-
+
-
Select the namespace where the application will be installed
-
+
Select the namespace where the application will be installed
+
Select the namespace where the application will be uninstalled
+
+
+
+
+
+
-
Select the multi-cloud infrastructure information where the application will be deployed
-
+
+
+
Select the virtual machine (VM) within the chosen multi-cloud infrastructure where the application will be deployed
+
+
-
applications to install (e.g. nginx,tomcat,mariadb,redis,grafana,prometheus)
+
applications to install (e.g. nginx,tomcat,mariadb,redis,grafana,prometheus)
-
+
+
+
+
Select the namespace where the application will be installed
+
Select the namespace where the application will be uninstalled
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Select the name of the cluster where the application will be deployed
+
Remove the application and associated resources from the multi-cloud infrastructure
+
+
+
+
-
-
+
+
Helm Charts to Install (e.g. nginx,tomcat,mariadb,redis,grafana,prometheus)
+
@@ -53,7 +97,7 @@ import { ref } from 'vue';
import { useToast } from 'vue-toastification';
import { onMounted, watch, computed } from 'vue';
import axios from 'axios'
-import _ from 'lodash';
+import _, { slice } from 'lodash';
const splitUrl = window.location.host.split(':');
@@ -73,7 +117,11 @@ const modalType = ref("" as string)
const selectNsId = ref("" as string)
const nsIdList = ref([] as any)
const mciList = ref([] as any)
+const vmList = ref([] as any)
const selectMci = ref("" as string)
+const selectVm = ref("" as string)
+const clusterList = ref([] as any)
+const selectCluster = ref("" as string)
const inputApplications = ref("" as string)
watch(modalTitle, async () => {
popupTitle.value = changeTitle(props.title);
@@ -101,11 +149,20 @@ const _getNsId = async () => {
const response = await axios.get(baseUrl + '/cbtumblebug/ns');
nsIdList.value = response.data;
if(nsIdList.value.length > 0) {
- selectNsId.value = nsIdList.value[0].name
+ selectNsId.value = nsIdList.value[0].name;
+ if(modalType.value == 'vm_application_install' || modalType.value == 'vm_application_uninstall') {
+ await _getMciName()
+ } else {
+ await _getClusterName()
+ }
}
if(!_.isEmpty(selectNsId.value)) {
- await _getMciName();
+ if(modalType.value == 'vm_application_install' || modalType.value == 'vm_application_uninstall') {
+ await _getMciName()
+ } else {
+ await _getClusterName()
+ }
}
}
@@ -113,29 +170,90 @@ const _getMciName = async () => {
const response = await axios.get(baseUrl + '/cbtumblebug/ns/' + selectNsId.value + '/mci');
mciList.value = response.data;
if(mciList.value.length > 0) {
- selectMci.value = mciList.value[0].name
+ selectMci.value = mciList.value[0].name;
+ await _getVmName();
} else {
selectMci.value = "";
}
}
+const _getVmName = async () => {
+ const response = await axios.get(baseUrl + '/cbtumblebug/ns/' + selectNsId.value + '/mci/' + selectMci.value);
+ vmList.value = response.data.vm;
+ if(mciList.value.length > 0) {
+ selectVm.value = vmList.value[0].name;
+ } else {
+ selectVm.value = "";
+ }
+}
+
+const _getClusterName = async () => {
+ const response = await axios.get(baseUrl + '/cbtumblebug/ns/' + selectNsId.value + '/k8scluster');
+ clusterList.value = response.data;
+ if(clusterList.value.length > 0) {
+ selectCluster.value = clusterList.value[0].name;
+ } else {
+ selectCluster.value = "";
+ }
+}
+
const onChangeNsId = async () => {
await _getMciName();
}
+const onChangeMci = async () => {
+ await _getVmName();
+}
+
+const onSelectNamespace = async () =>{
+ await _getClusterName();
+}
+
const runInstall = async () => {
- if(modalType.value == 'vm_application_install') {
+ if(modalType.value == 'vm_application_install' || modalType.value == 'vm_application_uninstall') {
+ let runUrl = "";
+ if(modalType.value == 'vm_application_install') {
+ runUrl = "/ape/vm/install"
+ } else {
+ runUrl = "/ape/vm/uninstall"
+ }
+
const appList = inputApplications.value.split(",").map(item => item.trim());
const param = {
"namespace": selectNsId.value,
"mciName": selectMci.value,
+ "vmName": selectVm.value,
"applications": appList
}
- const res = await axios.post(baseUrl + '/ape/vm/install', param)
- if(res.data.message) {
+ const res = await axios.post(baseUrl + runUrl, param)
+ if(res.data.code == 200 && res.data.message) {
toast.success(res.data.message)
+ } else {
+ toast.error(res.data.message)
+ }
+ } else if(modalType.value == "helm_application_install" || modalType.value == "helm_application_uninstall") {
+ let runUrl = "";
+ if(modalType.value == 'helm_application_install') {
+ runUrl = "/ape/helm/install"
+ } else {
+ runUrl = "/ape/helm/uninstall"
}
+
+ const appList = inputApplications.value.split(",").map(item => item.trim());
+ const param = {
+ "namespace": selectNsId.value,
+ "clusterName": selectCluster.value,
+ "helmCharts": appList
+ }
+
+ const res = await axios.post(baseUrl + runUrl, param)
+ if(res.data.code == 200 && res.data.message) {
+ toast.success(res.data.message)
+ } else {
+ toast.error(res.data.message)
+ }
+
}
}
diff --git a/applicationFE/src/views/softwareCatalog/components/softwareCatalogLog.vue b/applicationFE/src/views/softwareCatalog/components/softwareCatalogLog.vue
index 2567ef8..d509606 100644
--- a/applicationFE/src/views/softwareCatalog/components/softwareCatalogLog.vue
+++ b/applicationFE/src/views/softwareCatalog/components/softwareCatalogLog.vue
@@ -61,7 +61,7 @@
const firstLoadData = ref(false as boolean)
const splitUrl = window.location.host.split(':');
const baseUrl = window.location.protocol + '//' + splitUrl[0] + ':18084'
-// const baseUrl = "http://210.217.178.130:18084";
+ // const baseUrl = "http://210.217.178.130:18084";
const jobName = computed(() => props.jobName);
watch(jobName, async () => {