diff --git a/nezha-fronted/package.json b/nezha-fronted/package.json index 9073baa7a..72628e518 100644 --- a/nezha-fronted/package.json +++ b/nezha-fronted/package.json @@ -5,7 +5,7 @@ "author": "", "private": true, "scripts": { - "dev": "node --max-old-space-size=6000 ./node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --progress --config build/webpack.dev.conf.js", + "dev": "node --max-old-space-size=10240 ./node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --progress --config build/webpack.dev.conf.js", "start": "npm run dev", "build": "node build/build.js", "lint": "eslint --fix --ext .js,.vue src" diff --git a/nezha-fronted/src/components/common/bottomBox/bottomBox.vue b/nezha-fronted/src/components/common/bottomBox/bottomBox.vue index 632bb4200..fe74149b4 100644 --- a/nezha-fronted/src/components/common/bottomBox/bottomBox.vue +++ b/nezha-fronted/src/components/common/bottomBox/bottomBox.vue @@ -20,6 +20,7 @@
+ @@ -172,11 +173,18 @@ export default { dc: { cabinet: [ { prop: 'cabinet', name: this.$t('config.dc.cabinets'), active: true }, - { prop: 'asset', name: this.$t('asset.assets'), active: false } + { prop: 'asset', name: this.$t('asset.assets'), active: false }, + { prop: 'alertMessageTab', name: this.$t('overall.alert'), active: false } ], asset: [ { prop: 'cabinet', name: this.$t('config.dc.cabinets'), active: false }, - { prop: 'asset', name: this.$t('asset.assets'), active: true } + { prop: 'asset', name: this.$t('asset.assets'), active: true }, + { prop: 'alertMessageTab', name: this.$t('overall.alert'), active: false } + ], + alertMessage: [ + { prop: 'cabinet', name: this.$t('config.dc.cabinets'), active: false }, + { prop: 'asset', name: this.$t('asset.assets'), active: false }, + { prop: 'alertMessageTab', name: this.$t('overall.alert'), active: true } ] } diff --git a/nezha-fronted/src/components/common/language/en.js b/nezha-fronted/src/components/common/language/en.js index 640dda90b..fcab68c50 100644 --- a/nezha-fronted/src/components/common/language/en.js +++ b/nezha-fronted/src/components/common/language/en.js @@ -210,7 +210,7 @@ const en = { panelId: 'ID' // ID }, // 图表-侧滑框 - createChartTitle: 'New chart', // "新增图表" + createChartTitle: 'New Chart Template', // "新增图表" editChartTitle: 'Edit', // "编辑图表" chartForm: { chartId: 'ID', @@ -677,6 +677,7 @@ const en = { type: 'Type', // "类别" checkTime: 'Check time', dataCenter: 'Data center', + name : 'Name', agent: { agent: 'Agent', title: 'Download agent', diff --git a/nezha-fronted/src/components/common/rightBox/agentBox.vue b/nezha-fronted/src/components/common/rightBox/agentBox.vue index ca96dc14b..abe450ca1 100644 --- a/nezha-fronted/src/components/common/rightBox/agentBox.vue +++ b/nezha-fronted/src/components/common/rightBox/agentBox.vue @@ -2,7 +2,7 @@
-
{{editPromServer.id ? ($t("config.promServer.editProm") + " ID:" + editPromServer.id) : $t("config.promServer.createProm")}}
+
{{editPromServer.id ? ($t("config.agent.editProm") + " ID:" + editPromServer.id) : $t("config.agent.createProm")}}
@@ -11,9 +11,9 @@
- + - +
@@ -32,14 +32,14 @@ - + - + @@ -77,7 +77,7 @@ import { agent2 } from '@/components/common/js/constants' export default { name: 'agentBox', props: { - promServer: Object + agent: Object }, data () { return { @@ -127,11 +127,11 @@ export default { }, /* 保存 */ save () { - this.$refs.promServerForm.validate(valid => { + this.$refs.agentForm.validate(valid => { if (valid) { this.prevent_opt.save = true if (this.editPromServer.id) { - this.$put('promServer', this.editPromServer).then(response => { + this.$put('agent', this.editPromServer).then(response => { if (response.code === 200) { this.$message({ duration: 1000, type: 'success', message: this.$t('tip.saveSuccess') }) this.esc(true) @@ -141,7 +141,7 @@ export default { this.prevent_opt.save = false }) } else { - this.$post('promServer', this.editPromServer).then(response => { + this.$post('agent', this.editPromServer).then(response => { if (response.code === 200) { this.$message({ duration: 1000, type: 'success', message: this.$t('tip.saveSuccess') }) this.esc(true) @@ -163,7 +163,7 @@ export default { cancelButtonText: this.$t('tip.no'), type: 'warning' }).then(() => { - this.$delete('promServer?ids=' + this.editPromServer.id).then(response => { + this.$delete('agent?ids=' + this.editPromServer.id).then(response => { if (response.code === 200) { this.$message({ duration: 1000, type: 'success', message: this.$t('tip.deleteSuccess') }) this.esc(true) @@ -184,7 +184,7 @@ export default { }, watch: { // 将prop里的user转为组件内部对象 - promServer: { + agent: { immediate: true, deep: true, handler (n) { diff --git a/nezha-fronted/src/components/common/rightBox/assetMetaBox.vue b/nezha-fronted/src/components/common/rightBox/assetMetaBox.vue index a9f80bfa5..95989f44c 100644 --- a/nezha-fronted/src/components/common/rightBox/assetMetaBox.vue +++ b/nezha-fronted/src/components/common/rightBox/assetMetaBox.vue @@ -30,20 +30,20 @@ @change="switchSearch" v-model="editAssetMeta.search" active-color="#ee9d3f" - :active-value="1" - :inactive-value="0"> + active-value="1" + inactive-value="0"> + active-value="1" + inactive-value="0"> - +
  {{item.name}}
@@ -160,8 +160,8 @@ export default { id: '', name: '' }, - search: 1, - display: 1, + search: '0', + display: '0', type: '', param: {}, remark: '' @@ -246,21 +246,23 @@ export default { assetLabel: { immediate: true, handler (n) { - this.editAssetMeta = { ...n } + this.editAssetMeta = { ...n, search: `${n.search}`, display: `${n.display}` } this.selectType(n.type, true) } } }, mounted () { this.getGroupData() - this.switchSearch() + this.switchSearch('0') }, methods: { switchSearch(value){ this.typeData.forEach(element => { - if( value === 0 ) { + if( value == 0 ) { element.disabled = false - }else { + console.log(value); + }else if(value == 1) { + console.log(value); if(element.value == 'radio'){ element.disabled = false }else if(element.value == 'checkbox'){ @@ -268,6 +270,8 @@ export default { }else if(element.value == 'select'){ element.disabled = false } + }else { + return console.log('不为0,也不为1'); } }) }, diff --git a/nezha-fronted/src/components/common/rightBox/cabinetBox.vue b/nezha-fronted/src/components/common/rightBox/cabinetBox.vue index 1d5be8340..586f1fbbd 100644 --- a/nezha-fronted/src/components/common/rightBox/cabinetBox.vue +++ b/nezha-fronted/src/components/common/rightBox/cabinetBox.vue @@ -113,7 +113,7 @@ export default { cancelButtonText: this.$t('tip.no'), type: 'warning' }).then(() => { - this.$delete('/cabinet?ids=' + this.editCabinet.id).then(response => { + this.$delete('dc/cabinet?ids=' + this.editCabinet.id).then(response => { this.prevent_opt.save = false if (response.code == 200) { this.$message({ duration: 2000, type: 'success', message: this.$t('tip.saveSuccess') }) diff --git a/nezha-fronted/src/components/common/rightBox/setting/cabinetBox.vue b/nezha-fronted/src/components/common/rightBox/setting/cabinetBox.vue index 33ba9a665..5ffd65699 100644 --- a/nezha-fronted/src/components/common/rightBox/setting/cabinetBox.vue +++ b/nezha-fronted/src/components/common/rightBox/setting/cabinetBox.vue @@ -105,7 +105,7 @@ export default { cancelButtonText: this.$t('tip.no'), type: 'warning' }).then(() => { - this.$delete('/cabinet?ids=' + this.editCabinet.id).then(response => { + this.$delete('dc/cabinet?ids=' + this.editCabinet.id).then(response => { this.prevent_opt.save = false if (response.code == 200) { this.$message({ duration: 2000, type: 'success', message: this.$t('tip.saveSuccess') }) diff --git a/nezha-fronted/src/components/common/table/settings/agentTable.vue b/nezha-fronted/src/components/common/table/settings/agentTable.vue index 786e35d36..1963813f9 100644 --- a/nezha-fronted/src/components/common/table/settings/agentTable.vue +++ b/nezha-fronted/src/components/common/table/settings/agentTable.vue @@ -86,7 +86,7 @@ export default { show: true, width: 80 }, { - label: this.$t('config.dc.dc'), + label: this.$t('config.agent.name'), prop: 'dc', show: true }, { diff --git a/nezha-fronted/src/components/common/table/settings/dcTable.vue b/nezha-fronted/src/components/common/table/settings/dcTable.vue index 5d43f5055..ac3171c96 100644 --- a/nezha-fronted/src/components/common/table/settings/dcTable.vue +++ b/nezha-fronted/src/components/common/table/settings/dcTable.vue @@ -61,12 +61,12 @@