Compare commits

..

1 Commits

Author SHA1 Message Date
Ewall555
0c85e0c683 feat: Add fields and metadata for Kubernetes platform in CloudCreateUpdate component 2025-11-13 17:00:03 +08:00
7 changed files with 44 additions and 16 deletions

View File

@@ -144,6 +144,11 @@ export default {
deep: true
}
},
mounted() {
if (!this.$store.getters.hasValidLicense) {
delete this.fields[3]
}
},
methods: {
handleAfterGetRemoteMeta(meta) {
const needSetOptionFields = [

View File

@@ -57,7 +57,6 @@ export default {
id: 'check',
name: this.$t('Check'),
icon: 'scan',
has: (node) => node?.meta?.type === 'asset',
callback: (node) => {
vm.detectDialog.asset = node.id
setTimeout(() => {

View File

@@ -10,7 +10,33 @@ export default {
components: { BaseAssetCreateUpdate },
data() {
return {
url: '/api/v1/assets/clouds/'
url: '/api/v1/assets/clouds/',
addFields: this.getAddFields(),
addFieldsMeta: this.getAddFieldsMeta()
}
},
methods: {
getAddFields() {
const platform = this.$route.query.type
const baseFields = []
if (platform === 'k8s') {
baseFields.push([this.$t('Basic'), ['namespace'], 1])
}
return baseFields
},
getAddFieldsMeta() {
const platform = this.$route.query.type
const fieldsMeta = {}
if (platform === 'k8s') {
fieldsMeta['namespace'] = {
label: this.$t('DefaultNamespace')
}
}
return fieldsMeta
}
}
}

View File

@@ -515,8 +515,6 @@ export default {
this.setBtn()
this.selectAssets = assets
this.selectNodes = nodes
}).catch(() => {
this.lastRequestPayload = null
})
},
viewConfirmRunAssets() {
@@ -527,8 +525,8 @@ export default {
.then(() => {
this.xterm.write(
'\x1b[31m' +
this.$tc('StopLogOutput').replace('currentTaskId', this.currentTaskId) +
'\x1b[0m'
this.$tc('StopLogOutput').replace('currentTaskId', this.currentTaskId) +
'\x1b[0m'
)
this.xterm.write(this.wrapperError(''))
this.getTaskStatus()

View File

@@ -441,7 +441,8 @@ export default {
this.xtermConfig = { taskId: this.currentTaskId, type: 'shortcut_cmd' }
this.setCostTimeInterval()
this.writeExecutionOutput()
}).catch(() => {
}).catch((error) => {
this.$message.error(this.$tc('Error'), error)
this.execute_stop()
})
})

View File

@@ -224,12 +224,11 @@ export default {
title: this.$t('ExecuteAfterSaving'),
callback: (value, form, btn) => {
form.value.run_after_save = true
if (form.value?.variable) {
form.value['parameters'] = form.value.variable.reduce((acc, item) => {
acc[item.var_name] = item.default_value || ''
return acc
}, {})
}
const parameters = form.value.variable.reduce((acc, item) => {
acc[item.var_name] = item.default_value || ''
return acc
}, {})
form.value['parameters'] = parameters
this.submitForm(form, btn)
}
}

View File

@@ -8570,9 +8570,9 @@ js-tokens@^3.0.2:
integrity sha512-RjTcuD4xjtthQkaWH7dFlH85L+QaVtSoOyGdZ3g6HFhS9dFNDfLyqgm2NFe2X6cQpeFmt0452FJjFG5UameExg==
js-yaml@^3.13.0, js-yaml@^3.13.1, js-yaml@^3.14.0, js-yaml@^3.7.0, js-yaml@^3.9.1:
version "3.14.2"
resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.14.2.tgz#77485ce1dd7f33c061fd1b16ecea23b55fcb04b0"
integrity sha512-PMSmkqxr106Xa156c2M265Z+FTrPl+oxd/rgOQy2tijQeK5TxQ43psO1ZCwhVOSdnn+RzkzlRz/eY4BgJBYVpg==
version "3.14.1"
resolved "https://registry.npmmirror.com/js-yaml/-/js-yaml-3.14.1.tgz#dae812fdb3825fa306609a8717383c50c36a0537"
integrity sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==
dependencies:
argparse "^1.0.7"
esprima "^4.0.0"