Merge branch 'dev-3.5' of git.mesalab.cn:nezha/nezha-fronted into dev-3.5

This commit is contained in:
zyh
2022-09-09 09:52:10 +08:00
53 changed files with 1488 additions and 444 deletions

1
.gitignore vendored
View File

@@ -19,3 +19,4 @@ nezha-fronted/src/components/common/rightBox/tempRoghtBox.vue
nezha-fronted/exportHtml/ nezha-fronted/exportHtml/
nezha-fronted/src/a.txt nezha-fronted/src/a.txt
nezha-fronted/src/components/common/testTopology.vue nezha-fronted/src/components/common/testTopology.vue
nezha-fronted/static/

View File

@@ -30,32 +30,36 @@ dev_build:
# 所需执行的脚本 # 所需执行的脚本
script: script:
- env | sort - env | sort
- pwd - pwd
- cd nezha-fronted - cd nezha-fronted
# 安装 npm 依赖文件 # 安装 npm 依赖文件
- echo "npm install ..." - echo "npm install ..."
- npm install --registry=http://registry.npmmirror.com - npm install --registry=http://registry.npmmirror.com
- echo "npm run build" - echo "npm run build"
# 编译 上传模板 # 编译 上传模板
- npm run build:html - npm run build:html
- mc alias set nz $MINIO_HOST $MINIO_USER $MINIO_PWD - mc alias set nz $MINIO_HOST $MINIO_USER $MINIO_PWD
- mc cp dist/index.html nz/depends/template/snapshot_template.html - mc cp dist/index.html nz/depends/template/snapshot_template.html
- npm run build - 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 - mc cp nz/depends/template/snapshot_template.html ./snapshot_template.html
- rm -rf nz-gui*.zip - rm -rf nz-gui*.zip
- export FILE_NAME=nz-gui-$CI_COMMIT_REF_NAME-$CI_COMMIT_SHORT_SHA.zip - export FILE_NAME=nz-gui-$CI_COMMIT_REF_NAME-$CI_COMMIT_SHORT_SHA.zip
# 生成 git log 日志文件 # 生成 git log 日志文件
- sed -i 's+</body>+<a style="position:fixed;bottom:20px;left:40px;z-index:999;color:white;" target="_blank" href="./static/git-log.html">更新记录</a>\n</body>+g' ./index.html; - sed -i 's+</body>+<a style="position:fixed;bottom:20px;left:40px;z-index:999;color:white;" target="_blank" href="/static/git-log.html">更新记录</a>\n</body>+g' ./index.html;
- echo "<pre>" > ./static/git-log.html - echo "<html>" > ./static/git-log.html
- echo "<head>" >> ./static/git-log.html
- echo '<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">' >> ./static/git-log.html
- echo "</head>" >> ./static/git-log.html
- echo "<pre>" >> ./static/git-log.html
- "git log -100 --pretty=format:'%ad : %s' >> ./static/git-log.html" - "git log -100 --pretty=format:'%ad : %s' >> ./static/git-log.html"
- echo "</pre>" >> ./static/git-log.html - echo "</pre></html>" >> ./static/git-log.html
- zip -q -r $FILE_NAME ./* - 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/$FILE_NAME
- mc cp $FILE_NAME nz/ci-cd/nz-gui/nz-gui-$CI_COMMIT_REF_NAME-latest.zip - mc cp $FILE_NAME nz/ci-cd/nz-gui/nz-gui-$CI_COMMIT_REF_NAME-latest.zip
artifacts: artifacts:
@@ -78,7 +82,7 @@ rel_build:
# 所需执行的脚本 # 所需执行的脚本
script: script:
- env | sort - env | sort
- pwd - pwd
- echo "npm install ..." - echo "npm install ..."
- cd nezha-fronted - cd nezha-fronted
- npm install --registry=http://registry.npmmirror.com - npm install --registry=http://registry.npmmirror.com

View File

@@ -25,11 +25,14 @@ devWebpackConfig = merge(baseWebpackConfig, {
// these devServer options should be customized in /config/index.js // these devServer options should be customized in /config/index.js
devServer: { devServer: {
clientLogLevel: 'warning', clientLogLevel: 'warning',
historyApiFallback: { historyApiFallback: true,
rewrites: [ // historyApiFallback: {
{ from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, indexHtml) } // // 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, hot: true,
inline: true, inline: true,
contentBase: false, // since we use CopyWebpackPlugin. contentBase: false, // since we use CopyWebpackPlugin.

View File

@@ -190,7 +190,8 @@ if (arg === 'html') {
output: { output: {
path: config.build.assetsRoot, path: config.build.assetsRoot,
filename: utils.assetsPath('js/[name].[chunkhash].js'), filename: utils.assetsPath('js/[name].[chunkhash].js'),
chunkFilename: utils.assetsPath('js/[name].[chunkhash].js') chunkFilename: utils.assetsPath('js/[name].[chunkhash].js'),
publicPath: '/'
}, },
plugins: [ plugins: [
/* new GenerateAssetPlugin({ /* new GenerateAssetPlugin({

View File

@@ -3,7 +3,8 @@
// see http://vuejs-templates.github.io/webpack for documentation. // see http://vuejs-templates.github.io/webpack for documentation.
const path = require('path') 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 = { module.exports = {
dev: { dev: {
// Paths // Paths

View File

@@ -1401,7 +1401,7 @@
}, },
"@mapbox/geojson-rewind": { "@mapbox/geojson-rewind": {
"version": "0.5.2", "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==", "integrity": "sha512-tJaT+RbYGJYStt7wI3cq4Nl4SXxG8W7JDG5DMJu97V25RnbNg3QtQtf+KD+VLjNpWKYsRvXDNmNrBgEETr1ifA==",
"requires": { "requires": {
"get-stream": "^6.0.1", "get-stream": "^6.0.1",
@@ -1410,44 +1410,44 @@
"dependencies": { "dependencies": {
"get-stream": { "get-stream": {
"version": "6.0.1", "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==" "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg=="
}, },
"minimist": { "minimist": {
"version": "1.2.6", "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==" "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q=="
} }
} }
}, },
"@mapbox/jsonlint-lines-primitives": { "@mapbox/jsonlint-lines-primitives": {
"version": "2.0.2", "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==" "integrity": "sha512-rY0o9A5ECsTQRVhv7tL/OyDpGAoUB4tTvLiW1DSzQGq4bvTPhNw1VpSNjDJc5GFZ2XuyOtSWSVN05qOtcD71qQ=="
}, },
"@mapbox/mapbox-gl-supported": { "@mapbox/mapbox-gl-supported": {
"version": "2.0.1", "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==" "integrity": "sha512-HP6XvfNIzfoMVfyGjBckjiAOQK9WfX0ywdLubuPMPv+Vqf5fj0uCbgBQYpiqcWZT6cbyyRnTSXDheT1ugvF6UQ=="
}, },
"@mapbox/point-geometry": { "@mapbox/point-geometry": {
"version": "0.1.0", "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==" "integrity": "sha512-6j56HdLTwWGO0fJPlrZtdU/B13q8Uwmo18Ck2GnGgN9PCFyKTZ3UbXeEdRFh18i9XQ92eH2VdtpJHpBD3aripQ=="
}, },
"@mapbox/tiny-sdf": { "@mapbox/tiny-sdf": {
"version": "2.0.5", "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==" "integrity": "sha512-OhXt2lS//WpLdkqrzo/KwB7SRD8AiNTFFzuo9n14IBupzIMa67yGItcK7I2W9D8Ghpa4T04Sw9FWsKCJG50Bxw=="
}, },
"@mapbox/unitbezier": { "@mapbox/unitbezier": {
"version": "0.0.1", "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==" "integrity": "sha512-nMkuDXFv60aBr9soUG5q+GvZYL+2KZHVvsqFCzqnkGEf46U2fvmytHaEVc1/YZbiLn8X+eR3QzX1+dwDO1lxlw=="
}, },
"@mapbox/vector-tile": { "@mapbox/vector-tile": {
"version": "1.3.1", "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==", "integrity": "sha512-MCEddb8u44/xfQ3oD+Srl/tNcQoqTw3goGk2oLsrFxOTc3dUp+kAnby3PvAeeBYSMSjSPD1nd1AJA6W49WnoUw==",
"requires": { "requires": {
"@mapbox/point-geometry": "~0.1.0" "@mapbox/point-geometry": "~0.1.0"
@@ -1455,7 +1455,7 @@
}, },
"@mapbox/whoots-js": { "@mapbox/whoots-js": {
"version": "3.1.0", "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==" "integrity": "sha512-Es6WcD0nO5l+2BOQS4uLfNPYQaNDfbot3X1XUoloz+x0mPDS3eeORZJl06HXjwBG1fOGwCRnzK88LMdxKRrd6Q=="
}, },
"@riophae/vue-treeselect": { "@riophae/vue-treeselect": {
@@ -1507,9 +1507,9 @@
"integrity": "sha512-pFCGC7pBorMA8kPiAPKLeBp9VjHXs8FRMujTjFAUpJxQGRAZzjnuVq0pB32me9Vc/Ckp1/pH6S0JgD+poVA5CA==" "integrity": "sha512-pFCGC7pBorMA8kPiAPKLeBp9VjHXs8FRMujTjFAUpJxQGRAZzjnuVq0pB32me9Vc/Ckp1/pH6S0JgD+poVA5CA=="
}, },
"@topology/core": { "@topology/core": {
"version": "1.1.32", "version": "1.2.0",
"resolved": "https://registry.npmjs.org/@topology/core/-/core-1.1.32.tgz", "resolved": "https://registry.npmjs.org/@topology/core/-/core-1.2.0.tgz",
"integrity": "sha512-ZpRzW0ERxBMFcdujT7VpZVY8t7B+OEMXVhuY+vQ8a++LTG/SIWT3ib8EhYw4cJM4BaIUtOOyDPYHpFk4SOl0KA==", "integrity": "sha512-4CCg9utyJTSNNtmqWG7895ongEWGz4mHwwkKy8MGM4cQSzgC2S615XQgwiLMPjMxSUL0OOQkI9oU4wei/gTPuA==",
"requires": { "requires": {
"mitt": "^2.1.0", "mitt": "^2.1.0",
"mqtt": "^4.2.6" "mqtt": "^4.2.6"
@@ -1573,7 +1573,7 @@
}, },
"@types/geojson": { "@types/geojson": {
"version": "7946.0.10", "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==" "integrity": "sha512-Nmh0K3iWQJzniTuPRcJn5hxXkfB1T1pgB89SBig5PlJQU5yocazeu4jATJlaA0GYFKWMqDdvYemoSnF2pXgLVA=="
}, },
"@types/istanbul-lib-coverage": { "@types/istanbul-lib-coverage": {
@@ -1609,12 +1609,12 @@
}, },
"@types/mapbox__point-geometry": { "@types/mapbox__point-geometry": {
"version": "0.1.2", "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==" "integrity": "sha512-D0lgCq+3VWV85ey1MZVkE8ZveyuvW5VAfuahVTQRpXFQTxw03SuIf1/K4UQ87MMIXVKzpFjXFiFMZzLj2kU+iA=="
}, },
"@types/mapbox__vector-tile": { "@types/mapbox__vector-tile": {
"version": "1.3.0", "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==", "integrity": "sha512-kDwVreQO5V4c8yAxzZVQLE5tyWF+IPToAanloQaSnwfXmIcJ7cyOrv8z4Ft4y7PsLYmhWXmON8MBV8RX0Rgr8g==",
"requires": { "requires": {
"@types/geojson": "*", "@types/geojson": "*",
@@ -1624,7 +1624,7 @@
}, },
"@types/pbf": { "@types/pbf": {
"version": "3.0.2", "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==" "integrity": "sha512-EDrLIPaPXOZqDjrkzxxbX7UlJSeQVgah3i0aA4pOSzmK9zq3BIh7/MZIQxED7slJByvKM4Gc6Hypyu2lJzh3SQ=="
}, },
"@types/q": { "@types/q": {
@@ -4071,7 +4071,7 @@
}, },
"clipboard": { "clipboard": {
"version": "2.0.11", "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==", "integrity": "sha512-C+0bbOqkezLIsmWSvlsXS0Q0bmkugu7jcfMIACB+RDEntIzQIkdr148we28AfSloQLRdZlYL/QYyrq05j/3Faw==",
"requires": { "requires": {
"good-listener": "^1.2.2", "good-listener": "^1.2.2",
@@ -5014,7 +5014,7 @@
}, },
"csscolorparser": { "csscolorparser": {
"version": "1.0.3", "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==" "integrity": "sha512-umPSgYwZkdFoUrH5hIq5kf0wPSXiro51nPw0j2K/c83KflkPSTBGMz6NJvMB+07VlL0y7VPo6QJcDjcgKTTm3w=="
}, },
"cssesc": { "cssesc": {
@@ -6245,7 +6245,7 @@
}, },
"delegate": { "delegate": {
"version": "3.2.0", "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==" "integrity": "sha512-IofjkYBZaZivn0V8nnsMJGBr4jVLxHDheKSW88PyxS5QC4Vo9ZbZVvhzlSxY87fVq3STR6r+4cGepyHkcWOQSw=="
}, },
"delegates": { "delegates": {
@@ -6481,7 +6481,7 @@
}, },
"earcut": { "earcut": {
"version": "2.2.4", "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==" "integrity": "sha512-/pjZsA1b4RPHbeWZQn66SWS8nZZWLQQ23oE3Eam7aroEFGEvwKAsJfZ9ytiEMycfzXWpca4FA9QIOehf7PocBQ=="
}, },
"easings-css": { "easings-css": {
@@ -8375,7 +8375,7 @@
}, },
"geojson-vt": { "geojson-vt": {
"version": "3.2.1", "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==" "integrity": "sha512-EvGQQi/zPrDA6zr6BnJD/YhwAkBP8nnJ9emh3EnHQKVMfg/MRVtPbMYdgVy/IaEmn4UfagD2a6fafPDL5hbtwg=="
}, },
"get-caller-file": { "get-caller-file": {
@@ -8427,7 +8427,7 @@
}, },
"gl-matrix": { "gl-matrix": {
"version": "3.4.3", "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==" "integrity": "sha512-wcCp8vu8FT22BnvKVPjXa/ICBWRq/zjFfdofZy1WSpQZpphblv12/bOQLBC1rMM7SGOFS9ltVmKOHil5+Ml7gA=="
}, },
"glob": { "glob": {
@@ -8572,7 +8572,7 @@
}, },
"good-listener": { "good-listener": {
"version": "1.2.2", "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==", "integrity": "sha512-goW1b+d9q/HIwbVYZzZ6SsTr4IgE+WA44A0GmPIQstuOrgsFcT7VEJ48nmr9GaRtNu0XTKacFLGnBPAM6Afouw==",
"requires": { "requires": {
"delegate": "^3.1.2" "delegate": "^3.1.2"
@@ -11057,7 +11057,7 @@
}, },
"kdbush": { "kdbush": {
"version": "3.0.0", "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==" "integrity": "sha512-hRkd6/XW4HTsA9vjVpY9tuXJYLSlelnkTmVFu4M9/7MIYQtFcHpbugAU7UbOfjOiVSVYl2fqgBuJ32JUmRo5Ew=="
}, },
"keyv": { "keyv": {
@@ -11415,7 +11415,7 @@
}, },
"maplibre-gl": { "maplibre-gl": {
"version": "2.2.0", "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==", "integrity": "sha512-5LB7ROIxvBADPa4PmU2j+mp0jG5IIbEidCOyZEXVbEriluMJn0hz28vszVb4Cr2IA4YQ9cnERqjHaf33MHIRBQ==",
"requires": { "requires": {
"@mapbox/geojson-rewind": "^0.5.2", "@mapbox/geojson-rewind": "^0.5.2",
@@ -11935,7 +11935,7 @@
}, },
"murmurhash-js": { "murmurhash-js": {
"version": "1.0.0", "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==" "integrity": "sha512-TvmkNhkv8yct0SVBSy+o8wYzXjE4Zz3PCesbfs8HiCXXdcTuocApFv11UWlNFWKYsP2okqrhb7JNlSm9InBhIw=="
}, },
"mv": { "mv": {
@@ -12862,7 +12862,7 @@
}, },
"pbf": { "pbf": {
"version": "3.2.1", "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==", "integrity": "sha512-ClrV7pNOn7rtmoQVF4TS1vyU0WhYRnP92fzbfF75jAIwpnzdJXf8iTd4CMEqO4yUenH6NDqLiwjqlh6QgZzgLQ==",
"requires": { "requires": {
"ieee754": "^1.1.12", "ieee754": "^1.1.12",
@@ -15303,7 +15303,7 @@
}, },
"potpack": { "potpack": {
"version": "1.0.2", "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==" "integrity": "sha512-choctRBIV9EMT9WGAZHn3V7t0Z2pMQyl0EZE6pFc/6ml3ssw7Dlf/oAOvFwjm1HVsqfQN8GfeFyJ+d8tRzqueQ=="
}, },
"preload": { "preload": {
@@ -15452,7 +15452,7 @@
}, },
"protocol-buffers-schema": { "protocol-buffers-schema": {
"version": "3.6.0", "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==" "integrity": "sha512-TdDRD+/QNdrCGCE7v8340QyuXd4kIWIgapsE2+n/SaGiSSbomYl4TjHlvIoCWRpE7wFt02EpB35VVA2ImcBVqw=="
}, },
"proxy-addr": { "proxy-addr": {
@@ -15574,7 +15574,7 @@
}, },
"quickselect": { "quickselect": {
"version": "2.0.0", "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==" "integrity": "sha512-RKJ22hX8mHe3Y6wH/N3wCM6BWtjaxIyyUIkpHOvfFnxdI4yD4tBXEBKSbriGujF6jnSVkJrffuo6vxACiSSxIw=="
}, },
"quill": { "quill": {
@@ -16069,7 +16069,7 @@
}, },
"resolve-protobuf-schema": { "resolve-protobuf-schema": {
"version": "2.1.0", "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==", "integrity": "sha512-kI5ffTiZWmJaS/huM8wZfEMer1eRd7oJQhDuxeCLe3t7N7mX3z94CN0xPxBQxFYQTSNz9T0i+v6inKqSdK8xrQ==",
"requires": { "requires": {
"protocol-buffers-schema": "^3.3.1" "protocol-buffers-schema": "^3.3.1"
@@ -16560,7 +16560,7 @@
}, },
"select": { "select": {
"version": "1.1.2", "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==" "integrity": "sha512-OwpTSOfy6xSs1+pwcNrv0RBMOzI39Lp3qQKUTPVVPRjCdNa5JH/oPRiqsesIskK8TVgmRiHwO4KXlV2Li9dANA=="
}, },
"select-hose": { "select-hose": {
@@ -17572,7 +17572,7 @@
}, },
"supercluster": { "supercluster": {
"version": "7.1.5", "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==", "integrity": "sha512-EulshI3pGUM66o6ZdH3ReiFcvHpM3vAigyK+vcxdjpJyEbIIrtbmBdY23mGgnI24uXiGFvrGq9Gkum/8U7vJWg==",
"requires": { "requires": {
"kdbush": "^3.0.0" "kdbush": "^3.0.0"
@@ -18044,7 +18044,7 @@
}, },
"tiny-emitter": { "tiny-emitter": {
"version": "2.1.0", "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==" "integrity": "sha512-NB6Dk1A9xgQPMoGqC5CVXn123gWyte215ONT5Pp5a0yt4nlEoO1ZWeCwpncaekPHXO60i47ihFnZPiRPjRMq4Q=="
}, },
"tinycolor2": { "tinycolor2": {
@@ -18054,7 +18054,7 @@
}, },
"tinyqueue": { "tinyqueue": {
"version": "2.0.3", "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==" "integrity": "sha512-ppJZNDuKGgxzkHihX8v9v9G5f+18gzaTfrukGrq6ueg0lmH4nqVnA2IPG0AEH3jKEk2GRJCUhDoqpoiw3PHLBA=="
}, },
"tmp": { "tmp": {
@@ -18728,7 +18728,7 @@
}, },
"vt-pbf": { "vt-pbf": {
"version": "3.1.3", "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==", "integrity": "sha512-2LzDFzt0mZKZ9IpVF2r69G9bXaP2Q2sArJCmcCgvfTdCCZzSyz4aCLoQyUilu37Ll56tCblIZrXFIjNUpGIlmA==",
"requires": { "requires": {
"@mapbox/point-geometry": "0.1.0", "@mapbox/point-geometry": "0.1.0",
@@ -18743,7 +18743,7 @@
}, },
"vue-clipboard2": { "vue-clipboard2": {
"version": "0.3.3", "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==", "integrity": "sha512-aNWXIL2DKgJyY/1OOeITwAQz1fHaCIGvUFHf9h8UcoQBG5a74MkdhS/xqoYe7DNZdQmZRL+TAdIbtUs9OyVjbw==",
"requires": { "requires": {
"clipboard": "^2.0.0" "clipboard": "^2.0.0"

View File

@@ -28,7 +28,7 @@
"@topology/activity-diagram": "^1.1.0", "@topology/activity-diagram": "^1.1.0",
"@topology/chart-diagram": "^1.1.0", "@topology/chart-diagram": "^1.1.0",
"@topology/class-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/flow-diagram": "^1.1.1",
"@topology/form-diagram": "^1.1.32", "@topology/form-diagram": "^1.1.32",
"@topology/sequence-diagram": "^1.1.0", "@topology/sequence-diagram": "^1.1.0",

View File

@@ -110,6 +110,9 @@
.color23bf9a { .color23bf9a {
color: #23bf9a; color: #23bf9a;
} }
.bgFFECD9{
background: $--color-primary !important;
}
.timezone-area { .timezone-area {
display: inline-block; display: inline-block;
vertical-align: middle; vertical-align: middle;
@@ -283,10 +286,18 @@ td .nz-icon-gear:before {
border-color: $--border-color-light-hover; border-color: $--border-color-light-hover;
} }
} }
#elementQuery{
border: 1px solid $--border-color-light;
}
.el-input__inner:hover { .el-input__inner:hover {
border-color: $--border-color-light-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 { .sub-box.detail-view-sub-box {
.top-tools.top-tools--sub { .top-tools.top-tools--sub {
padding: 0 15px 0 0; padding: 0 15px 0 0;

View File

@@ -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;
}

View File

@@ -76,6 +76,9 @@
color: #FFFFFF; color: #FFFFFF;
} }
} }
.ͼ2 .cm-content{
caret-color:$--color-text-regular;
}
} }
.severity-item{ .severity-item{
color: $--color-text-secondary; color: $--color-text-secondary;

View File

@@ -10,6 +10,7 @@
@import './common/alert/alertDaysInfo.scss'; @import './common/alert/alertDaysInfo.scss';
@import './common/bottomBox/bottomBox.scss'; @import './common/bottomBox/bottomBox.scss';
@import './common/bottomBox/panelTabNew.scss'; @import './common/bottomBox/panelTabNew.scss';
@import './common/bottomBox/issueTab.scss';
@import './common/bottomBox/terminalLogCMDTab.scss'; @import './common/bottomBox/terminalLogCMDTab.scss';
@import './common/bottomBox/terminalLogMonitorTab.scss'; @import './common/bottomBox/terminalLogMonitorTab.scss';
@import './common/bottomBox/terminalLogRecordTab.scss'; @import './common/bottomBox/terminalLogRecordTab.scss';
@@ -52,6 +53,7 @@
@import './common/rightBox/menuBox.scss'; @import './common/rightBox/menuBox.scss';
@import './common/rightBox/moduleBox.scss'; @import './common/rightBox/moduleBox.scss';
@import './common/rightBox/ipam.scss'; @import './common/rightBox/ipam.scss';
@import './common/rightBox/assetMetaBox.scss';
@import './common/rightBox/chartRightBox/chartRightBox.scss'; @import './common/rightBox/chartRightBox/chartRightBox.scss';
@import './common/rightBox/mibBox.scss'; @import './common/rightBox/mibBox.scss';
@import './common/rightBox/assetBactchEditBox.scss'; @import './common/rightBox/assetBactchEditBox.scss';

View File

@@ -414,6 +414,10 @@ article {
.box-overflow{ .box-overflow{
overflow-x: scroll; 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{ .logfmt-module,.json-module,.pattern-module,.regular-module,.unpack-module,.line-module,.formatting-module,.unwrapped-module{
pre { pre {
border: 0; border: 0;

View File

@@ -1083,7 +1083,11 @@ li {
width:0 !important; width:0 !important;
background-color: $--background-color-base; 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; height: 100% !important;
z-index: 1; z-index: 1;
} }

View File

@@ -135,7 +135,7 @@ export default {
const z = urlParams[urlParams.length - 3] const z = urlParams[urlParams.length - 3]
const x = urlParams[urlParams.length - 2] const x = urlParams[urlParams.length - 2]
const y = urlParams[urlParams.length - 1] 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 { return {
url: newUrl1, url: newUrl1,
credentials: 'include', credentials: 'include',
@@ -145,7 +145,7 @@ export default {
} }
if (resourceType === 'SpriteJSON') { if (resourceType === 'SpriteJSON') {
return { return {
url: 'nzMap://static/Titles/sprite.json', url: 'nzMap:///static/Titles/sprite.json',
credentials: 'include', credentials: 'include',
method: 'GET' method: 'GET'
// Include cookies for cross-origin requests // Include cookies for cross-origin requests
@@ -153,7 +153,7 @@ export default {
} }
if (resourceType === 'SpriteImage') { if (resourceType === 'SpriteImage') {
return { return {
url: 'nzMap://static/Titles/sprite.png', url: 'nzMap:///static/Titles/sprite.png',
credentials: 'include', credentials: 'include',
method: 'GET' method: 'GET'
// Include cookies for cross-origin requests // Include cookies for cross-origin requests

View File

@@ -146,10 +146,10 @@ export default {
/* 使用setTimeout延迟渲染图表避免样式错乱 */ /* 使用setTimeout延迟渲染图表避免样式错乱 */
setTimeout(() => { setTimeout(() => {
const myChart = this.isInit ? echarts.init(document.getElementById(`chart-canvas-${this.chartId}`)) : getChart(this.chartId) const myChart = this.isInit ? echarts.init(document.getElementById(`chart-canvas-${this.chartId}`)) : getChart(this.chartId)
myChart.clear()
if (!myChart) { if (!myChart) {
return return
} }
myChart.clear()
myChart.setOption(chartOption) myChart.setOption(chartOption)
this.isInit && setChart(this.chartId, myChart) // 缓存不使用vue的data是为避免整个chart被监听导致卡顿 this.isInit && setChart(this.chartId, myChart) // 缓存不使用vue的data是为避免整个chart被监听导致卡顿

File diff suppressed because one or more lines are too long

View File

@@ -698,7 +698,9 @@ export default {
if (this.fromTopologyDialog && !this.isPreview) { if (this.fromTopologyDialog && !this.isPreview) {
setTimeout(() => { setTimeout(() => {
this.topologyLoading = false this.topologyLoading = false
console.log(data) if (!data.pens) {
data.pens = []
}
getTopology(this.topologyIndex).open(data || {}) getTopology(this.topologyIndex).open(data || {})
getTopology(this.topologyIndex).centerView() getTopology(this.topologyIndex).centerView()
getTopology(this.topologyIndex).resize() getTopology(this.topologyIndex).resize()
@@ -709,6 +711,9 @@ export default {
if (!getTopology(this.topologyIndex)) { if (!getTopology(this.topologyIndex)) {
return return
} }
if (!data.pens) {
data.pens = []
}
getTopology(this.topologyIndex).open(data || {}) getTopology(this.topologyIndex).open(data || {})
getTopology(this.topologyIndex).lock(1) getTopology(this.topologyIndex).lock(1)
this.objChange = false this.objChange = false
@@ -856,7 +861,7 @@ export default {
gridColor: '#ededed', gridColor: '#ededed',
lineWidth: 1, lineWidth: 1,
ruleColor: '#4e4e4e', ruleColor: '#4e4e4e',
pens:[] pens: []
} }
this.projectInfoShow = true this.projectInfoShow = true
this.projectAlertShow = true this.projectAlertShow = true
@@ -865,6 +870,7 @@ export default {
data.ruleColor = this.theme == 'light' ? '#4e4e4e' : '#BEBEBE' data.ruleColor = this.theme == 'light' ? '#4e4e4e' : '#BEBEBE'
resolve(data) resolve(data)
} else { } else {
delete data.origin
data.ruleColor = this.theme == 'light' ? '#4e4e4e' : '#BEBEBE' data.ruleColor = this.theme == 'light' ? '#4e4e4e' : '#BEBEBE'
if (data.data) { if (data.data) {
this.topologyInfo = { this.topologyInfo = {
@@ -1213,7 +1219,15 @@ export default {
}, },
onUpdateProps (node) { 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 () { handleAvatarSuccess () {
@@ -1754,7 +1768,10 @@ export default {
const domRect = dom ? dom.getBoundingClientRect() : {} const domRect = dom ? dom.getBoundingClientRect() : {}
getTopology(this.topologyIndex).canvasPos = domRect getTopology(this.topologyIndex).canvasPos = domRect
if (this.fromOverView) { 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 let flag = false
const position = { const position = {

View File

@@ -52,7 +52,7 @@
<div class="document-copy-block"> <div class="document-copy-block">
<div class="alert-label-title">{{$t('overall.name')}}</div> <div class="alert-label-title">{{$t('overall.name')}}</div>
<div class="alert-label-value document-copy-text">{{alertLabelData && alertLabelData.name ? alertLabelData.name : '--'}}</div> <div class="alert-label-value document-copy-text">{{alertLabelData && alertLabelData.name ? alertLabelData.name : '--'}}</div>
<i v-if="alertLabelData.name" class="nz-icon nz-icon-override" style="visibility: hidden" @click="onCopy(alertLabelData.name)" :title="$t('overall.copyText')"></i> <i v-if="alertLabelData && alertLabelData.name" class="nz-icon nz-icon-override" style="visibility: hidden" @click="onCopy.stop(alertLabelData.name)" :title="$t('overall.copyText')"></i>
</div> </div>
</div> </div>
<!-- <div class="alert-label-box name-labe"> <!-- <div class="alert-label-box name-labe">
@@ -70,7 +70,7 @@
: "--" : "--"
}} }}
</div> </div>
<i v-if="alertLabelData.manageIp" class="nz-icon nz-icon-override asset-manage-ip" style="visibility: hidden" @click="onCopy(alertLabelData.manageIp)" :title="$t('overall.copyText')"></i> <i v-if="alertLabelData && alertLabelData.manageIp" class="nz-icon nz-icon-override asset-manage-ip" style="visibility: hidden" @click="onCopy.stop(alertLabelData.manageIp)" :title="$t('overall.copyText')"></i>
</div> </div>
<div class="alert-label-box"> <div class="alert-label-box">
<div class="alert-label-title">{{ $t("overall.type") }}</div> <div class="alert-label-title">{{ $t("overall.type") }}</div>
@@ -218,7 +218,7 @@
<div class="alert-label-value document-copy-text"> <div class="alert-label-value document-copy-text">
{{ alertLabelData && alertLabelData.name ? alertLabelData.name : "--" }} {{ alertLabelData && alertLabelData.name ? alertLabelData.name : "--" }}
</div> </div>
<i v-if="alertLabelData.name" class="nz-icon nz-icon-override" style="visibility: hidden" @click="onCopy(alertLabelData.name)" :title="$t('overall.copyText')"></i> <i v-if="alertLabelData && alertLabelData.name" class="nz-icon nz-icon-override" style="visibility: hidden" @click="onCopy.stop(alertLabelData.name)" :title="$t('overall.copyText')"></i>
</div> </div>
</div> </div>
<div class="alert-label-box"> <div class="alert-label-box">
@@ -314,7 +314,7 @@
<div class="alert-label-value document-copy-text"> <div class="alert-label-value document-copy-text">
{{ alertLabelData && alertLabelData.name ? alertLabelData.name : "--" }} {{ alertLabelData && alertLabelData.name ? alertLabelData.name : "--" }}
</div> </div>
<i v-if="alertLabelData.name" class="nz-icon nz-icon-override" style="visibility: hidden" @click="onCopy(alertLabelData.name)" :title="$t('overall.copyText')"></i> <i v-if="alertLabelData && alertLabelData.name" class="nz-icon nz-icon-override" style="visibility: hidden" @click="onCopy.stop(alertLabelData.name)" :title="$t('overall.copyText')"></i>
</div> </div>
</div> </div>
<div class="alert-label-box"> <div class="alert-label-box">
@@ -412,7 +412,7 @@
<div class="alert-label-value document-copy-text"> <div class="alert-label-value document-copy-text">
{{ alertLabelData && alertLabelData.name ? alertLabelData.name : "--" }} {{ alertLabelData && alertLabelData.name ? alertLabelData.name : "--" }}
</div> </div>
<i v-if="alertLabelData.name" class="nz-icon nz-icon-override" style="visibility: hidden" @click="onCopy(alertLabelData.name)" :title="$t('overall.copyText')"></i> <i v-if="alertLabelData && alertLabelData.name" class="nz-icon nz-icon-override" style="visibility: hidden" @click="onCopy.stop(alertLabelData.name)" :title="$t('overall.copyText')"></i>
</div> </div>
</div> </div>
<div class="alert-label-box"> <div class="alert-label-box">
@@ -547,7 +547,7 @@
<div class="alert-label-value document-copy-text"> <div class="alert-label-value document-copy-text">
{{ alertLabelData && alertLabelData.name ? alertLabelData.name : "--" }} {{ alertLabelData && alertLabelData.name ? alertLabelData.name : "--" }}
</div> </div>
<i v-if="alertLabelData.name" class="nz-icon nz-icon-override" style="visibility: hidden" @click="onCopy(alertLabelData.name)" :title="$t('overall.copyText')"></i> <i v-if="alertLabelData && alertLabelData.name" class="nz-icon nz-icon-override" style="visibility: hidden" @click="onCopy.stop(alertLabelData.name)" :title="$t('overall.copyText')"></i>
</div> </div>
</div> </div>
<div class="alert-label-box"> <div class="alert-label-box">

View File

@@ -31,7 +31,7 @@
<div class="document-copy-block"> <div class="document-copy-block">
<div class="alert-label-title">{{$t('overall.name')}}</div> <div class="alert-label-title">{{$t('overall.name')}}</div>
<div class="alert-label-value document-copy-text">{{alertLabelData && alertLabelData.name ? alertLabelData.name : '--'}}</div> <div class="alert-label-value document-copy-text">{{alertLabelData && alertLabelData.name ? alertLabelData.name : '--'}}</div>
<i v-if="alertLabelData.name" class="nz-icon nz-icon-override" style="visibility: hidden" @click="onCopy(alertLabelData.name)" :title="$t('overall.copyText')"></i> <i v-if="alertLabelData && alertLabelData.name" class="nz-icon nz-icon-override" style="visibility: hidden" @click="onCopy.stop(alertLabelData.name)" :title="$t('overall.copyText')"></i>
</div> </div>
</div> </div>
<!-- <div class="alert-label-box name-labe"> <!-- <div class="alert-label-box name-labe">
@@ -49,7 +49,7 @@
: "--" : "--"
}} }}
</div> </div>
<i v-if="alertLabelData.manageIp" class="nz-icon nz-icon-override asset-manage-ip" style="visibility: hidden" @click="onCopy(alertLabelData.manageIp)" :title="$t('overall.copyText')"></i> <i v-if="alertLabelData && alertLabelData.manageIp" class="nz-icon nz-icon-override asset-manage-ip" style="visibility: hidden" @click="onCopy.stop(alertLabelData.manageIp)" :title="$t('overall.copyText')"></i>
</div> </div>
<div class="alert-label-box"> <div class="alert-label-box">
<div class="alert-label-title">{{ $t("overall.type") }}</div> <div class="alert-label-title">{{ $t("overall.type") }}</div>
@@ -197,7 +197,7 @@
<div class="alert-label-value document-copy-text"> <div class="alert-label-value document-copy-text">
{{ alertLabelData && alertLabelData.name ? alertLabelData.name : "--" }} {{ alertLabelData && alertLabelData.name ? alertLabelData.name : "--" }}
</div> </div>
<i v-if="alertLabelData.name" class="nz-icon nz-icon-override" style="visibility: hidden" @click="onCopy(alertLabelData.name)" :title="$t('overall.copyText')"></i> <i v-if="alertLabelData && alertLabelData.name" class="nz-icon nz-icon-override" style="visibility: hidden" @click="onCopy.stop(alertLabelData.name)" :title="$t('overall.copyText')"></i>
</div> </div>
</div> </div>
<div class="alert-label-box"> <div class="alert-label-box">
@@ -293,7 +293,7 @@
<div class="alert-label-value document-copy-text"> <div class="alert-label-value document-copy-text">
{{ alertLabelData && alertLabelData.name ? alertLabelData.name : "--" }} {{ alertLabelData && alertLabelData.name ? alertLabelData.name : "--" }}
</div> </div>
<i v-if="alertLabelData.name" class="nz-icon nz-icon-override" style="visibility: hidden" @click="onCopy(alertLabelData.name)" :title="$t('overall.copyText')"></i> <i v-if="alertLabelData && alertLabelData.name" class="nz-icon nz-icon-override" style="visibility: hidden" @click="onCopy.stop(alertLabelData.name)" :title="$t('overall.copyText')"></i>
</div> </div>
</div> </div>
<div class="alert-label-box"> <div class="alert-label-box">
@@ -391,7 +391,7 @@
<div class="alert-label-value document-copy-text"> <div class="alert-label-value document-copy-text">
{{ alertLabelData && alertLabelData.name ? alertLabelData.name : "--" }} {{ alertLabelData && alertLabelData.name ? alertLabelData.name : "--" }}
</div> </div>
<i v-if="alertLabelData.name" class="nz-icon nz-icon-override" style="visibility: hidden" @click="onCopy(alertLabelData.name)" :title="$t('overall.copyText')"></i> <i v-if="alertLabelData && alertLabelData.name" class="nz-icon nz-icon-override" style="visibility: hidden" @click="onCopy.stop(alertLabelData.name)" :title="$t('overall.copyText')"></i>
</div> </div>
</div> </div>
<div class="alert-label-box"> <div class="alert-label-box">
@@ -526,7 +526,7 @@
<div class="alert-label-value document-copy-text"> <div class="alert-label-value document-copy-text">
{{ alertLabelData && alertLabelData.name ? alertLabelData.name : "--" }} {{ alertLabelData && alertLabelData.name ? alertLabelData.name : "--" }}
</div> </div>
<i v-if="alertLabelData.name" class="nz-icon nz-icon-override" style="visibility: hidden" @click="onCopy(alertLabelData.name)" :title="$t('overall.copyText')"></i> <i v-if="alertLabelData && alertLabelData.name" class="nz-icon nz-icon-override" style="visibility: hidden" @click="onCopy.stop(alertLabelData.name)" :title="$t('overall.copyText')"></i>
</div> </div>
</div> </div>
<div class="alert-label-box"> <div class="alert-label-box">

View File

@@ -19,7 +19,7 @@
<div class="document-copy-block"> <div class="document-copy-block">
<div class="alert-label-title">{{$t('overall.name')}}</div> <div class="alert-label-title">{{$t('overall.name')}}</div>
<div class="alert-label-value document-copy-text">{{alertRuleData.name ? alertRuleData.name : '--'}}</div> <div class="alert-label-value document-copy-text">{{alertRuleData.name ? alertRuleData.name : '--'}}</div>
<i v-if="alertRuleData.name" class="nz-icon nz-icon-override" style="visibility: hidden" @click="onCopy(alertRuleData.name)" :title="$t('overall.copyText')"></i> <i v-if="alertRuleData && alertRuleData.name" class="nz-icon nz-icon-override" style="visibility: hidden" @click="onCopy(alertRuleData.name)" :title="$t('overall.copyText')"></i>
</div> </div>
</div> </div>

View File

@@ -17,7 +17,7 @@
<div class="document-copy-block" style="display:flex"> <div class="document-copy-block" style="display:flex">
<div class="alert-label-title">{{$t('overall.name')}}</div> <div class="alert-label-title">{{$t('overall.name')}}</div>
<div class="alert-label-value document-copy-text">{{alertRuleData.name ? alertRuleData.name : '--'}}</div> <div class="alert-label-value document-copy-text">{{alertRuleData.name ? alertRuleData.name : '--'}}</div>
<i v-if="alertRuleData.name" class="nz-icon nz-icon-override" style="visibility: hidden" @click="onCopy(alertRuleData.name)" :title="$t('overall.copyText')"></i> <i v-if="alertRuleData && alertRuleData.name" class="nz-icon nz-icon-override" style="visibility: hidden" @click="onCopy(alertRuleData.name)" :title="$t('overall.copyText')"></i>
</div> </div>
</div> </div>
<!-- <div class="alert-label-box">--> <!-- <div class="alert-label-box">-->

View File

@@ -37,11 +37,12 @@
<operation-log-tab v-if="from === fromRoute.user && targetTab === 'operationLogTab'" :from="from" :obj="obj" :tabs="tabs.user.operationLog" @changeTab="changeTab" :targetTab.sync="targetTab"></operation-log-tab> <operation-log-tab v-if="from === fromRoute.user && targetTab === 'operationLogTab'" :from="from" :obj="obj" :tabs="tabs.user.operationLog" @changeTab="changeTab" :targetTab.sync="targetTab"></operation-log-tab>
<terminal-log-tab v-if="from === fromRoute.user && targetTab === 'terminalLogTab'" :from="from" :obj="obj" :tabs="tabs.user.terminalLog" @changeTab="changeTab" :targetTab.sync="targetTab"></terminal-log-tab> <terminal-log-tab v-if="from === fromRoute.user && targetTab === 'terminalLogTab'" :from="from" :obj="obj" :tabs="tabs.user.terminalLog" @changeTab="changeTab" :targetTab.sync="targetTab"></terminal-log-tab>
<!-- asset列表的3个 --> <!-- asset列表的3个 -->
<panel-tab-new @exit="closeSubList" @getTableData="getTableData" :paramsType="'asset'" v-if="from === fromRoute.asset && targetTab === 'panelTab'" v-show="subResizeShow" :from="from" :obj="obj" :tabs="tabs.asset.panel" :targetTab.sync="targetTab" @changeTab="changeTab"></panel-tab-new> <panel-tab-new @exit="closeSubList" @getTableData="getTableData" :paramsType="'asset'" v-if="from === fromRoute.asset && targetTab === 'panelTab'" v-show="subResizeShow" :from="from" :obj="obj" :tabs="assetTabs" :targetTab.sync="targetTab" @changeTab="changeTab"></panel-tab-new>
<alertMessageTabNew v-if="from === fromRoute.asset && targetTab === 'alertMessageTab'" v-show="subResizeShow" :sign="sign+'alert'" :from="from" :obj="obj" :tabs="tabs.asset.alertMessage" :targetTab.sync="targetTab" @changeTab="changeTab" ></alertMessageTabNew> <alertMessageTabNew v-if="from === fromRoute.asset && targetTab === 'alertMessageTab'" v-show="subResizeShow" :sign="sign+'alert'" :from="from" :obj="obj" :tabs="assetTabs" :targetTab.sync="targetTab" @changeTab="changeTab" ></alertMessageTabNew>
<endpointTabNew v-if="from === fromRoute.asset && targetTab === 'endpointTab'" v-show="subResizeShow" :from="from" :obj="obj" :tabs="tabs.asset.endpoint" :targetTab.sync="targetTab" @changeTab="changeTab"></endpointTabNew> <endpointTabNew v-if="from === fromRoute.asset && targetTab === 'endpointTab'" v-show="subResizeShow" :from="from" :obj="obj" :tabs="assetTabs" :targetTab.sync="targetTab" @changeTab="changeTab"></endpointTabNew>
<log-bottom-tab v-if="from === fromRoute.asset && targetTab === 'log'" v-show="subResizeShow" :sign="sign+'log'" :from="from" :obj="obj" :tabs="tabs.asset.log" :targetTab.sync="targetTab" @changeTab="changeTab"></log-bottom-tab> <log-bottom-tab v-if="from === fromRoute.asset && targetTab === 'log'" v-show="subResizeShow" :sign="sign+'log'" :from="from" :obj="obj" :tabs="assetTabs" :targetTab.sync="targetTab" @changeTab="changeTab"></log-bottom-tab>
<assetSubTab v-if="from === fromRoute.asset && targetTab === 'assetSubTab' && obj.childrenNum" v-show="subResizeShow" :from="from" :obj="obj" :tabs="tabs.asset.alertMessageSub" @changeTab="changeTab" :targetTab.sync="targetTab"></assetSubTab> <process-bottom-tab v-if="from === fromRoute.asset && targetTab === 'process' && obj.clientState == '1'" v-show="subResizeShow" :from="from" :obj="obj" :tabs="assetTabs" :targetTab.sync="targetTab" @changeTab="changeTab"></process-bottom-tab>
<assetSubTab v-if="from === fromRoute.asset && targetTab === 'assetSubTab' && obj.childrenNum" v-show="subResizeShow" :from="from" :obj="obj" :tabs="assetTabs" @changeTab="changeTab" :targetTab.sync="targetTab"></assetSubTab>
<!--module列表的tab--> <!--module列表的tab-->
<endpointTabNew v-if="from === fromRoute.module && targetTab === 'endpoint'" v-show="subResizeShow" :from="from" :obj="obj" :tabs="tabs.module.moduleTabTitle" :targetTab="targetTab" @changeTab="changeTab"></endpointTabNew> <endpointTabNew v-if="from === fromRoute.module && targetTab === 'endpoint'" v-show="subResizeShow" :from="from" :obj="obj" :tabs="tabs.module.moduleTabTitle" :targetTab="targetTab" @changeTab="changeTab"></endpointTabNew>
<alertMessageTabNew v-if="from === fromRoute.module && targetTab === 'moduleAlertMessage'" v-show="subResizeShow" :from="from" :obj="obj" :tabs="tabs.module.moduleTabTitle" @changeTab="changeTab" :targetTab="targetTab"></alertMessageTabNew> <alertMessageTabNew v-if="from === fromRoute.module && targetTab === 'moduleAlertMessage'" v-show="subResizeShow" :from="from" :obj="obj" :tabs="tabs.module.moduleTabTitle" @changeTab="changeTab" :targetTab="targetTab"></alertMessageTabNew>
@@ -66,6 +67,8 @@
<record-rule-eval-log v-if="from === fromRoute.recordRule && targetTab === 'recordRule'" :from="from" :obj="obj" :tabs="tabs.recordRule" @changeTab="changeTab" :targetTab.sync="targetTab"></record-rule-eval-log> <record-rule-eval-log v-if="from === fromRoute.recordRule && targetTab === 'recordRule'" :from="from" :obj="obj" :tabs="tabs.recordRule" @changeTab="changeTab" :targetTab.sync="targetTab"></record-rule-eval-log>
<!--alertRule Tab--> <!--alertRule Tab-->
<alertMessageTabNew v-if="from === fromRoute.alertSilence && targetTab === 'alertMessageTab'" v-show="subResizeShow" :from="from" :obj="obj" :tabs="tabs.alertSilence" @changeTab="changeTab" :targetTab.sync="targetTab"></alertMessageTabNew> <alertMessageTabNew v-if="from === fromRoute.alertSilence && targetTab === 'alertMessageTab'" v-show="subResizeShow" :from="from" :obj="obj" :tabs="tabs.alertSilence" @changeTab="changeTab" :targetTab.sync="targetTab"></alertMessageTabNew>
<!--issue Tab-->
<!-- <issueTab v-if="from === fromRoute.issue && targetTab === 'issue'" v-show="subResizeShow" :from="from" :obj="obj" :tabs="tabs.alertSilence" @changeTab="changeTab" :targetTab.sync="targetTab"></issueTab>-->
</div> </div>
</div> </div>
</div> </div>
@@ -75,6 +78,7 @@
import cabinetTab from './tabs/cabinetTab' import cabinetTab from './tabs/cabinetTab'
import alertMessageTab from './tabs/alertMessageTab' import alertMessageTab from './tabs/alertMessageTab'
import alertMessageTabNew from './tabs/alertMessageTabNew' import alertMessageTabNew from './tabs/alertMessageTabNew'
import issueTab from './tabs/issueTab'
import alertRuleEvalLog from './tabs/alertRuleEvalLog' import alertRuleEvalLog from './tabs/alertRuleEvalLog'
import assetSubTab from './tabs/assetSubTab' import assetSubTab from './tabs/assetSubTab'
import endpointQuery from './tabs/endpointQuery' import endpointQuery from './tabs/endpointQuery'
@@ -89,15 +93,19 @@ import terminalLogTab from './tabs/terminalLogTab'
import assetTab from '@/components/common/bottomBox/tabs/assetTab' import assetTab from '@/components/common/bottomBox/tabs/assetTab'
import { fromRoute } from '@/components/common/js/constants' import { fromRoute } from '@/components/common/js/constants'
import LogBottomTab from '@/components/common/bottomBox/tabs/logBottomTab' 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 scrapeEndpoint from '@/components/common/bottomBox/tabs/scrapeEndpoint'
import IpDetails from '@/components/common/bottomBox/tabs/IpDetails' import IpDetails from '@/components/common/bottomBox/tabs/IpDetails'
import recordRuleEvalLog from '@/components/common/bottomBox/tabs/recordRuleEvalLog' import recordRuleEvalLog from '@/components/common/bottomBox/tabs/recordRuleEvalLog'
import routerPathParams from '@/components/common/mixin/routerPathParams'
export default { export default {
name: 'bottomBox', name: 'bottomBox',
mixins: [routerPathParams],
components: { components: {
scrapeEndpoint, scrapeEndpoint,
LogBottomTab, LogBottomTab,
processBottomTab,
cabinetTab, cabinetTab,
alertMessageTab, alertMessageTab,
endpointTab, endpointTab,
@@ -114,7 +122,8 @@ export default {
assetSubTab, assetSubTab,
alertRuleEvalLog, alertRuleEvalLog,
IpDetails, IpDetails,
recordRuleEvalLog recordRuleEvalLog,
issueTab
}, },
props: { props: {
isFullScreen: Boolean, // 是否全屏 isFullScreen: Boolean, // 是否全屏
@@ -129,22 +138,21 @@ export default {
obj: { obj: {
immediate: true, immediate: true,
handler (n) { handler (n) {
if ((this.from === fromRoute.asset) && n) { // if ((this.from === fromRoute.asset) && n) {
const assetSub = { prop: 'assetSubTab', name: this.$t('overall.assetSubTab'), active: false } // const assetSub = { prop: 'assetSubTab', name: this.$t('overall.assetSubTab'), active: false }
if (n.childrenNum) { // if (n.childrenNum) {
if (!this.tabs.asset.panel.find(item => item.prop === assetSub.prop)) { // if (!this.tabs.asset.panel.find(item => item.prop === assetSub.prop)) {
this.tabs.asset.panel.push(assetSub) // this.tabs.asset.panel.push(assetSub)
this.tabs.asset.alertMessage.push(assetSub) // this.tabs.asset.alertMessage.push(assetSub)
this.tabs.asset.endpoint.push(assetSub) // this.tabs.asset.endpoint.push(assetSub)
this.tabs.asset.log.push(assetSub) // this.tabs.asset.log.push(assetSub)
} // }
} else if (this.tabs.asset.panel.find(item => item.prop === assetSub.prop)) { // } 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.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.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.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) // this.tabs.asset.log = this.tabs.asset.log.filter(item => item.prop !== assetSub.prop)
} // }
}
} }
} }
}, },
@@ -177,37 +185,43 @@ export default {
// module tab // module tab
}, },
asset: { asset: {
panel: [ assetTabTitle: [
{ prop: 'panelTab', name: this.$t('overall.dashboard'), active: true }, { prop: 'panelTab', name: this.$t('overall.dashboard') },
{ prop: 'alertMessageTab', name: this.$t('overall.alert'), active: false }, { prop: 'alertMessageTab', name: this.$t('overall.alert') },
{ prop: 'endpointTab', name: this.$t('asset.endpoint'), active: false }, { prop: 'endpointTab', name: this.$t('asset.endpoint') },
{ prop: 'log', name: this.$t('dashboard.panel.chartForm.typeVal.log.label'), active: false } { prop: 'log', name: this.$t('dashboard.panel.chartForm.typeVal.log.label') }
],
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 }
] ]
// 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: { module: {
moduleTabTitle: [ moduleTabTitle: [
@@ -266,6 +280,9 @@ export default {
], ],
alertSilence: [ alertSilence: [
{ prop: 'alertMessageTab', name: this.$t('overall.alert'), active: true } { 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') const config = this.obj.configs.find(c => c.type === 'logs')
return config && config.enable === 1 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 () { endpointTabs () {
const config = this.obj.configs.find(c => c.type === 'logs') const config = this.obj.configs.find(c => c.type === 'logs')
const hasLog = config && config.enable === 1 const hasLog = config && config.enable === 1
@@ -307,6 +341,9 @@ export default {
}, },
changeTab (tab) { changeTab (tab) {
this.$emit('update:targetTab', tab) this.$emit('update:targetTab', tab)
this.$nextTick(() => {
this.updatePath(this.$route.query, this.$route.path, 'bottomBox')
})
}, },
afterResize () { afterResize () {
if (this.from === this.fromRoute.endpoint && this.targetTab === 'endpointQuery') { if (this.from === this.fromRoute.endpoint && this.targetTab === 'endpointQuery') {

View File

@@ -0,0 +1,281 @@
<template>
<div>
<el-container>
<el-container class="issuetab-container">
<el-header class="issuetab-header">
<span class="title">this is a title</span>
<div>
<ul id="menu">
<li class="menu-li">
<i class="nz-icon nz-icon-label menu-i"></i>
<div class="menu-div">
<span>{{ this.issuedetailsData.type }}</span>
<span class="describe">Type</span>
</div>
</li>
<li class="menu-li">
<i class="nz-icon nz-icon-label menu-i"></i>
<div class="menu-div">
<span>{{ priorityEnums(issuedetailsData.priority) }}</span>
<span class="describe">Priority</span>
</div>
</li>
<li class="menu-li">
<i class="nz-icon nz-icon-label menu-i"></i>
<div class="menu-div">
<span>{{ stateEnums(this.issuedetailsData.state) }}</span>
<span class="describe">state</span>
</div>
</li>
<li class="menu-li">
<i class="nz-icon nz-icon-user menu-i"></i>
<div class="menu-div">
<span>{{ this.issuedetailsData.reporter.username }}</span>
<span class="describe" >Reporter</span>
</div>
</li>
<li class="menu-li">
<i class="nz-icon nz-icon-user menu-i"></i>
<div class="menu-div">
<span>{{ this.issuedetailsData.assignee.username }}</span>
<span class="describe">Assignee</span>
</div>
</li>
</ul>
</div>
</el-header>
<el-main class="issuetab-main">
<div>
<span class="description" >
<i class="nz-icon nz-icon-arrow-right fold" v-if="foldShow" @click="foldFun"></i>
<i class="nz-icon nz-icon-arrow-down open" v-if="openShow" @click="openFun"></i>
</span>
<span class="description-title">Description</span>
<div class="description-content" v-if="openShow" v-html="this.contents">
</div>
</div>
<div class="relate-assets-box">
<span class="relate-assets" >
<i class="nz-icon nz-icon-arrow-right fold" v-if="assetsfoldShow" @click="assetsfoldFun"></i>
<i class="nz-icon nz-icon-arrow-down open" v-if="assetsopenShow" @click="assetsopenFun"></i>
</span>
<span class="relate-assets-title">Relate-assets</span>
<div class="relate-assets-content" v-if="assetsopenShow " >
<div v-for="(item, index) in this.assets" :key="index" >{{item.name}}</div>
</div>
</div>
</el-main>
<!-- <el-footer>Footer</el-footer> -->
</el-container>
<el-aside width="400px" class="issuetab-aside">
<span>{{$t("issueTab.dynamic")}} </span>
<template>
<el-tabs v-model="activeName" @tab-click="handleClick" class="issuetab-eltabs">
<el-tab-pane :label="$t('issueTab.whole')" name="first" class="tab-pane">
<div class="change ">
<i class="nz-icon nz-icon-edit"></i>
<span>老王</span>
<span>Created issue</span>
<span>2022-09-02</span>
<!-- <div v-for="(item, index) in changeData" :key="index" v-html="item.content" ></div> -->
</div>
<div class="content first-content" >
<div v-for="(item, index) in this.contentData" :key="index">
<i class="nz-icon nz-icon-edit"></i>
<span>{{item.createUser.name}}</span>
<span>{{typeEnums(item.type)}}</span>
<span>{{timezoneToUtcTimeStr(item.cts)}}</span>
<div class="content-data" v-for="(item, index) in contentData" :key="index" v-html="item.content" ></div>
</div>
</div>
</el-tab-pane>
<el-tab-pane :label="$t('issueTab.comment')" name="content" class="tab-pane">
<div class="content " >
<div v-for="(item, index) in this.contentData" :key="index">
<i class="nz-icon nz-icon-edit"></i>
<span>{{item.createUser.name}}</span>
<span>{{typeEnums(item.type)}}</span>
<span>{{timezoneToUtcTimeStr(item.cts)}}</span>
<div class="content-data" v-for="(item, index) in contentData" :key="index" v-html="item.content" ></div>
</div>
</div>
</el-tab-pane>
<el-tab-pane :label="$t('issueTab.changeRecord')" name="change" class="tab-pane">
<div class="change">
<i class="nz-icon nz-icon-edit"></i>
<span>老王</span>
<span>Created issue</span>
<span>2022-09-02</span>
</div>
</el-tab-pane>
</el-tabs>
</template>
<div class="add-comment-btn">
<el-button type="text" v-if="addcommentShow" @click="addcommentBtn">{{$t("issueTab.addComment")}}</el-button>
</div>
<div v-if="textareaShow" class="textareas">
<el-input
class="textareas-input"
type="textarea"
:autosize="{ minRows: 2, maxRows: 4}"
placeholder="多行输入"
v-model="textarea">
</el-input>
<div class="btn-box">
<el-button size="mini" @click="addFun">{{$t("issueTab.Add")}}</el-button>
<el-button size="mini" @click="cancelBtn">{{$t("issueTab.Cencel")}}</el-button>
</div>
</div>
</el-aside>
</el-container>
</div>
</template>
<script>
import mainMixinFun from '@/components/common/mixin/mainMixinFun'
export default {
name: 'issueTab',
mixins: [mainMixinFun],
data () {
return {
url: '/issue',
activeName: 'first',
textareaShow: false, // 底部输入框显示状态
addcommentShow: true, // 底部按钮显示状态
openShow: false, // 展开折叠图标显示状态
foldShow: true, // 展开折叠图标显示状态
assetsopenShow: false, // 展开折叠图标显示状态
assetsfoldShow: true, // 展开折叠图标显示状态
textarea: '', // 底部输入框内容
issuedetailsData: [], // issue详情data
changeData: [], // 变更data
contentData: [], // 评论data
assets: [],
contents: [],
createUser: [],
updateUser: [],
time: '',
defaultProps: {
children: 'children',
label: 'label'
}
}
},
created () {
this.axiosss()
},
methods: {
handleNodeClick (data) {
console.log(data)
},
handleClick (tab, event) {
console.log(tab, event)
},
addcommentBtn () {
this.textareaShow = true
this.addcommentShow = false
},
cancelBtn () {
this.textareaShow = false
this.addcommentShow = true
},
// 处理后台返回的html特殊标签 ----已经弃用 之前有插件处理
delHtmlTag (str) {
return str.replace(/<[^>]+>/g, '').replace(/&nbsp;/ig, '')
},
addFun () {
const params = {
issueId: 1,
content: this.textarea
}
this.$post('/issue/activity', params).then(response => { // 问题动态 新增
if (response.code === 200) {
// console.log(response, 1)
this.axiosss()
}
})
},
axiosss () {
this.$get(`${this.url}/${1}`).then(response => { // issue详情接口
if (response.code === 200) {
this.issuedetailsData = response.data
this.contents = this.issuedetailsData.content
this.assets = this.issuedetailsData.assets
// console.log(this.issuedetailsData, 3)
}
})
this.$get(`${this.url}/activity?issueId=1&type=1&pageSize=-1`).then(response => { // issue动态详情接口-变更记录
if (response.code === 200) {
this.changeData = response.data.list
this.time = response.time
console.log(response.time)
console.log(response.data, 1)
// console.log(response.data, 2)
}
})
this.$get(`${this.url}/activity?issueId=1&type=2&pageSize=-1`).then(response => { // issue动态详情接口-评论
if (response.code === 200) {
this.contentData = response.data.list
this.time = response.time
}
})
},
// priority 枚举转换
priorityEnums (data) {
if (data == 1) {
data = '高'
} else if (data == 2) {
data = '中'
} else {
data = '低'
}
return data
},
// state 枚举转换
stateEnums (data) {
if (data == 1) {
data = '打开'
} else if (data == 2) {
data = '已指派'
} else if (data == 3) {
data = '处理中'
} else if (data == 4) {
data = '挂起'
} else if (data == 5) {
data = '已解决'
} else if (data == 6) {
data = '关闭'
} else if (data == 7) {
data = '取消'
}
return data
},
// type 处理
typeEnums (data) {
if (data == 1) {
data = 'changed issue'
} else if (data == 2) {
data = 'created issue'
}
return data
},
foldFun () {
this.openShow = true
this.foldShow = false
},
openFun () {
this.openShow = false
this.foldShow = true
},
assetsfoldFun () {
this.assetsopenShow = true
this.assetsfoldShow = false
},
assetsopenFun () {
this.assetsopenShow = false
this.assetsfoldShow = true
}
}
}
</script>

View File

@@ -0,0 +1,181 @@
<template>
<nz-bottom-data-list
:showTitle='showTitle'
:obj='obj'
:api="url"
:custom-table-title.sync="tools.customTableTitle"
:layout="['elementSet']"
:search-msg="searchMsg"
:tabs="tabs"
:targetTab="targetTab"
:showPagination="false"
@search="search"
@changeTab="changeTab"
>
<template v-slot:title><span :title="obj.name">{{obj.name}}</span></template>
<template v-slot:top-tool-right>
<div class="top-tool-right">
<div class="top-tool-search margin-r-20">
<el-input ref="elementQuery" @clear="clearInput" id="elementQuery" @focus="focusInput" @blur="blurInput" v-model="queryExpression" class="query-input-inactive" size="mini" clearable :placeholder="$t('project.endpoint.promExpr')" >
<i slot="suffix" class="el-input__icon nz-icon nz-icon-search" style="float:right" @click="focusInput"></i>
</el-input>
</div>
<pick-time
ref="pickTime"
v-model="searchTime"
:refresh-data-func="dateChange"
:showTimePicker="false"
:use-chart-unit="false"
class="pickTime margin-r-10">
</pick-time>
</div>
</template>
<template v-slot>
<assetProcessTable
ref="dataTable"
:orderByFa="'id'"
v-my-loading="tools.loading"
:loading="tools.loading"
:api="url"
:custom-table-title="tools.customTableTitle"
:height="subTableHeight"
:filterTime="filterTime"
:table-data="tableData"
:terminaLogTab="true"
:queryExpression="queryExpression"
@del="del"
@edit="edit"
@orderBy="tableDataSort"
@reload="getTableData"
@selectionChange="selectionChange"></assetProcessTable>
</template>
<template v-slot:pagination>
<Pagination ref="Pagination" :pageObj="pageObj" :tableId="tableId" @pageNo='pageNo' @pageSize='pageSize'></Pagination>
</template>
</nz-bottom-data-list>
</template>
<script>
import bus from '@/libs/bus'
import dataListMixin from '@/components/common/mixin/dataList'
import subDataListMixin from '@/components/common/mixin/subDataList'
import nzBottomDataList from '@/components/common/bottomBox/nzBottomDataList'
import assetProcessTable from '@/components/common/table/asset/assetProcessTable'
import detailViewRightMixin from '@/components/common/mixin/detailViewRightMixin'
export default {
name: 'processBottomTab',
mixins: [dataListMixin, subDataListMixin, detailViewRightMixin],
components: {
nzBottomDataList,
assetProcessTable
},
props: {
obj: Object,
showTitle: {
type: Boolean,
default: true
}
},
watch: {
obj (n) {
this.searchLabel = { id: n.id }
this.getTableData()
},
queryExpression (n) {
const temp = this
setTimeout(function () {
temp.tableFilter()
}, 500)
}
},
data () {
return {
url: 'asset/oshi/process/1/',
tableId: 'assetProcessTable', // 需要分页的table的id用于记录每页数量
searchMsg: { // 给搜索框子组件传递的信息
zheze_none: true,
searchLabelList: []
},
searchLabel: { id: this.obj.id },
queryExpression: '',
tableData: [],
tableDataCopy: '',
searchTime: bus.getTimezontDateRange(),
filterTime: [
bus.timeFormate(bus.getOffsetTimezoneData(-1), 'YYYY-MM-DD HH:mm:ss'),
bus.timeFormate(bus.getOffsetTimezoneData(), 'YYYY-MM-DD HH:mm:ss')
]
}
},
methods: {
getTableData (params) {
if (params && Object.keys(params).length > 0) {
for (const key in params) {
this.$set(this.searchLabel, key, params[key])
}
}
if (this.orderBy) {
this.$set(this.searchLabel, 'orderBy', this.orderBy)
} else {
delete this.searchLabel.orderBy
}
this.$set(this.searchLabel, 'pageNo', this.pageObj.pageNo)
this.$set(this.searchLabel, 'pageSize', -1)
this.tools.loading = true
if (this.obj) {
this.$set(this.searchLabel, 'id', this.obj.id)
}
this.tableDataCopy = ''
this.$get('asset/oshi/process?id=' + this.obj.id).then(response => {
// this.$get('/mock/asset/oshi/process').then(response => {
this.tools.loading = false
this.nowTime = this.utcTimeToTimezoneStr(response.time)
if (response.code === 200) {
this.tableData = response.data.list
this.tableDataCopy = JSON.stringify(this.tableData)
if (!this.scrollbarWrap && this.$refs.dataTable && this.$refs.dataTable.$refs.dataTable) {
this.$nextTick(() => {
this.scrollbarWrap = this.$refs.dataTable.$refs.dataTable.bodyWrapper
this.toTopBtnHandler(this.scrollbarWrap)
})
}
}
})
},
clearInput () {
this.$refs.elementQuery.focus()
},
focusInput () {
let classVal = document.getElementById('elementQuery').parentElement.getAttribute('class')
classVal = classVal.replace('query-input-inactive', 'query-input-active')
document.getElementById('elementQuery').parentElement.setAttribute('class', classVal)
this.$refs.elementQuery.focus()
},
blurInput () {
if (!this.queryExpression || this.queryExpression == '') {
setTimeout(function () {
let classVal = document.getElementById('elementQuery').parentElement.getAttribute('class')
classVal = classVal.replace('query-input-active', 'query-input-inactive')
document.getElementById('elementQuery').parentElement.setAttribute('class', classVal)
}, 100)
}
},
tableFilter () {
const tableDatas = JSON.parse(this.tableDataCopy)
this.tableData = tableDatas.filter((item) => {
const element = item.name
return element.indexOf(this.queryExpression) !== -1
})
},
dateChange () {
// const nowTimeType = this.$refs.pickTime.$refs.timePicker.nowTimeType
// this.setSearchTime(nowTimeType.type, nowTimeType.value)
this.searchTime = bus.getTimezontDateRange()
this.filterTime[0] = bus.timeFormate(this.searchTime[0], 'YYYY-MM-DD HH:mm:ss')
this.filterTime[1] = bus.timeFormate(this.searchTime[1], 'YYYY-MM-DD HH:mm:ss')
this.tableFilter()
}
}
}
</script>

View File

@@ -64,9 +64,11 @@ import assetTab from '@/components/common/bottomBox/tabs/assetTab'
import { fromRoute } from '@/components/common/js/constants' import { fromRoute } from '@/components/common/js/constants'
import LogBottomTab from '@/components/common/bottomBox/tabs/logBottomTab' import LogBottomTab from '@/components/common/bottomBox/tabs/logBottomTab'
import detailRightTop from './detailRightTop/detailRightTop' import detailRightTop from './detailRightTop/detailRightTop'
import routerPathParams from "@/components/common/mixin/routerPathParams";
export default { export default {
name: 'detailViewRight', name: 'detailViewRight',
mixins: [routerPathParams],
components: { components: {
LogBottomTab, LogBottomTab,
cabinetTab, cabinetTab,
@@ -101,7 +103,7 @@ export default {
from: { from: {
immediate: true, immediate: true,
handler (n) { handler (n) {
this.setTargetTab() this.setTargetTab(true)
} }
}, },
obj: { obj: {
@@ -276,6 +278,9 @@ export default {
}, },
changeTab (tab) { changeTab (tab) {
this.targetTab = tab this.targetTab = tab
this.$nextTick(() => {
this.updatePath(this.$route.query, this.$route.path, 'bottomBox')
})
}, },
afterResize () { afterResize () {
if (this.from === this.fromRoute.endpoint && this.targetTab === 'endpointQuery') { if (this.from === this.fromRoute.endpoint && this.targetTab === 'endpointQuery') {
@@ -289,7 +294,13 @@ export default {
getTableData () { getTableData () {
this.$emit('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) { if (this.from === fromRoute.asset) {
this.targetTab = 'panelTab' this.targetTab = 'panelTab'
} else if (this.from === fromRoute.endpoint) { } else if (this.from === fromRoute.endpoint) {

View File

@@ -38,17 +38,22 @@ export const clickoutside = {
} }
if (oldValue) { if (oldValue) {
// const newValue = JSON.parse(JSON.stringify(binding.value.obj)) // 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'), { MessageBox.confirm(i18n.t('tip.confirmCancel'), {
confirmButtonText: i18n.t('tip.yes'), confirmButtonText: i18n.t('tip.yes'),
cancelButtonText: i18n.t('tip.no'), cancelButtonText: i18n.t('tip.no'),
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
el.isShow = false
if (binding.value.func) { if (binding.value.func) {
binding.value.func() binding.value.func()
} }
}).catch(err => err) }).catch(err => {
} else { el.isShow = false
console.log(err)
})
} else if (!el.isShow) {
binding.value.func() binding.value.func()
} }
} else { } else {

View File

@@ -76,7 +76,6 @@ export default {
maxBounds: [[-179, -85], [179, 85]], maxBounds: [[-179, -85], [179, 85]],
hash: false, hash: false,
transformRequest: function (url, resourceType) { transformRequest: function (url, resourceType) {
console.log(resourceType)
if (resourceType === 'Tile' && url.indexOf('https://api.maptiler.com/tiles/v3') > -1) { if (resourceType === 'Tile' && url.indexOf('https://api.maptiler.com/tiles/v3') > -1) {
const urlParams = url.split('.pbf')[0].split('/') const urlParams = url.split('.pbf')[0].split('/')
const z = urlParams[urlParams.length - 3] const z = urlParams[urlParams.length - 3]
@@ -161,7 +160,6 @@ export default {
}) })
// const marker = L.marker([this.mapParam.latitude, this.mapParam.longitude]).addTo(map) // const marker = L.marker([this.mapParam.latitude, this.mapParam.longitude]).addTo(map)
this.map.on('click', function (e) { this.map.on('click', function (e) {
console.log(e, e.lngLat)
const coords = e.lngLat const coords = e.lngLat
geoJSON.features[0].geometry.coordinates = [coords.lng, coords.lat] geoJSON.features[0].geometry.coordinates = [coords.lng, coords.lat]
self.map.getSource('centerMarker').setData(geoJSON) self.map.getSource('centerMarker').setData(geoJSON)

View File

@@ -1,7 +1,7 @@
<template> <template>
<div class="login" id="login-bgimg"> <div class="login" id="login-bgimg">
<div class="model"></div> <div class="model"></div>
<div class="stars-wrapper" id="stars-wrapper" v-if="!this.bgImg"> <div class="stars-wrapper" id="stars-wrapper" v-if="false">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 358.52 351.84" class="star-cloud star-cloud1"> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 358.52 351.84" class="star-cloud star-cloud1">
<g id="Layer_2" data-name="Layer 2"> <g id="Layer_2" data-name="Layer 2">
<g id="Layer_1-2" data-name="Layer 1"> <g id="Layer_1-2" data-name="Layer 1">
@@ -583,7 +583,7 @@ export default {
if (this.bgImg) { if (this.bgImg) {
document.getElementById('login-bgimg').style['background-image'] = `url(${this.bgImg})` document.getElementById('login-bgimg').style['background-image'] = `url(${this.bgImg})`
} else { } else {
this.initStar() // this.initStar()
} }
}, },
beforeDestroy () { beforeDestroy () {

View File

@@ -303,7 +303,7 @@ export default {
let labels = this.$loadsh.cloneDeep(row.labels) let labels = this.$loadsh.cloneDeep(row.labels)
if (typeof labels === 'string') labels = JSON.parse(labels) if (typeof labels === 'string') labels = JSON.parse(labels)
this.objectSilence.matchers = [] this.objectSilence.matchers = []
const filterArr = ['alertname', 'severity_id', 'severity', 'rule_type'] const filterArr = ['alertname', 'severity_id', 'severity', 'rule_type', 'nz_agent_id']
Object.keys(labels).forEach((key, i) => { Object.keys(labels).forEach((key, i) => {
if (filterArr.indexOf(key) != -1) { if (filterArr.indexOf(key) != -1) {
return return

View File

@@ -1,5 +1,15 @@
export default { export default {
props: {}, props: {},
watch: {
detailViewRightObj: {
immediate: true,
handler (n) {
if (n) {
this.updatePath(this.$route.query, this.$route.path, 'nzDetailList')
}
}
}
},
data () { data () {
return { return {
detailType: localStorage.getItem('detail-view-' + this.tableId) || 'list', detailType: localStorage.getItem('detail-view-' + this.tableId) || 'list',
@@ -21,6 +31,9 @@ export default {
// this.detailViewRightObj = '' // this.detailViewRightObj = ''
// } // }
this.detailType = flag this.detailType = flag
const query = { ...this.$route.query, detailType: flag }
query.bottomBox = this.detailType !== 'view'
this.$router.replace({ query: query }).catch(err => {})
let dataList = '' let dataList = ''
localStorage.setItem('detail-view-' + this.tableId, this.detailType) localStorage.setItem('detail-view-' + this.tableId, this.detailType)
if (this.detailType === 'view') { if (this.detailType === 'view') {

View File

@@ -27,16 +27,84 @@ export default {
}, 200) }, 200)
qv && this.$set(val.target, val.propertyName, qv) qv && this.$set(val.target, val.propertyName, qv)
}) })
if (q.bottomBox && JSON.parse(q.bottomBox)) {
this.$nextTick(() => {
this.detailType = q.detailType
const detailType = this.detailType === 'list' ? 'dataList' : 'detailList'
this.$refs[detailType].bottomBox.showSubList = JSON.parse(q.bottomBox)
this.$refs[detailType].bottomBox.targetTab = q.targetTab
this.$refs[detailType].bottomBox.object = JSON.parse(q.selectObj)
})
} else if (this.detailType === 'view') {
this.detailType = q.detailType
this.detailViewRightObj = JSON.parse(q.selectObj)
this.$store.commit('setGlobalSearchId', this.detailViewRightObj.id)
}
}, },
// 更新path包含请求参数 // 更新path包含请求参数
updatePath (param, path) { updatePath (param, path, from) {
const params = lodash.cloneDeep(param) this.$nextTick(() => {
Object.keys(params).forEach(key => { const params = lodash.cloneDeep(param)
if (!params[key]) { Object.keys(params).forEach(key => {
delete params[key] if (!params[key]) {
delete params[key]
}
})
if (!from) {
const detailType = this.detailType === 'list' ? 'dataList' : 'detailList'
localStorage.setItem('detail-view-' + this.tableId, this.detailType)
params.detailType = this.detailType
if (this.detailType === 'list' && this.$refs[detailType]) {
params.bottomBox = this.$refs[detailType].bottomBox.showSubList
params.targetTab = this.$refs[detailType].bottomBox.targetTab
} else {
params.bottomBox = false
params.targetTab = this.$route.query.targetTab
}
if (this.detailType === 'list' && this.$refs[detailType]) {
params.selectObj = JSON.stringify({
id: this.$refs[detailType].bottomBox.object.id,
name: this.$refs[detailType].bottomBox.object.name,
configs: this.$refs[detailType].bottomBox.object.configs ? this.$refs[detailType].bottomBox.object.configs.map(item => { return { type: item.type, enable: item.enable } }) : '',
childrenNum: this.$refs[detailType].bottomBox.object.childrenNum || ''
})
} else if (this.$refs[detailType] && this.$refs[detailType].detailViewRightObj) {
this.$nextTick(() => {
params.selectObj = JSON.stringify({
id: this.$refs[detailType].detailViewRightObj.id,
name: this.$refs[detailType].detailViewRightObj.name,
configs: this.$refs[detailType].detailViewRightObj.configs ? this.$refs[detailType].detailViewRightObj.configs.map(item => { return { type: item.type, enable: item.enable } }) : '',
childrenNum: this.$refs[detailType].detailViewRightObj.childrenNum || ''
})
})
}
this.$router.replace({ path: path, query: params }).catch(err => {})
} else if (from === 'nzDatalist' && this.bottomBox) {
params.bottomBox = this.bottomBox.showSubList
params.targetTab = this.bottomBox.targetTab
params.selectObj = JSON.stringify({
id: this.bottomBox.object.id,
name: this.bottomBox.object.name,
configs: this.bottomBox.object.configs ? this.bottomBox.object.configs.map(item => { return { type: item.type, enable: item.enable } }) : '',
childrenNum: this.bottomBox.object.childrenNum || '',
clientState: this.bottomBox.object.clientState || ''
})
this.$router.replace({ path: path, query: params }).catch(err => {})
} else if (from === 'nzDetailList' && this.detailViewRightObj) {
params.targetTab = this.$route.query.targetTab
params.selectObj = JSON.stringify({
id: this.detailViewRightObj.id,
name: this.detailViewRightObj.name,
configs: this.detailViewRightObj.configs ? this.detailViewRightObj.configs.map(item => { return { type: item.type, enable: item.enable } }) : '',
childrenNum: this.detailViewRightObj.childrenNum || '',
clientState: this.detailViewRightObj.clientState || ''
})
this.$router.replace({ path: path, query: params }).catch(err => {})
} else if (from === 'bottomBox' && this.targetTab) {
params.targetTab = this.targetTab
this.$router.replace({ path: path, query: params }).catch(err => {})
} }
}) })
this.$router.replace({ path: path, query: params }).catch(err => {})
}, },
setSearchInput (val, qv) { setSearchInput (val, qv) {
let dataList = '' let dataList = ''

View File

@@ -1,8 +1,7 @@
<template> <template>
<div class="props-box" :loading="loading"> <div class="props-box" :loading="loading">
<!--所有属性--> <!--所有属性-->
<keep-alive> <el-tabs v-model="tab" type="card" v-if="selection.pen" @tab-click="tabClick">
<el-tabs v-model="tab" type="card" v-if="selection.pen" @tab-click="tabClick">
<el-tab-pane :label="$t('project.topology.data')" name="1"> <el-tab-pane :label="$t('project.topology.data')" name="1">
<el-form v-model="selection.pen.data" class="pens-data" label-position="top"> <el-form v-model="selection.pen.data" class="pens-data" label-position="top">
<!--module--> <!--module-->
@@ -24,11 +23,11 @@
<el-row class="form-row-title"> <el-row class="form-row-title">
{{ $t('dashboard.panel.chartForm.thresholds') }} {{ $t('dashboard.panel.chartForm.thresholds') }}
<span v-if="selection.pen.data.valueMappingSort !=='desc'" class="title__label" <span v-if="selection.pen.data.valueMappingSort !=='desc'" class="title__label"
>0:Ok > >{{ >0:Ok > >{{
selection.pen.data.valueMapping.length selection.pen.data.valueMapping.length
}}:Critical</span> }}:Critical</span>
<span v-if="selection.pen.data.valueMappingSort ==='desc'" class="title__label" <span v-if="selection.pen.data.valueMappingSort ==='desc'" class="title__label"
>{{ >{{
selection.pen.data.valueMapping.length selection.pen.data.valueMapping.length
}}:Critical > >0:Ok</span> }}:Critical > >0:Ok</span>
<el-form-item class="float-right" prop="type" style="height: 100%;"> <el-form-item class="float-right" prop="type" style="height: 100%;">
@@ -45,6 +44,7 @@
<el-row v-for="(item,index) in selection.pen.data.expressArr" :key="index" class="element-item form-row-item" <el-row v-for="(item,index) in selection.pen.data.expressArr" :key="index" class="element-item form-row-item"
style=""> style="">
<promql-input <promql-input
v-if="selection.pen"
:from-father-data="true" :from-father-data="true"
:isTopo="true" :isTopo="true"
:metricOptionsParent="metricOptions" :metricOptionsParent="metricOptions"
@@ -109,9 +109,9 @@
<span v-if="item.level!==0"> <span v-if="item.level!==0">
<div style="display: inline-block"> <div style="display: inline-block">
<nezhaColor :isTopo="true" <nezhaColor :isTopo="true"
:color-val="item.color" :color-val="item.color"
:presetColors="predefineColors" :single="false" :presetColors="predefineColors" :single="false"
:value-arr="[{name:'fill',value:item.color.fill,key:'bac'},{name:'line',value:item.color.line,key:'line'},{name:'text',value:item.color.text,key:'text'}]" @colorChange="(val,key)=>{colorChangeTable(item,val,key)}"/> :value-arr="[{name:'fill',value:item.color.fill,key:'bac'},{name:'line',value:item.color.line,key:'line'},{name:'text',value:item.color.text,key:'text'}]" @colorChange="(val,key)=>{colorChangeTable(item,val,key)}"/>
</div> </div>
</span> </span>
<span v-else>base</span> <span v-else>base</span>
@@ -223,6 +223,7 @@
class="element-item form-row-item form-row-item-border" class="element-item form-row-item form-row-item-border"
style="width: 100%; border-radius: 2px; padding-right: 60px;"> style="width: 100%; border-radius: 2px; padding-right: 60px;">
<promql-input <promql-input
v-if="selection.pen"
:from-father-data="true" :from-father-data="true"
:isTopo="true" :isTopo="true"
:metricOptionsParent="metricOptions" :metricOptionsParent="metricOptions"
@@ -429,7 +430,7 @@
:class="['nz-icon',bkTypeOption.find(item1=>item1.id==selection.pen.data.gradientType).label,bkTypeOption.find(item1=>item1.id==selection.pen.data.gradientType).fontSize]"></i> :class="['nz-icon',bkTypeOption.find(item1=>item1.id==selection.pen.data.gradientType).label,bkTypeOption.find(item1=>item1.id==selection.pen.data.gradientType).fontSize]"></i>
</div> </div>
<el-option v-for="(item,index) in bkTypeOption" :value="item.id" :key="index"> <el-option v-for="(item,index) in bkTypeOption" :value="item.id" :label="''" :key="index">
<i :class="['nz-icon',item.label,item.fontSize]"></i> <i :class="['nz-icon',item.label,item.fontSize]"></i>
</el-option> </el-option>
<!--el-input__inner--> <!--el-input__inner-->
@@ -716,53 +717,52 @@
</div> </div>
</div> </div>
<!-- <div class="props-pen-item">--> <!-- <div class="props-pen-item">-->
<!-- <div>{{ $t('project.topology.textOffsetX') }}</div>--> <!-- <div>{{ $t('project.topology.textOffsetX') }}</div>-->
<!-- <div class="p10 pl0">--> <!-- <div class="p10 pl0">-->
<!-- <el-input-number--> <!-- <el-input-number-->
<!-- @focus="inputFocus"--> <!-- @focus="inputFocus"-->
<!-- @blur="inputBlur"--> <!-- @blur="inputBlur"-->
<!-- :precision="0"--> <!-- :precision="0"-->
<!-- controls-position="right"--> <!-- controls-position="right"-->
<!-- size="small" name="x"--> <!-- size="small" name="x"-->
<!-- class="input"--> <!-- class="input"-->
<!-- v-model.number="selection.pen.textLeft"--> <!-- v-model.number="selection.pen.textLeft"-->
<!-- :readonly="readonly"--> <!-- :readonly="readonly"-->
<!-- required--> <!-- required-->
<!-- @change="onChange()"></el-input-number>--> <!-- @change="onChange()"></el-input-number>-->
<!-- </div>--> <!-- </div>-->
<!-- </div>--> <!-- </div>-->
<!-- <div class="props-pen-item">--> <!-- <div class="props-pen-item">-->
<!-- <div>{{ $t('project.topology.textOffsetY') }}</div>--> <!-- <div>{{ $t('project.topology.textOffsetY') }}</div>-->
<!-- <div class="p10 pl0">--> <!-- <div class="p10 pl0">-->
<!-- <el-input-number--> <!-- <el-input-number-->
<!-- @focus="inputFocus"--> <!-- @focus="inputFocus"-->
<!-- @blur="inputBlur"--> <!-- @blur="inputBlur"-->
<!-- :precision="0"--> <!-- :precision="0"-->
<!-- controls-position="right"--> <!-- controls-position="right"-->
<!-- size="small" name="x"--> <!-- size="small" name="x"-->
<!-- class="input"--> <!-- class="input"-->
<!-- v-model.number="selection.pen.textTop"--> <!-- v-model.number="selection.pen.textTop"-->
<!-- :readonly="readonly"--> <!-- :readonly="readonly"-->
<!-- required--> <!-- required-->
<!-- @change="onChange()"></el-input-number>--> <!-- @change="onChange()"></el-input-number>-->
<!-- </div>--> <!-- </div>-->
<!-- </div>--> <!-- </div>-->
</div> </div>
</el-collapse-item> </el-collapse-item>
</el-collapse> </el-collapse>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
</keep-alive>
<!--选中多个--> <!--选中多个-->
<keep-alive> <keep-alive>
<div v-if="selection.pens" class=""> <div v-if="selection.pens" class="">
<el-collapse v-model="activeNames"> <el-collapse v-model="activeNames">
<!--对齐方式--> <!--对齐方式-->
<el-collapse-item :title="$t('project.topology.align')" name="1" v-if="selection.pens"> <el-collapse-item :title="$t('project.topology.align')" name="1" v-if="selection.pens">
<label class="hover pointer mr10 iconLabel" v-for="item in nodesAlign" :title="item.desc"> <label class="hover pointer mr10 iconLabel" v-for="item in nodesAlign" :title="item.desc" :key="item.value">
<i :class="['iconfont','iconfontSize16',`icon-align-${item.value}`]" <i :class="['iconfont','iconfontSize16',`icon-align-${item.value}`]"
@click="onNodesAlign(item.value)"></i> @click="onNodesAlign(item.value)"></i>
</label> </label>
@@ -1546,6 +1546,7 @@ export default {
if (value === 'lineDash') { if (value === 'lineDash') {
this.selection.pen.lineDash = val ? (val == 1 ? [5, 5] : ((val == 2 ? [10, 10] : [10, 10, 2, 10]))) : [] this.selection.pen.lineDash = val ? (val == 1 ? [5, 5] : ((val == 2 ? [10, 10] : [10, 10, 2, 10]))) : []
} }
console.log(this.selection.pen)
this.$emit('change', this.selection.pen) this.$emit('change', this.selection.pen)
// if(!this.selection.pen.type||this.selection.pens){ // if(!this.selection.pen.type||this.selection.pens){
// this.$emit('change',this.selection.pen||this.selection.pens); // this.$emit('change',this.selection.pen||this.selection.pens);

View File

@@ -713,7 +713,10 @@ export default {
if (!getTopology(this.topologyIndex)) { if (!getTopology(this.topologyIndex)) {
return return
} }
getTopology(this.topologyIndex).open(data || {}) if (!data.pens) {
data.pens = []
}
getTopology(this.topologyIndex).open(data)
getTopology(this.topologyIndex).lock(1) getTopology(this.topologyIndex).lock(1)
this.objChange = false this.objChange = false
let flag = false let flag = false
@@ -878,6 +881,7 @@ export default {
resolve(data) resolve(data)
data = null data = null
} else { } else {
delete data.origin
data.ruleColor = this.theme == 'light' ? '#4e4e4e' : '#f9f9f9' data.ruleColor = this.theme == 'light' ? '#4e4e4e' : '#f9f9f9'
data.gridColor = this.theme == 'light' ? '#ededed' : '#090909' data.gridColor = this.theme == 'light' ? '#ededed' : '#090909'
data.grid = false data.grid = false
@@ -1645,7 +1649,16 @@ export default {
}, },
onUpdateProps (node) { // 更新pen onUpdateProps (node) { // 更新pen
getTopology(this.topologyIndex).setValue(node) const obj = this.$loadsh.cloneDeep(node)
console.log(obj)
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 () { handleAvatarSuccess () {
@@ -2221,7 +2234,10 @@ export default {
let domRect = document.getElementById('topology-canvas' + this.topologyIndex).getBoundingClientRect() let domRect = document.getElementById('topology-canvas' + this.topologyIndex).getBoundingClientRect()
getTopology(this.topologyIndex).canvasPos = domRect getTopology(this.topologyIndex).canvasPos = domRect
if (this.fromOverView) { 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 let flag = false

View File

@@ -117,7 +117,7 @@ export default {
pen: null, pen: null,
pens: null pens: null
} }
if (!pens.length) return if (!pens.length || !this.editTopologyFlag) return
this.$nextTick(() => { this.$nextTick(() => {
if (pens.length == 1) { if (pens.length == 1) {
this.modulesDiff && this.modulesDiff(pens[0]) this.modulesDiff && this.modulesDiff(pens[0])

View File

@@ -968,6 +968,8 @@ export default {
objectInfo.type = val.valnum objectInfo.type = val.valnum
} else if (val.label === 'issueState') { } else if (val.label === 'issueState') {
objectInfo.state = val.valnum objectInfo.state = val.valnum
} else if (val.label === 'silenceState') {
objectInfo.state = val.valnum
} else if (val.label === 'priority') { } else if (val.label === 'priority') {
objectInfo.priority = val.valnum objectInfo.priority = val.valnum
} else if (typeof (val.valnum) === 'undefined' || val.valnum == '') { } else if (typeof (val.valnum) === 'undefined' || val.valnum == '') {
@@ -1611,10 +1613,14 @@ export default {
this.select_list.forEach(item => { this.select_list.forEach(item => {
if (item.listStr) { if (item.listStr) {
if (item.listStr == 'issue') { if (item.listStr == 'issue') {
item.valnum = item.val item.valnum = JSON.parse(localStorage.getItem('nz-history-' + this.where))[0][0].valnum
item.val = JSON.parse(localStorage.getItem('nz-history-' + this.where))[0][0].val item.val = JSON.parse(localStorage.getItem('nz-history-' + this.where))[0][0].val
} else { } else {
item.val = this[item.listStr].find(r => r.id == item.valnum).name if (this.selectInfoList[item.listStr]) {
item.val = this.selectInfoList[item.listStr].find(r => r.value == item.valnum).label
} else {
item.val = this[item.listStr].find(r => r.id == item.valnum).name
}
} }
} }
}) })

View File

@@ -347,6 +347,18 @@ export default {
label: this.$t('overall.cancel') label: this.$t('overall.cancel')
} }
], ],
silenceState: [
{
value: 1,
label: this.$t('silence.active')
}, {
value: 2,
label: this.$t('silence.pending')
}, {
value: 3,
label: this.$t('silence.expired')
}
],
priority: [ priority: [
{ {
value: 1, value: 1,

View File

@@ -80,15 +80,15 @@
</span> </span>
</template> </template>
<template v-else-if="item.prop === 'state'"> <template v-else-if="item.prop === 'state'">
<span v-if="scope.row.state === 1" class="silence-active" <span v-if="scope.row.state === 1">
>active</span <div class="active-icon green-bg inline-block"></div>
> {{$t('silence.active')}}</span>
<span v-if="scope.row.state === 2" class="silence-pending" <span v-if="scope.row.state === 2">
>pending</span <div class="active-icon bgFFECD9 inline-block"></div>
> {{$t('silence.pending')}}</span>
<span v-if="scope.row.state === 3" class="silence-expired" <span v-if="scope.row.state === 3">
>expired</span <div class="active-icon gray-bg inline-block"></div>
> {{$t('silence.expired')}}</span>
</template> </template>
<template v-else-if="item.prop === 'utime'"> <template v-else-if="item.prop === 'utime'">
{{ utcTimeToTimezoneStr(scope.row[item.prop]) }} {{ utcTimeToTimezoneStr(scope.row[item.prop]) }}
@@ -180,130 +180,130 @@
</template> </template>
<script> <script>
import table from "@/components/common/mixin/table"; import table from '@/components/common/mixin/table'
import { calcDurationByStringTimeB } from "@/components/common/js/tools"; import { calcDurationByStringTimeB } from '@/components/common/js/tools'
import nzAlertTag from "../../../page/alert/nzAlertTag"; import nzAlertTag from '../../../page/alert/nzAlertTag'
import { sameLabels } from "@/components/common/js/constants"; import { sameLabels } from '@/components/common/js/constants'
export default { export default {
name: "alertSilenceTable", name: 'alertSilenceTable',
components: { components: {
nzAlertTag, nzAlertTag
}, },
mixins: [table], mixins: [table],
props: { props: {
loading: Boolean, loading: Boolean,
nowTime: {}, nowTime: {}
}, },
data() { data () {
return { return {
/* 表格相关 */ /* 表格相关 */
tableTitle: [ tableTitle: [
{ {
label: "ID", label: 'ID',
prop: "id", prop: 'id',
show: true, show: true,
width: 80, width: 80,
sortable: "custom", sortable: 'custom'
}, },
{ {
label: this.$t("overall.name"), label: this.$t('overall.name'),
prop: "name", prop: 'name',
show: true, show: true,
minWidth: 150, minWidth: 150
}, },
{ {
label: this.$t("alert.silence.matchers"), label: this.$t('alert.silence.matchers'),
prop: "matchers", prop: 'matchers',
show: true, show: true,
minWidth: 200, minWidth: 200,
sortable: "custom", sortable: 'custom'
}, },
{ {
label: this.$t("overall.startTime"), label: this.$t('overall.startTime'),
prop: "startAt", prop: 'startAt',
show: true, show: true,
width: 300, width: 300,
sortable: "custom", sortable: 'custom'
}, },
{ {
label: this.$t("config.terminallog.duration"), label: this.$t('config.terminallog.duration'),
prop: "duration", prop: 'duration',
show: true, show: true,
width: 120, width: 120
}, },
{ {
label: this.$t("overall.remark"), label: this.$t('overall.remark'),
prop: "remark", prop: 'remark',
show: true, show: true,
width: 120, width: 120
}, },
{ {
label: this.$t("alert.silence.upTime"), label: this.$t('alert.silence.upTime'),
prop: "utime", prop: 'utime',
show: false, show: false,
width: 300, width: 300
}, },
{ {
label: this.$t("alert.alert"), label: this.$t('alert.alert'),
prop: "alertNum", prop: 'alertNum',
show: false, show: false,
width: 120, width: 120,
sortable: "custom", sortable: 'custom'
}, },
{ {
label: this.$t("overall.state"), label: this.$t('overall.state'),
prop: "state", prop: 'state',
show: true, show: true,
width: 120, width: 120
}, }
], ]
}; }
}, },
computed: { computed: {
getDuration() { getDuration () {
return function (record) { return function (record) {
if (record.endAt) { if (record.endAt) {
return calcDurationByStringTimeB(record.startAt, record.endAt); return calcDurationByStringTimeB(record.startAt, record.endAt)
} }
return calcDurationByStringTimeB( return calcDurationByStringTimeB(
record.startAt, record.startAt,
this.utcTimeToTimezoneStr(this.nowTime) this.utcTimeToTimezoneStr(this.nowTime)
); )
}; }
}, },
tagType() { tagType () {
return (key) => { return (key) => {
if (sameLabels.find((item) => item === key)) { if (sameLabels.find((item) => item === key)) {
return "normal"; return 'normal'
} else { } else {
return "info"; return 'info'
} }
}; }
}, }
}, },
methods: { methods: {
labelsSort(obj) { labelsSort (obj) {
obj = obj || []; obj = obj || []
const buildIn = sameLabels; const buildIn = sameLabels
if (typeof obj === "string") obj = JSON.parse(obj); if (typeof obj === 'string') obj = JSON.parse(obj)
const labels = JSON.parse(JSON.stringify(obj)); const labels = JSON.parse(JSON.stringify(obj))
const result = []; const result = []
const result2 = []; const result2 = []
for (const key of buildIn) { for (const key of buildIn) {
labels.forEach((item) => { labels.forEach((item) => {
if (item.name === key) { if (item.name === key) {
result.push(item); result.push(item)
} }
}); })
} }
labels.forEach((item) => { labels.forEach((item) => {
if (buildIn.indexOf(item.name) === -1) { if (buildIn.indexOf(item.name) === -1) {
result2.push(item); result2.push(item)
} }
}); })
// console.log([...result, ...result2]) // console.log([...result, ...result2])
return [...result, ...result2]; return [...result, ...result2]
}, }
}, }
}; }
</script> </script>

View File

@@ -0,0 +1,191 @@
<template>
<el-table
id="assetProcessTable"
ref="dataTable"
:data="tableData"
:height="height"
tooltip-effect="light"
border
@header-dragend="dragend"
@sort-change="tableDataSort"
@selection-change="selectionChange"
@row-dblclick="(row)=>{queryMessage(row)}"
>
<el-table-column
:resizable="false"
align="center"
type="selection"
width="55">
</el-table-column>
<el-table-column
v-for="(item, index) in customTableTitle"
v-if="item.show"
:key="`col-${index}`"
:fixed="item.fixed"
:label="item.label"
:min-width="`${item.minWidth}`"
:prop="item.prop"
:resizable="true"
:sort-orders="['ascending', 'descending']"
:sortable="item.sortable"
:width="`${item.width}`"
:show-overflow-tooltip="item.prop === 'description'"
class="data-column"
>
<template slot="header">
<span class="data-column__span">{{item.label}}</span>
<div class="col-resize-area"></div>
</template>
<template slot-scope="scope" :column="item">
<template v-if="item.prop === 'name'">
<div style="height:100%;display: flex;align-items: center;">
<el-popover trigger="hover" placement="right-start" v-if="typeof scope.row.name != 'undefined' && scope.row.name != null">
<div>
<ul>
<li><span class="metirc-tip-list">{{$t('overall.state')}}&nbsp;:&nbsp;&nbsp;</span><span>{{'{ '+ scope.row.state +' }'}}</span></li>
</ul>
</div>
<div slot="reference"><div :class="{'bar active-icon green-bg':scope.row.state.toLowerCase() == 'running','bar active-icon red-bg':scope.row.state.toLowerCase() != 'running'}"></div></div>
</el-popover>
<span>{{scope.row[item.prop]}}</span>
</div>
</template>
<template v-else-if="item.prop === 'startTime'">
{{utcTimeToTimezoneStr(scope.row[item.prop])}}
</template>
<template v-else-if="item.prop === 'cpuUsage'">
<div style="height:100%;">
<progress id="container" max="100" :value= scope.row[item.prop]></progress>
<div style="float:left">{{scope.row[item.prop] + '%'}}</div>
</div>
</template>
<template v-else-if="item.prop === 'memUsage'">
<div style="height:100%;">
<progress id="container" max="100" :value= scope.row[item.prop]></progress>
<div style="float:left">{{scope.row[item.prop] + '%'}}</div>
</div>
</template>
<span v-else-if="scope.row[item.prop]">{{scope.row[item.prop]}}</span>
<template v-else>-</template>
</template>
</el-table-column>
<template slot="empty">
<div v-if="!loading" class="table-no-data">
<svg class="icon" aria-hidden="true">
<use xlink:href="#nz-icon-no-data-list"></use>
</svg>
<div class="table-no-data__title">No results found</div>
</div>
<div v-else>&nbsp;</div>
</template>
</el-table>
</template>
<script>
import table from '@/components/common/mixin/table'
export default {
name: 'assetProcessTable',
mixins: [table],
props: {
loading: Boolean,
filterTime: {}
},
data () {
return {
tableTitle: [
{
label: this.$t('overall.process'),
prop: 'name',
show: true,
minWidth: 250,
sortable: 'custom'
}, {
label: this.$t('asset.process.PID'),
prop: 'processID',
show: true,
minWidth: 100,
sortable: 'custom'
}, {
label: 'PPID',
prop: 'parentProcessID',
show: false,
minWidth: 100,
sortable: 'custom'
}, {
label: this.$t('overall.startTime'),
prop: 'startTime',
show: true,
minWidth: 150,
sortable: 'custom'
}, {
label: '%' + this.$t('asset.process.cpu'),
prop: 'cpuUsage',
show: true,
minWidth: 200,
sortable: 'custom'
}, {
label: '%' + this.$t('asset.process.mem'),
prop: 'memUsage',
show: true,
minWidth: 200,
sortable: 'custom'
}, {
label: this.$t('config.operationlog.username'),
prop: 'user',
show: false,
minWidth: 120,
sortable: 'custom'
}, {
label: this.$t('dashboard.panel.chartForm.group'),
prop: 'group',
show: false,
minWidth: 120,
sortable: 'custom'
}, {
label: this.$t('overall.state'),
prop: 'state',
show: false,
minWidth: 120
}, {
label: this.$t('asset.process.threadCount'),
prop: 'threadCount',
show: false,
minWidth: 150,
sortable: 'custom'
}
]
}
},
computed: {
},
methods: {
}
}
</script>
<style scoped>
.el-popover__reference{
display: flex;
align-items: center;
}
.bar {
width: 3px;
height: 14px;
border-radius: 0;
}
#container {
float:left;
width: 120px;
height: 18px;
margin-right: 15px;
background-color: #e6eaed;
}
/* 进度条被填充部分的背景颜色 */
::-webkit-progress-value {
background-color: #00c398;
}
/deep/ .active-icon {
margin-left: 5px;
}
</style>
<style>
</style>

View File

@@ -106,8 +106,11 @@ import bottomBox from '@/components/common/bottomBox/bottomBox'
import { bottomBoxWindow } from '@/components/common/js/tools' import { bottomBoxWindow } from '@/components/common/js/tools'
import panelChart from '@/components/chart/panelChart' import panelChart from '@/components/chart/panelChart'
import bus from '@/libs/bus' import bus from '@/libs/bus'
import routerPathParams from "@/components/common/mixin/routerPathParams";
import lodash from "lodash";
export default { export default {
name: 'nzDataList', name: 'nzDataList',
mixins: [routerPathParams],
components: { components: {
bottomBox, bottomBox,
panelChart panelChart
@@ -235,6 +238,7 @@ export default {
'bottomBox.showSubList': function (n) { 'bottomBox.showSubList': function (n) {
const vm = this const vm = this
bottomBoxWindow.showSubListWatch(vm, n) bottomBoxWindow.showSubListWatch(vm, n)
this.updatePath(this.$route.query, this.$route.path, 'nzDatalist')
}, },
layout: { layout: {
immediate: true, immediate: true,

View File

@@ -1,5 +1,5 @@
<template> <template>
<div> <div style="height: 100%">
<el-table <el-table
id="roleTable" id="roleTable"
ref="dataTable" ref="dataTable"

View File

@@ -95,7 +95,7 @@
{{ $t("overall.option") }} {{ $t("overall.option") }}
</div> </div>
<div slot-scope="scope" class="table-operation-items"> <div slot-scope="scope" class="table-operation-items">
<button class="table-operation-item" @click="showBottomBox('recordRule', scope.row)" :title="$t('overall.view')"><i class="nz-icon nz-icon-view1"></i></button> <button class="table-operation-item" @click="showBottomBox('issue', scope.row)" :title="$t('overall.view')"><i class="nz-icon nz-icon-view1"></i></button>
<el-dropdown size="medium" v-has="['record_rule_edit','record_rule_delete']" trigger="click" @command="tableOperation"> <el-dropdown size="medium" v-has="['record_rule_edit','record_rule_delete']" trigger="click" @command="tableOperation">
<div class="table-operation-item table-operation-item--more" :title="$t('overall.moreOperations')"> <div class="table-operation-item table-operation-item--more" :title="$t('overall.moreOperations')">
<i class="nz-icon nz-icon-more3"></i> <i class="nz-icon nz-icon-more3"></i>

View File

@@ -1,5 +1,4 @@
<template> <template>
<div>
<el-table <el-table
id="recordRuleTable" id="recordRuleTable"
ref="dataTable" ref="dataTable"
@@ -132,7 +131,6 @@
<div v-else>&nbsp;</div> <div v-else>&nbsp;</div>
</template> </template>
</el-table> </el-table>
</div>
</template> </template>
<script> <script>

View File

@@ -1,5 +1,5 @@
<template> <template>
<div height="100%"> <div style="height: 100%">
<el-table <el-table
id="userTable" id="userTable"
ref="dataTable" ref="dataTable"
@@ -118,7 +118,7 @@
<div v-else>&nbsp;</div> <div v-else>&nbsp;</div>
</template> </template>
</el-table> </el-table>
</div> </div>
</template> </template>
<script> <script>

View File

@@ -199,10 +199,10 @@ export default {
this.username = localStorage.getItem('nz-username') this.username = localStorage.getItem('nz-username')
// this.refreshLang() // this.refreshLang()
}) })
if (window.history && window.history.pushState) { // if (window.history && window.history.pushState) {
history.pushState(null, null, document.URL) // history.pushState(null, null, document.URL)
window.addEventListener('popstate', this.cancel, false) // window.addEventListener('popstate', this.cancel, false)
} // }
bus.$on('link-data-change', () => { bus.$on('link-data-change', () => {
this.getLinkData() this.getLinkData()
}) })

View File

@@ -109,153 +109,159 @@
</template> </template>
<script> <script>
import bus from "@/libs/bus"; import bus from '@/libs/bus'
import alertSilenceBox from "@/components/common/rightBox/alertSilenceBox"; import alertSilenceBox from '@/components/common/rightBox/alertSilenceBox'
import deleteButton from "@/components/common/deleteButton"; import deleteButton from '@/components/common/deleteButton'
import nzDataList from "@/components/common/table/nzDataList"; import nzDataList from '@/components/common/table/nzDataList'
import dataListMixin from "@/components/common/mixin/dataList"; import dataListMixin from '@/components/common/mixin/dataList'
import alertSilenceTable from "@/components/common/table/alert/alertSilenceTable"; import alertSilenceTable from '@/components/common/table/alert/alertSilenceTable'
import routerPathParams from "@/components/common/mixin/routerPathParams"; import routerPathParams from '@/components/common/mixin/routerPathParams'
export default { export default {
name: "alertSilence", name: 'alertSilence',
components: { components: {
alertSilenceTable, alertSilenceTable,
deleteButton, deleteButton,
nzDataList, nzDataList,
alertSilenceBox, alertSilenceBox
}, },
mixins: [dataListMixin, routerPathParams], mixins: [dataListMixin, routerPathParams],
data() { data () {
return { return {
url: "alert/silence", url: 'alert/silence',
tableId: "silenceTable", tableId: 'silenceTable',
/* 搜素相关 */ /* 搜素相关 */
searchMsg: { searchMsg: {
// 给搜索框子组件传递的信息 // 给搜索框子组件传递的信息
zheze_none: true, zheze_none: true,
searchLabelList: [ searchLabelList: [
{ {
name: "ID", name: 'ID',
type: "input", type: 'input',
label: "ids", label: 'ids',
disabled: false, disabled: false
}, },
{ {
name: this.$t("alert.silence.matchers"), name: this.$t('alert.silence.matchers'),
type: "input", type: 'input',
label: "matchers", label: 'matchers',
disabled: false, disabled: false
}, },
], {
name: this.$t('overall.state'),
type: 'select',
label: 'silenceState',
disabled: false
}
]
}, },
// 导出相关 // 导出相关
importBox: { show: false, title: this.$t("overall.exportExcel") }, importBox: { show: false, title: this.$t('overall.exportExcel') },
deleteBox: { show: false, ids: "", remark: "", state: 2 }, deleteBox: { show: false, ids: '', remark: '', state: 2 },
// 创建修改相关 // 创建修改相关
blankObject: { blankObject: {
id: "", id: '',
startAt: "", startAt: '',
endAt: "", endAt: '',
ruleId: "", ruleId: '',
type: "asset", type: 'asset',
linkId: "", linkId: '',
remark: "", remark: '',
time: [], time: [],
matchers: [{ name: "", value: "", regex: 0 }], matchers: [{ name: '', value: '', regex: 0 }],
name: "", name: ''
}, },
nowTime: "", nowTime: ''
}; }
}, },
mounted() { mounted () {
this.initEvent(); this.initEvent()
}, },
methods: { methods: {
queryMessage(alertRule) { queryMessage (alertRule) {
this.$refs.dataList.showBottomBox('alertRuleAlertMessage', alertRule) this.$refs.dataList.showBottomBox('alertRuleAlertMessage', alertRule)
}, },
closeRightBox(refresh) { closeRightBox (refresh) {
this.rightBox.show = false; this.rightBox.show = false
this.copyFlag = false; this.copyFlag = false
this.object = {}; this.object = {}
if (refresh) { if (refresh) {
this.delFlag = true; this.delFlag = true
this.getTableData(); this.getTableData()
} }
}, },
initEvent() { initEvent () {
bus.$on("alert-rule-list-change", () => { bus.$on('alert-rule-list-change', () => {
this.getTableData(); this.getTableData()
}); })
bus.$on("dc-list-change", () => { bus.$on('dc-list-change', () => {
this.getTableData(); this.getTableData()
}); })
bus.$on("alert-message-change", () => { bus.$on('alert-message-change', () => {
this.getTableData(); this.getTableData()
}); })
}, },
exportCur() { exportCur () {
const searchLabel = Object.assign({}, this.searchLabel); const searchLabel = Object.assign({}, this.searchLabel)
this.$set( this.$set(
searchLabel, searchLabel,
"language", 'language',
localStorage.getItem("nz-language") localStorage.getItem('nz-language')
? localStorage.getItem("nz-language") ? localStorage.getItem('nz-language')
: "en" : 'en'
); )
this.exportExcel(searchLabel); this.exportExcel(searchLabel)
this.closeDialog(); this.closeDialog()
}, },
exportAll() { exportAll () {
const temp = JSON.parse(JSON.stringify(this.searchLabel)); const temp = JSON.parse(JSON.stringify(this.searchLabel))
temp.pageSize = -1; temp.pageSize = -1
this.$set( this.$set(
temp, temp,
"language", 'language',
localStorage.getItem("nz-language") localStorage.getItem('nz-language')
? localStorage.getItem("nz-language") ? localStorage.getItem('nz-language')
: "en" : 'en'
); )
this.exportExcel(temp); this.exportExcel(temp)
this.closeDialog(); this.closeDialog()
}, },
closeDialog() { closeDialog () {
this.importBox.show = false; this.importBox.show = false
this.deleteBox.show = false; this.deleteBox.show = false
}, },
getTableData(params) { getTableData (params) {
if (params && Object.keys(params).length > 0) { if (params && Object.keys(params).length > 0) {
for (const key in params) { for (const key in params) {
this.$set(this.searchLabel, key, params[key]); this.$set(this.searchLabel, key, params[key])
} }
} }
if (this.orderBy) { if (this.orderBy) {
this.$set(this.searchLabel, "orderBy", this.orderBy); this.$set(this.searchLabel, 'orderBy', this.orderBy)
} else { } else {
delete this.searchLabel.orderBy; delete this.searchLabel.orderBy
} }
this.$set(this.searchLabel, "pageNo", this.pageObj.pageNo); this.$set(this.searchLabel, 'pageNo', this.pageObj.pageNo)
this.$set(this.searchLabel, "pageSize", this.pageObj.pageSize); this.$set(this.searchLabel, 'pageSize', this.pageObj.pageSize)
this.tools.loading = true; this.tools.loading = true
const alertRuleParam = { const alertRuleParam = {
...this.searchLabel, ...this.searchLabel,
...this.searchCheckBox, ...this.searchCheckBox
}; }
const path = this.fromRoute.alertSilence; const path = this.fromRoute.alertSilence
this.updatePath(alertRuleParam, path); this.updatePath(alertRuleParam, path)
this.$get(this.url, { ...this.searchLabel, ...this.searchCheckBox }).then( this.$get(this.url, { ...this.searchLabel, ...this.searchCheckBox }).then(
(response) => { (response) => {
this.tools.loading = false; this.tools.loading = false
this.nowTime = this.utcTimeToTimezoneStr(response.time); this.nowTime = this.utcTimeToTimezoneStr(response.time)
if (response.code === 200) { if (response.code === 200) {
for (let i = 0; i < response.data.list.length; i++) { for (let i = 0; i < response.data.list.length; i++) {
response.data.list[i].status = response.data.list[i].status + ""; response.data.list[i].status = response.data.list[i].status + ''
// response.data.list[i].startAt = bus.UTCTimeToConfigTimezone(response.data.list[i].startAt) // response.data.list[i].startAt = bus.UTCTimeToConfigTimezone(response.data.list[i].startAt)
// response.data.list[i].endAt = bus.UTCTimeToConfigTimezone(response.data.list[i].endAt) // response.data.list[i].endAt = bus.UTCTimeToConfigTimezone(response.data.list[i].endAt)
} }
this.tableData = response.data.list; this.tableData = response.data.list
this.pageObj.total = response.data.total; this.pageObj.total = response.data.total
if ( if (
!this.scrollbarWrap && !this.scrollbarWrap &&
this.$refs.dataTable && this.$refs.dataTable &&
@@ -263,111 +269,126 @@ export default {
) { ) {
this.$nextTick(() => { this.$nextTick(() => {
this.scrollbarWrap = this.scrollbarWrap =
this.$refs.dataTable.$refs.dataTable.bodyWrapper; this.$refs.dataTable.$refs.dataTable.bodyWrapper
this.toTopBtnHandler(this.scrollbarWrap); this.toTopBtnHandler(this.scrollbarWrap)
}); })
} }
} }
} }
); )
}, },
add() { add () {
this.blankObject.startAt = bus.getOffsetTimezoneData(); this.blankObject.startAt = bus.getOffsetTimezoneData()
this.blankObject.endAt = bus.getOffsetTimezoneData(1); this.blankObject.endAt = bus.getOffsetTimezoneData(1)
this.object = JSON.parse(JSON.stringify(this.blankObject)); this.object = JSON.parse(JSON.stringify(this.blankObject))
this.rightBox.show = true; this.rightBox.show = true
}, },
edit(u, copyFlag) { edit (u, copyFlag) {
this.$get(`${this.url}/${u.id}`).then((response) => { this.$get(`${this.url}/${u.id}`).then((response) => {
if (response.code === 200) { if (response.code === 200) {
this.object = { this.object = {
...response.data, ...response.data,
matchers: JSON.parse(response.data.matchers), matchers: JSON.parse(response.data.matchers),
startAt: bus.UTCTimeToConfigTimezone(response.data.startAt), startAt: bus.UTCTimeToConfigTimezone(response.data.startAt),
endAt: bus.UTCTimeToConfigTimezone(response.data.endAt), endAt: bus.UTCTimeToConfigTimezone(response.data.endAt)
}; }
if (copyFlag) { if (copyFlag) {
this.object.id = ""; this.object.id = ''
this.object.name = this.object.name + "-copy"; this.object.name = this.object.name + '-copy'
if (this.object.name.length > 64) { if (this.object.name.length > 64) {
const length = this.object.name.length - 64; const length = this.object.name.length - 64
this.object.name = this.object.name =
u.name.substring(0, u.name.length - length) + "-copy"; u.name.substring(0, u.name.length - length) + '-copy'
} }
} }
this.rightBox.show = true; this.rightBox.show = true
} }
}); })
}, },
copy(u) { copy (u) {
this.edit(u, true); this.edit(u, true)
}, },
del(row) { del (row) {
this.$confirm(this.$t("tip.confirmExpired"), { this.$confirm(this.$t('tip.confirmExpired'), {
confirmButtonText: this.$t("tip.yes"), confirmButtonText: this.$t('tip.yes'),
cancelButtonText: this.$t("tip.no"), cancelButtonText: this.$t('tip.no'),
type: "warning", type: 'warning'
}).then(() => { }).then(() => {
this.$delete(this.url + "?ids=" + row.id + "&state=" + this.state).then( this.$delete(this.url + '?ids=' + row.id + '&state=' + this.state).then(
(response) => { (response) => {
if (response.code === 200) { if (response.code === 200) {
this.delFlag = true; this.delFlag = true
this.$message({ this.$message({
duration: 2000, duration: 2000,
type: "success", type: 'success',
message: this.$t("tip.deleteSuccess"), message: this.$t('tip.deleteSuccess')
}); })
this.getTableData(); this.getTableData()
} else { } else {
this.$message.error(response.msg); this.$message.error(response.msg)
} }
} }
); )
}); })
}, }
}, },
created() { created () {
const searchKeys = { const searchKeys = {
// key: path 键 // key: path 键
// value: vue set 参数 // value: vue set 参数
pageNo: { target: this.pageObj, propertyName: "pageNo", type: "number" }, pageNo: { target: this.pageObj, propertyName: 'pageNo', type: 'number' },
pageSize: { pageSize: {
target: this.pageObj, target: this.pageObj,
propertyName: "pageSize", propertyName: 'pageSize',
type: "number", type: 'number'
}, },
orderBy: { target: this.$data, propertyName: "orderBy", type: "string" }, orderBy: { target: this.$data, propertyName: 'orderBy', type: 'string' },
ids: { ids: {
target: this.searchLabel, target: this.searchLabel,
isSearchInput: true, isSearchInput: true,
propertyName: "ids", propertyName: 'ids',
type: "string", type: 'string',
defaultJson: { defaultJson: {
disabled: false, disabled: false,
id: "ids", id: 'ids',
label: "ids", label: 'ids',
name: "ID", name: 'ID',
type: "input", type: 'input',
val: "", val: ''
}, },
jsonKey: "val", jsonKey: 'val'
}, },
matchers: { matchers: {
target: this.searchLabel, target: this.searchLabel,
isSearchInput: true, isSearchInput: true,
propertyName: "matchers", propertyName: 'matchers',
type: "string", type: 'string',
defaultJson: { defaultJson: {
disabled: false, disabled: false,
label: "matchers", label: 'matchers',
name: "Matcher", name: 'Matcher',
type: "input", type: 'input',
val: "", val: ''
}, },
jsonKey: "val", jsonKey: 'val'
}, },
}; state: {
this.initQueryFromPath(searchKeys); target: this.searchLabel,
}, isSearchInput: true,
}; propertyName: 'state',
type: 'number',
defaultJson: {
name: 'state',
type: 'select',
label: 'silenceState',
disabled: false,
val: '',
listStr: 'silenceState'
},
jsonKey: 'valnum',
}
}
this.initQueryFromPath(searchKeys)
}
}
</script> </script>

View File

@@ -286,7 +286,7 @@ instance_cpu_time_ns{app="fox", proc="widget", rev="4d3a513", env="prod", job="c
<h1 class="page-header" style="margin-Top:0px" id="log-query-language">LogQL: Log query language<a class="header-anchor" href="https://grafana.com/docs/loki/latest/logql/" rel="noopener noreferrer" target="_blank"><i class="nz-icon nz-icon-link1" style="font-size: 16px;" :title="$t('overall.link')"></i></a></h1> <h1 class="page-header" style="margin-Top:0px" id="log-query-language">LogQL: Log query language<a class="header-anchor" href="https://grafana.com/docs/loki/latest/logql/" rel="noopener noreferrer" target="_blank"><i class="nz-icon nz-icon-link1" style="font-size: 16px;" :title="$t('overall.link')"></i></a></h1>
<div class="title-heard__divider"></div> <div class="title-heard__divider"></div>
<div class="page-header-label"> <div class="page-header-label">
<p>LogQL is Grafana Lokis PromQL-inspired query language. Queries act as if they are a distributed grep to aggregate log sources. LogQL uses labels and operators for filtering.</p> <p style="width:calc(100% - 380px);">LogQL is Grafana Lokis PromQL-inspired query language. Queries act as if they are a distributed grep to aggregate log sources. LogQL uses labels and operators for filtering.</p>
<p>There are two types of LogQL queries:</p> <p>There are two types of LogQL queries:</p>
<ul> <ul>
<li><b style="color: #3C92F1" @click="jumpClick('#log-queries')" class="log-link">Log queries </b>return the contents of log lines.</li> <li><b style="color: #3C92F1" @click="jumpClick('#log-queries')" class="log-link">Log queries </b>return the contents of log lines.</li>
@@ -308,7 +308,7 @@ instance_cpu_time_ns{app="fox", proc="widget", rev="4d3a513", env="prod", job="c
<li>a log stream selector <code>{container="query-frontend",namespace="loki-dev"}</code> which targets the <code>query-frontend</code> container in the <code>loki-dev</code> namespace.</li> <li>a log stream selector <code>{container="query-frontend",namespace="loki-dev"}</code> which targets the <code>query-frontend</code> container in the <code>loki-dev</code> namespace.</li>
<li>a log pipeline <code>|= "metrics.go" | logfmt | duration > 10s and throughput_mb < 500</code> which will filter out log that contains the word <code>metrics.go</code>, then parses each log line to extract more labels and filter with them.</li> <li>a log pipeline <code>|= "metrics.go" | logfmt | duration > 10s and throughput_mb < 500</code> which will filter out log that contains the word <code>metrics.go</code>, then parses each log line to extract more labels and filter with them.</li>
</ul> </ul>
<pre>To avoid escaping special characters you can use the <code>`</code>(backtick) instead of<code> " </code>when quoting strings. For example <code>`\w+`</code> is the same as <code>"\\w+"</code>. This is specially useful when writing a regular expression which contains multiple <br/>backslashes that require escaping.</pre> <pre class="box-overflow">To avoid escaping special characters you can use the <code>`</code>(backtick) instead of<code> " </code>when quoting strings. For example <code>`\w+`</code> is the same as <code>"\\w+"</code>. This is specially useful when writing a regular expression which contains multiple <br/>backslashes that require escaping.</pre>
</div> </div>
<!-- Log stream selector --> <!-- Log stream selector -->
<div class="introduce-view__content"> <div class="introduce-view__content">
@@ -642,7 +642,7 @@ instance_cpu_time_ns{app="fox", proc="widget", rev="4d3a513", env="prod", job="c
<p>The right side can alternatively be a template string (double quoted or backtick), for example dst="<code v-pre>{{.status}} {{.query}}</code>", in which case the <code>dst</code> label value is replaced by the result of the text/template evaluation. This is the same template engine as the <code>| line_format</code> expression, which means labels are available as variables and you can use the same list of functions.</p> <p>The right side can alternatively be a template string (double quoted or backtick), for example dst="<code v-pre>{{.status}} {{.query}}</code>", in which case the <code>dst</code> label value is replaced by the result of the text/template evaluation. This is the same template engine as the <code>| line_format</code> expression, which means labels are available as variables and you can use the same list of functions.</p>
<p>In both cases, if the destination label doesnt exist, then a new one is created.</p> <p>In both cases, if the destination label doesnt exist, then a new one is created.</p>
<p>The renaming form <code>dst=src</code> will drop the <code>src</code> label after remapping it to the <code>dst</code> label. However, the template form will preserve the referenced labels, such that <code v-pre>dst="{{.src}}"</code> results in both <code>dst</code> and <code>src</code> having the same value.</p> <p>The renaming form <code>dst=src</code> will drop the <code>src</code> label after remapping it to the <code>dst</code> label. However, the template form will preserve the referenced labels, such that <code v-pre>dst="{{.src}}"</code> results in both <code>dst</code> and <code>src</code> having the same value.</p>
<pre>A single label name can only appear once per expression. This means <code>| label_format foo=bar,foo="new"</code> is not allowed but you can use two expressions for the desired effect: <code>| label_format foo=bar | label_format foo="new"</code></pre> <pre class="box-overflow">A single label name can only appear once per expression. This means <code>| label_format foo=bar,foo="new"</code> is not allowed but you can use two expressions for the desired effect: <code>| label_format foo=bar | label_format foo="new"</code></pre>
</div> </div>
</div> </div>
<!-- Log queries examples --> <!-- Log queries examples -->

View File

@@ -514,7 +514,8 @@ export default {
projectOption: [], projectOption: [],
filterSilence: '', filterSilence: '',
tempBoxId: {}, tempBoxId: {},
loading: false loading: false,
firstInit: true
} }
}, },
computed: { computed: {
@@ -697,6 +698,9 @@ export default {
} }
}, },
newChange (val) { newChange (val) {
if (this.firstInit && this.isTopo) {
return
}
if (val) { if (val) {
this.oldcCodeLength = val.length this.oldcCodeLength = val.length
this.codeMirrorValue[this.index] = val this.codeMirrorValue[this.index] = val
@@ -1154,7 +1158,7 @@ export default {
immediate: true, immediate: true,
handler (n, o) { handler (n, o) {
this.codeMirrorValue[this.index] = n[this.index] this.codeMirrorValue[this.index] = n[this.index]
if (this.isTopo) { if (this.isTopo && this.firstInit) {
setTimeout(() => { setTimeout(() => {
const text = this.newView.state.doc.toString() const text = this.newView.state.doc.toString()
this.newView.dispatch( this.newView.dispatch(
@@ -1162,6 +1166,7 @@ export default {
changes: { from: 0, to: text.length, insert: this.codeMirrorValue[this.index] } changes: { from: 0, to: text.length, insert: this.codeMirrorValue[this.index] }
}) })
) )
this.firstInit = false
}, 200) }, 200)
} }
} }

View File

@@ -16,12 +16,12 @@ export default {
}, },
async created () { async created () {
const herfSpiltArr = window.location.href.split('/') const herfSpiltArr = window.location.href.split('/')
if (herfSpiltArr[3] !== '#') { // if (herfSpiltArr[3] !== '#') {
herfSpiltArr[3] = '#' // herfSpiltArr[3] = '#'
window.location.href = herfSpiltArr.join('/') // window.location.href = herfSpiltArr.join('/')
} // }
const Timestamp = new Date().getTime() 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 const result = await this.$http.get(url) // 获取本地的config.json 判断是否需要清空localStorage 以及设备的宽 和 axios的baseUrl
this.$axios.defaults.baseURL = result.body.baseUrl this.$axios.defaults.baseURL = result.body.baseUrl
const version = result.body.version const version = result.body.version

View File

@@ -40,7 +40,7 @@ axios.interceptors.request.use(
) )
const accountErrorCode = [518003, 518004, 518005, 518006, 518007, 518008] // 账号锁定等 const accountErrorCode = [518003, 518004, 518005, 518006, 518007, 518008] // 账号锁定等
const licenceErrorCode = [711001] const licenceErrorCode = [711001]
const noJumpPath = ['#/', '#/login'] const noJumpPath = ['/', '/login', '/ui/login']
// 若get请求的url中带问号则将url上的参数截取改为对象形式传参 // 若get请求的url中带问号则将url上的参数截取改为对象形式传参
axios.interceptors.request.use( axios.interceptors.request.use(
@@ -77,15 +77,20 @@ axios.interceptors.request.use(
) )
axios.interceptors.response.use( axios.interceptors.response.use(
response => { 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) sessionStorage.setItem('nz-previous-page', router.currentRoute.fullPath)
window.location.href = '/' window.location.href = '/'
} else if (response.status === 200) { } 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) sessionStorage.setItem('nz-previous-page', router.currentRoute.fullPath)
window.location.href = '/' window.location.href = '/'
} }
} else { } else {
removePending(response.config)
return response return response
} }
// 请求完成在数组中移除 // 请求完成在数组中移除

View File

@@ -19,7 +19,7 @@ router.beforeEach((to, from, next) => {
requestsArr.forEach(xhr => xhr.cancel('cancel')) requestsArr.forEach(xhr => xhr.cancel('cancel'))
} }
store.commit('setNowPath', to.path) 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') { // 拦截登录页面,现货区外观设置 再系统初始化检查 if (to.path === '/login') { // 拦截登录页面,现货区外观设置 再系统初始化检查
Vue.http.get(configUrl).then(config => { Vue.http.get(configUrl).then(config => {
const appearance = new Promise(resolve => { const appearance = new Promise(resolve => {

View File

@@ -2,6 +2,10 @@ import Vue from 'vue'
import Router from 'vue-router' import Router from 'vue-router'
Vue.use(Router) Vue.use(Router)
export default new Router({ export default new Router({
hashbang: false,
history: true,
mode: 'history',
base: '/ui/',
routes: [ routes: [
{ {
path: '/', path: '/',

View File

@@ -5,6 +5,7 @@ import { returnMenuCode, sortByOrderNum } from '@/permission'
import moment from 'moment-timezone' import moment from 'moment-timezone'
import { theme } from '@/components/common/js/constants' import { theme } from '@/components/common/js/constants'
const noJumpPath = ['/', '/login', '/ui/login']
const user = { const user = {
state: { state: {
menuList: [], 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') const route = sessionStorage.getItem('nz-previous-page')
router.push({ router.push({
path: route path: route
@@ -151,6 +152,7 @@ const user = {
sessionStorage.removeItem('nz-previous-page') sessionStorage.removeItem('nz-previous-page')
}) })
} else { } else {
sessionStorage.removeItem('nz-previous-page')
router.push({ router.push({
path: path[0], path: path[0],
query: { query: {

View File

@@ -1 +1 @@
{"baseUrl":"http://192.168.40.42:8080/", "version": "22.05"} {"baseUrl":"http://192.168.40.42/", "version": "22.05"}