diff --git a/.gitignore b/.gitignore index 5b014fbc1..d27e6fa15 100644 --- a/.gitignore +++ b/.gitignore @@ -19,3 +19,4 @@ 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/.gitlab-ci.yml b/.gitlab-ci.yml index 7a6b18d71..7e72071f0 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -30,32 +30,36 @@ dev_build: # 所需执行的脚本 script: - env | sort - - pwd + - pwd - cd nezha-fronted # 安装 npm 依赖文件 - echo "npm install ..." - npm install --registry=http://registry.npmmirror.com - echo "npm run build" - + # 编译 上传模板 - npm run build:html - mc alias set nz $MINIO_HOST $MINIO_USER $MINIO_PWD - mc cp dist/index.html nz/depends/template/snapshot_template.html - npm run build - - cd /builds/nezha/nezha-fronted/nezha-fronted/dist + - cd /builds/nezha/nezha-fronted/nezha-fronted/dist - mc cp nz/depends/template/snapshot_template.html ./snapshot_template.html - rm -rf nz-gui*.zip - export FILE_NAME=nz-gui-$CI_COMMIT_REF_NAME-$CI_COMMIT_SHORT_SHA.zip # 生成 git log 日志文件 - - sed -i 's++更新记录\n+g' ./index.html; - - echo "
" > ./static/git-log.html
+    - sed -i 's++更新记录\n+g' ./index.html;
+    - echo "" > ./static/git-log.html
+    - echo "" >> ./static/git-log.html
+    - echo '' >> ./static/git-log.html
+    - echo "" >> ./static/git-log.html
+    - echo "
" >> ./static/git-log.html
     - "git log -100 --pretty=format:'%ad : %s' >> ./static/git-log.html"
-    - echo "
" >> ./static/git-log.html + - echo "
" >> ./static/git-log.html - zip -q -r $FILE_NAME ./* - # 将 dist zip 上传到 minio + # 将 dist zip 上传到 minio - mc cp $FILE_NAME nz/ci-cd/nz-gui/$FILE_NAME - mc cp $FILE_NAME nz/ci-cd/nz-gui/nz-gui-$CI_COMMIT_REF_NAME-latest.zip artifacts: @@ -78,7 +82,7 @@ rel_build: # 所需执行的脚本 script: - env | sort - - pwd + - pwd - echo "npm install ..." - cd nezha-fronted - npm install --registry=http://registry.npmmirror.com diff --git a/nezha-fronted/build/webpack.dev.conf.js b/nezha-fronted/build/webpack.dev.conf.js index ed7f7cd31..65c565ccf 100644 --- a/nezha-fronted/build/webpack.dev.conf.js +++ b/nezha-fronted/build/webpack.dev.conf.js @@ -25,11 +25,14 @@ devWebpackConfig = merge(baseWebpackConfig, { // these devServer options should be customized in /config/index.js devServer: { clientLogLevel: 'warning', - historyApiFallback: { - rewrites: [ - { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, indexHtml) } - ] - }, + historyApiFallback: true, + // historyApiFallback: { + // // rewrites: [ + // // // { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, indexHtml) } + // // { from: /.*/, to: '/ui' }, + // // { from: '/ui', to: path.posix.join(config.dev.assetsPublicPath, indexHtml) }, + // // ] + // }, hot: true, inline: true, contentBase: false, // since we use CopyWebpackPlugin. diff --git a/nezha-fronted/build/webpack.prod.conf.js b/nezha-fronted/build/webpack.prod.conf.js index aee6b4268..1f159c4f3 100644 --- a/nezha-fronted/build/webpack.prod.conf.js +++ b/nezha-fronted/build/webpack.prod.conf.js @@ -190,7 +190,8 @@ if (arg === 'html') { output: { path: config.build.assetsRoot, filename: utils.assetsPath('js/[name].[chunkhash].js'), - chunkFilename: utils.assetsPath('js/[name].[chunkhash].js') + chunkFilename: utils.assetsPath('js/[name].[chunkhash].js'), + publicPath: '/' }, plugins: [ /* new GenerateAssetPlugin({ diff --git a/nezha-fronted/config/index.js b/nezha-fronted/config/index.js index 4215b1ba8..0169c2829 100644 --- a/nezha-fronted/config/index.js +++ b/nezha-fronted/config/index.js @@ -3,7 +3,8 @@ // see http://vuejs-templates.github.io/webpack for documentation. const path = require('path') - +const devStart = process.env.npm_lifecycle_event +const indexHtml = devStart === 'dev' ? '/src/entrance/app/index.html' : '/src/entrance/exportHtml/exportHtml.html' module.exports = { dev: { // Paths diff --git a/nezha-fronted/package-lock.json b/nezha-fronted/package-lock.json index 5dc85bc4b..767e9aa90 100644 --- a/nezha-fronted/package-lock.json +++ b/nezha-fronted/package-lock.json @@ -1401,7 +1401,7 @@ }, "@mapbox/geojson-rewind": { "version": "0.5.2", - "resolved": "https://registry.npmmirror.com/@mapbox/geojson-rewind/-/geojson-rewind-0.5.2.tgz", + "resolved": "https://registry.npmjs.org/@mapbox/geojson-rewind/-/geojson-rewind-0.5.2.tgz", "integrity": "sha512-tJaT+RbYGJYStt7wI3cq4Nl4SXxG8W7JDG5DMJu97V25RnbNg3QtQtf+KD+VLjNpWKYsRvXDNmNrBgEETr1ifA==", "requires": { "get-stream": "^6.0.1", @@ -1410,44 +1410,44 @@ "dependencies": { "get-stream": { "version": "6.0.1", - "resolved": "https://registry.npmmirror.com/get-stream/-/get-stream-6.0.1.tgz", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==" }, "minimist": { "version": "1.2.6", - "resolved": "https://registry.npmmirror.com/minimist/-/minimist-1.2.6.tgz", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==" } } }, "@mapbox/jsonlint-lines-primitives": { "version": "2.0.2", - "resolved": "https://registry.npmmirror.com/@mapbox/jsonlint-lines-primitives/-/jsonlint-lines-primitives-2.0.2.tgz", + "resolved": "https://registry.npmjs.org/@mapbox/jsonlint-lines-primitives/-/jsonlint-lines-primitives-2.0.2.tgz", "integrity": "sha512-rY0o9A5ECsTQRVhv7tL/OyDpGAoUB4tTvLiW1DSzQGq4bvTPhNw1VpSNjDJc5GFZ2XuyOtSWSVN05qOtcD71qQ==" }, "@mapbox/mapbox-gl-supported": { "version": "2.0.1", - "resolved": "https://registry.npmmirror.com/@mapbox/mapbox-gl-supported/-/mapbox-gl-supported-2.0.1.tgz", + "resolved": "https://registry.npmjs.org/@mapbox/mapbox-gl-supported/-/mapbox-gl-supported-2.0.1.tgz", "integrity": "sha512-HP6XvfNIzfoMVfyGjBckjiAOQK9WfX0ywdLubuPMPv+Vqf5fj0uCbgBQYpiqcWZT6cbyyRnTSXDheT1ugvF6UQ==" }, "@mapbox/point-geometry": { "version": "0.1.0", - "resolved": "https://registry.npmmirror.com/@mapbox/point-geometry/-/point-geometry-0.1.0.tgz", + "resolved": "https://registry.npmjs.org/@mapbox/point-geometry/-/point-geometry-0.1.0.tgz", "integrity": "sha512-6j56HdLTwWGO0fJPlrZtdU/B13q8Uwmo18Ck2GnGgN9PCFyKTZ3UbXeEdRFh18i9XQ92eH2VdtpJHpBD3aripQ==" }, "@mapbox/tiny-sdf": { "version": "2.0.5", - "resolved": "https://registry.npmmirror.com/@mapbox/tiny-sdf/-/tiny-sdf-2.0.5.tgz", + "resolved": "https://registry.npmjs.org/@mapbox/tiny-sdf/-/tiny-sdf-2.0.5.tgz", "integrity": "sha512-OhXt2lS//WpLdkqrzo/KwB7SRD8AiNTFFzuo9n14IBupzIMa67yGItcK7I2W9D8Ghpa4T04Sw9FWsKCJG50Bxw==" }, "@mapbox/unitbezier": { "version": "0.0.1", - "resolved": "https://registry.npmmirror.com/@mapbox/unitbezier/-/unitbezier-0.0.1.tgz", + "resolved": "https://registry.npmjs.org/@mapbox/unitbezier/-/unitbezier-0.0.1.tgz", "integrity": "sha512-nMkuDXFv60aBr9soUG5q+GvZYL+2KZHVvsqFCzqnkGEf46U2fvmytHaEVc1/YZbiLn8X+eR3QzX1+dwDO1lxlw==" }, "@mapbox/vector-tile": { "version": "1.3.1", - "resolved": "https://registry.npmmirror.com/@mapbox/vector-tile/-/vector-tile-1.3.1.tgz", + "resolved": "https://registry.npmjs.org/@mapbox/vector-tile/-/vector-tile-1.3.1.tgz", "integrity": "sha512-MCEddb8u44/xfQ3oD+Srl/tNcQoqTw3goGk2oLsrFxOTc3dUp+kAnby3PvAeeBYSMSjSPD1nd1AJA6W49WnoUw==", "requires": { "@mapbox/point-geometry": "~0.1.0" @@ -1455,7 +1455,7 @@ }, "@mapbox/whoots-js": { "version": "3.1.0", - "resolved": "https://registry.npmmirror.com/@mapbox/whoots-js/-/whoots-js-3.1.0.tgz", + "resolved": "https://registry.npmjs.org/@mapbox/whoots-js/-/whoots-js-3.1.0.tgz", "integrity": "sha512-Es6WcD0nO5l+2BOQS4uLfNPYQaNDfbot3X1XUoloz+x0mPDS3eeORZJl06HXjwBG1fOGwCRnzK88LMdxKRrd6Q==" }, "@riophae/vue-treeselect": { @@ -1507,9 +1507,9 @@ "integrity": "sha512-pFCGC7pBorMA8kPiAPKLeBp9VjHXs8FRMujTjFAUpJxQGRAZzjnuVq0pB32me9Vc/Ckp1/pH6S0JgD+poVA5CA==" }, "@topology/core": { - "version": "1.1.32", - "resolved": "https://registry.npmjs.org/@topology/core/-/core-1.1.32.tgz", - "integrity": "sha512-ZpRzW0ERxBMFcdujT7VpZVY8t7B+OEMXVhuY+vQ8a++LTG/SIWT3ib8EhYw4cJM4BaIUtOOyDPYHpFk4SOl0KA==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@topology/core/-/core-1.2.0.tgz", + "integrity": "sha512-4CCg9utyJTSNNtmqWG7895ongEWGz4mHwwkKy8MGM4cQSzgC2S615XQgwiLMPjMxSUL0OOQkI9oU4wei/gTPuA==", "requires": { "mitt": "^2.1.0", "mqtt": "^4.2.6" @@ -1573,7 +1573,7 @@ }, "@types/geojson": { "version": "7946.0.10", - "resolved": "https://registry.npmmirror.com/@types/geojson/-/geojson-7946.0.10.tgz", + "resolved": "https://registry.npmjs.org/@types/geojson/-/geojson-7946.0.10.tgz", "integrity": "sha512-Nmh0K3iWQJzniTuPRcJn5hxXkfB1T1pgB89SBig5PlJQU5yocazeu4jATJlaA0GYFKWMqDdvYemoSnF2pXgLVA==" }, "@types/istanbul-lib-coverage": { @@ -1609,12 +1609,12 @@ }, "@types/mapbox__point-geometry": { "version": "0.1.2", - "resolved": "https://registry.npmmirror.com/@types/mapbox__point-geometry/-/mapbox__point-geometry-0.1.2.tgz", + "resolved": "https://registry.npmjs.org/@types/mapbox__point-geometry/-/mapbox__point-geometry-0.1.2.tgz", "integrity": "sha512-D0lgCq+3VWV85ey1MZVkE8ZveyuvW5VAfuahVTQRpXFQTxw03SuIf1/K4UQ87MMIXVKzpFjXFiFMZzLj2kU+iA==" }, "@types/mapbox__vector-tile": { "version": "1.3.0", - "resolved": "https://registry.npmmirror.com/@types/mapbox__vector-tile/-/mapbox__vector-tile-1.3.0.tgz", + "resolved": "https://registry.npmjs.org/@types/mapbox__vector-tile/-/mapbox__vector-tile-1.3.0.tgz", "integrity": "sha512-kDwVreQO5V4c8yAxzZVQLE5tyWF+IPToAanloQaSnwfXmIcJ7cyOrv8z4Ft4y7PsLYmhWXmON8MBV8RX0Rgr8g==", "requires": { "@types/geojson": "*", @@ -1624,7 +1624,7 @@ }, "@types/pbf": { "version": "3.0.2", - "resolved": "https://registry.npmmirror.com/@types/pbf/-/pbf-3.0.2.tgz", + "resolved": "https://registry.npmjs.org/@types/pbf/-/pbf-3.0.2.tgz", "integrity": "sha512-EDrLIPaPXOZqDjrkzxxbX7UlJSeQVgah3i0aA4pOSzmK9zq3BIh7/MZIQxED7slJByvKM4Gc6Hypyu2lJzh3SQ==" }, "@types/q": { @@ -4071,7 +4071,7 @@ }, "clipboard": { "version": "2.0.11", - "resolved": "https://registry.npmjs.org/clipboard/-/clipboard-2.0.11.tgz", + "resolved": "https://registry.npmmirror.com/clipboard/-/clipboard-2.0.11.tgz", "integrity": "sha512-C+0bbOqkezLIsmWSvlsXS0Q0bmkugu7jcfMIACB+RDEntIzQIkdr148we28AfSloQLRdZlYL/QYyrq05j/3Faw==", "requires": { "good-listener": "^1.2.2", @@ -5014,7 +5014,7 @@ }, "csscolorparser": { "version": "1.0.3", - "resolved": "https://registry.npmmirror.com/csscolorparser/-/csscolorparser-1.0.3.tgz", + "resolved": "https://registry.npmjs.org/csscolorparser/-/csscolorparser-1.0.3.tgz", "integrity": "sha512-umPSgYwZkdFoUrH5hIq5kf0wPSXiro51nPw0j2K/c83KflkPSTBGMz6NJvMB+07VlL0y7VPo6QJcDjcgKTTm3w==" }, "cssesc": { @@ -6245,7 +6245,7 @@ }, "delegate": { "version": "3.2.0", - "resolved": "https://registry.npmjs.org/delegate/-/delegate-3.2.0.tgz", + "resolved": "https://registry.npmmirror.com/delegate/-/delegate-3.2.0.tgz", "integrity": "sha512-IofjkYBZaZivn0V8nnsMJGBr4jVLxHDheKSW88PyxS5QC4Vo9ZbZVvhzlSxY87fVq3STR6r+4cGepyHkcWOQSw==" }, "delegates": { @@ -6481,7 +6481,7 @@ }, "earcut": { "version": "2.2.4", - "resolved": "https://registry.npmmirror.com/earcut/-/earcut-2.2.4.tgz", + "resolved": "https://registry.npmjs.org/earcut/-/earcut-2.2.4.tgz", "integrity": "sha512-/pjZsA1b4RPHbeWZQn66SWS8nZZWLQQ23oE3Eam7aroEFGEvwKAsJfZ9ytiEMycfzXWpca4FA9QIOehf7PocBQ==" }, "easings-css": { @@ -8375,7 +8375,7 @@ }, "geojson-vt": { "version": "3.2.1", - "resolved": "https://registry.npmmirror.com/geojson-vt/-/geojson-vt-3.2.1.tgz", + "resolved": "https://registry.npmjs.org/geojson-vt/-/geojson-vt-3.2.1.tgz", "integrity": "sha512-EvGQQi/zPrDA6zr6BnJD/YhwAkBP8nnJ9emh3EnHQKVMfg/MRVtPbMYdgVy/IaEmn4UfagD2a6fafPDL5hbtwg==" }, "get-caller-file": { @@ -8427,7 +8427,7 @@ }, "gl-matrix": { "version": "3.4.3", - "resolved": "https://registry.npmmirror.com/gl-matrix/-/gl-matrix-3.4.3.tgz", + "resolved": "https://registry.npmjs.org/gl-matrix/-/gl-matrix-3.4.3.tgz", "integrity": "sha512-wcCp8vu8FT22BnvKVPjXa/ICBWRq/zjFfdofZy1WSpQZpphblv12/bOQLBC1rMM7SGOFS9ltVmKOHil5+Ml7gA==" }, "glob": { @@ -8572,7 +8572,7 @@ }, "good-listener": { "version": "1.2.2", - "resolved": "https://registry.npmjs.org/good-listener/-/good-listener-1.2.2.tgz", + "resolved": "https://registry.npmmirror.com/good-listener/-/good-listener-1.2.2.tgz", "integrity": "sha512-goW1b+d9q/HIwbVYZzZ6SsTr4IgE+WA44A0GmPIQstuOrgsFcT7VEJ48nmr9GaRtNu0XTKacFLGnBPAM6Afouw==", "requires": { "delegate": "^3.1.2" @@ -11057,7 +11057,7 @@ }, "kdbush": { "version": "3.0.0", - "resolved": "https://registry.npmmirror.com/kdbush/-/kdbush-3.0.0.tgz", + "resolved": "https://registry.npmjs.org/kdbush/-/kdbush-3.0.0.tgz", "integrity": "sha512-hRkd6/XW4HTsA9vjVpY9tuXJYLSlelnkTmVFu4M9/7MIYQtFcHpbugAU7UbOfjOiVSVYl2fqgBuJ32JUmRo5Ew==" }, "keyv": { @@ -11415,7 +11415,7 @@ }, "maplibre-gl": { "version": "2.2.0", - "resolved": "https://registry.npmmirror.com/maplibre-gl/-/maplibre-gl-2.2.0.tgz", + "resolved": "https://registry.npmjs.org/maplibre-gl/-/maplibre-gl-2.2.0.tgz", "integrity": "sha512-5LB7ROIxvBADPa4PmU2j+mp0jG5IIbEidCOyZEXVbEriluMJn0hz28vszVb4Cr2IA4YQ9cnERqjHaf33MHIRBQ==", "requires": { "@mapbox/geojson-rewind": "^0.5.2", @@ -11935,7 +11935,7 @@ }, "murmurhash-js": { "version": "1.0.0", - "resolved": "https://registry.npmmirror.com/murmurhash-js/-/murmurhash-js-1.0.0.tgz", + "resolved": "https://registry.npmjs.org/murmurhash-js/-/murmurhash-js-1.0.0.tgz", "integrity": "sha512-TvmkNhkv8yct0SVBSy+o8wYzXjE4Zz3PCesbfs8HiCXXdcTuocApFv11UWlNFWKYsP2okqrhb7JNlSm9InBhIw==" }, "mv": { @@ -12862,7 +12862,7 @@ }, "pbf": { "version": "3.2.1", - "resolved": "https://registry.npmmirror.com/pbf/-/pbf-3.2.1.tgz", + "resolved": "https://registry.npmjs.org/pbf/-/pbf-3.2.1.tgz", "integrity": "sha512-ClrV7pNOn7rtmoQVF4TS1vyU0WhYRnP92fzbfF75jAIwpnzdJXf8iTd4CMEqO4yUenH6NDqLiwjqlh6QgZzgLQ==", "requires": { "ieee754": "^1.1.12", @@ -15303,7 +15303,7 @@ }, "potpack": { "version": "1.0.2", - "resolved": "https://registry.npmmirror.com/potpack/-/potpack-1.0.2.tgz", + "resolved": "https://registry.npmjs.org/potpack/-/potpack-1.0.2.tgz", "integrity": "sha512-choctRBIV9EMT9WGAZHn3V7t0Z2pMQyl0EZE6pFc/6ml3ssw7Dlf/oAOvFwjm1HVsqfQN8GfeFyJ+d8tRzqueQ==" }, "preload": { @@ -15452,7 +15452,7 @@ }, "protocol-buffers-schema": { "version": "3.6.0", - "resolved": "https://registry.npmmirror.com/protocol-buffers-schema/-/protocol-buffers-schema-3.6.0.tgz", + "resolved": "https://registry.npmjs.org/protocol-buffers-schema/-/protocol-buffers-schema-3.6.0.tgz", "integrity": "sha512-TdDRD+/QNdrCGCE7v8340QyuXd4kIWIgapsE2+n/SaGiSSbomYl4TjHlvIoCWRpE7wFt02EpB35VVA2ImcBVqw==" }, "proxy-addr": { @@ -15574,7 +15574,7 @@ }, "quickselect": { "version": "2.0.0", - "resolved": "https://registry.npmmirror.com/quickselect/-/quickselect-2.0.0.tgz", + "resolved": "https://registry.npmjs.org/quickselect/-/quickselect-2.0.0.tgz", "integrity": "sha512-RKJ22hX8mHe3Y6wH/N3wCM6BWtjaxIyyUIkpHOvfFnxdI4yD4tBXEBKSbriGujF6jnSVkJrffuo6vxACiSSxIw==" }, "quill": { @@ -16069,7 +16069,7 @@ }, "resolve-protobuf-schema": { "version": "2.1.0", - "resolved": "https://registry.npmmirror.com/resolve-protobuf-schema/-/resolve-protobuf-schema-2.1.0.tgz", + "resolved": "https://registry.npmjs.org/resolve-protobuf-schema/-/resolve-protobuf-schema-2.1.0.tgz", "integrity": "sha512-kI5ffTiZWmJaS/huM8wZfEMer1eRd7oJQhDuxeCLe3t7N7mX3z94CN0xPxBQxFYQTSNz9T0i+v6inKqSdK8xrQ==", "requires": { "protocol-buffers-schema": "^3.3.1" @@ -16560,7 +16560,7 @@ }, "select": { "version": "1.1.2", - "resolved": "https://registry.npmjs.org/select/-/select-1.1.2.tgz", + "resolved": "https://registry.npmmirror.com/select/-/select-1.1.2.tgz", "integrity": "sha512-OwpTSOfy6xSs1+pwcNrv0RBMOzI39Lp3qQKUTPVVPRjCdNa5JH/oPRiqsesIskK8TVgmRiHwO4KXlV2Li9dANA==" }, "select-hose": { @@ -17572,7 +17572,7 @@ }, "supercluster": { "version": "7.1.5", - "resolved": "https://registry.npmmirror.com/supercluster/-/supercluster-7.1.5.tgz", + "resolved": "https://registry.npmjs.org/supercluster/-/supercluster-7.1.5.tgz", "integrity": "sha512-EulshI3pGUM66o6ZdH3ReiFcvHpM3vAigyK+vcxdjpJyEbIIrtbmBdY23mGgnI24uXiGFvrGq9Gkum/8U7vJWg==", "requires": { "kdbush": "^3.0.0" @@ -18044,7 +18044,7 @@ }, "tiny-emitter": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/tiny-emitter/-/tiny-emitter-2.1.0.tgz", + "resolved": "https://registry.npmmirror.com/tiny-emitter/-/tiny-emitter-2.1.0.tgz", "integrity": "sha512-NB6Dk1A9xgQPMoGqC5CVXn123gWyte215ONT5Pp5a0yt4nlEoO1ZWeCwpncaekPHXO60i47ihFnZPiRPjRMq4Q==" }, "tinycolor2": { @@ -18054,7 +18054,7 @@ }, "tinyqueue": { "version": "2.0.3", - "resolved": "https://registry.npmmirror.com/tinyqueue/-/tinyqueue-2.0.3.tgz", + "resolved": "https://registry.npmjs.org/tinyqueue/-/tinyqueue-2.0.3.tgz", "integrity": "sha512-ppJZNDuKGgxzkHihX8v9v9G5f+18gzaTfrukGrq6ueg0lmH4nqVnA2IPG0AEH3jKEk2GRJCUhDoqpoiw3PHLBA==" }, "tmp": { @@ -18728,7 +18728,7 @@ }, "vt-pbf": { "version": "3.1.3", - "resolved": "https://registry.npmmirror.com/vt-pbf/-/vt-pbf-3.1.3.tgz", + "resolved": "https://registry.npmjs.org/vt-pbf/-/vt-pbf-3.1.3.tgz", "integrity": "sha512-2LzDFzt0mZKZ9IpVF2r69G9bXaP2Q2sArJCmcCgvfTdCCZzSyz4aCLoQyUilu37Ll56tCblIZrXFIjNUpGIlmA==", "requires": { "@mapbox/point-geometry": "0.1.0", @@ -18743,7 +18743,7 @@ }, "vue-clipboard2": { "version": "0.3.3", - "resolved": "https://registry.npmjs.org/vue-clipboard2/-/vue-clipboard2-0.3.3.tgz", + "resolved": "https://registry.npmmirror.com/vue-clipboard2/-/vue-clipboard2-0.3.3.tgz", "integrity": "sha512-aNWXIL2DKgJyY/1OOeITwAQz1fHaCIGvUFHf9h8UcoQBG5a74MkdhS/xqoYe7DNZdQmZRL+TAdIbtUs9OyVjbw==", "requires": { "clipboard": "^2.0.0" diff --git a/nezha-fronted/package.json b/nezha-fronted/package.json index 8dfd2e29b..98851e730 100644 --- a/nezha-fronted/package.json +++ b/nezha-fronted/package.json @@ -28,7 +28,7 @@ "@topology/activity-diagram": "^1.1.0", "@topology/chart-diagram": "^1.1.0", "@topology/class-diagram": "^1.1.0", - "@topology/core": "^1.1.32", + "@topology/core": "^1.1.38", "@topology/flow-diagram": "^1.1.1", "@topology/form-diagram": "^1.1.32", "@topology/sequence-diagram": "^1.1.0", diff --git a/nezha-fronted/src/assets/css/common.scss b/nezha-fronted/src/assets/css/common.scss index 09de77b31..732618b6b 100644 --- a/nezha-fronted/src/assets/css/common.scss +++ b/nezha-fronted/src/assets/css/common.scss @@ -110,6 +110,9 @@ .color23bf9a { color: #23bf9a; } +.bgFFECD9{ + background: $--color-primary !important; +} .timezone-area { display: inline-block; vertical-align: middle; @@ -283,10 +286,18 @@ td .nz-icon-gear:before { border-color: $--border-color-light-hover; } } + #elementQuery{ + border: 1px solid $--border-color-light; + } .el-input__inner:hover { border-color: $--border-color-light-hover; } } +.query-input-active.el-input{ + #elementQuery{ + border: 1px solid $--border-color-light !important; + } +} .sub-box.detail-view-sub-box { .top-tools.top-tools--sub { padding: 0 15px 0 0; diff --git a/nezha-fronted/src/assets/css/components/common/bottomBox/issueTab.scss b/nezha-fronted/src/assets/css/components/common/bottomBox/issueTab.scss new file mode 100644 index 000000000..9eb6e6568 --- /dev/null +++ b/nezha-fronted/src/assets/css/components/common/bottomBox/issueTab.scss @@ -0,0 +1,134 @@ +#menu { + display: flex; + justify-content: space-between; + align-items: center; + flex-wrap: wrap; + } + #menu .menu-li { + display: flex; + flex-wrap: wrap; + width: 200px; + height: 90px; + margin-top: 40px; + position: relative; + } + #menu .menu-li .menu-i{ + font-size: 40px; + margin-right: 10px; + } + #menu .menu-li .describe { + position: absolute; + bottom: 40px; + right: 100px; + width: 50px; + color: $--color-text-secondary; + } + /* #menu .menu-li .menu-i,div{ + line-height: 100%; + } */ + .issuetab-header{ + height: 150px !important; + padding: 20px !important; + border-top: 1px solid $--border-color-light; + border-bottom: 1px solid $--border-color-light; + border-left:1px solid $--border-color-light; + .title{ + color: $--color-text-primary; + } + } + .issuetab-aside{ + position: relative; + height: 630px !important; + padding: 20px !important; + border: 1px solid $--border-color-light; + .add-comment-btn{ + position: absolute; + left: 0; + bottom: 0; + border: 1px solid $--border-color-light; + width: 370px; + padding-left: 20px; + color: $--color-text-regular; + } + } + .issuetab-main { + height: 480px !important; + padding: 20px !important; + border-left: 1px solid $--border-color-light; + border-bottom:1px solid $--border-color-light; + } + .issuetab-eltabs { + margin-top: 20px !important; + height: 400px; + /* height:90%; */ + overflow-y:auto; + overflow-x:hidden + } + /* .issuetab-eltabs .tab-pane{ + } */ + .textareas{ + background: pink; + width: 390px; + position: absolute; + bottom: 35px; + left: 0; + border: 1px solid $--border-color-light; + } + .btn-box{ + position: absolute; + /* bottom: -40px; */ + right: 0; + } + .description{ + position: relative; + line-height: 100%; + } + .description .fold, .open { + position: absolute; + top: 0px; + left: 0px; + cursor:pointer;/*鼠标变小手*/ + border: 1px solid ; + } + .description-title { + margin-left: 20px; + } + .description-content { + margin-left: 20px; + margin-top: 12px; + white-space:pre-wrap; + } + .relate-assets-box { + margin-top: 20px; + } + .relate-assets{ + position: relative; + line-height: 100%; + } + .relate-assets .fold, .open { + position: absolute; + top: 0px; + left: 0px; + cursor:pointer;/*鼠标变小手*/ + border: 1px solid ; + } + .relate-assets-title { + margin-left: 20px; + } + .relate-assets-content { + margin-left: 20px; + margin-top: 12px; + } + .content-data{ + margin-top: 10px; + margin-left: 20px; + } + .first-content{ + border-bottom: 1px solid $--border-color-light; + border-top: 1px solid $--border-color-light; + margin-top: 20px; + padding-top: 10px; + padding-bottom: 10px; + } + + \ No newline at end of file diff --git a/nezha-fronted/src/assets/css/components/common/rightBox/alertRuleBox.scss b/nezha-fronted/src/assets/css/components/common/rightBox/alertRuleBox.scss index bcaf315f8..a59e9559b 100644 --- a/nezha-fronted/src/assets/css/components/common/rightBox/alertRuleBox.scss +++ b/nezha-fronted/src/assets/css/components/common/rightBox/alertRuleBox.scss @@ -76,6 +76,9 @@ color: #FFFFFF; } } + .ͼ2 .cm-content{ + caret-color:$--color-text-regular; + } } .severity-item{ color: $--color-text-secondary; diff --git a/nezha-fronted/src/assets/css/components/index.scss b/nezha-fronted/src/assets/css/components/index.scss index cae2cdda0..134b5a21b 100644 --- a/nezha-fronted/src/assets/css/components/index.scss +++ b/nezha-fronted/src/assets/css/components/index.scss @@ -10,6 +10,7 @@ @import './common/alert/alertDaysInfo.scss'; @import './common/bottomBox/bottomBox.scss'; @import './common/bottomBox/panelTabNew.scss'; +@import './common/bottomBox/issueTab.scss'; @import './common/bottomBox/terminalLogCMDTab.scss'; @import './common/bottomBox/terminalLogMonitorTab.scss'; @import './common/bottomBox/terminalLogRecordTab.scss'; @@ -52,6 +53,7 @@ @import './common/rightBox/menuBox.scss'; @import './common/rightBox/moduleBox.scss'; @import './common/rightBox/ipam.scss'; +@import './common/rightBox/assetMetaBox.scss'; @import './common/rightBox/chartRightBox/chartRightBox.scss'; @import './common/rightBox/mibBox.scss'; @import './common/rightBox/assetBactchEditBox.scss'; diff --git a/nezha-fronted/src/assets/css/components/page/dashboard/explore/explore.scss b/nezha-fronted/src/assets/css/components/page/dashboard/explore/explore.scss index 3d0ef869d..37f6ed914 100644 --- a/nezha-fronted/src/assets/css/components/page/dashboard/explore/explore.scss +++ b/nezha-fronted/src/assets/css/components/page/dashboard/explore/explore.scss @@ -414,6 +414,10 @@ article { .box-overflow{ overflow-x: scroll; } + pre.box-overflow{ + overflow-x: scroll; + padding-bottom: 0; + } .logfmt-module,.json-module,.pattern-module,.regular-module,.unpack-module,.line-module,.formatting-module,.unwrapped-module{ pre { border: 0; diff --git a/nezha-fronted/src/assets/stylus/main.scss b/nezha-fronted/src/assets/stylus/main.scss index f694dca52..a13dcc7ef 100644 --- a/nezha-fronted/src/assets/stylus/main.scss +++ b/nezha-fronted/src/assets/stylus/main.scss @@ -1083,7 +1083,11 @@ li { width:0 !important; background-color: $--background-color-base; } -.nz-table .el-table__fixed, .nz-table .el-table__fixed-right { +// .nz-table .el-table__fixed, .nz-table .el-table__fixed-right { +// height: 100% !important; +// z-index: 1; +// } +.nz-table .el-table__fixed, .nz-table,.nz-table-list .el-table__fixed-right { height: 100% !important; z-index: 1; } diff --git a/nezha-fronted/src/components/chart/chart/chartMap.vue b/nezha-fronted/src/components/chart/chart/chartMap.vue index 50524c092..bf62c4bd5 100644 --- a/nezha-fronted/src/components/chart/chart/chartMap.vue +++ b/nezha-fronted/src/components/chart/chart/chartMap.vue @@ -135,7 +135,7 @@ export default { const z = urlParams[urlParams.length - 3] const x = urlParams[urlParams.length - 2] const y = urlParams[urlParams.length - 1] - const newUrl1 = `nzMap://static/Titles/${z}/${x}/${y}.pbf` + const newUrl1 = `nzMap:///static/Titles/${z}/${x}/${y}.pbf` return { url: newUrl1, credentials: 'include', @@ -145,7 +145,7 @@ export default { } if (resourceType === 'SpriteJSON') { return { - url: 'nzMap://static/Titles/sprite.json', + url: 'nzMap:///static/Titles/sprite.json', credentials: 'include', method: 'GET' // Include cookies for cross-origin requests @@ -153,7 +153,7 @@ export default { } if (resourceType === 'SpriteImage') { return { - url: 'nzMap://static/Titles/sprite.png', + url: 'nzMap:///static/Titles/sprite.png', credentials: 'include', method: 'GET' // Include cookies for cross-origin requests diff --git a/nezha-fronted/src/components/chart/chart/chartTimeSeries.vue b/nezha-fronted/src/components/chart/chart/chartTimeSeries.vue index 2f5e1226e..3c7ac23ce 100644 --- a/nezha-fronted/src/components/chart/chart/chartTimeSeries.vue +++ b/nezha-fronted/src/components/chart/chart/chartTimeSeries.vue @@ -146,10 +146,10 @@ export default { /* 使用setTimeout延迟渲染图表,避免样式错乱 */ setTimeout(() => { const myChart = this.isInit ? echarts.init(document.getElementById(`chart-canvas-${this.chartId}`)) : getChart(this.chartId) - myChart.clear() if (!myChart) { return } + myChart.clear() myChart.setOption(chartOption) this.isInit && setChart(this.chartId, myChart) // 缓存;不使用vue的data是为避免整个chart被监听导致卡顿 diff --git a/nezha-fronted/src/components/chart/chart/mapStyle.js b/nezha-fronted/src/components/chart/chart/mapStyle.js index 3ca65dbb5..394cc9b71 100644 --- a/nezha-fronted/src/components/chart/chart/mapStyle.js +++ b/nezha-fronted/src/components/chart/chart/mapStyle.js @@ -5,7 +5,7 @@ const mapAllStyle = { name: 'Maptiler.com: Basic', sources: { openmaptiles: { - url: 'static/Titles/tiles.json', + url: '/static/Titles/tiles.json', type: 'vector' }, maptiler_attribution: { @@ -15,7 +15,7 @@ const mapAllStyle = { }, layers: [{ id: 'background', type: 'background', paint: { 'background-color': 'rgb(242, 242, 242)' } }, { id: 'landuse_residential', type: 'fill', source: 'openmaptiles', 'source-layer': 'landuse', layout: { visibility: 'visible' }, paint: { 'fill-color': { stops: [[6, 'rgb(222, 222, 222)'], [14, 'rgb(253, 253, 253)'], [18, 'rgb(255, 255, 255)']] }, 'fill-opacity': 0.7 }, filter: ['all', ['in', 'class', 'residential', 'suburb', 'neighbourhood']] }, { id: 'landcover_grass', type: 'fill', source: 'openmaptiles', 'source-layer': 'landcover', paint: { 'fill-color': 'rgb(244, 244, 244)', 'fill-opacity': 0.4 }, filter: ['==', 'class', 'grass'] }, { id: 'landcover_wood', type: 'fill', source: 'openmaptiles', 'source-layer': 'landcover', paint: { 'fill-color': 'rgb(237, 237, 237)', 'fill-opacity': 0.8 }, filter: ['==', 'class', 'wood'] }, { id: 'landcover_sand', type: 'fill', source: 'openmaptiles', 'source-layer': 'landcover', paint: { 'fill-color': 'rgb(188, 188, 188)', 'fill-opacity': 0.3, 'fill-antialias': false }, metadata: {}, filter: ['all', ['in', 'class', 'sand']] }, { id: 'landcover_glacier', type: 'fill', source: 'openmaptiles', 'source-layer': 'landcover', layout: { visibility: 'visible' }, paint: { 'fill-color': 'rgb(243, 243, 243)', 'fill-opacity': 1 }, filter: ['all', ['in', 'subclass', 'glacier', 'ice_shelf']] }, { id: 'water', type: 'fill', source: 'openmaptiles', 'source-layer': 'water', layout: { visibility: 'visible' }, paint: { 'fill-color': 'rgb(217, 218, 221)' }, filter: ['all', ['!=', 'intermittent', 1], ['!=', 'brunnel', 'tunnel']] }, { id: 'water_intermittent', type: 'fill', source: 'openmaptiles', 'source-layer': 'water', layout: { visibility: 'visible' }, paint: { 'fill-color': 'rgb(217, 218, 221)', 'fill-opacity': 0.7 }, filter: ['all', ['==', 'intermittent', 1]] }, { id: 'waterway_tunnel', type: 'line', source: 'openmaptiles', 'source-layer': 'waterway', layout: { visibility: 'visible' }, paint: { 'line-color': 'rgb(217, 218, 221)', 'line-width': 1, 'line-opacity': 0.7, 'line-dasharray': [3, 3] }, filter: ['all', ['==', 'brunnel', 'tunnel']] }, { id: 'waterway', type: 'line', source: 'openmaptiles', 'source-layer': 'waterway', layout: { visibility: 'visible' }, paint: { 'line-color': 'rgb(217, 218, 221)', 'line-width': { stops: [[8, 1], [15, 3]] }, 'line-opacity': 1 }, filter: ['all', ['!in', 'brunnel', 'tunnel', 'bridge'], ['!=', 'intermittent', 1]] }, { id: 'waterway_intermittent', type: 'line', source: 'openmaptiles', 'source-layer': 'waterway', layout: { visibility: 'visible' }, paint: { 'line-color': 'rgb(217, 218, 221)', 'line-width': { stops: [[8, 1], [15, 3]] }, 'line-opacity': 1, 'line-dasharray': [2, 1] }, filter: ['all', ['!in', 'brunnel', 'tunnel', 'bridge'], ['==', 'intermittent', 1]] }, { id: 'building', type: 'fill', source: 'openmaptiles', 'source-layer': 'building', layout: { visibility: 'none' }, paint: { 'fill-color': 'rgba(212, 204, 176, 1)', 'fill-opacity': 0.6, 'fill-antialias': true } }, { id: 'road_area_pier', type: 'fill', source: 'openmaptiles', 'source-layer': 'transportation', layout: { visibility: 'visible' }, paint: { 'fill-color': 'rgb(250, 250, 250)', 'fill-opacity': 1, 'fill-antialias': true }, metadata: {}, filter: ['all', ['==', '$type', 'Polygon'], ['==', 'class', 'pier']] }, { id: 'road_area_bridge', type: 'fill', source: 'openmaptiles', 'source-layer': 'transportation', layout: {}, paint: { 'fill-color': 'hsl(47, 26%, 88%)', 'fill-opacity': 0.7 }, filter: ['all', ['==', '$type', 'Polygon'], ['in', 'brunnel', 'bridge']] }, { id: 'road_pier', type: 'line', source: 'openmaptiles', 'source-layer': 'transportation', layout: { 'line-cap': 'round', 'line-join': 'round' }, paint: { 'line-color': 'hsl(47, 26%, 88%)', 'line-width': 1 }, metadata: {}, filter: ['all', ['in', 'class', 'pier']] }, { id: 'road_path', type: 'line', source: 'openmaptiles', 'source-layer': 'transportation', minzoom: 14, layout: { 'line-cap': 'square', 'line-join': 'bevel' }, paint: { 'line-color': 'hsl(0, 0%, 97%)', 'line-width': { base: 1.55, stops: [[14, 0.5], [20, 4]] }, 'line-dasharray': [1, 1] }, filter: ['all', ['in', 'class', 'path', 'track']] }, { id: 'road_minor', type: 'line', source: 'openmaptiles', 'source-layer': 'transportation', minzoom: 13, layout: { 'line-cap': 'round', 'line-join': 'round', visibility: 'visible' }, paint: { 'line-color': 'hsl(0, 0%, 97%)', 'line-width': { base: 1.55, stops: [[4, 0.25], [20, 24]] } }, filter: ['all', ['in', 'class', 'minor', 'service']] }, { id: 'road_tunnel', type: 'line', source: 'openmaptiles', 'source-layer': 'transportation', layout: { 'line-cap': 'butt', 'line-join': 'miter', visibility: 'visible' }, paint: { 'line-color': '#fff', 'line-width': { base: 1.4, stops: [[7, 0.5], [20, 24]] }, 'line-opacity': 0.75, 'line-dasharray': [0.28, 0.14] }, filter: ['all', ['==', 'brunnel', 'tunnel'], ['in', 'class', 'primary', 'secondary', 'tertiary', 'trunk', 'minor_road']] }, { id: 'road_major', type: 'line', source: 'openmaptiles', 'source-layer': 'transportation', minzoom: 7, layout: { 'line-cap': 'round', 'line-join': 'round', visibility: 'visible' }, paint: { 'line-color': '#fff', 'line-width': { base: 1.4, stops: [[7, 0.5], [20, 28]] } }, filter: ['all', ['in', 'class', 'trunk', 'primary', 'secondary', 'tertiary'], ['!=', 'brunnel', 'tunnel'], ['!=', 'brunnel', 'bridge']] }, { id: 'road_motorway', type: 'line', source: 'openmaptiles', 'source-layer': 'transportation', minzoom: 4, layout: { 'line-cap': 'round', 'line-join': 'round', visibility: 'visible' }, paint: { 'line-color': 'hsl(0, 0%, 100%)', 'line-width': { base: 1.4, stops: [[8, 1], [16, 10]] }, 'line-offset': 0 }, filter: ['all', ['==', 'class', 'motorway']] }, { id: 'railway_transit_tunnel', type: 'line', source: 'openmaptiles', 'source-layer': 'transportation', minzoom: 0, layout: { 'line-cap': 'butt', 'line-join': 'miter', visibility: 'visible' }, paint: { 'line-color': 'hsl(34, 12%, 66%)', 'line-opacity': 0.5, 'line-dasharray': [3, 3] }, filter: ['all', ['==', 'brunnel', 'tunnel'], ['==', 'class', 'transit']] }, { id: 'railway', type: 'line', source: 'openmaptiles', 'source-layer': 'transportation', minzoom: 11, layout: { visibility: 'visible' }, paint: { 'line-color': 'hsl(34, 12%, 66%)', 'line-opacity': 0.5 }, filter: ['==', 'class', 'rail'] }, { id: 'railway_transit', type: 'line', source: 'openmaptiles', 'source-layer': 'transportation', layout: { visibility: 'visible' }, paint: { 'line-color': 'hsl(34, 12%, 66%)', 'line-opacity': 0.5 }, filter: ['all', ['==', 'class', 'transit'], ['!=', 'brunnel', 'tunnel']] }, { id: 'aeroway_taxiway', type: 'line', source: 'openmaptiles', 'source-layer': 'aeroway', minzoom: 12, layout: { 'line-cap': 'round', 'line-join': 'round', visibility: 'visible' }, paint: { 'line-color': 'rgba(255, 255, 255, 1)', 'line-width': 1, 'line-opacity': 1 }, metadata: { 'mapbox:group': '1444849345966.4436' }, filter: ['all', ['in', 'class', 'taxiway']] }, { id: 'aeroway_runway', type: 'line', source: 'openmaptiles', 'source-layer': 'aeroway', minzoom: 4, layout: { 'line-cap': 'round', 'line-join': 'round', visibility: 'visible' }, paint: { 'line-color': 'rgba(255, 255, 255, 1)', 'line-width': 5, 'line-opacity': 1 }, metadata: { 'mapbox:group': '1444849345966.4436' }, filter: ['all', ['in', 'class', 'runway']] }, { id: 'bridge_waterway', type: 'line', source: 'openmaptiles', 'source-layer': 'waterway', layout: { 'line-cap': 'round', 'line-join': 'round', visibility: 'none' }, paint: { 'line-color': 'hsl(205, 56%, 73%)', 'line-width': 1 }, filter: ['all', ['==', 'brunnel', 'bridge']] }, { id: 'bridge', type: 'line', source: 'openmaptiles', 'source-layer': 'transportation', layout: { 'line-cap': 'round', 'line-join': 'round', visibility: 'visible' }, paint: { 'line-color': '#fff', 'line-width': { base: 1.4, stops: [[7, 0.5], [20, 28]] } }, filter: ['all', ['==', 'brunnel', 'bridge'], ['in', 'class', 'primary', 'secondary', 'tertiary', 'trunk']] }, { id: 'admin_sub', type: 'line', source: 'openmaptiles', 'source-layer': 'boundary', minzoom: 3, layout: { visibility: 'visible' }, paint: { 'line-color': 'rgba(184, 192, 201, 0.5)', 'line-width': 1.25, 'line-dasharray': [2, 1] }, filter: ['in', 'admin_level', 4, 6, 8] }, { id: 'admin_disputed', type: 'line', source: 'openmaptiles', 'source-layer': 'boundary', minzoom: 5, layout: { 'line-cap': 'round', 'line-join': 'round', visibility: 'visible' }, paint: { 'line-color': 'rgb(194, 201, 209)', 'line-width': 1, 'line-dasharray': [2, 2] }, filter: ['all', ['<=', 'admin_level', 2], ['==', '$type', 'LineString'], ['==', 'disputed', 1]] }, { id: 'admin_country', type: 'line', source: 'openmaptiles', 'source-layer': 'boundary', minzoom: 0, layout: { 'line-cap': 'round', 'line-join': 'round', visibility: 'visible' }, paint: { 'line-color': 'rgb(194, 201, 209)', 'line-width': 1 }, filter: ['all', ['<=', 'admin_level', 2], ['==', '$type', 'LineString'], ['!has', 'claimed_by']] }, { id: 'label_airport', type: 'symbol', source: 'openmaptiles', 'source-layer': 'aerodrome_label', minzoom: 10, layout: { 'icon-size': 1, 'text-font': ['Noto Sans Regular'], 'text-size': 11, 'text-field': '{name:latin}\n{name:nonlatin}', visibility: 'visible', 'text-anchor': 'top', 'text-offset': [0, 0.5], 'text-max-width': 8 }, paint: { 'text-color': 'rgb(215, 217, 220)', 'text-halo-blur': 1, 'text-halo-color': 'rgba(255, 255, 255, 0.75)', 'text-halo-width': 1 }, filter: ['all', ['has', 'iata']] }, { id: 'label_road', type: 'symbol', source: 'openmaptiles', 'source-layer': 'transportation_name', minzoom: 13, layout: { 'text-font': ['Noto Sans Regular'], 'text-size': { base: 1.4, stops: [[10, 8], [20, 14]] }, 'text-field': '{name:latin} {name:nonlatin}', visibility: 'visible', 'text-transform': 'uppercase', 'symbol-placement': 'line', 'text-letter-spacing': 0.1, 'text-rotation-alignment': 'map' }, paint: { 'text-color': 'rgb(107, 115, 124)', 'text-halo-color': 'rgb(255, 255, 255)', 'text-halo-width': 2 }, filter: ['all', ['==', '$type', 'LineString'], ['!=', 'subclass', 'ferry']] }, { id: 'label_place_other', type: 'symbol', source: 'openmaptiles', 'source-layer': 'place', minzoom: 8, layout: { 'text-font': ['Noto Sans Regular'], 'text-size': { stops: [[6, 10], [12, 14]] }, 'text-field': '{name:latin}\n{name:nonlatin}', visibility: 'visible', 'text-anchor': 'center', 'text-max-width': 6 }, paint: { 'text-color': 'rgb(174, 179, 185)', 'text-halo-blur': 0, 'text-halo-color': 'rgb(255, 255, 255)', 'text-halo-width': 2 }, filter: ['all', ['==', '$type', 'Point'], ['!in', 'class', 'city', 'state', 'country', 'continent']] }, { id: 'label_place_city', type: 'symbol', source: 'openmaptiles', 'source-layer': 'place', maxzoom: 16, layout: { 'text-font': ['Noto Sans Regular'], 'text-size': { stops: [[3, 11], [8, 16]] }, 'text-field': '{name:latin}\n{name:nonlatin}', 'text-max-width': 10 }, paint: { 'text-color': 'rgb(107, 115, 124)', 'text-halo-blur': 0, 'text-halo-color': 'rgba(255, 255, 255, 0.75)', 'text-halo-width': 2 }, filter: ['all', ['==', '$type', 'Point'], ['==', 'class', 'city']] }, { id: 'label_country_other', type: 'symbol', source: 'openmaptiles', 'source-layer': 'place', maxzoom: 12, layout: { 'text-font': ['Noto Sans Regular'], 'text-size': { stops: [[3, 12], [8, 22]] }, 'text-field': '{name:latin}', visibility: 'visible', 'text-max-width': 10 }, paint: { 'text-color': 'rgb(141, 148, 156)', 'text-halo-blur': 0, 'text-halo-color': 'rgba(255, 255, 255, 0.75)', 'text-halo-width': 2 }, filter: ['all', ['==', '$type', 'Point'], ['==', 'class', 'country'], ['!has', 'iso_a2']] }, { id: 'label_country', type: 'symbol', source: 'openmaptiles', 'source-layer': 'place', maxzoom: 12, layout: { 'text-font': ['Noto Sans Bold'], 'text-size': { stops: [[3, 12], [8, 22]] }, 'text-field': '{name:latin}', visibility: 'visible', 'text-max-width': 10 }, paint: { 'text-color': 'rgb(141, 148, 156)', 'text-halo-blur': 0, 'text-halo-color': 'rgba(255, 255, 255, 0.75)', 'text-halo-width': 2 }, filter: ['all', ['==', '$type', 'Point'], ['==', 'class', 'country'], ['has', 'iso_a2']] }], metadata: { 'maptiler:copyright': 'This style was generated on MapTiler Cloud. Usage outside of MapTiler Cloud or MapTiler Server requires valid MapTiler Data package: https://www.maptiler.com/data/ -- please contact us.' }, - glyphs: 'static/Titles/fonts/{fontstack}/{range}.pbf?key=rB2y2a2rG8i9SEjOXQXl', + glyphs: '/static/Titles/fonts/{fontstack}/{range}.pbf?key=rB2y2a2rG8i9SEjOXQXl', sprite: 'https://www.maptiler.com/static/Titles/sprite', bearing: 0, pitch: 0, @@ -28,7 +28,7 @@ const mapAllStyle = { name: 'Maptiler.com: Basic', sources: { openmaptiles: { - url: 'static/Titles/tiles.json', + url: '/static/Titles/tiles.json', type: 'vector' }, maptiler_attribution: { @@ -38,7 +38,7 @@ const mapAllStyle = { }, layers: [{ id: 'background', type: 'background', paint: { 'background-color': 'rgb(33, 33, 33)' } }, { id: 'landuse_residential', type: 'fill', source: 'openmaptiles', 'source-layer': 'landuse', layout: { visibility: 'visible' }, paint: { 'fill-color': { stops: [[6, 'rgb(13, 13, 13)'], [14, 'rgb(44, 44, 44)'], [18, 'rgb(56, 56, 56)']] }, 'fill-opacity': 0.7 }, filter: ['all', ['in', 'class', 'residential', 'suburb', 'neighbourhood']] }, { id: 'landcover_grass', type: 'fill', source: 'openmaptiles', 'source-layer': 'landcover', paint: { 'fill-color': 'rgb(23, 23, 23)', 'fill-opacity': 0.4 }, filter: ['==', 'class', 'grass'] }, { id: 'landcover_wood', type: 'fill', source: 'openmaptiles', 'source-layer': 'landcover', paint: { 'fill-color': 'rgb(16, 16, 16)', 'fill-opacity': 0.8 }, filter: ['==', 'class', 'wood'] }, { id: 'landcover_sand', type: 'fill', source: 'openmaptiles', 'source-layer': 'landcover', paint: { 'fill-color': 'rgb(0, 0, 0)', 'fill-opacity': 0.3, 'fill-antialias': false }, metadata: {}, filter: ['all', ['in', 'class', 'sand']] }, { id: 'landcover_glacier', type: 'fill', source: 'openmaptiles', 'source-layer': 'landcover', layout: { visibility: 'none' }, paint: { 'fill-color': 'rgba(236, 235, 230, 1)', 'fill-opacity': 1 }, filter: ['all', ['in', 'subclass', 'glacier', 'ice_shelf']] }, { id: 'water', type: 'fill', source: 'openmaptiles', 'source-layer': 'water', layout: { visibility: 'visible' }, paint: { 'fill-color': 'rgb(0, 0, 0)' }, filter: ['all', ['!=', 'intermittent', 1], ['!=', 'brunnel', 'tunnel']] }, { id: 'water_intermittent', type: 'fill', source: 'openmaptiles', 'source-layer': 'water', layout: { visibility: 'visible' }, paint: { 'fill-color': 'rgb(0, 0, 0)', 'fill-opacity': 0.7 }, filter: ['all', ['==', 'intermittent', 1]] }, { id: 'waterway_tunnel', type: 'line', source: 'openmaptiles', 'source-layer': 'waterway', layout: { visibility: 'visible' }, paint: { 'line-color': 'rgb(0, 0, 0)', 'line-width': 1, 'line-opacity': 0.7, 'line-dasharray': [3, 3] }, filter: ['all', ['==', 'brunnel', 'tunnel']] }, { id: 'waterway', type: 'line', source: 'openmaptiles', 'source-layer': 'waterway', layout: { visibility: 'visible' }, paint: { 'line-color': 'rgb(0, 0, 0)', 'line-width': { stops: [[8, 1], [15, 3]] }, 'line-opacity': 1 }, filter: ['all', ['!in', 'brunnel', 'tunnel', 'bridge'], ['!=', 'intermittent', 1]] }, { id: 'waterway_intermittent', type: 'line', source: 'openmaptiles', 'source-layer': 'waterway', layout: { visibility: 'visible' }, paint: { 'line-color': 'rgb(0, 0, 0)', 'line-width': { stops: [[8, 1], [15, 3]] }, 'line-opacity': 1, 'line-dasharray': [2, 1] }, filter: ['all', ['!in', 'brunnel', 'tunnel', 'bridge'], ['==', 'intermittent', 1]] }, { id: 'building', type: 'fill', source: 'openmaptiles', 'source-layer': 'building', paint: { 'fill-color': 'rgb(51, 51, 51)', 'fill-opacity': 0.6, 'fill-antialias': true } }, { id: 'road_area_pier', type: 'fill', source: 'openmaptiles', 'source-layer': 'transportation', layout: { visibility: 'visible' }, paint: { 'fill-color': 'rgb(41, 41, 41)', 'fill-opacity': 1, 'fill-antialias': true }, metadata: {}, filter: ['all', ['==', '$type', 'Polygon'], ['==', 'class', 'pier']] }, { id: 'road_area_bridge', type: 'fill', source: 'openmaptiles', 'source-layer': 'transportation', layout: {}, paint: { 'fill-color': 'rgb(24, 21, 14)', 'fill-opacity': 0.7 }, filter: ['all', ['==', '$type', 'Polygon'], ['in', 'brunnel', 'bridge']] }, { id: 'road_pier', type: 'line', source: 'openmaptiles', 'source-layer': 'transportation', layout: { 'line-cap': 'round', 'line-join': 'round' }, paint: { 'line-color': 'rgb(24, 21, 14)', 'line-width': 1 }, metadata: {}, filter: ['all', ['in', 'class', 'pier']] }, { id: 'road_path', type: 'line', source: 'openmaptiles', 'source-layer': 'transportation', minzoom: 14, layout: { 'line-cap': 'square', 'line-join': 'bevel' }, paint: { 'line-color': 'rgb(42, 42, 42)', 'line-width': { base: 1.55, stops: [[14, 0.5], [20, 4]] }, 'line-dasharray': [1, 1] }, filter: ['all', ['in', 'class', 'path', 'track']] }, { id: 'road_minor', type: 'line', source: 'openmaptiles', 'source-layer': 'transportation', minzoom: 13, layout: { 'line-cap': 'round', 'line-join': 'round', visibility: 'visible' }, paint: { 'line-color': 'rgb(42, 42, 42)', 'line-width': { base: 1.55, stops: [[4, 0.25], [20, 24]] } }, filter: ['all', ['in', 'class', 'minor', 'service']] }, { id: 'road_tunnel', type: 'line', source: 'openmaptiles', 'source-layer': 'transportation', layout: { 'line-cap': 'butt', 'line-join': 'miter', visibility: 'visible' }, paint: { 'line-color': 'rgb(50, 50, 50)', 'line-width': { base: 1.4, stops: [[7, 0.5], [20, 24]] }, 'line-opacity': 0.75, 'line-dasharray': [0.28, 0.14] }, filter: ['all', ['==', 'brunnel', 'tunnel'], ['in', 'class', 'primary', 'secondary', 'tertiary', 'trunk', 'minor_road']] }, { id: 'road_major', type: 'line', source: 'openmaptiles', 'source-layer': 'transportation', minzoom: 7, layout: { 'line-cap': 'round', 'line-join': 'round', visibility: 'visible' }, paint: { 'line-color': 'rgb(50, 50, 50)', 'line-width': { base: 1.4, stops: [[7, 0.5], [20, 28]] } }, filter: ['all', ['in', 'class', 'trunk', 'primary', 'secondary', 'tertiary'], ['!=', 'brunnel', 'tunnel'], ['!=', 'brunnel', 'bridge']] }, { id: 'road_motorway', type: 'line', source: 'openmaptiles', 'source-layer': 'transportation', minzoom: 4, layout: { 'line-cap': 'round', 'line-join': 'round', visibility: 'visible' }, paint: { 'line-color': 'rgb(50, 50, 50)', 'line-width': { base: 1.4, stops: [[8, 1], [16, 10]] }, 'line-offset': 0 }, filter: ['all', ['==', 'class', 'motorway']] }, { id: 'railway_transit_tunnel', type: 'line', source: 'openmaptiles', 'source-layer': 'transportation', minzoom: 0, layout: { 'line-cap': 'butt', 'line-join': 'miter', visibility: 'visible' }, paint: { 'line-color': 'rgb(0, 0, 0)', 'line-opacity': 0.5, 'line-dasharray': [3, 3] }, filter: ['all', ['==', 'brunnel', 'tunnel'], ['==', 'class', 'transit']] }, { id: 'railway', type: 'line', source: 'openmaptiles', 'source-layer': 'transportation', minzoom: 11, layout: { visibility: 'visible' }, paint: { 'line-color': 'rgb(0, 0, 0)', 'line-opacity': 0.5 }, filter: ['==', 'class', 'rail'] }, { id: 'railway_transit', type: 'line', source: 'openmaptiles', 'source-layer': 'transportation', layout: { visibility: 'visible' }, paint: { 'line-color': 'rgb(0, 0, 0)', 'line-opacity': 0.5 }, filter: ['all', ['==', 'class', 'transit'], ['!=', 'brunnel', 'tunnel']] }, { id: 'aeroway_taxiway', type: 'line', source: 'openmaptiles', 'source-layer': 'aeroway', minzoom: 12, layout: { 'line-cap': 'round', 'line-join': 'round', visibility: 'visible' }, paint: { 'line-color': 'rgb(50, 50, 50)', 'line-width': 1, 'line-opacity': 1 }, metadata: { 'mapbox:group': '1444849345966.4436' }, filter: ['all', ['in', 'class', 'taxiway']] }, { id: 'aeroway_runway', type: 'line', source: 'openmaptiles', 'source-layer': 'aeroway', minzoom: 4, layout: { 'line-cap': 'round', 'line-join': 'round', visibility: 'visible' }, paint: { 'line-color': 'rgb(50, 50, 50)', 'line-width': 5, 'line-opacity': 1 }, metadata: { 'mapbox:group': '1444849345966.4436' }, filter: ['all', ['in', 'class', 'runway']] }, { id: 'bridge_waterway', type: 'line', source: 'openmaptiles', 'source-layer': 'waterway', layout: { 'line-cap': 'round', 'line-join': 'round', visibility: 'none' }, paint: { 'line-color': 'hsl(205, 56%, 73%)', 'line-width': 1 }, filter: ['all', ['==', 'brunnel', 'bridge']] }, { id: 'bridge', type: 'line', source: 'openmaptiles', 'source-layer': 'transportation', layout: { 'line-cap': 'round', 'line-join': 'round', visibility: 'visible' }, paint: { 'line-color': 'rgb(50, 50, 50)', 'line-width': { base: 1.4, stops: [[7, 0.5], [20, 28]] } }, filter: ['all', ['==', 'brunnel', 'bridge'], ['in', 'class', 'primary', 'secondary', 'tertiary', 'trunk']] }, { id: 'admin_sub', type: 'line', source: 'openmaptiles', 'source-layer': 'boundary', minzoom: 3, layout: { visibility: 'visible' }, paint: { 'line-color': 'rgba(59, 59, 59, 0.5)', 'line-width': 1.25, 'line-dasharray': [2, 1] }, filter: ['in', 'admin_level', 4, 6, 8] }, { id: 'admin_disputed', type: 'line', source: 'openmaptiles', 'source-layer': 'boundary', minzoom: 5, layout: { 'line-cap': 'round', 'line-join': 'round', visibility: 'visible' }, paint: { 'line-color': 'rgb(68, 68, 68)', 'line-width': 1, 'line-dasharray': [2, 2] }, filter: ['all', ['<=', 'admin_level', 2], ['==', '$type', 'LineString'], ['==', 'disputed', 1]] }, { id: 'admin_country', type: 'line', source: 'openmaptiles', 'source-layer': 'boundary', minzoom: 0, layout: { 'line-cap': 'round', 'line-join': 'round', visibility: 'visible' }, paint: { 'line-color': 'rgb(68, 68, 68)', 'line-width': 1 }, filter: ['all', ['<=', 'admin_level', 2], ['==', '$type', 'LineString'], ['!has', 'claimed_by']] }, { id: 'label_airport', type: 'symbol', source: 'openmaptiles', 'source-layer': 'aerodrome_label', minzoom: 10, layout: { 'icon-size': 1, 'text-font': ['Noto Sans Regular'], 'text-size': 11, 'text-field': '{name:latin}\n{name:nonlatin}', visibility: 'visible', 'text-anchor': 'top', 'text-offset': [0, 0.5], 'text-max-width': 8 }, paint: { 'text-color': 'rgb(110, 110, 110)', 'text-halo-blur': 1, 'text-halo-color': 'rgba(0, 0, 0, 0.75)', 'text-halo-width': 1 }, filter: ['all', ['has', 'iata']] }, { id: 'label_road', type: 'symbol', source: 'openmaptiles', 'source-layer': 'transportation_name', minzoom: 13, layout: { 'text-font': ['Noto Sans Regular'], 'text-size': { base: 1.4, stops: [[10, 8], [20, 14]] }, 'text-field': '{name:latin} {name:nonlatin}', visibility: 'visible', 'text-transform': 'uppercase', 'symbol-placement': 'line', 'text-letter-spacing': 0.1, 'text-rotation-alignment': 'map' }, paint: { 'text-color': 'rgb(212, 212, 212)', 'text-halo-color': 'rgb(0, 0, 0)', 'text-halo-width': 2 }, filter: ['all', ['==', '$type', 'LineString'], ['!=', 'subclass', 'ferry']] }, { id: 'label_place_other', type: 'symbol', source: 'openmaptiles', 'source-layer': 'place', minzoom: 8, layout: { 'text-font': ['Noto Sans Regular'], 'text-size': { stops: [[6, 10], [12, 14]] }, 'text-field': '{name:latin}\n{name:nonlatin}', visibility: 'visible', 'text-anchor': 'center', 'text-max-width': 6 }, paint: { 'text-color': 'rgb(148, 148, 148)', 'text-halo-blur': 0, 'text-halo-color': 'rgb(0, 0, 0)', 'text-halo-width': 2 }, filter: ['all', ['==', '$type', 'Point'], ['!in', 'class', 'city', 'state', 'country', 'continent']] }, { id: 'label_place_city', type: 'symbol', source: 'openmaptiles', 'source-layer': 'place', maxzoom: 16, layout: { 'text-font': ['Noto Sans Regular'], 'text-size': { stops: [[3, 11], [8, 16]] }, 'text-field': '{name:latin}\n{name:nonlatin}', 'text-max-width': 10 }, paint: { 'text-color': 'rgb(212, 212, 212)', 'text-halo-blur': 0, 'text-halo-color': 'rgba(0, 0, 0, 0.75)', 'text-halo-width': 2 }, filter: ['all', ['==', '$type', 'Point'], ['==', 'class', 'city']] }, { id: 'label_country_other', type: 'symbol', source: 'openmaptiles', 'source-layer': 'place', maxzoom: 12, layout: { 'text-font': ['Noto Sans Regular'], 'text-size': { stops: [[3, 12], [8, 22]] }, 'text-field': '{name:latin}', visibility: 'visible', 'text-max-width': 10 }, paint: { 'text-color': 'rgb(179, 179, 179)', 'text-halo-blur': 0, 'text-halo-color': 'rgba(0, 0, 0, 0.75)', 'text-halo-width': 2 }, filter: ['all', ['==', '$type', 'Point'], ['==', 'class', 'country'], ['!has', 'iso_a2']] }, { id: 'label_country', type: 'symbol', source: 'openmaptiles', 'source-layer': 'place', maxzoom: 12, layout: { 'text-font': ['Noto Sans Bold'], 'text-size': { stops: [[3, 12], [8, 22]] }, 'text-field': '{name:latin}', visibility: 'visible', 'text-max-width': 10 }, paint: { 'text-color': 'rgb(179, 179, 179)', 'text-halo-blur': 0, 'text-halo-color': 'rgba(0, 0, 0, 0.75)', 'text-halo-width': 2 }, filter: ['all', ['==', '$type', 'Point'], ['==', 'class', 'country'], ['has', 'iso_a2']] }], metadata: { 'maptiler:copyright': 'This style was generated on MapTiler Cloud. Usage outside of MapTiler Cloud or MapTiler Server requires valid MapTiler Data package: https://www.maptiler.com/data/ -- please contact us.' }, - glyphs: 'static/Titles/fonts/{fontstack}/{range}.pbf?key=rB2y2a2rG8i9SEjOXQXl', + glyphs: '/static/Titles/fonts/{fontstack}/{range}.pbf?key=rB2y2a2rG8i9SEjOXQXl', sprite: 'https://www.maptiler.com/static/Titles/sprite', bearing: 0, pitch: 0, diff --git a/nezha-fronted/src/components/common/ChartDiagram/diagram.vue b/nezha-fronted/src/components/common/ChartDiagram/diagram.vue index baf465be0..1e6d88544 100644 --- a/nezha-fronted/src/components/common/ChartDiagram/diagram.vue +++ b/nezha-fronted/src/components/common/ChartDiagram/diagram.vue @@ -698,7 +698,9 @@ export default { if (this.fromTopologyDialog && !this.isPreview) { setTimeout(() => { this.topologyLoading = false - console.log(data) + if (!data.pens) { + data.pens = [] + } getTopology(this.topologyIndex).open(data || {}) getTopology(this.topologyIndex).centerView() getTopology(this.topologyIndex).resize() @@ -709,6 +711,9 @@ export default { if (!getTopology(this.topologyIndex)) { return } + if (!data.pens) { + data.pens = [] + } getTopology(this.topologyIndex).open(data || {}) getTopology(this.topologyIndex).lock(1) this.objChange = false @@ -856,7 +861,7 @@ export default { gridColor: '#ededed', lineWidth: 1, ruleColor: '#4e4e4e', - pens:[] + pens: [] } this.projectInfoShow = true this.projectAlertShow = true @@ -865,6 +870,7 @@ export default { data.ruleColor = this.theme == 'light' ? '#4e4e4e' : '#BEBEBE' resolve(data) } else { + delete data.origin data.ruleColor = this.theme == 'light' ? '#4e4e4e' : '#BEBEBE' if (data.data) { this.topologyInfo = { @@ -1213,7 +1219,15 @@ export default { }, onUpdateProps (node) { - getTopology(this.topologyIndex).setValue(node) + const obj = this.$loadsh.cloneDeep(node) + delete obj.x + delete obj.y + delete obj.center + delete obj.ex + delete obj.ey + delete obj.width + delete obj.height + getTopology(this.topologyIndex).setValue(obj) }, handleAvatarSuccess () { @@ -1754,7 +1768,10 @@ export default { const domRect = dom ? dom.getBoundingClientRect() : {} getTopology(this.topologyIndex).canvasPos = domRect if (this.fromOverView) { - getTopology(this.topologyIndex).open(this.oldTopologyData || {}) + if (this.oldTopologyData && !this.oldTopologyData.pens) { + this.oldTopologyData.pens = [] + } + getTopology(this.topologyIndex).open(this.oldTopologyData || {}) } let flag = false const position = { diff --git a/nezha-fronted/src/components/common/alert/alertLabel.vue b/nezha-fronted/src/components/common/alert/alertLabel.vue index 2a0b932ec..45cb6b807 100644 --- a/nezha-fronted/src/components/common/alert/alertLabel.vue +++ b/nezha-fronted/src/components/common/alert/alertLabel.vue @@ -52,7 +52,7 @@
{{$t('overall.name')}}
{{alertLabelData && alertLabelData.name ? alertLabelData.name : '--'}}
- +
diff --git a/nezha-fronted/src/components/common/bottomBox/bottomBox.vue b/nezha-fronted/src/components/common/bottomBox/bottomBox.vue index c24077f29..893d8fa7a 100644 --- a/nezha-fronted/src/components/common/bottomBox/bottomBox.vue +++ b/nezha-fronted/src/components/common/bottomBox/bottomBox.vue @@ -37,11 +37,12 @@ - - - - - + + + + + + @@ -66,6 +67,8 @@ + + @@ -75,6 +78,7 @@ import cabinetTab from './tabs/cabinetTab' import alertMessageTab from './tabs/alertMessageTab' import alertMessageTabNew from './tabs/alertMessageTabNew' +import issueTab from './tabs/issueTab' import alertRuleEvalLog from './tabs/alertRuleEvalLog' import assetSubTab from './tabs/assetSubTab' import endpointQuery from './tabs/endpointQuery' @@ -89,15 +93,19 @@ import terminalLogTab from './tabs/terminalLogTab' import assetTab from '@/components/common/bottomBox/tabs/assetTab' import { fromRoute } from '@/components/common/js/constants' import LogBottomTab from '@/components/common/bottomBox/tabs/logBottomTab' +import processBottomTab from '@/components/common/bottomBox/tabs/processBottomTab' import scrapeEndpoint from '@/components/common/bottomBox/tabs/scrapeEndpoint' import IpDetails from '@/components/common/bottomBox/tabs/IpDetails' import recordRuleEvalLog from '@/components/common/bottomBox/tabs/recordRuleEvalLog' +import routerPathParams from '@/components/common/mixin/routerPathParams' export default { name: 'bottomBox', + mixins: [routerPathParams], components: { scrapeEndpoint, LogBottomTab, + processBottomTab, cabinetTab, alertMessageTab, endpointTab, @@ -114,7 +122,8 @@ export default { assetSubTab, alertRuleEvalLog, IpDetails, - recordRuleEvalLog + recordRuleEvalLog, + issueTab }, props: { isFullScreen: Boolean, // 是否全屏 @@ -129,22 +138,21 @@ export default { obj: { immediate: true, handler (n) { - if ((this.from === fromRoute.asset) && n) { - const assetSub = { prop: 'assetSubTab', name: this.$t('overall.assetSubTab'), active: false } - if (n.childrenNum) { - if (!this.tabs.asset.panel.find(item => item.prop === assetSub.prop)) { - this.tabs.asset.panel.push(assetSub) - this.tabs.asset.alertMessage.push(assetSub) - this.tabs.asset.endpoint.push(assetSub) - this.tabs.asset.log.push(assetSub) - } - } else if (this.tabs.asset.panel.find(item => item.prop === assetSub.prop)) { - this.tabs.asset.panel = this.tabs.asset.panel.filter(item => item.prop !== assetSub.prop) - this.tabs.asset.alertMessage = this.tabs.asset.alertMessage.filter(item => item.prop !== assetSub.prop) - this.tabs.asset.endpoint = this.tabs.asset.endpoint.filter(item => item.prop !== assetSub.prop) - this.tabs.asset.log = this.tabs.asset.log.filter(item => item.prop !== assetSub.prop) - } - } + // if ((this.from === fromRoute.asset) && n) { + // const assetSub = { prop: 'assetSubTab', name: this.$t('overall.assetSubTab'), active: false } + // if (n.childrenNum) { + // if (!this.tabs.asset.panel.find(item => item.prop === assetSub.prop)) { + // this.tabs.asset.panel.push(assetSub) + // this.tabs.asset.alertMessage.push(assetSub) + // this.tabs.asset.endpoint.push(assetSub) + // this.tabs.asset.log.push(assetSub) + // } + // } else if (this.tabs.asset.panel.find(item => item.prop === assetSub.prop)) { + // this.tabs.asset.panel = this.tabs.asset.panel.filter(item => item.prop !== assetSub.prop) + // this.tabs.asset.alertMessage = this.tabs.asset.alertMessage.filter(item => item.prop !== assetSub.prop) + // this.tabs.asset.endpoint = this.tabs.asset.endpoint.filter(item => item.prop !== assetSub.prop) + // this.tabs.asset.log = this.tabs.asset.log.filter(item => item.prop !== assetSub.prop) + // } } } }, @@ -177,37 +185,43 @@ export default { // module tab }, asset: { - panel: [ - { prop: 'panelTab', name: this.$t('overall.dashboard'), active: true }, - { prop: 'alertMessageTab', name: this.$t('overall.alert'), active: false }, - { prop: 'endpointTab', name: this.$t('asset.endpoint'), active: false }, - { prop: 'log', name: this.$t('dashboard.panel.chartForm.typeVal.log.label'), active: false } - ], - alertMessage: [ - { prop: 'panelTab', name: this.$t('overall.dashboard'), active: false }, - { prop: 'alertMessageTab', name: this.$t('overall.alert'), active: true }, - { prop: 'endpointTab', name: this.$t('asset.endpoint'), active: false }, - { prop: 'log', name: this.$t('dashboard.panel.chartForm.typeVal.log.label'), active: false } - ], - endpoint: [ - { prop: 'panelTab', name: this.$t('overall.dashboard'), active: false }, - { prop: 'alertMessageTab', name: this.$t('overall.alert'), active: false }, - { prop: 'endpointTab', name: this.$t('asset.endpoint'), active: true }, - { prop: 'log', name: this.$t('dashboard.panel.chartForm.typeVal.log.label'), active: false } - ], - log: [ - { prop: 'panelTab', name: this.$t('overall.dashboard'), active: false }, - { prop: 'alertMessageTab', name: this.$t('overall.alert'), active: false }, - { prop: 'endpointTab', name: this.$t('asset.endpoint'), active: false }, - { prop: 'log', name: this.$t('dashboard.panel.chartForm.typeVal.log.label'), active: true } - ], - alertMessageSub: [ - { prop: 'panelTab', name: this.$t('overall.dashboard'), active: false }, - { prop: 'alertMessageTab', name: this.$t('overall.alert'), active: false }, - { prop: 'endpointTab', name: this.$t('asset.endpoint'), active: false }, - { prop: 'log', name: this.$t('dashboard.panel.chartForm.typeVal.log.label'), active: false }, - { prop: 'assetSubTab', name: this.$t('overall.assetSubTab'), active: true } + assetTabTitle: [ + { prop: 'panelTab', name: this.$t('overall.dashboard') }, + { prop: 'alertMessageTab', name: this.$t('overall.alert') }, + { prop: 'endpointTab', name: this.$t('asset.endpoint') }, + { prop: 'log', name: this.$t('dashboard.panel.chartForm.typeVal.log.label') } ] + // panel: [ + // { prop: 'panelTab', name: this.$t('overall.dashboard'), active: true }, + // { prop: 'alertMessageTab', name: this.$t('overall.alert'), active: false }, + // { prop: 'endpointTab', name: this.$t('asset.endpoint'), active: false }, + // { prop: 'log', name: this.$t('dashboard.panel.chartForm.typeVal.log.label'), active: false } + // ], + // alertMessage: [ + // { prop: 'panelTab', name: this.$t('overall.dashboard'), active: false }, + // { prop: 'alertMessageTab', name: this.$t('overall.alert'), active: true }, + // { prop: 'endpointTab', name: this.$t('asset.endpoint'), active: false }, + // { prop: 'log', name: this.$t('dashboard.panel.chartForm.typeVal.log.label'), active: false } + // ], + // endpoint: [ + // { prop: 'panelTab', name: this.$t('overall.dashboard'), active: false }, + // { prop: 'alertMessageTab', name: this.$t('overall.alert'), active: false }, + // { prop: 'endpointTab', name: this.$t('asset.endpoint'), active: true }, + // { prop: 'log', name: this.$t('dashboard.panel.chartForm.typeVal.log.label'), active: false } + // ], + // log: [ + // { prop: 'panelTab', name: this.$t('overall.dashboard'), active: false }, + // { prop: 'alertMessageTab', name: this.$t('overall.alert'), active: false }, + // { prop: 'endpointTab', name: this.$t('asset.endpoint'), active: false }, + // { prop: 'log', name: this.$t('dashboard.panel.chartForm.typeVal.log.label'), active: true } + // ], + // alertMessageSub: [ + // { prop: 'panelTab', name: this.$t('overall.dashboard'), active: false }, + // { prop: 'alertMessageTab', name: this.$t('overall.alert'), active: false }, + // { prop: 'endpointTab', name: this.$t('asset.endpoint'), active: false }, + // { prop: 'log', name: this.$t('dashboard.panel.chartForm.typeVal.log.label'), active: false }, + // { prop: 'assetSubTab', name: this.$t('overall.assetSubTab'), active: true }, + // ] }, module: { moduleTabTitle: [ @@ -266,6 +280,9 @@ export default { ], alertSilence: [ { prop: 'alertMessageTab', name: this.$t('overall.alert'), active: true } + ], + issue: [ + // { prop: 'issue', name: this.$t('overall.issue'), active: true } ] } } @@ -275,6 +292,23 @@ export default { const config = this.obj.configs.find(c => c.type === 'logs') return config && config.enable === 1 }, + assetTabs () { + const hasSub = this.obj && this.obj.childrenNum + const hasProcess = this.obj && this.obj.clientState == '1' + const tabs = [ + { prop: 'panelTab', name: this.$t('overall.dashboard') }, + { prop: 'alertMessageTab', name: this.$t('overall.alert') }, + { prop: 'endpointTab', name: this.$t('asset.endpoint') }, + { prop: 'log', name: this.$t('dashboard.panel.chartForm.typeVal.log.label') } + ] + if (hasSub) { + tabs.push({ prop: 'assetSubTab', name: this.$t('overall.assetSubTab') }) + } + if (hasProcess) { + tabs.push({ prop: 'process', name: this.$t('overall.process') }) + } + return tabs + }, endpointTabs () { const config = this.obj.configs.find(c => c.type === 'logs') const hasLog = config && config.enable === 1 @@ -307,6 +341,9 @@ export default { }, changeTab (tab) { this.$emit('update:targetTab', tab) + this.$nextTick(() => { + this.updatePath(this.$route.query, this.$route.path, 'bottomBox') + }) }, afterResize () { if (this.from === this.fromRoute.endpoint && this.targetTab === 'endpointQuery') { diff --git a/nezha-fronted/src/components/common/bottomBox/tabs/issueTab.vue b/nezha-fronted/src/components/common/bottomBox/tabs/issueTab.vue new file mode 100644 index 000000000..7404e3f56 --- /dev/null +++ b/nezha-fronted/src/components/common/bottomBox/tabs/issueTab.vue @@ -0,0 +1,281 @@ + + + diff --git a/nezha-fronted/src/components/common/bottomBox/tabs/processBottomTab.vue b/nezha-fronted/src/components/common/bottomBox/tabs/processBottomTab.vue new file mode 100644 index 000000000..9fb1efeae --- /dev/null +++ b/nezha-fronted/src/components/common/bottomBox/tabs/processBottomTab.vue @@ -0,0 +1,181 @@ + + + diff --git a/nezha-fronted/src/components/common/detailView/view/detailViewRight.vue b/nezha-fronted/src/components/common/detailView/view/detailViewRight.vue index bf4653c4e..2ce99fca4 100644 --- a/nezha-fronted/src/components/common/detailView/view/detailViewRight.vue +++ b/nezha-fronted/src/components/common/detailView/view/detailViewRight.vue @@ -64,9 +64,11 @@ import assetTab from '@/components/common/bottomBox/tabs/assetTab' import { fromRoute } from '@/components/common/js/constants' import LogBottomTab from '@/components/common/bottomBox/tabs/logBottomTab' import detailRightTop from './detailRightTop/detailRightTop' +import routerPathParams from "@/components/common/mixin/routerPathParams"; export default { name: 'detailViewRight', + mixins: [routerPathParams], components: { LogBottomTab, cabinetTab, @@ -101,7 +103,7 @@ export default { from: { immediate: true, handler (n) { - this.setTargetTab() + this.setTargetTab(true) } }, obj: { @@ -276,6 +278,9 @@ export default { }, changeTab (tab) { this.targetTab = tab + this.$nextTick(() => { + this.updatePath(this.$route.query, this.$route.path, 'bottomBox') + }) }, afterResize () { if (this.from === this.fromRoute.endpoint && this.targetTab === 'endpointQuery') { @@ -289,7 +294,13 @@ export default { getTableData () { this.$emit('getTableData') }, - setTargetTab () { + setTargetTab (flag) { + if (this.$route.query.targetTab && flag) { + this.$nextTick(()=>{ + this.targetTab = this.$route.query.targetTab + }) + return + } if (this.from === fromRoute.asset) { this.targetTab = 'panelTab' } else if (this.from === fromRoute.endpoint) { diff --git a/nezha-fronted/src/components/common/js/tools.js b/nezha-fronted/src/components/common/js/tools.js index 06f452093..f75b807c4 100644 --- a/nezha-fronted/src/components/common/js/tools.js +++ b/nezha-fronted/src/components/common/js/tools.js @@ -38,17 +38,22 @@ export const clickoutside = { } if (oldValue) { // const newValue = JSON.parse(JSON.stringify(binding.value.obj)) - if (unsavedChange == 'on' && !isEqual(oldValue, el.__newValue__)) { + if (unsavedChange == 'on' && !isEqual(oldValue, el.__newValue__) && !el.isShow) { + el.isShow = true MessageBox.confirm(i18n.t('tip.confirmCancel'), { confirmButtonText: i18n.t('tip.yes'), cancelButtonText: i18n.t('tip.no'), type: 'warning' }).then(() => { + el.isShow = false if (binding.value.func) { binding.value.func() } - }).catch(err => err) - } else { + }).catch(err => { + el.isShow = false + console.log(err) + }) + } else if (!el.isShow) { binding.value.func() } } else { diff --git a/nezha-fronted/src/components/common/latlngPicker.vue b/nezha-fronted/src/components/common/latlngPicker.vue index c9215586b..3b228085d 100644 --- a/nezha-fronted/src/components/common/latlngPicker.vue +++ b/nezha-fronted/src/components/common/latlngPicker.vue @@ -76,7 +76,6 @@ export default { maxBounds: [[-179, -85], [179, 85]], hash: false, transformRequest: function (url, resourceType) { - console.log(resourceType) if (resourceType === 'Tile' && url.indexOf('https://api.maptiler.com/tiles/v3') > -1) { const urlParams = url.split('.pbf')[0].split('/') const z = urlParams[urlParams.length - 3] @@ -161,7 +160,6 @@ export default { }) // const marker = L.marker([this.mapParam.latitude, this.mapParam.longitude]).addTo(map) this.map.on('click', function (e) { - console.log(e, e.lngLat) const coords = e.lngLat geoJSON.features[0].geometry.coordinates = [coords.lng, coords.lat] self.map.getSource('centerMarker').setData(geoJSON) diff --git a/nezha-fronted/src/components/common/login.vue b/nezha-fronted/src/components/common/login.vue index 64556e77a..0fedd6e19 100644 --- a/nezha-fronted/src/components/common/login.vue +++ b/nezha-fronted/src/components/common/login.vue @@ -1,7 +1,7 @@ diff --git a/nezha-fronted/src/components/common/table/asset/assetProcessTable.vue b/nezha-fronted/src/components/common/table/asset/assetProcessTable.vue new file mode 100644 index 000000000..a88ca74b7 --- /dev/null +++ b/nezha-fronted/src/components/common/table/asset/assetProcessTable.vue @@ -0,0 +1,191 @@ + + + + + diff --git a/nezha-fronted/src/components/common/table/nzDataList.vue b/nezha-fronted/src/components/common/table/nzDataList.vue index fe86098c3..1fafe9299 100644 --- a/nezha-fronted/src/components/common/table/nzDataList.vue +++ b/nezha-fronted/src/components/common/table/nzDataList.vue @@ -106,8 +106,11 @@ import bottomBox from '@/components/common/bottomBox/bottomBox' import { bottomBoxWindow } from '@/components/common/js/tools' import panelChart from '@/components/chart/panelChart' import bus from '@/libs/bus' +import routerPathParams from "@/components/common/mixin/routerPathParams"; +import lodash from "lodash"; export default { name: 'nzDataList', + mixins: [routerPathParams], components: { bottomBox, panelChart @@ -235,6 +238,7 @@ export default { 'bottomBox.showSubList': function (n) { const vm = this bottomBoxWindow.showSubListWatch(vm, n) + this.updatePath(this.$route.query, this.$route.path, 'nzDatalist') }, layout: { immediate: true, diff --git a/nezha-fronted/src/components/common/table/settings/agentTable.vue b/nezha-fronted/src/components/common/table/settings/agentTable.vue index fa973f5d9..b20044a36 100644 --- a/nezha-fronted/src/components/common/table/settings/agentTable.vue +++ b/nezha-fronted/src/components/common/table/settings/agentTable.vue @@ -1,5 +1,5 @@ diff --git a/nezha-fronted/src/components/page/dashboard/explore/exploreItem.vue b/nezha-fronted/src/components/page/dashboard/explore/exploreItem.vue index d65b6fd97..ccc9d452a 100644 --- a/nezha-fronted/src/components/page/dashboard/explore/exploreItem.vue +++ b/nezha-fronted/src/components/page/dashboard/explore/exploreItem.vue @@ -286,7 +286,7 @@ instance_cpu_time_ns{app="fox", proc="widget", rev="4d3a513", env="prod", job="c

LogQL: Log query language

-

LogQL is Grafana Loki’s PromQL-inspired query language. Queries act as if they are a distributed grep to aggregate log sources. LogQL uses labels and operators for filtering.

+

LogQL is Grafana Loki’s PromQL-inspired query language. Queries act as if they are a distributed grep to aggregate log sources. LogQL uses labels and operators for filtering.

There are two types of LogQL queries:

-
To avoid escaping special characters you can use the `(backtick) instead of " when quoting strings. For example `\w+` is the same as "\\w+". This is specially useful when writing a regular expression which contains multiple 
backslashes that require escaping.
+
To avoid escaping special characters you can use the `(backtick) instead of " when quoting strings. For example `\w+` is the same as "\\w+". This is specially useful when writing a regular expression which contains multiple 
backslashes that require escaping.
@@ -642,7 +642,7 @@ instance_cpu_time_ns{app="fox", proc="widget", rev="4d3a513", env="prod", job="c

The right side can alternatively be a template string (double quoted or backtick), for example dst="{{.status}} {{.query}}", in which case the dst label value is replaced by the result of the text/template evaluation. This is the same template engine as the | line_format expression, which means labels are available as variables and you can use the same list of functions.

In both cases, if the destination label doesn’t exist, then a new one is created.

The renaming form dst=src will drop the src label after remapping it to the dst label. However, the template form will preserve the referenced labels, such that dst="{{.src}}" results in both dst and src having the same value.

-
A single label name can only appear once per expression. This means | label_format foo=bar,foo="new" is not allowed but you can use two expressions for the desired effect: | label_format foo=bar | label_format foo="new"
+
A single label name can only appear once per expression. This means | label_format foo=bar,foo="new" is not allowed but you can use two expressions for the desired effect: | label_format foo=bar | label_format foo="new"
diff --git a/nezha-fronted/src/components/page/dashboard/explore/promqlInput.vue b/nezha-fronted/src/components/page/dashboard/explore/promqlInput.vue index c65ae05fa..8c831cde2 100644 --- a/nezha-fronted/src/components/page/dashboard/explore/promqlInput.vue +++ b/nezha-fronted/src/components/page/dashboard/explore/promqlInput.vue @@ -514,7 +514,8 @@ export default { projectOption: [], filterSilence: '', tempBoxId: {}, - loading: false + loading: false, + firstInit: true } }, computed: { @@ -697,6 +698,9 @@ export default { } }, newChange (val) { + if (this.firstInit && this.isTopo) { + return + } if (val) { this.oldcCodeLength = val.length this.codeMirrorValue[this.index] = val @@ -1154,7 +1158,7 @@ export default { immediate: true, handler (n, o) { this.codeMirrorValue[this.index] = n[this.index] - if (this.isTopo) { + if (this.isTopo && this.firstInit) { setTimeout(() => { const text = this.newView.state.doc.toString() this.newView.dispatch( @@ -1162,6 +1166,7 @@ export default { changes: { from: 0, to: text.length, insert: this.codeMirrorValue[this.index] } }) ) + this.firstInit = false }, 200) } } diff --git a/nezha-fronted/src/entrance/app/App.vue b/nezha-fronted/src/entrance/app/App.vue index af3ed805a..4f8132b39 100644 --- a/nezha-fronted/src/entrance/app/App.vue +++ b/nezha-fronted/src/entrance/app/App.vue @@ -16,12 +16,12 @@ export default { }, async created () { const herfSpiltArr = window.location.href.split('/') - if (herfSpiltArr[3] !== '#') { - herfSpiltArr[3] = '#' - window.location.href = herfSpiltArr.join('/') - } + // if (herfSpiltArr[3] !== '#') { + // herfSpiltArr[3] = '#' + // window.location.href = herfSpiltArr.join('/') + // } const Timestamp = new Date().getTime() - const url = 'static/config.json?Timestamp=' + Timestamp + const url = '/static/config.json?Timestamp=' + Timestamp const result = await this.$http.get(url) // 获取本地的config.json 判断是否需要清空localStorage 以及设备的宽 和 axios的baseUrl this.$axios.defaults.baseURL = result.body.baseUrl const version = result.body.version diff --git a/nezha-fronted/src/http.js b/nezha-fronted/src/http.js index e2c855ee8..6a86b5869 100644 --- a/nezha-fronted/src/http.js +++ b/nezha-fronted/src/http.js @@ -40,7 +40,7 @@ axios.interceptors.request.use( ) const accountErrorCode = [518003, 518004, 518005, 518006, 518007, 518008] // 账号锁定等 const licenceErrorCode = [711001] -const noJumpPath = ['#/', '#/login'] +const noJumpPath = ['/', '/login', '/ui/login'] // 若get请求的url中带问号,则将url上的参数截取,改为对象形式传参 axios.interceptors.request.use( @@ -77,15 +77,20 @@ axios.interceptors.request.use( ) axios.interceptors.response.use( response => { - if (licenceErrorCode.indexOf(response.data.code) !== -1 && noJumpPath.indexOf(window.location.hash) == -1) { + if (response.config.url.indexOf('ui') !== -1) { + removePending(response.config) + return response + } + if (licenceErrorCode.indexOf(response.data.code) !== -1 && noJumpPath.indexOf(window.location.pathname) == -1) { sessionStorage.setItem('nz-previous-page', router.currentRoute.fullPath) window.location.href = '/' } else if (response.status === 200) { - if (accountErrorCode.indexOf(response.data.code) !== -1 && noJumpPath.indexOf(window.location.hash) == -1) { + if (accountErrorCode.indexOf(response.data.code) !== -1 && noJumpPath.indexOf(window.location.pathname) == -1) { sessionStorage.setItem('nz-previous-page', router.currentRoute.fullPath) window.location.href = '/' } } else { + removePending(response.config) return response } // 请求完成在数组中移除 diff --git a/nezha-fronted/src/permission.js b/nezha-fronted/src/permission.js index cd2fd5a4b..7fe83cab8 100644 --- a/nezha-fronted/src/permission.js +++ b/nezha-fronted/src/permission.js @@ -19,7 +19,7 @@ router.beforeEach((to, from, next) => { requestsArr.forEach(xhr => xhr.cancel('cancel')) } store.commit('setNowPath', to.path) - const configUrl = 'static/config.json?Timestamp=' + new Date().getTime() + const configUrl = '/static/config.json?Timestamp=' + new Date().getTime() if (to.path === '/login') { // 拦截登录页面,现货区外观设置 再系统初始化检查 Vue.http.get(configUrl).then(config => { const appearance = new Promise(resolve => { diff --git a/nezha-fronted/src/router/index.js b/nezha-fronted/src/router/index.js index 6273f44b3..d8f39c453 100644 --- a/nezha-fronted/src/router/index.js +++ b/nezha-fronted/src/router/index.js @@ -2,6 +2,10 @@ import Vue from 'vue' import Router from 'vue-router' Vue.use(Router) export default new Router({ + hashbang: false, + history: true, + mode: 'history', + base: '/ui/', routes: [ { path: '/', diff --git a/nezha-fronted/src/store/user.js b/nezha-fronted/src/store/user.js index fe4ecfd02..2b81217c0 100644 --- a/nezha-fronted/src/store/user.js +++ b/nezha-fronted/src/store/user.js @@ -5,6 +5,7 @@ import { returnMenuCode, sortByOrderNum } from '@/permission' import moment from 'moment-timezone' import { theme } from '@/components/common/js/constants' +const noJumpPath = ['/', '/login', '/ui/login'] const user = { state: { menuList: [], @@ -143,7 +144,7 @@ const user = { }) } // 登录成功后跳回到原来页面 - if (sessionStorage.getItem('nz-previous-page')) { + if (sessionStorage.getItem('nz-previous-page') && noJumpPath.indexOf(sessionStorage.getItem('nz-previous-page')) === -1) { const route = sessionStorage.getItem('nz-previous-page') router.push({ path: route @@ -151,6 +152,7 @@ const user = { sessionStorage.removeItem('nz-previous-page') }) } else { + sessionStorage.removeItem('nz-previous-page') router.push({ path: path[0], query: { diff --git a/nezha-fronted/static/config.json b/nezha-fronted/static/config.json index 3151969db..b9b43a208 100644 --- a/nezha-fronted/static/config.json +++ b/nezha-fronted/static/config.json @@ -1 +1 @@ -{"baseUrl":"http://192.168.40.42:8080/", "version": "22.05"} +{"baseUrl":"http://192.168.40.42/", "version": "22.05"}