Compare commits

..

10 Commits

Author SHA1 Message Date
陈劲松
0d4bc17873 Merge branch 'cherry-pick-2c703306' into 'dev-24.04'
fix: 修复双向链路配置下,链路下钻后id不对的问题

See merge request cyber-narrator/cn-ui!81
2024-06-18 10:16:28 +00:00
chenjinsong
cb391dc416 fix: 修复双向链路配置下,链路下钻后id不对的问题
(cherry picked from commit 2c70330695)
2024-06-18 10:16:22 +00:00
陈劲松
a29b433dc4 Merge branch 'cherry-pick-d82e69b8' into 'dev-24.04'
CN-1669 fix: 去除链路界面多余的npm接口请求。

See merge request cyber-narrator/cn-ui!79
2024-06-18 06:28:31 +00:00
刘洪洪
bf2dc13380 CN-1669 fix: 去除链路界面多余的npm接口请求。
(cherry picked from commit d82e69b8f4)
2024-06-18 06:28:25 +00:00
陈劲松
0a36304907 Merge branch 'cherry-pick-77886f54' into 'dev-24.04'
CN-1669 fix: 1、修复超时登录url编码异常导致的界面报错问题;2、去除链路界面多余的npm接口请求。

See merge request cyber-narrator/cn-ui!77
2024-06-18 02:41:49 +00:00
刘洪洪
9c5d7d3fea CN-1669 fix: 1、修复超时登录url编码异常导致的界面报错问题;2、去除链路界面多余的npm接口请求。
(cherry picked from commit 77886f54c2)
2024-06-18 02:41:43 +00:00
陈劲松
c4131a7b43 Merge branch 'cherry-pick-1a8f9835' into 'dev-24.04'
fix: 修复链路下钻后第一个图漏加filter条件的问题

See merge request cyber-narrator/cn-ui!76
2024-06-17 08:35:02 +00:00
chenjinsong
ce9adab0f6 fix: 修复链路下钻后第一个图漏加filter条件的问题
(cherry picked from commit 1a8f983585)
2024-06-17 08:34:56 +00:00
陈劲松
0e9fa1ec0e Merge branch 'cherry-pick-ee393e33' into 'dev-24.04'
fix: 修复链路第二个block悬浮框主题色错误问题

See merge request cyber-narrator/cn-ui!75
2024-06-17 08:34:35 +00:00
chenjinsong
de069eac3f fix: 修复链路第二个block悬浮框主题色错误问题
(cherry picked from commit ee393e331f)
2024-06-17 08:34:28 +00:00
155 changed files with 6986 additions and 16043 deletions

View File

@@ -1,4 +1,4 @@
FROM 192.168.40.153:9080/common/nginx-cn:1.0.0
FROM nginx:latest
MAINTAINER shizhendong shizhendong@zdjizhi.com

696
package-lock.json generated
View File

@@ -2761,21 +2761,6 @@
"integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==",
"dev": true
},
"color-convert": {
"version": "2.0.1",
"resolved": "https://registry.npmmirror.com/color-convert/-/color-convert-2.0.1.tgz",
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
"dev": true,
"requires": {
"color-name": "~1.1.4"
}
},
"color-name": {
"version": "1.1.4",
"resolved": "https://registry.npmmirror.com/color-name/-/color-name-1.1.4.tgz",
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
"dev": true
},
"emoji-regex": {
"version": "9.2.2",
"resolved": "https://registry.npmmirror.com/emoji-regex/-/emoji-regex-9.2.2.tgz",
@@ -2793,40 +2778,6 @@
"strip-ansi": "^7.0.1"
}
},
"string-width-cjs": {
"version": "npm:string-width@4.2.3",
"resolved": "https://registry.npmmirror.com/string-width/-/string-width-4.2.3.tgz",
"integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==",
"dev": true,
"requires": {
"emoji-regex": "^8.0.0",
"is-fullwidth-code-point": "^3.0.0",
"strip-ansi": "^6.0.1"
},
"dependencies": {
"ansi-regex": {
"version": "5.0.1",
"resolved": "https://registry.npmmirror.com/ansi-regex/-/ansi-regex-5.0.1.tgz",
"integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",
"dev": true
},
"emoji-regex": {
"version": "8.0.0",
"resolved": "https://registry.npmmirror.com/emoji-regex/-/emoji-regex-8.0.0.tgz",
"integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==",
"dev": true
},
"strip-ansi": {
"version": "6.0.1",
"resolved": "https://registry.npmmirror.com/strip-ansi/-/strip-ansi-6.0.1.tgz",
"integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
"dev": true,
"requires": {
"ansi-regex": "^5.0.1"
}
}
}
},
"strip-ansi": {
"version": "7.1.0",
"resolved": "https://registry.npmmirror.com/strip-ansi/-/strip-ansi-7.1.0.tgz",
@@ -2836,23 +2787,6 @@
"ansi-regex": "^6.0.1"
}
},
"strip-ansi-cjs": {
"version": "npm:strip-ansi@6.0.1",
"resolved": "https://registry.npmmirror.com/strip-ansi/-/strip-ansi-6.0.1.tgz",
"integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
"dev": true,
"requires": {
"ansi-regex": "^5.0.1"
},
"dependencies": {
"ansi-regex": {
"version": "5.0.1",
"resolved": "https://registry.npmmirror.com/ansi-regex/-/ansi-regex-5.0.1.tgz",
"integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",
"dev": true
}
}
},
"wrap-ansi": {
"version": "8.1.0",
"resolved": "https://registry.npmmirror.com/wrap-ansi/-/wrap-ansi-8.1.0.tgz",
@@ -2863,60 +2797,6 @@
"string-width": "^5.0.1",
"strip-ansi": "^7.0.1"
}
},
"wrap-ansi-cjs": {
"version": "npm:wrap-ansi@7.0.0",
"resolved": "https://registry.npmmirror.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz",
"integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==",
"dev": true,
"requires": {
"ansi-styles": "^4.0.0",
"string-width": "^4.1.0",
"strip-ansi": "^6.0.0"
},
"dependencies": {
"ansi-regex": {
"version": "5.0.1",
"resolved": "https://registry.npmmirror.com/ansi-regex/-/ansi-regex-5.0.1.tgz",
"integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",
"dev": true
},
"ansi-styles": {
"version": "4.3.0",
"resolved": "https://registry.npmmirror.com/ansi-styles/-/ansi-styles-4.3.0.tgz",
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
"dev": true,
"requires": {
"color-convert": "^2.0.1"
}
},
"emoji-regex": {
"version": "8.0.0",
"resolved": "https://registry.npmmirror.com/emoji-regex/-/emoji-regex-8.0.0.tgz",
"integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==",
"dev": true
},
"string-width": {
"version": "4.2.3",
"resolved": "https://registry.npmmirror.com/string-width/-/string-width-4.2.3.tgz",
"integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==",
"dev": true,
"requires": {
"emoji-regex": "^8.0.0",
"is-fullwidth-code-point": "^3.0.0",
"strip-ansi": "^6.0.1"
}
},
"strip-ansi": {
"version": "6.0.1",
"resolved": "https://registry.npmmirror.com/strip-ansi/-/strip-ansi-6.0.1.tgz",
"integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
"dev": true,
"requires": {
"ansi-regex": "^5.0.1"
}
}
}
}
}
},
@@ -3680,11 +3560,6 @@
"dev": true,
"optional": true
},
"@popperjs/core": {
"version": "npm:@sxzz/popperjs-es@2.11.7",
"resolved": "https://registry.npmmirror.com/@sxzz/popperjs-es/-/popperjs-es-2.11.7.tgz",
"integrity": "sha512-Ccy0NlLkzr0Ex2FKvh2X+OyERHXJ88XJ1MXtsI9y9fGexlaXaVTPzBCRBwIxFkORuOb+uBqeu+RqnpgYTEZRUQ=="
},
"@probe.gl/env": {
"version": "3.6.0",
"resolved": "https://registry.npmmirror.com/@probe.gl/env/-/env-3.6.0.tgz",
@@ -4153,11 +4028,6 @@
"integrity": "sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw==",
"dev": true
},
"@tweenjs/tween.js": {
"version": "23.1.2",
"resolved": "https://registry.npmmirror.com/@tweenjs/tween.js/-/tween.js-23.1.2.tgz",
"integrity": "sha512-kMCNaZCJugWI86xiEHaY338CU5JpD0B97p1j1IKNn/Zto8PgACjQx0UxbHjmOcLl/dDOBnItwD07KmCs75pxtQ=="
},
"@types/aria-query": {
"version": "5.0.4",
"resolved": "https://registry.npmmirror.com/@types/aria-query/-/aria-query-5.0.4.tgz",
@@ -5099,6 +4969,17 @@
"color-convert": "^2.0.1"
}
},
"chalk": {
"version": "4.1.2",
"resolved": "https://registry.npmmirror.com/chalk/-/chalk-4.1.2.tgz",
"integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
"dev": true,
"optional": true,
"requires": {
"ansi-styles": "^4.1.0",
"supports-color": "^7.1.0"
}
},
"cliui": {
"version": "6.0.0",
"resolved": "https://registry.npmmirror.com/cliui/-/cliui-6.0.0.tgz",
@@ -5142,12 +5023,26 @@
"universalify": "^0.1.0"
}
},
"has-flag": {
"version": "4.0.0",
"resolved": "https://registry.npmmirror.com/has-flag/-/has-flag-4.0.0.tgz",
"integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
"dev": true,
"optional": true
},
"is-fullwidth-code-point": {
"version": "3.0.0",
"resolved": "https://registry.npmmirror.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz",
"integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==",
"dev": true
},
"json5": {
"version": "2.2.3",
"resolved": "https://registry.npmmirror.com/json5/-/json5-2.2.3.tgz",
"integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==",
"dev": true,
"optional": true
},
"jsonfile": {
"version": "4.0.0",
"resolved": "https://registry.npmmirror.com/jsonfile/-/jsonfile-4.0.0.tgz",
@@ -5157,6 +5052,18 @@
"graceful-fs": "^4.1.6"
}
},
"loader-utils": {
"version": "2.0.4",
"resolved": "https://registry.npmmirror.com/loader-utils/-/loader-utils-2.0.4.tgz",
"integrity": "sha512-xXqpXoINfFhgua9xiqD8fPFHgkoq1mmmpE92WlDbm9rNRd/EbRb+Gqf908T2DMfuHjjJlksiK2RbHVOdD/MqSw==",
"dev": true,
"optional": true,
"requires": {
"big.js": "^5.2.2",
"emojis-list": "^3.0.0",
"json5": "^2.1.2"
}
},
"minipass": {
"version": "3.3.6",
"resolved": "https://registry.npmmirror.com/minipass/-/minipass-3.3.6.tgz",
@@ -5195,6 +5102,28 @@
"ansi-regex": "^5.0.1"
}
},
"supports-color": {
"version": "7.2.0",
"resolved": "https://registry.npmmirror.com/supports-color/-/supports-color-7.2.0.tgz",
"integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
"dev": true,
"optional": true,
"requires": {
"has-flag": "^4.0.0"
}
},
"vue-loader-v16": {
"version": "npm:vue-loader@16.8.3",
"resolved": "https://registry.npmmirror.com/vue-loader/-/vue-loader-16.8.3.tgz",
"integrity": "sha512-7vKN45IxsKxe5GcVCbc2qFU5aWzyiLrYJyUuMz4BQLKctCj/fmCa0w6fGiiQ2cLFetNcek1ppGJQDCup0c1hpA==",
"dev": true,
"optional": true,
"requires": {
"chalk": "^4.1.0",
"hash-sum": "^2.0.0",
"loader-utils": "^2.0.0"
}
},
"wrap-ansi": {
"version": "6.2.0",
"resolved": "https://registry.npmmirror.com/wrap-ansi/-/wrap-ansi-6.2.0.tgz",
@@ -5780,11 +5709,6 @@
"negotiator": "0.6.3"
}
},
"accessor-fn": {
"version": "1.5.0",
"resolved": "https://registry.npmmirror.com/accessor-fn/-/accessor-fn-1.5.0.tgz",
"integrity": "sha512-dml7D96DY/K5lt4Ra2jMnpL9Bhw5HEGws4p1OAIxFFj9Utd/RxNfEO3T3f0QIWFNwQU7gNxH9snUfqF/zNkP/w=="
},
"acorn": {
"version": "7.4.1",
"resolved": "https://registry.npmmirror.com/acorn/-/acorn-7.4.1.tgz",
@@ -6628,11 +6552,6 @@
"tweetnacl": "^0.14.3"
}
},
"bezier-js": {
"version": "6.1.4",
"resolved": "https://registry.npmmirror.com/bezier-js/-/bezier-js-6.1.4.tgz",
"integrity": "sha512-PA0FW9ZpcHbojUCMu28z9Vg/fNkwTj5YhusSAjHHDfHDGLxJ6YUKrAN2vk1fP2MMOxVw4Oko16FMlRGVBGqLKg=="
},
"bfj": {
"version": "6.1.2",
"resolved": "https://registry.npmmirror.com/bfj/-/bfj-6.1.2.tgz",
@@ -7174,14 +7093,6 @@
"integrity": "sha512-J/jkFgsQ3NEl4w2lCoM9ZPxrD+FoBNJ7uJUpGVjIg/j0OwJosWM36EPDv+Yyi0V4twBk9pPmlFS+PLykgEvUmg==",
"dev": true
},
"canvas-color-tracker": {
"version": "1.2.1",
"resolved": "https://registry.npmmirror.com/canvas-color-tracker/-/canvas-color-tracker-1.2.1.tgz",
"integrity": "sha512-i5clg2pEdaWqHuEM/B74NZNLkHh5+OkXbA/T4iaBiaNDagkOCXkLNrhqUfdUugsRwuaNRU20e/OygzxWRor3yg==",
"requires": {
"tinycolor2": "^1.6.0"
}
},
"capture-exit": {
"version": "2.0.0",
"resolved": "https://registry.npmmirror.com/capture-exit/-/capture-exit-2.0.0.tgz",
@@ -8868,43 +8779,6 @@
"type": "^1.0.1"
}
},
"d3": {
"version": "7.9.0",
"resolved": "https://registry.npmmirror.com/d3/-/d3-7.9.0.tgz",
"integrity": "sha512-e1U46jVP+w7Iut8Jt8ri1YsPOvFpg46k+K8TpCb0P+zjCkjkPnV7WzfDJzMHy1LnA+wj5pLT1wjO901gLXeEhA==",
"requires": {
"d3-array": "3",
"d3-axis": "3",
"d3-brush": "3",
"d3-chord": "3",
"d3-color": "3",
"d3-contour": "4",
"d3-delaunay": "6",
"d3-dispatch": "3",
"d3-drag": "3",
"d3-dsv": "3",
"d3-ease": "3",
"d3-fetch": "3",
"d3-force": "3",
"d3-format": "3",
"d3-geo": "3",
"d3-hierarchy": "3",
"d3-interpolate": "3",
"d3-path": "3",
"d3-polygon": "3",
"d3-quadtree": "3",
"d3-random": "3",
"d3-scale": "4",
"d3-scale-chromatic": "3",
"d3-selection": "3",
"d3-shape": "3",
"d3-time": "3",
"d3-time-format": "4",
"d3-timer": "3",
"d3-transition": "3",
"d3-zoom": "3"
}
},
"d3-array": {
"version": "3.2.4",
"resolved": "https://registry.npmmirror.com/d3-array/-/d3-array-3.2.4.tgz",
@@ -8913,94 +8787,21 @@
"internmap": "1 - 2"
}
},
"d3-axis": {
"version": "3.0.0",
"resolved": "https://registry.npmmirror.com/d3-axis/-/d3-axis-3.0.0.tgz",
"integrity": "sha512-IH5tgjV4jE/GhHkRV0HiVYPDtvfjHQlQfJHs0usq7M30XcSBvOotpmH1IgkcXsO/5gEQZD43B//fc7SRT5S+xw=="
},
"d3-binarytree": {
"version": "1.0.2",
"resolved": "https://registry.npmmirror.com/d3-binarytree/-/d3-binarytree-1.0.2.tgz",
"integrity": "sha512-cElUNH+sHu95L04m92pG73t2MEJXKu+GeKUN1TJkFsu93E5W8E9Sc3kHEGJKgenGvj19m6upSn2EunvMgMD2Yw=="
},
"d3-brush": {
"version": "3.0.0",
"resolved": "https://registry.npmmirror.com/d3-brush/-/d3-brush-3.0.0.tgz",
"integrity": "sha512-ALnjWlVYkXsVIGlOsuWH1+3udkYFI48Ljihfnh8FZPF2QS9o+PzGLBslO0PjzVoHLZ2KCVgAM8NVkXPJB2aNnQ==",
"requires": {
"d3-dispatch": "1 - 3",
"d3-drag": "2 - 3",
"d3-interpolate": "1 - 3",
"d3-selection": "3",
"d3-transition": "3"
}
},
"d3-chord": {
"version": "3.0.1",
"resolved": "https://registry.npmmirror.com/d3-chord/-/d3-chord-3.0.1.tgz",
"integrity": "sha512-VE5S6TNa+j8msksl7HwjxMHDM2yNK3XCkusIlpX5kwauBfXuyLAtNg9jCp/iHH61tgI4sb6R/EIMWCqEIdjT/g==",
"requires": {
"d3-path": "1 - 3"
}
},
"d3-color": {
"version": "3.1.0",
"resolved": "https://registry.npmmirror.com/d3-color/-/d3-color-3.1.0.tgz",
"integrity": "sha512-zg/chbXyeBtMQ1LbD/WSoW2DpC3I0mpmPdW+ynRTj/x2DAWYrIY7qeZIHidozwV24m4iavr15lNwIwLxRmOxhA=="
},
"d3-contour": {
"version": "4.0.2",
"resolved": "https://registry.npmmirror.com/d3-contour/-/d3-contour-4.0.2.tgz",
"integrity": "sha512-4EzFTRIikzs47RGmdxbeUvLWtGedDUNkTcmzoeyg4sP/dvCexO47AaQL7VKy/gul85TOxw+IBgA8US2xwbToNA==",
"requires": {
"d3-array": "^3.2.0"
}
},
"d3-delaunay": {
"version": "6.0.4",
"resolved": "https://registry.npmmirror.com/d3-delaunay/-/d3-delaunay-6.0.4.tgz",
"integrity": "sha512-mdjtIZ1XLAM8bm/hx3WwjfHt6Sggek7qH043O8KEjDXN40xi3vx/6pYSVTwLjEgiXQTbvaouWKynLBiUZ6SK6A==",
"requires": {
"delaunator": "5"
}
},
"d3-dispatch": {
"version": "3.0.1",
"resolved": "https://registry.npmmirror.com/d3-dispatch/-/d3-dispatch-3.0.1.tgz",
"integrity": "sha512-rzUyPU/S7rwUflMyLc1ETDeBj0NRuHKKAcvukozwhshr6g6c5d8zh4c2gQjY2bZ0dXeGLWc1PF174P2tVvKhfg=="
},
"d3-drag": {
"version": "3.0.0",
"resolved": "https://registry.npmmirror.com/d3-drag/-/d3-drag-3.0.0.tgz",
"integrity": "sha512-pWbUJLdETVA8lQNJecMxoXfH6x+mO2UQo8rSmZ+QqxcbyA3hfeprFgIT//HW2nlHChWeIIMwS2Fq+gEARkhTkg==",
"requires": {
"d3-dispatch": "1 - 3",
"d3-selection": "3"
}
},
"d3-dsv": {
"version": "3.0.1",
"resolved": "https://registry.npmmirror.com/d3-dsv/-/d3-dsv-3.0.1.tgz",
"integrity": "sha512-UG6OvdI5afDIFP9w4G0mNq50dSOsXHJaRE8arAS5o9ApWnIElp8GZw1Dun8vP8OyHOZ/QJUKUJwxiiCCnUwm+Q==",
"requires": {
"commander": "7",
"iconv-lite": "0.6",
"rw": "1"
}
},
"d3-ease": {
"version": "3.0.1",
"resolved": "https://registry.npmmirror.com/d3-ease/-/d3-ease-3.0.1.tgz",
"integrity": "sha512-wR/XK3D3XcLIZwpbvQwQ5fK+8Ykds1ip7A2Txe0yxncXSdq1L9skcG7blcedkOX+ZcgxGAmLX1FrRGbADwzi0w=="
},
"d3-fetch": {
"version": "3.0.1",
"resolved": "https://registry.npmmirror.com/d3-fetch/-/d3-fetch-3.0.1.tgz",
"integrity": "sha512-kpkQIM20n3oLVBKGg6oHrUchHM3xODkTzjMoj7aWQFq5QEM+R6E4WkzT5+tojDY7yjez8KgCBRoj4aEr99Fdqw==",
"requires": {
"d3-dsv": "1 - 3"
}
},
"d3-force": {
"version": "3.0.0",
"resolved": "https://registry.npmmirror.com/d3-force/-/d3-force-3.0.0.tgz",
@@ -9011,23 +8812,6 @@
"d3-timer": "1 - 3"
}
},
"d3-force-3d": {
"version": "3.0.5",
"resolved": "https://registry.npmmirror.com/d3-force-3d/-/d3-force-3d-3.0.5.tgz",
"integrity": "sha512-tdwhAhoTYZY/a6eo9nR7HP3xSW/C6XvJTbeRpR92nlPzH6OiE+4MliN9feuSFd0tPtEUo+191qOhCTWx3NYifg==",
"requires": {
"d3-binarytree": "1",
"d3-dispatch": "1 - 3",
"d3-octree": "1",
"d3-quadtree": "1 - 3",
"d3-timer": "1 - 3"
}
},
"d3-format": {
"version": "3.1.0",
"resolved": "https://registry.npmmirror.com/d3-format/-/d3-format-3.1.0.tgz",
"integrity": "sha512-YyUI6AEuY/Wpt8KWLgZHsIU86atmikuoOmCfommt0LYHiQSPjvX2AcFc38PX0CBpr2RCyZhjex+NS/LPOv6YqA=="
},
"d3-geo": {
"version": "3.1.0",
"resolved": "https://registry.npmmirror.com/d3-geo/-/d3-geo-3.1.0.tgz",
@@ -9046,11 +8830,6 @@
"d3-geo": "1.12.0 - 3"
}
},
"d3-hierarchy": {
"version": "3.1.2",
"resolved": "https://registry.npmmirror.com/d3-hierarchy/-/d3-hierarchy-3.1.2.tgz",
"integrity": "sha512-FX/9frcub54beBdugHjDCdikxThEqjnR93Qt7PvQTOHxyiNCAlvMrHhclk3cD5VeAaq9fxmfRp+CnWw9rEMBuA=="
},
"d3-interpolate": {
"version": "3.0.1",
"resolved": "https://registry.npmmirror.com/d3-interpolate/-/d3-interpolate-3.0.1.tgz",
@@ -9059,81 +8838,16 @@
"d3-color": "1 - 3"
}
},
"d3-octree": {
"version": "1.0.2",
"resolved": "https://registry.npmmirror.com/d3-octree/-/d3-octree-1.0.2.tgz",
"integrity": "sha512-Qxg4oirJrNXauiuC94uKMbgxwnhdda9xRLl9ihq45srlJ4Ga3CSgqGcAL8iW7N5CIv4Oz8x3E734ulxyvHPvwA=="
},
"d3-path": {
"version": "3.1.0",
"resolved": "https://registry.npmmirror.com/d3-path/-/d3-path-3.1.0.tgz",
"integrity": "sha512-p3KP5HCf/bvjBSSKuXid6Zqijx7wIfNW+J/maPs+iwR35at5JCbLUT0LzF1cnjbCHWhqzQTIN2Jpe8pRebIEFQ=="
},
"d3-polygon": {
"version": "3.0.1",
"resolved": "https://registry.npmmirror.com/d3-polygon/-/d3-polygon-3.0.1.tgz",
"integrity": "sha512-3vbA7vXYwfe1SYhED++fPUQlWSYTTGmFmQiany/gdbiWgU/iEyQzyymwL9SkJjFFuCS4902BSzewVGsHHmHtXg=="
},
"d3-quadtree": {
"version": "3.0.1",
"resolved": "https://registry.npmmirror.com/d3-quadtree/-/d3-quadtree-3.0.1.tgz",
"integrity": "sha512-04xDrxQTDTCFwP5H6hRhsRcb9xxv2RzkcsygFzmkSIOJy3PeRJP7sNk3VRIbKXcog561P9oU0/rVH6vDROAgUw=="
},
"d3-random": {
"version": "3.0.1",
"resolved": "https://registry.npmmirror.com/d3-random/-/d3-random-3.0.1.tgz",
"integrity": "sha512-FXMe9GfxTxqd5D6jFsQ+DJ8BJS4E/fT5mqqdjovykEB2oFbTMDVdg1MGFxfQW+FBOGoB++k8swBrgwSHT1cUXQ=="
},
"d3-scale": {
"version": "4.0.2",
"resolved": "https://registry.npmmirror.com/d3-scale/-/d3-scale-4.0.2.tgz",
"integrity": "sha512-GZW464g1SH7ag3Y7hXjf8RoUuAFIqklOAq3MRl4OaWabTFJY9PN/E1YklhXLh+OQ3fM9yS2nOkCoS+WLZ6kvxQ==",
"requires": {
"d3-array": "2.10.0 - 3",
"d3-format": "1 - 3",
"d3-interpolate": "1.2.0 - 3",
"d3-time": "2.1.1 - 3",
"d3-time-format": "2 - 4"
}
},
"d3-scale-chromatic": {
"version": "3.1.0",
"resolved": "https://registry.npmmirror.com/d3-scale-chromatic/-/d3-scale-chromatic-3.1.0.tgz",
"integrity": "sha512-A3s5PWiZ9YCXFye1o246KoscMWqf8BsD9eRiJ3He7C9OBaxKhAd5TFCdEx/7VbKtxxTsu//1mMJFrEt572cEyQ==",
"requires": {
"d3-color": "1 - 3",
"d3-interpolate": "1 - 3"
}
},
"d3-selection": {
"version": "3.0.0",
"resolved": "https://registry.npmmirror.com/d3-selection/-/d3-selection-3.0.0.tgz",
"integrity": "sha512-fmTRWbNMmsmWq6xJV8D19U/gw/bwrHfNXxrIN+HfZgnzqTHp9jOmKMhsTUjXOJnZOdZY9Q28y4yebKzqDKlxlQ=="
},
"d3-shape": {
"version": "3.2.0",
"resolved": "https://registry.npmmirror.com/d3-shape/-/d3-shape-3.2.0.tgz",
"integrity": "sha512-SaLBuwGm3MOViRq2ABk3eLoxwZELpH6zhl3FbAoJ7Vm1gofKx6El1Ib5z23NUEhF9AsGl7y+dzLe5Cw2AArGTA==",
"requires": {
"d3-path": "^3.1.0"
}
},
"d3-time": {
"version": "3.1.0",
"resolved": "https://registry.npmmirror.com/d3-time/-/d3-time-3.1.0.tgz",
"integrity": "sha512-VqKjzBLejbSMT4IgbmVgDjpkYrNWUYJnbCGo874u7MMKIWsILRX+OpX/gTk8MqjpT1A/c6HY2dCA77ZN0lkQ2Q==",
"requires": {
"d3-array": "2 - 3"
}
},
"d3-time-format": {
"version": "4.1.0",
"resolved": "https://registry.npmmirror.com/d3-time-format/-/d3-time-format-4.1.0.tgz",
"integrity": "sha512-dJxPBlzC7NugB2PDLwo9Q8JiTR3M3e4/XANkreKSUxF8vvXKqm1Yfq4Q5dl8budlunRVlUUaDUgFt7eA8D6NLg==",
"requires": {
"d3-time": "1 - 3"
}
},
"d3-timer": {
"version": "3.0.1",
"resolved": "https://registry.npmmirror.com/d3-timer/-/d3-timer-3.0.1.tgz",
@@ -9151,18 +8865,6 @@
"d3-timer": "1 - 3"
}
},
"d3-zoom": {
"version": "3.0.0",
"resolved": "https://registry.npmmirror.com/d3-zoom/-/d3-zoom-3.0.0.tgz",
"integrity": "sha512-b8AmV3kfQaqWAuacbPuNbL6vahnOJflOhexLzMMNLga62+/nh0JzvJ0aO/5a5MVgUFGS7Hu1P9P03o3fJkDCyw==",
"requires": {
"d3-dispatch": "1 - 3",
"d3-drag": "2 - 3",
"d3-interpolate": "1 - 3",
"d3-selection": "2 - 3",
"d3-transition": "2 - 3"
}
},
"dagre": {
"version": "0.8.5",
"resolved": "https://registry.npmmirror.com/dagre/-/dagre-0.8.5.tgz",
@@ -9462,14 +9164,6 @@
}
}
},
"delaunator": {
"version": "5.0.1",
"resolved": "https://registry.npmmirror.com/delaunator/-/delaunator-5.0.1.tgz",
"integrity": "sha512-8nvh+XBe96aCESrGOqMp/84b13H9cdKbG5P2ejQCh4d4sK9RL4371qou9drQjMhvnPmhWl5hnmqbEE0fXr9Xnw==",
"requires": {
"robust-predicates": "^3.0.2"
}
},
"delayed-stream": {
"version": "1.0.0",
"resolved": "https://registry.npmmirror.com/delayed-stream/-/delayed-stream-1.0.0.tgz",
@@ -9895,6 +9589,13 @@
"lodash-unified": "^1.0.2",
"memoize-one": "^6.0.0",
"normalize-wheel-es": "^1.2.0"
},
"dependencies": {
"@popperjs/core": {
"version": "npm:@sxzz/popperjs-es@2.11.7",
"resolved": "https://registry.npmmirror.com/@sxzz/popperjs-es/-/popperjs-es-2.11.7.tgz",
"integrity": "sha512-Ccy0NlLkzr0Ex2FKvh2X+OyERHXJ88XJ1MXtsI9y9fGexlaXaVTPzBCRBwIxFkORuOb+uBqeu+RqnpgYTEZRUQ=="
}
}
},
"element-resize-detector": {
@@ -11386,27 +11087,6 @@
"integrity": "sha512-7EwmXrOjyL+ChxMhmG5lnW9MPt1aIeZEwKhQzoBUdTV0N3zuwWDZYVJatDvZ2OyzPUvdIAZDsCetk3coyMfcnQ==",
"dev": true
},
"force-graph": {
"version": "1.43.5",
"resolved": "https://registry.npmmirror.com/force-graph/-/force-graph-1.43.5.tgz",
"integrity": "sha512-HveLELh9yhZXO/QOfaFS38vlwJZ/3sKu+jarfXzRmbmihSOH/BbRWnUvmg8wLFiYy6h4HlH4lkRfZRccHYmXgA==",
"requires": {
"@tweenjs/tween.js": "18 - 23",
"accessor-fn": "1",
"bezier-js": "3 - 6",
"canvas-color-tracker": "1",
"d3-array": "1 - 3",
"d3-drag": "2 - 3",
"d3-force-3d": "2 - 3",
"d3-scale": "1 - 4",
"d3-scale-chromatic": "1 - 3",
"d3-selection": "2 - 3",
"d3-zoom": "2 - 3",
"index-array-by": "1",
"kapsule": "^1.14",
"lodash-es": "4"
}
},
"foreground-child": {
"version": "3.1.1",
"resolved": "https://registry.npmmirror.com/foreground-child/-/foreground-child-3.1.1.tgz",
@@ -12698,11 +12378,6 @@
"integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==",
"dev": true
},
"index-array-by": {
"version": "1.4.1",
"resolved": "https://registry.npmmirror.com/index-array-by/-/index-array-by-1.4.1.tgz",
"integrity": "sha512-Zu6THdrxQdyTuT2uA5FjUoBEsFHPzHcPIj18FszN6yXKHxSfGcR4TPLabfuT//E25q1Igyx9xta2WMvD/x9P/g=="
},
"indexes-of": {
"version": "1.0.1",
"resolved": "https://registry.npmmirror.com/indexes-of/-/indexes-of-1.0.1.tgz",
@@ -13104,12 +12779,6 @@
"resolved": "https://registry.npmmirror.com/is-extglob/-/is-extglob-2.1.1.tgz",
"integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ=="
},
"is-fullwidth-code-point": {
"version": "3.0.0",
"resolved": "https://registry.npmmirror.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz",
"integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==",
"dev": true
},
"is-generator-fn": {
"version": "2.1.0",
"resolved": "https://registry.npmmirror.com/is-generator-fn/-/is-generator-fn-2.1.0.tgz",
@@ -15483,14 +15152,6 @@
"verror": "1.10.0"
}
},
"kapsule": {
"version": "1.14.5",
"resolved": "https://registry.npmmirror.com/kapsule/-/kapsule-1.14.5.tgz",
"integrity": "sha512-H0iSpTynUzZw3tgraDmReprpFRmH5oP5GPmaNsurSwLx2H5iCpOMIkp5q+sfhB4Tz/UJd1E1IbEE9Z6ksnJ6RA==",
"requires": {
"lodash-es": "4"
}
},
"kdbush": {
"version": "4.0.2",
"resolved": "https://registry.npmmirror.com/kdbush/-/kdbush-4.0.2.tgz",
@@ -19369,11 +19030,6 @@
"inherits": "^2.0.1"
}
},
"robust-predicates": {
"version": "3.0.2",
"resolved": "https://registry.npmmirror.com/robust-predicates/-/robust-predicates-3.0.2.tgz",
"integrity": "sha512-IXgzBWvWQwE6PrDI05OvmXUIruQTcoMDzRsOd5CDvHCVLcLHMTSYvOK5Cm46kWqlV3yAbuSpBZdJ5oP5OUoStg=="
},
"rsvp": {
"version": "4.8.5",
"resolved": "https://registry.npmmirror.com/rsvp/-/rsvp-4.8.5.tgz",
@@ -20503,6 +20159,46 @@
}
}
},
"string-width-cjs": {
"version": "npm:string-width@4.2.3",
"resolved": "https://registry.npmmirror.com/string-width/-/string-width-4.2.3.tgz",
"integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==",
"dev": true,
"requires": {
"emoji-regex": "^8.0.0",
"is-fullwidth-code-point": "^3.0.0",
"strip-ansi": "^6.0.1"
},
"dependencies": {
"ansi-regex": {
"version": "5.0.1",
"resolved": "https://registry.npmmirror.com/ansi-regex/-/ansi-regex-5.0.1.tgz",
"integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",
"dev": true
},
"emoji-regex": {
"version": "8.0.0",
"resolved": "https://registry.npmmirror.com/emoji-regex/-/emoji-regex-8.0.0.tgz",
"integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==",
"dev": true
},
"is-fullwidth-code-point": {
"version": "3.0.0",
"resolved": "https://registry.npmmirror.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz",
"integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==",
"dev": true
},
"strip-ansi": {
"version": "6.0.1",
"resolved": "https://registry.npmmirror.com/strip-ansi/-/strip-ansi-6.0.1.tgz",
"integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
"dev": true,
"requires": {
"ansi-regex": "^5.0.1"
}
}
}
},
"string.prototype.trim": {
"version": "1.2.8",
"resolved": "https://registry.npmmirror.com/string.prototype.trim/-/string.prototype.trim-1.2.8.tgz",
@@ -20552,6 +20248,23 @@
"ansi-regex": "^2.0.0"
}
},
"strip-ansi-cjs": {
"version": "npm:strip-ansi@6.0.1",
"resolved": "https://registry.npmmirror.com/strip-ansi/-/strip-ansi-6.0.1.tgz",
"integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
"dev": true,
"requires": {
"ansi-regex": "^5.0.1"
},
"dependencies": {
"ansi-regex": {
"version": "5.0.1",
"resolved": "https://registry.npmmirror.com/ansi-regex/-/ansi-regex-5.0.1.tgz",
"integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",
"dev": true
}
}
},
"strip-eof": {
"version": "1.0.0",
"resolved": "https://registry.npmmirror.com/strip-eof/-/strip-eof-1.0.0.tgz",
@@ -22402,94 +22115,6 @@
}
}
},
"vue-loader-v16": {
"version": "npm:vue-loader@16.8.3",
"resolved": "https://registry.npmmirror.com/vue-loader/-/vue-loader-16.8.3.tgz",
"integrity": "sha512-7vKN45IxsKxe5GcVCbc2qFU5aWzyiLrYJyUuMz4BQLKctCj/fmCa0w6fGiiQ2cLFetNcek1ppGJQDCup0c1hpA==",
"dev": true,
"optional": true,
"requires": {
"chalk": "^4.1.0",
"hash-sum": "^2.0.0",
"loader-utils": "^2.0.0"
},
"dependencies": {
"ansi-styles": {
"version": "4.3.0",
"resolved": "https://registry.npmmirror.com/ansi-styles/-/ansi-styles-4.3.0.tgz",
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
"dev": true,
"optional": true,
"requires": {
"color-convert": "^2.0.1"
}
},
"chalk": {
"version": "4.1.2",
"resolved": "https://registry.npmmirror.com/chalk/-/chalk-4.1.2.tgz",
"integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
"dev": true,
"optional": true,
"requires": {
"ansi-styles": "^4.1.0",
"supports-color": "^7.1.0"
}
},
"color-convert": {
"version": "2.0.1",
"resolved": "https://registry.npmmirror.com/color-convert/-/color-convert-2.0.1.tgz",
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
"dev": true,
"optional": true,
"requires": {
"color-name": "~1.1.4"
}
},
"color-name": {
"version": "1.1.4",
"resolved": "https://registry.npmmirror.com/color-name/-/color-name-1.1.4.tgz",
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
"dev": true,
"optional": true
},
"has-flag": {
"version": "4.0.0",
"resolved": "https://registry.npmmirror.com/has-flag/-/has-flag-4.0.0.tgz",
"integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
"dev": true,
"optional": true
},
"json5": {
"version": "2.2.3",
"resolved": "https://registry.npmmirror.com/json5/-/json5-2.2.3.tgz",
"integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==",
"dev": true,
"optional": true
},
"loader-utils": {
"version": "2.0.4",
"resolved": "https://registry.npmmirror.com/loader-utils/-/loader-utils-2.0.4.tgz",
"integrity": "sha512-xXqpXoINfFhgua9xiqD8fPFHgkoq1mmmpE92WlDbm9rNRd/EbRb+Gqf908T2DMfuHjjJlksiK2RbHVOdD/MqSw==",
"dev": true,
"optional": true,
"requires": {
"big.js": "^5.2.2",
"emojis-list": "^3.0.0",
"json5": "^2.1.2"
}
},
"supports-color": {
"version": "7.2.0",
"resolved": "https://registry.npmmirror.com/supports-color/-/supports-color-7.2.0.tgz",
"integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
"dev": true,
"optional": true,
"requires": {
"has-flag": "^4.0.0"
}
}
}
},
"vue-router": {
"version": "4.2.5",
"resolved": "https://registry.npmmirror.com/vue-router/-/vue-router-4.2.5.tgz",
@@ -23387,6 +23012,81 @@
}
}
},
"wrap-ansi-cjs": {
"version": "npm:wrap-ansi@7.0.0",
"resolved": "https://registry.npmmirror.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz",
"integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==",
"dev": true,
"requires": {
"ansi-styles": "^4.0.0",
"string-width": "^4.1.0",
"strip-ansi": "^6.0.0"
},
"dependencies": {
"ansi-regex": {
"version": "5.0.1",
"resolved": "https://registry.npmmirror.com/ansi-regex/-/ansi-regex-5.0.1.tgz",
"integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",
"dev": true
},
"ansi-styles": {
"version": "4.3.0",
"resolved": "https://registry.npmmirror.com/ansi-styles/-/ansi-styles-4.3.0.tgz",
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
"dev": true,
"requires": {
"color-convert": "^2.0.1"
}
},
"color-convert": {
"version": "2.0.1",
"resolved": "https://registry.npmmirror.com/color-convert/-/color-convert-2.0.1.tgz",
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
"dev": true,
"requires": {
"color-name": "~1.1.4"
}
},
"color-name": {
"version": "1.1.4",
"resolved": "https://registry.npmmirror.com/color-name/-/color-name-1.1.4.tgz",
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
"dev": true
},
"emoji-regex": {
"version": "8.0.0",
"resolved": "https://registry.npmmirror.com/emoji-regex/-/emoji-regex-8.0.0.tgz",
"integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==",
"dev": true
},
"is-fullwidth-code-point": {
"version": "3.0.0",
"resolved": "https://registry.npmmirror.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz",
"integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==",
"dev": true
},
"string-width": {
"version": "4.2.3",
"resolved": "https://registry.npmmirror.com/string-width/-/string-width-4.2.3.tgz",
"integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==",
"dev": true,
"requires": {
"emoji-regex": "^8.0.0",
"is-fullwidth-code-point": "^3.0.0",
"strip-ansi": "^6.0.1"
}
},
"strip-ansi": {
"version": "6.0.1",
"resolved": "https://registry.npmmirror.com/strip-ansi/-/strip-ansi-6.0.1.tgz",
"integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
"dev": true,
"requires": {
"ansi-regex": "^5.0.1"
}
}
}
},
"wrappy": {
"version": "1.0.2",
"resolved": "https://registry.npmmirror.com/wrappy/-/wrappy-1.0.2.tgz",

View File

@@ -1,6 +1,6 @@
{
"name": "cn",
"version": "24.8.0",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
@@ -14,17 +14,14 @@
"@amcharts/amcharts4-geodata": "^4.1.20",
"@antv/g6": "^4.8.17",
"@element-plus/icons-vue": "^2.3.1",
"@turf/turf": "^7.1.0",
"axios": "^0.21.1",
"babel-plugin-lodash": "~3.3.0",
"codemirror": "^5.65.1",
"core-js": "~3.31.0",
"d3": "^7.9.0",
"dayjs": "^1.10.5",
"dexie": "~3.2.0",
"echarts": "^5.5.1",
"element-plus": "^2.8.5",
"force-graph": "^1.43.5",
"echarts": "^5.1.1",
"element-plus": "^2.5.1",
"h3-js": "~3.7.2",
"lib-flexible": "^0.3.2",
"lodash": "^4.17.21",
@@ -33,6 +30,7 @@
"moment-timezone": "^0.5.33",
"postcss-plugin-px2rem": "~0.8.1",
"postcss-px2rem-exclude": "0.0.6",
"sass": "^1.72.0",
"sass-loader": "~8.0.2",
"tiny-emitter": "^2.1.0",
"vue": "~3.3.0",
@@ -83,7 +81,6 @@
"eslint-plugin-promise": "^4.3.1",
"eslint-plugin-vue": "^7.7.0",
"jest": "~26.6.0",
"sass": "^1.80.3",
"ts-jest": "~26.5.0",
"uglifyjs-webpack-plugin": "^2.2.0",
"unplugin-auto-import": "^0.17.5",

View File

@@ -4,4 +4,3 @@ IP,192.168.1.1-192.168.1.2
IP,103.3.138.0
Domain,$www.baidu.com
Domain,*.email.baidu.com
Subscriber,41582263
1 entityType entityValue
4 IP 103.3.138.0
5 Domain $www.baidu.com
6 Domain *.email.baidu.com
Subscriber 41582263

View File

@@ -1,8 +1,7 @@
const BASE_CONFIG = {
baseUrl: 'http://192.168.44.54:8090/',
version: '24.04',
apiVersion: 'v1',
apiVersion2: 'v2'
apiVersion: 'v1'
}
// 默认时间过滤条件,单位分钟. 0表示请求接口时不传时间参数
const DEFAULT_TIME_FILTER_RANGE = {

View File

@@ -1 +0,0 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1687771200531" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7765" width="36" height="36" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M723.84487531 71.54166698c60.46291698 0 110.11458302 49.45145802 110.11458302 110.11458302v12.21270802h10.05045802c27.58870802 0 49.77179198 22.30320802 49.77179198 49.73175v256.78720896c0 27.42854198-22.34325 49.73175-49.77179198 49.73175h-10.05045802v292.22408302c0 60.50295802-49.4915 110.11458302-110.11458302 110.11458302H310.89516635a110.394875 110.394875 0 0 1-110.11458302-110.11458302v-292.22408302h-10.0905A49.81183302 49.81183302 0 0 1 140.95833333 500.38791698V243.60070802c0-27.42854198 22.30320802-49.73175 49.73175-49.73175h10.0905V181.65625C200.78058333 121.15329198 250.23204135 71.54166698 310.89516635 71.54166698z m54.97720802 688.31625H255.75779135v82.48583302a55.2575 55.2575 0 0 0 55.137375 55.137375h412.94970896a55.2575 55.2575 0 0 0 55.09733302-55.137375l-0.120125-82.48583302z m-261.47208302 27.508625c22.02291698 0 41.24291698 19.22 41.24291604 41.28295802 0 22.02291698-19.22 41.24291698-41.24291604 41.24291698-21.90279198 0-41.24291698-19.22-41.24291698-41.24291698s19.22-41.24291698 41.24291698-41.24291698z m261.59220802-237.246875H255.87791635v154.56083302h523.06429198v-154.56083302z m61.06354198-302.47475H194.73429135v248.65875h645.27145896v-248.65875z m-518.53958396 23.78475c12.41291698 0 23.5445 7.52783302 28.10925 18.97975l60.903375 150.55666604a24.865875 24.865875 0 0 1-23.10404104 34.27566698 25.106125 25.106125 0 0 1-23.26420896-15.8565l-6.56683302-16.697375H284.78800031l-6.32658396 16.53720802a25.14616698 25.14616698 0 1 1-46.76866604-18.41916604l61.70420802-150.55666698a30.43166698 30.43166698 0 0 1 28.10925-18.81958302z m217.82666698 0c40.722375 0 71.63454198 31.47275 71.63454198 69.6725 0 38.15970802-31.19245802 69.071875-74.4775 69.071875h-20.70154198v40.32195802a24.66566698 24.66566698 0 0 1-24.74575 24.74575 24.82583302 24.82583302 0 0 1-24.74575-24.74575V296.17541698a24.66566698 24.66566698 0 0 1 24.74575-24.74575z m190.878625 0c40.722375 0 71.67458302 31.47275 71.67458302 69.6725 0 38.15970802-31.2325 69.071875-74.4775 69.071875h-20.74158302v40.32195802a24.66566698 24.66566698 0 0 1-24.74575 24.74575 24.66566698 24.66566698 0 0 1-24.70570802-24.74575V296.17541698a24.66566698 24.66566698 0 0 1 24.70570802-24.74575zM321.10579135 348.30966698l-20.181 52.05416604H341.16666635l-20.02083302-52.05416604z m215.46420896-27.3885h-20.70154198v47.16908302h18.17891698c18.65941698 0 27.3885-11.57204198 27.3885-25.14616698 0-11.01145802-6.68695802-22.02291698-24.82583396-22.02291604z m190.7585 0h-20.70154198v47.16908302h18.138875c18.69945802 0 27.42854198-11.57204198 27.42854198-25.14616698 0-11.01145802-6.727-22.02291698-24.82583396-22.02291604z m-3.3635-194.40229198H311.01529135A55.2575 55.2575 0 0 0 255.87791635 181.65625v12.21270802h523.22445896V181.65625a55.2575 55.2575 0 0 0-55.137375-55.137375z" p-id="7766" fill="#E5A219"></path></svg>

Before

Width:  |  Height:  |  Size: 3.1 KiB

View File

@@ -1 +0,0 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1688290120782" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7911" xmlns:xlink="http://www.w3.org/1999/xlink" width="36" height="36"><path d="M723.84487531 71.54166698c60.46291698 0 110.11458302 49.45145802 110.11458302 110.11458302v12.21270802h10.05045802c27.58870802 0 49.77179198 22.30320802 49.77179198 49.73175v256.78720896c0 27.42854198-22.34325 49.73175-49.77179198 49.73175h-10.05045802v292.22408302c0 60.50295802-49.4915 110.11458302-110.11458302 110.11458302H310.89516635a110.394875 110.394875 0 0 1-110.11458302-110.11458302v-292.22408302h-10.0905A49.81183302 49.81183302 0 0 1 140.95833333 500.38791698V243.60070802c0-27.42854198 22.30320802-49.73175 49.73175-49.73175h10.0905V181.65625C200.78058333 121.15329198 250.23204135 71.54166698 310.89516635 71.54166698z m54.97720802 688.31625H255.75779135v82.48583302a55.2575 55.2575 0 0 0 55.137375 55.137375h412.94970896a55.2575 55.2575 0 0 0 55.09733302-55.137375l-0.120125-82.48583302z m-261.47208302 27.508625c22.02291698 0 41.24291698 19.22 41.24291604 41.28295802 0 22.02291698-19.22 41.24291698-41.24291604 41.24291698-21.90279198 0-41.24291698-19.22-41.24291698-41.24291698s19.22-41.24291698 41.24291698-41.24291698z m261.59220802-237.246875H255.87791635v154.56083302h523.06429198v-154.56083302z m61.06354198-302.47475H194.73429135v248.65875h645.27145896v-248.65875z m-518.53958396 23.78475c12.41291698 0 23.5445 7.52783302 28.10925 18.97975l60.903375 150.55666604a24.865875 24.865875 0 0 1-23.10404104 34.27566698 25.106125 25.106125 0 0 1-23.26420896-15.8565l-6.56683302-16.697375H284.78800031l-6.32658396 16.53720802a25.14616698 25.14616698 0 1 1-46.76866604-18.41916604l61.70420802-150.55666698a30.43166698 30.43166698 0 0 1 28.10925-18.81958302z m217.82666698 0c40.722375 0 71.63454198 31.47275 71.63454198 69.6725 0 38.15970802-31.19245802 69.071875-74.4775 69.071875h-20.70154198v40.32195802a24.66566698 24.66566698 0 0 1-24.74575 24.74575 24.82583302 24.82583302 0 0 1-24.74575-24.74575V296.17541698a24.66566698 24.66566698 0 0 1 24.74575-24.74575z m190.878625 0c40.722375 0 71.67458302 31.47275 71.67458302 69.6725 0 38.15970802-31.2325 69.071875-74.4775 69.071875h-20.74158302v40.32195802a24.66566698 24.66566698 0 0 1-24.74575 24.74575 24.66566698 24.66566698 0 0 1-24.70570802-24.74575V296.17541698a24.66566698 24.66566698 0 0 1 24.70570802-24.74575zM321.10579135 348.30966698l-20.181 52.05416604H341.16666635l-20.02083302-52.05416604z m215.46420896-27.3885h-20.70154198v47.16908302h18.17891698c18.65941698 0 27.3885-11.57204198 27.3885-25.14616698 0-11.01145802-6.68695802-22.02291698-24.82583396-22.02291604z m190.7585 0h-20.70154198v47.16908302h18.138875c18.69945802 0 27.42854198-11.57204198 27.42854198-25.14616698 0-11.01145802-6.727-22.02291698-24.82583396-22.02291604z m-3.3635-194.40229198H311.01529135A55.2575 55.2575 0 0 0 255.87791635 181.65625v12.21270802h523.22445896V181.65625a55.2575 55.2575 0 0 0-55.137375-55.137375z" p-id="7912" fill="#778391"></path></svg>

Before

Width:  |  Height:  |  Size: 3.1 KiB

View File

@@ -1 +0,0 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1688298522321" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7364" xmlns:xlink="http://www.w3.org/1999/xlink" width="36" height="36"><path d="M512 61.06201172a450.93798828 450.93798828 0 1 1 0 901.87597656 450.93798828 450.93798828 0 0 1 0-901.87597656z m0 45.09379883a405.84418945 405.84418945 0 1 0 0 811.6883789 405.84418945 405.84418945 0 0 0 0-811.6883789z" p-id="7365" fill="#38ACD2"></path><path d="M229.64344446 586.23133044l15.95626722-52.586307c4.64812962-15.19314186 8.18625866-30.6637832 10.54501134-46.41192491h0.69375048c3.1912538 18.3150199 6.17438209 31.77378466 10.12876124 46.48129978l15.05439124 52.51693213h46.82817591l49.11755284-149.36453686h-48.77067761l-13.73626514 59.24631408c-3.60750391 17.06626868-6.93750745 33.855037-9.22688438 50.99068056h-0.69375136a864.41343565 864.41343565 0 0 0-11.79376257-50.64380531l-15.95626721-59.59318933h-39.33566772l-17.06626869 61.39694129c-3.88500427 14.63814112-8.46375903 31.70440892-11.79376256 48.84005335h-0.69375049A890.56783897 890.56783897 0 0 0 199.81216237 497.84748474l-12.7650143-61.05006603h-50.78255506l46.55067554 149.36453685h46.82817591zM570.27506324 496.04373279c-3.53812904 17.20501843-6.86813258 33.99378674-9.1575104 51.06005543h-0.69375047c-3.1912538-17.13564355-7.49250818-33.855037-11.79376257-50.64380531l-15.95626721-59.59318933H493.26872999l-17.06626869 61.39694129c-3.88500427 14.63814112-8.46375903 31.77378466-11.79376256 48.84005335h-0.69375137a904.30410413 904.30410413 0 0 0-9.08813463-49.18692861l-12.83438917-61.05006603h-50.78255417l46.48129978 149.29516199h46.89755078l16.09501783-52.51693213c4.57875475-15.26251673 8.11688379-30.73315807 10.40626074-46.48130068h0.69375136c3.33000354 18.38439477 6.24375697 31.84315955 10.19813611 46.48130068l15.05439124 52.51693212h46.82817502l49.11755373-149.29516198H584.15007813l-13.73626514 59.24631408zM825.22846423 496.04373279c-3.60750391 17.20501843-6.93750745 33.99378674-9.15751039 51.06005543h-0.69375048c-3.26062867-17.13564355-7.56188305-33.855037-11.79376256-50.64380531l-16.02564208-59.59318933h-39.33566773l-16.99689381 61.39694129a710.40076917 710.40076917 0 0 0-11.79376257 48.84005335h-0.69375049a893.96721827 893.96721827 0 0 0-9.15751038-49.18692861l-12.76501342-61.05006603H645.89389464l46.55067554 149.29516199h46.82817591l16.09501784-52.51693213a328.14410573 328.14410573 0 0 0 10.47563559-46.48130068h0.69375136c3.26062867 18.38439477 6.24375697 31.84315955 10.12876036 46.48130068l15.05439124 52.51693212h46.82817591l49.1869286-149.29516198h-48.84005337l-13.73626426 59.24631408z" p-id="7366" fill="#38ACD2"></path><path d="M320.17791736 643.11889184c28.65190576 164.34955323 107.87824195 274.72529762 191.82208264 274.72529761 81.30758763 0 158.24454601-103.7157373 189.04707984-259.80965612l2.42812756-12.83438916 44.40004835 7.90875828C715.4077206 835.28784972 623.34699522 962.93798828 512 962.93798828c-109.26574291 0-200.07771705-123.00200805-233.93275317-299.56157396l-2.28937782-12.48751393 44.40004835-7.70063368zM512 61.06201172c109.40449353 0 200.14709193 123.14075868 234.00212804 299.83907432l2.28937782 12.48751393-44.40004834 7.70063369C675.10080202 216.67030556 595.94384069 106.15581055 512 106.15581055c-82.07071387 0-159.56267298 105.58886413-189.81020519 263.62528552l-2.28937782 12.69563854-44.40004834-7.63125792C307.06602784 190.65465198 399.7511288 61.06201172 512 61.06201172z" p-id="7367" fill="#38ACD2"></path><path d="M549.60129065 647.28139648V962.93798828h-60.14819006V647.28139648h60.14819006z m0-586.21938476v315.6565918h-60.14819006V61.06201172h60.14819006z" p-id="7368" fill="#38ACD2"></path><path d="M151.24960938 241.43720703h721.50078124v45.09379883H151.24960938V241.43720703z m0 496.03178711h721.50078124v45.09379883H151.24960938v-45.09379883z" p-id="7369" fill="#38ACD2"></path></svg>

Before

Width:  |  Height:  |  Size: 3.9 KiB

View File

@@ -1 +0,0 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1687771150463" class="icon" viewBox="0 0 1228 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7479" width="35.9765625" height="30" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M1099.86729167 250.4559668V115.17457031H125.84123698v135.28139649h974.02605469z m0 54.11255859H125.84123698v595.23814453h974.02605469V304.56852539zM71.72867839 61.06201172h1082.25117187v892.8572168H71.72867839V61.06201172z m324.31460117 504.74992185v44.34223492c0.1803752 10.31144837 2.1344401 18.12770712 5.89225608 23.50890074 3.72775374 5.38119362 11.15319987 8.05675843 22.27633663 8.05675844h99.65729541v44.34223581h-119.73906657c-20.14189651 0-34.15103728-4.65969284-41.99735827-13.9490154-7.81625876-9.28932256-11.7243877-23.32852556-11.72438769-42.14767035v-82.61183945c0-18.81914567 3.90812893-32.85834779 11.72438769-42.14767034 7.81625876-9.31938479 21.82539863-13.9490154 41.99735827-13.9490154h119.73906657v44.34223581h-99.65729541c-11.12313675 0-18.54858288 2.70562793-22.27633663 8.05675842-3.75781686 5.38119362-5.71188089 12.7465135-5.89225608 22.1560868z m327.98223044 64.15344416c0 18.12770712-3.72775374 32.01659717-11.21332523 41.66667012-7.4855706 9.62001071-21.40452288 14.43001562-41.7267946 14.43001563h-66.76888539c-20.17195963 0-34.18109951-4.65969284-41.99735738-13.9490154-7.81625876-9.28932256-11.7243877-23.32852556-11.7243877-42.14767035v-82.61183945c0-18.81914567 3.90812893-32.85834779 11.7243877-42.14767034 7.81625876-9.31938479 21.82539863-13.9490154 41.99735738-13.9490154h66.73882227c20.35233483 0 34.27128711 4.81000491 41.75685772 14.43001562 7.4855706 9.62001071 11.21332435 23.53896299 11.21332523 41.66667012v82.61183945zM678.39058559 611.20635742v-44.67292307c0-10.76238636-1.74362659-18.60870736-5.23088067-23.50890076-3.48725407-4.93025564-11.21332435-7.39538301-23.20827572-7.395383h-25.55315237c-11.12313675 0-18.57864512 2.70562793-22.30639886 8.05675842-3.72775374 5.38119362-5.6216933 12.98701406-5.62169418 22.84752534v44.31217268c0 9.86051038 1.89393956 17.4663317 5.62169418 22.84752444 3.72775374 5.38119362 11.18326211 8.05675843 22.30639886 8.05675932h25.55315237c11.99495049 0 19.63083405-2.46512737 22.93771293-7.39538301 3.30687888-4.90019251 5.14069306-12.62626367 5.50144346-23.14815036z m241.37207356-119.91944264c20.32227171 0 34.27128711 4.81000491 41.72679548 14.43001562 7.4855706 9.62001071 11.21332435 23.53896299 11.21332434 41.66667012v138.7085252h-45.63492441v-119.55869137c0-10.76238636-1.74362659-18.60870736-5.23088066-23.50890076-3.48725407-4.93025564-11.21332435-7.39538301-23.20827484-7.395383h-14.61039082v150.46297513h-46.17605l-0.24050055-150.46297513h-13.04713943c-11.12313675 0-18.54858288 2.70562793-22.30639886 8.05675842-3.72775374 5.38119362-5.59163105 12.98701406-5.59163105 22.84752534v119.55869137h-45.90548721v-138.7085252c0-18.81914567 3.90812893-32.85834779 11.72438769-42.14767035 7.81625876-9.31938479 21.82539863-13.9490154 41.99735828-13.94901539h115.28981204zM244.88886589 637.36076074h48.70130273v48.70130274H244.88886589v-48.70130274z" p-id="7480" fill="#38ACD2"></path></svg>

Before

Width:  |  Height:  |  Size: 3.1 KiB

View File

@@ -1 +0,0 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1688290376101" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="8107" xmlns:xlink="http://www.w3.org/1999/xlink" width="36" height="36"><path d="M512 61.06201172a450.93798828 450.93798828 0 1 1 0 901.87597656 450.93798828 450.93798828 0 0 1 0-901.87597656z m0 45.09379883a405.84418945 405.84418945 0 1 0 0 811.6883789 405.84418945 405.84418945 0 0 0 0-811.6883789z" p-id="8108" fill="#778391"></path><path d="M229.64344446 586.23133044l15.95626722-52.586307c4.64812962-15.19314186 8.18625866-30.6637832 10.54501134-46.41192491h0.69375048c3.1912538 18.3150199 6.17438209 31.77378466 10.12876124 46.48129978l15.05439124 52.51693213h46.82817591l49.11755284-149.36453686h-48.77067761l-13.73626514 59.24631408c-3.60750391 17.06626868-6.93750745 33.855037-9.22688438 50.99068056h-0.69375136a864.41343565 864.41343565 0 0 0-11.79376257-50.64380531l-15.95626721-59.59318933h-39.33566772l-17.06626869 61.39694129c-3.88500427 14.63814112-8.46375903 31.70440892-11.79376256 48.84005335h-0.69375049A890.56783897 890.56783897 0 0 0 199.81216237 497.84748474l-12.7650143-61.05006603h-50.78255506l46.55067554 149.36453685h46.82817591zM570.27506324 496.04373279c-3.53812904 17.20501843-6.86813258 33.99378674-9.1575104 51.06005543h-0.69375047c-3.1912538-17.13564355-7.49250818-33.855037-11.79376257-50.64380531l-15.95626721-59.59318933H493.26872999l-17.06626869 61.39694129c-3.88500427 14.63814112-8.46375903 31.77378466-11.79376256 48.84005335h-0.69375137a904.30410413 904.30410413 0 0 0-9.08813463-49.18692861l-12.83438917-61.05006603h-50.78255417l46.48129978 149.29516199h46.89755078l16.09501783-52.51693213c4.57875475-15.26251673 8.11688379-30.73315807 10.40626074-46.48130068h0.69375136c3.33000354 18.38439477 6.24375697 31.84315955 10.19813611 46.48130068l15.05439124 52.51693212h46.82817502l49.11755373-149.29516198H584.15007813l-13.73626514 59.24631408zM825.22846423 496.04373279c-3.60750391 17.20501843-6.93750745 33.99378674-9.15751039 51.06005543h-0.69375048c-3.26062867-17.13564355-7.56188305-33.855037-11.79376256-50.64380531l-16.02564208-59.59318933h-39.33566773l-16.99689381 61.39694129a710.40076917 710.40076917 0 0 0-11.79376257 48.84005335h-0.69375049a893.96721827 893.96721827 0 0 0-9.15751038-49.18692861l-12.76501342-61.05006603H645.89389464l46.55067554 149.29516199h46.82817591l16.09501784-52.51693213a328.14410573 328.14410573 0 0 0 10.47563559-46.48130068h0.69375136c3.26062867 18.38439477 6.24375697 31.84315955 10.12876036 46.48130068l15.05439124 52.51693212h46.82817591l49.1869286-149.29516198h-48.84005337l-13.73626426 59.24631408z" p-id="8109" fill="#778391"></path><path d="M320.17791736 643.11889184c28.65190576 164.34955323 107.87824195 274.72529762 191.82208264 274.72529761 81.30758763 0 158.24454601-103.7157373 189.04707984-259.80965612l2.42812756-12.83438916 44.40004835 7.90875828C715.4077206 835.28784972 623.34699522 962.93798828 512 962.93798828c-109.26574291 0-200.07771705-123.00200805-233.93275317-299.56157396l-2.28937782-12.48751393 44.40004835-7.70063368zM512 61.06201172c109.40449353 0 200.14709193 123.14075868 234.00212804 299.83907432l2.28937782 12.48751393-44.40004834 7.70063369C675.10080202 216.67030556 595.94384069 106.15581055 512 106.15581055c-82.07071387 0-159.56267298 105.58886413-189.81020519 263.62528552l-2.28937782 12.69563854-44.40004834-7.63125792C307.06602784 190.65465198 399.7511288 61.06201172 512 61.06201172z" p-id="8110" fill="#778391"></path><path d="M549.60129065 647.28139648V962.93798828h-60.14819006V647.28139648h60.14819006z m0-586.21938476v315.6565918h-60.14819006V61.06201172h60.14819006z" p-id="8111" fill="#778391"></path><path d="M151.24960938 241.43720703h721.50078124v45.09379883H151.24960938V241.43720703z m0 496.03178711h721.50078124v45.09379883H151.24960938v-45.09379883z" p-id="8112" fill="#778391"></path></svg>

Before

Width:  |  Height:  |  Size: 3.9 KiB

View File

@@ -1 +0,0 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1687770782238" class="icon" viewBox="0 0 1109 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7446" width="35.7392578125" height="33" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M306.07165232 286.53100586h88.45900173v402.31184159H306.07165232V286.53100586z m254.70480646 258.08684225h92.9683825c25.1773713 0 46.59692575-3.68265995 64.25866333-10.97282467 17.66173758-7.36532077 32.01659717-16.9853306 43.06457788-29.01034421 11.12313675-12.02501272 19.1648645-25.85377829 24.27549445-41.48629492a152.94313406 152.94313406 0 0 0 0-95.44854056 111.6071521 111.6071521 0 0 0-24.27549445-41.18566989 120.25012991 120.25012991 0 0 0-43.06457788-29.01034333A167.59861869 167.59861869 0 0 0 653.74484128 286.53100586H472.31745703v402.31184159h88.45900175v-144.30015625z m0-189.39395508h68.7680432c10.14610474 0 19.84127148 0.75156302 29.31096924 2.25468995a68.39226126 68.39226126 0 0 1 24.80158936 8.79329077 47.72427072 47.72427072 0 0 1 17.13564355 18.33814456 64.48413233 64.48413233 0 0 1 6.46344479 30.96440824c0 12.77657663-2.1795339 23.07299344-6.46344479 30.96440911a47.6491138 47.6491138 0 0 1-17.21079959 18.33814456 68.09163623 68.09163623 0 0 1-24.80158936 8.71813474c-9.39454172 1.50312692-19.08970846 2.25468994-29.31096923 2.25468994H560.85161569V355.29904907z" p-id="7447" fill="#7E9F54"></path><path d="M997.43474439 61.06201172H101.72158671C79.2498442 61.06201172 61.06201172 80.60265817 61.06201172 104.65268362v814.69463276c0 24.05002634 18.18783249 43.5906719 40.65957499 43.5906719h895.71315768c22.47174337 0 40.65957499-19.54064646 40.65957497-43.5906719V104.65268362c0-24.05002634-18.18783249-43.5906719-40.65957497-43.5906719z m-20.36736551 835.73840524H122.0889531V126.44802001h854.97842578v770.35239695z" p-id="7448" fill="#7E9F54"></path></svg>

Before

Width:  |  Height:  |  Size: 1.9 KiB

View File

@@ -1 +0,0 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1688290403407" class="icon" viewBox="0 0 1109 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="8307" xmlns:xlink="http://www.w3.org/1999/xlink" width="38.98828125" height="36"><path d="M306.07165232 286.53100586h88.45900173v402.31184159H306.07165232V286.53100586z m254.70480646 258.08684225h92.9683825c25.1773713 0 46.59692575-3.68265995 64.25866333-10.97282467 17.66173758-7.36532077 32.01659717-16.9853306 43.06457788-29.01034421 11.12313675-12.02501272 19.1648645-25.85377829 24.27549445-41.48629492a152.94313406 152.94313406 0 0 0 0-95.44854056 111.6071521 111.6071521 0 0 0-24.27549445-41.18566989 120.25012991 120.25012991 0 0 0-43.06457788-29.01034333A167.59861869 167.59861869 0 0 0 653.74484128 286.53100586H472.31745703v402.31184159h88.45900175v-144.30015625z m0-189.39395508h68.7680432c10.14610474 0 19.84127148 0.75156302 29.31096924 2.25468995a68.39226126 68.39226126 0 0 1 24.80158936 8.79329077 47.72427072 47.72427072 0 0 1 17.13564355 18.33814456 64.48413233 64.48413233 0 0 1 6.46344479 30.96440824c0 12.77657663-2.1795339 23.07299344-6.46344479 30.96440911a47.6491138 47.6491138 0 0 1-17.21079959 18.33814456 68.09163623 68.09163623 0 0 1-24.80158936 8.71813474c-9.39454172 1.50312692-19.08970846 2.25468994-29.31096923 2.25468994H560.85161569V355.29904907z" p-id="8308" fill="#778391"></path><path d="M997.43474439 61.06201172H101.72158671C79.2498442 61.06201172 61.06201172 80.60265817 61.06201172 104.65268362v814.69463276c0 24.05002634 18.18783249 43.5906719 40.65957499 43.5906719h895.71315768c22.47174337 0 40.65957499-19.54064646 40.65957497-43.5906719V104.65268362c0-24.05002634-18.18783249-43.5906719-40.65957497-43.5906719z m-20.36736551 835.73840524H122.0889531V126.44802001h854.97842578v770.35239695z" p-id="8309" fill="#778391"></path></svg>

Before

Width:  |  Height:  |  Size: 1.9 KiB

View File

@@ -92,7 +92,7 @@ export default {
username: '',
pin: '',
language: '',
licenseStatus: -1, // -1 未获取后台数据状态0 获取后台数据且验证成功1 获取后台数据且验证失败;
licenseStatus: -1,//-1 未获取后台数据状态0 获取后台数据且验证成功1 获取后台数据且验证失败;
licenseStatusErrMsg: '',
downloadC2vUrl: api.downloadLicenseC2v,
supportID: ''
@@ -141,7 +141,7 @@ export default {
this.loading = false
this.blockOperation.query = false
if (_.get(e, 'response.data.code', 0) === 518005) {
this.$message.error(this.$t('tip.incorrectUsernameOrPassword'))
this.$message.error(this.$t('Incorrect username or password'))
} else {
this.$message.error(this.errorMsgHandler(e))
}

View File

@@ -150,7 +150,3 @@ body {
}
}
}
.el-table .table-disabled-row {
--el-table-tr-bg-color: var(--el-fill-color-light);
}

View File

@@ -145,20 +145,6 @@ $border-radius-small: 2px;
width: calc(50% - 10px);
}
}
.my-progress {
margin-bottom: 6px;
.el-progress-bar__innerText {
color: rgba(0,0,0,0) !important;
}
}
.password-hint {
color: var(--el-color-info);
font-size: 12px;
margin-bottom: 12px;
}
}
.right-box__footer {

View File

@@ -53,7 +53,7 @@
border: 1px solid var(--el-border-color-light);
}
.top-tool-search, .top-tool-search1 {
.top-tool-search {
.top-tool-search__display {
display: flex;
}
@@ -83,13 +83,6 @@
}
}
.top-tool-search1 {
width: 100%;
.el-input {
width: 100% !important;
}
}
.top-tool-right {
display: flex;
}
@@ -128,12 +121,6 @@
}
}
.tool-btn-view {
i {
font-size: 13px;
}
}
.btn-customize {
color: var(--el-color-primary);
font-size: 12px;
@@ -163,7 +150,7 @@
.cn-table {
padding: 0 20px;
height: calc(100% - 52px);
height: calc(100% - 48px);
.el-table:not(.chart-table) {
height: calc(100% - 58px);
@@ -243,10 +230,6 @@
margin-bottom: 10px;
}
.margin-l-16 {
margin-left: 16px;
}
.padding-r-20 {
padding-right: 20px;
}

View File

@@ -41,7 +41,7 @@
.time-line-container {
height: 40px;
line-height: 40px;
background-color: rgba(245, 245, 245, 0.50);
background-color: rgba(255, 255, 255, 0.50);
display: flex;
justify-content: space-between;
padding: 0 6px;

View File

@@ -6,9 +6,6 @@
&>div {
height: 100%;
}
&:focus-visible {
outline: none;
}
overflow-y: auto;
}
@@ -88,21 +85,20 @@
}
.cn-menu__left {
flex: 1;
padding: 12px 0 10px 0;
padding: 12px 10px 10px 20px;
max-width: 290px;
border-right: 1px solid var(--el-border-color);
.left-menu {
padding: 8px 0 8px 20px;
padding: 8px 0;
font-size: 14px;
color: var(--el-text-color-primary);
cursor: pointer;
&:hover {
color: var(--el-color-primary);
}
&.left-menu--setting {
background-color: #f0f0f0;
span {
text-decoration: underline;
}
}
.cn-icon:first-of-type {
font-size: 17px;
@@ -117,10 +113,6 @@
padding-left: 10px;
}
}
.empty-menu {
border-top: 1px rgba(0,0,0,0) solid;
}
}
.cn-menu__middle {
display: flex;

View File

@@ -89,6 +89,3 @@
@import "./components/common/simple-loading";
@import "views/location/location";
@import "views/setting/sourcesForm";
@import "views/setting/entitySettingForm";

View File

@@ -108,10 +108,6 @@ $color-highlight: #CC4444;
height: 21px;
}
}
&.map-marker--hidden {
display: none;
}
}
.map-tracking-marker {
@@ -316,48 +312,7 @@ $color-highlight: #CC4444;
height: 58px;
display: flex;
.item-icons {
display: flex;
flex-direction: column;
.icon-circle {
position: relative;
padding-left: 18px;
i {
position: absolute;
top: 0;
left: 0;
font-size: 14px;
color: #FA901C;
}
.circle-circle {
width: 10px;
height: 10px;
margin-left: 2px;
margin-top: 2px;
border-radius: 50%;
background-color: $color-circle;
&.circle-circle__highlight {
margin-left: 0;
margin-top: 0;
width: 14px;
height: 14px;
}
}
}
.item-line {
border-left: 2px $color-inactive dotted;
height: 34px;
margin-left: 24px;
margin-top: 6px;
transition: all 0.2s;
}
}
/*.item-circle {
.item-circle {
display: flex;
flex-direction: column;
@@ -376,7 +331,7 @@ $color-highlight: #CC4444;
margin-top: 6px;
transition: all var(--el-transition-duration-fast);
}
}*/
}
.item-content {
display: flex;
@@ -467,7 +422,7 @@ $color-highlight: #CC4444;
.hexagon-tooltip__body {
.body__item .item__label {
width: 80px;
width: 140px;
}
}
}

View File

@@ -129,6 +129,5 @@
font-size: 12px;
color: #353636;
font-weight: 400;
line-height: 12px;
margin-top: -2px !important;
}

View File

@@ -138,29 +138,6 @@ $bg-color-page: var(--el-bg-color-page);
border-radius: 3px;
margin-right: 10px;
}
.detection-event-name {
font-family: NotoSansSChineseRegular;
font-size: 16px;
color: var(--el-text-color-primary);
font-weight: 400;
}
.detection-event-key {
font-family: Roboto-Black;
font-style: italic;
font-size: 12px;
color: var(--el-color-info);
letter-spacing: 0;
line-height: 14px;
font-weight: 400;
margin-left: 4px;
}
.detection-event-line {
border-left: 1px var(--el-color-info) solid;
margin: 8px;
}
}
.cn-detection__body {
@@ -211,35 +188,6 @@ $bg-color-page: var(--el-bg-color-page);
color: var(--el-color-success);
font-weight: 500;
}
.item__key {
font-family: NotoSansSChineseRegular;
font-size: 16px;
color: var(--el-text-color-primary) !important;
font-weight: 400;
}
.item__key__type {
font-family: Roboto-Black;
font-style: italic;
font-size: 12px;
color: var(--el-color-info);
letter-spacing: 0;
line-height: 14px;
font-weight: 400;
margin-left: 4px;
margin-right: 16px;
}
.item__key__nums {
background: rgba(250,144,28,0.14);
border-radius: 12px;
font-family: NotoSansSChineseRegular;
font-size: 12px;
color: #FA901C !important;
font-weight: 400;
padding: 2px 8px;
}
}
.basic-info__item1 {
@@ -249,10 +197,6 @@ $bg-color-page: var(--el-bg-color-page);
}
}
.new__basic-info {
padding: 0 16px;
}
.show-detail {
flex-shrink: 0;
padding: 0 30px;

View File

@@ -35,11 +35,6 @@ $color-regular: var(--el-text-color-regular);
}
}
.overview__title__margin {
margin: 10px 0;
}
.overview__row {
display: flex;
flex-direction: row;
@@ -57,20 +52,12 @@ $color-regular: var(--el-text-color-regular);
line-height: 14px;
word-break: normal;
}
.row__label__capitalize {
text-transform: capitalize;
}
.row__charts {
height: 20px;
width: 80px;
}
.row__content__charts {
width: 600px;
height: 220px;
}
.row__content--metric {
display: flex;
flex-wrap: nowrap;
@@ -119,24 +106,6 @@ $color-regular: var(--el-text-color-regular);
font-size: 14px;
margin-right: 7px;
}
.row__mark__line {
display: flex;
flex-wrap: wrap;
.mark__line__text {
font-size: 12px;
color: var(--el-text-color-regular);
}
.mark__line__block {
width: 12px;
height: 12px;
margin-left: 6px;
margin-right: 6px;
cursor: pointer;
}
}
}
.row__content {
width: calc(100% - 176px);
@@ -145,43 +114,7 @@ $color-regular: var(--el-text-color-regular);
.row__content1 {
display: block;
padding-right: 50px;
.charts__visual__map {
width: 523px;
height: 32px;
margin: 12px 0 10px 58px;
display: flex;
div {
width: 100%;
height: 32px;
}
}
}
.row__display {
display: flex;
justify-content: center;
align-items: center;
width: 600px;
padding-right: 0;
}
}
.overview__row__display {
display: flex;
flex-direction: column;
}
}
.overview__left-new {
flex: 0 0 100%;
.data-expired {
width: 100%;
height: 300px;
line-height: 300px;
color: var(--el-text-color-disabled);
text-align: center;
}
}
}
@@ -332,13 +265,3 @@ $color-regular: var(--el-text-color-regular);
color: var(--el-text-color-primary);
font-weight: 400;
}
.detection-detail__loading {
width: 100%;
position: relative;
.detail__loading {
position: absolute;
width: 100%;
}
}

View File

@@ -12,38 +12,6 @@
width: 100%;
}
.detections__search {
display: flex;
.detections__search__btns {
width: 80px;
height: 40px;
border: 1px solid var(--el-border-color-light);
margin-right: 10px;
border-radius: 2px;
display: flex;
div {
width: 40px;
display: flex;
align-items: center;
justify-content: center;
background-color: var(--el-fill-color);
cursor: pointer;
i {
color: var(--el-text-color-primary);
}
}
.active__btn {
i {
color: var(--el-color-primary) !important;
}
background-color: var(--el-bg-color) !important;
}
}
}
.detections__container {
display: flex;
flex-direction: column;

View File

@@ -254,7 +254,6 @@
font-size: 12px;
color: var(--el-text-color-regular);
font-weight: 400;
white-space: nowrap;
}
}

View File

@@ -1,3 +1,6 @@
$color-business: var(--el-color-business);
$color-primary: var(--el-text-color-primary);
$color-regular: var(--el-text-color-regular);
.graph-toolbar {
position: fixed;
top: 100px;
@@ -15,12 +18,13 @@
cursor: pointer;
i {
color: #575757;
color: $color-regular;
font-size: 18px;
}
&.toolbar--unactivated {
cursor: not-allowed;
cursor: default;
i {
opacity: .4;
}
@@ -28,137 +32,24 @@
}
}
}
.entity-graph {
display: flex;
background-color:'orange';
border: 'solid 5px red';
.entity-graph__chart {
width: 100%;
height:100%;
overflow: hidden;
.force-graph-container .graph-tooltip {
padding: 8px 10px;
//border-radius: 10px;
background-color: white;
box-shadow: -1px 1px 10px -1px rgba(205,205,205,0.85);
.primary-node-tooltip {
padding: 5px;
.tooltip__header {
display: flex;
align-items: center;
i {
color: #717171;
font-size: 14px;
}
.tooltip__title {
padding-left: 6px;
font-size: 15px;
line-height: 15px;
color: #111;
}
}
.tooltip__content {
padding-top: 10px;
color: #222;
font-size: 12px;
span:first-of-type {
padding-right: 20px;
}
}
}
.entity-node-tooltip {
width: 300px;
padding: 5px;
.tooltip__header {
display: flex;
align-items: center;
margin-bottom: 20px;
.tooltip__title {
font-size: 15px;
line-height: 15px;
color: #111;
}
}
.tooltip__content {
display: flex;
flex-direction: column;
.content-header {
display: flex;
align-items: center;
.header-icon {
width: 3px !important;
height: 12px !important;
background: #38ACD2;
border-radius: 1px;
margin-right: 6px;
}
}
.content-tag-list {
display: flex;
align-items: flex-start;
flex-wrap: wrap;
.entity-tag {
margin: 10px 9px 10px 0;
padding: 0 8px;
height: 20px;
font-size: 12px;
border: 1px solid;
border-radius: 2px;
$normal-color: #778391;
$normal-light-color: #F7F8F9;
$negative-color: #E26154;
$negative-light-color: #FEF6F5;
$positive-color: #749F4D;
$positive-light-color: #F7FAF5;
&.entity-tag--level-two-normal {
border-color: $normal-color;
color: $normal-color;
background-color: $normal-light-color;
}
&.entity-tag--level-two-negative {
border-color: $negative-color;
color: $negative-color;
background-color: $negative-light-color;
}
&.entity-tag--level-two-positive {
border-color: $positive-color;
color: $positive-color;
background-color: $positive-light-color;
}
}
}
}
}
}
.force-graph-container {
//height:100% !important;
canvas {
//height:100% !important;
}
}
.graph-node {
display: flex;
flex-direction: column;
align-items: center;
background-color: transparent !important;
transition: linear all .2s;
transition: linear all var(--el-transition-duration-fast);
.graph-node__text {
width: 120px;
font-size: 12px;
color: #353636;
color: $color-primary;
}
&.graph-node--root {
@@ -171,30 +62,38 @@
box-shadow: none;
animation: none;
}
&.graph-node--ip {
border-color: #CBD9BB !important;
box-shadow: 0 0 0 8px rgba(126,159,84,0.14);
border-color: var(--el-color-success-light-5) !important;
box-shadow: 0 0 0 8px rgba(126, 159, 84, 0.14);
i {
color: #7E9F54;
color: var(--el-color-success);
}
}
&.graph-node--domain {
border-color: #AFDEED !important;
box-shadow: 0 0 0 8px rgba(56,172,210,0.14);
border-color: var(--el-color-primary-light-7) !important;
box-shadow: 0 0 0 8px rgba(56, 172, 210, 0.14);
i {
color: #38ACD2;
color: $color-business;
}
}
&.graph-node--app {
border-color: #F5DAA3 !important;
box-shadow: 0 0 0 8px rgba(229,162,25,0.14);
border-color: var(--el-color-warning-light-5) !important;
box-shadow: 0 0 0 8px rgba(229, 162, 25, 0.14);
i {
color: #E5A219;
color: var(--el-color-warning);
}
}
i {
font-size: 36px;
}
.graph-node__text {
padding-top: 30px;
}
@@ -204,19 +103,21 @@
padding-top: 20px;
width: 66px;
height: 66px;
border: 1px solid #A7B0B9 !important;
border: 1px solid #A7B0B9 !important; // 该class并未使用到
box-shadow: none;
// 覆盖自带的node点击效果
&.rel-node-checked {
box-shadow: 0 0 0 5px rgba(151,151,151,0.21);
box-shadow: 0 0 0 5px rgba(151, 151, 151, 0.21);
animation: none;
border-color: #778391 !important;
border-color: $color-regular !important;
}
i {
font-size: 24px;
color: #778391;
color: $color-regular;
}
.graph-node__text {
padding-top: 24px;
}
@@ -230,19 +131,22 @@
&.graph-node--ip {
i {
color: #7E9F54;
color: var(--el-color-success);
}
}
&.graph-node--domain {
i {
color: #38ACD2;
color: $color-business;
}
}
&.graph-node--app {
i {
color: #E5A219;
color: var(--el-color-warning);
}
}
i {
font-size: 21px;
}
@@ -255,6 +159,7 @@
left: unset !important;
right: 0 !important;
}
.entity-graph__detail {
height: calc(100% - 100px) !important;
top: 100px !important;
@@ -265,7 +170,7 @@
}
.g6-component-tooltip {
box-shadow: -1px 1px 10px -1px rgba(205,205,205,0.85);
box-shadow: -1px 1px 10px -1px rgba(205, 205, 205, 0.85);
.primary-node-tooltip {
padding: 5px;
@@ -275,19 +180,21 @@
align-items: center;
i {
color: #717171;
color: $color-regular;
font-size: 14px;
}
.tooltip__title {
padding-left: 6px;
font-size: 15px;
line-height: 15px;
color: #111;
color: $color-primary;
}
}
.tooltip__content {
padding-top: 10px;
color: #222;
color: $color-primary;
font-size: 12px;
span:first-of-type {
@@ -295,6 +202,7 @@
}
}
}
.entity-node-tooltip {
width: 300px;
padding: 5px;
@@ -307,7 +215,7 @@
.tooltip__title {
font-size: 15px;
line-height: 15px;
color: #111;
color: $color-primary;
}
}
@@ -322,11 +230,12 @@
.header-icon {
width: 3px !important;
height: 12px !important;
background: #38ACD2;
background: $color-business;
border-radius: 1px;
margin-right: 6px;
}
}
.content-tag-list {
display: flex;
align-items: flex-start;
@@ -340,22 +249,25 @@
border: 1px solid;
border-radius: 2px;
$normal-color: #778391;
$normal-light-color: #F7F8F9;
$negative-color: #E26154;
$negative-light-color: #FEF6F5;
$positive-color: #749F4D;
$positive-light-color: #F7FAF5;
$normal-color: $color-regular;
$normal-light-color: var(--el-fill-color-light);
$negative-color: var(--el-color-danger);
$negative-light-color: var(--el-color-danger-light-9);
$positive-color: var(--el-color-success);
$positive-light-color: var(--el-color-success-light-9);
&.entity-tag--level-two-normal {
border-color: $normal-color;
color: $normal-color;
background-color: $normal-light-color;
}
&.entity-tag--level-two-negative {
border-color: $negative-color;
color: $negative-color;
background-color: $negative-light-color;
}
&.entity-tag--level-two-positive {
border-color: $positive-color;
color: $positive-color;

View File

@@ -19,7 +19,7 @@ $color-regular: var(--el-text-color-regular);
.graph-list-header-icon {
font-size: 21px;
color: #778391;
color: $color-regular;
margin-right: 9px;
}
}
@@ -50,10 +50,13 @@ $color-regular: var(--el-text-color-regular);
border-radius: 3px;
font-size: 12px;
color: var(--el-color-white);
padding: 8px 10px;
display: flex;
align-items: center;
justify-content: center;
font-weight: 500;
padding: 14px 10px;
cursor: pointer;
border: 1px solid var(--el-color-business);
text-align: center;
border: 1px solid rgba(46, 136, 166, 0.85);
i {
font-size: 16px;

View File

@@ -11,6 +11,7 @@
$color-primary: var(--el-color-primary);
&.explorer-search--show-list {
flex: 0 0 40px;
background-image: none;
}

View File

@@ -7,7 +7,6 @@ $color-primary: var(--el-color-primary);
$color-human: #233447; // 以下是颜色暂无替代的
$color-circle: #DE3434;
$color-base-station: #585B5F;
$color-cell: #586A7F;
$color-search-follow: #6f6f6e;
$color-highlight: #CC4444;
@@ -17,28 +16,10 @@ $color-highlight: #CC4444;
padding: 0 20px 20px;
position: relative;
.subscriber-tags {
display: flex;
flex-wrap: wrap;
padding-left: 18px;
.subscriber-tag {
display: flex;
justify-content: center;
margin: 0 6px 6px 0;
height: 20px;
line-height: 20px;
padding: 0 6px;
font-size: 12px;
border: 1px solid;
border-radius: 2px;
}
}
.location-tabs {
.traceTracking-tabs_label {
display: flex;
flex-display: row;
.traceTracking-num {
margin-top: 5px;
@@ -56,10 +37,6 @@ $color-highlight: #CC4444;
}
}
.follow-cursor {
cursor: pointer;
}
svg {
fill: $color-white;
}
@@ -104,19 +81,6 @@ $color-highlight: #CC4444;
.panel__time {
display: flex;
.follow {
padding-left:6px;
padding-right:6px;
}
.divider {
display: flex;
align-items: center;
.el-divider--vertical {
height: 20px;
margin-left: 10px;
margin-right: 10px;
}
}
}
}
@@ -167,7 +131,6 @@ $color-highlight: #CC4444;
left: 0;
bottom: unset;
right: unset;
z-index: 0;
}
.map-marker {
@@ -177,7 +140,7 @@ $color-highlight: #CC4444;
width: 20px;
height: 20px;
border-radius: 50%;
cursor: pointer;
cursor: default;
padding: 0;
transition: height .1s linear, width .1s linear;
@@ -188,6 +151,7 @@ $color-highlight: #CC4444;
&.map-marker--human {
background-color: $color-human;
cursor: pointer;
svg {
width: 14px;
@@ -204,33 +168,20 @@ $color-highlight: #CC4444;
}
}
&.map-marker--cell {
border: 1px solid $color-white;
background-color: $color-cell;
svg {
width: 12px;
height: 12px;
}
}
&.map-marker--hover {
width: 30px;
height: 30px;
border: 2px solid $color-white;
z-index: 1;
display: flex !important;
z-index: 2;
&.map-marker--human svg {
width: 21px;
height: 21px;
}
&.map-marker--base-station, &.map-marker--cell {
svg {
width: 18px;
height: 18px;
}
&.map-marker--base-station svg {
width: 18px;
height: 18px;
}
}
@@ -239,25 +190,12 @@ $color-highlight: #CC4444;
height: 30px;
border: 2px solid $color-white;
background-color: $color-highlight;
z-index: 2;
display: flex !important;
z-index: 3;
svg {
width: 21px;
height: 21px;
}
&.map-marker--base-station {
background-color: $color-base-station;
svg {
width: 18px;
height: 18px;
}
}
}
&.map-marker--hidden, &.map-marker--unfollowed {
display: none;
}
}
@@ -291,117 +229,89 @@ $color-highlight: #CC4444;
.map-time-line {
position: absolute;
bottom: 0;
width: 100%;
z-index: 10;
left: -6px;
width: calc(100% - 318px);
}
.analysis-statistics-arrow {
position: fixed;
top: calc(50vh + 60px);
height: 30px;
background-color: #FFFFFF;
border-radius: 7px;
transform: translateY(-50%);
color: var(--el-text-color-secondary);
z-index: 1;
font-size: 12px;
cursor: pointer;
transition: all .3s;
&:hover {
color: var(--el-text-color-primary);
}
&.analysis-statistics-arrow--left {
left: 25px;
&.analysis-statistics-arrow--left-expanded {
left: 355px;
}
}
&.analysis-statistics-arrow--right {
right: 25px;
&.analysis-statistics-arrow--right-expanded {
right: 355px;
}
}
}
.analysis-statistics {
width: 330px;
overflow: hidden;
transition: transform .3s;
z-index: 3;
&.analysis-statistics--expanded {
transform: scaleX(1);
}
&.analysis-statistics--collapsed {
transform: scaleX(0);
overflow-y: hidden;
& > div {
visibility: hidden;
}
}
&.analysis-statistics--left-drawer, &.analysis-statistics--right-drawer {
position: fixed;
top: 149px;
height: calc(100vh - 170px);
background-color: #FFFFFF;
}
&.analysis-statistics--left-drawer {
left: 20px;
transform-origin: left;
padding-right: 10px;
}
&.analysis-statistics--right-drawer {
right: 20px;
transform-origin: right;
}
.analysis-statistics__search-list {
padding-left: 10px;
overflow-y: scroll;
padding-right: 5px;
.analysis-statistics__search {
margin-bottom: 10px;
.el-input {
margin-bottom: 10px;
width: 306px;
.el-input-group__prepend {
background-color: #FFF;
padding: 0 8px;
}
}
.business-button {
display: flex;
height: 24px;
justify-content: center;
align-items: center;
font-size: 12px;
}
.input-to-select {
.el-input__wrapper {
display: none;
padding-left: 20px;
.el-select {
.search-active {
float: left;
border-radius: 3px;
width: 6px;
height: 6px;
margin-right: 10px;
position: relative;
top: 50%;
transform: translateY(-50%);
text-align: center;
}
.el-input-group__append {
width: 100%;
padding: 0;
.search-value {
font-size: 14px;
margin-right: 20px;
}
.el-select {
.el-select__wrapper {
background-color: #FFFFFF;
box-shadow: 0 0 0 1px var(--el-input-border-color, var(--el-border-color)) inset;
}
.search-id {
color: var(--el-color-info);
}
.search-follow__icon {
position: absolute;
top: 50%;
right: 10px;
transform: translateY(-50%);
color: $color-search-follow;
margin-right: 10px;
text-align: center;
i {
font-size: 12px;
}
}
.search-content {
display: flex;
flex-direction: column;
height: 100%;
justify-content: center;
}
.active-icon {
background: $color-business;
}
.inactive-icon {
background: $color-inactive;
}
.search-select {
max-height: 250px;
}
.search-select .el-scrollbar__wrap {
max-height: 250px;
overflow-y: auto;
}
.el-select-dropdown .el-scrollbar .el-select-dropdown__wrap .el-scrollbar__view.el-select-dropdown__list .el-select-dropdown__item {
position: relative;
height: 48px;
line-height: 16px;
}
}
}
.analysis-statistics__condition {
display: flex;
justify-content: space-between;
margin-bottom: 10px;
padding-left: 10px;
padding-left: 20px;
font-size: 16px;
color: $color-text-primary;
.el-checkbox__label {
@@ -410,7 +320,7 @@ $color-highlight: #CC4444;
}
}
.analysis-statistics__chart {
margin-bottom: 10px;
margin: 0 0 10px 20px;
height: 148px;
background: rgba(113, 113, 113, 0.06);
border: 1px solid var(--el-border-color-light);
@@ -452,7 +362,7 @@ $color-highlight: #CC4444;
}
.legend-range {
margin-right: 30px;
margin-right: 40px;
width: 54px;
font-family: Helvetica;
font-size: 12px;
@@ -474,9 +384,8 @@ $color-highlight: #CC4444;
.chart__statistics {
display: flex;
height: 30px;
height: 20px;
padding-left: 10px;
padding-bottom: 8px;
.statistics-number {
margin-right: 8px;
@@ -492,7 +401,6 @@ $color-highlight: #CC4444;
text-align: center;
font-size: 12px;
color: $color-white;
line-height: 20px;
}
}
@@ -503,28 +411,22 @@ $color-highlight: #CC4444;
}
.chart-line__drawing {
height: calc(100% - 60px);
height: calc(100% - 32px);
}
.chart__value {
font-size: 32px;
height: calc(100% - 32px);
display: flex;
align-items: center;
justify-content: center;
transform: translateY(-8px);
#activeSubscribersChart {
height: calc(100% - 52px);
}
}
.analysis-statistics__title {
position: relative;
margin-bottom: 8px;
padding-left: 10px;
margin-bottom: 10px;
padding-left: 20px;
font-size: 16px;
color: $color-text-primary;
display: flex;
justify-content: space-between;
.el-checkbox__label {
font-size: 14px;
color: $color-text-primary !important;
@@ -539,8 +441,7 @@ $color-highlight: #CC4444;
}
.analysis-statistics__subscribers {
padding: 0 5px 0 10px;
overflow-y: scroll;
padding-left: 20px;
.analysis-statistics__subscriber {
margin-bottom: 10px;
@@ -600,12 +501,6 @@ $color-highlight: #CC4444;
.header__title {
font-size: 16px;
i {
margin-left: 10px;
font-size: 12px;
cursor: pointer;
}
}
.header__content {
@@ -649,11 +544,10 @@ $color-highlight: #CC4444;
}
.subscriber__body {
padding: 10px 18px 10px 0;
padding: 10px 18px;
.body__item {
display: flex;
padding-left: 18px;
.item__label {
padding-right: 10px;
@@ -675,9 +569,9 @@ $color-highlight: #CC4444;
.item-record__header {
font-family: Helvetica;
padding-left: 18px;
font-size: 16px;
color: $color-text-primary;
font-weight: 400;
height: 38px;
line-height: 38px;
}
@@ -722,38 +616,24 @@ $color-highlight: #CC4444;
display: flex;
padding-bottom: 10px;
.info-icons {
.timeline__info--circle {
display: flex;
flex-direction: column;
position: relative;
.icon-circle {
position: relative;
padding-left: 18px;
i {
position: absolute;
top: 4px;
left: -3px;
font-size: 14px;
color: #FA901C;
}
.circle-circle {
width: 17px;
height: 17px;
margin-left: -2px;
border-radius: 50%;
background-image: radial-gradient($color-circle 20%, transparent);
outline: rgba(222, 52, 52, 0.30) solid 4px;
margin-top: 2px;
}
.info__circle {
width: 17px;
height: 17px;
margin-left: -2px;
border-radius: 50%;
background-image: radial-gradient($color-circle 20%, transparent);
outline: rgba(222, 52, 52, 0.30) solid 4px;
margin-top: 2px;
}
.info-line {
.info__line {
border-left: 2px $color-inactive dotted;
height: 34px;
margin-left: 24px;
margin-left: 6px;
transition: all 0.2s;
}
}
@@ -788,7 +668,6 @@ $color-highlight: #CC4444;
.item-record__btn, .item-record__btn-disabled {
padding-right: 6px;
margin-left: 18px;
cursor: pointer;
text-align: center;
}
@@ -808,43 +687,22 @@ $color-highlight: #CC4444;
height: 58px;
display: flex;
.item-icons {
.item-circle {
display: flex;
flex-direction: column;
.icon-circle {
position: relative;
padding-left: 18px;
i {
position: absolute;
top: 0;
left: 0;
font-size: 14px;
color: #FA901C;
}
.circle-circle {
width: 10px;
height: 10px;
margin-left: 2px;
margin-top: 2px;
border-radius: 50%;
background-color: $color-circle;
&.circle-circle__highlight {
margin-left: 0;
margin-top: 0;
width: 14px;
height: 14px;
}
}
.circle-circle {
width: 10px;
height: 10px;
margin-left: 2px;
border-radius: 50%;
background-color: $color-circle;
}
.item-line {
.circle-line {
border-left: 2px $color-inactive dotted;
height: 34px;
margin-left: 24px;
margin-left: 6px;
margin-top: 6px;
transition: all 0.2s;
}
@@ -886,7 +744,7 @@ $color-highlight: #CC4444;
box-shadow: 0 1px 10px 0 rgba(0, 0, 0, 0.5);
border-radius: 2px;
min-width: 185px;
z-index: 5;
z-index: 3;
/*&.geo-analysis__hexagon-tooltip--hexagon {
}*/
@@ -903,18 +761,7 @@ $color-highlight: #CC4444;
.hexagon-tooltip__body {
.body__item .item__label {
width: 80px;
}
}
}
&.geo-analysis__hexagon-tooltip--cell {
.icon__box {
background-color: $color-cell;
}
.hexagon-tooltip__body {
.body__item .item__label {
width: 100px;
width: 140px;
}
}
}
@@ -923,7 +770,7 @@ $color-highlight: #CC4444;
position: relative;
display: flex;
flex-direction: column;
padding: 10px 10px 10px 63px;
padding: 10px 0 10px 63px;
color: $color-white;
.header__icon {

View File

@@ -1,352 +0,0 @@
$text-color-primary: var(--el-text-color-primary);
$bg-color-page: var(--el-bg-color-page);
$border-color-light: var(--el-border-color-light);
// es为entity setting简写
.es-form {
padding: 20px;
.el-input {
height: 24px;
line-height: 24px;
}
.el-select__wrapper {
min-height: 24px;
//padding: 2px 8px;
}
.es-form-header {
font-size: 24px;
color: $text-color-primary;
font-weight: bold;
margin-top: 10px;
}
.es-form-content {
height: calc(100% - 92px);
overflow: scroll;
padding-bottom: 20px;
.es-form-collapse {
margin-top: 20px;
width: 1200px;
border: 1px $border-color-light solid;
.rule-definition {
position: relative;
}
.el-collapse-item__header {
width: 1200px !important;
height: 56px !important;
background: var(--el-fill-color-blank) !important;
border-left: 1px solid $bg-color-page;
border-right: 1px solid $border-color-light;
border-radius: 4px !important;
display: flex;
justify-content: space-between;
flex-direction: inherit;
position: relative;
padding: 0 20px;
i {
position: absolute;
left: 20px;
}
}
.el-collapse-item__wrap {
//border: 1px solid $bg-color-page;
border-top: none;
}
.form-collapse-header {
margin-left: 26px;
display: flex;
align-items: center;
.form-collapse-header-no, .form-collapse-header-no-active {
width: 24px;
height: 24px;
line-height: 24px;
text-align: center;
font-size: 16px;
border-radius: 50%;
margin-right: 10px;
transition: 0.5s all;
}
.form-collapse-header-no {
background: $border-color-light;
color: $text-color-primary;
}
.form-collapse-header-no-active {
background: var(--el-color-business);
color: var(--el-color-white);
}
.form-collapse-header-title {
font-size: 16px;
color: $text-color-primary;
}
}
.form-collapse-content {
padding: 0 20px 0 46px;
.form-setting__block {
width: 620px;
margin-top: 0;
.form-setting__select {
width: 620px !important;
}
}
.form-content__title {
line-height: 16px;
font-size: 16px;
color: var(--el-text-color-primary);
font-weight: 500;
margin-bottom: 15px;
}
.form-content__block {
width: 620px;
padding: 15px 12px 5px 12px;
border: 1px $border-color-light solid;
margin-bottom: 10px;
.block-header {
width: 596px;
line-height: 12px;
display: flex;
flex-direction: column;
font-size: 12px;
color: var(--el-text-color-primary);
margin-bottom: 10px;
.block-header__title {
display: flex;
justify-content: space-between;
div:nth-child(1) {
font-weight: bold;
}
i {
color: var(--el-text-color-regular);
font-size: 10px;
cursor: pointer;
}
}
.block-header__menu {
display: flex;
padding: 10px 10px 0 10px;
font-weight: bold;
div:nth-child(1) {
width: 278px;
}
}
}
.el-form {
display: flex;
flex-direction: column;
}
.block-body, .block-body1 {
width: 576px;
display: flex;
.el-form-item {
margin-bottom: 10px;
}
.block-body__select {
width: 255px;
}
.block-body-equal {
margin: 0 10px;
color: var(--el-text-color-disabled);
}
.mapping-item-add {
color: var(--el-text-color-regular);
font-size: 10px;
line-height: 24px;
margin: 0 10px;
cursor: pointer;
}
.mapping-item-close {
height: 24px;
line-height: 24px;
color: var(--el-color-error);
font-size: 10px;
cursor: pointer;
}
.relation-field__select {
width: 112px;
}
.relation-field__select-disabled {
width: 112px;
.el-select__selected-item {
color: var(--el-text-color-primary);
}
.el-select__suffix {
display: none;
}
}
.relation-type__select {
width: 302px;
margin: 0 10px;
}
}
.block-body {
padding-left: 10px;
}
.block-body1 {
width: 596px;
}
}
.form-setting-type {
width: 620px;
border: 1px solid $border-color-light;
padding: 15px 12px;
margin-bottom: 10px;
.setting-type__header {
font-size: 14px;
margin-bottom: 10px;
display: flex;
justify-content: space-between;
i {
height: 24px;
line-height: 24px;
color: var(--el-text-color-regular);
font-size: 10px;
cursor: pointer;
}
}
}
.block__footer {
cursor: pointer;
.addFieldBtn {
height: 24px;
min-height: 24px;
font-size: 12px;
color: var(--el-text-color-primary);
font-weight: 500;
width: 620px;
background: var(--el-color-business-light-9);
border: 1px $border-color-light solid;
padding: 0;
box-shadow: 0 2px 4px 0 rgba(51, 51, 51, 0.02);
border-radius: 2px;
.add-field-btn {
color: var(--el-text-color-regular) !important;
font-size: 9px !important;
margin: 0 8px 2px 8px;
}
&:hover {
i {
color: var(--el-color-business) !important;
}
}
}
}
}
.margin-20 {
margin: 20px 0;
}
.el-collapse-item__content {
padding-bottom: 20px;
}
.es-form-trigger {
.el-input__wrapper, .el-select__wrapper {
width: 112px;
}
.el-input__inner {
padding: 0 15px !important;
}
}
}
.el-input--small, .el-input--small .el-input__inner {
border-radius: 2px !important;
}
.switch__block {
margin: 20px 0;
.block-title {
font-size: 14px;
line-height: 14px;
color: $text-color-primary;
margin-bottom: 12px;
}
}
}
.es-form__footer {
width: 100%;
height: 60px;
box-shadow: 0 -1px 4px 0 rgba(0, 0, 0, 0.10);
display: flex;
align-items: center;
justify-content: center;
.el-form-item__label {
color: var(--el-text-color-primary);
}
.tag__btn {
margin: 0 10px;
height: 30px;
min-width: 74px;
}
}
.el-overlay-message-box, .el-message-box {
padding: 0 !important;
}
.el-overlay-message-box {
text-align: center !important;
}
.is-message-box .el-overlay-message-box {
display: flex;
justify-content: center;
align-items: center;
}
.from-dot {
font-size: 14px;
color: var(--el-color-danger);
margin-right: 4px;
}
}

View File

@@ -1,195 +0,0 @@
$color-text-primary: var(--el-text-color-primary);
.sources-form {
height: 100%;
.el-input {
height: 24px;
line-height: 24px;
}
.el-select__wrapper {
min-height: 24px;
padding: 2px 8px;
}
.el-input__wrapper {
padding: 1px 6px;
}
.sources-form__header {
padding: 30px 0 30px 20px;
font-size: 24px;
line-height: 24px;
font-weight: bold;
color: $color-text-primary;
}
.sources-form__body {
display: flex;
flex-direction: column;
height: calc(100% - 147px);
padding-left: 40px;
overflow: auto;
.el-form-item__label {
color: var(--el-text-color-primary);
}
.form__body__label {
font-family: NotoSansHans-Medium;
font-size: 14px;
color: var(--el-text-color-primary);
font-weight: 500;
}
.form-fields__block {
padding: 10px;
width: 620px;
border: 1px solid var(--el-border-color-light);
border-radius: 2px;
margin-top: 10px;
margin-bottom: 20px;
.block__header {
display: flex;
font-family: NotoSansHans-Medium;
font-size: 12px;
color: var(--el-text-color-primary);
font-weight: bold;
margin-bottom: 10px;
.block__header-name {
width: 262px;
margin-right: 10px;
}
.block__header-type {
width: 162px;
margin-right: 10px;
}
}
.block__body {
display: flex;
flex-direction: column;
.block__body-container {
//height: 24px;
//line-height: 24px;
display: flex;
//margin-bottom: 8px;
.block__body-name, .block__body-type, .block__body-default, .block__body-function, .block__body-field, .block__body-field-name {
width: 262px;
height: 24px;
margin-right: 10px;
}
.block__body-type {
width: 162px;
}
.block__body-default {
width: 132px;
}
.block__body-function {
width: 160px;
}
.block__body-field {
width: 124px;
}
.block__body-field-name {
width: 138px;
}
.remove-btn {
height: 24px;
line-height: 24px;
color: var(--el-text-color-primary);
font-size: 9px;
cursor: pointer;
}
.el-form-item {
margin-bottom: 12px;
.el-form-item__content {
line-height: 24px;
}
}
}
}
.block__footer {
margin-top: 8px;
cursor: pointer;
.addFieldBtn {
height: 24px;
min-height: 24px;
font-size: 12px;
color: $color-text-primary;
font-weight: 500;
width: 598px;
background: var(--el-color-business-light-9);
border: 1px var(--el-border-color-light) solid;
padding: 0;
box-shadow: 0 2px 4px 0 rgba(51, 51, 51, 0.02);
border-radius: 2px;
font-family: NotoSansHans-Medium !important;
.add-field-btn {
color: var(--el-text-color-regular) !important;
font-size: 9px !important;
margin: 0 8px 2px 8px;
}
&:hover {
i {
color: var(--el-color-business) !important;
}
}
span {
font-family: NotoSansHans-Medium !important;
}
}
}
}
}
.form-description {
width: 620px;
margin-top: 12px;
margin-bottom: 20px;
}
.sources-form__footer {
display: flex;
align-items: center;
justify-content: center;
height: 60px;
margin-top: 3px;
box-shadow: 0 -1px 4px 0 rgba(0, 0, 0, 0.10);
.el-form-item__label {
color: var(--el-text-color-primary);
}
.tag__btn {
margin: 0 10px;
height: 30px;
min-width: 74px;
}
}
.from-dot {
font-size: 14px;
color: var(--el-color-danger);
margin-right: 4px;
}
}

View File

@@ -199,114 +199,6 @@
}
}
}
.sources-dialog {
.el-dialog__header {
background-color: var(--cn-bg-color-lighter);
box-shadow: 0 1px 0 0 rgba(53,54,54,0.08);
padding: 0;
height: 42px;
line-height: 42px;
.sources-dialog__header {
font-family: NotoSansSChineseRegular;
font-size: 14px;
color: var(--el-text-color-primary);
letter-spacing: 0;
font-weight: 400;
padding-left: 10px;
}
.el-dialog__headerbtn {
width: 42px;
height: 42px;
.el-dialog__close {
color: var(--el-text-color-primary);
}
}
}
.sources-dialog__body {
padding: 20px 30px 10px 30px;
display: flex;
flex-direction: column;
.dialog__body-upload {
width: 420px;
height: 124px;
background: var(--cn-bg-color-lighter);
border: 1px solid var(--el-border-color-light);
border-radius: 4px;
margin-bottom: 10px;
.el-upload-dragger {
height: 124px;
border: 1px solid var(--el-border-color-light);
}
.upload-icon {
font-size: 24px;
color: var(--el-text-color-primary);
}
.el-upload__text {
color: var(--el-text-color-primary);
}
}
.dialog__body-tip {
width: 420px;
height: 142px;
background: var(--el-color-business-light-9);
border-radius: 4px;
padding: 10px;
.tip__text {
font-family: NotoSansSChineseRegular;
font-size: 12px;
color: var(--el-text-color-regular);
letter-spacing: 0;
font-weight: 400;
}
}
}
.el-dialog__footer {
padding: 0;
.sources-dialog__footer {
height: 52px;
line-height: 52px;
border-top: 1px solid var(--el-border-color-light);
.cancel-btn {
width: 80px;
height: 28px;
margin-right: 20px;
color: var(--el-text-color-primary);
background: var(--el-fill-color-light);
border: 1px solid var(--el-border-color-dark);
border-radius: 2px;
cursor: pointer;
}
.upload-btn {
width: 80px;
height: 28px;
margin-right: 20px;
color: var(--el-color-white);
margin-left: 0 !important;
background-color: var(--el-color-business);
border: none;
outline: none;
border-radius: 2px;
cursor: pointer;
}
}
}
}
}
.type-tag {
display: inline-block;

View File

@@ -1,8 +1,8 @@
@font-face {
font-family: "cn-icon"; /* Project id 2614877 */
src: url('iconfont.woff2?t=1731894091336') format('woff2'),
url('iconfont.woff?t=1731894091336') format('woff'),
url('iconfont.ttf?t=1731894091336') format('truetype');
src: url('iconfont.woff2?t=1711625913930') format('woff2'),
url('iconfont.woff?t=1711625913930') format('woff'),
url('iconfont.ttf?t=1711625913930') format('truetype');
}
.cn-icon {
@@ -13,38 +13,6 @@
-moz-osx-font-smoothing: grayscale;
}
.cn-icon-System:before {
content: "\e830";
}
.cn-icon-mutual:before {
content: "\ec8d";
}
.cn-icon-breached-human-black:before {
content: "\e824";
}
.cn-icon-breached-human-white:before {
content: "\e822";
}
.cn-icon-base-station2:before {
content: "\e820";
}
.cn-icon-signal:before {
content: "\e823";
}
.cn-icon-fuhe:before {
content: "\e815";
}
.cn-icon-danfenxi:before {
content: "\e816";
}
.cn-icon-tag-fill:before {
content: "\e775";
}

File diff suppressed because one or more lines are too long

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -26,8 +26,8 @@
@change="(value) => selectColumn(value, meta)"
>
<el-option
v-for="column in columnList"
:key="column.label"
v-for="(column, index) in columnList"
:key="index"
:label="column.label"
:value="column.label"
></el-option>
@@ -57,8 +57,8 @@
@change="(value) => selectValue(value, meta)"
>
<el-option
v-for="code in meta.doc.data"
:key="code.code"
v-for="(code, i) in meta.doc.data"
:key="i"
:label="code.code"
:value="code.code"
></el-option>
@@ -116,8 +116,8 @@
<div class="condition__operation-select" v-if="meta.operator.show && meta.operator.isEditing">
<div
class="condition__operation"
v-for="operator in operatorList"
:key="operator"
v-for="(operator, index) in operatorList"
:key="index"
@click.stop="selectOperator(operator, meta)"
>{{operator}}</div>
</div>

View File

@@ -13,7 +13,7 @@ const strReg = {
value: /^[\da-zA-Z\u4E00-\u9FA5\u3040-\u309F\u0800-\u4e00\u0400-\u04FF\u2000-\u206F\s.'-_%]$/
}
const operatorList = ['=', ' in ', ' IN ', ' like ', ' LIKE ', 'HAS(', 'has(']
const enumList = ['status', 'eventType', 'severity', 'ruleType']
const enumList = ['status', 'eventType', 'severity']
// ipv4校验
const regexIPv4 = /^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/
@@ -1573,10 +1573,9 @@ export default class Parser {
for (let i = 0; i < obj.doc.data.length; i++) {
const item1 = obj.doc.data[i]
if (item.indexOf(item1.code) > -1) {
if (item.indexOf('unordered_sequence') > -1) {
searchList[index] = searchList[index].replace(new RegExp('unordered_sequence', 'g'), 4)
}
searchList[index] = searchList[index].replace(new RegExp(item1.code, 'g'), item1.value)
// 匹配到code终止匹配
break
} else {
// 该操作是避免中文参数切换到英文环境时code经i18n转为英文匹配不到中文参数的情况
Object.keys(store.state.i18nObj).forEach(lang => {

View File

@@ -1,7 +1,7 @@
<template>
<div class="HintInfo" id="myHint" @mouseenter="onMouseenter">
<ul style="padding-left: 0;margin: -10px 0 0 0;min-width: calc(100% - 12px)">
<template v-for="(item,index) in hintList" :key="item.displayText">
<template v-for="(item,index) in hintList" :key="index">
<li :ref="'hint_'+index" class="relative-item CodeMirror-hint"
style="margin-bottom: 2px"
@click="handleSelect(item,index,hintList)"

View File

@@ -12,13 +12,11 @@ export default function createHint (hitType = 'default', CodeMirror, {
keyboardDown,
keyboardEnter
}) {
hitType === 'default'
? showHint(CodeMirror)
: manualShowHint(CodeMirror, {
cb: callback,
keyboardUp,
keyboardDown,
keyboardEnter
})
hitType === 'default' ? showHint(CodeMirror) : manualShowHint(CodeMirror, {
cb: callback,
keyboardUp,
keyboardDown,
keyboardEnter
})
sqlHint(CodeMirror, { dataset, hinthook, keywordshook })
}

View File

@@ -1,25 +1,25 @@
export default function (CodeMirror, {
export default function (CodeMirror,{
cb,
keyboardUp,
keyboardDown,
keyboardEnter
}) {
const HINT_ELEMENT_CLASS = 'CodeMirror-hint'
const ACTIVE_HINT_ELEMENT_CLASS = 'CodeMirror-hint-active'
var HINT_ELEMENT_CLASS = 'CodeMirror-hint'
var ACTIVE_HINT_ELEMENT_CLASS = 'CodeMirror-hint-active'
// This is the old interface, kept around for now to stay
// backwards-compatible.
CodeMirror.showHint = function (cm, getHints, options) {
if (!getHints) return cm.showHint(options)
if (options && options.async) getHints.async = true
const newOpts = { hint: getHints }
if (options) for (const prop in options) newOpts[prop] = options[prop]
var newOpts = { hint: getHints }
if (options) for (var prop in options) newOpts[prop] = options[prop]
return cm.showHint(newOpts)
}
CodeMirror.defineExtension('showHint', function (options) {
options = parseOptions(this, this.getCursor('start'), options)
const selections = this.listSelections()
var selections = this.listSelections()
if (selections.length > 1) return
// By default, don't allow completion when something is selected.
// A hint function can have a `supportsSelection` property to
@@ -27,7 +27,7 @@ export default function (CodeMirror, {
if (this.somethingSelected()) {
if (!options.hint.supportsSelection) return
// Don't try with cross-line selections
for (let i = 0; i < selections.length; i++) {
for (var i = 0; i < selections.length; i++) {
if (selections[i].head.line != selections[i].anchor.line) return
}
}
@@ -55,17 +55,17 @@ export default function (CodeMirror, {
this.startLen = this.cm.getLine(this.startPos.line).length - this.cm.getSelection().length
if (this.options.updateOnCursorActivity) {
const self = this
var self = this
cm.on('cursorActivity', this.activityFunc = function () {
self.cursorActivity()
})
}
}
const requestAnimationFrame = window.requestAnimationFrame || function (fn) {
var requestAnimationFrame = window.requestAnimationFrame || function (fn) {
return setTimeout(fn, 1000 / 60)
}
const cancelAnimationFrame = window.cancelAnimationFrame || clearTimeout
var cancelAnimationFrame = window.cancelAnimationFrame || clearTimeout
Completion.prototype = {
close: function () {
@@ -116,7 +116,7 @@ export default function (CodeMirror, {
this.debounce = 0
}
let identStart = this.startPos
var identStart = this.startPos
if (this.data) {
identStart = this.data.from
}
@@ -127,7 +127,7 @@ export default function (CodeMirror, {
(!pos.ch || this.options.closeCharacters.test(line.charAt(pos.ch - 1)))) {
this.close()
} else {
const self = this
var self = this
this.debounce = requestAnimationFrame(function () {
self.update()
})
@@ -137,7 +137,7 @@ export default function (CodeMirror, {
update: function (first) {
if (this.tick == null) return
const self = this; const myTick = ++this.tick
var self = this, myTick = ++this.tick
fetchHints(this.options.hint, this.cm, this.options, function (data) {
if (self.tick == myTick) self.finishUpdate(data, first)
})
@@ -189,7 +189,7 @@ export default function (CodeMirror, {
}
function buildKeyMap (completion, handle) {
const baseMap = {
var baseMap = {
Up: function () {
handle.moveFocus(-1)
},
@@ -215,7 +215,7 @@ export default function (CodeMirror, {
Esc: handle.close
}
const mac = /Mac/.test(navigator.platform)
var mac = /Mac/.test(navigator.platform)
if (mac) {
baseMap['Ctrl-P'] = function () {
@@ -226,11 +226,11 @@ export default function (CodeMirror, {
}
}
const custom = completion.options.customKeys
const ourMap = custom ? {} : baseMap
var custom = completion.options.customKeys
var ourMap = custom ? {} : baseMap
function addBinding (key, val) {
let bound
var bound
if (typeof val != 'string') {
bound = function (cm) {
return val(cm, handle)
@@ -251,7 +251,7 @@ export default function (CodeMirror, {
}
}
}
const extra = completion.options.extraKeys
var extra = completion.options.extraKeys
if (extra) {
for (var key in extra) {
if (extra.hasOwnProperty(key)) {
@@ -274,25 +274,25 @@ export default function (CodeMirror, {
this.completion = completion
this.data = data
this.picked = false
const widget = this; const cm = completion.cm
const ownerDocument = cm.getInputField().ownerDocument
const parentWindow = ownerDocument.defaultView || ownerDocument.parentWindow
var widget = this, cm = completion.cm
var ownerDocument = cm.getInputField().ownerDocument
var parentWindow = ownerDocument.defaultView || ownerDocument.parentWindow
const hints = this.hints = ownerDocument.createElement('ul')
var hints = this.hints = ownerDocument.createElement('ul')
// $(hints).append(`
// <h1>lalallalla</h1>
// `)
hints.setAttribute('role', 'listbox')
hints.setAttribute('aria-expanded', 'true')
hints.id = this.id
const theme = completion.cm.options.theme
var theme = completion.cm.options.theme
hints.className = 'CodeMirror-hints ' + theme
this.selectedHint = data.selectedHint || 0
const completions = data.list
for (let i = 0; i < completions.length; ++i) {
const elt = hints.appendChild(ownerDocument.createElement('li')); const cur = completions[i]
let className = HINT_ELEMENT_CLASS + (i != this.selectedHint ? '' : ' ' + ACTIVE_HINT_ELEMENT_CLASS)
var completions = data.list
for (var i = 0; i < completions.length; ++i) {
var elt = hints.appendChild(ownerDocument.createElement('li')), cur = completions[i]
var className = HINT_ELEMENT_CLASS + (i != this.selectedHint ? '' : ' ' + ACTIVE_HINT_ELEMENT_CLASS)
if (cur.className != null) className = cur.className + ' ' + className
elt.className = className
if (i == this.selectedHint) elt.setAttribute('aria-selected', 'true')
@@ -306,16 +306,16 @@ export default function (CodeMirror, {
elt.hintId = i
}
const container = completion.options.container || ownerDocument.body
let pos = cm.cursorCoords(completion.options.alignWithWord ? data.from : null)
let left = pos.left; let top = pos.bottom; let below = true
let offsetLeft = 0; let offsetTop = 0
var container = completion.options.container || ownerDocument.body
var pos = cm.cursorCoords(completion.options.alignWithWord ? data.from : null)
var left = pos.left, top = pos.bottom, below = true
var offsetLeft = 0, offsetTop = 0
if (container !== ownerDocument.body) {
// We offset the cursor position because left and top are relative to the offsetParent's top left corner.
const isContainerPositioned = ['absolute', 'relative', 'fixed'].indexOf(parentWindow.getComputedStyle(container).position) !== -1
const offsetParent = isContainerPositioned ? container : container.offsetParent
const offsetParentPosition = offsetParent.getBoundingClientRect()
const bodyPosition = ownerDocument.body.getBoundingClientRect()
var isContainerPositioned = ['absolute', 'relative', 'fixed'].indexOf(parentWindow.getComputedStyle(container).position) !== -1
var offsetParent = isContainerPositioned ? container : container.offsetParent
var offsetParentPosition = offsetParent.getBoundingClientRect()
var bodyPosition = ownerDocument.body.getBoundingClientRect()
offsetLeft = (offsetParentPosition.left - bodyPosition.left - offsetParent.scrollLeft)
offsetTop = (offsetParentPosition.top - bodyPosition.top - offsetParent.scrollTop)
}
@@ -325,10 +325,10 @@ export default function (CodeMirror, {
hints.style.display = 'none'
// If we're at the edge of the screen, then we want the menu to appear on the left of the cursor.
const winW = parentWindow.innerWidth || Math.max(ownerDocument.body.offsetWidth, ownerDocument.documentElement.offsetWidth)
const winH = parentWindow.innerHeight || Math.max(ownerDocument.body.offsetHeight, ownerDocument.documentElement.offsetHeight)
var winW = parentWindow.innerWidth || Math.max(ownerDocument.body.offsetWidth, ownerDocument.documentElement.offsetWidth)
var winH = parentWindow.innerHeight || Math.max(ownerDocument.body.offsetHeight, ownerDocument.documentElement.offsetHeight)
// 不用默认的DOM 下拉提示
//不用默认的DOM 下拉提示
// container.appendChild(hints);
hints.remove()
@@ -336,25 +336,25 @@ export default function (CodeMirror, {
cm.getInputField().setAttribute('aria-owns', this.id)
cm.getInputField().setAttribute('aria-activedescendant', this.id + '-' + this.selectedHint)
let box = completion.options.moveOnOverlap ? hints.getBoundingClientRect() : new DOMRect()
const scrolls = completion.options.paddingForScrollbar ? hints.scrollHeight > hints.clientHeight + 1 : false
var box = completion.options.moveOnOverlap ? hints.getBoundingClientRect() : new DOMRect()
var scrolls = completion.options.paddingForScrollbar ? hints.scrollHeight > hints.clientHeight + 1 : false
// Compute in the timeout to avoid reflow on init
let startScroll
var startScroll
setTimeout(function () {
startScroll = cm.getScrollInfo()
})
const overlapY = box.bottom - winH
var overlapY = box.bottom - winH
if (overlapY > 0) {
const height = box.bottom - box.top; const curTop = pos.top - (pos.bottom - box.top)
var height = box.bottom - box.top, curTop = pos.top - (pos.bottom - box.top)
if (curTop - height > 0) { // Fits above cursor
hints.style.top = (top = pos.top - height - offsetTop) + 'px'
below = false
} else if (height > winH) {
hints.style.height = (winH - 5) + 'px'
hints.style.top = (top = pos.bottom - box.top - offsetTop) + 'px'
const cursor = cm.getCursor()
var cursor = cm.getCursor()
if (data.from.ch != cursor.ch) {
pos = cm.cursorCoords(cursor)
hints.style.left = (left = pos.left - offsetLeft) + 'px'
@@ -362,7 +362,7 @@ export default function (CodeMirror, {
}
}
}
let overlapX = box.right - winW
var overlapX = box.right - winW
if (scrolls) overlapX += cm.display.nativeBarWidth
if (overlapX > 0) {
if (box.right - box.left > winW) {
@@ -372,7 +372,7 @@ export default function (CodeMirror, {
hints.style.left = (left = Math.max(pos.left - overlapX - offsetLeft, 0)) + 'px'
}
if (scrolls) {
for (let node = hints.firstChild; node; node = node.nextSibling) {
for (var node = hints.firstChild; node; node = node.nextSibling) {
node.style.paddingRight = cm.display.nativeBarWidth + 'px'
}
}
@@ -400,7 +400,7 @@ export default function (CodeMirror, {
}))
if (completion.options.closeOnUnfocus) {
let closingOnBlur
var closingOnBlur
cm.on('blur', this.onBlur = function () {
closingOnBlur = setTimeout(function () {
completion.close()
@@ -412,10 +412,10 @@ export default function (CodeMirror, {
}
cm.on('scroll', this.onScroll = function () {
const curScroll = cm.getScrollInfo(); const editor = cm.getWrapperElement().getBoundingClientRect()
var curScroll = cm.getScrollInfo(), editor = cm.getWrapperElement().getBoundingClientRect()
if (!startScroll) startScroll = cm.getScrollInfo()
const newTop = top + startScroll.top - curScroll.top
let point = newTop - (parentWindow.pageYOffset || (ownerDocument.documentElement || ownerDocument.body).scrollTop)
var newTop = top + startScroll.top - curScroll.top
var point = newTop - (parentWindow.pageYOffset || (ownerDocument.documentElement || ownerDocument.body).scrollTop)
if (!below) point += hints.offsetHeight
if (point <= editor.top || point >= editor.bottom) return completion.close()
hints.style.top = newTop + 'px'
@@ -423,7 +423,7 @@ export default function (CodeMirror, {
})
CodeMirror.on(hints, 'dblclick', function (e) {
const t = getHintElement(hints, e.target || e.srcElement)
var t = getHintElement(hints, e.target || e.srcElement)
if (t && t.hintId != null) {
widget.changeActive(t.hintId)
widget.pick()
@@ -431,7 +431,7 @@ export default function (CodeMirror, {
})
CodeMirror.on(hints, 'click', function (e) {
const t = getHintElement(hints, e.target || e.srcElement)
var t = getHintElement(hints, e.target || e.srcElement)
if (t && t.hintId != null) {
widget.changeActive(t.hintId)
if (completion.options.completeOnSingleClick) widget.pick()
@@ -445,7 +445,7 @@ export default function (CodeMirror, {
})
// The first hint doesn't need to be scrolled to on init
const selectedHintRange = this.getSelectedHintRange()
var selectedHintRange = this.getSelectedHintRange()
if (selectedHintRange.from !== 0 || selectedHintRange.to !== 0) {
this.scrollToActive()
}
@@ -460,11 +460,11 @@ export default function (CodeMirror, {
this.completion.widget = null
if (this.hints.parentNode) this.hints.parentNode.removeChild(this.hints)
this.completion.cm.removeKeyMap(this.keyMap)
const input = this.completion.cm.getInputField()
var input = this.completion.cm.getInputField()
input.removeAttribute('aria-activedescendant')
input.removeAttribute('aria-owns')
const cm = this.completion.cm
var cm = this.completion.cm
if (this.completion.options.closeOnUnfocus) {
cm.off('blur', this.onBlur)
cm.off('focus', this.onFocus)
@@ -474,7 +474,7 @@ export default function (CodeMirror, {
disable: function () {
this.completion.cm.removeKeyMap(this.keyMap)
const widget = this
var widget = this
this.keyMap = {
Enter: function () {
widget.picked = true
@@ -494,7 +494,7 @@ export default function (CodeMirror, {
i = avoidWrap ? 0 : this.data.list.length - 1
}
if (this.selectedHint == i) return
let node = this.hints.childNodes[this.selectedHint]
var node = this.hints.childNodes[this.selectedHint]
if (node) {
node.className = node.className.replace(' ' + ACTIVE_HINT_ELEMENT_CLASS, '')
node.removeAttribute('aria-selected')
@@ -508,10 +508,10 @@ export default function (CodeMirror, {
},
scrollToActive: function () {
const selectedHintRange = this.getSelectedHintRange()
const node1 = this.hints.childNodes[selectedHintRange.from]
const node2 = this.hints.childNodes[selectedHintRange.to]
const firstNode = this.hints.firstChild
var selectedHintRange = this.getSelectedHintRange()
var node1 = this.hints.childNodes[selectedHintRange.from]
var node2 = this.hints.childNodes[selectedHintRange.to]
var firstNode = this.hints.firstChild
if (node1.offsetTop < this.hints.scrollTop) {
this.hints.scrollTop = node1.offsetTop - firstNode.offsetTop
} else if (node2.offsetTop + node2.offsetHeight > this.hints.scrollTop + this.hints.clientHeight) {
@@ -524,18 +524,18 @@ export default function (CodeMirror, {
},
getSelectedHintRange: function () {
const margin = this.completion.options.scrollMargin || 0
var margin = this.completion.options.scrollMargin || 0
return {
from: Math.max(0, this.selectedHint - margin),
to: Math.min(this.data.list.length - 1, this.selectedHint + margin)
to: Math.min(this.data.list.length - 1, this.selectedHint + margin),
}
}
}
function applicableHelpers (cm, helpers) {
if (!cm.somethingSelected()) return helpers
const result = []
for (let i = 0; i < helpers.length; i++) {
var result = []
for (var i = 0; i < helpers.length; i++) {
if (helpers[i].supportsSelection) result.push(helpers[i])
}
return result
@@ -545,7 +545,7 @@ export default function (CodeMirror, {
if (hint.async) {
hint(cm, callback, options)
} else {
const result = hint(cm, options)
var result = hint(cm, options)
if (result && result.then) {
result.then(callback)
} else {
@@ -555,10 +555,10 @@ export default function (CodeMirror, {
}
function resolveAutoHints (cm, pos) {
const helpers = cm.getHelpers(pos, 'hint'); let words
var helpers = cm.getHelpers(pos, 'hint'), words
if (helpers.length) {
const resolved = function (cm, callback, options) {
const app = applicableHelpers(cm, helpers)
var resolved = function (cm, callback, options) {
var app = applicableHelpers(cm, helpers)
function run (i) {
if (i == app.length) return callback(null)
@@ -595,17 +595,17 @@ export default function (CodeMirror, {
})
CodeMirror.registerHelper('hint', 'fromList', function (cm, options) {
const cur = cm.getCursor(); const token = cm.getTokenAt(cur)
let term; let from = CodeMirror.Pos(cur.line, token.start); const to = cur
var cur = cm.getCursor(), token = cm.getTokenAt(cur)
var term, from = CodeMirror.Pos(cur.line, token.start), to = cur
if (token.start < cur.ch && /\w/.test(token.string.charAt(cur.ch - token.start - 1))) {
term = token.string.substr(0, cur.ch - token.start)
} else {
term = ''
from = cur
}
const found = []
for (let i = 0; i < options.words.length; i++) {
const word = options.words[i]
var found = []
for (var i = 0; i < options.words.length; i++) {
var word = options.words[i]
if (word.slice(0, term.length) == term) {
found.push(word)
}
@@ -620,7 +620,7 @@ export default function (CodeMirror, {
}
})
CodeMirror.commands.autocomplete = CodeMirror.showHint
CodeMirror.commands.autocomplete = CodeMirror.showHint;
var defaultOptions = {
hint: CodeMirror.hint.auto,
@@ -629,7 +629,7 @@ export default function (CodeMirror, {
closeCharacters: /[\s()\[\]{};:>,]/,
closeOnPick: false,
closeOnUnfocus: false, // 阻止提示信息 失焦关闭
closeOnUnfocus: false, //阻止提示信息 失焦关闭
// closeOnUnfocus: false,
updateOnCursorActivity: true,
@@ -638,7 +638,8 @@ export default function (CodeMirror, {
customKeys: null,
extraKeys: null,
paddingForScrollbar: true,
moveOnOverlap: true
}
CodeMirror.defineOption('hintOptions', null)
moveOnOverlap: true,
};
CodeMirror.defineOption("hintOptions", null);
}

View File

@@ -1,216 +1,222 @@
// 正则 向前去找关键字
//正则 向前去找关键字
/* 用于匹配关系数据 */
function matchOperator (CodeMirror, hintParams = {}) {
const editor = hintParams.editor
const Pos = CodeMirror.Pos
const cur = hintParams.cur
let token = hintParams.token
function matchOperator(CodeMirror, hintParams = {}) {
var editor = hintParams.editor;
var Pos = CodeMirror.Pos
var cur = hintParams.cur;
var token = hintParams.token;
if (!editor) {
return
}
let start = token.start
let cont = true
const leftTokenGroup = []
var start = token.start;
var cont = true;
var leftTokenGroup = [];
while (cont) {
start = token.start
leftTokenGroup.unshift(token)
token = editor.getTokenAt(Pos(cur.line, token.start))
cont = !(token.string.match(/^[ ]*$/) || start === 0) // 只用空格做终止条件
start = token.start;
leftTokenGroup.unshift(token);
token = editor.getTokenAt(Pos(cur.line, token.start));
cont = !(token.string.match(/^[ ]*$/) || start === 0); //只用空格做终止条件
}
const cursorLeftString = editor.getRange(Pos(cur.line, leftTokenGroup[0].start), Pos(cur.line, leftTokenGroup[leftTokenGroup.length - 1].end))
var cursorLeftString = editor.getRange(Pos(cur.line, leftTokenGroup[0].start), Pos(cur.line, leftTokenGroup[leftTokenGroup.length - 1].end))
// 判断是不是满足 运算符 表达式的正则
// test 如果是ig 会改变正则指针: https://my.oschina.net/jamesview/blog/5460753
const reg = /^(.*?)(=|!=|>|<|>=|<=)([^ ]*?)$/
//判断是不是满足 运算符 表达式的正则
//test 如果是ig 会改变正则指针: https://my.oschina.net/jamesview/blog/5460753
var reg = /^(.*?)(=|!=|>|<|>=|<=)([^ ]*?)$/;
if (reg.test(cursorLeftString)) {
const execArr = reg.exec(cursorLeftString) || []
var execArr = reg.exec(cursorLeftString) || []
return {
leftTokenGroup,
cursorLeftString,
label: execArr[1],
sign: execArr[2],
value: execArr[3]
value: execArr[3],
}
}
return null
}
function matchCommon (CodeMirror, hintParams = {}) {
// 通用情况 QUANTILE(expr,level) 左括号右侧第一个就是 关键字
const editor = hintParams.editor
const Pos = CodeMirror.Pos
const cur = hintParams.cur
let token = hintParams.token
function matchCommon(CodeMirror, hintParams = {}) {
//通用情况 QUANTILE(expr,level) 左括号右侧第一个就是 关键字
var editor = hintParams.editor;
var Pos = CodeMirror.Pos
var cur = hintParams.cur;
var token = hintParams.token;
if (!editor) {
return
}
let start = token.start
let cont = true
const leftTokenGroup = []
while (cont) {
start = token.start
leftTokenGroup.unshift(token)
token = editor.getTokenAt(Pos(cur.line, token.start))
cont = !(token.string.match(/^[ (]*$/) || start === 0) // 括号或者空格为终止条件
// 括号补上
var start = token.start;
var cont = true;
var leftTokenGroup = [];
while (cont) {
start = token.start;
leftTokenGroup.unshift(token);
token = editor.getTokenAt(Pos(cur.line, token.start));
cont = !(token.string.match(/^[ (]*$/) || start === 0); //括号或者空格为终止条件
//括号补上
if (token.string === '(') {
leftTokenGroup.unshift(token)
leftTokenGroup.unshift(token);
}
}
const cursorLeftString = editor.getRange(Pos(cur.line, leftTokenGroup[0].start), Pos(cur.line, leftTokenGroup[leftTokenGroup.length - 1].end))
var cursorLeftString = editor.getRange(Pos(cur.line, leftTokenGroup[0].start), Pos(cur.line, leftTokenGroup[leftTokenGroup.length - 1].end))
// 判断是不是满足 运算符 表达式的正则
const reg = /^\((.*?),([^ ]*)$/
//判断是不是满足 运算符 表达式的正则
var reg = /^\((.*?),([^ ]*)$/;
if (reg.test(cursorLeftString)) {
const execArr = reg.exec(cursorLeftString) || []
var execArr = reg.exec(cursorLeftString) || []
return {
leftTokenGroup,
cursorLeftString,
label: execArr[1],
sign: 'unknown', // 没必要判断
value: execArr[2]
sign: 'unknown', //没必要判断
value: execArr[2],
}
}
return null
}
function matchIn (CodeMirror, hintParams = {}) {
// in 的情况比较特殊
// 通用情况 expr not in (values) expr in (values)
const editor = hintParams.editor
const Pos = CodeMirror.Pos
const cur = hintParams.cur
let token = hintParams.token
function matchIn(CodeMirror, hintParams = {}) {
//in 的情况比较特殊
//通用情况 expr not in (values) expr in (values)
var editor = hintParams.editor;
var Pos = CodeMirror.Pos
var cur = hintParams.cur;
var token = hintParams.token;
if (!editor) {
return
}
let start = token.start
let cont = true
const leftTokenGroup = []
// 找到左括号
var start = token.start;
var cont = true;
var leftTokenGroup = [];
//找到左括号
while (cont) {
start = token.start
leftTokenGroup.unshift(token)
token = editor.getTokenAt(Pos(cur.line, token.start))
cont = !(token.string.match(/^[ (]*$/) || start === 0) // 括号或者空格为终止条件
// 左括号补上
start = token.start;
leftTokenGroup.unshift(token);
token = editor.getTokenAt(Pos(cur.line, token.start));
cont = !(token.string.match(/^[ (]*$/) || start === 0); //括号或者空格为终止条件
//左括号补上
if (token.string === '(') {
leftTokenGroup.unshift(token)
leftTokenGroup.unshift(token);
}
}
// 左括号继续向右找
//左括号继续向右找
cont = true
while (cont) {
start = token.start
leftTokenGroup.unshift(token)
token = editor.getTokenAt(Pos(cur.line, token.start))
cont = !(!token.string.match(/^(in|not| )/g) || start === 0) // 括号或者空格为终止条件
start = token.start;
leftTokenGroup.unshift(token);
token = editor.getTokenAt(Pos(cur.line, token.start));
cont = !(!token.string.match(/^(in|not| )/g) || start === 0); //括号或者空格为终止条件
// string-2
//string-2
if (token.type === 'string-2') {
leftTokenGroup.unshift(token)
leftTokenGroup.unshift(token);
}
}
const cursorLeftString = editor.getRange(Pos(cur.line, leftTokenGroup[0].start), Pos(cur.line, leftTokenGroup[leftTokenGroup.length - 1].end))
var cursorLeftString = editor.getRange(Pos(cur.line, leftTokenGroup[0].start), Pos(cur.line, leftTokenGroup[leftTokenGroup.length - 1].end))
// 判断是不是满足 运算符 表达式的正则
const reg = /^(.*?)[ ]+((?:not[ ]+)?in)[ ]*\(([^ ]*?)$/i
//判断是不是满足 运算符 表达式的正则
var reg = /^(.*?)[ ]+((?:not[ ]+)?in)[ ]*\(([^ ]*?)$/i;
if (reg.test(cursorLeftString)) {
const execArr = reg.exec(cursorLeftString) || []
var execArr = reg.exec(cursorLeftString) || []
return {
leftTokenGroup,
cursorLeftString,
label: execArr[1],
sign: execArr[2],
value: execArr[3]
value: execArr[3],
}
}
return null
}
function matchLike (CodeMirror, hintParams = {}) {
// like 的情况比较特殊 expr like value , expr not like value
const editor = hintParams.editor
const Pos = CodeMirror.Pos
const cur = hintParams.cur
let token = hintParams.token
function matchLike(CodeMirror, hintParams = {}) {
//like 的情况比较特殊 expr like value , expr not like value
var editor = hintParams.editor;
var Pos = CodeMirror.Pos
var cur = hintParams.cur;
var token = hintParams.token;
if (!editor) {
return
}
let start = token.start
let cont = true
const leftTokenGroup = []
// 找到左括号
var start = token.start;
var cont = true;
var leftTokenGroup = [];
//找到左括号
while (cont) {
start = token.start
leftTokenGroup.unshift(token)
token = editor.getTokenAt(Pos(cur.line, token.start))
cont = !(token.string.match(/^[ ]*$/) || start === 0) // 括号或者空格为终止条件
start = token.start;
leftTokenGroup.unshift(token);
token = editor.getTokenAt(Pos(cur.line, token.start));
cont = !(token.string.match(/^[ ]*$/) || start === 0); //括号或者空格为终止条件
}
// 左括号继续向右找
//左括号继续向右找
cont = true
while (cont) {
start = token.start
leftTokenGroup.unshift(token)
token = editor.getTokenAt(Pos(cur.line, token.start))
cont = !(!token.string.match(/^(like|not| )/g) || start === 0) // 括号或者空格为终止条件
start = token.start;
leftTokenGroup.unshift(token);
token = editor.getTokenAt(Pos(cur.line, token.start));
cont = !(!token.string.match(/^(like|not| )/g) || start === 0); //括号或者空格为终止条件
// string-2
//string-2
if (token.type === 'string-2') {
leftTokenGroup.unshift(token)
leftTokenGroup.unshift(token);
}
}
const cursorLeftString = editor.getRange(Pos(cur.line, leftTokenGroup[0].start), Pos(cur.line, leftTokenGroup[leftTokenGroup.length - 1].end))
var cursorLeftString = editor.getRange(Pos(cur.line, leftTokenGroup[0].start), Pos(cur.line, leftTokenGroup[leftTokenGroup.length - 1].end))
// 判断是不是满足 运算符 表达式的正则
const reg = /^(.*?)[ ]+((?:not[ ]+)?like)[ ]*([^ ]*?)$/i
//判断是不是满足 运算符 表达式的正则
var reg = /^(.*?)[ ]+((?:not[ ]+)?like)[ ]*([^ ]*?)$/i;
if (reg.test(cursorLeftString)) {
const execArr = reg.exec(cursorLeftString) || []
var execArr = reg.exec(cursorLeftString) || []
return {
leftTokenGroup,
cursorLeftString,
label: execArr[1],
sign: execArr[2],
value: execArr[3]
value: execArr[3],
}
}
return null
}
export const matchMain = (CodeMirror, params, manualParams = {}) => {
let matchRes = null
// 匹配 运算符表达式
var matchRes = null
//匹配 运算符表达式
matchRes = matchOperator(CodeMirror, manualParams)
if (matchRes) {
return matchRes
}
// 匹配 in表达式
//匹配 in表达式
matchRes = matchIn(CodeMirror, manualParams)
if (matchRes) {
return matchRes
}
// 匹配 like表达式
//匹配 like表达式
matchRes = matchLike(CodeMirror, manualParams)
if (matchRes) {
return matchRes
}
// 这里缺少一个对 count(distinct expr) 模式的匹配, 感觉大数据涉及存在缺陷, 先暂时不写
//这里缺少一个对 count(distinct expr) 模式的匹配, 感觉大数据涉及存在缺陷, 先暂时不写
// 匹配 其他表达式 (expr,value1,value2....) 模式的匹配
//匹配 其他表达式 (expr,value1,value2....) 模式的匹配
matchRes = matchCommon(CodeMirror, manualParams)
if (matchRes) {
// 说明这是一个 运算符表达式

View File

@@ -1,521 +1,525 @@
export default function showHint (CodeMirror) {
'use strict'
export default function showHint(CodeMirror) {
"use strict";
const HINT_ELEMENT_CLASS = 'CodeMirror-hint'
const ACTIVE_HINT_ELEMENT_CLASS = 'CodeMirror-hint-active'
var HINT_ELEMENT_CLASS = "CodeMirror-hint";
var ACTIVE_HINT_ELEMENT_CLASS = "CodeMirror-hint-active";
// This is the old interface, kept around for now to stay
// backwards-compatible.
CodeMirror.showHint = function (cm, getHints, options) {
if (!getHints) return cm.showHint(options)
if (options && options.async) getHints.async = true
const newOpts = { hint: getHints }
if (options) for (const prop in options) newOpts[prop] = options[prop]
return cm.showHint(newOpts)
}
if (!getHints) return cm.showHint(options);
if (options && options.async) getHints.async = true;
var newOpts = {hint: getHints};
if (options) for (var prop in options) newOpts[prop] = options[prop];
return cm.showHint(newOpts);
};
CodeMirror.defineExtension('showHint', function (options) {
options = parseOptions(this, this.getCursor('start'), options)
const selections = this.listSelections()
if (selections.length > 1) return
CodeMirror.defineExtension("showHint", function (options) {
options = parseOptions(this, this.getCursor("start"), options);
var selections = this.listSelections()
if (selections.length > 1) return;
// By default, don't allow completion when something is selected.
// A hint function can have a `supportsSelection` property to
// indicate that it can handle selections.
if (this.somethingSelected()) {
if (!options.hint.supportsSelection) return
if (!options.hint.supportsSelection) return;
// Don't try with cross-line selections
for (let i = 0; i < selections.length; i++) { if (selections[i].head.line != selections[i].anchor.line) return }
for (var i = 0; i < selections.length; i++)
if (selections[i].head.line != selections[i].anchor.line) return;
}
if (this.state.completionActive) this.state.completionActive.close()
const completion = this.state.completionActive = new Completion(this, options)
if (!completion.options.hint) return
if (this.state.completionActive) this.state.completionActive.close();
var completion = this.state.completionActive = new Completion(this, options);
if (!completion.options.hint) return;
CodeMirror.signal(this, 'startCompletion', this)
completion.update(true)
})
CodeMirror.signal(this, "startCompletion", this);
completion.update(true);
});
CodeMirror.defineExtension('closeHint', function () {
CodeMirror.defineExtension("closeHint", function () {
if (this.state.completionActive) this.state.completionActive.close()
})
function Completion (cm, options) {
this.cm = cm
this.options = options
this.widget = null
this.debounce = 0
this.tick = 0
this.startPos = this.cm.getCursor('start')
this.startLen = this.cm.getLine(this.startPos.line).length - this.cm.getSelection().length
function Completion(cm, options) {
this.cm = cm;
this.options = options;
this.widget = null;
this.debounce = 0;
this.tick = 0;
this.startPos = this.cm.getCursor("start");
this.startLen = this.cm.getLine(this.startPos.line).length - this.cm.getSelection().length;
if (this.options.updateOnCursorActivity) {
const self = this
cm.on('cursorActivity', this.activityFunc = function () {
self.cursorActivity()
})
var self = this;
cm.on("cursorActivity", this.activityFunc = function () {
self.cursorActivity();
});
}
}
const requestAnimationFrame = window.requestAnimationFrame || function (fn) {
return setTimeout(fn, 1000 / 60)
}
const cancelAnimationFrame = window.cancelAnimationFrame || clearTimeout
var requestAnimationFrame = window.requestAnimationFrame || function (fn) {
return setTimeout(fn, 1000 / 60);
};
var cancelAnimationFrame = window.cancelAnimationFrame || clearTimeout;
Completion.prototype = {
close: function () {
if (!this.active()) return
this.cm.state.completionActive = null
this.tick = null
if (!this.active()) return;
this.cm.state.completionActive = null;
this.tick = null;
if (this.options.updateOnCursorActivity) {
this.cm.off('cursorActivity', this.activityFunc)
this.cm.off("cursorActivity", this.activityFunc);
}
if (this.widget && this.data) CodeMirror.signal(this.data, 'close')
if (this.widget) this.widget.close()
CodeMirror.signal(this.cm, 'endCompletion', this.cm)
if (this.widget && this.data) CodeMirror.signal(this.data, "close");
if (this.widget) this.widget.close();
CodeMirror.signal(this.cm, "endCompletion", this.cm);
},
active: function () {
return this.cm.state.completionActive == this
return this.cm.state.completionActive == this;
},
pick: function (data, i) {
const completion = data.list[i]; const self = this
var completion = data.list[i], self = this;
this.cm.operation(function () {
if (completion.hint) { completion.hint(self.cm, data, completion) } else {
if (completion.hint)
completion.hint(self.cm, data, completion);
else
self.cm.replaceRange(getText(completion), completion.from || data.from,
completion.to || data.to, 'complete')
}
CodeMirror.signal(data, 'pick', completion)
self.cm.scrollIntoView()
})
completion.to || data.to, "complete");
CodeMirror.signal(data, "pick", completion);
self.cm.scrollIntoView();
});
if (this.options.closeOnPick) {
this.close()
this.close();
}
},
cursorActivity: function () {
if (this.debounce) {
cancelAnimationFrame(this.debounce)
this.debounce = 0
cancelAnimationFrame(this.debounce);
this.debounce = 0;
}
let identStart = this.startPos
var identStart = this.startPos;
if (this.data) {
identStart = this.data.from
identStart = this.data.from;
}
const pos = this.cm.getCursor(); const line = this.cm.getLine(pos.line)
var pos = this.cm.getCursor(), line = this.cm.getLine(pos.line);
if (pos.line != this.startPos.line || line.length - pos.ch != this.startLen - this.startPos.ch ||
pos.ch < identStart.ch || this.cm.somethingSelected() ||
(!pos.ch || this.options.closeCharacters.test(line.charAt(pos.ch - 1)))) {
this.close()
this.close();
} else {
const self = this
var self = this;
this.debounce = requestAnimationFrame(function () {
self.update()
})
if (this.widget) this.widget.disable()
self.update();
});
if (this.widget) this.widget.disable();
}
},
update: function (first) {
if (this.tick == null) return
const self = this; const myTick = ++this.tick
var self = this, myTick = ++this.tick
fetchHints(this.options.hint, this.cm, this.options, function (data) {
if (self.tick == myTick) self.finishUpdate(data, first)
})
},
finishUpdate: function (data, first) {
if (this.data) CodeMirror.signal(this.data, 'update')
if (this.data) CodeMirror.signal(this.data, "update");
const picked = (this.widget && this.widget.picked) || (first && this.options.completeSingle)
if (this.widget) this.widget.close()
var picked = (this.widget && this.widget.picked) || (first && this.options.completeSingle);
if (this.widget) this.widget.close();
this.data = data
this.data = data;
if (data && data.list.length) {
if (picked && data.list.length == 1) {
this.pick(data, 0)
this.pick(data, 0);
} else {
this.widget = new Widget(this, data)
CodeMirror.signal(data, 'shown')
this.widget = new Widget(this, data);
CodeMirror.signal(data, "shown");
}
}
}
}
};
function parseOptions (cm, pos, options) {
const editor = cm.options.hintOptions
const out = {}
for (var prop in defaultOptions) out[prop] = defaultOptions[prop]
if (editor) {
for (var prop in editor) { if (editor[prop] !== undefined) out[prop] = editor[prop] }
}
if (options) {
for (var prop in options) { if (options[prop] !== undefined) out[prop] = options[prop] }
}
function parseOptions(cm, pos, options) {
var editor = cm.options.hintOptions;
var out = {};
for (var prop in defaultOptions) out[prop] = defaultOptions[prop];
if (editor) for (var prop in editor)
if (editor[prop] !== undefined) out[prop] = editor[prop];
if (options) for (var prop in options)
if (options[prop] !== undefined) out[prop] = options[prop];
if (out.hint.resolve) out.hint = out.hint.resolve(cm, pos)
return out
return out;
}
function getText (completion) {
if (typeof completion == 'string') return completion
else return completion.text
function getText(completion) {
if (typeof completion == "string") return completion;
else return completion.text;
}
function buildKeyMap (completion, handle) {
const baseMap = {
function buildKeyMap(completion, handle) {
var baseMap = {
Up: function () {
handle.moveFocus(-1)
handle.moveFocus(-1);
},
Down: function () {
handle.moveFocus(1)
handle.moveFocus(1);
},
PageUp: function () {
handle.moveFocus(-handle.menuSize() + 1, true)
handle.moveFocus(-handle.menuSize() + 1, true);
},
PageDown: function () {
handle.moveFocus(handle.menuSize() - 1, true)
handle.moveFocus(handle.menuSize() - 1, true);
},
Home: function () {
handle.setFocus(0)
handle.setFocus(0);
},
End: function () {
handle.setFocus(handle.length - 1)
handle.setFocus(handle.length - 1);
},
Enter: handle.pick,
Tab: handle.pick,
Esc: handle.close
}
};
const mac = /Mac/.test(navigator.platform)
var mac = /Mac/.test(navigator.platform);
if (mac) {
baseMap['Ctrl-P'] = function () {
handle.moveFocus(-1)
}
baseMap['Ctrl-N'] = function () {
handle.moveFocus(1)
}
baseMap["Ctrl-P"] = function () {
handle.moveFocus(-1);
};
baseMap["Ctrl-N"] = function () {
handle.moveFocus(1);
};
}
const custom = completion.options.customKeys
const ourMap = custom ? {} : baseMap
var custom = completion.options.customKeys;
var ourMap = custom ? {} : baseMap;
function addBinding (key, val) {
let bound
if (typeof val != 'string') {
function addBinding(key, val) {
var bound;
if (typeof val != "string")
bound = function (cm) {
return val(cm, handle)
}
}
return val(cm, handle);
};
// This mechanism is deprecated
else if (baseMap.hasOwnProperty(val)) { bound = baseMap[val] } else { bound = val }
ourMap[key] = bound
else if (baseMap.hasOwnProperty(val))
bound = baseMap[val];
else
bound = val;
ourMap[key] = bound;
}
if (custom) {
for (var key in custom) {
if (custom.hasOwnProperty(key)) { addBinding(key, custom[key]) }
}
}
const extra = completion.options.extraKeys
if (extra) {
for (var key in extra) {
if (extra.hasOwnProperty(key)) { addBinding(key, extra[key]) }
}
}
return ourMap
if (custom)
for (var key in custom) if (custom.hasOwnProperty(key))
addBinding(key, custom[key]);
var extra = completion.options.extraKeys;
if (extra)
for (var key in extra) if (extra.hasOwnProperty(key))
addBinding(key, extra[key]);
return ourMap;
}
function getHintElement (hintsElement, el) {
function getHintElement(hintsElement, el) {
while (el && el != hintsElement) {
if (el.nodeName.toUpperCase() === 'LI' && el.parentNode == hintsElement) return el
el = el.parentNode
if (el.nodeName.toUpperCase() === "LI" && el.parentNode == hintsElement) return el;
el = el.parentNode;
}
}
function Widget (completion, data) {
this.id = 'cm-complete-' + Math.floor(Math.random(1e6))
this.completion = completion
this.data = data
this.picked = false
const widget = this; const cm = completion.cm
const ownerDocument = cm.getInputField().ownerDocument
const parentWindow = ownerDocument.defaultView || ownerDocument.parentWindow
function Widget(completion, data) {
this.id = "cm-complete-" + Math.floor(Math.random(1e6))
this.completion = completion;
this.data = data;
this.picked = false;
var widget = this, cm = completion.cm;
var ownerDocument = cm.getInputField().ownerDocument;
var parentWindow = ownerDocument.defaultView || ownerDocument.parentWindow;
const hints = this.hints = ownerDocument.createElement('ul')
var hints = this.hints = ownerDocument.createElement("ul");
// $(hints).append(`
// <h1>lalallalla</h1>
// `)
hints.setAttribute('role', 'listbox')
hints.setAttribute('aria-expanded', 'true')
hints.setAttribute("role", "listbox")
hints.setAttribute("aria-expanded", "true")
hints.id = this.id
const theme = completion.cm.options.theme
hints.className = 'CodeMirror-hints ' + theme
this.selectedHint = data.selectedHint || 0
var theme = completion.cm.options.theme;
hints.className = "CodeMirror-hints " + theme;
this.selectedHint = data.selectedHint || 0;
const completions = data.list
for (let i = 0; i < completions.length; ++i) {
const elt = hints.appendChild(ownerDocument.createElement('li')); const cur = completions[i]
let className = HINT_ELEMENT_CLASS + (i != this.selectedHint ? '' : ' ' + ACTIVE_HINT_ELEMENT_CLASS)
if (cur.className != null) className = cur.className + ' ' + className
elt.className = className
if (i == this.selectedHint) elt.setAttribute('aria-selected', 'true')
elt.id = this.id + '-' + i
elt.setAttribute('role', 'option')
if (cur.render) cur.render(elt, data, cur)
else elt.appendChild(ownerDocument.createTextNode(cur.displayText || getText(cur)))
elt.hintId = i
var completions = data.list;
for (var i = 0; i < completions.length; ++i) {
var elt = hints.appendChild(ownerDocument.createElement("li")), cur = completions[i];
var className = HINT_ELEMENT_CLASS + (i != this.selectedHint ? "" : " " + ACTIVE_HINT_ELEMENT_CLASS);
if (cur.className != null) className = cur.className + " " + className;
elt.className = className;
if (i == this.selectedHint) elt.setAttribute("aria-selected", "true")
elt.id = this.id + "-" + i
elt.setAttribute("role", "option")
if (cur.render) cur.render(elt, data, cur);
else elt.appendChild(ownerDocument.createTextNode(cur.displayText || getText(cur)));
elt.hintId = i;
}
const container = completion.options.container || ownerDocument.body
let pos = cm.cursorCoords(completion.options.alignWithWord ? data.from : null)
let left = pos.left; let top = pos.bottom; let below = true
let offsetLeft = 0; let offsetTop = 0
var container = completion.options.container || ownerDocument.body;
var pos = cm.cursorCoords(completion.options.alignWithWord ? data.from : null);
var left = pos.left, top = pos.bottom, below = true;
var offsetLeft = 0, offsetTop = 0;
if (container !== ownerDocument.body) {
// We offset the cursor position because left and top are relative to the offsetParent's top left corner.
const isContainerPositioned = ['absolute', 'relative', 'fixed'].indexOf(parentWindow.getComputedStyle(container).position) !== -1
const offsetParent = isContainerPositioned ? container : container.offsetParent
const offsetParentPosition = offsetParent.getBoundingClientRect()
const bodyPosition = ownerDocument.body.getBoundingClientRect()
offsetLeft = (offsetParentPosition.left - bodyPosition.left - offsetParent.scrollLeft)
offsetTop = (offsetParentPosition.top - bodyPosition.top - offsetParent.scrollTop)
var isContainerPositioned = ['absolute', 'relative', 'fixed'].indexOf(parentWindow.getComputedStyle(container).position) !== -1;
var offsetParent = isContainerPositioned ? container : container.offsetParent;
var offsetParentPosition = offsetParent.getBoundingClientRect();
var bodyPosition = ownerDocument.body.getBoundingClientRect();
offsetLeft = (offsetParentPosition.left - bodyPosition.left - offsetParent.scrollLeft);
offsetTop = (offsetParentPosition.top - bodyPosition.top - offsetParent.scrollTop);
}
hints.style.left = (left - offsetLeft) + 'px'
hints.style.top = (top - offsetTop) + 'px'
hints.style.left = (left - offsetLeft) + "px";
hints.style.top = (top - offsetTop) + "px";
// todo 隐藏codemirror自带的提示
hints.style.display = 'none'
// If we're at the edge of the screen, then we want the menu to appear on the left of the cursor.
const winW = parentWindow.innerWidth || Math.max(ownerDocument.body.offsetWidth, ownerDocument.documentElement.offsetWidth)
const winH = parentWindow.innerHeight || Math.max(ownerDocument.body.offsetHeight, ownerDocument.documentElement.offsetHeight)
// 在这里 添加的DOM 元素 -- 该方案 实现复杂算了吧
container.appendChild(hints)
// debugger
// $(container).append(
// `
// <div>
// <h1>hahah</h1>
// ${ hints }
// </div>
// `
// )
cm.getInputField().setAttribute('aria-autocomplete', 'list')
cm.getInputField().setAttribute('aria-owns', this.id)
cm.getInputField().setAttribute('aria-activedescendant', this.id + '-' + this.selectedHint)
var winW = parentWindow.innerWidth || Math.max(ownerDocument.body.offsetWidth, ownerDocument.documentElement.offsetWidth);
var winH = parentWindow.innerHeight || Math.max(ownerDocument.body.offsetHeight, ownerDocument.documentElement.offsetHeight);
//在这里 添加的DOM 元素 -- 该方案 实现复杂算了吧
container.appendChild(hints);
// debugger
// $(container).append(
// `
// <div>
// <h1>hahah</h1>
// ${ hints }
// </div>
// `
// )
cm.getInputField().setAttribute("aria-autocomplete", "list")
cm.getInputField().setAttribute("aria-owns", this.id)
cm.getInputField().setAttribute("aria-activedescendant", this.id + "-" + this.selectedHint)
let box = completion.options.moveOnOverlap ? hints.getBoundingClientRect() : new DOMRect()
const scrolls = completion.options.paddingForScrollbar ? hints.scrollHeight > hints.clientHeight + 1 : false
var box = completion.options.moveOnOverlap ? hints.getBoundingClientRect() : new DOMRect();
var scrolls = completion.options.paddingForScrollbar ? hints.scrollHeight > hints.clientHeight + 1 : false;
// Compute in the timeout to avoid reflow on init
let startScroll
var startScroll;
setTimeout(function () {
startScroll = cm.getScrollInfo()
})
startScroll = cm.getScrollInfo();
});
const overlapY = box.bottom - winH
var overlapY = box.bottom - winH;
if (overlapY > 0) {
const height = box.bottom - box.top; const curTop = pos.top - (pos.bottom - box.top)
var height = box.bottom - box.top, curTop = pos.top - (pos.bottom - box.top);
if (curTop - height > 0) { // Fits above cursor
hints.style.top = (top = pos.top - height - offsetTop) + 'px'
below = false
hints.style.top = (top = pos.top - height - offsetTop) + "px";
below = false;
} else if (height > winH) {
hints.style.height = (winH - 5) + 'px'
hints.style.top = (top = pos.bottom - box.top - offsetTop) + 'px'
const cursor = cm.getCursor()
hints.style.height = (winH - 5) + "px";
hints.style.top = (top = pos.bottom - box.top - offsetTop) + "px";
var cursor = cm.getCursor();
if (data.from.ch != cursor.ch) {
pos = cm.cursorCoords(cursor)
hints.style.left = (left = pos.left - offsetLeft) + 'px'
box = hints.getBoundingClientRect()
pos = cm.cursorCoords(cursor);
hints.style.left = (left = pos.left - offsetLeft) + "px";
box = hints.getBoundingClientRect();
}
}
}
let overlapX = box.right - winW
if (scrolls) overlapX += cm.display.nativeBarWidth
var overlapX = box.right - winW;
if (scrolls) overlapX += cm.display.nativeBarWidth;
if (overlapX > 0) {
if (box.right - box.left > winW) {
hints.style.width = (winW - 5) + 'px'
overlapX -= (box.right - box.left) - winW
hints.style.width = (winW - 5) + "px";
overlapX -= (box.right - box.left) - winW;
}
hints.style.left = (left = Math.max(pos.left - overlapX - offsetLeft, 0)) + 'px'
}
if (scrolls) {
for (let node = hints.firstChild; node; node = node.nextSibling) { node.style.paddingRight = cm.display.nativeBarWidth + 'px' }
hints.style.left = (left = Math.max(pos.left - overlapX - offsetLeft, 0)) + "px";
}
if (scrolls) for (var node = hints.firstChild; node; node = node.nextSibling)
node.style.paddingRight = cm.display.nativeBarWidth + "px"
// debugger
cm.addKeyMap(this.keyMap = buildKeyMap(completion, {
moveFocus: function (n, avoidWrap) {
widget.changeActive(widget.selectedHint + n, avoidWrap)
widget.changeActive(widget.selectedHint + n, avoidWrap);
},
setFocus: function (n) {
widget.changeActive(n)
widget.changeActive(n);
},
menuSize: function () {
return widget.screenAmount()
return widget.screenAmount();
},
length: completions.length,
close: function () {
completion.close()
completion.close();
},
pick: function () {
widget.pick()
widget.pick();
},
data: data
}))
}));
if (completion.options.closeOnUnfocus) {
let closingOnBlur
cm.on('blur', this.onBlur = function () {
var closingOnBlur;
cm.on("blur", this.onBlur = function () {
closingOnBlur = setTimeout(function () {
completion.close()
}, 100)
})
cm.on('focus', this.onFocus = function () {
clearTimeout(closingOnBlur)
})
completion.close();
}, 100);
});
cm.on("focus", this.onFocus = function () {
clearTimeout(closingOnBlur);
});
}
cm.on('scroll', this.onScroll = function () {
const curScroll = cm.getScrollInfo(); const editor = cm.getWrapperElement().getBoundingClientRect()
if (!startScroll) startScroll = cm.getScrollInfo()
const newTop = top + startScroll.top - curScroll.top
let point = newTop - (parentWindow.pageYOffset || (ownerDocument.documentElement || ownerDocument.body).scrollTop)
if (!below) point += hints.offsetHeight
if (point <= editor.top || point >= editor.bottom) return completion.close()
hints.style.top = newTop + 'px'
hints.style.left = (left + startScroll.left - curScroll.left) + 'px'
})
cm.on("scroll", this.onScroll = function () {
var curScroll = cm.getScrollInfo(), editor = cm.getWrapperElement().getBoundingClientRect();
if (!startScroll) startScroll = cm.getScrollInfo();
var newTop = top + startScroll.top - curScroll.top;
var point = newTop - (parentWindow.pageYOffset || (ownerDocument.documentElement || ownerDocument.body).scrollTop);
if (!below) point += hints.offsetHeight;
if (point <= editor.top || point >= editor.bottom) return completion.close();
hints.style.top = newTop + "px";
hints.style.left = (left + startScroll.left - curScroll.left) + "px";
});
CodeMirror.on(hints, 'dblclick', function (e) {
const t = getHintElement(hints, e.target || e.srcElement)
CodeMirror.on(hints, "dblclick", function (e) {
var t = getHintElement(hints, e.target || e.srcElement);
if (t && t.hintId != null) {
widget.changeActive(t.hintId)
widget.pick()
widget.changeActive(t.hintId);
widget.pick();
}
})
});
CodeMirror.on(hints, 'click', function (e) {
const t = getHintElement(hints, e.target || e.srcElement)
CodeMirror.on(hints, "click", function (e) {
var t = getHintElement(hints, e.target || e.srcElement);
if (t && t.hintId != null) {
widget.changeActive(t.hintId)
if (completion.options.completeOnSingleClick) widget.pick()
widget.changeActive(t.hintId);
if (completion.options.completeOnSingleClick) widget.pick();
}
})
});
CodeMirror.on(hints, 'mousedown', function () {
CodeMirror.on(hints, "mousedown", function () {
setTimeout(function () {
cm.focus()
}, 20)
})
cm.focus();
}, 20);
});
// The first hint doesn't need to be scrolled to on init
const selectedHintRange = this.getSelectedHintRange()
var selectedHintRange = this.getSelectedHintRange();
if (selectedHintRange.from !== 0 || selectedHintRange.to !== 0) {
this.scrollToActive()
this.scrollToActive();
}
CodeMirror.signal(data, 'select', completions[this.selectedHint], hints.childNodes[this.selectedHint])
return true
CodeMirror.signal(data, "select", completions[this.selectedHint], hints.childNodes[this.selectedHint]);
return true;
}
Widget.prototype = {
close: function () {
if (this.completion.widget != this) return
this.completion.widget = null
if (this.hints.parentNode) this.hints.parentNode.removeChild(this.hints)
this.completion.cm.removeKeyMap(this.keyMap)
const input = this.completion.cm.getInputField()
input.removeAttribute('aria-activedescendant')
input.removeAttribute('aria-owns')
if (this.completion.widget != this) return;
this.completion.widget = null;
if (this.hints.parentNode) this.hints.parentNode.removeChild(this.hints);
this.completion.cm.removeKeyMap(this.keyMap);
var input = this.completion.cm.getInputField()
input.removeAttribute("aria-activedescendant")
input.removeAttribute("aria-owns")
const cm = this.completion.cm
var cm = this.completion.cm;
if (this.completion.options.closeOnUnfocus) {
cm.off('blur', this.onBlur)
cm.off('focus', this.onFocus)
cm.off("blur", this.onBlur);
cm.off("focus", this.onFocus);
}
cm.off('scroll', this.onScroll)
cm.off("scroll", this.onScroll);
},
disable: function () {
this.completion.cm.removeKeyMap(this.keyMap)
const widget = this
this.completion.cm.removeKeyMap(this.keyMap);
var widget = this;
this.keyMap = {
Enter: function () {
widget.picked = true
widget.picked = true;
}
}
this.completion.cm.addKeyMap(this.keyMap)
};
this.completion.cm.addKeyMap(this.keyMap);
},
pick: function () {
this.completion.pick(this.data, this.selectedHint)
this.completion.pick(this.data, this.selectedHint);
},
changeActive: function (i, avoidWrap) {
if (i >= this.data.list.length) { i = avoidWrap ? this.data.list.length - 1 : 0 } else if (i < 0) { i = avoidWrap ? 0 : this.data.list.length - 1 }
if (this.selectedHint == i) return
let node = this.hints.childNodes[this.selectedHint]
if (i >= this.data.list.length)
i = avoidWrap ? this.data.list.length - 1 : 0;
else if (i < 0)
i = avoidWrap ? 0 : this.data.list.length - 1;
if (this.selectedHint == i) return;
var node = this.hints.childNodes[this.selectedHint];
if (node) {
node.className = node.className.replace(' ' + ACTIVE_HINT_ELEMENT_CLASS, '')
node.removeAttribute('aria-selected')
node.className = node.className.replace(" " + ACTIVE_HINT_ELEMENT_CLASS, "");
node.removeAttribute("aria-selected")
}
node = this.hints.childNodes[this.selectedHint = i]
node.className += ' ' + ACTIVE_HINT_ELEMENT_CLASS
node.setAttribute('aria-selected', 'true')
this.completion.cm.getInputField().setAttribute('aria-activedescendant', node.id)
node = this.hints.childNodes[this.selectedHint = i];
node.className += " " + ACTIVE_HINT_ELEMENT_CLASS;
node.setAttribute("aria-selected", "true")
this.completion.cm.getInputField().setAttribute("aria-activedescendant", node.id)
this.scrollToActive()
CodeMirror.signal(this.data, 'select', this.data.list[this.selectedHint], node)
CodeMirror.signal(this.data, "select", this.data.list[this.selectedHint], node);
},
scrollToActive: function () {
const selectedHintRange = this.getSelectedHintRange()
const node1 = this.hints.childNodes[selectedHintRange.from]
const node2 = this.hints.childNodes[selectedHintRange.to]
const firstNode = this.hints.firstChild
if (node1.offsetTop < this.hints.scrollTop) { this.hints.scrollTop = node1.offsetTop - firstNode.offsetTop } else if (node2.offsetTop + node2.offsetHeight > this.hints.scrollTop + this.hints.clientHeight) { this.hints.scrollTop = node2.offsetTop + node2.offsetHeight - this.hints.clientHeight + firstNode.offsetTop }
var selectedHintRange = this.getSelectedHintRange();
var node1 = this.hints.childNodes[selectedHintRange.from];
var node2 = this.hints.childNodes[selectedHintRange.to];
var firstNode = this.hints.firstChild;
if (node1.offsetTop < this.hints.scrollTop)
this.hints.scrollTop = node1.offsetTop - firstNode.offsetTop;
else if (node2.offsetTop + node2.offsetHeight > this.hints.scrollTop + this.hints.clientHeight)
this.hints.scrollTop = node2.offsetTop + node2.offsetHeight - this.hints.clientHeight + firstNode.offsetTop;
},
screenAmount: function () {
return Math.floor(this.hints.clientHeight / this.hints.firstChild.offsetHeight) || 1
return Math.floor(this.hints.clientHeight / this.hints.firstChild.offsetHeight) || 1;
},
getSelectedHintRange: function () {
const margin = this.completion.options.scrollMargin || 0
var margin = this.completion.options.scrollMargin || 0;
return {
from: Math.max(0, this.selectedHint - margin),
to: Math.min(this.data.list.length - 1, this.selectedHint + margin)
}
to: Math.min(this.data.list.length - 1, this.selectedHint + margin),
};
}
}
};
function applicableHelpers (cm, helpers) {
function applicableHelpers(cm, helpers) {
if (!cm.somethingSelected()) return helpers
const result = []
for (let i = 0; i < helpers.length; i++) { if (helpers[i].supportsSelection) result.push(helpers[i]) }
var result = []
for (var i = 0; i < helpers.length; i++)
if (helpers[i].supportsSelection) result.push(helpers[i])
return result
}
function fetchHints (hint, cm, options, callback) {
function fetchHints(hint, cm, options, callback) {
if (hint.async) {
hint(cm, callback, options)
} else {
const result = hint(cm, options)
var result = hint(cm, options)
if (result && result.then) result.then(callback)
else callback(result)
}
}
function resolveAutoHints (cm, pos) {
const helpers = cm.getHelpers(pos, 'hint'); let words
function resolveAutoHints(cm, pos) {
var helpers = cm.getHelpers(pos, "hint"), words
if (helpers.length) {
const resolved = function (cm, callback, options) {
const app = applicableHelpers(cm, helpers)
var resolved = function (cm, callback, options) {
var app = applicableHelpers(cm, helpers);
function run (i) {
function run(i) {
if (i == app.length) return callback(null)
fetchHints(app[i], cm, options, function (result) {
if (result && result.list.length > 0) callback(result)
@@ -528,9 +532,9 @@ export default function showHint (CodeMirror) {
resolved.async = true
resolved.supportsSelection = true
return resolved
} else if (words = cm.getHelper(cm.getCursor(), 'hintWords')) {
} else if (words = cm.getHelper(cm.getCursor(), "hintWords")) {
return function (cm) {
return CodeMirror.hint.fromList(cm, { words: words })
return CodeMirror.hint.fromList(cm, {words: words})
}
} else if (CodeMirror.hint.anyword) {
return function (cm, options) {
@@ -542,29 +546,30 @@ export default function showHint (CodeMirror) {
}
}
CodeMirror.registerHelper('hint', 'auto', {
CodeMirror.registerHelper("hint", "auto", {
resolve: resolveAutoHints
})
});
CodeMirror.registerHelper('hint', 'fromList', function (cm, options) {
const cur = cm.getCursor(); const token = cm.getTokenAt(cur)
let term; let from = CodeMirror.Pos(cur.line, token.start); const to = cur
CodeMirror.registerHelper("hint", "fromList", function (cm, options) {
var cur = cm.getCursor(), token = cm.getTokenAt(cur)
var term, from = CodeMirror.Pos(cur.line, token.start), to = cur
if (token.start < cur.ch && /\w/.test(token.string.charAt(cur.ch - token.start - 1))) {
term = token.string.substr(0, cur.ch - token.start)
} else {
term = ''
term = ""
from = cur
}
const found = []
for (let i = 0; i < options.words.length; i++) {
const word = options.words[i]
if (word.slice(0, term.length) == term) { found.push(word) }
var found = [];
for (var i = 0; i < options.words.length; i++) {
var word = options.words[i];
if (word.slice(0, term.length) == term)
found.push(word);
}
if (found.length) return { list: found, from: from, to: to }
})
if (found.length) return {list: found, from: from, to: to};
});
CodeMirror.commands.autocomplete = CodeMirror.showHint
CodeMirror.commands.autocomplete = CodeMirror.showHint;
var defaultOptions = {
hint: CodeMirror.hint.auto,
@@ -579,8 +584,8 @@ export default function showHint (CodeMirror) {
customKeys: null,
extraKeys: null,
paddingForScrollbar: true,
moveOnOverlap: true
}
moveOnOverlap: true,
};
CodeMirror.defineOption('hintOptions', null)
CodeMirror.defineOption("hintOptions", null);
}

View File

@@ -1,336 +1,343 @@
import { cloneDeep } from 'lodash'
import { matchMain } from './matchRelatedInfo'
import {cloneDeep} from 'lodash'
import {matchMain} from './matchRelatedInfo'
export default function (CodeMirror,
{
dataset,
hinthook, // 生成提示的hook 拦截
keywordshook // 关键字hook 在关键字里面
}
{
dataset,
hinthook, //生成提示的hook 拦截
keywordshook //关键字hook 在关键字里面
}
) {
// "use strict";
let tables
let defaultTable
let keywords
let identifierQuote
const CONS = {
QUERY_DIV: ';',
ALIAS_KEYWORD: 'AS'
}
const Pos = CodeMirror.Pos; const cmpPos = CodeMirror.cmpPos
var tables;
var defaultTable;
var keywords;
var identifierQuote;
var CONS = {
QUERY_DIV: ";",
ALIAS_KEYWORD: "AS"
};
var Pos = CodeMirror.Pos, cmpPos = CodeMirror.cmpPos;
function isArray (val) {
return Object.prototype.toString.call(val) == '[object Array]'
function isArray(val) {
return Object.prototype.toString.call(val) == "[object Array]"
}
function getKeywords (editor) {
let mode = editor.doc.modeOption
if (mode === 'sql') mode = 'text/x-sql'
keywords = CodeMirror.resolveMode(mode).keywords
function getKeywords(editor) {
var mode = editor.doc.modeOption;
if (mode === "sql") mode = "text/x-sql";
keywords = CodeMirror.resolveMode(mode).keywords;
if (keywordshook) {
keywords = keywordshook(keywords, CodeMirror.resolveMode(mode)) || keywords
}
return keywords
}
function getIdentifierQuote (editor) {
let mode = editor.doc.modeOption
if (mode === 'sql') mode = 'text/x-sql'
return CodeMirror.resolveMode(mode).identifierQuote || '`'
function getIdentifierQuote(editor) {
var mode = editor.doc.modeOption;
if (mode === "sql") mode = "text/x-sql";
return CodeMirror.resolveMode(mode).identifierQuote || "`";
}
function getText (item) {
return typeof item == 'string' ? item : item.text
function getText(item) {
return typeof item == "string" ? item : item.text;
}
function wrapTable (name, value) {
if (isArray(value)) value = { columns: value }
function wrapTable(name, value) {
if (isArray(value)) value = {columns: value}
if (!value.text) value.text = name
return value
}
function parseTables (input) {
// table 名称变大写 统一变成对象格式 columns text
const result = {}
function parseTables(input) {
//table 名称变大写 统一变成对象格式 columns text
var result = {}
if (isArray(input)) {
for (let i = input.length - 1; i >= 0; i--) {
const item = input[i]
for (var i = input.length - 1; i >= 0; i--) {
var item = input[i]
result[getText(item).toUpperCase()] = wrapTable(getText(item), item)
}
} else if (input) {
for (const name in input) { result[name.toUpperCase()] = wrapTable(name, input[name]) }
for (var name in input)
result[name.toUpperCase()] = wrapTable(name, input[name])
}
return result
}
function getTable (name) {
function getTable(name) {
return tables[name.toUpperCase()]
}
function shallowClone (object) {
const result = {}
for (const key in object) {
if (object.hasOwnProperty(key)) { result[key] = object[key] }
}
return result
function shallowClone(object) {
var result = {};
for (var key in object) if (object.hasOwnProperty(key))
result[key] = object[key];
return result;
}
function match (string, word) {
const len = string.length
const sub = getText(word).substr(0, len)
return string.toUpperCase() === sub.toUpperCase()
function match(string, word) {
var len = string.length;
var sub = getText(word).substr(0, len);
return string.toUpperCase() === sub.toUpperCase();
}
function addMatches (result, search, wordlist, formatter) {
function addMatches(result, search, wordlist, formatter) {
if (isArray(wordlist)) {
for (let i = 0; i < wordlist.length; i++) { if (match(search, wordlist[i])) result.push(formatter(wordlist[i])) }
for (var i = 0; i < wordlist.length; i++)
if (match(search, wordlist[i])) result.push(formatter(wordlist[i]))
} else {
for (const word in wordlist) {
if (wordlist.hasOwnProperty(word)) {
let val = wordlist[word]
if (!val || val === true) { val = word } else { val = val.displayText ? { text: val.text, displayText: val.displayText } : val.text }
if (match(search, val)) result.push(formatter(val))
}
for (var word in wordlist) if (wordlist.hasOwnProperty(word)) {
var val = wordlist[word]
if (!val || val === true)
val = word
else
val = val.displayText ? {text: val.text, displayText: val.displayText} : val.text
if (match(search, val)) result.push(formatter(val))
}
}
}
function cleanName (name) {
function cleanName(name) {
// Get rid name from identifierQuote and preceding dot(.)
if (name.charAt(0) == '.') {
name = name.substr(1)
if (name.charAt(0) == ".") {
name = name.substr(1);
}
// replace duplicated identifierQuotes with single identifierQuotes
// and remove single identifierQuotes
const nameParts = name.split(identifierQuote + identifierQuote)
for (let i = 0; i < nameParts.length; i++) { nameParts[i] = nameParts[i].replace(new RegExp(identifierQuote, 'g'), '') }
return nameParts.join(identifierQuote)
var nameParts = name.split(identifierQuote + identifierQuote);
for (var i = 0; i < nameParts.length; i++)
nameParts[i] = nameParts[i].replace(new RegExp(identifierQuote, "g"), "");
return nameParts.join(identifierQuote);
}
function insertIdentifierQuotes (name) {
const nameParts = getText(name).split('.')
for (let i = 0; i < nameParts.length; i++) {
function insertIdentifierQuotes(name) {
var nameParts = getText(name).split(".");
for (var i = 0; i < nameParts.length; i++)
nameParts[i] = identifierQuote +
// duplicate identifierQuotes
nameParts[i].replace(new RegExp(identifierQuote, 'g'), identifierQuote + identifierQuote) +
identifierQuote
}
const escaped = nameParts.join('.')
if (typeof name == 'string') return escaped
name = shallowClone(name)
name.text = escaped
return name
nameParts[i].replace(new RegExp(identifierQuote, "g"), identifierQuote + identifierQuote) +
identifierQuote;
var escaped = nameParts.join(".");
if (typeof name == "string") return escaped;
name = shallowClone(name);
name.text = escaped;
return name;
}
function getLeftpart (cur, token, result, editor) {
const nameParts = []
let start = token.start
let cont = true
function getLeftpart(cur, token, result, editor) {
var nameParts = [];
var start = token.start;
var cont = true;
while (cont) {
// 全是空格 或者 是操作符 就接着往前找
cont = ((token.type === 'operator' || token.string.match(/^[ ]*$/)) && start !== 0)
start = token.start
nameParts.unshift(token.string)
token = editor.getTokenAt(Pos(cur.line, token.start))
//全是空格 或者 是操作符 就接着往前找
cont = ((token.type === 'operator' || token.string.match(/^[ ]*$/)) && start !== 0);
start = token.start;
nameParts.unshift(token.string);
token = editor.getTokenAt(Pos(cur.line, token.start));
if (token.type === 'operator') {
cont = true
token = editor.getTokenAt(Pos(cur.line, token.start))
cont = true;
token = editor.getTokenAt(Pos(cur.line, token.start));
}
}
return nameParts[0]
}
function isRightpart (cur, token, result, editor) {
token = editor.getTokenAt(Pos(cur.line, token.start))
function isRightpart(cur, token, result, editor) {
token = editor.getTokenAt(Pos(cur.line, token.start));
return token.type === 'operator'
}
function nameCompletion (cur, token, result, editor) {
function nameCompletion(cur, token, result, editor) {
// Try to complete table, column names and return start position of completion
let useIdentifierQuotes = false
const nameParts = []
let start = token.start
let cont = true
var useIdentifierQuotes = false;
var nameParts = [];
var start = token.start;
var cont = true;
while (cont) {
cont = (token.string.charAt(0) == '.')
useIdentifierQuotes = useIdentifierQuotes || (token.string.charAt(0) == identifierQuote)
cont = (token.string.charAt(0) == ".");
useIdentifierQuotes = useIdentifierQuotes || (token.string.charAt(0) == identifierQuote);
start = token.start
nameParts.unshift(cleanName(token.string))
start = token.start;
nameParts.unshift(cleanName(token.string));
token = editor.getTokenAt(Pos(cur.line, token.start))
if (token.string == '.') {
cont = true
token = editor.getTokenAt(Pos(cur.line, token.start))
token = editor.getTokenAt(Pos(cur.line, token.start));
if (token.string == ".") {
cont = true;
token = editor.getTokenAt(Pos(cur.line, token.start));
}
}
// Try to complete table names
let string = nameParts.join('.')
var string = nameParts.join(".");
addMatches(result, string, tables, function (w) {
return useIdentifierQuotes ? insertIdentifierQuotes(w) : w
})
return useIdentifierQuotes ? insertIdentifierQuotes(w) : w;
});
// Try to complete columns from defaultTable
addMatches(result, string, defaultTable, function (w) {
return useIdentifierQuotes ? insertIdentifierQuotes(w) : w
})
return useIdentifierQuotes ? insertIdentifierQuotes(w) : w;
});
// Try to complete columns
string = nameParts.pop()
let table = nameParts.join('.')
string = nameParts.pop();
var table = nameParts.join(".");
let alias = false
const aliasTable = table
var alias = false;
var aliasTable = table;
// Check if table is available. If not, find table by Alias
if (!getTable(table)) {
const oldTable = table
table = findTableByAlias(table, editor)
if (table !== oldTable) alias = true
var oldTable = table;
table = findTableByAlias(table, editor);
if (table !== oldTable) alias = true;
}
let columns = getTable(table)
if (columns && columns.columns) { columns = columns.columns }
var columns = getTable(table);
if (columns && columns.columns)
columns = columns.columns;
if (columns) {
addMatches(result, string, columns, function (w) {
let tableInsert = table
if (alias == true) tableInsert = aliasTable
if (typeof w == 'string') {
w = tableInsert + '.' + w
var tableInsert = table;
if (alias == true) tableInsert = aliasTable;
if (typeof w == "string") {
w = tableInsert + "." + w;
} else {
w = shallowClone(w)
w.text = tableInsert + '.' + w.text
w = shallowClone(w);
w.text = tableInsert + "." + w.text;
}
return useIdentifierQuotes ? insertIdentifierQuotes(w) : w
})
return useIdentifierQuotes ? insertIdentifierQuotes(w) : w;
});
}
return start
return start;
}
function eachWord (lineText, f) {
const words = lineText.split(/\s+/)
for (let i = 0; i < words.length; i++) { if (words[i]) f(words[i].replace(/[`,;]/g, '')) }
function eachWord(lineText, f) {
var words = lineText.split(/\s+/)
for (var i = 0; i < words.length; i++)
if (words[i]) f(words[i].replace(/[`,;]/g, ''))
}
function findTableByAlias (alias, editor) {
const doc = editor.doc
const fullQuery = doc.getValue()
const aliasUpperCase = alias.toUpperCase()
let previousWord = ''
let table = ''
const separator = []
let validRange = {
function findTableByAlias(alias, editor) {
var doc = editor.doc;
var fullQuery = doc.getValue();
var aliasUpperCase = alias.toUpperCase();
var previousWord = "";
var table = "";
var separator = [];
var validRange = {
start: Pos(0, 0),
end: Pos(editor.lastLine(), editor.getLineHandle(editor.lastLine()).length)
}
};
// add separator
let indexOfSeparator = fullQuery.indexOf(CONS.QUERY_DIV)
//add separator
var indexOfSeparator = fullQuery.indexOf(CONS.QUERY_DIV);
while (indexOfSeparator != -1) {
separator.push(doc.posFromIndex(indexOfSeparator))
indexOfSeparator = fullQuery.indexOf(CONS.QUERY_DIV, indexOfSeparator + 1)
separator.push(doc.posFromIndex(indexOfSeparator));
indexOfSeparator = fullQuery.indexOf(CONS.QUERY_DIV, indexOfSeparator + 1);
}
separator.unshift(Pos(0, 0))
separator.push(Pos(editor.lastLine(), editor.getLineHandle(editor.lastLine()).text.length))
separator.unshift(Pos(0, 0));
separator.push(Pos(editor.lastLine(), editor.getLineHandle(editor.lastLine()).text.length));
// find valid range
let prevItem = null
const current = editor.getCursor()
//find valid range
var prevItem = null;
var current = editor.getCursor()
for (var i = 0; i < separator.length; i++) {
if ((prevItem == null || cmpPos(current, prevItem) > 0) && cmpPos(current, separator[i]) <= 0) {
validRange = { start: prevItem, end: separator[i] }
break
validRange = {start: prevItem, end: separator[i]};
break;
}
prevItem = separator[i]
prevItem = separator[i];
}
if (validRange.start) {
const query = doc.getRange(validRange.start, validRange.end, false)
var query = doc.getRange(validRange.start, validRange.end, false);
for (var i = 0; i < query.length; i++) {
const lineText = query[i]
var lineText = query[i];
eachWord(lineText, function (word) {
const wordUpperCase = word.toUpperCase()
if (wordUpperCase === aliasUpperCase && getTable(previousWord)) { table = previousWord }
if (wordUpperCase !== CONS.ALIAS_KEYWORD) { previousWord = word }
})
if (table) break
var wordUpperCase = word.toUpperCase();
if (wordUpperCase === aliasUpperCase && getTable(previousWord))
table = previousWord;
if (wordUpperCase !== CONS.ALIAS_KEYWORD)
previousWord = word;
});
if (table) break;
}
}
return table
return table;
}
CodeMirror.registerHelper('hint', 'sql', function (editor, options) {
tables = parseTables(options && options.tables)
const defaultTableName = options && options.defaultTable // 默认table 名称
const disableKeywords = options && options.disableKeywords // 禁用的keyword
defaultTable = defaultTableName && getTable(defaultTableName)
keywords = getKeywords(editor) // 获取 定义defineMIME 时候的关键字参数
identifierQuote = getIdentifierQuote(editor) // 获取 引用标识符
CodeMirror.registerHelper("hint", "sql", function (editor, options) {
tables = parseTables(options && options.tables);
var defaultTableName = options && options.defaultTable; //默认table 名称
var disableKeywords = options && options.disableKeywords; //禁用的keyword
defaultTable = defaultTableName && getTable(defaultTableName);
keywords = getKeywords(editor); //获取 定义defineMIME 时候的关键字参数
identifierQuote = getIdentifierQuote(editor); //获取 引用标识符
if (defaultTableName && !defaultTable) { defaultTable = findTableByAlias(defaultTableName, editor) }
if (defaultTableName && !defaultTable)
defaultTable = findTableByAlias(defaultTableName, editor);
defaultTable = defaultTable || []
defaultTable = defaultTable || [];
if (defaultTable.columns) { defaultTable = defaultTable.columns }
if (defaultTable.columns)
defaultTable = defaultTable.columns;
const cur = editor.getCursor() // line 当前行 ch 索引 sticky ??
let result = []
const token = editor.getTokenAt(cur); let start; let end; let search
var cur = editor.getCursor(); //line 当前行 ch 索引 sticky ??
var result = [];
var token = editor.getTokenAt(cur), start, end, search;
if (token.end > cur.ch) {
token.end = cur.ch
token.string = token.string.slice(0, cur.ch - token.start)
token.end = cur.ch;
token.string = token.string.slice(0, cur.ch - token.start);
}
// start end search 赋值
//start end search 赋值
// todo 此处允许字符串包含 .
// if (token.string.match(/^[.`"'\w@][\w$#]*/g)) {
if (token.string.match(/^[.`"'\w@][\w#]*/g)) {
search = token.string
start = token.start
end = token.end
search = token.string;
start = token.start;
end = token.end;
} else {
start = end = cur.ch
search = ''
start = end = cur.ch;
search = "";
}
// 对引用标识符 . 的使用,关联table 列
if (search.charAt(0) == '.' || search.charAt(0) == identifierQuote) {
start = nameCompletion(cur, token, result, editor)
//对引用标识符 . 的使用,关联table 列
if (search.charAt(0) == "." || search.charAt(0) == identifierQuote) {
start = nameCompletion(cur, token, result, editor);
} else {
const objectOrClass = function (w, className) {
if (typeof w === 'object') {
w.className = className
var objectOrClass = function (w, className) {
if (typeof w === "object") {
w.className = className;
} else {
w = { text: w, className: className }
w = {text: w, className: className};
}
return w
}
return w;
};
addMatches(result, search, defaultTable, function (w) {
return objectOrClass(w, 'CodeMirror-hint-table CodeMirror-hint-default-table')
})
return objectOrClass(w, "CodeMirror-hint-table CodeMirror-hint-default-table");
});
addMatches(
result,
search,
tables, function (w) {
return objectOrClass(w, 'CodeMirror-hint-table')
return objectOrClass(w, "CodeMirror-hint-table");
}
)
if (!disableKeywords) {
);
if (!disableKeywords)
addMatches(result, search, keywords, function (w) {
return objectOrClass(w.toUpperCase(), 'CodeMirror-hint-keyword')
})
}
return objectOrClass(w.toUpperCase(), "CodeMirror-hint-keyword");
});
}
// 写入一个 钩子,在这里决定提示的内容
//写入一个 钩子,在这里决定提示的内容
if (hinthook) {
const params = {
search, // 搜索 关键字
keywords // 关键字列表
}
var params = {
search, //搜索 关键字
keywords, //关键字列表
};
if (token.type === 'operator') {
params.leftpart = getLeftpart(cur, token, result, editor) || ''
}
@@ -340,8 +347,8 @@ export default function (CodeMirror,
/* 之后的参数 是为manualHinthook 预备的 */
const manualParams = {
search, // 搜索 关键字
var manualParams = {
search, //搜索 关键字
// keywords, //关键字列表 没啥用
from: Pos(cur.line, start),
to: Pos(cur.line, end),
@@ -353,13 +360,13 @@ export default function (CodeMirror,
cur
}
const refField = matchMain(CodeMirror, params, manualParams)
var refField = matchMain(CodeMirror, params, manualParams);
manualParams.refField = refField
manualParams.leftpart = refField?.label || manualParams.leftpart
params.leftpart = refField?.label || params.leftpart
manualParams.leftpart = refField?.label || manualParams.leftpart;
params.leftpart = refField?.label || params.leftpart;
result = hinthook(result, params, manualParams) || result
}
return { list: result, from: Pos(cur.line, start), to: Pos(cur.line, end) }
})
return {list: result, from: Pos(cur.line, start), to: Pos(cur.line, end)};
});
}

File diff suppressed because one or more lines are too long

View File

@@ -1,4 +1,4 @@
const renderData = [
var renderData = [
{
name: 'COUNT',
syntax: 'count(expr)',
@@ -34,7 +34,7 @@ const renderData = [
code: 'count(distinct client_ip)'
},
{
purpose: 'Counts the number of different "Server IP" and "Server port" :',
purpose: `Counts the number of different "Server IP" and "Server port" :`,
code: 'count(distinct server_ip, server_port)'
}
],
@@ -50,11 +50,11 @@ const renderData = [
description: 'Aggregate function is used to calculate the arithmetic mean in the specified field. EXPR must be Integer,Float or Decimal and returned value as Float.',
example: [
{
purpose: 'Calculates the average(mean) "Byte sent (sent_bytes)" field:',
purpose: `Calculates the average(mean) "Byte sent (sent_bytes)" field:`,
code: 'avg(sent_bytes)'
},
{
purpose: 'Calculates the average(mean) "Bytes" , rounded to 2 decimal points:',
purpose: `Calculates the average(mean) "Bytes" , rounded to 2 decimal points:`,
code: 'round(avg(sent_bytes+received_bytes),2)'
}
],
@@ -70,11 +70,11 @@ const renderData = [
description: 'Aggregate function is used to sum of the values of the specified field. EXPR must be Integer,Float or Decimal.',
example: [
{
purpose: 'The sum of the "Byte sent (sent_bytes)" field:',
purpose: `The sum of the "Byte sent (sent_bytes)" field:`,
code: 'sum(sent_bytes)'
},
{
purpose: 'The sum of the "sent_bytes" and "received_bytes" fields , and rename as "Bytes ":',
purpose: `The sum of the "sent_bytes" and "received_bytes" fields , and rename as "Bytes ":`,
code: 'sum(sent_bytes+received_bytes) as Bytes'
}
],
@@ -89,7 +89,7 @@ const renderData = [
description: 'Aggregate function is used to return the maximum value of the specified field.',
example: [
{
purpose: 'Returns the maximum value of the "Byte sent (sent_bytes)" field:',
purpose: `Returns the maximum value of the "Byte sent (sent_bytes)" field:`,
code: 'max(sent_bytes)'
}
],
@@ -105,7 +105,7 @@ const renderData = [
description: 'Aggregate function is used to return the minimum value of the specified field.',
example: [
{
purpose: 'Returns the minimum value of the "Byte sent (sent_bytes)" field:',
purpose: `Returns the minimum value of the "Byte sent (sent_bytes)" field:`,
code: 'min(sent_bytes)'
}
],
@@ -121,7 +121,7 @@ const renderData = [
description: 'Rounds down a timestamp, returning it as a new timestamp,optionally from some reference fill, and fills time gaps and impute missing values.',
example: [
{
purpose: 'Round the recv_time down to a 5 minutes increment and fill time gaps and impute zero value.',
purpose: `Round the recv_time down to a 5 minutes increment and fill time gaps and impute zero value.`,
code: 'TIME_FLOOR_WITH_FILL(recv_time,\'PT5M\',\'zero\')'
}
],
@@ -148,21 +148,21 @@ const renderData = [
},
{
name: 'UNIX_TIMESTAMP',
syntax: 'UNIX_TIMESTAMP(date)',
description: 'Returns a Unix timestamp the value of the argument as seconds since \'1970-01-01 00:00:00\' UTC.',
syntax: `UNIX_TIMESTAMP(date)`,
description: `Returns a Unix timestamp the value of the argument as seconds since '1970-01-01 00:00:00' UTC.`,
example: [
{
purpose: 'Specify a datetime string "2019-06-06 19:11:12", calculate the Unix timestamp:',
purpose: `Specify a datetime string "2019-06-06 19:11:12", calculate the Unix timestamp:`,
code: 'UNIX_TIMESTAMP(\'2019-06-06 19:11:12\')'
},
{
purpose: 'Specify a ISO8601 datetime string with time zone information "2019-10-12T14:20:50+08:00", calculate the Unix timestamp:',
purpose: `Specify a ISO8601 datetime string with time zone information "2019-10-12T14:20:50+08:00", calculate the Unix timestamp:`,
code: 'UNIX_TIMESTAMP(\'2019-10-12T14:20:50+08:00\')'
},
{
purpose: 'Specify a ISO8601 datetime string with UTC+0 time zone information "2019-10-12T14:20:50Z", calculate the Unix timestamp:',
purpose: `Specify a ISO8601 datetime string with UTC+0 time zone information "2019-10-12T14:20:50Z", calculate the Unix timestamp:`,
code: 'UNIX_TIMESTAMP(\'2019-10-12T14:20:50Z\')'
}
},
],
details () {
// 支持jsx 嵌套写法,万一测试要关键字加重呢
@@ -181,13 +181,13 @@ const renderData = [
},
{
name: 'FROM_UNIXTIME',
syntax: 'FROM_UNIXTIME(unix_timestamp)',
description: 'Returns a representation of unix_timestamp as a datetime or character string value. The value returned is expressed using the UTC+0 time zone.',
syntax: `FROM_UNIXTIME(unix_timestamp)`,
description: `Returns a representation of unix_timestamp as a datetime or character string value. The value returned is expressed using the UTC+0 time zone.`,
example: [
{
purpose: 'Specify a Unix Timestamp "1570881546", calculate the datetime string:',
purpose: `Specify a Unix Timestamp "1570881546", calculate the datetime string:`,
code: 'FROM_UNIXTIME(1570881546)'
}
},
],
details () {
// 支持jsx 嵌套写法,万一测试要关键字加重呢
@@ -198,10 +198,10 @@ const renderData = [
{
name: 'DATE_FORMAT',
syntax: 'DATE_FORMAT(date, format)',
description: 'Formats the date value according to the format string.',
description: `Formats the date value according to the format string.`,
example: [
{
purpose: 'Specify a Unix Timestamp "1570881546", calculate the datetime string with format "%Y-%m-%d %H:%i:%s":',
purpose: `Specify a Unix Timestamp "1570881546", calculate the datetime string with format "%Y-%m-%d %H:%i:%s":`,
code: 'DATE_FORMAT(FROM_UNIXTIME(1570881546), \'%Y-%m-%d %H:%i:%s\')'
}
],
@@ -233,21 +233,21 @@ const renderData = [
},
{
name: 'CONVERT_TZ',
syntax: 'CONVERT_TZ(dt, from_tz, to_tz)',
description: 'Converts a datetime value dt from the time zone given by from_tz to the time zone given by to_tz and returns the resulting value.',
syntax: `CONVERT_TZ(dt, from_tz, to_tz)`,
description: `Converts a datetime value dt from the time zone given by from_tz to the time zone given by to_tz and returns the resulting value.`,
example: [
{
purpose: 'Specify a datetime string "2021-11-11 00:00:00", converted from GMT(Greenwich Mean Time) to Asia/Shanghai time zone:',
purpose: `Specify a datetime string "2021-11-11 00:00:00", converted from GMT(Greenwich Mean Time) to Asia/Shanghai time zone:`,
code: 'CONVERT_TZ(\'2021-11-11 00:00:00\',\'GMT\',\'Asia/Shanghai\')'
},
{
purpose: 'Specify a Unix timestamp "1636588800", converted from GMT(Greenwich Mean Time) to Asia/Shanghai time zone:',
purpose: `Specify a Unix timestamp "1636588800", converted from GMT(Greenwich Mean Time) to Asia/Shanghai time zone:`,
code: 'CONVERT_TZ(FROM_UNIXTIME(1636588800),\'GMT\',\'Asia/Shanghai\')'
},
{
purpose: 'Specify a Unix timestamp "1636588800", converted from Europe/London to America/New_York time zone:',
purpose: `Specify a Unix timestamp "1636588800", converted from Europe/London to America/New_York time zone:`,
code: 'CONVERT_TZ(DATE_FORMAT(FROM_UNIXTIME(1636588800), \'%Y-%m-%d %H:%i:%s\'),\'Europe/London\',\'America/New_York\')'
}
},
],
details () {
// 支持jsx 嵌套写法,万一测试要关键字加重呢
@@ -263,11 +263,11 @@ const renderData = [
},
{
name: 'MEDIAN',
syntax: 'MEDIAN(<expr>)',
description: 'Aggregate function is used to calculate median value. expr must be Integer, Float or Decimal.',
syntax: `MEDIAN(<expr>)`,
description: `Aggregate function is used to calculate median value. expr must be Integer, Float or Decimal.`,
example: [
{
purpose: 'Calculates the median "TCP Handshake Latency (tcp_handshake_latency_ms)" field:',
purpose: `Calculates the median "TCP Handshake Latency (tcp_handshake_latency_ms)" field:`,
code: 'MEDIAN(tcp_handshake_latency_ms)'
}
],
@@ -279,11 +279,11 @@ const renderData = [
},
{
name: 'QUANTILE',
syntax: 'QUANTILE(<expr>[, <level>])',
description: 'Aggregate function is used to calculate an approximate quantile of a numeric data sequence.',
syntax: `QUANTILE(<expr>[, <level>])`,
description: `Aggregate function is used to calculate an approximate quantile of a numeric data sequence.`,
example: [
{
purpose: 'Calculates the 90th percentile "TCP Handshake Latency (tcp_handshake_latency_ms)" field:',
purpose: `Calculates the 90th percentile "TCP Handshake Latency (tcp_handshake_latency_ms)" field:`,
code: 'QUANTILE(tcp_handshake_latency_ms, 0.9)'
}
],
@@ -300,13 +300,13 @@ const renderData = [
</ul>
</div>
}
}
},
]
function main () {
const functionTips = {}
var functionTips = {}
renderData.forEach((item, index) => {
const data = item // 这是个闭包
var data = item // 这是个闭包
functionTips[item.name] = {
name: item.name,
syntax: item.syntax,
@@ -327,9 +327,8 @@ function main () {
})}
</ul>
<h3> Details: </h3>
{Object.prototype.toString.call(data.details) === '[object Function]'
? <renderer renderFun={data.details}></renderer>
: <p>{data.details} </p>}
{Object.prototype.toString.call(data.details) === '[object Function]' ?
<renderer renderFun={data.details}></renderer> : <p>{data.details} </p>}
</div>)
}
}
@@ -338,5 +337,5 @@ function main () {
}
export const functionList = renderData
const functionTips = main()
var functionTips = main()
export default functionTips

View File

@@ -1,37 +1,37 @@
const renderData = [
var renderData = [
{
name: 'FROM',
syntax: 'FROM [db.]table |$log_type',
syntax: `FROM [db.]table |$log_type`,
description: {
title: 'The table name of logs. If you type $log_type, the variable value is the current table name of logs.'
title: `The table name of logs. If you type $log_type, the variable value is the current table name of logs.`
}
},
{
name: 'SELECT',
syntax: 'Optional. The selected columns(also known as dimensions and metrics).',
syntax: `Optional. The selected columns(also known as dimensions and metrics).`,
description: {
title: '可选,获取列',
list: [
'aggregate_function(field) - Aggregate functions, default is count.',
'as field - Use as to specify a aliases for a field or expression.'
`aggregate_function(field) - Aggregate functions, default is count.`,
`as field - Use as to specify a aliases for a field or expression.`
]
}
},
{
name: 'GROUP BY',
syntax: 'GROUP BY <field-list>',
syntax: `GROUP BY <field-list>`,
description: {
title: 'Aggregate data. GROUP BY clause switches the SELECT query into an aggregation mode',
list: [
'The list of fields known as "grouping key", while each individual expression be referred to as a "key expression".',
'All the expressions in the SELECT, HAVING and ORDER BY , must be "key expression" or on aggregate functions.',
'The result of aggregating SELECT query will return unique values of "grouping key" in log type.'
`The list of fields known as "grouping key", while each individual expression be referred to as a "key expression".`,
`All the expressions in the SELECT, HAVING and ORDER BY , must be "key expression" or on aggregate functions.`,
`The result of aggregating SELECT query will return unique values of "grouping key" in log type.`
]
}
},
{
name: 'HAVING',
syntax: 'HAVING <expression-list>',
syntax: `HAVING <expression-list>`,
description: {
title: `Optional. HAVING clause filtering the aggregation results retrieved by GROUP BY. It is difference is that WHERE is performed before aggregation, while HAVING is performed after it.
Note: HAVING can't be performed if GROUP BY is not performed.`
@@ -39,26 +39,26 @@ const renderData = [
},
{
name: 'LIMIT',
syntax: 'LIMIT [n, ]m',
syntax: `LIMIT [n, ]m`,
description: {
title: 'Select the m rows from the aggregate results after skipping the first n rows. Default is 10 rows.'
title: `Select the m rows from the aggregate results after skipping the first n rows. Default is 10 rows.`
}
},
{
name: 'ORDER BY',
syntax: 'ORDER BY <sort-field> [ASC|DESC]',
syntax: `ORDER BY <sort-field> [ASC|DESC]`,
description: {
title: 'Sort all of the results by the specified fields.'
title: `Sort all of the results by the specified fields.`
}
},
{
name: 'WHERE',
syntax: 'where $filter [and <expression-list>]',
syntax: `where $filter [and <expression-list>]`,
description: {
title: 'Filter the data.',
title: `Filter the data.`,
list: [
'$filter - Default global filter clause. Include Time period, Vsys ID, and other expressions, etc',
'and <expression-list> - filter clauses'
`$filter - Default global filter clause. Include Time period, Vsys ID, and other expressions, etc`,
`and <expression-list> - filter clauses`
]
}
}
@@ -66,9 +66,9 @@ const renderData = [
export const sqlList = renderData
function main () {
const sqlTips = {}
var sqlTips = {}
renderData.forEach((item, index) => {
const data = item // 这是个闭包
var data = item // 这是个闭包
sqlTips[item.name] = {
name: item.name,
syntax: item.syntax,
@@ -93,5 +93,5 @@ function main () {
return sqlTips
}
const sqlTips = main()
var sqlTips = main()
export default sqlTips

View File

@@ -1,4 +1,4 @@
const renderData = [
var renderData = [
{
name: '$LOG_TYPE',
description: 'A variable is a symbolic representation of data that enables you to access a value without having to enter it manually wherever you need it. You can use $ to reference variables throughout Advanced Search. ',
@@ -34,9 +34,8 @@ function main () {
<h3> Description: </h3>
<p> {data.description}</p>
<h3> Details: </h3>
{Object.prototype.toString.call(data.details) === '[object Function]'
? <renderer renderFun={data.details}></renderer>
: <p>{data.details} </p>}
{Object.prototype.toString.call(data.details) === '[object Function]' ?
<renderer renderFun={data.details}></renderer> : <p>{data.details} </p>}
</div>)
}
}

View File

@@ -1,22 +1,22 @@
import { dataTemplate, fieldTemplate } from './template'
import {dataTemplate, fieldTemplate} from './template'
export class DeviceTag {
constructor (context, params) {
// 先从缓存获取数据
constructor(context, params) {
//先从缓存获取数据
this.queryparams = params
this.context = context
}
filterQueryData (list) {
filterQueryData(list) {
return list
}
getDataFromRemote () {
// 从 远程,也就是请求接口获取数据
getDataFromRemote() {
//从 远程,也就是请求接口获取数据
return this.context.$get('/deviceTag', this.queryparams).then((res) => {
this.context.initDataReadyCb && this.context.initDataReadyCb(res.data || null) // 组件 请求 文件成功回调
this.context.initDataReadyCb && this.context.initDataReadyCb(res.data || null); //组件 请求 文件成功回调
if (res.code === 200) {
const data = res.data && res.data.list
var data = res.data && res.data.list;
return data
} else {
// this.context.$message({
@@ -31,40 +31,40 @@ export class DeviceTag {
})
}
formatData (data) {
// 格式化 获取的数据
formatData(data) {
//格式化 获取的数据
const resultData = {
operatesList: [
{
name: 'AND',
function: 'A AND B',
type: 'abstract',
label: 'AND'
"name": "AND",
"function": "A AND B",
type: "abstract",
label: "AND"
}
],
filtersList: data ? this.filterQueryData(data.fields || []) : [],
// 操作符仓库 用于记录 类型 和 操作符之间的映射关系
//操作符仓库 用于记录 类型 和 操作符之间的映射关系
operatesDic: data ? data.doc.schema_query.references.operator || [] : [],
// operator 记录运算符的label 和 value 映射 以及操作符的使用方法
//operator 记录运算符的label 和 value 映射 以及操作符的使用方法
operatorManual: data ? data.doc.functions.operator || [] : []
}
return resultData
}
organizeData (data = []) {
const fields = []
const res = JSON.parse(JSON.stringify(dataTemplate))
if (!data) {
organizeData(data=[]) {
var fields = []
var res = JSON.parse(JSON.stringify(dataTemplate));
if (!data ) {
return
}
data.forEach((item, index) => {
const fieldItem = JSON.parse(JSON.stringify(fieldTemplate))
var fieldItem = JSON.parse(JSON.stringify(fieldTemplate));
fieldItem.name = item.tagValue
fieldItem.type = 'Array'
fieldItem.type = "Array"
fieldItem.label = item.tagName
fieldItem.doc.data = (item.subTags || []).map(tagItem => {
return {
code: `'${tagItem.tagValue}'`, // 匹配SQL 的时候,这个Code 要加 ''
code: `'${tagItem.tagValue}'`, //匹配SQL 的时候,这个Code 要加 ''
value: tagItem.tagName,
type: tagItem.tagType
}
@@ -75,20 +75,20 @@ export class DeviceTag {
return res
}
getFormatedData (callback) {
getFormatedData(callback) {
this.getDataFromRemote().then(data => {
// 组织数据 模拟scama
const organizedData = this.organizeData(data)
// 格式化数据
//组织数据 模拟scama
var organizedData = this.organizeData(data);
//格式化数据
this.data = this.formatData(organizedData)
// 获取scameData的时候 查询映射字段
//获取scameData的时候 查询映射字段
callback && callback(this.data)
})
}
dispose () {
this.context = null
this.queryparams = null
this.data = null
dispose(){
this.context=null
this.queryparams=null
this.data=null
}
}

View File

@@ -1,156 +1,156 @@
export const dataTemplate = {
doc: {
functions: {
aggregation: [
"doc": {
"functions": {
"aggregation": [
{
name: 'COUNT',
function: 'count(expr)',
label: 'COUNT'
"name": "COUNT",
"function": "count(expr)",
"label": "COUNT"
}, {
name: 'COUNT_DISTINCT',
function: 'count(distinct expr)',
label: 'COUNT_DISTINCT'
"name": "COUNT_DISTINCT",
"function": "count(distinct expr)",
"label": "COUNT_DISTINCT"
}, {
name: 'AVG',
function: 'avg(expr)',
label: 'AVG'
"name": "AVG",
"function": "avg(expr)",
"label": "AVG"
}, {
name: 'SUM',
function: 'sum(expr)',
label: 'SUM'
"name": "SUM",
"function": "sum(expr)",
"label": "SUM"
}, {
name: 'MAX',
function: 'max(expr)',
label: 'MAX'
"name": "MAX",
"function": "max(expr)",
"label": "MAX"
}, {
name: 'MIN',
function: 'min(expr)',
label: 'MIN'
"name": "MIN",
"function": "min(expr)",
"label": "MIN"
}],
operator: [
"operator": [
{
name: '=',
function: 'expr = value',
label: '='
"name": "=",
"function": "expr = value",
"label": "="
}, {
name: '!=',
function: 'expr != value',
label: '!='
"name": "!=",
"function": "expr != value",
"label": "!="
}, {
name: '>',
function: 'expr > value',
label: '>'
"name": ">",
"function": "expr > value",
"label": ">"
}, {
name: '<',
function: 'expr < value',
label: '<'
"name": "<",
"function": "expr < value",
"label": "<"
}, {
name: '>=',
function: 'expr >= value',
label: '>='
"name": ">=",
"function": "expr >= value",
"label": ">="
}, {
name: '<=',
function: 'expr <= value',
label: '<='
"name": "<=",
"function": "expr <= value",
"label": "<="
}, {
name: 'has',
function: 'has(expr, value)',
label: 'HAS'
"name": "has",
"function": "has(expr, value)",
"label": "HAS"
}, {
name: 'in',
function: 'expr in (values)',
label: 'IN'
"name": "in",
"function": "expr in (values)",
"label": "IN"
}, {
name: 'not in',
function: 'expr not in (values)',
label: 'NOT IN'
"name": "not in",
"function": "expr not in (values)",
"label": "NOT IN"
}, {
name: 'like',
function: 'expr like value',
label: 'LIKE'
"name": "like",
"function": "expr like value",
"label": "LIKE"
}, {
name: 'not like',
function: 'expr not like value',
label: 'NOT LIKE'
"name": "not like",
"function": "expr not like value",
"label": "NOT LIKE"
}, {
name: 'notEmpty',
function: 'notEmpty(expr)',
label: 'NOT EMPTY'
"name": "notEmpty",
"function": "notEmpty(expr)",
"label": "NOT EMPTY"
}, {
name: 'empty',
function: 'empty(expr)',
label: 'EMPTY'
"name": "empty",
"function": "empty(expr)",
"label": "EMPTY"
}]
},
schema_query: {
references: {
aggregation: [
"schema_query": {
"references": {
"aggregation": [
{
type: 'int',
functions: 'COUNT,COUNT_DISTINCT,AVG,SUM,MAX,MIN'
"type": "int",
"functions": "COUNT,COUNT_DISTINCT,AVG,SUM,MAX,MIN"
}, {
type: 'long',
functions: 'COUNT,COUNT_DISTINCT,AVG,SUM,MAX,MIN'
"type": "long",
"functions": "COUNT,COUNT_DISTINCT,AVG,SUM,MAX,MIN"
}, {
type: 'float',
functions: 'COUNT,COUNT_DISTINCT,AVG,SUM,MAX,MIN'
"type": "float",
"functions": "COUNT,COUNT_DISTINCT,AVG,SUM,MAX,MIN"
}, {
type: 'double',
functions: 'COUNT,COUNT_DISTINCT,AVG,SUM,MAX,MIN'
"type": "double",
"functions": "COUNT,COUNT_DISTINCT,AVG,SUM,MAX,MIN"
}, {
type: 'string',
functions: 'COUNT,COUNT_DISTINCT'
"type": "string",
"functions": "COUNT,COUNT_DISTINCT"
}, {
type: 'date',
functions: 'COUNT,COUNT_DISTINCT,MAX,MIN'
"type": "date",
"functions": "COUNT,COUNT_DISTINCT,MAX,MIN"
}, {
type: 'timestamp',
functions: 'COUNT,COUNT_DISTINCT,MAX,MIN'
"type": "timestamp",
"functions": "COUNT,COUNT_DISTINCT,MAX,MIN"
}
],
operator: [
"operator": [
{
type: 'int',
functions: '=,!=,>,<,>=,<=,in,not in'
"type": "int",
"functions": "=,!=,>,<,>=,<=,in,not in"
}, {
type: 'long',
functions: '=,!=,>,<,>=,<=,in,not in'
"type": "long",
"functions": "=,!=,>,<,>=,<=,in,not in"
}, {
type: 'float',
functions: '=,!=,>,<,>=,<='
"type": "float",
"functions": "=,!=,>,<,>=,<="
}, {
type: 'double',
functions: '=,!=,>,<,>=,<='
"type": "double",
"functions": "=,!=,>,<,>=,<="
}, {
type: 'string',
functions: '=,!=,in,not in,like,not like,notEmpty,empty'
"type": "string",
"functions": "=,!=,in,not in,like,not like,notEmpty,empty"
}, {
type: 'date',
functions: '=,!=,>,<,>=,<='
"type": "date",
"functions": "=,!=,>,<,>=,<="
}, {
type: 'timestamp',
functions: '=,!=,>,<,>=,<='
"type": "timestamp",
"functions": "=,!=,>,<,>=,<="
}, {
type: 'array',
functions: 'has'
"type": "array",
"functions": "has"
}]
}
}
},
fields: []
"fields": []
}
export const fieldTemplate = {
name: '',
label: '',
doc: {
allow_query: 'true',
visibility: null,
constraints: {
type: 'tag',
operator_functions: 'in,not in'
"name": "",
"label": "",
"doc": {
"allow_query": "true",
"visibility": null,
"constraints": {
"type": "tag",
"operator_functions": "in,not in"
},
data: []
"data": []
},
type: 'Array'
"type": "Array"
}

View File

@@ -17,7 +17,7 @@
<el-select v-model="pageSize" :placeholder="pageSize+$t('pageSize')" size="small"
:teleported="appendToBody" class="pagination-size-select" @change="size"
:popper-class="popClass" @visible-change="popperVisible">
<el-option v-for="item in pageSizes" :key="item.value" :label="item.label" :value="item.value"></el-option>
<el-option v-for="(item, index) in pageSizes" :key="index" :label="item.label" :value="item.value"></el-option>
</el-select>
</el-pagination>

View File

@@ -1,6 +1,6 @@
<template>
<Transition name="fade">
<div class="simple-loading" :class="placementClass" v-show="loading" :style="style">
<div class="simple-loading" :class="placementClass" v-show="loading">
<div class="simple-loading__box" :class="sizeClass">
<div class="simple-loading__inner">
<div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div>
@@ -22,10 +22,6 @@ export default {
placement: {
type: String,
default: 'center' // top/top-start/top-end/bottom/bottom-start/bottom-end/left/left-start/left-end/right/right-start/right-end/center
},
style: {
type: String,
default: ''
}
},
data () {

View File

@@ -4,7 +4,7 @@
<el-slider v-model="currentTime" @change="onChange" :step="1" :max="timeLine.length>0?timeLine.length-1:99" :format-tooltip="formatTooltip"/>
</div>
<div class="time-line-container">
<div v-for="item in timeLine" :key="item.stamp">
<div v-for="(item, index) in timeLine" :key="index">
<div v-if="item.showFlag" style="color: #666;">{{ item.time }}</div>
</div>
</div>
@@ -111,8 +111,7 @@ export default {
const month = date.getMonth() + 1
const day = date.getDate()
const obj = {
// time: `${date.getFullYear()}-${month < 10 ? ('0' + month) : month}-${day < 10 ? ('0' + day) : day}`,
time: `${month < 10 ? ('0' + month) : month}-${day < 10 ? ('0' + day) : day}`,
time: `${date.getFullYear()}-${month < 10 ? ('0' + month) : month}-${day < 10 ? ('0' + day) : day}`,
time1: changeTimestampToTime(timestamp).substring(0, changeTimestampToTime(timestamp).length - 3),
showFlag: false
}

View File

@@ -11,7 +11,7 @@
</span>
<transition name="el-zoom-in-top">
<div v-if="dropdownShow" class="refresh-list">
<div v-for="item in refreshArr" :key="item.label" @click="setRefresh(item)" class="refresh-list-item" :class="item.value==interval ? 'active' : ''">
<div v-for="(item, index) in refreshArr" :key="index" @click="setRefresh(item)" class="refresh-list-item" :class="item.value==interval ? 'active' : ''">
{{ item.label }}
<i v-if="item.value===interval" class="cn-icon cn-icon-check"></i>
</div>

View File

@@ -138,35 +138,27 @@
class="cn-menu"
:with-header="false"
:show-close="false"
@close="closeDrawer"
>
<div class="cn-menu__left" v-if="otherMenu" @mouseleave="mouseleaveLeftMenu">
<div
class="left-menu"
:class="isShowSetting && menu.code==='setting' ? 'left-menu--setting' : ''"
v-for="menu in otherMenu"
:key="menu.id"
@click="jumpOther(menu.route,'','',0)"
@mouseenter="mouseleaveItemMenu(menu.code)">
<div class="cn-menu__left" v-if="otherMenu">
<div class="left-menu" v-for="menu in otherMenu" :key="menu.id" @click="jumpOther(menu.route,'','',0)">
<i :class="menu.icon"></i>
<span>{{ $t(menu.i18n || menu.name) }}</span>
<i class="cn-icon cn-icon-right" v-show="menu.code==='setting'"></i>
<i class="cn-icon cn-icon-right"></i>
</div>
<div class="empty-menu" @mouseleave="mouseleaveItemMenu(null)"></div>
</div>
<div class="cn-menu__middle" v-if="!isShowSetting">
<div class="cn-menu__middle" >
<div class="middle-menus middle-menus--network-analytics">
<div class="middle-menus__header">{{ $t('overall.networkAnalytics') }}</div>
<div class="middle-menus__body" v-if="networkAnalyticsMenu && networkAnalyticsMenu.children">
<div style="width: 260px;">
<template v-for="(menu, index) in networkAnalyticsMenu.children" :key="menu.name">
<template v-for="(menu, index) in networkAnalyticsMenu.children" :key="index">
<div class="middle-menu" v-if="index < 5" @click="jump(menu.route,'','',2)">
{{ $t(menu.i18n || menu.name) }}
</div>
</template>
</div>
<div>
<template v-for="(menu, index) in networkAnalyticsMenu.children" :key="menu.name">
<template v-for="(menu, index) in networkAnalyticsMenu.children" :key="index">
<div class="middle-menu" v-if="index >= 5 && index < 10" @click="jump(menu.route,'','',2)">
{{ $t(menu.i18n || menu.name) }}
</div>
@@ -178,35 +170,14 @@
<div class="middle-menus__header">{{ $t('overall.locationIntelligence') }}</div>
<div class="middle-menus__body" v-if="locationIntelligenceMenu && locationIntelligenceMenu.children">
<div style="width: 260px;">
<template v-for="(menu, index) in locationIntelligenceMenu.children" :key="menu.name">
<template v-for="(menu, index) in locationIntelligenceMenu.children" :key="index">
<div class="middle-menu" v-if="index < 5" @click="jump(menu.route,'','',2)">
{{ $t(menu.i18n || menu.name) }}
</div>
</template>
</div>
<div>
<template v-for="(menu, index) in locationIntelligenceMenu.children" :key="menu.name">
<div class="middle-menu" v-if="index >= 5 && index < 10" @click="jump(menu.route,'','',2)">
{{ $t(menu.i18n || menu.name) }}
</div>
</template>
</div>
</div>
</div>
</div>
<div class="cn-menu__middle" v-else @mouseenter="mouseleaveItemMenu('setting')">
<div class="middle-menus middle-menus--network-analytics">
<div class="middle-menus__header">{{ $t('overall.setting') }}</div>
<div class="middle-menus__body" v-if="settingMenu && settingMenu.children">
<div style="width: 260px;">
<template v-for="(menu, index) in settingMenu.children" :key="menu.name">
<div class="middle-menu" v-if="index < 5" @click="jump(menu.route,'','',2)">
{{ $t(menu.i18n || menu.name) }}
</div>
</template>
</div>
<div>
<template v-for="(menu, index) in settingMenu.children" :key="menu.name">
<template v-for="(menu, index) in locationIntelligenceMenu.children" :key="index">
<div class="middle-menu" v-if="index >= 5 && index < 10" @click="jump(menu.route,'','',2)">
{{ $t(menu.i18n || menu.name) }}
</div>
@@ -279,7 +250,7 @@ import {
import { getNowTime, getSecond } from '@/utils/date-util'
import _ from 'lodash'
import { useRoute } from 'vue-router'
import { useToggle } from '@vueuse/core'
import { useDark, useToggle } from '@vueuse/core'
export default {
name: 'Header',
@@ -366,7 +337,7 @@ export default {
logo: 'images/logo-header.svg',
ZH,
EN,
isShowSetting: false
// isDark: useDark()
}
},
computed: {
@@ -376,9 +347,6 @@ export default {
locationIntelligenceMenu () {
return this.$store.getters.menuList.find(menu => menu.code === 'locationIntelligence')
},
settingMenu () {
return this.$store.getters.menuList.find(menu => menu.code === 'setting')
},
otherMenu () {
return this.$store.getters.menuList.filter(menu => ['locationIntelligence', 'networkAnalytics', 'I18N', 'entityDetail', 'entityGraph', 'detectionPolicy'].indexOf(menu.code) === -1)
@@ -501,10 +469,8 @@ export default {
const newQuery = query
// 重刷界面后url里参数带空格的部分会被转为+,此处将+再转为空格。后续观察是否存在原本参数带+被误转的
Object.keys(newQuery).forEach(item => {
if (newQuery[item] && _.isString(newQuery[item])) {
if (newQuery[item].indexOf('+') > -1) {
newQuery[item] = newQuery[item].replaceAll('+', ' ')
}
if (newQuery[item] && newQuery[item].indexOf('+') > -1) {
newQuery[item] = newQuery[item].replaceAll('+', ' ')
}
})
const newUrl = urlParamsHandler(window.location.href, query, newQuery)
@@ -535,15 +501,12 @@ export default {
generateBreadcrumb (breadcrumb, menus, tab) {
const menu = menus.find(m => m.route === this.route)
if (menu) {
if (menu.code !== 'securityEvents') {
breadcrumb.unshift({
code: menu.code,
value: menu.i18n ? this.$t(menu.i18n) : menu.name,
route: menu.route,
type: menu.type
})
}
breadcrumb.unshift({
code: menu.code,
value: menu.i18n ? this.$t(menu.i18n) : menu.name,
route: menu.route,
type: menu.type
})
return true
} else {
for (let i = 0; i < menus.length; i++) {
@@ -790,10 +753,6 @@ export default {
},
// 仅处理除panel外的相关路径的导航
async jumpOther (route, index) {
if (route === '/setting') {
this.isShowSetting = true
return true
}
route = route.replace('redirect:', '')
this.showMenu = false
if (route === this.route && index > 0) { // 当前只有一级菜单时,点击不进行刷新,重新跳转
@@ -932,18 +891,6 @@ export default {
if (obj.scrollTop + obj.clientHeight === obj.scrollHeight) {
this.initDropdownList()
}
},
closeDrawer () {
const timer = setTimeout(() => {
this.isShowSetting = false
clearTimeout(timer)
}, 400)
},
mouseleaveLeftMenu () {
this.isShowSetting = false
},
mouseleaveItemMenu (code) {
this.isShowSetting = code === 'setting'
}
}
}

View File

@@ -1,149 +0,0 @@
<template>
<div class="right-box">
<div class="right-box__header">
<div class="header__title">{{ $t('location.myFollow')}}</div>
<div class="header__operation">
<span @click="esc"><i class="cn-icon cn-icon-close"></i></span>
</div>
</div>
<cn-data-list
ref="dataList"
:tableId="tableId"
v-model:custom-table-title="tools.customTableTitle"
:api="url"
style="height: calc(100% - 60px)"
>
<template #top-tool-left>
<button id="cancelFollows" class="business-button business-button--light margin-r-10"
:disabled="disableCancel" @click="cancelFollowBatch">
<span>{{ $t('location.cancelFollow') }}</span>
</button>
</template>
<template #default>
<loading :loading="loading"></loading>
<my-follow-table
ref="dataTable"
:api="url"
:isNoData="isNoData"
:custom-table-title="tools.customTableTitle"
:table-data="tableData"
@reload="getTableData"
@selectionChange="selectionChange"
@handleFollow="handleFollow"
/>
</template>
<template #pagination>
<pagination ref="pagination" :page-obj="pageObj" :table-id="tableId" @pageNo='pageNo' @pageSize='pageSize'></pagination>
</template>
</cn-data-list>
</div>
</template>
<script>
import axios from 'axios'
import { api } from '@/utils/api'
import cnDataList from '@/components/table/CnDataList'
import myFollowTable from '@/components/table/location/MyFollowTable'
import dataListMixin from '@/mixins/data-list'
export default {
name: 'MyFollowBox',
mixins: [dataListMixin],
props: {
timeFilter: {
type: Object
},
level: {
type: Number
}
},
components: {
cnDataList,
myFollowTable
},
data () {
return {
url: api.location.followedSubscriber,
tableId: 'myFollowTable',
disableCancel: true
}
},
mounted () {
},
methods: {
handleFollow(item) {
this.$emit('handleFollow', item)
},
getTableData () {
this.searchLabel = {
startTime: this.timeFilter.startTime,
endTime: this.timeFilter.endTime,
level: this.level,
...this.pageObj
}
this.isNoData = false
this.toggleLoading(true)
delete this.searchLabel.total
axios.get(this.url, { params: this.searchLabel }).then(response => {
if (response.status === 200) {
for (let i = 0; i < response.data.data.list.length; i++) {
response.data.data.list[i].isFollowed = 1
}
this.tableData = response.data.data.list
this.pageObj.total = response.data.data.total
} else {
console.error(response.data)
this.isNoData = true
if (response.data.message) {
this.$message.error(response.data.message)
} else {
this.$message.error(this.$t('tip.somethingWentWrong'))
}
}
}).finally(() => {
this.toggleLoading(false)
this.isNoData = !this.tableData || this.tableData.length === 0
})
},
selectionChange (objs) {
this.batchDeleteObjs = []
objs.forEach(obj => {
const delObj = this.batchDeleteObjs.find(item => item.subscriberId === obj.subscriberId)
if (delObj === undefined) {// && obj.isFollowed === 1
this.batchDeleteObjs.push(obj)
}
})
this.disableCancel = this.batchDeleteObjs.length < 1
},
cancelFollowBatch() {
const ids = []
if (this.batchDeleteObjs && this.batchDeleteObjs.length > 0) {
this.batchDeleteObjs.forEach(item => {
ids.push(item.subscriberId)
})
}
this.toggleLoading(true)
axios.delete(api.location.follow + '?subscriberIds=' + ids.join(',')).then(response => {
if (response.status === 200) {
this.$message({ duration: 2000, type: 'success', message: this.$t('location.cancelFollow.success') })
this.batchDeleteObjs.forEach(item => {
item.isFollowed = 0
})
} else {
this.$message.error(response.data.message)
}
}).catch(e => {
this.$message.error(e.response.data.message)
}).finally(() => {
this.toggleLoading(false)
this.$emit('handleCancelFollowBatch', this.batchDeleteObjs)
})
},
/* 关闭弹框 */
esc () {
this.$emit('close')
}
}
}
</script>

View File

@@ -110,7 +110,7 @@
<template #append>{{$t('report.week')}}</template>
</el-input>-->
<el-checkbox-group v-model="editObject.config.schedulerConfig.weekDates">
<el-checkbox v-for="item in weekdayList" :key="item.value" :label="item.value">{{$t(item.name)}}</el-checkbox>
<el-checkbox v-for="(item, index) in weekdayList" :key="index" :label="item.value">{{$t(item.name)}}</el-checkbox>
</el-checkbox-group>
</div>
<!-- -->
@@ -134,7 +134,7 @@
<div class="enable-month-all">
<el-checkbox v-model="monthCheckedAll" class="enable-month-all-months" :indeterminate="monthIsIndeterminate" @change="monthCheckAllChange" :label="$t('report.allMonths')"/>
<el-checkbox-group v-model="editObject.config.schedulerConfig.months" @change="monthCheckChange">
<el-checkbox v-for="item in monthList" :key="item.value" :label="item.value">{{$t(item.name)}}</el-checkbox>
<el-checkbox v-for="(item, index) in monthList" :key="index" :label="item.value">{{$t(item.name)}}</el-checkbox>
</el-checkbox-group>
</div>
</template>
@@ -163,7 +163,7 @@
<div class="enable-month-week">
<el-checkbox v-model="monthWeekdayCheckedAll" class="enable-month-week-all" :label="$t('report.all')" :indeterminate="monthWeekdayIsIndeterminate" @change="monthWeekdayCheckAllChange" size="large"/>
<el-checkbox-group v-model="editObject.config.schedulerConfig.weekDates" @change="monthWeekdayCheckChange">
<el-checkbox v-for="item in weekdayList" :key="item.value" :label="item.value">{{$t(item.name)}}</el-checkbox>
<el-checkbox v-for="(item, index) in weekdayList" :key="index" :label="item.value">{{$t(item.name)}}</el-checkbox>
</el-checkbox-group>
</div>
</template>
@@ -219,7 +219,7 @@
<!-- <el-input v-model="param.value" placeholder=" " v-for="(param, index) in editObject.categoryParams" :key="index" size="small" style="vertical-align: unset;" :disabled="!!editObject.id">
<template #prepend>{{param.key}}</template>
</el-input-number>-->
<template v-for="param in editObject.categoryParams" :key="param.key">
<template v-for="(param, index) in editObject.categoryParams" :key="index">
<el-input-number v-if="param.labelType === 'input'" v-model="param.value" placeholder=" " class="report__params-vertical" :disabled="!!editObject.id">
<template #prepend>{{param.key}}</template>
</el-input-number>

View File

@@ -13,7 +13,7 @@
<el-form-item :label="$t('config.user.name')" prop="name">
<el-input id="account-input-name" v-model="editObject.name"
:disabled="editObject.username==='admin' && editObject.id === 1"
maxlength="32" placeholder="" show-word-limit type="text"></el-input>
maxlength="64" placeholder="" show-word-limit type="text"></el-input>
</el-form-item>
<!--username-->
<el-form-item :label="$t('config.user.username')" prop="username">
@@ -23,21 +23,13 @@
</el-form-item>
<!--password-->
<el-form-item :label="$t('config.user.pin')" prop="pin">
<el-input id="account-input-password" v-model="editObject.pin" maxlength="16" placeholder=""
show-word-limit type="password" show-password @blur="pinBlur" @input="pinInput" autocomplete="new-password"></el-input>
<el-input id="account-input-password" v-model="editObject.pin" maxlength="64" placeholder=""
show-word-limit type="password" @blur="pinBlur" autocomplete="new-password"></el-input>
</el-form-item>
<!--密码强度-->
<el-progress
:text-inside="true"
class="my-progress"
:percentage="percentage"
:color="customColors" />
<!--密码提示-->
<div class="password-hint">{{ handleSpecialCode($t('validate.passwordHint')) }}</div>
<!--pinChange-->
<el-form-item :label="$t('config.user.confirmPin')" label-width="200px" prop="pinChange">
<el-input id="account-input-pinChange" v-model="editObject.pinChange" maxlength="16" placeholder=""
show-word-limit show-password type="password"></el-input>
<el-input id="account-input-pinChange" v-model="editObject.pinChange" maxlength="64" placeholder=""
show-word-limit type="password"></el-input>
</el-form-item>
<!--email-->
<el-form-item label="E-mail" prop="email">
@@ -112,38 +104,38 @@ import axios from 'axios'
import _ from 'lodash'
import { themeData, langData, storageKey } from '@/utils/constants'
import { api } from '@/utils/api'
import { handleSpecialCode } from '@/utils/tools'
export default {
name: 'UserBox',
mixins: [rightBoxMixin],
data () {
const validatePin = (rule, value, callback) => { // 确认密码
if (value) {
const reg = /^[-\d\w/~!@#$%^&*_.?]+$/g
const isValid = value.match(reg) // 返回匹配到的值
if (value && value.length < 8) {
callback(new Error(this.$t('validate.atLeastEight')))
} else if (!isValid) {
callback(new Error(handleSpecialCode(this.$t('validate.passwordError'))))
} else if (this.passwordLevel(this.editObject.pin) === 1) {
callback(new Error(this.$t('validate.passwordTwoTypes')))
} else {
callback()
}
} else if (this.editObject.id) { // 编辑时不输入密码则不做校验
if (value && value.length < 5) {
callback(new Error(this.$t('validate.atLeastFive')))
} else {
callback()
}
}
const validateConfirmPin = (rule, value, callback) => { // 确认密码的二次校验
if (this.editObject.id && _.isEmpty(value) && _.isEmpty(this.editObject.pin)) { // 编辑时,密码和确认密码没内容则不做校验
callback()
} else if (_.isEmpty(value) && !_.isEmpty(this.editObject.pin)) { // 密码有内容,确认密码没内容
if (_.isEmpty(value) && !_.isEmpty(this.editObject.pin)) { // 密码有内容,确认密码没内容
callback(new Error(this.$t('config.user.confirmPin')))
} else if (!_.isEmpty(value) && !_.isEmpty(this.editObject.pin) && value !== this.editObject.pin) { // 密码有内容,确认密码也有内容,内容不一致
} else if (!_.isEmpty(value) && value !== this.editObject.pin) { // 密码有内容,确认密码也有内容,内容不一致
callback(new Error(this.$t('config.user.confirmPinErr')))
} else if (!_.isEmpty(value) && _.isEmpty(this.editObject.pin)) { // 确认密码有内容,密码没内容
callback(new Error(this.$t('config.user.confirmNoPin')))
} else {
callback()
}
}
const validateName = (rule, value, callback) => {
let validate = true
// const reg = /^[a-zA-Z0-9\u4e00-\u9fa5\u30a1-\u30f6\u3041-\u3093\uFF00-\uFFFF\u4e00-\u9fa5\u0400-\u04FF\s]{2,64}$/
const reg = /^[\u4E00-\u9FA5\a-zA-Z0-9\u3040-\u309F\u0800-\u4e00\u0400-\u04FF\u2000-\u206F\s]{2,64}$/
const emptyFlag = value[0] === ' ' || value[value.length - 1] === ' '
validate = reg.test(value)
if (value.length < 2) {
callback(new Error(this.$t('validate.atLeastTwo')))
} else if (!validate || value.trim() === '' || emptyFlag) {
// 除满足中英日俄、数字空格外,不能全为空格,前后也不可为空格
callback(new Error(this.$t('validate.name')))
} else {
callback()
}
@@ -151,11 +143,13 @@ export default {
const validateUserName = (rule, value, callback) => {
let validate = true
// const reg = /^[a-zA-Z0-9_\u4e00-\u9fa5\u30a1-\u30f6\u3041-\u3093\uFF00-\uFFFF\u4e00-\u9fa5\u0400-\u04FF\s]{2,64}$/
// 校验,只允许英、数字和标点符号
const reg = /^[A-Za-z0-9~!@#$%^&*_.?]+$/
// 校验,只允许中、英、数字和下划线
const reg = /^[\u4e00-\u9fa5_a-zA-Z0-9]{2,64}$/
validate = reg.test(value)
if (!validate) {
callback(new Error(this.$t('validate.userName1')))
if (value.length < 2) {
callback(new Error(this.$t('validate.atLeastTwo')))
} else if (!validate) {
callback(new Error(this.$t('validate.userName')))
} else {
callback()
}
@@ -165,10 +159,11 @@ export default {
loginName: localStorage.getItem(storageKey.username),
rules: { // 表单校验规则
name: [
{ required: true, message: this.$t('validate.nameLength'), trigger: 'blur' }
{ required: true, message: this.$t('validate.required'), trigger: 'blur' },
{ validator: validateName, trigger: 'blur' }
],
username: [
{ required: true, message: this.$t('validate.userNameLength'), trigger: 'blur' },
{ required: true, message: this.$t('validate.required'), trigger: 'blur' },
{ validator: validateUserName, trigger: 'blur' }
],
pin: [
@@ -177,7 +172,7 @@ export default {
],
pinChange: [
{ required: true, message: this.$t('validate.required') },
// { validator: validatePin, trigger: 'blur' },
{ validator: validatePin, trigger: 'blur' },
{ validator: validateConfirmPin, trigger: 'blur' }
],
roleIds: [
@@ -193,18 +188,16 @@ export default {
},
rules2: { // 表单校验规则
name: [
{ required: true, message: this.$t('validate.nameLength'), trigger: 'blur' }
{ required: true, message: this.$t('validate.required'), trigger: 'blur' },
{ validator: validateName, trigger: 'blur' }
],
username: [
{ required: true, message: this.$t('validate.userNameLength'), trigger: 'blur' },
{ required: true, message: this.$t('validate.required'), trigger: 'blur' },
{ validator: validateUserName, trigger: 'blur' }
],
pin: [
{ validator: validatePin, trigger: 'blur' }
],
pinChange: [
{ validator: validateConfirmPin, trigger: 'blur' }
// { validator: validatePin, trigger: 'blur' }
{ validator: validateConfirmPin, trigger: 'blur' },
{ validator: validatePin, trigger: 'blur' }
],
roleIds: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
@@ -219,14 +212,7 @@ export default {
},
roleData: [],
themeData,
langData,
percentage: 0, // 密码强度
customColors: [ // 密码强度颜色指标
{ color: '#d32423', percentage: 26 },
{ color: '#fdbf12', percentage: 51 },
{ color: '#99c708', percentage: 76 },
{ color: '#099407', percentage: 100 }
]
langData
}
},
setup () {
@@ -235,14 +221,13 @@ export default {
this.getRoleData()
},
methods: {
handleSpecialCode,
isCurrentUser (username) {
return localStorage.getItem(storageKey.username) === username
},
/* 密码失去焦点 检验确认密码 */
pinBlur () {
if (this.editObject.pin && this.editObject.pinChange) {
this.$refs.userForm.validateField('pinChange', () => null) // 没有null则会报错
this.$refs.userForm.validateField('pinChange')
}
},
save () {
@@ -314,49 +299,6 @@ export default {
this.roleData = _.get(response, 'data.data.list', [])
}
})
},
pinInput () {
if (this.editObject?.pin.length < 8 && this.editObject?.pin.length !== 0) {
this.percentage = 25
} else if (this.editObject?.pin.length === 0) {
this.percentage = 0
} else if (this.editObject?.pin.length < 10) {
this.percentage = this.passwordLevel(this.editObject.pin) > 1 ? 2 * 25 : this.passwordLevel(this.editObject.pin) * 25
} else if (this.editObject?.pin.length < 12) {
this.percentage = this.passwordLevel(this.editObject.pin) === 4 ? 3 * 25 : this.passwordLevel(this.editObject.pin) * 25
} else {
this.percentage = this.passwordLevel(this.editObject.pin) * 25
}
},
passwordLevel (I) {
let H = 0
for (let a = 0; a < I.length; a++) {
H |= this.CharMode(I.charCodeAt(a))
}
return this.bitTotal(H)
},
CharMode (H) {
if (H >= 48 && H <= 57) { // 数字
return 1
}
if (H >= 65 && H <= 90) { // 大写
return 2
}
if (H >= 97 && H <= 122) { // 小写
return 4
} else {
return 8
}
},
bitTotal (H) {
let I = 0
for (let j = 0; j < 4; j++) {
if (H & 1) {
I++
}
H >>>= 1
}
return I
}
},
watch: {

View File

@@ -5,9 +5,9 @@
<div class="main-container">
<!-- 顶部工具栏 -->
<div class="top-tools">
<div class="top-tool-left" :style="{width: showInputWidth ? showInputWidth : 'auto'}">
<div class="top-tool-left">
<slot name="top-tool-left"></slot>
<div v-if="showLayout.indexOf('search') > -1" :class="showInputWidth ? 'top-tool-search1' : 'top-tool-search margin-r-20'">
<div v-if="showLayout.indexOf('search') > -1" class="top-tool-search margin-r-20">
<div class="top-tool-search__display">
<el-input v-model="keyWord" @keyup.enter="onSearch"></el-input>
<button class="business-button business-button--light top-tool-btn--search" @click="onSearch">
@@ -72,10 +72,6 @@ export default {
layout: {
type: Array,
default () { return [] }
},
inputWidth: {
type: String,
default () { return '' }
}
},
data () {
@@ -86,7 +82,6 @@ export default {
showCustomTableTitle: false // 自定义列弹框是否显示
},
showLayout: [],
showInputWidth: '',
loading: true
}
},
@@ -108,13 +103,6 @@ export default {
handler (n) {
this.showLayout = [...n]
}
},
inputWidth: {
immediate: true,
deep: true,
handler (n) {
this.showInputWidth = n
}
}
}
}

View File

@@ -59,7 +59,7 @@
<script>
import indexedDBUtils from '@/indexedDB'
import { storageKey, dbTableColumnCustomizeConfigPre, dbTableColumnCustomizeConfig } from '@/utils/constants'
import { storageKey, dbTableColumnCustomizeConfigPre,dbTableColumnCustomizeConfig } from '@/utils/constants'
export default {
props: {
customTableTitle: Array, // 自定义的title
@@ -153,7 +153,7 @@ export default {
this.$emit('update', this.custom)
const userId = localStorage.getItem(storageKey.userId)
const tableName = dbTableColumnCustomizeConfigPre + '-' + this.tableId
/*
/*
const defaultConfigInDb = await indexedDBUtils.selectTable(tableName).get({ id: userId })
let fullVersion = ''
if (defaultConfigInDb && defaultConfigInDb.version) {
@@ -168,8 +168,8 @@ export default {
fullVersion = BASE_CONFIG.version + '.1'
}
*/
const curTableConfig = dbTableColumnCustomizeConfig.find(item => item.tableName === tableName)
if (curTableConfig) {
let curTableConfig = dbTableColumnCustomizeConfig.find(item => item.tableName === tableName)
if(curTableConfig) {
await indexedDBUtils.selectTable(tableName).put({
id: userId,
version: curTableConfig.version,

View File

@@ -32,8 +32,7 @@
<div class="col-resize-area"></div>
</template>
<template #default="scope" :column="item">
<span v-if="item.prop === 'value'">{{handleSpecialCode(scope.row[item.prop]) || '-'}}</span>
<span v-else>{{scope.row[item.prop] || '-'}}</span>
<span>{{scope.row[item.prop] || '-'}}</span>
</template>
</el-table-column><template v-slot:empty >
<div class="table-no-data" v-if="isNoData">
@@ -46,7 +45,6 @@
<script>
import table from '@/mixins/table'
import { api } from '@/utils/api'
import { handleSpecialCode } from '@/utils/tools'
export default {
name: 'I18nTable',
@@ -93,9 +91,6 @@ export default {
}
]
}
},
methods: {
handleSpecialCode
}
}
</script>

View File

@@ -20,7 +20,7 @@
<div class="form-setting__block margin-b-20">
<div class="block-title">{{ $t('detection.create.dimensions') }}</div>
<div class="block-dimension">
<div class="block-dimension-tag" v-for="ite in dimensionList" :key="ite.label">{{ ite.label }}</div>
<div class="block-dimension-tag" v-for="(ite, ind) in dimensionList" :key="ind">{{ ite.label }}</div>
</div>
</div>
@@ -37,7 +37,7 @@
<div class="form-setting__block margin-b-20">
<div class="block-title1">{{ $t('detections.filters') }}</div>
<div class="definition-filter-block" v-if="showFilter">
<div class="definition-filter-item" v-for="(item, index) in thresholdRuleObj.filterList" :key="item.filter">
<div class="definition-filter-item" v-for="(item, index) in thresholdRuleObj.filterList" :key="index">
<el-select class="filter-item__select margin-r-8" v-model="item.filter" placeholder=" ">
<el-option
v-for="item in selectList"
@@ -68,7 +68,7 @@
<div class="block-title">{{ $t('detection.create.condition') }}</div>
<el-form ref="form2" :model="thresholdRuleObj" label-position="top">
<div class="definition-condition-block" v-for="(item, index) in thresholdRuleObj.conditionData" :key="item.level">
<div class="definition-condition-block" v-for="(item, index) in thresholdRuleObj.conditionData" :key="index">
<el-form-item :label="$t('detection.level')" :prop="`conditionData.${index}.level`" :rules="rules.level">
<el-select class="condition__select margin-b-20" v-model="item.level" placeholder=" ">
<template #prefix>

View File

@@ -1,147 +0,0 @@
<template>
<el-table
id="myFollowTable"
ref="dataTable"
:data="tableData"
tooltip-effect="light"
empty-text=" "
@selection-change="selectionChange"
>
<el-table-column
:resizable="false"
align="center"
type="selection"
:selectable="(row) => { return row.isFollowed === 1 }"
width="55">
</el-table-column>
<el-table-column
v-for="(item, index) in customTableTitles"
:key="item.prop+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}`"
>
<template #header>
<span class="data-column__span">{{item.label}}</span>
<div class="col-resize-area"></div>
</template>
<template #default="scope" :column="item">
<template v-if="item.prop === 'active'">
<template v-if="scope.row[item.prop] === 1">
{{$t('location.active')}}
</template>
<template v-else>
<span>{{$t('location.inactive')}}</span>
</template>
</template>
<template v-else-if="item.prop === 'ctime'">
<template v-if="scope.row[item.prop]">
{{dateFormatByAppearance(scope.row[item.prop]) || '-'}}
</template>
<template v-else>
<span>-</span>
</template>
</template>
<template v-else-if="item.prop === 'subscriberDto.phoneNumber'">
{{scope.row.subscriberDto ? scope.row.subscriberDto.phoneNumber : '-'}}
</template>
<template v-else-if="item.prop === 'isFollowed'" >
<span class="follow-cursor" v-if="scope.row[item.prop] === 1" @click="cancelFollow(scope.row)"><i class="cn-icon cn-icon-follow-fill"></i></span>
<span class="follow-cursor" v-else @click="follow(scope.row)"><i class="cn-icon cn-icon-follow"></i></span>
</template>
<span v-else>{{scope.row[item.prop] || '-'}}</span>
</template>
</el-table-column>
<template v-slot:empty >
<div class="table-no-data" v-if="isNoData">
<div class="table-no-data__title">{{ $t('npm.noData') }}</div>
</div>
</template>
</el-table>
</template>
<script>
import table from '@/mixins/table'
import axios from 'axios'
import { api } from '@/utils/api'
export default {
name: 'myFollowTable',
props: {
isNoData: {
type: Boolean,
default: false
}
},
mixins: [table],
data () {
return {
tableTitle: [ // 原始table列
{
label: 'ID',
prop: 'subscriberId',
show: true,
minWidth: 100
}, {
label: 'MSISDN',
prop: 'subscriberDto.phoneNumber',
show: true,
minWidth: 150
}, {
label: this.$t('overall.status'),
prop: 'active',
show: true,
minWidth: 80
}, {
label: this.$t('location.followTime'),
prop: 'ctime',
show: true,
minWidth: 150
}, {
label: this.$t('overall.option'),
prop: 'isFollowed',
show: true,
minWidth: 100
}
]
}
},
methods: {
cancelFollow(item) {
axios.delete(api.location.follow + '?subscriberIds=' + item.subscriberId).then(res => {
if (res.status === 200) {
this.$message({ duration: 2000, type: 'success', message: this.$t('location.cancelFollow.success') })
/* 刷新列表 */
item.isFollowed = 0
this.$refs.dataTable.toggleRowSelection(item, false)
this.$emit('handleFollow', item)
} else {
this.$message.error(res.data.message)
}
}).catch(e => {
this.$message.error(this.errorMsgHandler(e))
})
},
follow(item) {
axios.post(api.location.follow, { subscriberIds: item.subscriberId }).then(async res => {
if (res.status === 200) {
this.$message({ duration: 2000, type: 'success', message: this.$t('location.follow.success') })
/* 刷新列表 */
item.isFollowed = 1
this.$emit('handleFollow', item)
} else {
this.$message.error(res.data.message)
}
}).catch(e => {
this.$message.error(this.errorMsgHandler(e))
})
}
}
}
</script>

View File

@@ -33,7 +33,7 @@
<div class="expand">
<loading :loading="loadingDown"></loading>
<chart-no-data v-if="downDataList.length === 0 && !loadingDown"></chart-no-data>
<div class="expand-cell" v-for="item in downDataList" :key="item.id">
<div class="expand-cell" v-for="(item, index) in downDataList" :key="index">
<div class="expand-right">
<div class="demo-progress">
<el-progress :stroke-width="10" type="circle" :percentage="computePercent(item)"

View File

@@ -1,145 +0,0 @@
<template>
<el-table
id="userTable"
ref="dataTable"
:data="tableData"
tooltip-effect="light"
empty-text=" "
@header-dragend="dragend"
@sort-change="tableDataSort"
@selection-change="selectionChange"
:row-class-name="tableRowClassName"
>
<el-table-column
:resizable="false"
align="center"
type="selection"
width="55">
</el-table-column>
<el-table-column
v-for="(item, index) in customTableTitles"
:key="item.prop+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}`"
>
<template #header>
<span class="data-column__span">{{ item.label }}</span>
<div class="col-resize-area"></div>
</template>
<template #default="scope" :column="item">
<template v-if="item.prop === 'ctime' || item.prop === 'utime'">
<template v-if="scope.row[item.prop]">
{{ dateFormatByAppearance(scope.row[item.prop]) || '-' }}
</template>
<template v-else><span>-</span></template>
</template>
<template v-if="item.prop === 'entitySource'">
{{ scope.row[item.prop]?.name || '-' }}
</template>
<template v-if="item.prop === 'entities' || item.prop === 'relations'">
{{ handleListTypes(scope.row[item.prop]) }}
</template>
</template>
</el-table-column>
<template v-slot:empty>
<div class="table-no-data" v-if="isNoData">
<div class="table-no-data__title">{{ $t('npm.noData') }}</div>
</div>
</template>
</el-table>
</template>
<script>
import table from '@/mixins/table'
import { dateFormatByAppearance } from '@/utils/date-util'
export default {
name: 'SourcesTable',
props: {
isNoData: {
type: Boolean,
default: false
}
},
mixins: [table],
data () {
return {
tableTitle: [ // 原始table列
{
label: 'ID',
prop: 'id',
show: true,
minWidth: 50,
sortable: 'custom'
},
{
label: this.$t('setting.source'),
prop: 'entitySource',
show: true,
sortable: 'custom',
minWidth: 100
},
{
label: this.$t('setting.entityTypes'),
prop: 'entities',
show: true,
minWidth: 150
},
{
label: this.$t('setting.relationTypes'),
prop: 'relations',
show: true,
minWidth: 200
},
{
label: this.$t('config.user.createTime'),
prop: 'ctime',
show: true,
minWidth: 150
},
{
label: this.$t('overall.updateTime'),
prop: 'utime',
show: true,
minWidth: 150
}
]
}
},
methods: {
dateFormatByAppearance,
// 禁止勾选buildIn为1的项即禁止修改、删除admin的账号
checkSelectable (row) {
return row.isBuiltIn !== 1
},
handleListTypes (data) {
let str = ''
if (data && typeof data === 'string') {
data = JSON.parse(data)
data.forEach(item => {
if (!str) {
str = item.type + ','
} else if (str.indexOf(item.type) < 0) {
str += item.type + ','
}
})
str = str.slice(0, -1) || '-'
} else {
str = '-'
}
return str
},
tableRowClassName (row) {
if (row.row.isBuiltIn === 1) {
return 'table-disabled-row'
}
}
}
}
</script>

View File

@@ -1,282 +0,0 @@
<template>
<el-table
id="userTable"
ref="dataTable"
:data="tableData"
tooltip-effect="light"
empty-text=" "
@header-dragend="dragend"
@sort-change="tableDataSort"
@selection-change="selectionChange"
:row-class-name="tableRowClassName"
>
<el-table-column
:resizable="false"
align="center"
type="selection"
width="55">
</el-table-column>
<el-table-column
v-for="(item, index) in customTableTitles"
:key="item.prop+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}`"
>
<template #header>
<span class="data-column__span">{{ item.label }}</span>
<div class="col-resize-area"></div>
</template>
<template #default="scope" :column="item">
<template v-if="item.prop === 'ctime'">
<template v-if="scope.row[item.prop]">
{{ dateFormatByAppearance(scope.row[item.prop]) || '-' }}
</template>
<template v-else><span>-</span></template>
</template>
<template v-else-if="item.prop === 'option'">
<i class="cn-icon cn-icon-upload" style="cursor: pointer;" @click="clickOption(scope.row)"></i>
</template>
<span v-else>{{ scope.row[item.prop] || '-' }}</span>
</template>
</el-table-column>
<template v-slot:empty>
<div class="table-no-data" v-if="isNoData">
<div class="table-no-data__title">{{ $t('npm.noData') }}</div>
</div>
</template>
</el-table>
<el-dialog class="sources-dialog" v-model="dialogVisible" width="480">
<template #header>
<div class="sources-dialog__header">{{ $t('overall.upload') }}</div>
</template>
<div class="sources-dialog__body">
<div class="dialog__body-upload">
<loading :loading="uploadLoading"></loading>
<el-upload :action="uploadUrl"
:headers="uploadHeaders"
:data="uploadParams"
:multiple="false"
:file-list="fileList"
:on-change="fileChange"
:on-success="uploadSuccess"
:before-upload="beforeUpload"
:on-progress="onUpload"
:on-error="uploadError"
:class="uploadErrorTip ? 'el-upload--error' : ''"
drag
:accept="fileTypeLimit"
ref="upload"
>
<i class="cn-icon cn-icon-upload2 upload-icon"></i>
<div class="el-upload__text">
<div ref="uploadButton">{{ $t('sources.dragFile') }}</div>
</div>
</el-upload>
</div>
<div class="dialog__body-tip">
<div class="tip__text"
v-for="(item, index) in tipsInfo[language]"
:key="item.value"
:style="{color: index===0 || index===3 ? 'var(--el-color-business)' : 'var(--el-text-color-regular)'}">
{{ item.label }}
</div>
</div>
</div>
<template #footer>
<div class="sources-dialog__footer">
<button class="cancel-btn" @click="dialogVisible=false">{{ $t('overall.cancel') }}</button>
<button class="upload-btn">{{ $t('overall.upload') }}</button>
</div>
</template>
</el-dialog>
</template>
<script>
import table from '@/mixins/table'
import { dateFormatByAppearance } from '@/utils/date-util'
import { storageKey, unitTypes, EN } from '@/utils/constants'
import _ from 'lodash'
import unitConvert from '@/utils/unit-convert'
import { ElMessageBox } from 'element-plus'
import { ref } from 'vue'
import { api } from '@/utils/api'
import Loading from '@/components/common/Loading'
export default {
name: 'SourcesTable',
props: {
isNoData: {
type: Boolean,
default: false
}
},
mixins: [table],
data () {
return {
sourceId: '',
tableTitle: [ // 原始table列
{
label: 'ID',
prop: 'id',
show: true,
minWidth: 50,
sortable: 'custom'
},
{
label: this.$t('config.user.name'),
prop: 'name',
show: true,
sortable: 'custom',
minWidth: 150
},
{
label: this.$t('overall.remark'),
prop: 'description',
show: true,
minWidth: 350
},
{
label: this.$t('config.user.createTime'),
prop: 'ctime',
show: true,
minWidth: 150
},
{
label: this.$t('overall.option'),
prop: 'option',
show: true
}
],
dialogVisible: false,
uploadUrl: BASE_CONFIG.baseUrl + api.setting.source.sourceUpload,
uploadHeaders: {
'Cn-Authorization': localStorage.getItem(storageKey.token)
},
fileList: [],
fileTypeLimit: '.csv',
language: localStorage.getItem(storageKey.language) || EN,
uploadLoading: false,
tipsInfo: {
en: [
{ value: 0, label: 'You can now integrate data to our platform using two methods:' },
{ value: 1, label: '1. File Upload: Access the upload feature on our website to submit your files directly.' },
{ value: 2, label: '2. Kafka Direct Transmission: Send your data to a specific Kafka topic on our servers, ensuring each message includes a header with the source_id.' },
{ value: 3, label: 'For Kafka server information, please contact your administrator.' }
],
zh: [
{ value: 0, label: '您现在可以使用两种方法将数据集成到我们的平台:' },
{ value: 1, label: '1. 文件上传:访问我们网站的上传功能直接提交您的文件。' },
{ value: 2, label: '2. Kafka 直接传输:将您的数据发送到我们服务器上的特定 Kafka 主题,确保每条消息都包含带有 source_id 的标头。' },
{ value: 3, label: '有关 Kafka 服务器的信息,请联系您的管理员。' }
]
},
uploadFileSizeLimit: 1024 * 1024 * 1024,
isClick: true
}
},
components: {
Loading
},
computed: {
uploadParams () {
return {
sourceId: this.sourceId
}
}
},
methods: {
dateFormatByAppearance,
clickOption (item) {
this.sourceId = item.id
this.dialogVisible = true
this.fileTypeLimit = `.${item.dataFormat}`
},
// 禁止勾选buildIn为1的项即禁止修改、删除admin的账号
checkSelectable (row) {
return row.isBuiltIn !== 1
},
fileChange (files, fileList) {
if (this.fileList.length > 0 && this.fileList[0].status === 'success') {
this.fileListBack = this.fileList[0]
}
this.fileList = fileList.slice(-1)
},
uploadSuccess () {
this.uploaded = false
this.dialogVisible = false
this.$message.success(this.$t('tip.success'))
},
beforeUpload (file) {
return new Promise((resolve, reject) => {
// 判断后缀,仅支持.csv
if (!_.endsWith(file.name, this.fileTypeLimit)) {
this.$message.error(this.$t('validate.fileTypeLimit', { types: this.fileTypeLimit }))
this.fileList = []
reject(new Error(this.$t('validate.fileTypeLimit', { types: this.fileTypeLimit })))
} else if (file.size > this.uploadFileSizeLimit) { // 判断文件大小
this.$message.error(this.$t('validate.fileSizeLimit', { size: unitConvert(this.uploadFileSizeLimit, unitTypes.byte).join('') }))
this.fileList = []
reject(new Error(this.$t('validate.fileSizeLimit', { size: unitConvert(this.uploadFileSizeLimit, unitTypes.byte).join('') })))
} else {
if (!this.isClick) {
if (this.importedData.length > 0) {
ElMessageBox.confirm(this.$t('tip.uploadFile'), {
confirmButtonText: this.$t('tip.confirm'),
cancelButtonText: this.$t('overall.cancel'),
message: this.$t('tip.uploadFileTips'),
title: this.$t('tip.uploadFile'),
// type: 'warning',
iconClass: 'width:0px;height:0px;',
customClass: 'del-model'
}).then(() => {
resolve()
}).catch(e => {
reject(e)
})
} else {
resolve()
}
} else {
resolve()
}
}
})
},
onUpload () {
this.uploadLoading = true
this.typeSelectDisable = true
this.isClick = false
},
uploadError (error) {
let errorMsg
if (error.message) {
errorMsg = JSON.parse(error.message).message
} else {
errorMsg = 'error'
}
this.uploadLoading = false
this.$message.error(this.$t('tip.uploadFailed', { msg: errorMsg }))
},
tableRowClassName (row) {
if (row.row.isBuiltIn === 1) {
return 'table-disabled-row'
}
}
},
setup () {
// 没上传过文件的提示
const uploadErrorTip = ref('')
return {
uploadErrorTip
}
}
}
</script>

View File

@@ -137,7 +137,7 @@
<div class="bar-header-left">
<div class="bar-value-active"></div>
<div class="bar-value">
<template v-for="(item, index) in tabs" :key="item.name">
<template v-for="(item, index) in tabs" :key="index">
<div class="bar-value-tabs"
:class=" {'is-active': tabType === item.class, 'mousemove-cursor': mousemoveCursor === item.class}"
@mouseenter="mouseenterTab(item)"
@@ -220,7 +220,7 @@
</el-form>
</div>
<div class="dialog-footer">
<button @click="cancel" class="business-button business-button--light">{{ $t('overall.cancel') }}</button>
<button @click="cancle" class="business-button business-button--light">{{ $t('overall.cancel') }}</button>
<button @click="submitConfirm" class="business-button">{{ $t('tip.confirm') }}</button>
</div>
</template>
@@ -464,222 +464,222 @@ export default {
axios.get(url, { params: params }).then(response => {
const res = response.data
if (response.status === 200) {
this.isNoDataForPsiphon3 = res.data.result.length === 0
this.showErrorForPsiphon3 = false
if (!this.isNoDataForPsiphon3) {
const chartsData = res.data.result.map(item => {
return [getMillisecond(item.statTime), item.count]
})
if (this.activeTab === knowledgeCardUpdateRecordType.intelligenceLearning) {
this.echartsInit(chartsData)
if (response.status === 200) {
this.isNoDataForPsiphon3 = res.data.result.length === 0
this.showErrorForPsiphon3 = false
if (!this.isNoDataForPsiphon3) {
const chartsData = res.data.result.map(item => {
return [getMillisecond(item.statTime), item.count]
})
if (this.activeTab === knowledgeCardUpdateRecordType.intelligenceLearning) {
this.echartsInit(chartsData)
}
}
} else {
this.httpError(res)
}
}).catch(e => {
console.error(e)
this.httpError(e)
}).finally(() => {
this.psiphon3Loading = false
})
},
httpError (e) {
this.isNoDataForPsiphon3 = false
this.showErrorForPsiphon3 = true
this.errorMsgForPsiphon3 = this.errorMsgHandler(e)
},
handleActiveBar () {
if (document.querySelector('.psiphon3-bar .bar-value-tabs.is-active')) {
const {
offsetLeft,
clientWidth,
clientLeft
} = document.querySelector('.psiphon3-bar .bar-value-tabs.is-active')
const activeBar = document.querySelector('.psiphon3-bar .bar-value-active')
activeBar.style.cssText += `width: ${clientWidth}px; left: ${offsetLeft + this.leftOffset + clientLeft}px;`
}
},
resize () {
if (this.myChart) {
this.myChart.resize()
}
},
dispatchSelectAction (type, name) {
this.myChart && this.myChart.dispatchAction({
type: type,
name: name
})
},
legendSelectChange (item) {
this.dispatchSelectAction('legendSelect', item.name)
this.tabs.forEach((t) => {
if (t.name !== item.name) {
this.dispatchSelectAction('legendUnSelect', t.name)
}
})
},
timeChange () {
if (this.updateKnowledge.source === 'cn_psiphon3_ip') {
this.init()
}
if (this.activeTab === knowledgeCardUpdateRecordType.intelligenceLearning) {
this.$nextTick(() => {
this.handleActiveBar()
})
}
},
activeChange (item) { // isClick:代表是通过点击操作来的
if (item) {
this.tabType = item.class
}
this.legendSelectChange(item)
if (this.updateKnowledge.source === 'cn_psiphon3_ip') {
this.init()
}
},
mouseenterTab (item) {
if (this.isNoDataForPsiphon3) return
this.mousemoveCursor = item.class
if (this.activeTab === knowledgeCardUpdateRecordType.intelligenceLearning) {
this.$nextTick(() => {
this.handleActiveBar()
})
}
},
mouseleaveTab () {
this.mousemoveCursor = ''
},
fileChange (file, fileList) {
// 判断后缀,仅支持.csv
if (!_.endsWith(file.name, '.csv')) {
this.fileList = []
this.$message.error(this.$t('validate.fileTypeLimit', { types: this.fileTypeLimit }))
} else if (file.size > this.uploadFileSizeLimit) { // 判断文件大小
this.$message.error(this.$t('validate.fileSizeLimit', { size: unitConvert(this.uploadFileSizeLimit, unitTypes.byte).join('') }))
this.fileList = []
} else {
this.fileList = fileList.slice(-1)
}
},
uploadError (error) {
let errorMsg
if (error.message) {
errorMsg = JSON.parse(error.message).message
} else {
errorMsg = 'error'
}
this.uploadLoading = false
this.$message.error(this.$t('tip.uploadFailed', { msg: errorMsg }))
},
uploadSuccess (response) {
this.uploadLoading = false
this.uploaded = true
this.$message.success(this.$t('tip.success'))
this.showAddUpdateDialog = false
this.getCurTabData()
},
beforeUpload (file) {
this.uploadLoading = true
this.showConfirmDialog = false
},
submitConfirm () {
this.showConfirmDialog = true
},
submit () {
this.$refs.knowledgeUpload.submit()
},
cancle () {
this.showAddUpdateDialog = false
},
clickCard (data, event) {
if (data.isSelected) { // 原来为选中,当前点击后未选中
const index = this.checkList.indexOf(data)
if (index > -1) {
this.checkList.splice(index, 1)
}
} else {
this.httpError(res)
}
}).catch(e => {
console.error(e)
this.httpError(e)
}).finally(() => {
this.psiphon3Loading = false
})
},
httpError (e) {
this.isNoDataForPsiphon3 = false
this.showErrorForPsiphon3 = true
this.errorMsgForPsiphon3 = this.errorMsgHandler(e)
},
handleActiveBar () {
if (document.querySelector('.psiphon3-bar .bar-value-tabs.is-active')) {
const {
offsetLeft,
clientWidth,
clientLeft
} = document.querySelector('.psiphon3-bar .bar-value-tabs.is-active')
const activeBar = document.querySelector('.psiphon3-bar .bar-value-active')
activeBar.style.cssText += `width: ${clientWidth}px; left: ${offsetLeft + this.leftOffset + clientLeft}px;`
}
},
resize () {
if (this.myChart) {
this.myChart.resize()
}
},
dispatchSelectAction (type, name) {
this.myChart && this.myChart.dispatchAction({
type: type,
name: name
})
},
legendSelectChange (item) {
this.dispatchSelectAction('legendSelect', item.name)
this.tabs.forEach((t) => {
if (t.name !== item.name) {
this.dispatchSelectAction('legendUnSelect', t.name)
}
})
},
timeChange () {
if (this.updateKnowledge.source === 'cn_psiphon3_ip') {
this.init()
}
if (this.activeTab === knowledgeCardUpdateRecordType.intelligenceLearning) {
this.$nextTick(() => {
this.handleActiveBar()
})
}
},
activeChange (item) { // isClick:代表是通过点击操作来的
if (item) {
this.tabType = item.class
}
this.legendSelectChange(item)
if (this.updateKnowledge.source === 'cn_psiphon3_ip') {
this.init()
}
},
mouseenterTab (item) {
if (this.isNoDataForPsiphon3) return
this.mousemoveCursor = item.class
if (this.activeTab === knowledgeCardUpdateRecordType.intelligenceLearning) {
this.$nextTick(() => {
this.handleActiveBar()
})
}
},
mouseleaveTab () {
this.mousemoveCursor = ''
},
fileChange (file, fileList) {
// 判断后缀,仅支持.csv
if (!_.endsWith(file.name, '.csv')) {
this.fileList = []
this.$message.error(this.$t('validate.fileTypeLimit', { types: this.fileTypeLimit }))
} else if (file.size > this.uploadFileSizeLimit) { // 判断文件大小
this.$message.error(this.$t('validate.fileSizeLimit', { size: unitConvert(this.uploadFileSizeLimit, unitTypes.byte).join('') }))
this.fileList = []
} else {
this.fileList = fileList.slice(-1)
}
},
uploadError (error) {
let errorMsg
if (error.message) {
errorMsg = JSON.parse(error.message).message
} else {
errorMsg = 'error'
}
this.uploadLoading = false
this.$message.error(this.$t('tip.uploadFailed', { msg: errorMsg }))
},
uploadSuccess (response) {
this.uploadLoading = false
this.uploaded = true
this.$message.success(this.$t('tip.success'))
this.showAddUpdateDialog = false
this.getCurTabData()
},
beforeUpload (file) {
this.uploadLoading = true
this.showConfirmDialog = false
},
submitConfirm () {
this.showConfirmDialog = true
},
submit () {
this.$refs.knowledgeUpload.submit()
},
cancel () {
this.showAddUpdateDialog = false
},
clickCard (data, event) {
if (data.isSelected) { // 原来为选中,当前点击后未选中
const index = this.checkList.indexOf(data)
if (index > -1) {
this.checkList.splice(index, 1)
}
} else {
const index = this.checkList.indexOf(data)
if (index === -1) {
this.checkList.push(data)
}
}
const val = !data.isSelected
data.isSelected = val
this.$emit('checkboxStatusChange', val, data)
},
checkboxStatusChange (val, data) {
data.isSelected = val
this.$emit('checkboxStatusChange', val, data)
},
beforeClose (done) {
if (this.myChart) {
this.myChart.dispose()
this.myChart = null
}
done()
},
handleClose () {
this.showUpdateDialog = false
this.showAddUpdateDialog = false
this.uploadLoading = false
},
handleConfirmClose () {
this.showConfirmDialog = false
},
handleUpdateClose () {
this.showAddUpdateDialog = false
},
showUpdate () {
this.showUpdateDialog = true
this.showAddUpdateDialog = false
},
async jumpToUpdatePage (data, showEnable) {
this.updateKnowledge = data
this.showEnable = showEnable
await this.getCurTabData()
if (data.source === 'cn_psiphon3_ip') {
await this.init()
}
this.showUpdate()
if (this.activeTab === knowledgeCardUpdateRecordType.intelligenceLearning) {
this.$nextTick(() => {
this.handleActiveBar()
})
}
},
uploadRecord () {
this.showAddUpdateDialog = true
this.updateObject.name = this.updateKnowledge.name
this.updateObject.label = this.$t(this.updateKnowledge.label)
this.updateObject.description = ''
},
getCurTabData () { // showEnable:true 为psiphon3的知识库false为其它知识库
let params = {
pageSize: -1
}
if (this.showEnable) {
if (this.activeTab === knowledgeCardUpdateRecordType.updateRecord) {
params = {
...params,
opUser: -1
}
} else if (this.activeTab === knowledgeCardUpdateRecordType.intelligenceLearning) {
params = {
...params,
opUser: 0
const index = this.checkList.indexOf(data)
if (index === -1) {
this.checkList.push(data)
}
}
}
this.updateLogLoading = true
this.updateHistoryList = []
axios.get(api.knowledgeBaseLog + '/' + this.updateKnowledge.knowledgeId, { params: params }).then(res => {
this.updateHistoryList = res.data.data.list
if (this.updateHistoryList[0]) {
this.currentVersion = this.updateHistoryList[0].commitVersion + 1
const val = !data.isSelected
data.isSelected = val
this.$emit('checkboxStatusChange', val, data)
},
checkboxStatusChange (val, data) {
data.isSelected = val
this.$emit('checkboxStatusChange', val, data)
},
beforeClose (done) {
if (this.myChart) {
this.myChart.dispose()
this.myChart = null
}
/*
done()
},
handleClose () {
this.showUpdateDialog = false
this.showAddUpdateDialog = false
this.uploadLoading = false
},
handleConfirmClose () {
this.showConfirmDialog = false
},
handleUpdateClose () {
this.showAddUpdateDialog = false
},
showUpdate () {
this.showUpdateDialog = true
this.showAddUpdateDialog = false
},
async jumpToUpdatePage (data, showEnable) {
this.updateKnowledge = data
this.showEnable = showEnable
await this.getCurTabData()
if (data.source === 'cn_psiphon3_ip') {
await this.init()
}
this.showUpdate()
if (this.activeTab === knowledgeCardUpdateRecordType.intelligenceLearning) {
this.$nextTick(() => {
this.handleActiveBar()
})
}
},
uploadRecord () {
this.showAddUpdateDialog = true
this.updateObject.name = this.updateKnowledge.name
this.updateObject.label = this.$t(this.updateKnowledge.label)
this.updateObject.description = ''
},
getCurTabData () { // showEnable:true 为psiphon3的知识库false为其它知识库
let params = {
pageSize: -1
}
if (this.showEnable) {
if (this.activeTab === knowledgeCardUpdateRecordType.updateRecord) {
params = {
...params,
opUser: -1
}
} else if (this.activeTab === knowledgeCardUpdateRecordType.intelligenceLearning) {
params = {
...params,
opUser: 0
}
}
}
this.updateLogLoading = true
this.updateHistoryList = []
axios.get(api.knowledgeBaseLog + '/' + this.updateKnowledge.knowledgeId, { params: params }).then(res => {
this.updateHistoryList = res.data.data.list
if (this.updateHistoryList[0]) {
this.currentVersion = this.updateHistoryList[0].commitVersion + 1
}
/*
this.hasUpdatingRecord = false
this.updateHistoryList.forEach(item => {
if (item.isUpdating) { // if(item.isUpdating){//????????

View File

@@ -138,7 +138,7 @@
<div class="bar-header-left">
<div class="bar-value-active" ></div>
<div class="bar-value">
<template v-for="item in tabs" :key="item.name">
<template v-for="(item, index) in tabs" :key="index">
<div class="bar-value-tabs"
:class=" {'is-active': tabType === item.class, 'mousemove-cursor': mousemoveCursor === item.class}"
@mouseenter="mouseenterTab(item)"
@@ -221,7 +221,7 @@
</el-form>
</div>
<div class="dialog-footer">
<el-button @click="cancel">{{ $t('overall.cancel') }}</el-button>
<el-button @click="cancle">{{ $t('overall.cancel') }}</el-button>
<el-button type="primary" @click="submitConfirm">{{ $t('tip.confirm') }}</el-button>
</div>
</template>
@@ -550,7 +550,7 @@ export default {
submit () {
this.$refs.knowledgeUpload.submit()
},
cancel () {
cancle () {
this.showAddUpdateDialog = false
},
clickCard (data, event) {
@@ -698,7 +698,7 @@ export default {
this.switchKnowledgeId = id
return false
},
cancelSwitch () {
cancleSwitch () {
this.showConfirmSwitch = false
},
switchLearning () {

View File

@@ -111,7 +111,7 @@ export default {
},
methods: {
statusChange (plugin) {
const triggerStatus = plugin.triggerStatus
let triggerStatus = plugin.triggerStatus
let statusUrl = triggerStatus === '1' ? api.pluginStatusEnable : api.pluginStatusDisable
statusUrl = statusUrl.replace('{{id}}', plugin.id)
axios.post(statusUrl).then(response => {

View File

@@ -135,10 +135,10 @@ import table from '@/mixins/table'
import Loading from '@/components/common/Loading'
import axios from 'axios'
import { api } from '@/utils/api'
import { storageKey, tagIntent } from '@/utils/constants'
import { urlParamsHandler, overwriteUrl, headerCellClass, getYAxisBeginValue } from '@/utils/tools'
import { storageKey, tagIntent, chartColor3 } from '@/utils/constants'
import { urlParamsHandler, overwriteUrl, headerCellClass } from '@/utils/tools'
import { ref, shallowRef } from 'vue'
import { getNowTime, getSecond } from '@/utils/date-util'
import { dateFormatToUTC, getNowTime, getSecond } from '@/utils/date-util'
import chartDetectionPagination from '@/views/charts/charts/chartDetectionPagination'
import ChartNoData from '@/views/charts/charts/ChartNoData'
import { useRoute } from 'vue-router'
@@ -233,7 +233,7 @@ export default {
*/
setup () {
const { query } = useRoute()
/* // 获取url携带的range、startTime、endTime
/*// 获取url携带的range、startTime、endTime
const rangeParam = query.range
const startTimeParam = query.startTime
const endTimeParam = query.endTime
@@ -250,7 +250,7 @@ export default {
} else {
timeFilter.value.startTime = parseInt(startTimeParam)
timeFilter.value.endTime = parseInt(endTimeParam)
} */
}*/
const dateRangeValue = DEFAULT_TIME_FILTER_RANGE.tag.activeEntity || 60
const timeFilter = ref({ dateRangeValue })
@@ -377,15 +377,9 @@ export default {
echartsInit (data, item, type) {
const dom = document.getElementById(`chart${item.id}`)
if (dom && item) {
// 判断所有曲线的第一个值和最后一个值若均为0则删除该点
// 判断total曲线的第一个值和最后一个值若是0则删除
if (data.length > 1 && data[data.length - 1].ipCount === 0 && data[data.length - 1].domainCount === 0) {
data.splice(data.length - 1, 1)
}
if (data.length > 1 && data[0].ipCount === 0 && data[0].domainCount === 0) {
data.splice(0, 1)
}
// if (!this.myChart) {
this.myChart = echarts.init(dom)
// }
this.chartOption = tagLineChartOption
const series = []
if (item.indicatorType && item.indicatorType.indexOf('IP') > -1) {
@@ -400,6 +394,7 @@ export default {
}
},
name: 'IP',
stack: 'Total',
lineStyle: {
color: '#35ADDA',
width: 1
@@ -426,6 +421,7 @@ export default {
}
},
name: this.$t('overall.domain'),
stack: 'Total',
lineStyle: {
color: '#E48F3E',
width: 1
@@ -441,25 +437,12 @@ export default {
})
}
this.chartOption.series = series
this.chartOption.yAxis[0].startValue = getYAxisBeginValue(series)
this.chartOption.yAxis[0].axisLabel.formatter = (value) => {
return unitConvert(value, 'number').join('')
}
this.myChartArray.push(this.myChart)
this.myChart.setOption(this.chartOption)
const _this = this
this.myChart.on('legendselectchanged', function (params) {
const newSeries = []
if (params.selected.IP) {
newSeries.push(series[0])
}
if (params.selected.Domain) {
newSeries.push(series[1])
}
const _option = _this.myChart.getOption()
_option.yAxis[0].startValue = getYAxisBeginValue(newSeries)
_this.myChart.setOption(_option)
})
this.$nextTick(() => {
this.myChart.resize()
})
@@ -489,9 +472,9 @@ export default {
desc = this.$t('tag.observedEntities2')
}
}
/* if (this.observedCount > 0) {
/*if (this.observedCount > 0) {
desc += `, IP ${this.observedIpCount}, ${this.$t('overall.domain2')} ${this.observedDomainCount}`
} */
}*/
} else {
// 只有单种实体时,单个描述
if (this.disableToEntity) {

View File

@@ -1,5 +1,5 @@
import { handleSpecialCode, tableSort } from '@/utils/tools'
import { defaultPageSize, fromRoute, position, storageKey, dbTableColumnCustomizeConfigPre, dbTableColumnCustomizeConfig } from '@/utils/constants'
import { tableSort } from '@/utils/tools'
import { defaultPageSize, fromRoute, position, storageKey, dbTableColumnCustomizeConfigPre,dbTableColumnCustomizeConfig } from '@/utils/constants'
import _ from 'lodash'
import { ref } from 'vue'
import pagination from '@/components/common/Pagination'
@@ -42,7 +42,6 @@ export default {
delFlag: false,
disableEdit: true, // 编辑按钮是否不可用,当选择多条记录的时候,编辑按钮不可用
disableDelete: true,
disableView: true,
operationWidth: '165', // 操作列宽
loading: true,
isNoData: false
@@ -92,18 +91,7 @@ export default {
}
})
this.disableEdit = this.batchDeleteObjs.length !== 1
this.disableView = this.batchDeleteObjs.length !== 1
this.disableDelete = this.batchDeleteObjs.length < 1
const obj = objs.find(d => d.usage > 0)
if (obj) {
this.disableDelete = true
this.disableEdit = true
}
const obj1 = objs.find(d => d.isBuiltIn > 0)
if (obj1) {
this.disableDelete = true
this.disableEdit = true
}
},
getTableData (params, isAll, isClearType) {
if (isAll) {
@@ -254,9 +242,6 @@ export default {
axios.get(`${this.url}/${this.batchDeleteObjs[0].id}`).then(response => {
if (response.status === 200) {
this.object = response.data.data
if (this.url === '/sys/i18n') {
this.object.value = handleSpecialCode(this.object.value)
}
this.rightBox.show = true
}
})
@@ -443,11 +428,11 @@ export default {
localStorageTableTitle = await indexedDBUtils.selectTable(tableName).get({ id: userId })
}
const curTableTitles = this.$refs.dataTable && this.$refs.dataTable.tableTitle ? this.$refs.dataTable.tableTitle : []
const curTableConfig = dbTableColumnCustomizeConfig.find(item => item.tableName === tableName)
if (localStorageTableTitle && curTableConfig &&
let curTableTitles = this.$refs.dataTable && this.$refs.dataTable.tableTitle ? this.$refs.dataTable.tableTitle : []
let curTableConfig = dbTableColumnCustomizeConfig.find(item => item.tableName === tableName)
if(localStorageTableTitle && curTableConfig &&
localStorageTableTitle.version !== curTableConfig.version && curTableTitles) {
if (this.$refs.dataList) {
if(this.$refs.dataList) {
this.$refs.dataList.updateCustomTableTitle(curTableTitles)
}
await indexedDBUtils.selectTable(tableName).put({

View File

@@ -141,272 +141,6 @@ if (openMock) {
data.status = 1
}
return {
msg: 'success',
code: 200,
data: data
}
})
Mock.mock(new RegExp(urlAndVersion + '/detection/event/keyFields/statistics.*'), 'get', function (requestObj) {
const data = {
resultType: 'table',
result: [
{ key: '192.168.1.1, test.com', count: 25 },
{ key: 'baidu.com,app', count: 23 },
{ key: '192.168.2.33, app', count: 15 },
{ key: '192.168.8.8, test.com', count: 12 },
{ key: 'baidu.com, test.com', count: 8 },
{ key: '192.168.1.101, test.cn', count: 5 },
{ key: 'jd.com, app', count: 25 }
]
}
return {
msg: 'success',
code: 200,
data: data
}
})
Mock.mock(new RegExp(urlAndVersion + '/detection/event/list.*'), 'get', function (requestObj) {
const data = {
resultType: 'table',
result: [
{
eventId: 1212,
eventType: 'Anonymity',
eventName: 'Tor',
matchIds: '1, 2',
keyFields: 'ip, domain',
keyValues: '192.168.1.1, test.com',
ruleId: 2,
ruleVersion: '1',
ruleType: 'indicator_match',
isBuiltin: 1,
status: 1,
startTime: 1697092617,
endTime: 1697092777,
durationS: 30
},
{
eventId: 1213,
eventType: 'Anonymity',
eventName: 'Tor',
matchIds: '3, 4',
keyFields: 'ip, domain',
keyValues: '192.168.1.1, test.com',
ruleId: 3,
ruleVersion: '1',
ruleType: 'threshold',
isBuiltin: 1,
status: 1,
startTime: 1697092617,
endTime: 1697092777,
durationS: 30
},
{
eventId: 1214,
eventType: 'Anonymity',
eventName: 'Tor',
matchIds: '5, 6',
keyFields: 'ip, domain',
keyValues: '192.168.1.1, test.com',
ruleId: 3,
ruleVersion: '1',
ruleType: 'sequence/unordered_sequence',
isBuiltin: 1,
status: 0,
startTime: 1697092617,
endTime: 1697092777,
durationS: 30
}
]
}
return {
msg: 'success',
code: 200,
data: data
}
})
Mock.mock(new RegExp(urlAndVersion + '/detection/event/name/statistics.*'), 'get', function (requestObj) {
const data = {
resultType: 'table',
result: [
{
eventName: 'event1',
count: 25
},
{
eventName: 'event2',
count: 23
},
{
eventName: 'event3',
count: 15
},
{
eventName: 'event4',
count: 12
}
]
}
return {
msg: 'success',
code: 200,
data: data
}
})
Mock.mock(new RegExp(urlAndVersion + '/detection/event/count.*'), 'get', function (requestObj) {
const data = {
resultType: 'single',
result: 3
}
return {
msg: 'success',
code: 200,
data: data
}
})
Mock.mock(new RegExp(urlAndVersion + '/detection/security/event/timedistribution.*'), 'get', function (requestObj) {
const data = {
resultType: 'table',
result: [
{
statTime: 1722565322,
severity: 'critical',
count: 25
},
{
statTime: 1722565502,
severity: 'info',
count: 25
},
{
statTime: 1722566702,
severity: 'critical',
count: 25
},
{
statTime: 1722568322,
severity: 'critical',
count: 25
}
]
}
return {
msg: 'success',
code: 200,
data: data
}
})
Mock.mock(new RegExp(urlAndVersion + '/detection/security/event/detail.*'), 'get', function (requestObj) {
const data = {
eventIds: [1, 2, 3, 4, 5],
indicatorMatchs: [],
thresholdMatchs: [
{
matchId: 2,
ruleId: 2,
ruleType: 'threshold',
eventType: 'Command and Control',
eventName: 'event2',
severity: 'high',
keyFields: 'domain',
keyValues: 'test.com',
thresholdValue: 3,
metricValue: 5,
reset: 60,
startTime: 169780543432,
endTime: 169790486213
}
],
sequenceMatchs: [
{
matchId: 3,
ruleId: 3,
ruleType: 'sequence/unordered_sequence',
eventType: 'Command and Control',
eventName: 'event3',
severity: 'low',
eventInfo: '[{"stage_id":"A","recv_time":10000000,"client_ip":"192.168.1.1"},{"stage_id":"B","recv_time":10000001,"client_ip":"192.168.1.2",...}]'
}
]
}
const indicatorMatchObj = {
matchId: 1,
ruleId: 1,
ruleType: 'indicator_match',
eventType: 'Anonymity',
eventName: 'event1',
severity: 'critical',
matchNum: 20,
indicatorFields: 'ip,domain',
indicatorValues: '192.168.1.1,test.com',
reset: 60,
clientIp: '192.168.1.1',
client_country_region: 'china',
client_super_admin_area: 'beijing',
client_admin_area: 'beijing',
client_longitude: '116.30',
client_latitude: '40.50',
serverIp: '192.168.1.2',
server_country_region: 'china',
server_super_admin_area: 'beijing',
server_admin_area: 'beijing',
server_longitude: '116.30',
server_latitude: '40.50',
domain: 'test.com',
app: 'test',
matchTime: 1722503700000
}
for (let i = 0; i < 10; i++) {
data.indicatorMatchs.push(JSON.parse(JSON.stringify(indicatorMatchObj)))
indicatorMatchObj.matchId += 1
indicatorMatchObj.ruleId += 2
indicatorMatchObj.matchTime += 900000
indicatorMatchObj.matchNum = Math.floor((Math.random() * 100) + 1)
}
return {
msg: 'success',
code: 200,
data: data
}
})
Mock.mock(new RegExp(urlAndVersion + '/detection/event/status/statistics.*'), 'get', function (requestObj) {
const data = {
resultType: 'table',
result: [
{
status: 1,
count: 25
},
{
status: 0,
count: 23
}
]
}
return {
msg: 'success',
code: 200,
data: data
}
})
Mock.mock(new RegExp(urlAndVersion + '/detection/event/type/statistics.*'), 'get', function (requestObj) {
const data = {
resultType: 'table',
result: [
{ eventType: 'Anonymity', count: 25 },
{ eventType: 'Command and Control', count: 13 }
]
}
return {
msg: 'success',
code: 200,

View File

@@ -472,7 +472,7 @@ if (openMock) {
pageSize: 10,
total: 4,
list: [
{ entityValue: 'test123987', entityType: 'subscriber' },
{ entityValue: 'test123987', entityType: 'subscriber_id' },
{ entityValue: '172.217.24.66', entityType: 'ip' },
{ entityValue: 'gdbzkz.com', entityType: 'domain' },
{ entityValue: 'qqvideo', entityType: 'app' }
@@ -544,7 +544,7 @@ if (openMock) {
}
break
}
case ('subscriber'): {
case ('subscriber_id'): {
result = {
phone_number: '1568912455',
imei: 'r45ty5454fh',
@@ -850,7 +850,7 @@ const getEntityType = (url) => {
entityType = 'app'
}
if (url.indexOf('/subscriber?') > -1) {
entityType = 'subscriber'
entityType = 'subscriber_id'
}
return entityType
}
@@ -866,8 +866,8 @@ const getRelateType = (url) => {
if (url.indexOf('/apps?') > -1) {
entityType = 'app'
}
if (url.indexOf('/subscriber?') > -1) {
entityType = 'subscriber'
if (url.indexOf('/subscriber_id?') > -1) {
entityType = 'subscriber_id'
}
return entityType
}

View File

@@ -337,43 +337,43 @@ if (openMock) {
data: {
list: [
{
subscriberId: 111,
group: 'terrorist',
info: 'terrorist leader',
location: 'china',
active: 1
"subscriberId":111,
"group": "terrorist",
"info": "terrorist leader",
"location": "china",
"active": 1
},
{
subscriberId: 444,
group: 'terrorist',
info: 'terrorist leader',
location: 'china',
active: 1
"subscriberId":444,
"group": "terrorist",
"info": "terrorist leader",
"location": "china",
"active": 1
},
{
subscriberId: 555,
group: 'terrorist',
info: 'terrorist leader',
location: 'china',
active: 0
}, {
subscriberId: 666,
group: 'terrorist',
info: 'terrorist leader',
location: 'china',
active: 1
}, {
subscriberId: 777,
group: 'terrorist',
info: 'terrorist leader',
location: 'china',
active: 0
}, {
subscriberId: 888,
group: 'terrorist',
info: 'terrorist leader',
location: 'china',
active: 1
"subscriberId":555,
"group": "terrorist",
"info": "terrorist leader",
"location": "china",
"active": 0
},{
"subscriberId":666,
"group": "terrorist",
"info": "terrorist leader",
"location": "china",
"active": 1
},{
"subscriberId":777,
"group": "terrorist",
"info": "terrorist leader",
"location": "china",
"active": 0
},{
"subscriberId":888,
"group": "terrorist",
"info": "terrorist leader",
"location": "china",
"active": 1
}
]
}
@@ -384,53 +384,53 @@ if (openMock) {
msg: 'success',
code: 200,
data: {
total: 1,
pageSize: 20,
pageNo: 1,
pages: 1,
total:1,
pageSize:20,
pageNo:1,
pages:1,
list: [
{
subscriberId: 111,
active: 1,
phone_number: 18601680302,
follow: 1
"subscriberId":111,
"active": 1,
"phone_number": 18601680302,
"follow": 1
},
{
subscriberId: 222,
active: 1,
phone_number: 18601680303,
follow: 0
"subscriberId":222,
"active": 1,
"phone_number": 18601680303,
"follow": 0
},
{
subscriberId: 333,
active: 0,
phone_number: 18601680304,
follow: 0
}, {
subscriberId: 444,
active: 1,
phone_number: 18601680305,
follow: 1
}, {
subscriberId: 555,
active: 0,
phone_number: 18601680306,
follow: 1
}, {
subscriberId: 666,
active: 1,
phone_number: 18601680307,
follow: 1
}, {
subscriberId: 777,
active: 1,
phone_number: 18601680308,
follow: 1
}, {
subscriberId: 888,
active: 1,
phone_number: 18601680300,
follow: 1
"subscriberId":333,
"active": 0,
"phone_number": 18601680304,
"follow": 0
},{
"subscriberId":444,
"active": 1,
"phone_number": 18601680305,
"follow": 1
},{
"subscriberId":555,
"active": 0,
"phone_number": 18601680306,
"follow": 1
},{
"subscriberId":666,
"active": 1,
"phone_number": 18601680307,
"follow": 1
},{
"subscriberId":777,
"active": 1,
"phone_number": 18601680308,
"follow": 1
},{
"subscriberId":888,
"active": 1,
"phone_number": 18601680300,
"follow": 1
}
]
}

View File

@@ -197,18 +197,6 @@ export function handleComponent (code) {
case 'locationMap':
case 'traceTracking':
return () => import('@/views/location/Index')
case 'dataSource':
return () => import('@/views/setting/sources/Sources')
case 'createDataSource':
case 'editDataSource':
case 'viewDataSource':
return () => import('@/views/setting/sources/SourcesForm')
case 'entityIntegration':
return () => import('@/views/setting/entitySetting/EntitySetting')
case 'createEntityIntegration':
case 'editEntityIntegration':
case 'viewEntityIntegration':
return () => import('@/views/setting/entitySetting/EntitySettingForm')
default:
return null
}

View File

@@ -176,17 +176,6 @@ export const api = {
create: {
topKeys: apiVersion + '/detection/topKeys', // topKeys列表
create: apiVersion + '/rule/detection'
},
event: {
keyStatistics: apiVersion + '/detection/event/keyFields/statistics', // 事件key统计
nameStatistics: apiVersion + '/detection/event/name/statistics', // 事件名称统计
statusStatistics: apiVersion + '/detection/event/status/statistics', // 状态统计
typeStatistics: apiVersion + '/detection/event/type/statistics', // 事件类型统计
list: apiVersion + '/detection/event/list', // 事件列表
count: apiVersion + '/detection/event/count', // 事件总数
timeDistribution: apiVersion + '/detection/event/timedistribution', // 事件等级分布
detail: apiVersion + '/detection/event/detail', // 事件详情
detailTimeDistribution: apiVersion + '/detection/event/detail/timedistribution' // 事件详情分布统计
}
},
// Dashboard
@@ -334,7 +323,6 @@ export const api = {
subscriberBasicInfo: apiVersion + '/entity/explorer/detail/basic/subscriber', // subscriber实体响应
domainTags: apiVersion + '/entity/explorer/detail/kb/intelligence/tag/domain', // Domain实体标签响应结果
ipTags: apiVersion + '/entity/explorer/detail/kb/intelligence/tag/ip', // ip实体标签响应结果
subscriberTags: apiVersion + '/entity/explorer/detail/kb/intelligence/tag/subscriber', // ip实体标签响应结果
domainThroughput: apiVersion + '/entity/explorer/detail/traffic/throughput/domain', // 实体流量信息
ipThroughput: apiVersion + '/entity/explorer/detail/traffic/throughput/ip', // 实体流量信息
appThroughput: apiVersion + '/entity/explorer/detail/traffic/throughput/app', // 实体流量信息
@@ -379,22 +367,12 @@ export const api = {
density: apiVersion + '/locationIntelligence/population/density',
trend: apiVersion + '/locationIntelligence/active/trend',
count: apiVersion + '/locationIntelligence/active/count',
baseStation: apiVersion + '/cell/list',
baseStation: apiVersion + '/locationIntelligence/baseStation',
list: apiVersion + '/locationIntelligence/list',
totalCount: apiVersion + '/locationIntelligence/list/count',
followedSubscriber: apiVersion + '/locationIntelligence/followed/subscribers',
tracking: apiVersion + '/locationIntelligence/trace/tracking',
follow: apiVersion + '/locationIntelligence/follow',
geoLocation: apiVersion + 'locationIntelligence/geolocation'
},
setting: {
source: {
source: apiVersion + '/entity/sources', // get列表查询delete删除post新增put修改
sourceUpload: apiVersion + '/entity/sources/upload' // 文件上传post
},
profiles: {
profiles: apiVersion + '/entity/integrations' // get列表查询delete删除post新增put修改
}
}
}

File diff suppressed because one or more lines are too long

View File

@@ -106,9 +106,7 @@ export function timestampToList (time) {
* @returns {number}
*/
export function millTimestampDiffFromTz () {
const localOffset = Number(localStorage.getItem(storageKey.timezoneLocalOffset)) * 3600 * 1000
const serverOffset = window.$dayJs.tz().utcOffset() * 60 * 1000
return localOffset - serverOffset
return parseInt(localStorage.getItem(storageKey.timezoneLocalOffset)) * 3600 * 1000 - window.$dayJs.tz().utcOffset() * 60 * 1000
}
/**
* echarts时间类型横坐标formatter
@@ -211,15 +209,3 @@ export function getDurationsTimeByType (number, type) {
}
return `P${T}${number}${switchValueByDateType(type)}`
}
export function getNowDate (timeFilter) {
if (timeFilter?.dateRangeValue > -1) {
return {
startTime: (new Date()).getTime() - (timeFilter.dateRangeValue * 60 * 1000),
endTime: (new Date()).getTime(),
dateRangeValue: { value: timeFilter.dateRangeValue }
}
} else {
return { ...timeFilter, dateRangeValue: { value: timeFilter.dateRangeValue } }
}
}

View File

@@ -1,13 +0,0 @@
import * as turf from '@turf/turf'
export function generateRectanglePolygon (minLongitude, minLatitude, maxLongitude, maxLatitude) {
return turf.polygon([
[
[minLongitude, minLatitude],
[minLongitude, maxLatitude],
[maxLongitude, maxLatitude],
[maxLongitude, minLatitude],
[minLongitude, minLatitude]
]
])
}

View File

@@ -452,15 +452,6 @@ export const enumerateData = [
{ code: _this.$t('overall.low'), code1: 'overall.low', value: 'low' },
{ code: _this.$t('overall.info'), code1: 'overall.info', value: 'info' }
]
},
{
name: 'ruleType',
data: [
{ code: 'indicator_match', value: 1 },
{ code: 'threshold', value: 2 },
{ code: 'sequence', value: 3 },
{ code: 'unordered_sequence', value: 4 }
]
}
]

View File

@@ -2,34 +2,34 @@ import vue from '@/main.js'
// import Moment from "moment/moment";
// import {transformToUTCTime} from './TimeZone.js'
// 默认Schema 延时15s ,时间粒度 1s
//默认Schema 延时15s ,时间粒度 1s
const defaultSchema = {
doc: {
measurements: {
granularity: 1,
ingestion_delay: 15
"doc": {
"measurements": {
"granularity": 1,
"ingestion_delay": 15
}
}
}
let schemaDict = null
function getSchemaFromLocal (schemaType) {
let schemaData = null
let schemaDict=null;
function getSchemaFromLocal(schemaType) {
let schemaData=null
// if(schemaDict?.[schemaType]){
// schemaData=schemaDict
// }else{
schemaData = localStorage.getItem('TSGSchema')
// }
if (!schemaData) {
return null
return null;
}
const storeData = JSON.parse(schemaData)[schemaType]
const storeData = JSON.parse(schemaData)[schemaType];
// 如果根据key没有找到数据直接返回空
if (!storeData) {
return null
return null;
}
const parsedData = storeData
const currentTimestamp = new Date().getTime()
const parsedData = storeData;
const currentTimestamp = new Date().getTime();
// 将当前的时间戳和保存在storage中的timestamp进行比较
// 如果时间差小于等于过期时间说明没有过期,直接返回数据
@@ -37,9 +37,9 @@ function getSchemaFromLocal (schemaType) {
if (currentTimestamp - parsedData.timestamp <= parsedData.expire) {
return parsedData.value ? JSON.parse(parsedData.value) : parsedData.value
} else {
setDashboardSchema(schemaType, '')
setDashboardSchema(schemaType,'')
}
return null
return null;
}
/**
@@ -48,36 +48,37 @@ function getSchemaFromLocal (schemaType) {
* @param {*} value 保存的数据
* @param {*} expire 过期时间默认为1分钟
*/
function setDashboardSchema (schemaType, value, expire = 60000) {
const schemaData = localStorage.getItem('TSGSchema')
function setDashboardSchema(schemaType, value, expire = 60000) {
let schemaData = localStorage.getItem('TSGSchema');
if (!schemaData) {
localStorage.setItem('TSGSchema', '{}')
}
const TSGSchema = JSON.parse(localStorage.getItem('TSGSchema'))
let TSGSchema = JSON.parse(localStorage.getItem('TSGSchema'))
TSGSchema[schemaType] = {
value: value,
expire: expire,
timestamp: new Date().getTime()
}
const stringfiedData = JSON.stringify(TSGSchema)
localStorage.setItem('TSGSchema', stringfiedData)
schemaDict = TSGSchema
const stringfiedData = JSON.stringify(TSGSchema);
localStorage.setItem('TSGSchema', stringfiedData);
schemaDict=TSGSchema;
}
// 获取过期时间毫秒数
function getExpireTime (data) {
const expireDate = data.expireDate
if (!expireDate) {
function getExpireTime(data){
let expireDate=data.expireDate
if(!expireDate){
return 24 * 60 * 60 * 1000
}
const expireTime = new Date().getTime() - expireDate
let expireTime=new Date().getTime()-expireDate
return expireTime
}
function getSchemaFromRemote (schemaType) {
function getSchemaFromRemote(schemaType) {
return vue.$get(`/interface/gateway/api/galaxy/v1/metadata/schema/${schemaType}`).then(res => {
if (res.status === 200) {
const expireTime = getExpireTime(res.data)
let expireTime=getExpireTime(res.data)
setDashboardSchema(schemaType, JSON.stringify(res.data), expireTime)
return res.data
}
@@ -88,13 +89,14 @@ function getSchemaFromRemote (schemaType) {
})
}
// async 延时时间
// 转换时间 start end schmaType 相对时间 绝对时间
// 时间粒度
// 获取Schema数据,存在于local 直接取,不存在 直接请求,存本地
async function getSchemaInfo (schemaType = '') {
let schemaInfo = getSchemaFromLocal(schemaType)
//获取Schema数据,存在于local 直接取,不存在 直接请求,存本地
async function getSchemaInfo(schemaType = '') {
var schemaInfo = getSchemaFromLocal(schemaType)
if (!schemaInfo) {
schemaInfo = await getSchemaFromRemote(schemaType)
}
@@ -108,26 +110,26 @@ async function getSchemaInfo (schemaType = '') {
*
* granularity 单位必须是S 秒
* */
async function getTimeQueryParams ({ start, end, schemaType = '', granularity = 1, toUtc = false, delay = false }) {
const schemaData = await getSchemaInfo(schemaType)
async function getTimeQueryParams({start, end, schemaType = '', granularity = 1, toUtc = false, delay = false}) {
let schemaData = await getSchemaInfo(schemaType);
const schema_ingestion_delay = schemaData?.doc?.measurements?.ingestion_delay || 0
const schema_granularity = schemaData?.doc?.measurements?.granularity || 1
const schema_ingestion_delay = schemaData?.doc?.measurements?.ingestion_delay || 0;
const schema_granularity = schemaData?.doc?.measurements?.granularity || 1;
// 这里需要考虑 传入的是UTC 时间,Moment 可以正常处理吗
const delayTime = delay ? schema_ingestion_delay : 0
//这里需要考虑 传入的是UTC 时间,Moment 可以正常处理吗
var delayTime = delay ? schema_ingestion_delay : 0;
// let startDate = Moment(start).subtract(delayTime, 'seconds')
// let endDate = Moment(end).subtract(delayTime, 'seconds')
const startDate = '1'
const endDate = '2'
let startDate = '1'
let endDate = '2'
let startStr = startDate.format('YYYY-MM-DD HH:mm:ss')
let endStr = endDate.format('YYYY-MM-DD HH:mm:ss')
var startStr = startDate.format('YYYY-MM-DD HH:mm:ss')
var endStr = endDate.format('YYYY-MM-DD HH:mm:ss')
// 前端计算时间粒度,不能比Schema 支持的最小时间粒度 小
const alignmentPeriod = schema_granularity > granularity ? schema_granularity : granularity
//前端计算时间粒度,不能比Schema 支持的最小时间粒度 小
var alignmentPeriod = schema_granularity > granularity ? schema_granularity : granularity
// UTC 转换
//UTC 转换
if (toUtc) {
// startStr = transformToUTCTime(startStr)
// endStr = transformToUTCTime(endStr)
@@ -137,8 +139,8 @@ async function getTimeQueryParams ({ start, end, schemaType = '', granularity =
return {
start: startStr,
end: endStr,
granularity: 'PT' + schema_granularity + 'S',
alignmentPeriod: 'PT' + alignmentPeriod + 'S'
granularity: 'PT'+schema_granularity+'S',
alignmentPeriod: 'PT'+alignmentPeriod+'S',
}
}
@@ -146,4 +148,4 @@ export default {
getTimeQueryParams,
getSchemaInfo
}
export { getSchemaFromLocal, getSchemaInfo, setDashboardSchema, getSchemaFromRemote, getTimeQueryParams }
export {getSchemaFromLocal, getSchemaInfo, setDashboardSchema, getSchemaFromRemote, getTimeQueryParams};

View File

@@ -1268,6 +1268,24 @@ export function getIndexByEventSeverity (type) {
}
}
export function getQueryByFlag2 (type, condition) {
switch (type) {
case 'country':
case 'asn':
case 'province':
case 'city':
case 'isp': {
return `${type}='${condition[1]}'`
}
case 'idcRenter': {
return `idc_renter='${condition[1]}'`
}
default: {
return `${condition[0]}'${condition[1]}'`
}
}
}
/**
根据语言环境获取字符所占像素px
*/
@@ -1563,64 +1581,6 @@ const tagValueHandler = (value) => {
return find ? find.name : value
}
export const headerCellClass = 'my-header-cell-class'
/**
* & 被转译为&amp; 将转义后的值转为 &
*/
export const handleSpecialCode = (str) => {
return str.indexOf('&amp;') > -1 ? str.replaceAll('&amp;', '&') : str
}
/**
* 严重程度code和字符转换
* @param code
* @returns {string}
*/
export const getSeverityByCode = (code) => {
switch (code) {
case 5:
case '5': {
return 'Critical'
}
case 4:
case '4': {
return 'High'
}
case 3:
case '3': {
return 'Medium'
}
case 2:
case '2': {
return 'Low'
}
case 1:
case '1': {
return 'Info'
}
}
}
export function getYAxisBeginValue (data) {
let max
let min
data.forEach(line => {
line.data && line.data.forEach(value => {
if (max === undefined || max < value[1]) {
max = value[1]
}
if (min === undefined || min > value[1]) {
min = value[1]
}
})
})
if (_.isNumber(min) && min >= 100) {
const diff = max - min
if (diff / min < 0.5) {
const minMDiff = min - diff > 0.8 * min ? min - diff : 0.8 * min
return Math.floor(minMDiff / Math.pow(10, `${Math.floor(minMDiff)}`.length - 2)) * Math.pow(10, `${Math.floor(minMDiff)}`.length - 2)
}
}
return 0
export const headerCellClass = (row) => {
return 'my-header-cell-class'
}

View File

@@ -140,8 +140,8 @@ export function getUnitType (column) {
}
/* 单位转换,返回转换后的[value, unit]type=time时若value<1ms返回<1mstype=percent时若value<0.01%,返回<0.01% */
export function valueToRangeValue (value, unitType, sourceUnit, targetUnit, dot) {
const values = unitConvert(value, unitType, sourceUnit, targetUnit, dot)
export function valueToRangeValue (value, unitType,sourceUnit, targetUnit, dot) {
const values = unitConvert(value, unitType,sourceUnit, targetUnit, dot)
if (values[0] === '-') {
return values
}

View File

@@ -67,7 +67,7 @@ export default {
dateIssued: '',
dateExpires: ''
},
loading: false
loading:false
}
},
components: {

View File

@@ -7,7 +7,7 @@
class="map-chart__legend"
:class="`${currentLegendIndex === index ? 'map-chart__legend--active' : ''}`"
v-for="(legend, index) in legends"
:key="item.name"
:key="index"
@click="changeLegend(index)"
>
<div

View File

@@ -7,18 +7,18 @@
<div class="circle-icon" v-else-if="score <= 4" :class="{'data-score-yellow': score <= 4}" ></div>
<div class="circle-icon" v-else-if="score <= 6" :class="{'data-score-green': score <= 6}" ></div>
Score:{{score}}
</div>
<div v-if="showEntityDetail" class="panel-show-detail">
<el-tooltip
effect="light"
trigger="hover"
:content="$t('entity.jumpToEntityDetails')"
placement="right"
popper-class="panel-tooltip"
>
<i class="cn-icon cn-icon-jump-to" @click="jumpEntityDetail"></i>
</el-tooltip>
</div>
</div>
<div v-if="showEntityDetail" class="panel-show-detail">
<el-tooltip
effect="light"
trigger="hover"
:content="$t('entity.jumpToEntityDetails')"
placement="right"
popper-class="panel-tooltip"
>
<i class="cn-icon cn-icon-jump-to" @click="jumpEntityDetail"></i>
</el-tooltip>
</div>
</div>
<div class="panel__tools">
<el-select
@@ -528,10 +528,7 @@ export default {
path: '/entity/detail',
query: {
entityType: this.entityType,
entityName: this.entityValue,
startTime: this.timeFilter.startTime,
endTime: this.timeFilter.endTime,
range: this.timeFilter.dateRangeValue
entityName: this.entityValue
}
})
window.open(href, '_blank')

View File

@@ -9,7 +9,7 @@
v-show="item.show"
:class=" {'is-active': lineTab === item.class, 'mousemove-cursor': mousemoveCursor === item.class}"
v-for="(item, index) in tabs"
:key="item.name"
:key="index"
@mouseenter="mouseenter(item)"
@mouseleave="mouseleave(item)"
@click="activeChange(item, index,true)">
@@ -83,7 +83,7 @@ import { getSecond } from '@/utils/date-util'
import ChartNoData from '@/views/charts/charts/ChartNoData'
import chartMixin from '@/views/charts2/chart-mixin'
import { useRoute } from 'vue-router'
import {getLineType, getMarkLineByLineRefer, getYAxisBeginValue, overwriteUrl, urlParamsHandler} from '@/utils/tools'
import { getLineType, getMarkLineByLineRefer, overwriteUrl, urlParamsHandler } from '@/utils/tools'
import { dataForDnsTrafficLine } from '@/utils/static-data'
export default {
name: 'DnsTrafficLine',
@@ -292,7 +292,6 @@ export default {
}
}
})
this.chartOption.yAxis[0].startValue = getYAxisBeginValue(this.chartOption.series)
if (!show) {
this.chartOption.series.forEach((t) => {
t.markLine.label.show = false
@@ -379,13 +378,6 @@ export default {
this.dispatchSelectAction('legendUnSelect', t.name)
}
})
const series = this.tabs.filter(tab => tab.show)
const yAxisStartValue = getYAxisBeginValue(series)
if (this.myChart) {
const _option = this.myChart.getOption()
_option.yAxis[0].startValue = yAxisStartValue
this.myChart.setOption(_option)
}
}
if (val === 'active') {
this.tabs.forEach(t => {
@@ -474,19 +466,6 @@ export default {
})
}
lineData.splice(0, 1)
const totalData = lineData[0]
// 判断total曲线的第一个值和最后一个值若是0则删除
if (totalData.values.length > 1 && Number(totalData.values[totalData.values.length - 1][1]) === 0) {
lineData.forEach(r => {
r.values.splice(r.values.length - 1, 1)
})
}
if (totalData.values[0].length > 1 && Number(totalData.values[0][1]) === 0) {
lineData.forEach(l => {
l.values.splice(0, 1)
})
}
const tabs = _.cloneDeep(this.tabs)
if (val === 'Queries/s') {
lineData.forEach((d, i) => {

View File

@@ -130,8 +130,13 @@ export default {
this.showError = false
this.levelTwoTags = []
const basicInfoRequest = axios.get(`${api.entity.basicInfo}/${this.entity.entityType}?resource=${this.entity.entityName}`)
const tagRequest = axios.get(`${api.entity.tags}/${this.entity.entityType}?resource=${this.entity.entityName}`)
const requestArray = [tagRequest, basicInfoRequest]
let requestArray = []
if (this.entity.entityType === entityType.subscriber) {
requestArray = [null, basicInfoRequest]
} else {
const tagRequest = axios.get(`${api.entity.tags}/${this.entity.entityType}?resource=${this.entity.entityName}`)
requestArray = [tagRequest, basicInfoRequest]
}
Promise.all(requestArray).then(response => {
const tagData = response[0]
let tagError = ''
@@ -199,7 +204,7 @@ export default {
break
}
case 'subscriber': {
this.detailCards.find(c => c.name === 'phoneNumber').value = res.data.phone_number
this.detailCards.find(c => c.name === 'iphoneNumber').value = res.data.phone_number
this.detailCards.find(c => c.name === 'imei').value = res.data.imei
this.detailCards.find(c => c.name === 'imsi').value = res.data.imsi
this.detailCards.find(c => c.name === 'apn').value = res.data.apn
@@ -478,10 +483,10 @@ export default {
}
case 'subscriber': {
detailCards.value = _.concat(detailCards.value,
{ icon: 'cn-icon cn-icon-shoujihaoma', name: 'phoneNumber', label: 'MSISDN', value: '' },
{ icon: 'cn-icon cn-icon-IMEI', name: 'imei', label: 'IMEI', value: '' },
{ icon: 'cn-icon cn-icon-IMSI', name: 'imsi', label: 'IMSI', value: '' },
{ icon: 'cn-icon cn-icon-APN', name: 'apn', label: 'APN', value: '' }
{ icon: 'cn-icon cn-icon-shoujihaoma', name: 'iphoneNumber', label: i18n.global.t('entities.iphoneNumber'), value: '' },
{ icon: 'cn-icon cn-icon-IMEI', name: 'imei', label: i18n.global.t('entities.imei'), value: '' },
{ icon: 'cn-icon cn-icon-IMSI', name: 'imsi', label: i18n.global.t('entities.imsi'), value: '' },
{ icon: 'cn-icon cn-icon-APN', name: 'apn', label: i18n.global.t('entities.apn'), value: '' }
)
}
}

View File

@@ -10,7 +10,7 @@
<div class="line-value-tabs"
:class=" {'is-active': lineTab === item.class, 'mousemove-cursor': mousemoveCursor === item.class}"
v-if="item.show"
:key="item.name"
:key="index"
@mouseenter="mouseenter(item)"
@mouseleave="mouseleave(item)"
@click="activeChange(item, index,true)"

File diff suppressed because one or more lines are too long

View File

@@ -140,12 +140,9 @@ export default {
const queryCondition = ref(query.queryCondition || '')
// 获取url携带的range、startTime、endTime
/*const rangeParam = query.kpiRange
const rangeParam = query.kpiRange
const startTimeParam = query.kpiStartTime
const endTimeParam = query.kpiEndTime*/
const rangeParam = query.range
const startTimeParam = query.startTime
const endTimeParam = query.endTime
const endTimeParam = query.kpiEndTime
// 优先级url > config.js > 默认值。
const dateRangeValue = rangeParam ? parseInt(rangeParam) : (DEFAULT_TIME_FILTER_RANGE.entity.subscriberKpi || 60)

View File

@@ -67,12 +67,9 @@ export default {
const queryCondition = ref(query.queryCondition || '')
// 获取url携带的range、startTime、endTime
/*const rangeParam = query.topAppRange
const rangeParam = query.topAppRange
const startTimeParam = query.topAppStartTime
const endTimeParam = query.topAppEndTime*/
const rangeParam = query.range
const startTimeParam = query.startTime
const endTimeParam = query.endTime
const endTimeParam = query.topAppEndTime
// 优先级url > config.js > 默认值。
const dateRangeValue = rangeParam ? parseInt(rangeParam) : (DEFAULT_TIME_FILTER_RANGE.entity.subscriberTopApp || 60)

View File

@@ -186,10 +186,10 @@ export default {
switch (this.entity.entityType) {
case entityType.ip: {
const len1 = res[0].status === 200 ? res0.data.result && res0.data.result.length : 0
const len2 = res[1].status === 200 ? res1.data.result && res1.data.result.length : 0
const len1 = res[0].status === 200 ? res0.data.result.length : 0
const len2 = res[1].status === 200 ? res1.data.result.length : 0
this.initSetTag(entityDetailTabsName.relatedEntity, len1 + len2)
const behaviorPatternData = res[2].status === 200 ? res[2].data.data.result && res[2].data.data.result : 0
const behaviorPatternData = res[2].status === 200 ? res[2].data.data.result : 0
let behaviorPatternLen = 0
if (behaviorPatternData && behaviorPatternData[0]) {
const dataObject = behaviorPatternData[0]
@@ -205,20 +205,20 @@ export default {
}
case entityType.domain: {
const res2 = res[2].data
const len1 = res[0].status === 200 ? res0.data.result && res0.data.result.length : 0
const len2 = res[1].status === 200 ? res1.data.result && res1.data.result.length : 0
const len3 = res[2].status === 200 ? res2.data.result && res2.data.result.length : 0
const len1 = res[0].status === 200 ? res0.data.result.length : 0
const len2 = res[1].status === 200 ? res1.data.result.length : 0
const len3 = res[2].status === 200 ? res2.data.result.length : 0
this.initSetTag(entityDetailTabsName.relatedEntity, len1 + len2 + len3)
break
}
case entityType.app: {
const len1 = res[0].status === 200 ? res0.data.result && res0.data.result.length : 0
const len2 = res[1].status === 200 ? res1.data.result && res1.data.result.length : 0
const len1 = res[0].status === 200 ? res0.data.result.length : 0
const len2 = res[1].status === 200 ? res1.data.result.length : 0
this.initSetTag(entityDetailTabsName.relatedEntity, len1 + len2)
break
}
case entityType.subscriber: {
const len1 = res[0].status === 200 ? res0.data.result && res0.data.result.length : 0
const len1 = res[0].status === 200 ? res0.data.result.length : 0
// const len2 = res[1].status === 200 ? res1.data.result.length : 0
this.initSetTag(entityDetailTabsName.relatedEntity, len1)
break

View File

@@ -9,7 +9,7 @@
<div class="line-value-tabs"
:class=" {'is-active': lineTab === item.class, 'mousemove-cursor': mousemoveCursor === item.class}"
v-if="item.show"
:key="item.name"
:key="index"
@mouseenter="mouseenter(item)"
@mouseleave="mouseleave(item)"
@click="activeChange(item, index,true)"

View File

@@ -9,7 +9,7 @@
<div class="line-value-tabs"
:class=" {'is-active': lineTab === item.class, 'mousemove-cursor': mousemoveCursor === item.class}"
v-if="item.show"
:key="item.name"
:key="index"
@mouseenter="mouseenter(item)"
@mouseleave="mouseleave(item)"
@click="activeChange(item, index,true)"

View File

@@ -10,7 +10,7 @@
<span class="type-title-word">{{ $t('entities.tab.email') }}</span>({{ mailList.length }})
</div>
<div class="type-content">
<div v-for="mail in mailList.slice(0,showMailListInfo.num)" :key="mail" class="data-item">
<div v-for="(mail, index) in mailList.slice(0,showMailListInfo.num)" :key="index" class="data-item">
{{ mail }}
</div>
</div>
@@ -27,7 +27,7 @@
<span class="type-title-word">{{ $t('entities.tab.wetchat') }}</span>({{ wetchatList.length }})
</div>
<div class="type-content">
<div v-for="(wetchat, index) in wetchatList.slice(0,showWetchatListInfo.num)" :key="wetchat" class="data-item">
<div v-for="(wetchat, index) in wetchatList.slice(0,showWetchatListInfo.num)" :key="index" class="data-item">
{{ wetchat }}
</div>
</div>

View File

@@ -5,7 +5,7 @@
<div v-if="!isNoData && !showError" class="entity-detail-event-block" style="height: 100%;width: 100%;position: relative;">
<div class="behavior-pattern" >
<div class="behavior-pattern-legend" >
<div class="behavior-pattern-legend__item" v-for="(data, index) in tableData" :key="data.name">
<div class="behavior-pattern-legend__item" v-for="(data, index) in tableData" :key="index">
<div class="legend-icon" :style="`background:${chartColorForBehaviorPattern[index%10]};`"></div>
<div class="legend-name">{{data.name}}</div>
<div class="legend-value" >{{ valueToRangeValue(data.value, unitTypes.number).join('')}}</div>

View File

@@ -10,7 +10,7 @@
<span class="type-title-word">{{ $t('entities.tab.device') }}</span>({{ deviceList.length }})
</div>
<div class="type-content">
<div v-for="(device, index) in deviceList.slice(0,showDeviceListInfo.num)" :key="device" class="data-item">
<div v-for="(device, index) in deviceList.slice(0,showDeviceListInfo.num)" :key="index" class="data-item">
{{ device }}
</div>
</div>

Some files were not shown because too many files have changed in this diff Show More