diff --git a/nezha-fronted/src/assets/css/main.css b/nezha-fronted/src/assets/css/main.css index a6cbc4588..a682eb488 100644 --- a/nezha-fronted/src/assets/css/main.css +++ b/nezha-fronted/src/assets/css/main.css @@ -33,29 +33,29 @@ html { width: 90%; } -.config-receiver-dropdown { +.config-dropdown { width: 550px; } -.config-receiver-dropdown-btn { +.config-dropdown-btn { display: inline-block; margin-left: 7px; float: right; color: #60BEFF; font-size: 13px } -.config-receiver-dropdown-btn:hover { +.config-dropdown-btn:hover { color: #409EFF; } -.config-receiver-dropdown-btn-delete { +.config-dropdown-btn-delete { color: #F98D9A; font-size: 13px } -.config-receiver-dropdown-btn-delete:hover { +.config-dropdown-btn-delete:hover { color: #D96D7A; } -.config-receiver-dropdown.is-multiple .el-select-dropdown__item.selected::after { +.config-dropdown.is-multiple .el-select-dropdown__item.selected::after { content: "" !important; } -.config-receiver-dropdown-error-message { +.config-dropdown-error-message { color: #F98D9A; } diff --git a/nezha-fronted/src/components/common/header.vue b/nezha-fronted/src/components/common/header.vue index c840b9da4..c3f3915b2 100644 --- a/nezha-fronted/src/components/common/header.vue +++ b/nezha-fronted/src/components/common/header.vue @@ -27,10 +27,21 @@ - + + + + +
{{$t('config.account.account')}}
+
+ +
Prometheus Server
+
@@ -80,7 +91,8 @@ export default { }, methods: { jumpTo(data,id) { - this.$store.state.assetSelect = id + this.$store.state.assetData.moduleData = data + this.$store.state.assetData.selectedData = id this.$router.push({ path: "/" + data, query: { @@ -203,4 +215,4 @@ export default { .header-name-jiantou { position: static !important; } - \ No newline at end of file + diff --git a/nezha-fronted/src/components/common/language/cn.js b/nezha-fronted/src/components/common/language/cn.js index 2814d025f..dfbb06b58 100644 --- a/nezha-fronted/src/components/common/language/cn.js +++ b/nezha-fronted/src/components/common/language/cn.js @@ -4,6 +4,7 @@ const cn = { dashboard:'仪表盘', project:'工程', asset:'资产', + config:'设置', create: '新增', edit: '修改', delete: '删除', @@ -51,7 +52,13 @@ const cn = { createAccount: "新增用户", editAccount: "修改用户", notCurrentlySupport: '暂不支持' - } + }, + promServer: { + //侧滑框 + promId: "Prometheus Server ID", + createProm: "新增Prometheus Server", + editProm: "修改Prometheus Server" + }, }, ...zhLocale } diff --git a/nezha-fronted/src/components/common/language/en.js b/nezha-fronted/src/components/common/language/en.js index 0883a00e8..4f49fc32a 100644 --- a/nezha-fronted/src/components/common/language/en.js +++ b/nezha-fronted/src/components/common/language/en.js @@ -4,6 +4,7 @@ const en = { dashboard:'dashboard', project:'project', asset:'asset', + config:'config', create: 'Create', edit: 'Edit', delete: 'Delete', @@ -51,7 +52,13 @@ const en = { createAccount: "Create Account", editAccount: "Edit Account", notCurrentlySupport: 'Not currently supported' - } + }, + promServer: { + //侧滑框 + promId: "Prometheus Server ID", + createProm: "Create Prometheus Server", + editProm: "Edit Prometheus Server" + }, }, ...enLocale } diff --git a/nezha-fronted/src/components/common/sideBar.vue b/nezha-fronted/src/components/common/sideBar.vue index b10375c7d..78d8e5782 100644 --- a/nezha-fronted/src/components/common/sideBar.vue +++ b/nezha-fronted/src/components/common/sideBar.vue @@ -1,85 +1,94 @@ \ No newline at end of file + } + diff --git a/nezha-fronted/src/components/page/config/account.vue b/nezha-fronted/src/components/page/config/account.vue index f80ee4d54..96d3d7fef 100644 --- a/nezha-fronted/src/components/page/config/account.vue +++ b/nezha-fronted/src/components/page/config/account.vue @@ -136,7 +136,7 @@ cursor: pointer; width: 100%; } - .config-receiver-dropdown-label-input { + .config-dropdown-label-input { width: 50%; display: inline-block; } @@ -219,7 +219,7 @@
-
+
@@ -278,27 +278,27 @@
{{$t('config.account.receiver')}}
- + - {{item.name}} - + {{item.name}} + - {{item.errorMessage}} - + {{item.errorMessage}} + - +
@@ -339,7 +339,7 @@
-
{{$t('overall.cancel')}}
{{user.userId == '' ? $t('overall.create') : $t('overall.save')}}
+
{{$t('overall.cancel')}}
{{user.userId == '' ? $t('overall.create') : $t('overall.save')}}
@@ -662,32 +662,26 @@ export default { }], receiverData: [{ id: '1', - isEdit: false, name: 'group1', description: '小组1desc' }, { id: '2', - isEdit: false, name: 'group2', description: '小组2desc' }, { id: '3', - isEdit: false, name: '小组3', description: '小组3desc' }, { id: '4', - isEdit: false, name: '小组4', description: '小组4desc' }, { id: '5', - isEdit: false, name: '小组啊小组5', description: '小组5desc' }, { id: '6', - isEdit: false, name: '小组6', description: '小组6desc' }] @@ -697,7 +691,7 @@ export default { edit: function(u) { this.user = Object.assign({}, u); this.rightBox.isEdit = true; - this.rightBox.title = this.$t("config.account.editAccount") + " ID:" + u.id; + this.rightBox.title = this.$t("config.account.editAccount") + " ID:" + u.userId; this.rightBox.show = true; }, del: function(u) { @@ -705,7 +699,7 @@ export default { detail: function(u) { this.user = Object.assign({}, u); this.rightBox.isEdit = false; - this.rightBox.title = this.$t("config.account.account") + " ID:" + u.id; + this.rightBox.title = this.$t("config.account.account") + " ID:" + u.userId; this.rightBox.show = true; }, add: function() { @@ -717,7 +711,7 @@ export default { saveOrToEdit: function() { if (!this.rightBox.isEdit) { this.rightBox.isEdit = true; - this.rightBox.title = this.$t("config.account.editAccount") + " ID:" + this.user.id; + this.rightBox.title = this.$t("config.account.editAccount") + " ID:" + this.user.userId; } }, toEditReceiver: function(item) { @@ -751,9 +745,10 @@ export default { this.blurEditReceiver(); //TODO 请求后台,删除组 }, - setOldNameForReceiver: function() { + initReceiverData: function() { for (var i = 0; i < this.receiverData.length; i++) { this.$set(this.receiverData[i], 'oldName', this.receiverData[i].name); + this.$set(this.receiverData[i], 'isEdit', false); } }, esc: function() { @@ -780,13 +775,10 @@ export default { receiver: [], lang: 'en' } - }, - getUserById: function(userId) { - } }, mounted() { - this.setOldNameForReceiver(); + this.initReceiverData(); } } diff --git a/nezha-fronted/src/components/page/config/promServer.vue b/nezha-fronted/src/components/page/config/promServer.vue new file mode 100644 index 000000000..30c9b4e6b --- /dev/null +++ b/nezha-fronted/src/components/page/config/promServer.vue @@ -0,0 +1,470 @@ + + + diff --git a/nezha-fronted/src/router/index.js b/nezha-fronted/src/router/index.js index dcdb03c6e..0fc1ea281 100644 --- a/nezha-fronted/src/router/index.js +++ b/nezha-fronted/src/router/index.js @@ -30,8 +30,12 @@ export default new Router({ component: resolve => require(['../components/page/asset/asset.vue'], resolve), }, { - path: '/alarm', + path: '/account', component: resolve => require(['../components/page/config/account.vue'], resolve), + }, + { + path: '/promServer', + component: resolve => require(['../components/page/config/promServer.vue'], resolve), } ] }, diff --git a/nezha-fronted/src/store/index.js b/nezha-fronted/src/store/index.js index 49d402747..ec011bc1c 100644 --- a/nezha-fronted/src/store/index.js +++ b/nezha-fronted/src/store/index.js @@ -4,7 +4,10 @@ import Vuex from 'vuex' Vue.use(Vuex) const store = new Vuex.Store({ state: { - assetSelect:'' + assetData:{ + selectedData:'', + moduleData:'', + } }, getters: { },