diff --git a/nezha-fronted/src/assets/css/main.css b/nezha-fronted/src/assets/css/main.css index 22aff1144..d027e59e5 100644 --- a/nezha-fronted/src/assets/css/main.css +++ b/nezha-fronted/src/assets/css/main.css @@ -1,22 +1,22 @@ * { - margin: 0; - padding: 0; + margin: 0; + padding: 0; } - [v-cloak] { display: none; } - body { - height: 100%; + height: 100%; } html { - height: 100%; + height: 100%; } .content-box { height: 100%; } -/*通用*/ + + +/* begin--通用*/ .margin-l-5 { margin-left: 5px !important; } @@ -41,6 +41,12 @@ html { .margin-b-10 { margin-bottom: 10px !important; } +.float-left { + float: left; +} +.float-right { + float: right; +} .line-100 { width: 100%; height: 1px; @@ -51,128 +57,175 @@ html { } /*侧滑文字*/ .el-form-item .el-form-item__label{ - font-size: 10px; - text-align : left; + font-size: 10px; + text-align : left; } /*侧滑输入框高度*/ .el-input .el-input__inner{ - line-height: 26px; - height: 26px; + line-height: 26px; + height: 26px; } /*侧滑输入框宽度*/ -.el-form-item__content .el-input{ - width: 90%; +.right-menu .el-form-item__content .el-input{ + width: 90%; } +/* begin--按钮组件*/ +.nz-btn { + border-radius: 4px; + cursor: pointer; + line-height: 18px; + font-size: 14px; + font-weight: 700; + padding: 4px 14px; + text-align: center; + -webkit-appearance: none; + white-space: nowrap; +} +.nz-btn.nz-btn-size-normal {} /* size默认normal,是normal时这个class可不写*/ +.nz-btn.nz-btn-size-small { + font-size: 12px; + line-height: 18px; + padding: 2px 12px; +} +.nz-btn.nz-btn-style-normal { + background-color: #16b; + background-image: linear-gradient(#2d8cec, #16b); + border: 1px solid #0b4075; + border-top-color: #16b; + color: #fff; + text-shadow: 0 1px 1px rgba(0,0,0,.75); +} +.nz-btn.nz-btn-style-light { + background-color: #dedede; + background-image: linear-gradient(white,#dedede); + border: 1px solid #b8b8b8; + border-top-color: #dedede; + color: #444; + text-shadow: 0 1px 1px rgba(255,255,255,.75); +} +.nz-btn.nz-btn-style-light:hover:not(.nz-btn-disabled) { + background-image: linear-gradient(#dedede,#c5c5c5); +} +.nz-btn.nz-btn-style-normal:hover:not(.nz-btn-disabled) { + background-image: linear-gradient(#16b, #0d4d8c); +} +.nz-btn:focus { + outline: 0; +} +.nz-btn.nz-btn-disabled { + background-image: none; + background-color: #666; + color: white; + text-shadow: none; + border-color: #999; +} +.nz-btn-group .nz-btn:first-child:not(:last-child) { + border-bottom-right-radius: 0; + border-top-right-radius: 0; +} +.nz-btn-group .nz-btn:last-child:not(:first-child) { + border-bottom-left-radius: 0; + border-top-left-radius: 0; +} +/* end--按钮组件*/ +/* end--通用*/ /* begin--左侧列表*/ .content-left { float: left; - width: 322px; + width: 270px; height: 100%; - background-color: #eeeeee; - border-right: 1px solid #dadada; - padding: 0 12px 0 11px; + border-right: 1px solid #cccccc; + padding: 0 12px 0 30px; box-sizing: border-box; - font-size: 14px; } .sidebar-title { - padding: 20px 0 0 15px; - color: #5e5e5e; + padding-top: 20px; + color: #aaaaaa; + font-size: 16px; } .sidebar-info { - margin-top: 27px; - border: 1px solid #cacaca; - border-radius: 6px; height: calc(90vh - 55px); width: 100%; -} -.sidebar-info-item:first-of-type { - border-radius: 6px 6px 0 0; + padding-top: 10px; } .sidebar-info-item { - height: 39px; - line-height: 39px; - padding: 0 8px 0 32px; - border-bottom: 1px solid #cacaca; + line-height: 1.5rem; + padding: 0 10px 0 10px; cursor: pointer; - color: #5e5e5e; + color: #444444; + margin: 0 0 7px; } .side-bar-menu-edit { - line-height: 40px; + line-height: 1.5rem; float: right; } .sidebar-info-item-active { - background-color: #5e5e5e; - color: white; -} -.sidebar-info-foot { - border-radius: 6px 6px 0 0; + border-left: 3px solid #e07700; + font-weight: bold; } /* end--左侧列表*/ /* begin--右侧内容*/ - /* begin--顶部工具栏*/ +.content-right { + height: calc(100% - 131px); + margin-left: 270px; + padding: 0 15px 0 25px; +} +/* 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: 320px; } -.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; - border: 1px solid #656565; - background-color: #656565; -} -.top-tools .top-tool-btn-active:focus, .top-tools .top-tool-btn-active:hover { - color: white; - background-color: #656565; - border: 1px solid #656565; -} -.top-tools .top-tool-btn-txt { - font-size: 14px; -} - /* end--顶部工具栏*/ - /* start--内容*/ +/* end--顶部工具栏*/ +/* start--内容*/ .content-right>.el-table{ - border-radius: 4px; - border: 1px solid #D7D7D7; + border: 1px solid #d4d4d4; + border-left: none; + border-right: none; margin-top: 30px; + border-bottom: none; } -.content-right { - height: calc(100% - 131px); - margin-left: 322px; - padding: 0 15px 0 25px; +.content-right .el-table::before { + height: 0; } - /* end--内容*/ - /* start--分页*/ +.content-right .el-table--border::after, .el-table--group::after { + width: 0; +} +.content-right .el-table__header { + line-height: 40px; + text-shadow: 1px 1px white; +} +.content-right .el-table .el-table__header th { + background-image: linear-gradient(#eee,#e0e0e0); + color: #444444; + border-right: 1px solid #d4d4d4; + border-left: 1px solid white; + border-bottom: 1px solid #d4d4d4;; +} +.content-right .el-table .el-table__header th:first-of-type { + border-left: none; +} +.content-right .el-table .el-table__header th:nth-last-child(2) { + border-right: none; +} +.content-right .el-table--border td, .el-table--border th, .el-table__body-wrapper .el-table--border.is-scrolling-left~.el-table__fixed { + border-right: none; +} +.content-right .el-table td { + padding: 4px 0; +} +/* end--内容*/ +/* start--分页*/ .pagination { padding-top: 18px; text-align: center; } - /* end--分页*/ +/* end--分页*/ - /* begin--右弹框滑入滑出动画*/ +/* begin--右弹框滑入滑出动画*/ @keyframes slide-in-from-right { from {right: -800px} to {right: 0} @@ -187,9 +240,9 @@ html { .right-box-leave-active { animation: slide-out-to-right 0.4s; } - /* end--右弹框滑入滑出动画*/ +/* end--右弹框滑入滑出动画*/ - /* begin--右子弹框动画*/ +/* begin--右子弹框动画*/ @keyframes appear { from {opacity:0} to {opacity:1} @@ -204,7 +257,7 @@ html { .right-sub-box-leave-active { animation: disappear 0.4s; } - /* end--右子弹框动画*/ +/* end--右子弹框动画*/ /* end--右侧内容*/ /* begin--右侧弹框*/ @@ -219,8 +272,8 @@ html { padding: 0 20px; } - /*此处自定义弹框尺寸,不同功能可能需要的尺寸不一样,需自行添加*/ -.right-box-account, .right-box-prom, .right-box-alert-config, .right-box-project, .right-box-module, .right-box-edit-endpoint { +/*此处自定义弹框尺寸,不同功能可能需要的尺寸不一样,需自行添加*/ +.right-box-account, .right-box-prom, .right-box-alert-config, .right-box-project, .right-box-module, .right-box-edit-endpoint, .right-box-panel { width: 520px; height: calc(100% - 100px); } @@ -228,7 +281,7 @@ html { width: 820px; height: calc(100% - 100px); } - /* begin--右侧弹框--顶部按钮*/ +/* begin--右侧弹框--顶部按钮*/ .right-box-top-btns { text-align: center; } @@ -251,9 +304,9 @@ html { border-top: none; color: white; } - /* end--右侧弹框--顶部按钮*/ +/* end--右侧弹框--顶部按钮*/ - /* begin--右侧弹框--内容*/ +/* begin--右侧弹框--内容*/ .right-box-title { height: 30px; line-height: 40px; @@ -315,9 +368,9 @@ html { .right-box-row-btn-active:hover { border: 1px solid #656565; } - /* end--右侧弹框--内容*/ +/* end--右侧弹框--内容*/ - /* begin--右侧弹框--底部按钮*/ +/* begin--右侧弹框--底部按钮*/ .right-box-bottom-btns { position: absolute; bottom: 0; @@ -352,7 +405,7 @@ html { .right-box-bottom-btn-50 { width: 50%; } - /* end--右侧弹框--底部按钮*/ +/* end--右侧弹框--底部按钮*/ /* end--右侧弹框*/ /* begin--endpoint->子弹框asset搜索框前缀和后缀*/ .right-sub-box .el-input-group__append, .right-sub-box .el-input-group__prepend, .assets-box .el-input-group__append, .assets-box .el-input-group__prepend { diff --git a/nezha-fronted/src/assets/img/lang-box-active.svg b/nezha-fronted/src/assets/img/lang-box-active.svg new file mode 100644 index 000000000..8a59be2d4 --- /dev/null +++ b/nezha-fronted/src/assets/img/lang-box-active.svg @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/nezha-fronted/src/assets/img/lang-box.svg b/nezha-fronted/src/assets/img/lang-box.svg new file mode 100644 index 000000000..5029539c6 --- /dev/null +++ b/nezha-fronted/src/assets/img/lang-box.svg @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/nezha-fronted/src/assets/img/login-background.png b/nezha-fronted/src/assets/img/login-background.png new file mode 100644 index 000000000..cc3c51943 Binary files /dev/null and b/nezha-fronted/src/assets/img/login-background.png differ diff --git a/nezha-fronted/src/components/common/header.vue b/nezha-fronted/src/components/common/header.vue index 7fb2d271e..2c341fce7 100644 --- a/nezha-fronted/src/components/common/header.vue +++ b/nezha-fronted/src/components/common/header.vue @@ -1,485 +1,440 @@ diff --git a/nezha-fronted/src/components/common/home.vue b/nezha-fronted/src/components/common/home.vue index 102d8a6c8..3ea4c1021 100644 --- a/nezha-fronted/src/components/common/home.vue +++ b/nezha-fronted/src/components/common/home.vue @@ -17,7 +17,7 @@ export default { diff --git a/nezha-fronted/src/components/common/i18n.js b/nezha-fronted/src/components/common/i18n.js index 3c4055a1a..ad425df51 100644 --- a/nezha-fronted/src/components/common/i18n.js +++ b/nezha-fronted/src/components/common/i18n.js @@ -5,9 +5,9 @@ import messages from './language' Vue.use(VueI18n) //从localStorage获取语言选择。 const i18n = new VueI18n({ - locale: localStorage.language || 'en', //初始未选择默认 en 英文 + locale: localStorage.getItem('nz-language') || 'en', //初始未选择默认 en 英文 messages, }) locale.i18n((key, value) => i18n.t(key, value)) //兼容element -export default i18n \ No newline at end of file +export default i18n diff --git a/nezha-fronted/src/components/common/language/cn.js b/nezha-fronted/src/components/common/language/cn.js index 8396fba6c..92533f849 100644 --- a/nezha-fronted/src/components/common/language/cn.js +++ b/nezha-fronted/src/components/common/language/cn.js @@ -16,6 +16,23 @@ const cn = { add: '新增', option: "操作" }, + dashboard:{ + title:'仪表盘', + panel:{ + title:'看板', + //侧滑框 + createPanelTitle: "创建面板", + createPanelTitleSec:"创建新面板", + editPanelTitle: "编辑面板", + panelForm:{ + panelName:"面板名称" , + panelId:"ID" + } + }, + metricPreview:{ + title:'指标预览', + } + }, asset: { tableTitle: { id: 'ID', diff --git a/nezha-fronted/src/components/common/language/en.js b/nezha-fronted/src/components/common/language/en.js index 866d5fc47..3bc8a70e7 100644 --- a/nezha-fronted/src/components/common/language/en.js +++ b/nezha-fronted/src/components/common/language/en.js @@ -18,17 +18,39 @@ const en = { clearAll: "Clear All", clear: "Clear", name: 'Name', - cover: 'Cover' + cover: 'Cover', + signOut: 'Sign Out' }, + dashboard:{ + title:'Dashboard', + panel:{ + title:'Panel', + //侧滑框 + createPanelTitle: "Create Panel", + createPanelTitleSec:"Create New Panel", + editPanelTitle: "Panel", + panelForm:{ + panelName:"Panel Name", + panelId:"ID" + } + }, + metricPreview:{ + title:'MetricPreview', + } + }, + search: { - searchTip: 'Press Enter or click to search' + searchTip: 'Press Enter or click to search', + recentSearch: 'Recent Searches', + noRecentSearch: 'No Recent Searches' }, tip: { confirmDelete: "Confirm Delete?", yes: "Yes", no: "No", deleteSuccess: "Successfully Deleted", - saveSuccess: "Successfully Saved" + saveSuccess: "Successfully Saved", + coverSuccess: 'Successfully Covered' }, asset:{ createAsset: "Create Asset", @@ -141,7 +163,8 @@ const en = { accountId: "Accound ID", createAccount: "Create Account", editAccount: "Edit Account", - notCurrentlySupport: 'Not currently supported' + notCurrentlySupport: 'Not currently supported', + password: 'Password' }, promServer: { promServerList: "Prometheus Server", diff --git a/nezha-fronted/src/components/common/login.vue b/nezha-fronted/src/components/common/login.vue index f92796203..bb231f3e4 100644 --- a/nezha-fronted/src/components/common/login.vue +++ b/nezha-fronted/src/components/common/login.vue @@ -1,27 +1,45 @@ \ No newline at end of file + diff --git a/nezha-fronted/src/components/common/pagination.vue b/nezha-fronted/src/components/common/pagination.vue index 95dbc8e87..364ee181b 100644 --- a/nezha-fronted/src/components/common/pagination.vue +++ b/nezha-fronted/src/components/common/pagination.vue @@ -2,7 +2,6 @@ @@ -57,4 +56,11 @@ export default { diff --git a/nezha-fronted/src/components/common/rightBox/addEndpointBox.vue b/nezha-fronted/src/components/common/rightBox/addEndpointBox.vue index 0ebecdcf9..5d5a7eacf 100644 --- a/nezha-fronted/src/components/common/rightBox/addEndpointBox.vue +++ b/nezha-fronted/src/components/common/rightBox/addEndpointBox.vue @@ -1,6 +1,6 @@ @@ -346,11 +128,7 @@ export default { searchLabel: { //搜索参数 }, - rightBox: { //弹出框相关 - show: false, - isEdit: false, //false查看,true编辑 - title: '' - }, + alertRule: { id: '', alertName: '', @@ -441,40 +219,13 @@ export default { show: true, } ], - receiverData: [{ - id: '1', - name: 'group1', - description: '小组1desc' - }, { - id: '2', - name: 'group2', - description: '小组2desc' - }, { - id: '3', - name: '小组3', - description: '小组3desc' - }, { - id: '4', - name: '小组4', - description: '小组4desc' - }, { - id: '5', - name: '小组啊小组5', - description: '小组5desc' - }, { - id: '6', - name: '小组6', - description: '小组6desc' - }], tableData: [] } }, methods: { toEdit: function(u) { this.alertRule = Object.assign({}, u); - this.rightBox.isEdit = true; - this.rightBox.title = this.$t("alert.config.editAlertConfig") + " ID:" + u.id; - this.rightBox.show = true; + this.$refs.alertConfigBox.show(true, true); }, del: function(u) { this.$confirm(this.$t("tip.confirmDelete"), { @@ -494,84 +245,13 @@ export default { }, toAdd: function() { this.cleanAlertRule(); - this.rightBox.isEdit = true; - this.rightBox.title = this.$t("alert.config.createAlertConfig"); - this.rightBox.show = true; + this.$refs.alertConfigBox.show(true, true); }, detail: function(u) { this.alertRule = Object.assign({}, u); - this.rightBox.isEdit = false; - this.rightBox.title = this.$t("alert.config.alertConfig") + " ID:" + u.id; - this.rightBox.show = true; - }, - save: function() { - if (this.alertRule.id) { - this.$put('alert/rule', this.alertRule).then(response => { - if (response.code === 200) { - this.$message({duration: 1000, type: 'success', message: this.$t("tip.saveSuccess")}); - this.getTableData(); - this.rightBox.show = false; - } else { - this.$message.error(response.msg); - } - }); - } else { - this.$post('alert/rule', this.alertRule).then(response => { - if (response.code === 200) { - this.$message({duration: 1000, type: 'success', message: this.$t("tip.saveSuccess")}); - this.getTableData(); - this.rightBox.show = false; - } else { - this.$message.error(response.msg); - } - }); - } - }, - saveOrToEdit: function() { - if (!this.rightBox.isEdit) { - this.rightBox.isEdit = true; - this.rightBox.title = this.$t("alert.config.editAlertConfig") + " ID:" + this.alertRule.id; - } else { - this.save(); - } - }, - toEditReceiver: function(item) { - if (!item.isEdit) { - //如果不在编辑状态,那么其他项如果有改动,则还原改动,最后开始编辑 - this.blurEditReceiver(); - item.isEdit = true; - } else { - //如果已在编辑状态,判断name是否有变更,有变更则发请求 - if (item.name != item.oldName) { - if (this.updateReceiverName(item) == 200) { - item.isEdit = false; - } - } else { - item.errorMessage = ''; - item.isEdit = false; - } - } - }, - blurEditReceiver: function() { - for (var i = 0; i < this.receiverData.length; i++) { - if (this.receiverData[i].isEdit) { - this.receiverData[i].name = this.receiverData[i].oldName; - this.receiverData[i].isEdit = false; - this.receiverData[i].errorMessage = ''; - break; - } - } - }, - toDelReceiver: function(item) { - this.blurEditReceiver(); - //TODO 请求后台,删除组 - }, - 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); - } + this.$refs.alertConfigBox.show(true, false); }, + getTableData: function() { this.$set(this.searchLabel, "pageNo", this.pageObj.pageNo); this.$set(this.searchLabel, "pageSize", this.pageObj.pageSize); @@ -582,9 +262,6 @@ export default { } }) }, - esc: function() { - this.rightBox.show = false; - }, updateReceiverName: function(item) { //TODO 请求接口改名 var code = 200; @@ -609,8 +286,6 @@ export default { } }, jumpTo(data,id) { - this.$store.state.assetData.moduleData = data; - this.$store.state.assetData.selectedData = id; this.$router.push({ path: "/" + data, query: { @@ -638,18 +313,6 @@ export default { }, mounted() { this.getTableData(); - this.initReceiverData(); - }, - computed: { - sProject() { - return this.$store.state.createAlertConfig; - } - }, - watch: { - sProject(n, o) { - this.$store.commit('toCreateAlertConfig', false); - this.toAdd(); - } } } diff --git a/nezha-fronted/src/components/page/alert/list.vue b/nezha-fronted/src/components/page/alert/list.vue index 1403e8ef6..8b1b45cfb 100644 --- a/nezha-fronted/src/components/page/alert/list.vue +++ b/nezha-fronted/src/components/page/alert/list.vue @@ -169,7 +169,7 @@
- +
- +