diff --git a/nezha-fronted/src/assets/css/main.css b/nezha-fronted/src/assets/css/main.css index e12fbfa45..bf1f3331f 100644 --- a/nezha-fronted/src/assets/css/main.css +++ b/nezha-fronted/src/assets/css/main.css @@ -119,7 +119,7 @@ html { float: right; } .top-tools .top-tool-search { - width: 220px; + width: 320px; } .top-tools .el-button-group { float: left; @@ -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..bb66572bb 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,34 @@ 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', + type: 4 + }, + { + label: this.$t('alert.config.createAlertConfig'), + url: 'alertConfig', + type: 5 + } + ] } }, methods: { @@ -113,6 +156,31 @@ export default { } }); }, + createBox(item) { + this.jumpTo(item.url); + setTimeout(() =>{ + if (item.type == 1) { + if (this.projectData.length > 0) { + this.$store.commit('setProject', this.projectData[0]); + } + this.$store.commit('toCreateProject', true); + this.$store.commit('projectRightBoxShow', true); + } else if (item.type == 2) { + if (this.projectData.length > 0) { + this.$store.commit('setProject', this.projectData[0]); + } + this.$store.commit('toCreateModule', true); + } else if (item.type == 3) { + if (this.projectData.length > 0) { + this.$store.commit('setProject', this.projectData[0]); + } + this.$store.commit('toCreateEndpoint', true); + } else if (item.type == 5) { + this.$store.commit('projectRightBoxShow', false); + this.$store.commit('toCreateAlertConfig', true); + } + }, 120); + }, jumpToAsset(data, id) { this.$store.state.assetData.moduleData = data; this.$store.state.assetData.selectedData = id; @@ -141,9 +209,12 @@ export default { }) }, toEditProject(p) { - this.$store.commit('setProject', p); - this.$store.commit('projectRightBoxShow', true); this.jumpTo('project'); + setTimeout(() =>{ + this.$store.commit('setProject', p); + this.$store.commit('projectRightBoxShow', true); + }, 50); + } }, mounted() { @@ -151,7 +222,7 @@ export default { this.getProjectData(); }, computed: { - projectListReload() { + projectListReloadWatch() { return this.$store.state.projectListReload; } }, @@ -159,7 +230,7 @@ export default { projectListReloadWatch(n, o) { if (n) { this.getProjectData(); - this.$store.commit('projectListReload', false); + this.$store.commit('projectListReloadChange', false); } } } @@ -266,6 +337,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..28c62df9b 100644 --- a/nezha-fronted/src/components/common/language/en.js +++ b/nezha-fronted/src/components/common/language/en.js @@ -15,9 +15,20 @@ const en = { search: 'Search', add: "Add", option: "Option", - clearAll: "Clear All" + clearAll: "Clear All", + name: 'Name', + }, + search: { + searchTip: 'Press Enter or click to search' + }, + tip: { + confirmDelete: "Confirm Delete?", + yes: "Yes", + no: "No", + deleteSuccess: "Successfully Deleted" }, asset:{ + createAsset: "Create Asset", tableTitle: { id: 'ID', assetType: '资产类型', @@ -65,7 +76,8 @@ const en = { //侧滑框 promId: "Prometheus Server ID", createProm: "Create Prometheus Server", - editProm: "Edit Prometheus Server" + editProm: "Edit Prometheus Server", + type: "Type" }, }, alert: { @@ -86,9 +98,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 +108,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 +129,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 +155,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/common/searchInput.vue b/nezha-fronted/src/components/common/searchInput.vue new file mode 100644 index 000000000..5638832d1 --- /dev/null +++ b/nezha-fronted/src/components/common/searchInput.vue @@ -0,0 +1,1301 @@ + + + + + diff --git a/nezha-fronted/src/components/common/searchSelectInfo.vue b/nezha-fronted/src/components/common/searchSelectInfo.vue new file mode 100644 index 000000000..cdc9e2d2e --- /dev/null +++ b/nezha-fronted/src/components/common/searchSelectInfo.vue @@ -0,0 +1,44 @@ + diff --git a/nezha-fronted/src/components/page/alert/config.vue b/nezha-fronted/src/components/page/alert/config.vue index c5f0c8f83..2032a0428 100644 --- a/nezha-fronted/src/components/page/alert/config.vue +++ b/nezha-fronted/src/components/page/alert/config.vue @@ -2,6 +2,23 @@ .account { height: 100%; } + .right-box::-webkit-scrollbar-track { + -webkit-box-shadow: inset 0 0 5px rgba(0,0,0,0.2); + border-radius: 0; + background: rgba(0,0,0,0.1); + } + .right-box::-webkit-scrollbar-thumb { + border-radius: 5px; + -webkit-box-shadow: inset 0 0 5px rgba(0,0,0,0.2); + background: rgba(0,0,0,0.2); + } + .right-box::-webkit-scrollbar { + width: 4px; + height: 4px; + } + .right-box { + overflow: auto; + } .account-list-option { cursor: pointer; display: inline-block; @@ -31,16 +48,11 @@
- - - {{$t('overall.add')}} - - + + + {{$t('overall.add')}} + +
+ +  {{severityData[1].value}} + {{severityData[0].value}} +  {{severityData[2].value}} + + + + + {{scope.row[item.prop].name}} {{scope.row[item.prop]}} @@ -85,7 +106,7 @@ {{$t('overall.save')}} {{$t('overall.edit')}} -
+
@@ -100,6 +121,7 @@
+
{{$t('alert.config.name')}}
@@ -115,6 +137,52 @@
{{alertRule.alertName}}
+ +
+
{{$t('alert.list.type')}}
+
+ + + + +
{{item.value}}
+
+
+ +
+
{{$t('alert.config.link')}}
+
+ +
{{alertRule.linkObject.name}}
+ +
+
+
{{$t('alert.config.expr')}}
@@ -128,6 +196,7 @@
{{alertRule.expr}}
+
{{$t('alert.config.for')}}
@@ -137,23 +206,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 +249,7 @@
{{alertRule.summary}}
+
{{$t('alert.description')}}
@@ -180,6 +263,7 @@
{{alertRule.description}}
+
{{$t('config.account.receiver')}}
@@ -191,7 +275,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,9 +312,40 @@ diff --git a/nezha-fronted/src/components/page/alert/list.vue b/nezha-fronted/src/components/page/alert/list.vue index e90264a73..1403e8ef6 100644 --- a/nezha-fronted/src/components/page/alert/list.vue +++ b/nezha-fronted/src/components/page/alert/list.vue @@ -169,16 +169,7 @@
- - - {{$t('overall.add')}} - - +