diff --git a/nezha-fronted/src/assets/css/main.css b/nezha-fronted/src/assets/css/main.css index e12fbfa45..d555c8f08 100644 --- a/nezha-fronted/src/assets/css/main.css +++ b/nezha-fronted/src/assets/css/main.css @@ -361,7 +361,7 @@ html { /* end--endpoint->子弹框asset搜索框前缀和后缀*/ /* begin--自定义可编辑的el-select下拉框样式*/ .config-dropdown { - width: 550px; + width: 520px; } .config-dropdown-btn { display: inline-block; diff --git a/nezha-fronted/src/components/common/header.vue b/nezha-fronted/src/components/common/header.vue index 7876e0637..6ecc14344 100644 --- a/nezha-fronted/src/components/common/header.vue +++ b/nezha-fronted/src/components/common/header.vue @@ -1,12 +1,28 @@ @@ -39,10 +55,10 @@ - +
{{$t('alert.alertList')}}
- +
{{$t('alert.alertConfig')}}
@@ -50,10 +66,10 @@ - +
{{$t('config.account.account')}}
- +
{{$t('config.promServer.promServerList')}}
@@ -101,7 +117,32 @@ export default { return { language: localStorage.getItem("language"), assetData: [], - projectData: [] + projectData: [], + createMenu: [ + { + label: this.$t('project.project.createProject'), + url: 'project', + type: 1 + }, + { + label: this.$t('project.module.createModule'), + url: 'project', + type: 2 + }, + { + label: this.$t('project.endpoint.createEndpoint'), + url: 'project', + type: 3 + }, + { + label: this.$t('asset.createAsset'), + url: 'asset' + }, + { + label: this.$t('alert.config.createAlertConfig'), + url: 'alertConfig' + } + ] } }, methods: { @@ -112,6 +153,9 @@ export default { t: +new Date() } }); + }, + createBox(item) { + }, jumpToAsset(data, id) { this.$store.state.assetData.moduleData = data; @@ -151,7 +195,7 @@ export default { this.getProjectData(); }, computed: { - projectListReload() { + projectListReloadWatch() { return this.$store.state.projectListReload; } }, @@ -159,7 +203,7 @@ export default { projectListReloadWatch(n, o) { if (n) { this.getProjectData(); - this.$store.commit('projectListReload', false); + this.$store.commit('projectListReloadChange', false); } } } @@ -266,6 +310,20 @@ export default { .header-name-jiantou { position: static !important; } +.el-menu-demo>li:first-of-type { + position: fixed; + left: 40%; + top: 0; +} +.menu-create { + line-height: 15px; + text-align: center; + padding-top: 15px; +} +.menu-create .el-icon-plus { + font-size: 12px; + line-height: 12px; +} .menu-edit { line-height: 36px; float: right; diff --git a/nezha-fronted/src/components/common/language/en.js b/nezha-fronted/src/components/common/language/en.js index 67790d7c0..a45b1626a 100644 --- a/nezha-fronted/src/components/common/language/en.js +++ b/nezha-fronted/src/components/common/language/en.js @@ -15,9 +15,16 @@ const en = { search: 'Search', add: "Add", option: "Option", - clearAll: "Clear All" + clearAll: "Clear All", + }, + tip: { + confirmDelete: "Confirm Delete?", + yes: "Yes", + no: "No", + deleteSuccess: "Successfully Deleted" }, asset:{ + createAsset: "Create Asset", tableTitle: { id: 'ID', assetType: '资产类型', @@ -65,7 +72,8 @@ const en = { //侧滑框 promId: "Prometheus Server ID", createProm: "Create Prometheus Server", - editProm: "Edit Prometheus Server" + editProm: "Edit Prometheus Server", + type: "Type" }, }, alert: { @@ -86,9 +94,9 @@ const en = { charts: "Charts", //表内容 - projectalert: "Project Alert", - modulealert: "Module Alert", - devicealert: "Device Alert", + projectAlert: "Project Alert", + moduleAlert: "Module Alert", + deviceAlert: "Device Alert", pending: "Pending", expired: "Expired" }, @@ -96,11 +104,20 @@ const en = { name: "Name", receiver: "Receiver", expr: "Expr", - for: "For", + for: "For (s)", + link: 'Link', option: "Option", alertConfig: "Alert Config", - createalertConfig: "Create Alert Config", - editalertConfig: "Edit Alert Config", + createAlertConfig: "Create Alert Config", + editAlertConfig: "Edit Alert Config", + medium: "Medium", + high: "High", + low: "Low", + typeOption: { + project: 'Project', + module: 'Module', + asset: 'Asset' + } } }, project: { @@ -108,13 +125,15 @@ const en = { project: "Project", projectName: "Project Name", editProject: "Edit Project", - description: "Description" + description: "Description", + createProject: "Create Project" }, module: { module: "Module", moduleName: "Module Name", editModule: "Edit Module", description: "Description", + createModule: "Create Module", tip: { defaultEndpointSet: "Default Endpoint Set", relation: "Endpoints associated with Module will reference Port/Path/Param/Params by default" @@ -132,7 +151,12 @@ const en = { asset: "Asset", lastUpdate: "Last Update", }, - metrics: "Metrics" + metrics: { + metrics: "Metrics", + name: 'name', + type: 'Type', + description: 'Desc' + } }, ...enLocale } diff --git a/nezha-fronted/src/components/page/alert/config.vue b/nezha-fronted/src/components/page/alert/config.vue index c5f0c8f83..c6cdb1fcc 100644 --- a/nezha-fronted/src/components/page/alert/config.vue +++ b/nezha-fronted/src/components/page/alert/config.vue @@ -59,8 +59,17 @@ + +  {{severityData[1].value}} + {{severityData[0].value}} +  {{severityData[2].value}} + + + + + {{scope.row[item.prop].name}} {{scope.row[item.prop]}} @@ -85,7 +94,7 @@ {{$t('overall.save')}} {{$t('overall.edit')}} -
+
@@ -100,6 +109,7 @@
+
{{$t('alert.config.name')}}
@@ -115,6 +125,52 @@
{{alertRule.alertName}}
+ +
+
{{$t('alert.list.type')}}
+
+ + + + +
{{item.value}}
+
+
+ +
+
{{$t('alert.config.link')}}
+
+ +
{{alertRule.linkObject.name}}
+ +
+
+
{{$t('alert.config.expr')}}
@@ -128,6 +184,7 @@
{{alertRule.expr}}
+
{{$t('alert.config.for')}}
@@ -137,23 +194,36 @@ placeholder="" v-model="alertRule.last" size="small" - > + > + +
{{alertRule.last}}s
+
{{$t('alert.severity')}}
- -
{{alertRule.severity}}
+ + + {{item.value}} + + + + + +
{{alertRule.severity}}
+
{{$t('alert.summary')}}
@@ -167,6 +237,7 @@
{{alertRule.summary}}
+
{{$t('alert.description')}}
@@ -180,6 +251,7 @@
{{alertRule.description}}
+
{{$t('config.account.receiver')}}
@@ -191,7 +263,7 @@ :label="item.name" :value="item"> {{item.name}} - +
-
{{$t('overall.cancel')}}
{{alertRule.id == '' ? $t('overall.create') : $t('overall.save')}}
+
{{$t('overall.cancel')}}
{{alertRule.id == '' ? $t('overall.create') : $t('overall.save')}}
@@ -228,7 +300,7 @@