Skip to content

Commit

Permalink
update UI File / UI Build file
Browse files Browse the repository at this point in the history
  • Loading branch information
Strato-YangSungHun committed Nov 7, 2024
1 parent 88dab4a commit 46db21b
Show file tree
Hide file tree
Showing 15 changed files with 57 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
<select
class="form-select"
id="infra"
v-model="selectInfra">
v-model="selectInfra"
@click="onChangeForm">
<option
v-for="infra in infraList"
:value=infra.value
Expand Down Expand Up @@ -103,7 +104,7 @@
<div class="mb-3">
<label class="form-label">Application</label>
<p class="text-muted">Select the application</p>
<select class="form-select" v-model="inputApplications">
<select class="form-select" v-model="inputApplications" @change="onChangeCatalog">
<option v-for="catalog in props.catalogList" :key="catalog">{{ catalog.catalogTitle }}</option>
</select>

Expand Down Expand Up @@ -181,7 +182,7 @@
<div class="mb-3">
<label class="form-label">Helm chart</label>
<p class="text-muted">Select the application</p>
<select class="form-select" v-model="inputApplications">
<select class="form-select" v-model="inputApplications" @change="onChangeCatalog">
<option v-for="catalog in props.catalogList" :key="catalog">{{ catalog.catalogTitle }}</option>
</select>
<!-- <input
Expand Down Expand Up @@ -281,15 +282,15 @@ const selectCluster = ref("" as string)
const inputApplications = ref("" as string)
const specCheckFlag = ref(true as boolean)
watch(inputApplications, async () => {
// TODO :: hpa 데이터 가져오는 API 필요
hpaData.value = {
hpaMinReplicas: 0,
hpaMaxReplicas: 0,
hpaCpuUtilization: 0,
hpaMemoryUtilization: 0
}
})
// watch(inputApplications, async () => {
// // TODO :: hpa 데이터 가져오는 API 필요
// hpaData.value = {
// hpaMinReplicas: 0,
// hpaMaxReplicas: 0,
// hpaCpuUtilization: 0,
// hpaMemoryUtilization: 0
// }
// })
watch(modalTitle, async () => {
popupTitle.value = changeTitle(props.title);
modalType.value = props.title;
Expand Down Expand Up @@ -379,14 +380,17 @@ const _getClusterName = async () => {
const onChangeNsId = async () => {
await _getMciName();
onChangeForm();
}
const onChangeMci = async () => {
await _getVmName();
onChangeForm();
}
const onSelectNamespace = async () =>{
await _getClusterName();
onChangeForm();
}
const runInstall = async () => {
Expand Down Expand Up @@ -472,25 +476,41 @@ const specCheckCallback = async () => {
let param = "";
if (selectInfra.value === 'VM') {
if (selectNsId.value === undefined || selectMci.value === undefined || selectVm.value === undefined || props.catalogIdx === undefined) {
console.log('inputApplications.value >> ', inputApplications.value)
if (selectNsId.value === undefined || selectMci.value === undefined || selectVm.value === undefined || selectedCatalogIdx.value === undefined) {
return null;
}
runUrl = "/applications/vm/check/application"
param = "?namespace=" + selectNsId.value + "&mciName=" + selectMci.value + "&vmName=" + selectVm.value + "&catalogId=" + props.catalogIdx
param = "?namespace=" + selectNsId.value + "&mciName=" + selectMci.value + "&vmName=" + selectVm.value + "&catalogId=" + selectedCatalogIdx.value
}
else if (selectInfra.value === 'K8S') {
if (selectNsId.value === undefined || selectCluster.value === undefined || props.catalogIdx === undefined) {
if (selectNsId.value === undefined || selectCluster.value === undefined || selectedCatalogIdx.value === undefined) {
toast.error('Please select all items')
return;
}
runUrl = "/applications/k8s/check/application"
param = "?namespace=" + selectNsId.value + "&clusterName=" + selectCluster.value + "&catalogId=" + props.catalogIdx
param = "?namespace=" + selectNsId.value + "&clusterName=" + selectCluster.value + "&catalogId=" + selectedCatalogIdx.value
}
result = await axios.get(baseUrl + runUrl + param)
return result;
}
const selectedCatalogIdx = ref(0 as number)
const onChangeCatalog = () => {
specCheckFlag.value = true
props.catalogList.forEach((catalogInfo) => {
if (inputApplications.value === catalogInfo.catalogTitle) {
selectedCatalogIdx.value = catalogInfo.catalogIdx
return
}
})
}
const onChangeForm = () => {
specCheckFlag.value = true
}
</script>
<style scoped>
.input-form {
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 46db21b

Please sign in to comment.