diff --git a/nezha-fronted/build/webpack.base.conf.js b/nezha-fronted/build/webpack.base.conf.js index 05a72f998..6d72366ea 100644 --- a/nezha-fronted/build/webpack.base.conf.js +++ b/nezha-fronted/build/webpack.base.conf.js @@ -104,7 +104,6 @@ if (arg === 'html' || devStart === 'dev:html') { baseConfig.module.rules.unshift({ include: [ resolve('src/entrance/app'), - resolve('src/components/common/alert'), resolve('src/components/common/bottomBox'), resolve('src/components/common/detailView'), resolve('src/components/common/elSelect'), diff --git a/nezha-fronted/build/webpack.prod.conf.js b/nezha-fronted/build/webpack.prod.conf.js index 72e037b78..d0ba51e77 100644 --- a/nezha-fronted/build/webpack.prod.conf.js +++ b/nezha-fronted/build/webpack.prod.conf.js @@ -312,7 +312,8 @@ if (process.env.NODE_ENV == 'development') { onEnd: [ { move: [ - { source: path.join(__dirname, '../dist', '/static/config.json'), destination: path.join(__dirname, '../dist/config.json') } + { source: path.join(__dirname, '../dist', '/static/config.json'), destination: path.join(__dirname, '../dist/config.json') }, + { source: path.join(__dirname, '../exportHtml', '/exportHtml.html'), destination: path.join(__dirname, '../dist/exportHtml.html') } ], mkdir: [ @@ -345,7 +346,8 @@ if (process.env.NODE_ENV == 'development') { onEnd: [ { move: [ - { source: path.join(__dirname, '../dist', '/static/config.json'), destination: path.join(__dirname, '../dist/config.json') } + { source: path.join(__dirname, '../dist', '/static/config.json'), destination: path.join(__dirname, '../dist/config.json') }, + { source: path.join(__dirname, '../exportHtml', '/snapshot_template.html'), destination: path.join(__dirname, '../dist/snapshot_template.html') } ], mkdir: [ @@ -371,7 +373,7 @@ if (process.env.NODE_ENV == 'development') { if (arg === 'html') { plugin.onStart[0].delete.push(path.join(__dirname, '../exportHtml/')) plugin.onEnd[0].copy.push( - { source: path.join(__dirname, '../dist', '/index.html'), destination: path.join(__dirname, '../exportHtml', '/index.html') } + { source: path.join(__dirname, '../dist', '/index.html'), destination: path.join(__dirname, '../exportHtml', '/snapshot_template.html') } ) } webpackConfig.plugins.push( diff --git a/nezha-fronted/src/assets/css/components/common/rightBox/panelBox.scss b/nezha-fronted/src/assets/css/components/common/rightBox/panelBox.scss new file mode 100644 index 000000000..27ccfbed3 --- /dev/null +++ b/nezha-fronted/src/assets/css/components/common/rightBox/panelBox.scss @@ -0,0 +1,153 @@ +.right-box-panel{ + .item-receivers{ + .el-select.el-select--small{ + width: 100%; + } + .item-receivers-text{ + color: $--color-text-secondary; + } + } + .el-input--suffix.el-date-editor--datetime .el-input__inner{ + padding-left: 15px; + } + .form-items--half-width-group{ + .item-receivers{ + width: 100%; + .el-select.el-select--small{ + width: 100%; + } + } + .form-item--half-width{ + .el-date-editor.el-date-editor--datetime{ + width: 100%; + .el-input__inner{ + height: 32px; + } + } + } + .check-month_box{ + .el-checkbox-group{ + display: flex; + justify-content: start; + align-items: center; + flex-wrap: wrap; + .el-checkbox-button{ + display: flex; + justify-content: center; + align-items: center; + width: calc(100% / 7); + margin-right: -2px; + margin-bottom: -1px; + border: 1px solid $--border-color-light; + .el-checkbox-button__inner{ + border: 0px; + border-left: 0px !important; + border-bottom: 0px !important; + display: block; + width: 100%; + height: 100%; + background-color: $--background-color-empty; + border-radius: 0; + } + } + } + + .el-checkbox-button.is-checked .el-checkbox-button__inner { + color: #fff; + border-radius: 0; + background-color: $--color-primary !important; + } + } + .range-time{ + width: 100%; + .el-form-item__content{ + height: 41px; + .el-radio-group{ + height: 100%; + border-left: 1px solid $--border-color-light; + .el-radio-button__inner{ + height: 100%; + line-height: 1.5; + font-size: 14px; + color: $--color-text-primary; + } + } + .el-checkbox-group{ + height: 100%; + .el-checkbox-button{ + margin-right: -2px; + .el-checkbox-button__inner{ + background-color: $--background-color-empty; + border:1px solid $--border-color-light; + } + } + } + } + .el-radio-group{ + display: flex; + border-left: 0; + .el-radio-button{ + flex: 1; + } + } + + .el-checkbox-button.is-checked .el-checkbox-button__inner { + color: #fff; + border-radius: 0; + background-color: $--color-primary !important; + border: 1px solid $--color-primary !important; + // margin-right: -1px; + } + } + .form-tabs{ + width: 100%; + .el-tabs__nav{ + display: flex; + .el-tabs__item{ + flex: 1; + } + .el-checkbox-button.is-checked .el-checkbox-button__inner { + color: #fff; + border-radius: 0; + background-color: $--color-primary !important; + border: 1px solid $--color-primary !important; + // margin-right: -1px; + } + } + } + .form-day-week{ + width: 100%; + .el-input-group__append{ + border: 1px solid $--border-color-light; + background-color: $--right-box-sub-title-background-color; + } + } + } + } + + .el-form-item__content{ + text-align: unset !important; + .el-checkbox-button{ + width: calc(100% / 7) !important; + .el-checkbox-button__inner{ + width: 100%; + padding: 11px 3px; + } + + } + .el-checkbox-button.is-focus .el-checkbox-button__inner{ + border-color: $--border-color-base; + } + + .el-tabs__item.is-top.is-active{ + color: #fff !important; + background-color: $--color-primary !important; + } + .el-radio-button.el-radio-button--small.is-active{ + .el-radio-button__inner{ + color: #fff !important; + } + } + } + + \ No newline at end of file diff --git a/nezha-fronted/src/assets/css/components/index.scss b/nezha-fronted/src/assets/css/components/index.scss index 1f13dcb64..17add18bb 100644 --- a/nezha-fronted/src/assets/css/components/index.scss +++ b/nezha-fronted/src/assets/css/components/index.scss @@ -51,6 +51,7 @@ @import './common/rightBox/chartRightBox/chartRightBox.scss'; @import './common/rightBox/mibBox.scss'; @import './common/rightBox/assetBactchEditBox.scss'; +@import './common/rightBox/panelBox.scss'; @import './common/table/alert/alertMessageTable.scss'; @import './common/table/alert/alertRuleTable.scss'; @import './common/table/alert/alertSilenceTable.scss'; diff --git a/nezha-fronted/src/components/chart/chartDetail.vue b/nezha-fronted/src/components/chart/chartDetail.vue index 3f9022e2c..be110ed1a 100644 --- a/nezha-fronted/src/components/chart/chartDetail.vue +++ b/nezha-fronted/src/components/chart/chartDetail.vue @@ -210,6 +210,7 @@ export default { this.showBasicInfo = !this.showBasicInfo }, init () { + if (window.dataJson) { return } this.loading = true const weekDays = this.getWeeksTime() if (this.trendTimer) { diff --git a/nezha-fronted/src/components/chart/panelChart.vue b/nezha-fronted/src/components/chart/panelChart.vue index 743a31eaf..af3992c8c 100644 --- a/nezha-fronted/src/components/chart/panelChart.vue +++ b/nezha-fronted/src/components/chart/panelChart.vue @@ -436,9 +436,14 @@ export default { } case 'system': { this.chartData = [] + if (this.chartInfo.type === 'assetInfo' || this.chartInfo.type === 'endpointInfo') { + this.chartData = this.dataJson[this.chartInfo.id + '_' + 0].data + this.loading = false + break + } this.chartData.push(this.dataJson[this.chartInfo.id + '_' + 0].result) - } break + } case 'misc': { this.loading = false setTimeout(() => { diff --git a/nezha-fronted/src/components/common/mixin/editRigthBox.js b/nezha-fronted/src/components/common/mixin/editRigthBox.js index 4aea2c325..ecabae178 100644 --- a/nezha-fronted/src/components/common/mixin/editRigthBox.js +++ b/nezha-fronted/src/components/common/mixin/editRigthBox.js @@ -21,7 +21,7 @@ export default { this.messageParams.route = route this.messageParams.params = params this.closeMessage = this.$message({ - duration: 2000, + duration: showNext ? 5000 : 2000, dangerouslyUseHTMLString: true, type: 'success', message: `