diff --git a/.gitignore b/.gitignore index d27e6fa15..5b014fbc1 100644 --- a/.gitignore +++ b/.gitignore @@ -19,4 +19,3 @@ nezha-fronted/src/components/common/rightBox/tempRoghtBox.vue nezha-fronted/exportHtml/ nezha-fronted/src/a.txt nezha-fronted/src/components/common/testTopology.vue -nezha-fronted/static/ diff --git a/nezha-fronted/build/webpack.prod.conf.js b/nezha-fronted/build/webpack.prod.conf.js index 7f79c9983..58fcb43f8 100644 --- a/nezha-fronted/build/webpack.prod.conf.js +++ b/nezha-fronted/build/webpack.prod.conf.js @@ -8,9 +8,9 @@ const merge = require('webpack-merge') const baseWebpackConfig = require('./webpack.base.conf') const CopyWebpackPlugin = require('copy-webpack-plugin') const HtmlWebpackPlugin = require('html-webpack-plugin') -//const ExtractTextPlugin = require('extract-text-webpack-plugin') +// const ExtractTextPlugin = require('extract-text-webpack-plugin') const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin') - const ParallelUglifyPlugin = require('webpack-parallel-uglify-plugin') +const ParallelUglifyPlugin = require('webpack-parallel-uglify-plugin') const fileManagerPlugin = require('filemanager-webpack-plugin') const WebpackZipPlugin = require('webpack-zip-plugin') const UglifyJsPlugin = require('uglifyjs-webpack-plugin') @@ -19,14 +19,13 @@ const GenerateAssetPlugin = require('generate-asset-webpack-plugin') const WebpackShellPlugin = require('webpack-shell-plugin') const HtmlWebpackInlineSourcePlugin = require('html-webpack-inline-source-plugin') const serverConfig = require('../static/config.json')// 引入根目录下的配置文件 -const SpeedMeasurePlugin = require("speed-measure-webpack-plugin"); +const SpeedMeasurePlugin = require('speed-measure-webpack-plugin') const CssMinimizerPlugin = require('css-minimizer-webpack-plugin') const MiniCssExtractPlugin = require('mini-css-extract-plugin') const TerserPlugin = require('terser-webpack-plugin') const { VueLoaderPlugin } = require('vue-loader') // const smp = new SpeedMeasurePlugin(); - // const gitRevisionPlugin = new GitRevisionPlugin(); const createJson = function () { // serverConfig.version=config.build.version +"-"+gitRevisionPlugin.commithash(); @@ -61,7 +60,7 @@ if (arg === 'html') { plugins: [ new VueLoaderPlugin(), new webpack.ProvidePlugin({ - introJs: ['intro.js'], + introJs: ['intro.js'] }), /* new GenerateAssetPlugin({ filename: 'config.json', @@ -76,7 +75,7 @@ if (arg === 'html') { }), new MiniCssExtractPlugin({ filename: utils.assetsPath('css/[name].[contenthash].css'), - chunkFilename: "[name].[contenthash].css" + chunkFilename: '[name].[contenthash].css' }), new UglifyJsPlugin({ uglifyOptions: { @@ -91,14 +90,14 @@ if (arg === 'html') { parallel: true }), // extract css into its own file - /*new ExtractTextPlugin({ + /* new ExtractTextPlugin({ filename: utils.assetsPath('css/[name].[contenthash].css'), // Setting the following option to `false` will not extract CSS from codesplit chunks. // Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack. // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`, // increasing file size: https://github.com/vuejs-templates/webpack/issues/1110 allChunks: true - }),*/ + }), */ // Compress extracted CSS. We are using this plugin so that possible // duplicated CSS from different components can be deduped. new OptimizeCSSPlugin({ @@ -186,7 +185,7 @@ if (arg === 'html') { { from: path.resolve(__dirname, '../static'), to: config.build.assetsSubDirectory, - ignore: ['*'] + ignore: ['**/Titles/**'] } ]) ] @@ -240,11 +239,11 @@ if (arg === 'html') { new webpack.DefinePlugin({ 'process.env': env }), - new MiniCssExtractPlugin({ //替换 ExtractTextPlugin 用于css抽取 + new MiniCssExtractPlugin({ // 替换 ExtractTextPlugin 用于css抽取 filename: utils.assetsPath('css/[name].[contenthash].css') // chunkFilename: "[name].[contenthash].css" }), - /* new UglifyJsPlugin({ + /* new UglifyJsPlugin({ uglifyOptions: { compress: { warnings: false, @@ -255,16 +254,16 @@ if (arg === 'html') { exclude: /manifest.+js/, sourceMap: config.build.productionSourceMap, parallel: true - }),*/ + }), */ // extract css into its own file - /*new ExtractTextPlugin({ + /* new ExtractTextPlugin({ filename: utils.assetsPath('css/[name]_[md5:contenthash:hex:8].css'), // Setting the following option to `false` will not extract CSS from codesplit chunks. // Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack. // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`, // increasing file size: https://github.com/vuejs-templates/webpack/issues/1110 allChunks: true - }),*/ + }), */ // Compress extracted CSS. We are using this plugin so that possible // duplicated CSS from different components can be deduped. // new OptimizeCSSPlugin({ @@ -289,7 +288,7 @@ if (arg === 'html') { // https://github.com/kangax/html-minifier#options-quick-reference }, // necessary to consistently work with multiple chunks via CommonsChunkPlugin - //chunksSortMode: 'auto', + // chunksSortMode: 'auto', excludeChunks: ['exportHtml'] }), new GenerateAssetPlugin({ @@ -303,7 +302,7 @@ if (arg === 'html') { // enable scope hoisting new webpack.optimize.ModuleConcatenationPlugin(), // split vendor js into its own file - /* new webpack.optimize.CommonsChunkPlugin({ + /* new webpack.optimize.CommonsChunkPlugin({ name: 'vendor', minChunks (module) { // any required modules inside node_modules are extracted to vendor @@ -330,14 +329,14 @@ if (arg === 'html') { async: 'vendor-async', children: true, minChunks: 3 - }),*/ + }), */ // copy custom static assets new CopyWebpackPlugin([ { from: path.resolve(__dirname, '../static'), to: config.build.assetsSubDirectory, - ignore: ['*'] + ignore: ['**/Titles/**'] } ]) ], @@ -347,13 +346,13 @@ if (arg === 'html') { new TerserPlugin({ // 压缩JS代码 terserOptions: { compress: { - warnings: false, - drop_console: true, // 去除console - pure_funcs: ['console.log'] + warnings: false, + drop_console: true, // 去除console + pure_funcs: ['console.log'] } }, exclude: /manifest.+js/, - sourceMap: config.build.productionSourceMap, + sourceMap: config.build.productionSourceMap }) ], splitChunks: { // @@ -364,7 +363,7 @@ if (arg === 'html') { maxAsyncRequests: 5, maxInitialRequests: 3, automaticNameDelimiter: '~', - automaticNameMaxLength: 30, + automaticNameMaxLength: 30 } } }) @@ -380,7 +379,7 @@ 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') } ], @@ -414,7 +413,7 @@ 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') } ], diff --git a/nezha-fronted/package-lock.json b/nezha-fronted/package-lock.json index d277ba116..120aec352 100644 --- a/nezha-fronted/package-lock.json +++ b/nezha-fronted/package-lock.json @@ -14340,7 +14340,7 @@ }, "node-sass": { "version": "4.14.1", - "resolved": "https://registry.npmjs.org/node-sass/-/node-sass-4.14.1.tgz", + "resolved": "https://registry.npmmirror.com/node-sass/-/node-sass-4.14.1.tgz", "integrity": "sha512-sjCuOlvGyCJS40R8BscF5vhVlQjNN069NtQ1gSxyK1u9iqvn6tf7O1R4GNowVZfiZUCRt5MmMs1xd+4V/7Yr0g==", "dev": true, "requires": { @@ -20727,7 +20727,7 @@ }, "webpack-bundle-analyzer": { "version": "2.13.1", - "resolved": "https://registry.npmjs.org/webpack-bundle-analyzer/-/webpack-bundle-analyzer-2.13.1.tgz", + "resolved": "https://registry.npmmirror.com/webpack-bundle-analyzer/-/webpack-bundle-analyzer-2.13.1.tgz", "integrity": "sha512-rwxyfecTAxoarCC9VlHlIpfQCmmJ/qWD5bpbjkof+7HrNhTNZIwZITxN6CdlYL2axGmwNUQ+tFgcSOiNXMf/sQ==", "dev": true, "requires": { diff --git a/nezha-fronted/src/assets/css/common.scss b/nezha-fronted/src/assets/css/common.scss index 77aa08277..dd5fea04c 100644 --- a/nezha-fronted/src/assets/css/common.scss +++ b/nezha-fronted/src/assets/css/common.scss @@ -735,3 +735,11 @@ i.nz-icon-override{ .xterm .xterm-viewport { background-color: transparent !important; } +.downloading { + opacity: .6; + color: $--color-primary; + margin-left: 10px; +} +.el-form-item__error { + padding-top: 0; +} diff --git a/nezha-fronted/src/assets/css/components/common/latIngPicker.scss b/nezha-fronted/src/assets/css/components/common/latIngPicker.scss index a29e9f594..1510d47f3 100644 --- a/nezha-fronted/src/assets/css/components/common/latIngPicker.scss +++ b/nezha-fronted/src/assets/css/components/common/latIngPicker.scss @@ -41,4 +41,24 @@ width: 48px; } } +.append_unit{ + display: flex; + .el-input--small .el-input__inner { + border-radius: 4px 0 0 4px; + border-right: none; + } + &::after{ + content: attr(data-unit); + //position: absolute; + display: inline-block; + top: 0; + right: 100%; + padding: 0 20px; + color: $--color-text-secondary; + background-color: $--background-color-base; + border: 1px solid $--border-color-light; + border-radius:0 4px 4px 0; + width: auto; + } +} diff --git a/nezha-fronted/src/assets/css/components/common/rightBox/chartRightBox/chartRightBox.scss b/nezha-fronted/src/assets/css/components/common/rightBox/chartRightBox/chartRightBox.scss index 43a811571..0b079a253 100644 --- a/nezha-fronted/src/assets/css/components/common/rightBox/chartRightBox/chartRightBox.scss +++ b/nezha-fronted/src/assets/css/components/common/rightBox/chartRightBox/chartRightBox.scss @@ -375,4 +375,9 @@ .nz-icon-sort{ color: #FF8C0E !important; } -} \ No newline at end of file +} +.datasource-log { + .el-tabs__content { + overflow: unset; + } +} diff --git a/nezha-fronted/src/components/chart/chart/legend.vue b/nezha-fronted/src/components/chart/chart/legend.vue index 7dc086e99..e7f6f7593 100644 --- a/nezha-fronted/src/components/chart/chart/legend.vue +++ b/nezha-fronted/src/components/chart/chart/legend.vue @@ -198,7 +198,6 @@ export default { const series = this.$lodash.cloneDeep(this.series) const dataArg = series.filter((seriesItem, seriesIndex) => !this.isGrey[seriesIndex]) const option = this.renderYAxis(dataArg, chartInfo, 'legend') - console.log(option) getChart(this.chartId) && getChart(this.chartId).setOption({ yAxis: [ ...option.yAxis diff --git a/nezha-fronted/src/components/chart/chartList.vue b/nezha-fronted/src/components/chart/chartList.vue index 8d2c44b99..05b28f89f 100644 --- a/nezha-fronted/src/components/chart/chartList.vue +++ b/nezha-fronted/src/components/chart/chartList.vue @@ -594,7 +594,6 @@ export default { }) this.onScroll(this.scrollTop) }, - // group设置repeat 便利变量重复渲染图表 repeatVariableFn () { // 防止group中的chartList执行 @@ -742,7 +741,6 @@ export default { handler (newVal, oldVal) { // 比较变量 图表是否显示/隐藏 this.compareVariables() - this.repeatVariableFn() } }, @@ -785,7 +783,8 @@ export default { const position = getLayoutPosition(n) this.$store.commit('setChartLastPosition', position) } - const tempList = n.map(item => { + const cloneDataList = this.$lodash.cloneDeep(n) + const tempList = cloneDataList.map(item => { let param = '' let height = item.height || '' if (this.isPhone && item.type !== 'group') { @@ -848,11 +847,10 @@ export default { }) } this.$nextTick(() => { - this.copyDataList = JSON.parse(JSON.stringify(tempList)) + this.copyDataList = this.$lodash.cloneDeep(tempList) this.tempList = JSON.parse(JSON.stringify(this.copyDataList)) // 比较变量 图表是否显示/隐藏 this.compareVariables() - this.repeatVariableFn() setTimeout(() => { this.gridLayoutShow = true diff --git a/nezha-fronted/src/components/chart/renderChart.js b/nezha-fronted/src/components/chart/renderChart.js index 60383446c..f529d70c9 100644 --- a/nezha-fronted/src/components/chart/renderChart.js +++ b/nezha-fronted/src/components/chart/renderChart.js @@ -6,7 +6,6 @@ export default { methods: { renderYAxis (chartDatas, chartInfo, type) { let chartData = lodash.cloneDeep(chartDatas) - console.log(chartData) if (type === 'legend') { chartData.forEach(item => { item.values = item.data @@ -30,13 +29,12 @@ export default { ] } // 左y轴 - const leftData = chartData.filter(item => !item[0].yAxisIndex) + const leftData = chartData.filter(item => item[0] && !item[0].yAxisIndex) const leftInfo = this.getMinMaxFromData(leftData, chartInfo.unit, chartInfo.param) // - console.log(leftData, leftInfo) chartOption.yAxis[0].minInterval = chartDataFormat.Interval(leftInfo.maxValue, leftInfo.copies, leftInfo.unit.type, 'min') chartOption.yAxis[0].maxInterval = chartDataFormat.Interval(leftInfo.maxValue, leftInfo.copies, leftInfo.unit.type, 'max') * Math.ceil(this.series.length / 5) if (chartInfo.param.stack) { - chartOption.yAxis[0].maxInterval = chartOption.yAxis[0].maxInterval * (Math.ceil(chartOption.series.length / 5) + 1) + chartOption.yAxis[0].maxInterval = chartOption.yAxis[0].maxInterval * (Math.ceil(leftData.length / 5) + 1) } if (leftInfo.unit.type === 'Time' || leftInfo.unit.type === 'Date & Time') { delete chartOption.yAxis[0].minInterval @@ -64,13 +62,12 @@ export default { const unit = chartDataFormat.getUnit(lodash.get(chartInfo, 'param.rightYAxis.unit', 2)) const allRight = this.series.every(item => item.yAxisIndex == 1) chartOption.yAxis[1].splitLine.show = allRight - const rightData = chartData.filter(item => item[0].yAxisIndex) - console.log(rightData, unit) + const rightData = chartData.filter(item => item[0] && item[0].yAxisIndex) const rightInfo = this.getMinMaxFromData(rightData, lodash.get(chartInfo, 'param.rightYAxis.unit', 2), lodash.get(chartInfo, 'param.rightYAxis', {}))// chartOption.yAxis[1].minInterval = chartDataFormat.Interval(rightInfo.maxValue, rightInfo.copies, rightInfo.unit.type, 'min') chartOption.yAxis[1].maxInterval = chartDataFormat.Interval(rightInfo.maxValue, rightInfo.copies, rightInfo.unit.type, 'max') * Math.ceil(this.series.length / 5) if (chartInfo.param.stack) { - chartOption.yAxis[1].maxInterval = chartOption.yAxis[1].maxInterval * (Math.ceil(chartOption.series.length / 5) + 1) + chartOption.yAxis[1].maxInterval = chartOption.yAxis[1].maxInterval * (Math.ceil(rightData.length / 5) + 1) } if (unit.type === 'Time' || unit.type === 'Date & Time') { delete chartOption.yAxis[1].minInterval @@ -95,7 +92,6 @@ export default { delete chartOption.yAxis[1].max } } - console.log(chartOption) return chartOption }, getMinMaxFromData (originalDatas, chartUnit = 2, params) { diff --git a/nezha-fronted/src/components/cli/consoleNew.vue b/nezha-fronted/src/components/cli/consoleNew.vue index 70ad70fd9..1c536163f 100644 --- a/nezha-fronted/src/components/cli/consoleNew.vue +++ b/nezha-fronted/src/components/cli/consoleNew.vue @@ -114,9 +114,6 @@ export default { const consoleBox = document.getElementById('ternimalContainer' + this.idIndex) const width = document.body.clientWidth - 10// 可视宽度 const height = parseInt(consoleBox.offsetHeight) - 10 - console.log(width, height) - console.log(this.term.cols) - console.log(this.term.rows) const winStyle = { width: width, height: height, @@ -367,14 +364,12 @@ export default { // } }, renderTerminalSetting () { - console.log('renderTerminalSetting') this.showWatermark = this.terminalSetting.watermark this.wordSeparator = this.terminalSetting.wordSeparator this.term.options = { scrollback: this.terminalSetting.scrollbackLines, wordSeparator: this.terminalSetting.wordSeparator } - console.log(this.term) }, copySelection () { let str = this.term.getSelection() diff --git a/nezha-fronted/src/components/common/alert/terminalLogInfo.vue b/nezha-fronted/src/components/common/alert/terminalLogInfo.vue index 5ffe7e462..281cd9d95 100644 --- a/nezha-fronted/src/components/common/alert/terminalLogInfo.vue +++ b/nezha-fronted/src/components/common/alert/terminalLogInfo.vue @@ -160,7 +160,6 @@ export default { methods: { init () { this.loading = false - console.log(this.alertLabelData) }, getRemoteText (record) { return `${record.loginUser}@${record.host}:${record.port}` diff --git a/nezha-fronted/src/components/common/bottomBox/tabs/scrapeEndpoint.vue b/nezha-fronted/src/components/common/bottomBox/tabs/scrapeEndpoint.vue index 825ccb965..0782f0517 100644 --- a/nezha-fronted/src/components/common/bottomBox/tabs/scrapeEndpoint.vue +++ b/nezha-fronted/src/components/common/bottomBox/tabs/scrapeEndpoint.vue @@ -221,7 +221,6 @@ export default { if (simpleTemp.indexOf(',') !== -1) { simpleTemp = simpleTemp.substr(0, simpleTemp.length - 1) } - console.log(simpleTemp) tableData.tableDateAll = simpleTemp tableDates.push(tableData) } diff --git a/nezha-fronted/src/components/common/bottomBox/tabs/terminalLogMonitorTab.vue b/nezha-fronted/src/components/common/bottomBox/tabs/terminalLogMonitorTab.vue index 00b178320..ff503b899 100644 --- a/nezha-fronted/src/components/common/bottomBox/tabs/terminalLogMonitorTab.vue +++ b/nezha-fronted/src/components/common/bottomBox/tabs/terminalLogMonitorTab.vue @@ -81,7 +81,6 @@ export default { methods: { // 创建连接 create () { - console.log('create') const that = this if (this.terminalSocket) { this.terminalSocket.close() @@ -206,7 +205,6 @@ export default { }, consoleResize () { - console.log('consoleResize') this.$nextTick(() => { this.termFitAddon.fit() }) diff --git a/nezha-fronted/src/components/common/login.vue b/nezha-fronted/src/components/common/login.vue index f4d9c96e9..9c8d102c5 100644 --- a/nezha-fronted/src/components/common/login.vue +++ b/nezha-fronted/src/components/common/login.vue @@ -86,25 +86,37 @@ :show-close="true" width="620px" class="nz-dialog" >
-
- 1 Download your preferred authenticator app to your phone (any will work). If you don't + -