diff --git a/nezha-fronted/src/assets/css/main.css b/nezha-fronted/src/assets/css/main.css index f1153c45f..58291f8cf 100644 --- a/nezha-fronted/src/assets/css/main.css +++ b/nezha-fronted/src/assets/css/main.css @@ -12,6 +12,31 @@ html { .content-box { height: 100%; } +/*通用*/ +.margin-l-5 { + margin-left: 5px !important; +} +.margin-r-5 { + margin-right: 5px !important; +} +.margin-t-5 { + margin-top: 5px !important; +} +.margin-b-5 { + margin-bottom: 5px !important; +} +.margin-l-10 { + margin-left: 10px !important; +} +.margin-r-10 { + margin-right: 10px !important; +} +.margin-t-10 { + margin-top: 10px !important; +} +.margin-b-10 { + margin-bottom: 10px !important; +} /*侧滑文字*/ .el-form-item .el-form-item__label{ font-size: 10px; @@ -27,6 +52,126 @@ html { width: 90%; } +/* begin--左侧列表*/ +.content-left { + float: left; + width: 322px; + height: 100%; + background-color: #eeeeee; + border-right: 1px solid #dadada; + padding: 0 12px 0 11px; + box-sizing: border-box; + font-size: 14px; +} +.sidebar-title { + padding: 20px 0 0 15px; + color: #5e5e5e; +} +.sidebar-info { + margin-top: 27px; + border: 1px solid #cacaca; + border-radius: 6px; + height: calc(90vh - 55px); + width: 100%; +} +.sidebar-info-top { + border-radius: 6px 6px 0 0; +} +.sidebar-info-item { +height: 39px; +line-height: 39px; +padding: 0 8px 0 32px; +border-bottom: 1px solid #cacaca; +cursor: pointer; +color: #5e5e5e; +} +.sidebar-info-item-active { +background-color: #5e5e5e; +color: white; +} +.sidebar-info-foot { + border-radius: 6px 6px 0 0; +} +/* end--左侧列表*/ + +/* begin--右侧内容*/ + /* begin--顶部工具栏*/ +.top-tools { + padding: 22px 0 13px 0; +} +.top-tools .el-button--mini { + padding-top: 6px; + padding-bottom: 6px; +} +.top-tools .top-tool { + float: left; +} +.top-tools .top-tool-right { + float: right; +} +.top-tools .top-tool-search { + width: 220px; +} +.top-tools .el-button-group { + float: left; +} +.top-tools .top-tool-btn { + border-radius: 5px; + width: 100px; +} +.top-tools .top-tool-btn:focus, .top-tools .top-tool-btn:hover { + color: #606266; + background-color: white; +} +.top-tools .top-tool-btn-active { + color: white; + background-color: #656565; +} +.top-tools .top-tool-btn-active:focus, .top-tools .top-tool-btn-active:hover { + color: white; + background-color: #656565; +} +.top-tools .top-tool-btn-txt { + font-size: 14px; +} + /* end--顶部工具栏*/ + /* start--内容*/ +.content-right>.el-table{ + border-radius: 4px; + border: 1px solid #D7D7D7; + margin-top: 30px; +} +.content-right { + height: calc(100% - 131px); + margin-left: 322px; + padding: 0 15px 0 25px; +} + /* end--内容*/ + /* start--分页*/ +.pagination { + padding-top: 18px; + text-align: center; +} + /* end--分页*/ + /* begin--右弹框滑入滑出动画*/ +@keyframes slide-in-from-right { + from {right: -800px} + to {right: 0} +} +@keyframes slide-out-to-right { + from {right: 0} + to {right: -800px} +} +.right-box-enter-active { + animation: slide-in-from-right 0.4s; +} +.right-box-leave-active { + animation: slide-out-to-right 0.4s; +} + /* end--右弹框滑入滑出动画*/ +/* end--右侧内容*/ + +/* start--自定义可编辑的el-select下拉框样式*/ .config-dropdown { width: 550px; } @@ -53,3 +198,4 @@ html { .config-dropdown-error-message { color: #F98D9A; } +/* end--自定义可编辑的el-select下拉框样式*/ diff --git a/nezha-fronted/src/components/common/header.vue b/nezha-fronted/src/components/common/header.vue index 932d0931b..fb2893d07 100644 --- a/nezha-fronted/src/components/common/header.vue +++ b/nezha-fronted/src/components/common/header.vue @@ -29,13 +29,13 @@ -
{{$t('alarm.alarmList')}}
+
{{$t('alert.alertList')}}
-
{{$t('alarm.alarmConfig')}}
+
{{$t('alert.alertConfig')}}
diff --git a/nezha-fronted/src/components/common/language/cn.js b/nezha-fronted/src/components/common/language/cn.js index 8ca1c7fcf..8396fba6c 100644 --- a/nezha-fronted/src/components/common/language/cn.js +++ b/nezha-fronted/src/components/common/language/cn.js @@ -3,7 +3,7 @@ const cn = { overall: { dashboard: '仪表盘', project: '工程', - alarm: "告警", + alert: "告警", asset: '资产', config: '设置', create: '新增', @@ -12,7 +12,9 @@ const cn = { esc: '取消', cancel: '取消', save: '保存', - search: '搜索' + search: '搜索', + add: '新增', + option: "操作" }, asset: { tableTitle: { @@ -22,7 +24,7 @@ const cn = { ip: 'IP', assetState: '资产状态', module: 'Module', - alarm: 'Alarm', + alert: 'alert', dataCenter: '数据中心', cabinet: '机柜', model: '型号', @@ -36,7 +38,7 @@ const cn = { projectName: '项目名称', moduleName: 'Module Name', endPoint: 'EndPoint', - alarm: 'Alarm', + alert: 'alert', }, }, config: { @@ -62,11 +64,12 @@ const cn = { editProm: "修改Prometheus Server" }, }, - alarm: { - alarmList: "告警列表", - alarmConfig: "告警设置", + alert: { + alert: "告警", + alertList: "告警列表", + alertConfig: "告警设置", list: { - alarmName: "告警名称", + alertName: "告警名称", linkedId: "关联ID", severity: "告警级别", type: "类型", @@ -78,13 +81,26 @@ const cn = { charts: "图表", //表内容 - projectAlarm: "Project Alarm", - moduleAlarm: "Module Alarm", - deviceAlarm: "Device Alarm", + projectalert: "Project Alert", + modulealert: "Module Alert", + devicealert: "Device Alert", pending: "Pending", expired: "Expired" } }, + project: { + endpoint: { + endpoint: "Endpoint", + endpointId: "Endpoint ID", + host: "Host", + port: "Port", + param: "Param", + path: "Path", + asset: "Asset", + lastUpdate: "Last Update", + }, + metrics: "Metrics", + }, ...zhLocale } diff --git a/nezha-fronted/src/components/common/language/en.js b/nezha-fronted/src/components/common/language/en.js index dc122dd34..575f2beeb 100644 --- a/nezha-fronted/src/components/common/language/en.js +++ b/nezha-fronted/src/components/common/language/en.js @@ -3,7 +3,7 @@ const en = { overall:{ dashboard:'dashboard', project:'project', - alarm: "alarm", + alert: "alert", asset:'asset', config:'config', create: 'Create', @@ -12,7 +12,9 @@ const en = { esc: 'Esc', cancel: 'Cancel', save: 'Save', - search: 'Search' + search: 'Search', + add: "Add", + option: "Option" }, asset:{ tableTitle: { @@ -22,7 +24,7 @@ const en = { ip: 'IP', assetState: '资产状态', module: 'Module', - alarm: 'Alarm', + alert: 'alert', dataCenter: '数据中心', cabinet: '机柜', model: '型号', @@ -36,11 +38,13 @@ const en = { projectName: '项目名称', moduleName: 'Module Name', endPoint: 'EndPoint', - alarm: 'Alarm', + alert: 'alert', }, }, config: { + config: "Config", account: { + accountList: "Account List", //列表表头 account: "Account", language: "Language", @@ -56,16 +60,18 @@ const en = { notCurrentlySupport: 'Not currently supported' }, promServer: { + promServerList: "Prometheus Server", //侧滑框 promId: "Prometheus Server ID", createProm: "Create Prometheus Server", editProm: "Edit Prometheus Server" }, }, - alarm: { - alarmList: "Alarm List", - alarmConfig: "Alarm Config", - alarmName: "Alarm Name", + alert: { + alert: "Alert", + alertList: "Alert List", + alertConfig: "Alert Config", + alertName: "Alert Name", severity: "Severity", description: "Desc", summary: "Summary", @@ -79,9 +85,9 @@ const en = { charts: "Charts", //表内容 - projectAlarm: "Project Alarm", - moduleAlarm: "Module Alarm", - deviceAlarm: "Device Alarm", + projectalert: "Project Alert", + modulealert: "Module Alert", + devicealert: "Device Alert", pending: "Pending", expired: "Expired" }, @@ -91,11 +97,26 @@ const en = { expr: "Expr", for: "For", option: "Option", - alarmConfig: "Alarm Config", - createAlarmConfig: "Create Alarm Config", - editAlarmConfig: "Edit Alarm Config", + alertConfig: "Alert Config", + createalertConfig: "Create Alert Config", + editalertConfig: "Edit Alert Config", } }, + project: { + endpoint: { + createEndpoint: "Create Endpoint", + editEndpoint: "Edit Endpoint", + endpoint: "Endpoint", + endpointId: "Endpoint ID", + host: "Host", + port: "Port", + param: "Param", + path: "Path", + asset: "Asset", + lastUpdate: "Last Update", + }, + metrics: "Metrics" + }, ...enLocale } diff --git a/nezha-fronted/src/components/common/pagination.vue b/nezha-fronted/src/components/common/pagination.vue index 18e59c76e..bc6052c46 100644 --- a/nezha-fronted/src/components/common/pagination.vue +++ b/nezha-fronted/src/components/common/pagination.vue @@ -55,10 +55,4 @@ export default { diff --git a/nezha-fronted/src/components/page/alarm/config.vue b/nezha-fronted/src/components/page/alert/config.vue similarity index 84% rename from nezha-fronted/src/components/page/alarm/config.vue rename to nezha-fronted/src/components/page/alert/config.vue index 210b33078..be95615e6 100644 --- a/nezha-fronted/src/components/page/alarm/config.vue +++ b/nezha-fronted/src/components/page/alert/config.vue @@ -2,43 +2,6 @@ .account { height: 100%; } - .content-left { - float: left; - width: 370px; - height: 100%; - } - .sidebar-title { - padding-left: 30px; - padding-top: 20px; - } - - .sidebar-info { - margin-top: 20px; - border: 1px solid #acacac; - border-radius: 8px; - height: calc(90vh - 55px); - width: calc(100% - 30px); - } - - .sidebar-info-header { - background: #acacac; - text-align: center; - line-height: 50px; - border-top-left-radius: 8px; - border-top-right-radius: 8px; - height: 60px; - width: 100%; - } - - .sidebar-info-footer { - padding-top: 15px; - padding-left: 15px; - } - .account-list { - height: calc(100% - 131px); - margin-left: 370px; - padding: 0 15px 0 0; - } .account-list-option { cursor: pointer; display: inline-block; @@ -56,11 +19,6 @@ .account-list-option .el-icon-view:hover { color: #409EFF; } - .account-list-search { - float: right; - width: 220px; - margin: 15px 0; - } /* begin--右侧弹框*/ .right-box { position: fixed; @@ -182,41 +140,29 @@ } /* end--右侧弹框--底部按钮*/ /* end--右侧弹框*/ - - /* begin--右弹框滑入滑出动画*/ - @keyframes slide-in-from-right { - from {right: -800px} - to {right: 0} - } - @keyframes slide-out-to-right { - from {right: 0} - to {right: -800px} - } - .right-box-enter-active { - animation: slide-in-from-right 0.4s; - } - .right-box-leave-active { - animation: slide-out-to-right 0.4s; - } - /* end--右弹框滑入滑出动画*/ @@ -291,7 +222,7 @@
-
{{$t('alarm.config.name')}}
+
{{$t('alert.config.name')}}
-
{{$t('alarm.config.expr')}}
+
{{$t('alert.config.expr')}}
-
{{$t('alarm.config.for')}}
+
{{$t('alert.config.for')}}
-
{{$t('alarm.severity')}}
+
{{$t('alert.severity')}}
-
{{$t('alarm.summary')}}
+
{{$t('alert.summary')}}
-
{{$t('alarm.description')}}
+
{{$t('alert.description')}}
{ if (response.code == 200) { - this.tableData = response.data.list - this.pageObj.total = response.data.total + this.tableData = response.data.list; + this.pageObj.total = response.data.total; } }) }, @@ -607,6 +538,16 @@ export default { receiver: '', } }, + jumpTo(data,id) { + this.$store.state.assetData.moduleData = data + this.$store.state.assetData.selectedData = id + this.$router.push({ + path: "/" + data, + query: { + t: +new Date() + } + }); + }, pageNo(val) { this.pageObj.pageNo = val; this.getTableData() diff --git a/nezha-fronted/src/components/page/alarm/list.vue b/nezha-fronted/src/components/page/alert/list.vue similarity index 75% rename from nezha-fronted/src/components/page/alarm/list.vue rename to nezha-fronted/src/components/page/alert/list.vue index f136ed9ad..e90264a73 100644 --- a/nezha-fronted/src/components/page/alarm/list.vue +++ b/nezha-fronted/src/components/page/alert/list.vue @@ -2,43 +2,6 @@ .account { height: 100%; } - .content-left { - float: left; - width: 370px; - height: 100%; - } - .sidebar-title { - padding-left: 30px; - padding-top: 20px; - } - - .sidebar-info { - margin-top: 20px; - border: 1px solid #acacac; - border-radius: 8px; - height: calc(90vh - 55px); - width: calc(100% - 30px); - } - - .sidebar-info-header { - background: #acacac; - text-align: center; - line-height: 50px; - border-top-left-radius: 8px; - border-top-right-radius: 8px; - height: 60px; - width: 100%; - } - - .sidebar-info-footer { - padding-top: 15px; - padding-left: 15px; - } - .account-list { - height: calc(100% - 131px); - margin-left: 370px; - padding: 0 15px 0 0; - } .account-list-option { cursor: pointer; display: inline-block; @@ -56,11 +19,6 @@ .account-list-option .el-icon-view:hover { color: #409EFF; } - .account-list-search { - float: right; - width: 220px; - margin: 15px 0; - } /* begin--右侧弹框*/ .right-box { position: fixed; @@ -202,22 +160,26 @@ diff --git a/nezha-fronted/src/components/page/config/account.vue b/nezha-fronted/src/components/page/config/account.vue index 93527cea5..92f1a4d0e 100644 --- a/nezha-fronted/src/components/page/config/account.vue +++ b/nezha-fronted/src/components/page/config/account.vue @@ -2,65 +2,29 @@ .account { height: 100%; } - .content-left { - float: left; - width: 370px; - height: 100%; - } - .sidebar-title { - padding-left: 30px; - padding-top: 20px; - } - .sidebar-info { - margin-top: 20px; - border: 1px solid #acacac; - border-radius: 8px; - height: calc(90vh - 55px); - width: calc(100% - 30px); - } - - .sidebar-info-header { - background: #acacac; - text-align: center; - line-height: 50px; - border-top-left-radius: 8px; - border-top-right-radius: 8px; - height: 60px; - width: 100%; - } - - .sidebar-info-footer { - padding-top: 15px; - padding-left: 15px; - } - .account-list { + .content-right { height: calc(100% - 131px); - margin-left: 370px; - padding: 0 15px 0 0; + margin-left: 322px; + padding: 0 15px 0 25px; } - .account-list-option { + .content-right-option { cursor: pointer; display: inline-block; margin-right: 6px; } - .account-list-option .el-icon-delete { + .content-right-option .el-icon-delete { color: #F98D9A; } - .account-list-option .el-icon-delete:hover { + .content-right-option .el-icon-delete:hover { color: #D96D7A; } - .account-list-option .el-icon-view { + .content-right-option .el-icon-view { color: #60BEFF; } - .account-list-option .el-icon-view:hover { + .content-right-option .el-icon-view:hover { color: #409EFF; } - .account-list-search { - float: right; - width: 220px; - margin: 15px 0; - } /* begin--右侧弹框*/ .right-box { position: fixed; @@ -203,21 +167,25 @@