Compare commits

...

54 Commits

Author SHA1 Message Date
chenjinsong
b178941f01 fix: 修复linkmonitor底下图表名字错误的问题 2023-03-16 18:56:10 +08:00
陈劲松
ecd82b08c7 Merge branch 'cherry-pick-831b00fc' into 'dev-23.02'
fix: 写死知识库表单cancel路由

See merge request cyber-narrator/cn-ui!26
2023-03-16 10:03:26 +00:00
chenjinsong
23c88ae447 fix: 写死知识库表单cancel路由
(cherry picked from commit 831b00fc78)
2023-03-16 18:03:19 +08:00
陈劲松
9b2f2f5e21 Merge branch 'cherry-pick-5116d4f6' into 'dev-23.02'
CN-749 fix: 增加列表错误提示

See merge request cyber-narrator/cn-ui!25
2023-03-14 11:42:29 +00:00
chenjinsong
d8de1e5d69 CN-749 fix: 增加列表错误提示
(cherry picked from commit 5116d4f6d6)
2023-03-14 19:42:13 +08:00
chenjinsong
502d098413 fix: 修复npm折线图bug 2023-03-14 17:18:49 +08:00
陈劲松
a8a84b6abb Merge branch 'cherry-pick-26b54baa' into 'dev-23.02'
下钻表格问题修改:对特殊字符单引号做处理,以正确显示列表信息

See merge request cyber-narrator/cn-ui!23
2023-03-14 08:52:11 +00:00
hyx
da9eeae556 下钻表格问题修改:对特殊字符单引号做处理,以正确显示列表信息
(cherry picked from commit 26b54baa33)
2023-03-14 16:52:04 +08:00
chenjinsong
4125a88bba fix: 将默认时间范围统一为1小时 2023-03-14 11:39:30 +08:00
陈劲松
317693e2da Merge branch 'cherry-pick-5536ac94' into 'dev-23.02'
CN-906 fix: 调整步骤条样式

See merge request cyber-narrator/cn-ui!22
2023-03-14 02:11:10 +00:00
chenjinsong
be79109487 CN-906 fix: 调整步骤条样式
(cherry picked from commit 5536ac9490)
2023-03-14 10:10:58 +08:00
唐浩
b99a20725a Update .gitlab-ci.yml file 2023-03-13 10:32:13 +00:00
唐浩
c40941fa60 Update .gitlab-ci.yml file 2023-03-13 10:05:57 +00:00
唐浩
6fba2c6116 Update .gitlab-ci.yml file 2023-03-13 09:56:55 +00:00
唐浩
2609c2e721 Merge branch 'cherry-pick-c26b0525' into 'dev-23.02'
fix: 修复knowledgeBase-create在有滚动条时时间轴图标不滚动的情况

See merge request cyber-narrator/cn-ui!21
2023-03-13 09:46:44 +00:00
刘洪洪
158a143d76 fix: 修复knowledgeBase-create在有滚动条时时间轴图标不滚动的情况
(cherry picked from commit c26b05259d)
2023-03-13 17:46:19 +08:00
chenjinsong
1dee23435d CN-926 fix: 样式细节优化 2023-03-10 21:15:09 +08:00
hyx
64a6eac4a7 CN-926 列表页样式改版 2023-03-10 20:50:54 +08:00
刘洪洪
8f1adef30d fix: 修复steps展开收起点击范围过大的问题 2023-03-10 16:30:35 +08:00
chenjinsong
2b66aecf44 fix: 修复校验错误提示逻辑 2023-03-10 13:32:46 +08:00
chenjinsong
1311e53b65 fix: 修复知识库增加重复校验后无法保存的问题 2023-03-10 13:13:27 +08:00
chenjinsong
d9677e89f5 feat: 增加步骤条交互 2023-03-09 15:20:59 +08:00
刘洪洪
d89c20a75c fix: 修复knowledge模块因初始化格式不符等导致的warning提示 2023-03-09 10:39:26 +08:00
chenjinsong
476c49b08f fix: 统一命名 2023-03-09 10:14:05 +08:00
chenjinsong
32a04eec4c fix: 修复删除导入数据后页码可能不对的问题 2023-03-08 18:10:55 +08:00
chenjinsong
fb9034229e feat: 报告参数增加input类型 2023-03-08 17:57:01 +08:00
chenjinsong
43c79b94f1 CN-906 fix: 修复一系列问题 2023-03-08 17:35:22 +08:00
chenjinsong
801858c07d CN-906 fix: 上传loading、保存loading 2023-03-07 18:48:15 +08:00
chenjinsong
85d9b3d738 CN-906 fix: 上传loading、保存loading 2023-03-06 20:16:31 +08:00
chenjinsong
ac28e52ca7 CN-906 fix: 知识库列表排序字段名更正 2023-03-06 14:19:29 +08:00
chenj
e2f9eb7f59 CN-906 feat: 优化上传交互 2023-03-05 13:50:22 +08:00
chenjinsong
a9e5915113 CN-906 feat: 知识库列表、新增功能(细节体验待完善) 2023-03-02 20:37:21 +08:00
刘洪洪
fdb4ec5cf5 fix: 修复NetworkOverviewLine的eslint报警提示 2023-03-02 18:36:02 +08:00
刘洪洪
04062195e2 fix: 修复因使用弃用的方法'>>>',导致的eslint报警提示 2023-03-02 18:16:38 +08:00
刘洪洪
e29fc1244c Merge remote-tracking branch 'origin/dev' into dev 2023-03-02 17:56:05 +08:00
刘洪洪
3fc6a42d99 fix: 修复项目运行时eslint报错的提示 2023-03-02 17:55:47 +08:00
hanyuxia
1c776f4119 CN-903 人工测试--NetworkOverviewLine,修改问题:(1) 刷新未保留选中Tab的状态 2023-03-01 17:13:01 +08:00
hanyuxia
e87deec34c CN-903 人工测试--NetworkOverviewLine:(1) 登录系统后,点击其中一个Tab标签,再点击二级菜单(网络概况)或者右侧刷新按钮或者F5刷新,折线图不显示;(2)切换参考线:报错,界面数据不更新;(3)点击高亮 tab 后未取消高亮,未恢复到全不高亮的状态; 2023-03-01 16:52:33 +08:00
hanyuxia
5685e6b2c0 CN-893 单测用例--下钻table 2023-03-01 09:33:43 +08:00
hyx
9fddf7914d CN-893 单测用例--下钻table 2023-02-28 11:49:13 +08:00
刘洪洪
a55ab9fb15 fix: 修复linkMonitor下一跳网格图排序错乱问题 2023-02-27 16:14:59 +08:00
刘洪洪
35b1f31601 fix: 去除无效代码 2023-02-27 16:08:33 +08:00
刘洪洪
8627cec919 Merge remote-tracking branch 'origin/dev' into dev 2023-02-27 16:01:43 +08:00
刘洪洪
ee14b471a8 CN-894: 单测用例--用例更新 2023-02-27 16:01:25 +08:00
chenjinsong
5896931487 CN-906 fix: 面包屑功能调整 2023-02-26 23:06:57 +08:00
chenjinsong
f87714fae2 CN-906 fix: 面包屑功能调整(部分) 2023-02-24 18:51:17 +08:00
刘洪洪
def8851da0 Merge remote-tracking branch 'origin/dev' into dev 2023-02-23 18:21:13 +08:00
刘洪洪
8b3f43eb98 fix: 完善npm-event环形图单测 2023-02-23 18:20:56 +08:00
chenjinsong
3d2623f8cf CN-906 fix: 知识库列表简版;调整一些目录名 2023-02-23 18:12:20 +08:00
刘洪洪
a9fe48933c fix: 修复npm-event环形图event计数错误的问题 2023-02-23 16:29:13 +08:00
李金洋
1c2782e8e3 Update .gitlab-ci.yml 2023-02-23 03:32:58 +00:00
lijinyang
4462b5eaa3 fix: ci构建增加测试阶段 2023-02-23 11:17:08 +08:00
刘洪洪
46a0985f55 fix: 修复npm-event单测id根据时间命名可能会导致报错的问题 2023-02-23 10:54:18 +08:00
刘洪洪
4d6c444b25 fix: 修复linkMonitor下一跳网格图排序错乱问题 2023-02-23 10:53:12 +08:00
94 changed files with 5163 additions and 1525 deletions

View File

@@ -2,6 +2,7 @@
stages:
- gen_git-log
- build_project
- test
- build_image
cache:
@@ -52,6 +53,16 @@ build_project:
tags:
- galaxy
test:
stage: test
script:
- cnpm run test
when: on_success
only:
- dev
tags:
- galaxy
build_image:
dependencies:
- build_project
@@ -80,11 +91,11 @@ build_release_image:
- echo '提交的版本是'
- echo $CI_COMMIT_REF_NAME
- echo "docker build"
- sudo docker build --no-cache -t cn-ui-$CI_COMMIT_REF_NAME:$CI_COMMIT_TAG .
- sudo docker build --no-cache -t cn-ui:$CI_COMMIT_TAG .
- echo "docker tag"
- sudo docker tag cn-ui-$CI_COMMIT_REF_NAME:$CI_COMMIT_TAG 192.168.40.153:9080/cyber-narrator/cn-ui-$CI_COMMIT_REF_NAME:$CI_COMMIT_TAG
- sudo docker tag cn-ui:$CI_COMMIT_TAG 192.168.40.153:9080/cyber-narrator/cn-ui:$CI_COMMIT_TAG
- echo "docker push"
- sudo docker push 192.168.40.153:9080/cyber-narrator/cn-ui-$CI_COMMIT_REF_NAME:$CI_COMMIT_TAG
- sudo docker push 192.168.40.153:9080/cyber-narrator/cn-ui:$CI_COMMIT_TAG
only:
- tags
tags:

View File

@@ -148,7 +148,7 @@ export default {
align-items: center;
}
>>>.el-input__inner {
:deep .el-input__inner {
background-color: #0B325C !important;
border: none;
border-radius: 0px;
@@ -156,10 +156,10 @@ export default {
font-size: 14px;
line-height: 14px;
}
>>>.el-input__inner:hover {
:deep .el-input__inner:hover {
border-color: #295688;
}
>>>.el-input__inner:focus {
:deep .el-input__inner:focus {
border-color: #295688;
}
.el-button--primary:hover, .el-button--primary:focus, .el-button--primary:active {
@@ -167,10 +167,10 @@ export default {
border-color: #21B4ED;
color: #FFFFFF;
}
>>>.el-loading-mask {
:deep .el-loading-mask {
background-color: transparent;
}
>>>input {
:deep input {
-webkit-text-fill-color: rgba(231,234,237, .8) !important;
transition: background-color 500000000000000000s ease-in-out 0s !important;
caret-color: #fff ;
@@ -205,14 +205,14 @@ export default {
flex-direction: column;
align-items: center;
}
>>>.el-form-item {
:deep .el-form-item {
width: 334px;
margin-bottom: 25px;
}
>>>.el-input__prefix {
:deep .el-input__prefix {
color: #6DBBFF;
}
>>>.el-input__prefix i {
:deep .el-input__prefix i {
width: 17px;
font-size: 17px;
}

View File

@@ -14,9 +14,8 @@
z-index: 0;
}
.main-container {
padding: 10px;
padding: 0;
height: 100%;
background-color: #f6f6f6;
&>div {
background-color: white;
}
@@ -36,7 +35,7 @@
align-items : center;
position: relative;
justify-content: space-between;
padding: 14px 20px;
padding: 12px 20px;
&.top-tools--sub {
align-items: center;
@@ -50,6 +49,12 @@
.top-tool-btn {
border-left: none;
}
.top-tool-btn--search:hover {
border-left: none !important;
}
.top-tool-btn--search:focus {
border-left: none !important;
}
}
.top-tool-right {
@@ -74,17 +79,28 @@
}
.top-tool-btn {
cursor: pointer;
height: 33px;
width: 36px;
height: 28px;
width: 72px;
border: 1px solid $--border-color-primary;
outline: none;
border-radius: $--button-border-radius;
background-color: $--button-gray-background-color;
transition: background-color linear .1s;
font-size:12px;
font-weight: 500;
font-family: NotoSansHans-Medium !important;
i {
font-size: 14px;
color: $--button-gray-color;
color: #575757;
margin-right:4px;
}
}
.top-tool-btn:disabled {
cursor: not-allowed;
opacity: 0.66;
i {
}
}
@@ -94,13 +110,14 @@
color: #666;
}
.top-tool-btn:hover:not(.cn-btn-disabled) {
border: 1px solid $--border-color-primary;
background-color: $--button-gray-hover-background-color;
}
.top-tool-btn:focus:not(.cn-btn-disabled), .top-tool-btn.is-focus {
background-color: $--button-gray-hover-background-color;
border: 1px solid $--color-primary !important;
background-color: $--button-gray-active-background-color;
border: 1px solid $--border-color-primary;
i {
color: $--button-gray-active-color;
color: #575757;
}
}
.top-tool-btn--delete.top-tool-btn:focus:not(.cn-btn-disabled) {
@@ -111,6 +128,56 @@
color: #F0745A;
}
}
.top-tool-btn--create {
background-color: #38ACD2 !important;
border-color: #2E88A6 !important;
color:#FFFFFF;
i {
color: #FFFFFF;
}
}
.top-tool-btn--create:hover {
background-color: #57B8D9 !important;
border-color: #2E88A6 !important;
color:#FFFFFF;
i {
color: #FFFFFF;
}
}
.top-tool-btn--create:focus {
background-color: #31A5CD !important;
border-color: #2E88A6 !important;
color:#FFFFFF !important;
i {
color: #FFFFFF !important;
}
}
.top-tool-btn--create:disabled {
opacity: 0.66;
background-color: #38ACD2 !important;
border-color: #2E88A6 !important;
color:#FFFFFF;
i {
color: #FFFFFF;
}
}
.btn-customize {
color:$blue;
font-size: 12px;
.icon-gear{
color:#2C72C6;
width:12px;
height:12px;
margin-right:2px;
font-size:12px;
}
}
.btn-customize:hover {
cursor:pointer;
}
.top-tool-btn--dropdown {
position: relative;
width: auto;
@@ -130,6 +197,7 @@
width: calc(100% - 40px);
border: 1px solid $--right-box-border-color;
border-bottom: none;
border-radius:4px;
.caret-wrapper {
height: 23px;
@@ -152,7 +220,8 @@
th {
border-color: $--right-box-border-color;
padding: 8px 0;
background: #F9F9F9;
background: #FFF;
border-right:0px;
}
.el-table__header th:first-of-type {
border-left: none;
@@ -244,7 +313,7 @@
border-right: none !important;
}
/* 最后一列用box-shadow模拟边框 */
.el-table:not(.no-operation):not(.chart-table).el-table--border .el-table__body-wrapper td:nth-last-child(2) {
/*.el-table:not(.no-operation):not(.chart-table).el-table--border .el-table__body-wrapper td:nth-last-child(2) {
box-shadow: 1px 0 $--right-box-border-color;
}
.el-table:not(.no-operation):not(.chart-table).el-table--border .el-table__header-wrapper th:nth-last-child(3) {
@@ -263,7 +332,7 @@
th:last-of-type {
border-right: none !important;
}
}
}*/
.el-table--border:not(.chart-table)::after, .el-table--group:not(.chart-table)::after {
width: 0;
}

View File

@@ -78,12 +78,28 @@
border-radius: 2px;
background-color: #F9F9F9;
transition: background-color linear .1s;
padding-left:10px;
}
.list-page .top-tools .top-tool-btn--search{
width:28px !important;
height:28px !important;
padding:unset !important;
i {
font-size: 14px;
color: #575757;
margin-right:unset !important;
}
}
.list-page {
.el-input--small{
width: 214px !important;
line-height: 27px;
}
.el-input--small .el-input__inner {
height: 33px;
line-height: 32px;
border-radius: 0px;
height: 28px;
border-radius: 2px 0px 0px 2px;
}
}

View File

@@ -6,9 +6,9 @@
@import './components/common/pagination';
// @import './components/entities/entities';
@import './components/layout/layout';
@import 'components/rightBox/settings/chart-box';
@import 'components/rightBox/administration/chart-box';
@import 'components/setting/galaxy-proxy-debug';
@import 'components/table/settings/galaxy-proxy-table';
@import 'components/table/administration/galaxy-proxy-table';
@import './components/table/common';
@import './views/charts/chart';
@import 'views/entityExplorer/entity-explorer';
@@ -42,8 +42,8 @@
@import './views/chartHeader';
@import './views/charts/chartMap';
@import 'views/charts/chartRelationShipList';
@import './views/report/builtinReport';
@import './components/rightBox/report/builtinReportBox';
@import 'views/report/report';
@import 'components/rightBox/report/reportBox';
@import './views/charts2/panel';
@import './views/charts2/networkOverviewLine';
@@ -77,3 +77,4 @@
@import 'views/administration/AdministrationTabs';
@import 'views/setting/knowledgeBase';

View File

@@ -1,21 +1,22 @@
.cn-builtin {
.cn-report {
background: #fff;
margin: 10px;
height: calc(100% - 20px) !important;
display: flex;
flex-direction: row;
.cn-builtin-left {
.cn-report-left {
width: 288px;
height: 100%;
border-right: 1px solid #E7EAED;
position: relative;
.cn-builtin-left-title {
overflow: auto;
.cn-report-left-title {
padding: 28px 0 26px 13px;
font-size: 16px;
color: #333333;
letter-spacing: 0;
}
.cn-builtin-left-menu {
.cn-report-left-menu {
width: 250px;
word-break: normal;
margin: auto;
@@ -25,13 +26,13 @@
padding: 14px;
cursor: pointer;
}
.cn-builtin-left-menu.cn-active {
.cn-report-left-menu.cn-active {
background: #F4FAFF;
border-radius: 2px;
color: #0091FF;
}
}
.cn-builtin-right {
.cn-report-right {
flex: 1;
.list-page .main-container {
padding: 0;
@@ -73,7 +74,7 @@
height: 100%;
width: calc(100% - 32px);
background: #fff; //盖住fixed产生的阴影
::v-deep .is-leaf {
:deep .is-leaf {
color: #1b2e3b;
background: #ebeef5;
}

View File

@@ -0,0 +1,365 @@
.knowledge-base {
&.list-page {
height: calc(100% - 52px);
}
.type-tag {
display: inline-block;
padding: 0 10px;
background-color: #EBF7FA;
color: #046ECA;
box-shadow: 0 2px 4px 0 rgba(51,51,51,0.02);
border-radius: 12px;
}
.top-title {
font-size: 24px;
color: #353636;
font-weight: 900;
line-height: 24px;
display: flex;
align-items: center;
padding-bottom: 8px;
padding-top: 20px;
margin-left:20px;
}
}
.edit-knowledge-base {
height: 100%;
.edit-knowledge-base__header {
padding: 30px 0 30px 20px;
font-size: 24px;
line-height: 24px;
font-weight: 900;
color: #353636;
}
.edit-knowledge-base__body {
display: flex;
height: calc(100% - 147px);
padding-left: 20px;
overflow: auto;
.el-steps {
margin-left: 10px;
.el-step {
transition: flex-basis ease-in-out .28s;
}
.el-step__head {
.el-step__line {
top: 26px;
bottom: 2px;
background-color: #38ACD2;
border-color: transparent;
opacity: 0.66;
}
&.is-finish, &.is-process {
.el-step__icon {
border-color: #38ACD2;
color: white;
background: #38ACD2;
}
}
&.is-process {
.el-step__line {
opacity: 1;
}
}
&.is-wait {
.el-step__icon {
border-color: #38ACD2;
color: #38ACD2;
}
}
.el-step__icon-inner {
font-size: 16px;
font-weight: normal;
}
}
}
.el-collapse {
width: 655px;
margin-left: 5px;
border: none;
.el-collapse-item.upload-collapse {
.el-collapse-item__wrap {
height: 260px;
}
}
.el-collapse-item {
min-height: 58px;
position: relative;
.el-collapse-item__header {
height: unset;
line-height: unset;
border: none;
font-size: 16px;
color: #333333;
&.focusing:focus:not(:hover) {
color: unset;
}
.form-sub-title {
padding-left: 35px;
}
}
[role|=tab] {
display: flex;
align-items: flex-start;
}
.el-collapse-item__arrow {
position: absolute;
color: #38ACD2;
font-weight: bold;
}
.el-collapse-item__wrap {
padding-left: 35px;
border: none;
}
.el-collapse-item__content {
position: relative;
padding-bottom: 20px;
}
.form-input .el-input__inner{
padding-right: 50px !important;
}
.upload-error-tip, .preview-error-tip {
color: $--color-danger;
}
.upload-error-tip {
margin-top: -11px;
}
.el-upload {
margin-top: 12px;
.upload-tip {
font-size: 12px;
color: #999999;
}
.el-upload-dragger {
width: 320px;
border-radius: 2px;
transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
}
}
.el-upload--error .el-upload-dragger {
border-color: $--color-danger;
}
.el-upload-list {
.el-upload-list__item {
padding: 0 5px;
margin-top: unset;
height: 36px;
line-height: 36px;
background: #F5F8FA;
border-radius: 2px;
color: #353636;
.el-icon-close {
top: 11px;
}
.el-icon-close-tip {
top: 11px;
}
.el-progress.el-progress--line {
top: unset;
}
}
}
}
}
.el-form {
margin-top: 20px;
width: 620px;
label {
padding-bottom: 6px;
font-size: 14px;
color: #333333;
line-height: unset;
}
.el-form-item {
margin-bottom: 12px;
}
.el-form-item__content {
line-height: unset;
.el-input__inner {
padding-left: 8px;
font-size: 14px;
color: #353636;
}
.el-textarea__inner {
padding-left: 8px;
}
.form-select {
width: 100%;
.el-input__inner {
background-color: #F5F8FA;
}
}
}
}
.skeleton-border {
position: relative;
margin-top: 12px;
padding: 15px;
border: 1px solid #DCDFE6;
border-radius: 2px;
.skeleton-item-row:not(:nth-of-type(6)) {
margin-bottom: 5px;
}
.el-skeleton__item {
background: #F5F8FA;
}
.skeleton-tip {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
font-size: 14px;
color: #353636;
}
}
.imported-tip {
margin-top: 8px;
margin-bottom: 4px;
font-size: 14px;
color: #333333;
.cn-icon {
font-size: 16px;
color: #38ACD2;
}
}
.imported-table-box {
position: relative;
height: 367px;
border: 1px solid #DEDEDE;
border-radius: 2px;
transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
&.imported-table-box--error {
border-color: $--color-danger;
}
.imported-table {
padding: 0 12px;
width: 100%;
table-layout: fixed;
th {
text-align: left;
font-size: 14px;
color: #353636;;
}
td {
font-size: 14px;
color: #353636;
}
.imported-data-msg, .imported-data-item, .imported-data-value {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.imported-data-msg {
width: 140px;
}
.el-icon-close {
color: #666;
font-weight: bold;
cursor: pointer;
&:hover {
color: #111;
}
}
.el-icon-success {
color: #749F4D;
}
.el-icon-error {
color: #E26154;
}
}
.imported-pagination.pagination {
position: absolute;
width: 100%;
bottom: 0;
margin-top: 4px;
padding-top: 8px;
height: 42px;
border-top: 1px solid #eee;
.btn-prev, .btn-next, .number {
margin: 0 2px;
}
.el-pager li, .el-pagination .btn-next, .el-pagination .btn-prev {
border: none;
font-size: 12px;
}
.el-pagination .el-pager li {
color: #353636;
}
.el-pagination .el-pager li.active {
background-color: #38ACD2;
color: white;
}
}
}
}
.edit-knowledge-base__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);
.footer__btn {
margin: 0 10px;
height: 30px;
min-width: 74px;
padding: 0 15px;
color: white;
background-color: #38ACD2;
border: none;
border-radius: 4px;
outline: none;
font-size: 14px;
cursor: pointer;
transition: background-color linear .2s, color linear .1s;
}
.footer__btn:hover:not(.footer__btn--disabled) {
background-color: lighten(#38ACD2, 10%);
}
.footer__btn--light {
background-color: #F5F6F7;
border: 1px solid $--border-color-primary;
color: #333;
}
.footer__btn.footer__btn--light:hover:not(.footer__btn--disabled) {
background-color: white;
border-color: lighten(#38ACD2, 40%);
color: #38ACD2;
}
.footer__btn--disabled {
opacity: .6;
cursor: default;
}
}
}

View File

@@ -31,12 +31,12 @@ $--button-primary-background-color: $--color-primary; // 普通按钮背景色
$--button-hover-tint-percent: 20%; // 非灰色按钮在鼠标hover时背景色变浅的幅度
$--button-active-shade-percent: 0; // 非灰色按钮在focus时背景色变深的幅度
$--button-gray-color: #666; // 灰色按钮字色
$--button-gray-color: #353636; // 灰色按钮字色
$--button-gray-hover-color: $--button-gray-color; // 灰色按钮hover字色
$--button-gray-active-color: $--color-primary; // 灰色按钮focus字色
$--button-gray-background-color: #F9F9F9; // 灰色按钮背景色
$--button-gray-hover-background-color: #FFF; // 灰色按钮hover背景色
$--button-gray-active-background-color: $--button-gray-hover-background-color; // 灰色按钮focus背景色
$--button-gray-hover-background-color: #EBF1F4; // 灰色按钮hover背景色
$--button-gray-active-background-color: #E0E7EA; // 灰色按钮focus背景色
$--button-gray-border-color: $--border-color-primary; // 灰色按钮边框色
$--button-gray-hover-border-color: $--button-gray-border-color; // 灰色按钮hover边框色
$--button-gray-active-border-color-tint-percent: 30%; // 灰色按钮在focus时边框色相对于主题色变浅的幅度

View File

@@ -2,10 +2,10 @@
/** 重写element-ui变量 **/
$--color-primary: #0091ff; // 主题色
$--color-primary-dark-10: darken(#0091ff, 10%); // 默认主题色 深10%
$--color-primary-light-10: lighten(#0091ff, 10%); // 默认主题色 浅10%
$--color-primary-light-20: lighten(#0091ff, 20%); // 默认主题色 浅20%
$--color-primary: #699DC9; // 主题色
$--color-primary-dark-10: darken(#699DC9, 10%); // 默认主题色 深10%
$--color-primary-light-10: lighten(#699DC9, 10%); // 默认主题色 浅10%
$--color-primary-light-20: lighten(#699DC9, 20%); // 默认主题色 浅20%
/* menu相关 */
$--menu-background-color: #00162B; // menu背景色
@@ -31,12 +31,12 @@ $--button-primary-background-color: $--color-primary; // 普通按钮背景色
$--button-hover-tint-percent: 20%; // 非灰色按钮在鼠标hover时背景色变浅的幅度
$--button-active-shade-percent: 0; // 非灰色按钮在focus时背景色变深的幅度
$--button-gray-color: #666; // 灰色按钮字色
$--button-gray-color: #353636; // 灰色按钮字色
$--button-gray-hover-color: $--button-gray-color; // 灰色按钮hover字色
$--button-gray-active-color: $--color-primary; // 灰色按钮focus字色
$--button-gray-background-color: #F9F9F9; // 灰色按钮背景色
$--button-gray-hover-background-color: #FFF; // 灰色按钮hover背景色
$--button-gray-active-background-color: $--button-gray-hover-background-color; // 灰色按钮focus背景色
$--button-gray-hover-background-color: #EBF1F4; // 灰色按钮hover背景色
$--button-gray-active-background-color: #E0E7EA; // 灰色按钮focus背景色
$--button-gray-border-color: $--border-color-primary; // 灰色按钮边框色
$--button-gray-hover-border-color: $--button-gray-border-color; // 灰色按钮hover边框色
$--button-gray-active-border-color-tint-percent: 30%; // 灰色按钮在focus时边框色相对于主题色变浅的幅度

View File

@@ -10,7 +10,7 @@
<template #label>
<div class="chart-tabs__label">
<i :class="tab.icon"></i>
<span>{{ $t(tab.i18n) }}</span>
<span>{{ $t(tab.i18n || tab.name) }}</span>
</div>
</template>
</el-tab-pane>

View File

@@ -11,6 +11,7 @@
:page-size="Number(pageObj.pageSize)"
:layout="layout"
:total="pageObj.total"
v-bind="bind"
>
<el-select v-model="pageSize" :placeholder="pageSize+$t('pageSize')" size="mini"
:popper-append-to-body="appendToBody" class="pagination-size-select" @change="size"
@@ -42,15 +43,23 @@ export default {
layout: {
type: String,
default: 'total, prev, pager, next, slot'
},
bind: {
type: Object,
default: () => {}
},
storePageNoOnUrl: {
type: Boolean,
default: true
}
},
/**
* 添加vue3的setup目的是添加/获取地址栏的参数
*/
setup () {
setup (props) {
const { query } = useRoute()
const pageSize = ref(defaultPageSize)
const currentPageNo = ref(query.pageNo || 1)
const currentPageNo = ref(props.storePageNoOnUrl ? (query.pageNo || (props.pageObj.pageNo || 1)) : (props.pageObj.pageNo || 1))
return {
pageSize,

View File

@@ -42,9 +42,9 @@
</div>
<div class="cn-header__nav">
<i class="cn-icon cn-icon-a-NetworkAnalytics"></i>
<el-breadcrumb class="header__left-breadcrumb" :separator="route.indexOf('detection') === -1 && route.indexOf('administration') === -1 ? '>' : ''">
<el-breadcrumb-item class="header__left-breadcrumb-item" :id="`breadcrumb${item}`" :title="item"
v-for="(item,index) in breadcrumb" :key="item">
<el-breadcrumb class="header__left-breadcrumb" separator=">">
<el-breadcrumb-item class="header__left-breadcrumb-item" :id="`breadcrumb${item.value}`" :title="item.value"
v-for="(item,index) in breadcrumb" :key="item.value">
<template v-if="index===3">
<div class="header__left-breadcrumb-item-select">
<el-popover placement="bottom-start"
@@ -54,7 +54,7 @@
:hide-after="0"
:show-after="0"
popper-class="breadcrumb__popper"
@show="showBreadcrumbPopover(item)"
@show="showBreadcrumbPopover(item.value)"
@hide="hideBreadcrumbPopover()"
trigger="click">
<template #reference>
@@ -62,13 +62,13 @@
:class="showBackground?'breadcrumb-button__active':''">
<span id="breadcrumbValue">
<template v-if="curTabProp === 'qtype'">
<span>{{ dnsQtypeMapData.get(item)}}</span>
<span>{{ dnsQtypeMapData.get(item.value)}}</span>
</template>
<template v-else-if="curTabProp === 'rcode'">
<span>{{ dnsRcodeMapData.get(item)}}</span>
<span>{{ dnsRcodeMapData.get(item.value)}}</span>
</template>
<template v-else>
<span>{{ item }}</span>
<span>{{ item.value }}</span>
</template>
</span><i class="cn-icon-xiala cn-icon"></i>
</div>
@@ -82,7 +82,7 @@
</div>
<ul class="select-dropdown" id="breadcrumbSelectDropdown" @scroll="scrollList()">
<li v-for="item in breadcrumbColumnValueListShow" title='' :key="item" :id="item"
class="select-dropdown__item" @click="changeValue(item)" :class="selected?'':''">
class="select-dropdown__item" @click="changeValue(item)">
<template v-if="curTabProp === 'qtype'">
<span>{{ dnsQtypeMapData.get(item) }}</span>
</template>
@@ -99,14 +99,17 @@
</div>
</template>
<template v-else-if="index===2">
<span v-if="route===wholeScreenRouterMapping.dns">{{ $t(item) }}</span>
<span v-else class="route-menu" @click="jump(route,item,'',3)">{{ $t(item) }}</span>
<span v-if="route===wholeScreenRouterMapping.dns">{{ $t(item.value) }}</span>
<span v-else class="route-menu" @click="jump(route,item.value,'',3)">{{ $t(item.value) }}</span>
</template>
<!-- index=0和index=1的点击跳转由breadcrumb里的数据控制 -->
<template v-else-if="index===1">
<span class="route-menu" @click="jump(route,'','',2)">{{ item }}</span>
<span v-if="item.clickable" class="route-menu" @click="jump(route,'','',2)">{{ item.value }}</span>
<span v-else>{{ item.value }}</span>
</template>
<template v-else>
<span>{{ item }}</span>
<span v-if="item.clickable" class="route-menu" @click="jump(item.route,'','',0)">{{ item.value }}</span>
<span v-else>{{ item.value }}</span>
</template>
</el-breadcrumb-item>
</el-breadcrumb>
@@ -208,6 +211,7 @@ import {
handleSpecialValue
} from '@/utils/tools'
import { getNowTime, getSecond } from '@/utils/date-util'
import _ from 'lodash'
export default {
name: 'Header',
@@ -285,7 +289,7 @@ export default {
return this.$store.getters.menuList.find(menu => menu.code === 'networkAnalytics')
},
otherMenu () {
return this.$store.getters.menuList.filter(menu => menu.code !== 'networkAnalytics')
return this.$store.getters.menuList.filter(menu => ['networkAnalytics', 'chart', 'I18N'].indexOf(menu.code) === -1)
/* function excludeButton (menu) {
for (let i = 0; i < menu.length; i++) {
@@ -301,38 +305,28 @@ export default {
} */
},
breadcrumb () {
const breadcrumbMap = []
this.curTabProp = this.$route.query.dimensionType ? this.$route.query.dimensionType : null
this.$store.getters.menuList.forEach(menu => {
if (this.$_.isEmpty(menu.children) && menu.route) {
breadcrumbMap.push({
name: this.$t(menu.i18n),
path: menu.route,
columnName: menu.columnName,
columnValue: menu.columnValue
})
} else if (!this.$_.isEmpty(menu.children)) {
menu.children.forEach(child => {
breadcrumbMap.push({
name: child.i18n ? this.$t(child.i18n) : child.name,
parentName: menu.i18n ? this.$t(menu.i18n) : menu.name,
path: child.route,
columnName: child.columnName,
columnValue: child.columnValue
})
})
const breadcrumb = []
this.generateBreadcrumb(breadcrumb, this.$store.getters.menuList)
// 写死一级和二级菜单是否可以点击跳转
if (breadcrumb[0]) {
if (['knowledgeBase'].indexOf(breadcrumb[0].code) > -1) {
breadcrumb[0].clickable = true
}
})
const breadcrumb = breadcrumbMap.find(b => this.route === b.path)
if (breadcrumb[1]) {
if (breadcrumb[1].route && breadcrumb[1].route.indexOf('/panel/') === 0) {
breadcrumb[1].clickable = true
}
}
}
const thirdMenu = this.getUrlParam(this.curTabState.thirdMenu, '')
const fourthMenu = this.getUrlParam(this.curTabState.fourthMenu, '')
let result = []
let result = [...breadcrumb]
if (fourthMenu) {
result = breadcrumb ? [breadcrumb.parentName, breadcrumb.name, thirdMenu, fourthMenu] : []
result = [...result, { value: thirdMenu }, { value: fourthMenu }]
} else if (thirdMenu) {
result = breadcrumb ? [breadcrumb.parentName, breadcrumb.name, thirdMenu] : []
} else {
result = breadcrumb ? [breadcrumb.parentName, breadcrumb.name] : []
result = [...result, { value: thirdMenu }]
}
return result
},
@@ -356,6 +350,7 @@ export default {
}
},
async breadcrumb (n) {
this.curTabProp = this.$route.query.dimensionType ? this.$route.query.dimensionType : null
if (this.$route.params.typeName === fromRoute.dnsServiceInsights) {
if (this.dnsQtypeMapData.size === 0) {
this.dnsQtypeMapData = await getDnsMapData('dnsQtype')
@@ -396,6 +391,32 @@ export default {
}
},
methods: {
generateBreadcrumb (breadcrumb, menus) {
const menu = menus.find(m => m.route === this.route)
if (menu) {
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++) {
if (!_.isEmpty(menus[i].children)) {
if (this.generateBreadcrumb(breadcrumb, menus[i].children)) {
breadcrumb.unshift({
code: menus[i].code,
value: menus[i].i18n ? this.$t(menus[i].i18n) : menus[i].name,
route: menus[i].route,
type: menus[i].type
})
return true
}
}
}
}
},
handleClose () {
this.showChangePin = false
},
@@ -602,9 +623,6 @@ export default {
this.urlChangeParams[this.curTabState.tabOperationBeforeType] = this.getUrlParam(this.curTabState.tabOperationType, '', true)
this.urlChangeParams[this.curTabState.tabOperationType] = opeType
if (opeType === 3) {
/* if (route !== '/panel/networkOverview') {
this.urlChangeParams.queryCondition = ''
} */
this.urlChangeParams.queryCondition = ''
}
} else {

View File

@@ -233,9 +233,12 @@
<!-- <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>-->
<template v-for="(param, index) in editObject.categoryParams" :key="index">
<el-input v-if="param.labelType === 'input'" v-model="param.value" placeholder=" " size="small" style="vertical-align: unset;" :disabled="!!editObject.id">
<template #prepend>{{param.key}}</template>
</el-input>
<el-select v-model="param.value"
v-for="(param, index) in editObject.categoryParams"
:key="index"
v-else
class="right-box__select right-box__select--param"
placeholder=" "
filterable
@@ -251,8 +254,8 @@
<el-option :key="p" :value="p" v-for="p in paramOption.options"></el-option>
</template>
</template>
</el-select>
</template>
</el-form-item>
</el-form>
</div>

View File

@@ -2,31 +2,29 @@
<div :class="from" class="list-page">
<!-- 主页面 -->
<div class="main-list">
<!-- 顶部工具栏 -->
<div class="main-container">
<!-- 顶部工具栏 -->
<div class="top-tools">
<div class="top-tool-left" style="min-width: 300px">
<slot name="top-tool-left"></slot>
</div>
<div class="top-tool-right">
<!-- <el-input v-model="keyWord" value="keyWord"></el-input>
<el-button @click="onsearch" icon="el-icon-search" type="info" size="mini" style="margin-right: 10px"></el-button>-->
<div v-if="showLayout.indexOf('search') > -1" class="top-tool-search margin-r-20">
<div style="display: flex">
<el-input
v-model="keyWord" size="small" @keyup.enter="onsearch"></el-input>
<!-- <el-button icon="el-icon-search" @click="onsearch" size="small"></el-button>-->
<button class="top-tool-btn" style="border-radius: 0px"
type="button" @click="onsearch">
<el-input v-model="keyWord" size="small" @keyup.enter="onSearch"></el-input>
<!-- <el-button icon="el-icon-search" @click="onSearch" size="small"></el-button>-->
<button class="top-tool-btn top-tool-btn--search" style="border-radius: 0 2px 2px 0 !important;" @click="onSearch">
<i class="el-icon-search"></i>
</button>
</div>
</div>
</div>
<div class="top-tool-right">
<!-- <el-input v-model="keyWord" value="keyWord"></el-input>
<el-button @click="onSearch" icon="el-icon-search" type="info" size="mini" style="margin-right: 10px"></el-button>-->
<slot name="top-tool-right"></slot>
<button v-if="showLayout.indexOf('elementSet') > -1" class="top-tool-btn"
type="button" @click="tools.showCustomTableTitle = true">
<i class="cn-icon-gear cn-icon"></i>
</button>
<div v-if="showLayout.indexOf('elementSet') > -1" class="btn-customize" @click="tools.showCustomTableTitle = true">
<i class="cn-icon-gear cn-icon icon-gear"></i> <span> {{$t('network.customize')}}</span>
</div>
</div>
</div>
<div class="cn-table">
@@ -94,7 +92,7 @@ export default {
updateCustomTableTitle (custom) {
this.$emit('update:customTableTitle', custom)
},
onsearch () {
onSearch () {
const params = {
q: this.keyWord
}

View File

@@ -19,17 +19,17 @@
</div>
</div>
<div class="custom-bottom-btns">
<el-button size="mini" v-if="isCancel" :id="tableId+'-element-set-none'" class="cn-btn cn-btn-size-small-new cn-btn-style-light-new is-cancel" type="button" @click="batchHandler(false)">
<el-button size="mini" v-if="isCancel" :id="tableId+'-element-set-none'" class="cn-btn cn-btn-size-small-new cn-btn-style-light-new is-cancel" @click="batchHandler(false)">
<span class="top-tool-btn-txt">{{$t('overall.clear')}}</span>
</el-button>
<el-button size="mini" v-if="!isCancel" :id="tableId+'-element-set-all'" class="cn-btn cn-btn-size-small-new cn-btn-style-light-new" type="button" @click="batchHandler(true)">
<el-button size="mini" v-if="!isCancel" :id="tableId+'-element-set-all'" class="cn-btn cn-btn-size-small-new cn-btn-style-light-new" @click="batchHandler(true)">
<span class="top-tool-btn-txt">{{$t('overall.all')}}</span>
</el-button>
<div class="custom-bottom-btns-right">
<el-button size="mini" :id="tableId+'-element-set-esc'" class="cn-btn cn-btn-size-small-new cn-btn-style-light-new" type="button" @click="esc">
<el-button size="mini" :id="tableId+'-element-set-esc'" class="cn-btn cn-btn-size-small-new cn-btn-style-light-new" @click="esc">
<span class="top-tool-btn-txt">{{$t('overall.cancel')}}</span>
</el-button>
<el-button size="mini" :id="tableId+'-element-set-save'" class="cn-btn cn-btn-size-small-new cn-btn-style-normal-new" type="button" @click="save" style="background-color: #0091ff;color:#DCDFE6">
<el-button size="mini" :id="tableId+'-element-set-save'" class="cn-btn cn-btn-size-small-new cn-btn-style-normal-new" @click="save" style="background-color: #0091ff;color:#DCDFE6">
<span class="top-tool-btn-txt top-tool-btn-save">{{$t('overall.save')}}</span>
</el-button>
</div>
@@ -86,6 +86,7 @@ export default {
// 单选
handler (val, index) {
if (!this.allowedAll && !val.allowed && (index === 0 || index === 1 || val.NotSet)) {
//
} else {
this.custom[index].show = !this.custom[index].show
}

View File

@@ -110,7 +110,6 @@
<script>
import table from '@/mixins/table'
import { panelTypeAndRouteMapping } from '@/utils/constants'
import { api } from '@/utils/api'
export default {
name: 'chartTable',

View File

@@ -92,7 +92,7 @@ export default {
show: true
},
{
label: this.$t('config.operationlog.type'),
label: this.$t('overall.type'),
prop: 'type',
show: true
},

View File

@@ -47,29 +47,6 @@
<span v-else>{{scope.row[item.prop]}}</span>
</template>
</el-table-column>
<el-table-column
:resizable="false"
:width="operationWidth"
fixed="right">
<template #header>
<div class="table-operation-title">{{$t('overall.option')}}</div>
</template>
<template #default="scope">
<div class="table-operation-items">
<button class="table-operation-item" @click="tableOperation(['edit', scope.row])"><i class="cn-icon cn-icon-edit"></i></button>
<el-dropdown size="medium" trigger="hover" @command="tableOperation">
<div class="table-operation-item table-operation-item--more">
<i class="cn-icon cn-icon-more-arrow-down"></i>
</div>
<template #dropdown>
<el-dropdown-menu >
<el-dropdown-item :command="['delete', scope.row]" :disabled="scope.row.id === 1"><i class="cn-icon cn-icon-delete"></i><span class="operation-dropdown-text">{{$t('overall.delete')}}</span></el-dropdown-item>
</el-dropdown-menu>
</template>
</el-dropdown>
</div>
</template>
</el-table-column>
</el-table>
</template>

View File

@@ -62,29 +62,6 @@
<span v-else>{{scope.row[item.prop]}}</span>
</template>
</el-table-column>
<el-table-column
:resizable="false"
:width="operationWidth"
fixed="right">
<template #header>
<div class="table-operation-title">{{$t('overall.option')}}</div>
</template>
<template #default="scope">
<div class="table-operation-items">
<button class="table-operation-item" @click="tableOperation(['edit', scope.row])"><i class="cn-icon cn-icon-edit"></i></button>
<el-dropdown size="medium" trigger="hover" @command="tableOperation">
<div class="table-operation-item table-operation-item--more">
<i class="cn-icon cn-icon-more-arrow-down"></i>
</div>
<template #dropdown>
<el-dropdown-menu >
<el-dropdown-item :command="['delete', scope.row]" :disabled="scope.row.id === 1"><i class="cn-icon cn-icon-delete"></i><span class="operation-dropdown-text">{{$t('overall.delete')}}</span></el-dropdown-item>
</el-dropdown-menu>
</template>
</el-dropdown>
</div>
</template>
</el-table-column>
</el-table>
</template>

View File

@@ -188,24 +188,8 @@
<span v-else>{{ scope.row[item.prop] || '-' }}</span>
</template>
</el-table-column>
<el-table-column
:resizable="false"
:width="operationWidth"
fixed="right">
<template #header>
<div class="table-operation-title">{{ $t('overall.option') }}</div>
</template>
<template #default="scope">
<div class="table-operation-items">
<button class="table-operation-item" @click="tableOperation(['edit', scope.row])"><i
class="cn-icon cn-icon-bianji"></i></button>
<button class="table-operation-item" @click="tableOperation(['delete', scope.row])"><i
class="cn-icon cn-icon-shanchu"></i></button>
</div>
</template>
</el-table-column>
</el-table>
<div class="table-operation-all">
<!-- <div class="table-operation-all">
<el-checkbox v-model="checkboxAll" :indeterminate="isIndeterminate" @change="selectAll(tableData)"></el-checkbox>
<div class="table-operation-all-span">
<span>{{ $t('overall.all') }}</span>
@@ -216,7 +200,7 @@
<span>{{ $t('report.batchDeletion') }}</span>
</div>
</div>
</div>
</div>-->
</div>
</template>
@@ -308,6 +292,7 @@ export default {
loadingTableId: '',
loadingPreviewId: '',
downDataList: [],
disableEdit:false,//
// pageObj: {
// pageNo: 1,
// pageSize: 20,
@@ -556,6 +541,12 @@ export default {
})
// this.selectIds = selectIds
}
this.batchDeleteObjs = objs
if(objs.length > 1) {
this.disableEdit = true
}else {
this.disableEdit = false
}
},
/**
* 全选按钮
@@ -574,6 +565,13 @@ export default {
this.$refs.dataTable.clearSelection()
}
this.batchDeleteObjs = objs
if(objs.length > 1) {
this.disableEdit = true
}else {
this.disableEdit = false
}
// this.selectIds = selectIds
},
/**

View File

@@ -0,0 +1,135 @@
<template>
<el-table
id="knowledgeBaseTable"
ref="dataTable"
:data="tableData"
:height="height"
border
@header-dragend="dragend"
@sort-change="tableDataSort"
@selection-change="selectionChange"
>
<el-table-column
:resizable="false"
align="center"
type="selection"
width="55">
</el-table-column>
<el-table-column
v-for="(item, index) in customTableTitles"
:key="`col-${index}`"
:fixed="item.fixed"
:label="item.label"
:min-width="`${item.minWidth}`"
:prop="item.prop"
:resizable="true"
:sort-orders="['ascending', 'descending']"
:sortable="item.sortable"
:width="`${item.width}`"
class="data-column"
>
<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 === 'name'">
<template v-if="scope.row.i18n">
<span>{{$t(scope.row.i18n)}}</span>
</template>
<template v-else-if="scope.row.name">
<span>{{scope.row.name}}</span>
</template>
<template v-else>
<span>-</span>
</template>
</template>
<template v-else-if="item.prop === 'tagType'">
<span class="type-tag">{{tagTypeText(scope.row[item.prop])}}</span>
</template>
<template v-else-if="item.prop === 'utime' || 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 === 'cuser' || item.prop === 'uuser'">
<template v-if="scope.row[item.prop]">
{{scope.row[item.prop].username || '-'}}
</template>
<template v-else>
<span>-</span>
</template>
</template>
<span v-else>{{scope.row[item.prop] || '-'}}</span>
</template>
</el-table-column>
</el-table>
</template>
<script>
import table from '@/mixins/table'
import { knowledgeBaseType } from '@/utils/constants'
export default {
name: 'knowledgeBaseTable',
mixins: [table],
data () {
return {
tableTitle: [ // 原table列
{
label: 'ID',
prop: 'id',
show: true,
width: 100,
sortable: 'custom'
}, {
label: this.$t('config.roles.name'),
prop: 'tagName',
show: true,
sortable: 'custom'
}, {
label: this.$t('overall.type'),
prop: 'tagType',
show: true
}, {
label: this.$t('overall.remark'),
prop: 'remark',
show: true
},
{
label: this.$t('overall.createdBy'),
prop: 'cuser',
show: true
},
{
label: this.$t('config.user.createTime'),
prop: 'ctime',
show: false,
sortable: 'custom'
},
{
label: this.$t('overall.updatedBy'),
prop: 'uuser',
show: false
},
{
label: this.$t('overall.updateTime'),
prop: 'utime',
show: false,
sortable: 'custom'
}
]
}
},
computed: {
tagTypeText () {
return function (type) {
const t = knowledgeBaseType.find(t => t.value === type)
return t ? t.name : ''
}
}
}
}
</script>

View File

@@ -20,7 +20,7 @@ export default {
pageObj: { // 分页对象
pageNo: 1,
pageSize: defaultPageSize,
total: ''
total: 0
},
/* 工具参数 */
tools: {
@@ -37,6 +37,7 @@ export default {
tableData: [],
scrollbarWrap: null,
delFlag: false,
disableEdit:false,//编辑按钮是否不可用,当选择多条记录的时候你,编辑按钮不可用
operationWidth: '165' // 操作列宽
}
},
@@ -74,6 +75,11 @@ export default {
},
selectionChange (objs) {
this.batchDeleteObjs = objs
if(this.batchDeleteObjs.length > 1) {
this.disableEdit = true
}else {
this.disableEdit = false
}
},
getTableData (params) {
if (params) {
@@ -95,6 +101,13 @@ export default {
this.tableData = response.data.list
this.pageObj.total = response.data.total
// TODO 回到顶部
} else {
console.error(response)
if (response.message) {
this.$message.error(response.message)
} else {
this.$message.error('Something went wrong...')
}
}
})
},
@@ -115,6 +128,39 @@ export default {
})
})
},
delBatch () {
let ids = []
if(this.batchDeleteObjs && this.batchDeleteObjs.length > 0){
this.batchDeleteObjs.forEach(item =>{
ids.push(item.id)
})
}
if(ids.length === 0){
this.$alert(this.$t('tip.pleaseSelect'),{
confirmButtonText: this.$t('tip.yes'),
type:'warning'
})
}else {
this.$confirm(this.$t('tip.confirmDelete'), {
confirmButtonText: this.$t('tip.yes'),
cancelButtonText: this.$t('tip.no'),
type: 'warning'
}).then(() => {
this.tools.loading = true
axios.delete(this.url + '?ids=' + ids).then(response => {
if (response.data.code === 200) {
this.delFlag = true
this.$message({ duration: 2000, type: 'success', message: this.$t('tip.deleteSuccess') })
this.getTableData()
} else {
this.$message.error(response.data.message)
}
}).finally(() => {
this.tools.loading = false
})
})
}
},
newObject () {
return JSON.parse(JSON.stringify(this.blankObject))
},
@@ -153,6 +199,21 @@ export default {
}
})
},
editSelectRecord(){
if(this.batchDeleteObjs.length === 0){
this.$alert(this.$t('tip.pleaseSelectForEdit'),{
confirmButtonText: this.$t('tip.yes'),
type:'warning'
})
}else {
get(`${this.url}/${this.batchDeleteObjs[0].id}`).then(response => {
if (response.code === 200) {
this.object = response.data
this.rightBox.show = true
}
})
}
},
copy (u) {
this.object = { ...u, name: 'Copy from ' + u.name, id: '' }
this.rightBox.show = true

View File

@@ -28,7 +28,7 @@ export default {
if (n) {
setTimeout(() => {
this.$refs.dataTable.doLayout()
}, 100)
}, 200)
}
}
},
@@ -55,21 +55,7 @@ export default {
})
},
tableDataSort (item) {
let orderBy = ''
if (item.order === 'ascending') {
if (item.prop === 'lastTime') {
orderBy = chartTableOrderOptionsMapping[item.prop]
} else {
orderBy = item.prop
}
}
if (item.order === 'descending') {
if (item.prop === 'lastTime') {
orderBy = '-' + chartTableOrderOptionsMapping[item.prop]
} else {
orderBy = '-' + item.prop
}
}
const orderBy = (item.order === 'descending' ? '-' : '') + (item.prop ? (chartTableOrderOptionsMapping[item.prop] || item.prop) : '')
this.$emit('orderBy', orderBy)
}
}

View File

@@ -1,6 +1,5 @@
import router from './router'
import store from './store'
import { ElMessage } from 'element-plus'
import { getPermission } from '@/utils/api'
import { loadGeoData } from '@/utils/tools'
import axios from 'axios'
@@ -18,6 +17,7 @@ router.beforeEach(async (to, from, next) => {
loadGeoData()
// 加载baseUrl
if (!axios.defaults.baseURL) {
// eslint-disable-next-line no-undef
axios.defaults.baseURL = BASE_CONFIG.baseUrl
}
if (localStorage.getItem(storageKey.token)) {
@@ -36,11 +36,12 @@ router.beforeEach(async (to, from, next) => {
store.commit('setRoleList', roleList)
}
if (to.path) {
if (hasMenu(store.getters.menuList, to.path)) {
next()
/* if (hasMenu(store.getters.menuList, to.path)) {
next()
} else {
ElMessage.error('No access') // TODO 国际化
}
} */
}
}
} else {
@@ -80,7 +81,7 @@ export function hasMenu (menuList, route) {
export function hasParam (url, param) {
let hasParam = false
let tempArr = url.split('?')
const query = {}
// const query = {}
if (tempArr[1]) {
tempArr = tempArr[1].split('&')
tempArr.forEach(t => {

View File

@@ -21,12 +21,16 @@ const routes = [
},
{
path: '/report/builtIn',
component: () => import('@/views/report/reportTest')
component: () => import('@/views/report/Report')
},
{
path: '/entityExplorer',
component: () => import('@/views/entityExplorer/EntityExplorer')
},
{
path: '/detection',
redirect: '/detection/securityEvent'
},
{
path: '/detection/:typeName',
component: () => import('@/views/detections/Index')
@@ -35,6 +39,14 @@ const routes = [
path: '/businessLog/viewer',
component: () => import('@/views/businessLog/Viewer')
},
{
path: '/knowledgeBase',
component: () => import('@/views/setting/KnowledgeBase')
},
{
path: '/knowledgeBase/form',
component: () => import('@/views/setting/KnowledgeBaseForm')
},
{
name: 'Administration',
path: '/administration',
@@ -51,31 +63,26 @@ const routes = [
path: '/administration/role',
component: () => import('@/views/administration/Roles')
},
{
name: 'I18n',
path: '/administration/i18n',
component: () => import('@/views/administration/I18n')
},
{
name: 'OperationLog',
path: '/administration/operationLog',
component: () => import('@/views/administration/OperationLog')
}
]
},
{
name: 'GalaxyProxy',
path: '/administration/galaxyProxy',
component: () => import('@/views/administration/GalaxyProxy')
name: 'I18n',
path: '/i18n',
component: () => import('@/views/administration/I18n')
},
{
name: 'Chart',
path: '/administration/chart',
path: '/chart',
component: () => import('@/views/administration/Chart')
}
]
}
]
}
]
const router = createRouter({
history: createWebHashHistory(),

View File

@@ -12,7 +12,8 @@ const store = createStore({
return {
i18n: false,
showEntityTypeSelector: false, // 在entity explore页面时控制header显示实体类型选择框
from: '' // entity type
from: '', // entity type
test: 'jest' // 用于单测的demo
}
},
getters: {
@@ -24,6 +25,9 @@ const store = createStore({
},
entityName (state) {
return state.entityName
},
getTest (state) {
return state.test
}
},
mutations: {
@@ -37,6 +41,9 @@ const store = createStore({
},
showEntityTypeSelector (state, show) {
state.showEntityTypeSelector = show
},
setTest (state, test) {
state.test = test
}
}
})

View File

@@ -33,6 +33,8 @@ export const api = {
chartList: '/visual/chart/list',
// galaxyProxy
galaxyProxy: '/galaxy/setting',
// 知识库
knowledgeBase: '/knowledge',
// 报告相关
reportJob: '/report/job',

View File

@@ -122,7 +122,8 @@ export const chartTableColumnMapping = {
ip: 'IP'
}
export const chartTableOrderOptionsMapping = {
lastTime: 'last_time'
lastTime: 'last_time',
tagName: 'tag_name'
}
export const chartPieTableTopOptions = [
{ name: 'Sessions', value: 'sessions' },
@@ -277,6 +278,21 @@ export const cycle = {
pre: 1
}
export const knowledgeBaseType = [
{
name: 'IP',
value: 'ip'
},
{
name: 'Domain',
value: 'domain'
},
{
name: 'APP',
value: 'app'
}
]
export const curTabState = {
curTab: 'curTab',
tableMetric: 'tableMetric',

View File

@@ -532,14 +532,14 @@ export function getUserDrilldownTableGeo (userId) {
return data[userId]
}
function JSONParse (data) {
const firstParse = JSON.parse(data)
if (typeof firstParse === 'string') {
return JSON.parse(firstParse)
} else {
return firstParse
}
}
// function JSONParse (data) {
// const firstParse = JSON.parse(data)
// if (typeof firstParse === 'string') {
// return JSON.parse(firstParse)
// } else {
// return firstParse
// }
// }
export function copyValue (item) {
const str = item
@@ -878,9 +878,9 @@ export async function getDnsMapData (type) {
}
export function handleSpecialValue (value) {
if (value) {
value = value.replaceAll("'", "\\\\'")
.replaceAll('"', '\\"')
.replaceAll('&', '%26')
value = value.replace(/\'/g, "\\\\'")
.replace(/\"/g, '\\"')
.replace(/\&/g, '%26')
}
return value
}
@@ -894,13 +894,13 @@ export function combineTabList (tableType, list, commonTabList) {
const commonTab = commonTabList.find(item => item.name === tabName)
tab.label = commonTab ? commonTab.i18n : ''
tab.prop = commonTab ? commonTab.prop : ''
if (!tab.hasOwnProperty('checked')) {
if (!Object.prototype.hasOwnProperty.call(tab, 'checked')) {
tab.checked = tab ? tab.show : true
}
if (!tab.hasOwnProperty('disabled')) {
if (!Object.prototype.hasOwnProperty.call(tab, 'disabled')) {
tab.disabled = tab ? !tab.enable : false
}
if (!tab.hasOwnProperty('panelId')) {
if (!Object.prototype.hasOwnProperty.call(tab, 'panelId')) {
tab.panelId = tab ? tab.panelIdOfFourthMenu : null
}
// 代码里写死的
@@ -1146,3 +1146,20 @@ export function getLineIndexUnit (type, show) {
}
}
}
export function getLineIndexUnit2 (type) {
if (type.indexOf('total') > -1) {
return 0
} else if (type.indexOf('inbound') > -1) {
return 1
} else if (type.indexOf('outbound') > -1) {
return 2
} else if (type.indexOf('internal') > -1) {
return 3
} else if (type.indexOf('through') > -1) {
return 4
} else if (type.indexOf('other') > -1) {
return 5
} else {
return 0
}
}

View File

@@ -53,7 +53,7 @@
<script>
import cnDataList from '@/components/table/CnDataList'
import dataListMixin from '@/mixins/data-list'
import chartTable from '@/components/table/settings/ChartTable'
import chartTable from '@/components/table/administration/ChartTable'
import chartBox from '@/components/rightBox/settings/ChartBox'
import { api } from '@/utils/api'

View File

@@ -76,7 +76,7 @@
<script>
import cnDataList from '@/components/table/CnDataList'
import galaxyProxyBox from '@/components/rightBox/settings/GalaxyProxyBox'
import galaxyProxyTable from '@/components/table/settings/GalaxyProxyTable'
import galaxyProxyTable from '@/components/table/administration/GalaxyProxyTable'
import dataListMixin from '@/mixins/data-list'
import { api } from '@/utils/api'
import { get, put } from '@/utils/http'

View File

@@ -55,7 +55,7 @@
<script>
import cnDataList from '@/components/table/CnDataList'
import dataListMixin from '@/mixins/data-list'
import i18nTable from '@/components/table/settings/I18nTable'
import i18nTable from '@/components/table/administration/I18nTable'
import i18nBox from '@/components/rightBox/settings/I18nBox'
import { api } from '@/utils/api'

View File

@@ -16,35 +16,21 @@
<script>
import ChartTabs from '@/components/common/ChartTabs'
import { useStore } from 'vuex'
export default {
name: 'index',
components: {
ChartTabs
},
data () {
setup () {
const store = useStore()
const menu = store.getters.menuList.find(m => m.code === 'administration')
const tabsData = menu.children.map(l => ({
...l,
path: l.route
})).sort((a, b) => a.sort - b.sort)
return {
tabsData: [
{
i18n: 'overall.user',
path: '/administration/user',
icon: 'cn-icon cn-icon-user2'
},
{
i18n: 'overall.role',
path: '/administration/role',
icon: 'cn-icon cn-icon-role2'
},
{
i18n: 'overall.operationLog',
path: '/administration/operationLog',
icon: 'cn-icon cn-icon-operation-log'
},
{
i18n: 'I18n',
path: '/administration/i18n',
icon: 'cn-icon cn-icon-i18n'
}
]
tabsData
}
}
}

View File

@@ -34,7 +34,7 @@
<script>
import cnDataList from '@/components/table/CnDataList'
import dataListMixin from '@/mixins/data-list'
import operationLogTable from '@/components/table/settings/OperationLogTable'
import operationLogTable from '@/components/table/administration/OperationLogTable'
import { api } from '@/utils/api'
export default {

View File

@@ -9,11 +9,23 @@
:layout="['columnCustomize','elementSet','search']"
@search="search"
>
<template v-slot:top-tool-right>
<button id="roles-add" :title="$t('overall.createRole')" class="top-tool-btn margin-r-10"
type="button" @click="add">
<i class="cn-icon-add cn-icon"></i>
<template v-slot:top-tool-left>
<button id="roles-add" class="top-tool-btn margin-r-10 top-tool-btn--create"
@click="add">
<i class="cn-icon-xinjian cn-icon"></i>
<span>{{$t('overall.create')}}</span>
</button>
<button id="roles-edit" class="top-tool-btn margin-r-10" :disabled="disableEdit"
@click="edit">
<i class="cn-icon-edit cn-icon"></i>
<span>{{$t('overall.edit')}}</span>
</button>
<button id="roles-delete" class="top-tool-btn margin-r-10"
@click="delBatch">
<i class="cn-icon-delete cn-icon"></i>
<span>{{$t('overall.delete')}}</span>
</button>
<delete-button id="role-list-batch-delete" :api="url" :delete-objs="batchDeleteObjs" @after="getTableData" @before="delFlag=true"></delete-button>
</template>
<template v-slot:default>
@@ -48,7 +60,7 @@
<script>
import cnDataList from '@/components/table/CnDataList'
import dataListMixin from '@/mixins/data-list'
import rolesTable from '@/components/table/settings/RoleTable'
import rolesTable from '@/components/table/administration/RoleTable'
import roleBox from '@/components/rightBox/settings/RoleBox'
import { api } from '@/utils/api'
import { get } from '@/utils/http'
@@ -78,8 +90,14 @@ export default {
}
},
methods: {
edit (u) {
get(`${this.url}`, { ids: u.id }).then(response => {
edit () {
if(this.batchDeleteObjs.length === 0){
this.$alert(this.$t('tip.pleaseSelectForEdit'),{
confirmButtonText: this.$t('tip.yes'),
type:'warning'
})
}else {
get(`${this.url}`, { ids: this.batchDeleteObjs[0].id }).then(response => {
if (response.code === 200) {
this.object = response.data.list[0]
this.rightBox.show = true
@@ -88,4 +106,5 @@ export default {
}
}
}
}
</script>

View File

@@ -9,14 +9,21 @@
:layout="['columnCustomize','elementSet','search']"
@search="search"
>
<template #top-tool-right>
<button
id="account-add"
class="top-tool-btn margin-r-10"
type="button"
@click="add"
>
<i class="cn-icon-add cn-icon"/>
<template #top-tool-left>
<button id="account-add" class="top-tool-btn margin-r-10 top-tool-btn--create"
@click="add">
<i class="cn-icon-xinjian cn-icon"></i>
<span>{{$t('overall.create')}}</span>
</button>
<button id="account-edit" class="top-tool-btn margin-r-10" :disabled="disableEdit"
@click="editSelectRecord">
<i class="cn-icon-edit cn-icon"></i>
<span>{{$t('overall.edit')}}</span>
</button>
<button id="account-delete" class="top-tool-btn margin-r-10"
@click="delBatch">
<i class="cn-icon-delete cn-icon"></i>
<span>{{$t('overall.delete')}}</span>
</button>
</template>
<template #default>
@@ -53,7 +60,7 @@
<script>
import cnDataList from '@/components/table/CnDataList'
import dataListMixin from '@/mixins/data-list'
import userTable from '@/components/table/settings/UserTable'
import userTable from '@/components/table/administration/UserTable'
import userBox from '@/components/rightBox/settings/UserBox'
import { api } from '@/utils/api'

View File

@@ -370,17 +370,12 @@ export default {
}
},
setup (props) {
const { currentRoute } = useRouter()
function isEntityDetail (r) {
return r.indexOf('entityDetail') > -1
}
const dateRangeValue = isEntityDetail(currentRoute.value.path) ? 60 * 24 : 60
const dateRangeValue = 60
const { startTime, endTime } = getNowTime(dateRangeValue)
// entity详情内的chart时间工具不是公共的需要单独定义
const chartTimeFilter = ref({ startTime, endTime, dateRangeValue })
// 复制一份prop中需要被组件v-model的内容避免报错
const copyOrderPieTable = props.orderPieTable
const copyOrderPieTable = ref(props.orderPieTable)
return {
chartTimeFilter,
chartTableTopOptions,

View File

@@ -107,11 +107,8 @@ export default {
const { params } = useRoute()
panelType = props.entity ? props.entity.type : panelTypeAndRouteMapping[params.typeName]
function isEntityDetail (t) {
return [4, 5, 6].indexOf(t) > -1
}
// date
const dateRangeValue = isEntityDetail(panelType) ? 60 * 24 : 60
const dateRangeValue = 60
const { startTime, endTime } = getNowTime(dateRangeValue)
const timeFilter = ref({ startTime, endTime, dateRangeValue })

View File

@@ -239,19 +239,16 @@ export default {
panelType = props.entity ? props.entity.type : panelTypeAndRouteMapping[params.typeName]
}
function isEntityDetail (t) {
return [4, 5, 6].indexOf(t) > -1
}
// 获取url携带的range、startTime、endTime
const rangeParam = query.range
const startTimeParam = query.startTime
const endTimeParam = query.endTime
// 若url携带了使用携带的值否则使用默认值。
const dateRangeValue = rangeParam ? parseInt(query.range) : (isEntityDetail(panelType) ? 60 * 24 : 60)
const dateRangeValue = rangeParam ? parseInt(query.range) : 60
const timeFilter = ref({ dateRangeValue })
if (!startTimeParam || !endTimeParam) {
const { startTime, endTime } = getNowTime(isEntityDetail(panelType) ? 60 * 24 : 60)
const { startTime, endTime } = getNowTime(60)
timeFilter.value.startTime = startTime
timeFilter.value.endTime = endTime
} else {

View File

@@ -1,13 +1,13 @@
<template>
<div class="link-blocks">
<div class="block-list" style="position: relative">
<div class="block-list__title" v-if="!showError">{{ $t('linkMonitor.links') }}</div>
<div class="block-list__title" v-if="!showError1">{{ $t('linkMonitor.links') }}</div>
<!--无数据noData-->
<chart-no-data v-if="isNoData"></chart-no-data>
<chart-no-data v-if="linkNoData" test-id="linkBlockNoData"></chart-no-data>
<div class="block-list__list" v-show="!isNoData">
<chart-error v-if="showError" :content="errorMsg1" />
<div class="block-list__list" v-show="!linkNoData">
<chart-error v-if="showError1" :content="errorMsg1" />
<el-popover
v-else
placement="bottom"
@@ -57,12 +57,12 @@
</div>
<div class="block-list" >
<div class="block-list__title" v-if="!showError">{{ $t('linkMonitor.nextHopInternet') }}</div>
<div class="block-list__title" v-if="!showError2">{{ $t('linkMonitor.nextHopInternet') }}</div>
<chart-no-data v-if="isNoData"></chart-no-data>
<chart-no-data v-if="nextHopNoData" test-id="nextHpNoData"></chart-no-data>
<div class="block-list__list" v-show="!isNoData">
<chart-error v-if="showError" :content="errorMsg2" />
<div class="block-list__list" v-show="!nextHopNoData">
<chart-error v-if="showError2" :content="errorMsg2" />
<el-popover
v-else
placement="bottom"
@@ -91,13 +91,13 @@
<div class="popper-content__link-info">
<div class="info__label">{{ $t('linkMonitor.linkBlock.bandwidthUsage') }}</div>
<div class="info__value" style="display: flex">
<div>
<div :test-id="`nextHopEgressUsage${index}`">
<svg class="icon item-popover-up" aria-hidden="true">
<use xlink:href="#cn-icon-egress"></use>
</svg>
{{ convertValue(item.egressUsage) }}
</div>
<div>
<div :test-id="`nextHopIngressUsage${index}`">
<svg class="icon item-popover-down" aria-hidden="true">
<use xlink:href="#cn-icon-ingress"></use>
</svg>
@@ -135,12 +135,14 @@ export default {
},
data () {
return {
isNoData: false,
linkNoData: false,
nextHopNoData: false,
unitTypes,
linkData: [],
nextHopData: [],
gradientColor: ['#FF005C', '#40537E'], // [start, end]
showError: false,
showError1: false,
showError2: false,
errorMsg1: '',
errorMsg2: ''
}
@@ -182,16 +184,13 @@ export default {
const res = []
res[0] = response[0].data
res[1] = response[1].data
if (res[0].code === 200 && res[1].code === 200) {
this.showError = false
if (res[0].code === 200) {
this.showError1 = false
const linkData = res[0].data.result
const nextHopData = res[1].data.result
this.isNoData = linkData.length === 0 && nextHopData.length === 0
if (this.isNoData) {
return
}
this.linkNoData = linkData.length === 0
if (!this.linkNoData) {
const data = []
linkData.forEach(d => {
const info = linkInfo.find(i => i.originalLinkId === d.linkId)
@@ -237,7 +236,19 @@ export default {
s.popoverWidth = this.computePopoverWidth(s.egressUsage, s.ingressUsage)
})
this.linkData = sorted
}
} else {
this.linkNoData = false
this.showError1 = true
this.errorMsg1 = res[0].message
}
if (res[1].code === 200) {
this.showError2 = false
const nextHopData = res[1].data.result
this.nextHopNoData = nextHopData.length === 0
if (!this.nextHopNoData) {
let directionArr = []
nextHopData.forEach((item) => {
if (item.egressLinkDirection !== '' && item.ingressLinkDirection !== '') {
@@ -288,16 +299,18 @@ export default {
})
this.nextHopData = nextHopSorted
}
} else {
this.isNoData = false
this.showError = true
this.errorMsg1 = res[0].message
this.showError2 = true
this.nextHopNoData = false
this.errorMsg2 = res[1].message
}
}).catch(e => {
console.error(e)
this.isNoData = false
this.showError = true
this.linkNoData = false
this.nextHopNoData = false
this.showError1 = true
this.showError2 = true
// todo 此处数据还待验证
this.errorMsg1 = e.message
this.errorMsg2 = e.message

View File

@@ -1,10 +1,10 @@
<template>
<div class="link-direction-grid">
<!--左侧链路出入口-->
<popover-content :isNoData="isLinkNoData" :gridData="linkGridData" :showError="isLinkShowError" :content="linkErrorMsg" style="width: 900px;"/>
<popover-content :title="$t('linkMonitor.egressLink') + ' & ' + $t('linkMonitor.ingressLink')" :isNoData="isLinkNoData" :gridData="linkGridData" :showError="isLinkShowError" :content="linkErrorMsg" style="width: 900px;"/>
<!--右侧链路下一跳-->
<popover-content :isNoData="isNextNoData" :gridData="nextGridData" :showError="isNextShowError" :content="nextErrorMsg" />
<popover-content :title="$t('linkMonitor.nextHopInternetOfGrid')" :isNoData="isNextNoData" :gridData="nextGridData" :showError="isNextShowError" :content="nextErrorMsg" />
</div>
</template>
@@ -143,12 +143,12 @@ export default {
// 链路下一跳信息
const nextLinkData = res[1].data.result
// 接口数据乱序,根据方向排序,再根据同个方向下的进行排序
// 接口数据乱序,根据方向排序,再根据同个方向下的出方向进行排序
nextLinkData.sort((a, b) => {
if (a.ingressLinkDirection !== b.ingressLinkDirection) {
return a.ingressLinkDirection.localeCompare(b.ingressLinkDirection)
return a.ingressLinkDirection.localeCompare(b.ingressLinkDirection, 'zh')
}
return a.egressLinkDirection.localeCompare(b.egressLinkDirection)
return a.egressLinkDirection.localeCompare(b.egressLinkDirection, 'zh')
})
this.isNextNoData = nextLinkData.length === 0

View File

@@ -1,9 +1,8 @@
<template>
<div class="link-statistical-dimension" style="position: relative">
<div class="dimension-title" v-if="gridData.length>3">{{ $t('linkMonitor.egressLink') }}&nbsp;&&nbsp;{{ $t('linkMonitor.ingressLink') }}</div>
<div class="dimension-title" v-else>{{ $t('linkMonitor.nextHopInternetOfGrid') }}</div>
<div class="dimension-title">{{title}}</div>
<chart-no-data v-if="isNoData"></chart-no-data>
<chart-no-data v-if="isNoData" :test-id="`noData${gridData.length}`"></chart-no-data>
<chart-error class="link-block-error" v-if="showError" :content="content"/>
@@ -156,7 +155,8 @@ export default {
gridData: Array,
isNoData: Boolean,
showError: Boolean,
content: String
content: String,
title: String
},
components: {
ChartError,

View File

@@ -53,7 +53,7 @@
</div>
</div>
<div style="height: calc(100% - 74px); position: relative">
<chart-no-data v-if="isNoData"></chart-no-data>
<chart-no-data v-if="isNoData" test-id="noData"></chart-no-data>
<div class="chart-drawing" v-show="showMarkLine && !isNoData" id="linkTrafficLineChart"></div>
</div>
</div>
@@ -201,7 +201,7 @@ export default {
console.error(e)
this.showError = true
this.errorMsg = e.message
// this.isNoData = true
this.isNoData = false
}).finally(() => {
this.loading = false
})

View File

@@ -161,10 +161,9 @@ export default {
this.errorMsg = res.message
}
}).catch(e => {
console.error(e)
this.showError = true
this.errorMsg = e.message
// this.isNoData = true
this.isNoData = false
}).finally(() => {
this.loading = false
})

View File

@@ -71,7 +71,7 @@
<el-tab-pane :label="$t('network.providers')" :name="0">
<div class="body__apps" :class="{'body__apps-no-grid': providerOptions.length === 0}">
<loading :loading="loadingBody"></loading>
<chart-no-data v-if="providerOptions.length === 0 && !loadingBody"></chart-no-data>
<chart-no-data v-if="providerOptions.length === 0 && !loadingBody" test-id="noData"></chart-no-data>
<div class="body__app" v-else :class="{'provide-show': app.provideShow}" v-for="(app, index) in providerOptions" :key="index" @click="appCheckedChange(app, 0)" :test-id="`provide${index}`">
<div class="body__app-content">
<div class="body__app-left">
@@ -463,7 +463,7 @@ export default {
params.type = 'overviewProvide'
axios.get(api.dict, { params: params }).then(res => {
res = res.data
if (res.code === 200) {
if (res.code === 200 && res.data.list) {
res.data.list = res.data.list.filter(l => !this.appData.some(pd => pd.type === 'provider' && pd.name === l.value))
this.pageObj.pages = res.data.pages
res.data.list.forEach(t => {

View File

@@ -1,6 +1,6 @@
<template>
<div class="ddos-detection">
<chart-no-data v-if="isNoData"></chart-no-data>
<chart-no-data v-if="isNoData" test-id="noData"></chart-no-data>
<chart-error info v-if="showError" :content="errorMsg" />
<div class="ddos-detection-title">

View File

@@ -12,7 +12,7 @@
:key="index"
@mouseenter="mouseenter(item)"
@mouseleave="mouseleave(item)"
@click="activeChange(item, index)"
@click="activeChange(item, index,true)"
:test-id="`tab${index}`"
>
<div class="line-value-tabs-name">
@@ -75,7 +75,6 @@ import chartMixin from '@/views/charts2/chart-mixin'
import { useRoute } from 'vue-router'
import { getLineType, overwriteUrl, urlParamsHandler } from '@/utils/tools'
import ChartError from '@/components/common/Error'
import mockData from '../../../../../test/views/charts2/charts/networkOverview/NetworkOverviewLineMockData'
export default {
name: 'NetworkOverviewLine',
@@ -123,12 +122,66 @@ export default {
}
],
tabsTemplate: [
{ analysis: {}, name: 'network.total', class: 'total', show: true, invertTab: true, positioning: 0, data: [], unitType: '' },
{ analysis: {}, name: 'network.inbound', class: 'inbound', show: true, invertTab: true, positioning: 1, data: [], unitType: '' },
{ analysis: {}, name: 'network.outbound', class: 'outbound', show: true, invertTab: true, positioning: 2, data: [], unitType: '' },
{ analysis: {}, name: 'network.internal', class: 'internal', show: true, invertTab: true, positioning: 3, data: [], unitType: '' },
{ analysis: {}, name: 'network.through', class: 'through', show: true, invertTab: true, positioning: 4, data: [], unitType: '' },
{ analysis: {}, name: 'network.other', class: 'other', show: true, invertTab: true, positioning: 5, data: [], unitType: '' }
{
analysis: {},
name: 'network.total',
class: 'total',
show: true,
invertTab: true,
positioning: 0,
data: [],
unitType: ''
},
{
analysis: {},
name: 'network.inbound',
class: 'inbound',
show: true,
invertTab: true,
positioning: 1,
data: [],
unitType: ''
},
{
analysis: {},
name: 'network.outbound',
class: 'outbound',
show: true,
invertTab: true,
positioning: 2,
data: [],
unitType: ''
},
{
analysis: {},
name: 'network.internal',
class: 'internal',
show: true,
invertTab: true,
positioning: 3,
data: [],
unitType: ''
},
{
analysis: {},
name: 'network.through',
class: 'through',
show: true,
invertTab: true,
positioning: 4,
data: [],
unitType: ''
},
{
analysis: {},
name: 'network.other',
class: 'other',
show: true,
invertTab: true,
positioning: 5,
data: [],
unitType: ''
}
],
tabs: [],
unitConvert,
@@ -226,31 +279,31 @@ export default {
/**
* 初始化echartsdom用于右键点击返回框选
*/
domInit () {
const self = this
// 去掉默认的contextmenu事件否则会和右键事件同时出现。
document.oncontextmenu = function (e) {
e.preventDefault()
}
document.getElementById('overviewLineChart').onmousedown = function (e) {
// e.button: 0左键1滚轮2右键
if (e.button === 2) {
self.myChart.dispatchAction({
type: 'brush',
areas: [] // 删除选框
})
self.mouseDownFlag = true
document.getElementById('brushBtn').style.left = e.layerX + 'px'
document.getElementById('brushBtn').style.top = e.layerY + 74 + 'px'
}
}
},
// domInit () {
// const self = this
// // 去掉默认的contextmenu事件否则会和右键事件同时出现。
// document.oncontextmenu = function (e) {
// e.preventDefault()
// }
// document.getElementById('overviewLineChart').onmousedown = function (e) {
// // e.button: 0左键1滚轮2右键
// if (e.button === 2) {
// self.myChart.dispatchAction({
// type: 'brush',
// areas: [] // 删除选框
// })
// self.mouseDownFlag = true
// document.getElementById('brushBtn').style.left = e.layerX + 'px'
// document.getElementById('brushBtn').style.top = e.layerY + 74 + 'px'
// }
// }
// },
echartsInit (echartsData, show) {
// echarts内容在单元测试时不执行
if (!this.isUnitTesting) {
if (this.lineTab) {
this.handleActiveBar()
echartsData = echartsData.filter(t => t.show === true && t.invertTab === false)
echartsData = echartsData.filter(t => t.show === true && t.class === this.lineTab) // t.invertTab === false
} else {
echartsData = echartsData.filter(t => t.show === true)
}
@@ -263,6 +316,10 @@ export default {
return {
...chartOption,
name: t.name,
type: 'line',
showSymbol: false,
smooth: true,
symbol: 'circle',
lineStyle: {
color: chartColor3[t.positioning],
width: 1
@@ -404,11 +461,17 @@ export default {
})
}
},
activeChange (item, index) {
activeChange (item, index, isClick) { // isClick:代表是通过点击操作来的
if (this.isNoData) return
if (isClick && this.lineTab === item.class) { // 点击高亮 tab 后取消高亮,恢复到全不高亮的状态
this.legendSelectChange(item, index, 'active', true)
this.lineTab = ''
this.showMarkLine = false
} else {
this.lineTab = item.class
this.legendSelectChange(item, index, 'active')
this.showMarkLine = !item.invertTab
}
this.init(this.metric, this.showMarkLine, 'active')
},
mouseenter (item) {
@@ -431,10 +494,15 @@ export default {
name: name
})
},
legendSelectChange (item, index, val) {
legendSelectChange (item, index, val, isActiveAll) {
if (index === 'index') {
this.dispatchLegendSelectAction(item.name)
} else if (this.tabs[index] && this.tabs[index].name === item.name) {
if (isActiveAll) {
this.tabs.forEach((t) => {
this.dispatchLegendSelectAction(t.name)
})
} else {
this.dispatchLegendSelectAction(item.name)
this.tabs.forEach((t) => {
if (t.name !== item.name) {
@@ -442,6 +510,7 @@ export default {
}
})
}
}
if (val === 'active') {
this.tabs.forEach(t => {
if (item.name === t.name) {
@@ -464,38 +533,44 @@ export default {
},
handleActiveBar () {
if (document.querySelector('.network .line-value-tabs.is-active')) {
const { offsetLeft, clientWidth, clientLeft } = document.querySelector('.network .line-value-tabs.is-active')
const {
offsetLeft,
clientWidth,
clientLeft
} = document.querySelector('.network .line-value-tabs.is-active')
const activeBar = document.querySelector('.network .line-value-active')
activeBar.style.cssText += `width: ${clientWidth}px; left: ${offsetLeft + this.leftOffset + clientLeft}px;`
}
},
resize () {
if (this.myChart) {
this.myChart.resize()
}
},
referenceSelectChange (val) {
this.lineRefer = val
let echartsData
if (this.lineTab) {
echartsData = this.tabs.filter(t => t.show === true && t.invertTab === false)
echartsData = this.tabs.filter(t => t.show === true && t.class === this.lineTab) // t.invertTab === false
} else {
echartsData = this.tabs.filter(t => t.show === true)
}
if (!this.isUnitTesting) {
const chartOption = this.myChart.getOption()
if (this.lineRefer === 'Average' && this.showMarkLine) {
chartOption.series.forEach((t, i) => {
chartOption.series.forEach((t) => {
if (t.name === echartsData[0].name) {
t.markLine.data = [{ yAxis: echartsData[0].analysis.avg }]
}
})
} else if (this.lineRefer === '95th Percentile' && this.showMarkLine) {
chartOption.series.forEach((t, i) => {
chartOption.series.forEach((t) => {
if (t.name === echartsData[0].name) {
t.markLine.data = [{ yAxis: echartsData[0].analysis.p95 }]
}
})
} else if (this.lineRefer === 'Maximum' && this.showMarkLine) {
chartOption.series.forEach((t, i) => {
chartOption.series.forEach((t) => {
if (t.name === echartsData[0].name) {
t.markLine.data = [{ yAxis: echartsData[0].analysis.max }]
}
@@ -548,7 +623,9 @@ export default {
otherData[2] = 5
}
}
dataIntegrationArray.sort((a, b) => { return a[1] - b[1] })
dataIntegrationArray.sort((a, b) => {
return a[1] - b[1]
})
const sortIndex = dataIntegrationArray.findIndex(a => a[2] === index)
return this.sizes[sortIndex]
},
@@ -598,22 +675,23 @@ export default {
tabs[i].analysis = d.analysis
})
let num = 0
const self = this
tabs.forEach(e => {
e.unitType = type
if (e.name !== 'network.total' && parseFloat(e.analysis.avg) == 0) {
if (e.name !== 'network.total' && parseFloat(e.analysis.avg) === 0) {
e.show = false
num += 1
} else {
e.show = true
if (!active && show !== this.lineRefer) {
this.legendSelectChange(e, 'index')
if (!active && show !== self.lineRefer) {
self.legendSelectChange(e, 'index')
}
}
if (this.lineTab === e.class) {
if (self.lineTab === e.class) {
if (parseFloat(e.analysis.avg) <= 0) {
this.lineTab = ''
this.lineRefer = ''
this.init()
self.lineTab = ''
self.lineRefer = ''
self.init()
}
}
})
@@ -632,33 +710,34 @@ export default {
if (!this.lineRefer) this.lineRefer = 'Average'
})
}
},
}
/**
* 鼠标右键返回框选的时间范围
*/
backBrushHistory () {
this.myChart.dispatchAction({
type: 'brush',
areas: [] // 删除选框
})
if (this.brushHistory.length > 0) {
this.$store.commit('setRangeEchartsData', _.cloneDeep(this.brushHistory[0]))
this.brushHistory.shift()
}
this.mouseDownFlag = false
}
// backBrushHistory () {
// this.myChart.dispatchAction({
// type: 'brush',
// areas: [] // 删除选框
// })
// if (this.brushHistory.length > 0) {
// this.$store.commit('setRangeEchartsData', _.cloneDeep(this.brushHistory[0]))
// this.brushHistory.shift()
// }
// this.mouseDownFlag = false
// }
},
mounted () {
// todo 初始化鼠标事件,开启右键返回
// this.domInit()
this.myChart = null
this.chartOption = null
this.timer = setTimeout(() => {
if (this.lineTab && this.metric !== 'Sessions/s') {
const data = this.tabsTemplate.find(t => t.class === this.lineTab)
this.activeChange(data, data.positioning)
const self = this
self.timer = setTimeout(() => {
if (self.lineTab && self.metric !== 'Sessions/s') {
const data = self.tabsTemplate.find(t => t.class === self.lineTab)
self.activeChange(data, data.positioning)
} else {
this.init()
self.init()
}
}, 200)
window.addEventListener('resize', this.resize)

View File

@@ -24,6 +24,7 @@
border
:cell-style="tableCellStyle"
:header-cell-style="tableHeaderCellStyle"
:row-class-name="rowClassName"
:class="tableClass"
height="100%"
empty-text=" "
@@ -47,7 +48,7 @@
<template #default="scope" :column="item">
<template v-if="item.columnType === tableColumnType.chainRatio" >
<div class="data-total" >
<div class="data-value">
<div class="data-value" :test-id="`data-value-${item.prop}${scope.row.index}`">
<template v-if="showUnit && item.unit">
{{scope.row[item.prop]?((scope.row[item.prop][0]||scope.row[item.prop][0]===0)? unitConvert(scope.row[item.prop][0], item.unit).join(' ') : '-'):'' }}
</template>
@@ -55,16 +56,16 @@
{{scope.row[item.prop]?((scope.row[item.prop][0]||scope.row[item.prop][0]===0)? unitConvert(scope.row[item.prop][0], unitTypes.number).join(' ') : '-'):'' }}
</template>
</div>
<div class="data-trend">
<div class="data-trend" :test-id="`data-trend-all-${item.prop}${scope.row.index}`">
<template v-if="scope.row[item.prop]">
<div v-if="scope.row[item.prop][1] === 'up'" class="data-total-trend data-total-trend-red">
<i class="cn-icon-rise1 cn-icon"></i><span>{{scope.row[item.prop][2]}}</span>
<div v-if="scope.row[item.prop][1] === 'up'" class="data-total-trend data-total-trend-red" :test-id="`data-trend-${item.prop}${scope.row.index}`">
<i class="cn-icon-rise1 cn-icon" :test-id="`data-trend-icon-${item.prop}${scope.row.index}`"></i><span :test-id="`data-trend-value-${item.prop}${scope.row.index}`">{{scope.row[item.prop][2]}}</span>
</div>
<div v-else-if="scope.row[item.prop][1] === 'down'" class="data-total-trend data-total-trend-green">
<i class="cn-icon-decline cn-icon"></i><span>{{scope.row[item.prop][2]}}</span>
<div v-else-if="scope.row[item.prop][1] === 'down'" class="data-total-trend data-total-trend-green" :test-id="`data-trend-${item.prop}${scope.row.index}`">
<i class="cn-icon-decline cn-icon" :test-id="`data-trend-icon-${item.prop}${scope.row.index}`"></i><span :test-id="`data-trend-value-${item.prop}${scope.row.index}`">{{scope.row[item.prop][2]}}</span>
</div>
<div v-else-if="scope.row[item.prop][1] === 'noChange'" class="data-total-trend data-total-trend-black">
<i class="cn-icon-constant cn-icon"></i>
<div v-else-if="scope.row[item.prop][1] === 'noChange'" class="data-total-trend data-total-trend-black" :test-id="`data-trend-${item.prop}${scope.row.index}`">
<i class="cn-icon-constant cn-icon" :test-id="`data-trend-icon-${item.prop}${scope.row.index}`"></i>
</div>
</template>
<template v-else>
@@ -74,7 +75,7 @@
</div>
</template>
<template v-else-if="item.columnType === tableColumnType.dillDown" >
<div v-if="isOnlyRead" >
<div v-if="isOnlyRead" :test-id="`dnsMapType-${scope.row.index}`">
<template v-if="tableType === fromRoute.dnsServiceInsights && isDnsMapType">
{{dnsMapData.get(scope.row['tab'])}}
</template>
@@ -82,7 +83,7 @@
{{scope.row['tab']}}
</template>
</div>
<div v-else class="data-click" @click="handleTabValue(item.name,scope.row['tab'])">
<div v-else class="data-click" :test-id="`dnsMapType-${scope.row.index}`" @click="handleTabValue(item.name,scope.row['tab'])">
<template v-if="tableType === fromRoute.dnsServiceInsights && isDnsMapType">
{{dnsMapData.get(scope.row['tab'])}}
</template>
@@ -94,10 +95,10 @@
<template v-else-if="item.columnType === tableColumnType.percent" >
<div class="dns-in-ex">
<div class="dns-percent-pic">
<div v-if="scope.row[item.prop][0] !== false" class="div-green" id="green" :style="`width:${scope.row[item.prop][0]}`"></div>
<div v-if="scope.row[item.prop][0] !== false" class="div-yellow" id="yellow" :style="`width:${scope.row[item.prop][1]}`"></div>
<div v-if="scope.row[item.prop][0] !== false" class="div-green" id="green" :test-id="`percent-green-${scope.row.index}`" :style="`width:${scope.row[item.prop][0]}`"></div>
<div v-if="scope.row[item.prop][0] !== false" class="div-yellow" id="yellow" :test-id="`percent-yellow-${scope.row.index}`" :style="`width:${scope.row[item.prop][1]}`"></div>
</div>
<div class="dns-percent">{{scope.row[item.prop][2]}}</div>
<div class="dns-percent" :test-id="`percent-value-${scope.row.index}`">{{scope.row[item.prop][2]}}</div>
</div>
</template>
<template v-else-if="item.prop === 'score'" >
@@ -105,10 +106,10 @@
<div v-if="scope.row.score <= 2" class="data-score data-score-red" >
{{scope.row[item.prop] ? unitConvert(scope.row[item.prop], unitTypes.number).join(' ') : '0'}}
</div>
<div v-else-if="scope.row.score <= 4" class="data-score data-score-yellow" >
<div v-else-if="scope.row.score <= 4" class="data-score data-score-yellow" :test-id="`score-${scope.row.index}`">
{{scope.row[item.prop] ? unitConvert(scope.row[item.prop], unitTypes.number).join(' ') : '0'}}
</div>
<div v-else-if="scope.row.score <= 6" class="data-score data-score-green" >
<div v-else-if="scope.row.score <= 6" class="data-score data-score-green" :test-id="`score-${scope.row.index}`">
{{scope.row[item.prop] ? unitConvert(scope.row[item.prop], unitTypes.number).join(' ') : '0'}}
</div>
</div>
@@ -326,6 +327,10 @@ export default {
},
mixins: [chartMixin],
methods: {
rowClassName ({ row, rowIndex }) {
// 把每一行的索引放进row
row.index = rowIndex
},
/* 参数 extraParams 额外请求参数 */
getChartData (extraParams = {}) {
this.initState()
@@ -1053,7 +1058,6 @@ export default {
type: tabList[0].prop
}
this.changeUrlTabState()
// const condition = this.$store.getters.getQueryCondition
const condition = this.getQueryCondition()
if (condition) {
queryParams = {
@@ -1539,13 +1543,13 @@ export default {
const commonTab = this.commonTabList.find(item => item.name === tabName)
tab.label = commonTab ? commonTab.i18n : ''
tab.prop = commonTab ? commonTab.prop : ''
if (!tab.hasOwnProperty('checked') || tab.checked === undefined || tab.checked === null) {
if (!Object.prototype.hasOwnProperty.call(tab, 'checked') || tab.checked === undefined || tab.checked === null) {
tab.checked = tab ? tab.show : true
}
if (!tab.hasOwnProperty('disabled') || tab.disabled === undefined || tab.disabled === null) {
if (!Object.prototype.hasOwnProperty.call(tab, 'disabled') || tab.disabled === undefined || tab.disabled === null) {
tab.disabled = tab ? !tab.enable : false
}
if (!tab.hasOwnProperty('panelId') || tab.panelId === undefined || tab.panelId === null) {
if (!Object.prototype.hasOwnProperty.call(tab, 'panelId') || tab.panelId === undefined || tab.panelId === null) {
tab.panelId = tab ? tab.panelIdOfFourthMenu : null
}
// 代码里写死的
@@ -1562,7 +1566,7 @@ export default {
const drilldownTabFull = []
const drilldownTabList = tab.drilldownTabs
drilldownTabList.forEach(drilldownTab => {
if (!drilldownTab.hasOwnProperty('name') || drilldownTab.name === undefined || drilldownTab.name === null) {
if (!Object.prototype.hasOwnProperty.call(drilldownTab, 'name') || drilldownTab.name === undefined || drilldownTab.name === null) {
const drilldownTabName = drilldownTab ? (drilldownTab.name ? drilldownTab.name : drilldownTab) : ''
const fullTab = oldList.find(item => item.name === drilldownTabName)
const drilldownTabWithAllInfo = this.$_.cloneDeep(fullTab)
@@ -1660,7 +1664,7 @@ export default {
let isSetDrilldownTabInfo = false
if (tabList && tabList.length > 0) {
const drilldownTab = tabList[0].drilldownTabs
if (drilldownTab && drilldownTab.length > 0 && drilldownTab.hasOwnProperty('name')) {
if (drilldownTab && drilldownTab.length > 0 && Object.prototype.hasOwnProperty.call(drilldownTab, 'name')) {
isSetDrilldownTabInfo = true
}
}
@@ -1743,7 +1747,7 @@ export default {
const tabItem = this.curTable.tabs.find(tabItem => tabItem.name === tab.name)
tab.hiddenDrilldownTabs = this.getHiddenDrilldownTabNameGroup(tabItem)
if (tab && tab.hasMetricSearch === true) {
const columnsForMetric = tab.metrics.find(metric => metric.name === this.metric)
// const columnsForMetric = tab.metrics.find(metric => metric.name === this.metric)
tab.metrics.forEach(metric => {
const oldSortColumns = metric.columns
const newSortColumns = this.customTableTitles.slice(1)

View File

@@ -82,7 +82,7 @@
</div>
</template>
<template v-else-if="item.prop === 'inbound'">
<div class="data-total-value">{{unitConvert(scope.row.inboundPacketsRate, unitTypes.bps).join(' ')}}</div>
<div class="data-total-value" :test-id="`inbound-packet-${scope.row.appSubcategory}`">{{unitConvert(scope.row.inboundPacketsRate, unitTypes.bps).join(' ')}}</div>
<div class="data-trend">
<div v-if="scope.row.inboundBytesRateChainRatio > 0" class="data-total-trend data-total-trend-red">
<i class="cn-icon-rise1 cn-icon"></i>&nbsp;

View File

@@ -54,7 +54,7 @@
</template>
<template v-slot:empty>
<div class="table-no-data" v-show="isNoData">
<div class="table-no-data__title">{{ $t('npm.noData') }}</div>
<div class="table-no-data__title" test-id="noData">{{ $t('npm.noData') }}</div>
</div>
</template>
</el-table>

View File

@@ -5,7 +5,7 @@
<chart-error tooltip v-if="showError" :content="errorMsg"></chart-error>
</div>
<div class="npm-event-pie">
<chart-no-data v-if="isNoData"></chart-no-data>
<chart-no-data v-if="isNoData" test-id="noData"></chart-no-data>
<div class="npm-event-pies" v-show="!isNoData">
<div class="chart-drawing" id="chart"></div>
<div class="npm-event-pie-legends">
@@ -65,7 +65,7 @@ export default {
},
watch: {
timeFilter: {
handler (n) {
handler () {
this.eventsByTypeData()
}
}
@@ -91,11 +91,11 @@ export default {
return num
}
}
this.myChart.on('mouseover', function (params) {
this.myChart.on('mouseover', function () {
_this.chartOption.series[0].label.show = false
_this.myChart.setOption(_this.chartOption)
})
this.myChart.on('mouseout', function (params) {
this.myChart.on('mouseout', function () {
_this.chartOption.series[0].label.show = true
_this.myChart.setOption(_this.chartOption)
})
@@ -118,7 +118,9 @@ export default {
const hit = arrData.find(e => e.name === t.eventType)
if (hit) {
arrData.forEach(d => {
if (hit.name === d.name) {
d.value++
}
})
} else {
arrData.push({ name: t.eventType, value: 1 })

View File

@@ -17,6 +17,7 @@ import { api } from '@/utils/api'
import chartMixin from '@/views/charts2/chart-mixin'
import ChartError from '@/components/common/Error'
import axios from 'axios'
export default {
name: 'NpmEventsHeader',
components: { ChartError },

View File

@@ -29,7 +29,7 @@
<template v-else-if="item.prop === 'eventType'">
<span class="data-recent-table-eventType" :test-id="`eventType-${scope.row.eventType}-${scope.$index}`">{{scope.row[item.prop]}}</span>
</template>
<span v-else-if="scope.row[item.prop]" :test-id="`startTime-${scope.row.startTime}-${scope.$index}`">{{scope.row[item.prop]}}</span>
<span v-else-if="scope.row[item.prop]" :test-id="`startTime-${scope.$index}`">{{scope.row[item.prop]}}</span>
<span v-else>-</span>
</div>
</template>
@@ -40,7 +40,7 @@
<svg class="icon" aria-hidden="true">
<use xlink:href="#cn-icon-good"></use>
</svg>
<div class="table-no-data__title">{{ $t('npm.thereNoEvents') }}</div>
<div class="table-no-data__title" test-id="noData">{{ $t('npm.thereNoEvents') }}</div>
</div>
</template>
</el-table>
@@ -126,11 +126,12 @@ export default {
})
this.tableData = res.data.result
} else {
// this.isNoData = true
this.isNoData = false
this.showError = true
this.errorMsg = res.message
}
}).catch(error => {
this.isNoData = false
this.showError = true
this.errorMsg = error.message
}).finally(() => {

View File

@@ -42,7 +42,7 @@ import ChartNoData from '@/views/charts/charts/ChartNoData'
import _ from 'lodash'
import chartMixin from '@/views/charts2/chart-mixin'
import { useRoute } from 'vue-router'
import { getLineType, getLineIndexUnit, overwriteUrl, urlParamsHandler } from '@/utils/tools'
import { getLineType, getLineIndexUnit, getLineIndexUnit2, overwriteUrl, urlParamsHandler } from '@/utils/tools'
import ChartError from '@/components/common/Error'
export default {
@@ -215,6 +215,7 @@ export default {
{ name: this.$t('overall.packetRetrans'), show: true, positioning: 0, data: [], unitType: unitTypes.percent, index: 4 }
]
} else {
console.info(res.data.result)
this.initData(res.data.result, val)
}
} else {
@@ -226,6 +227,7 @@ export default {
this.isNoData = false
this.showError = true
this.errorMsg = e.message
console.error(e)
}).finally(() => {
this.toggleLoading(false)
})
@@ -265,6 +267,7 @@ export default {
{ name: this.$t('overall.packetRetrans'), show: true, positioning: 0, data: [], unitType: unitTypes.percent, index: 4 }
]
} else {
console.info(npmLineData)
this.initData(npmLineData, val)
}
}).catch(e => {
@@ -282,7 +285,7 @@ export default {
if (echartsData.length > 0) {
const dom = document.getElementById('chart-line')
!this.myChart && (this.myChart = echarts.init(dom))
this.chartOption = trafficLineChartOption
this.chartOption = _.cloneDeep(trafficLineChartOption)
const chartOption = this.chartOption.series[0]
this.chartOption.series = echartsData.map((t) => {
this.chartOption.yAxis[0].axisLabel.formatter = (value) => {
@@ -301,7 +304,7 @@ export default {
color: chartColor3[t.positioning],
width: 1
},
stack: t.name !== 'network.total' ? 'network.total' : '',
stack: t.name !== this.$t('network.total') ? this.$t('network.total') : '',
areaStyle: {
opacity: 0.1,
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
@@ -393,18 +396,32 @@ export default {
if (data !== undefined && data.length > 0) {
data.forEach(item => {
item.type = getLineType(item.type)
if (['Bits/s', 'Packets/s', 'Sessions/s'].indexOf(val) > -1) {
if (item.type === val) {
lineData = Object.keys((item)).map(t => {
return {
...item[t],
index: getLineIndexUnit2(t, false),
key: t
}
})
}
} else {
if (item.type === val) {
lineData = Object.keys((item)).map(t => {
return {
...item[t],
index: getLineIndexUnit(item.type, false),
unit: getLineIndexUnit(item.type, true)
unit: getLineIndexUnit(item.type, true),
key: t
}
})
}
}
})
}
lineData.splice(0, 1)
console.info(lineData)
const tabs = _.cloneDeep(this.tabs)
const npmQuantity = _.cloneDeep(this.npmQuantity)
if (val === 'Sessions/s') {
@@ -419,7 +436,7 @@ export default {
})
this.tabs = tabs
this.echartsInit(this.tabs)
} else if (val !== 'Bits/s' && val !== 'Packets/s' && val !== 'Sessions/s') {
} else if (val !== 'Bits/s' && val !== 'Packets/s') {
this.legendInit(lineData, npmQuantity, true)
} else {
this.legendInit(lineData, tabs, false)
@@ -431,8 +448,8 @@ export default {
npmData[d.index].data = d.values
npmData[d.index].analysis = d.analysis
} else {
npmData[i].data = d.values
npmData[i].analysis = d.analysis
npmData[d.index].data = d.values
npmData[d.index].analysis = d.analysis
}
})
if (show) {

View File

@@ -842,7 +842,7 @@ export default {
setup () {
const { params } = useRoute()
const pageType = params.typeName
const dateRangeValue = 60 * 24
const dateRangeValue = 60
const { startTime, endTime } = getNowTime(dateRangeValue)
const timeFilter = ref({ startTime, endTime, dateRangeValue })

View File

@@ -717,7 +717,7 @@ export default {
}
},
setup () {
const dateRangeValue = 60 * 24
const dateRangeValue = 60
const { startTime, endTime } = getNowTime(dateRangeValue)
const timeFilter = ref({ startTime, endTime, dateRangeValue })
return {

View File

@@ -1,18 +1,18 @@
<template>
<div class="cn-builtin">
<div class="cn-builtin-left">
<div class="cn-report">
<div class="cn-report-left">
<loading :loading="builtinLeftLoading"></loading>
<div class="cn-builtin-left-title">
<div class="cn-report-left-title">
{{$t('report.category')}}
</div>
<div class="cn-builtin-left-menu" :class="{'cn-active': !builtinId}" @click="builtinTabs(null)">
<div class="cn-report-left-menu" :class="{'cn-active': !builtinId}" @click="builtinTabs(null)">
{{$t('dns.all')}}
</div>
<div class="cn-builtin-left-menu" :class="{'cn-active': builtinId === item.id}" v-for="item in builtinReportLeftMenu" :key="item.id" @click="builtinTabs(item.id)">
<div class="cn-report-left-menu" :class="{'cn-active': builtinId === item.id}" v-for="item in builtinReportLeftMenu" :key="item.id" @click="builtinTabs(item.id)">
{{item.name}}
</div>
</div>
<div class="cn-builtin-right">
<div class="cn-report-right">
<cn-data-list
ref="dataList"
:tableId="tableId"
@@ -22,19 +22,26 @@
:layout="['search']"
@search="search"
>
<template #top-tool-right>
<button
id="account-add"
class="top-tool-btn"
type="button"
@click="add"
>
<i class="cn-icon-add cn-icon"/>
<template #top-tool-left>
<button id="account-add" class="top-tool-btn margin-r-10 top-tool-btn--create"
@click="add">
<i class="cn-icon-xinjian cn-icon"></i>
<span>{{$t('overall.create')}}</span>
</button>
<button id="report-edit" class="top-tool-btn margin-r-10" :disabled="disableEdit"
@click="editReport">
<i class="cn-icon-edit cn-icon"></i>
<span>{{$t('overall.edit')}}</span>
</button>
<button id="report-delete" class="top-tool-btn margin-r-10"
@click="delBatch">
<i class="cn-icon-delete cn-icon"></i>
<span>{{$t('overall.delete')}}</span>
</button>
</template>
<template #default>
<loading :loading="builtinRightLoading"></loading>
<builtin-report-table
<report-table
ref="dataTable"
:api="url"
:custom-table-title="tools.customTableTitle"
@@ -73,7 +80,7 @@
<script>
import { get } from '@/utils/http'
import builtinReportTable from '@/components/table/report/reportTestTable'
import ReportTable from '@/components/table/report/ReportTable'
import cnDataList from '@/components/table/CnDataList'
import dataListMixin from '@/mixins/data-list'
import { api } from '@/utils/api'
@@ -148,7 +155,7 @@ export default {
'report.november',
'report.december'
],
tableId: 'builtinReportTable',
tableId: 'reportTable',
builtinLeftLoading: false,
builtinRightLoading: false,
getNum: -1
@@ -171,7 +178,7 @@ export default {
components: {
Loading,
cnDataList,
builtinReportTable,
ReportTable,
ReportBox
},
mounted () {
@@ -210,7 +217,7 @@ export default {
methods: {
queryGetTempData () {
this.builtinLeftLoading = true
get(api.reportCategory).then(res => {
get(api.reportCategory, { pageSize: 999 }).then(res => {
if (res.code === 200) {
this.builtinReportLeftMenu = res.data.list.map(c => {
return {
@@ -287,6 +294,19 @@ export default {
this.object = u
this.rightBox.show = true
},
editReport () {
if(this.batchDeleteObjs.length === 0){
this.$alert(this.$t('tip.pleaseSelectForEdit'),{
confirmButtonText: this.$t('tip.yes'),
type:'warning'
})
}else {
let curRecord = this.batchDeleteObjs[0]
this.initConfig(curRecord)
this.object = curRecord
this.rightBox.show = true
}
},
initConfig (u) {
if (!u.config) {
u.config = {

View File

@@ -0,0 +1,41 @@
<template>
<div class="administration entity-explorer entity-explorer--show-list">
<!-- 顶部工具栏在列表页显示 -->
<div class="explorer-top-tools explorer-detection-top-tools">
<div class="explorer-top-tools-title">{{$t('overall.knowledgeBase')}}</div>
</div>
<div style="width: 100%;padding-bottom: 26px;">
<chart-tabs :data="tabsData" router></chart-tabs>
</div>
<!-- 内容区 -->
<div class="explorer-container administration-container">
<router-view />
</div>
</div>
</template>
<script>
import ChartTabs from '@/components/common/ChartTabs'
import { useStore } from 'vuex'
export default {
name: 'Index',
components: {
ChartTabs
},
setup () {
const store = useStore()
const menu = store.getters.menuList.find(m => m.code === 'setting')
const tabsData = menu.children.map(l => ({
...l,
path: l.route
})).sort((a, b) => a.sort - b.sort)
return {
tabsData
}
}
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,128 @@
<template>
<div style="height: 100%;" class="knowledge-base">
<div class="top-title">
{{$t('overall.knowledgeBase')}}
</div>
<cn-data-list
ref="dataList"
:tableId="tableId"
v-model:custom-table-title="tools.customTableTitle"
:api="url"
from="knowledge-base"
:layout="['columnCustomize','elementSet','search']"
@search="search"
>
<template v-slot:top-tool-left>
<button id="knowledge-base-add" :title="$t('knowledgeBase.createKnowledgeBase')" class="top-tool-btn margin-r-10 top-tool-btn--create"
@click="jumpToCreatePage">
<i class="cn-icon-xinjian cn-icon"></i>
<span>{{$t('overall.create')}}</span>
</button>
<!--
<button id="knowledge-base-edit" :title="$t('knowledgeBase.editKnowledgeBase')" class="top-tool-btn margin-r-10" :disabled="disableEdit"
@click="edit">
<i class="cn-icon-edit cn-icon" ></i>
<span>{{$t('overall.edit')}}</span>
</button>
-->
<button id="knowledge-base-delete" :title="$t('knowledgeBase.deleteKnowledgeBase')" class="top-tool-btn margin-r-10"
@click="delBatch">
<i class="cn-icon-delete cn-icon"></i>
<span>{{$t('overall.delete')}}</span>
</button>
</template>
<template v-slot:default>
<knowledge-base-table
ref="dataTable"
v-loading="tools.loading"
:api="url"
:custom-table-title="tools.customTableTitle"
:height="mainTableHeight"
:table-data="tableData"
@delete="del"
@edit="edit"
@orderBy="tableDataSort"
@reload="getTableData"
@selectionChange="selectionChange"
></knowledge-base-table>
</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 cnDataList from '@/components/table/CnDataList'
import dataListMixin from '@/mixins/data-list'
import KnowledgeBaseTable from '@/components/table/setting/KnowledgeBaseTable'
import { api } from '@/utils/api'
import axios from 'axios'
export default {
name: 'knowledgeBase',
components: {
cnDataList,
KnowledgeBaseTable
},
mixins: [dataListMixin],
data () {
return {
url: api.knowledgeBase,
tableId: 'knowledgeBaseTable' // 需要分页的table的id用于记录每页数量
}
},
methods: {
edit (u) {
axios.get(`${this.url}`, { params: { ids: u.id } }).then(response => {
if (response.data.code === 200) {
this.object = response.data.data.list[0]
}
}).catch(e => {
console.error(e)
if (e.response.data && e.response.data.message) {
this.$message.error(e.response.data.message)
} else {
this.$message.error('Something went wrong...')
}
})
},
del (row) {
this.$confirm(this.$t('tip.confirmDelete'), {
confirmButtonText: this.$t('tip.yes'),
cancelButtonText: this.$t('tip.no'),
type: 'warning'
}).then(() => {
this.tools.loading = true
axios.delete(this.url + '?ids=' + row.id).then(response => {
if (response.data.code === 200) {
this.delFlag = true
this.$message({ duration: 2000, type: 'success', message: this.$t('tip.deleteSuccess') })
this.getTableData()
} else {
this.$message.error(response.data.message)
}
}).catch(e => {
console.error(e)
if (e.response.data && e.response.data.message) {
this.$message.error(e.response.data.message)
} else {
this.$message.error('Something went wrong...')
}
}).finally(() => {
this.tools.loading = false
})
})
},
jumpToCreatePage () {
this.$router.push({
path: '/knowledgeBase/form',
query: {
t: +new Date()
}
})
}
}
}
</script>

View File

@@ -0,0 +1,510 @@
<template>
<div class="edit-knowledge-base">
<div class="edit-knowledge-base__header">{{$t('overall.create')}}</div>
<div class="edit-knowledge-base__body">
<el-steps direction="vertical" :active="activeStep">
<el-step v-for="(height, index) in stepHeights" :style="`flex-basis: ${height}px; flex-shrink: 0;`" :key="index"></el-step>
</el-steps>
<el-collapse v-model="activeCollapses">
<el-collapse-item name="0">
<template #title><div class="form-sub-title">{{$t('knowledgeBase.editInformation')}}</div></template>
<el-form :model="editObject" label-position="top" ref="form" :rules="rules">
<!--name-->
<el-form-item :label="$t('config.roles.name')" prop="tagName">
<el-input class="form-input" maxlength="64" placeholder="" :disabled="!!editObject.id" show-word-limit size="mini" type="text" v-model="editObject.tagName" @blur="tagNameBlur"></el-input>
</el-form-item>
<el-form-item :label="$t('overall.type')" prop="tagType">
<el-select v-model="editObject.tagType"
class="form-select"
placeholder=" "
popper-class="form-select-popper"
:disabled="!!editObject.id || typeSelectDisable"
size="mini"
>
<template v-for="type in knowledgeBaseType" :key="type.name">
<el-option :label="type.name" :value="type.value"></el-option>
</template>
</el-select>
</el-form-item>
<el-form-item :label="$t('overall.remark')" prop="remark">
<el-input maxlength="255" show-word-limit :rows="4" size='mini' type="textarea" v-model="editObject.remark" id="role-box-input-remark"/>
</el-form-item>
</el-form>
</el-collapse-item>
<el-collapse-item name="1" class="upload-collapse">
<template #title><div class="form-sub-title">{{$t('overall.importFromFile')}}</div></template>
<loading :loading="uploadLoading"></loading>
<el-upload :action="`${baseUrl}knowledge/import`"
:headers="uploadHeaders"
:data="uploadParams"
:multiple="false"
:file-list="fileList"
:on-change="fileChange"
:on-success="uploadSuccess"
:on-remove="onRemove"
:before-upload="beforeUpload"
:on-progress="onUpload"
:on-error="uploadError"
:class="uploadErrorTip ? 'el-upload--error' : ''"
drag
:accept="fileTypeLimit"
ref="upload"
>
<i class="el-icon-upload"></i>
<div class="el-upload__text">
<div>{{$t('knowledgeBase.dropFileHereOr')}}<em>{{$t('knowledgeBase.clickToUpload')}}</em></div>
<div class="upload-tip">{{$t('knowledgeBase.supportCsv')}}</div>
</div>
</el-upload>
<transition name="el-zoom-in-top">
<div class="upload-error-tip" v-if="uploadErrorTip">{{uploadErrorTip}}</div>
</transition>
</el-collapse-item>
<el-collapse-item name="2">
<template #title><div class="form-sub-title">{{$t('overall.preview')}}</div></template>
<div class="skeleton-border" v-if="!uploaded">
<el-skeleton>
<template #template>
<div v-for="item of 6" :key="item" class="skeleton-item-row">
<el-skeleton-item variant="text" style="width: calc(33% - 25px); margin-right: 38px;"/>
<el-skeleton-item variant="text" style="width: calc(33% - 25px); margin-right: 38px;"/>
<el-skeleton-item variant="text" style="width: calc(33% - 26px);"/>
</div>
</template>
</el-skeleton>
<div class="skeleton-tip">{{$t('knowledgeBase.skeletonTip')}}</div>
</div>
<div v-else>
<div class="imported-tip"><i class="cn-icon cn-icon-baocuo"/>
&nbsp;&nbsp;{{$t('knowledgeBase.importTip', { total: originalImportInfo.total, succeeded: originalImportInfo.succeeded, failed: originalImportInfo.failed })}}
</div>
<div class="imported-table-box" :class="previewErrorTip ? 'imported-table-box--error' : ''">
<table class="imported-table" v-if="!importedDataNoData">
<tr>
<th width="230">{{importedTableFirstColumn}}</th>
<th width="180">Label</th>
<th>{{$t('overall.import')}}</th>
<th width="16"></th>
</tr>
<tr v-for="(d, i) in showImportedData" :key="importedType + d.tagItem + d.tagValue + i">
<td class="imported-data-item" :title="d.tagItem">{{d.tagItem}}</td>
<td class="imported-data-value" :title="d.tagValue">{{d.tagValue}}</td>
<td class="imported-data-msg" :title="d.msg"><i :class="d.status === 1 ? 'el-icon-success' : 'el-icon-error'"></i>&nbsp;&nbsp;{{d.msg}}</td>
<td><i class="el-icon-close" @click="removeImportedData(i)"></i></td>
</tr>
</table>
<chart-no-data v-else></chart-no-data>
<Pagination
class="imported-pagination"
:page-obj="importedPageObj"
:store-page-no-on-url="false"
layout="prev,pager,next"
@pageNo='pageNo'
@prev-click="prev"
@next-click="next"
></Pagination>
</div>
<transition name="el-zoom-in-top">
<div class="preview-error-tip" v-if="previewErrorTip">{{previewErrorTip}}</div>
</transition>
</div>
</el-collapse-item>
</el-collapse>
</div>
<div class="edit-knowledge-base__footer">
<button class="footer__btn footer__btn--light" @click="cancel">
<span>{{$t('overall.cancel')}}</span>
</button>
<button style="position: relative;" :class="{'footer__btn--disabled': blockOperation.save}" :disabled="blockOperation.save" class="footer__btn" @click="save">
<loading size="small" :loading="blockOperation.save"></loading>
<span>{{$t('overall.save')}}</span>
</button>
</div>
</div>
</template>
<script>
import { useRoute } from 'vue-router'
import { ref } from 'vue'
import _ from 'lodash'
import { knowledgeBaseType, storageKey, unitTypes } from '@/utils/constants'
import Pagination from '@/components/common/Pagination'
import ChartNoData from '@/views/charts/charts/ChartNoData'
import axios from 'axios'
import { api } from '@/utils/api'
import unitConvert from '@/utils/unit-convert'
import Loading from '@/components/common/Loading'
export default {
name: 'CreateKnowledgeBase',
components: {
Pagination,
ChartNoData,
Loading
},
data () {
const nameValidator = (rule, value, callback) => {
let validate = true
// /^[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEFA-Za-z0-9\-\_]*$/
const reg = /^[\u4e00-\u9fa5A-Za-z0-9\-\_]*$/
validate = reg.test(value)
return validate
}
const nameAndTypeValidator = async (rule, value, callback) => {
this.$refs.form.clearValidate('tagType')
let validate = true
const response = await this.getKnowledgeBaseList()
if (response.data.code === 200) {
const find = response.data.data.list.find(d => d.tagName === value && d.tagType === this.editObject.tagType)
if (find) {
validate = false
callback(new Error())
}
}
return validate
}
const typeAndNameValidator = async (rule, value, callback) => {
this.$refs.form.clearValidate('tagName')
let validate = true
const response = await this.getKnowledgeBaseList()
if (response.data.code === 200) {
const find = response.data.data.list.find(d => d.tagName === this.editObject.tagName && d.tagType === value)
if (find) {
validate = false
callback(new Error())
}
}
return validate
}
return {
rules: {
tagName: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' },
{ validator: nameValidator, message: this.$t('validate.onlyAllowNumberLetterChinese-_'), trigger: 'blur' },
{ validator: nameAndTypeValidator, message: this.$t('validate.duplicateRecord', { columns: '(' + this.$t('config.roles.name') + '+' + this.$t('overall.type') + ')' }), trigger: 'blur' }
],
tagType: [
{ required: true, message: this.$t('validate.required'), trigger: 'change' },
{ validator: typeAndNameValidator, message: this.$t('validate.duplicateRecord', { columns: '(' + this.$t('config.roles.name') + '+' + this.$t('overall.type') + ')' }), trigger: 'change' }
],
remark: [
{ validator: nameValidator, message: this.$t('validate.onlyAllowNumberLetterChinese-_'), trigger: 'blur' }
]
}
}
},
methods: {
tagNameBlur () {
if (!this.tagNameFirstBlur) {
this.$refs.form.validate(valid => {
if (valid) {
this.tagNameFirstBlur = true
}
})
}
},
fileChange (files, fileList) {
this.fileList = fileList.slice(-1)
},
uploadError () {
this.uploadLoading = false
this.$message.error(this.$t('tip.uploadFailed', { msg: 'error' }))
},
uploadSuccess (response) {
this.uploaded = response.code === 200
if (response.code === 200) {
// 上传成功后去掉upload和preview的错误提示
this.uploadErrorTip = ''
this.previewErrorTip = ''
this.importedType = this.editObject.tagType
const originalImportedData = _.cloneDeep(response.data.data)
this.importedDataNoData = originalImportedData.length === 0
this.originalImportInfo = {
total: originalImportedData.length,
succeeded: originalImportedData.filter(d => d.status === 1).length,
failed: originalImportedData.filter(d => d.status !== 1).length
}
originalImportedData.sort((a, b) => b.status - a.status)
this.importedData = originalImportedData
this.handleShowImportedData()
} else {
this.uploadLoading = false
this.$message.error(this.$t('tip.uploadFailed', { msg: response.message }))
}
},
onRemove (files, fileList) {
this.uploaded = false
this.typeSelectDisable = false
this.importedData = []
this.showImportedData = []
this.originalImportInfo = {
total: null,
succeeded: null,
failed: null
}
},
beforeUpload (file) {
// 判断后缀,仅支持.csv
if (!_.endsWith(file.name, '.csv')) {
this.$message.error(this.$t('validate.fileTypeLimit', { types: this.fileTypeLimit }))
this.fileList = []
return false
}
// 判断文件大小
if (file.size > this.uploadFileSizeLimit) {
this.$message.error(this.$t('validate.fileSizeLimit', { size: unitConvert(this.uploadFileSizeLimit, unitTypes.byte).join('') }))
this.fileList = []
return false
}
return true
},
onUpload (event, file) {
this.uploadLoading = true
this.typeSelectDisable = true
},
handleShowImportedData () {
const startIndex = (this.importedPageObj.pageNo - 1) * this.importedPageObj.pageSize
const endIndex = this.importedPageObj.pageNo * this.importedPageObj.pageSize
this.showImportedData = this.importedData.slice(startIndex, endIndex)
this.$nextTick(() => {
this.uploadLoading = false
})
},
pageNo (val) {
this.importedPageObj.pageNo = val
},
prev () {
this.importedPageObj.pageNo--
},
next () {
this.importedPageObj.pageNo++
},
removeImportedData (index) {
const toRemoveIndex = (this.importedPageObj.pageNo - 1) * this.importedPageObj.pageSize + index
this.importedData.splice(toRemoveIndex, 1)
this.importedPageObj.total--
this.handleShowImportedData()
// 若删除后本页无数据则页码减1或者提示无数据
if (this.showImportedData.length === 0) {
if (this.importedData.length > 0) {
this.importedPageObj.pageNo--
this.handleShowImportedData()
} else {
this.importedDataNoData = true
}
}
// 删除后若有错误提示且列表中不再有错误项,则清空错误提示
if (!this.hasErrorImportedData() && this.previewErrorTip) {
this.previewErrorTip = ''
}
},
cancel () {
this.$router.push({
path: '/knowledgeBase',
t: +new Date()
})
},
save () {
if (this.blockOperation.save) { return }
this.blockOperation.save = true
// 校验form + upload + preview
this.$refs.form.validate(valid => {
this.$refs.form.validateField('tagName')
if (!this.uploaded) {
this.uploadErrorTip = this.$t('validate.required')
} else {
this.uploadErrorTip = ''
}
if (this.importedData.length === 0) {
this.previewErrorTip = this.$t('validate.required')
} else if (this.hasErrorImportedData()) {
this.previewErrorTip = this.$t('validate.pleaseCheckForErrorItem')
} else {
this.previewErrorTip = ''
}
if (valid) {
// 校验通过后组织数据、请求接口
if (valid && !this.uploadErrorTip && !this.previewErrorTip) {
const postData = {
tagName: this.editObject.tagName,
tagType: this.editObject.tagType,
data: []
}
this.importedData.forEach(d => {
const findData = postData.data.find(d2 => d2.tagValue === d.tagValue)
if (findData) {
findData.itemList.add(d.tagItem)
} else {
const set = new Set()
set.add(d.tagItem)
postData.data.push({
tagValue: d.tagValue,
itemList: set
})
}
})
postData.data.forEach(d => {
d.itemList = [...d.itemList]
})
postData.remark = this.editObject.remark
axios.post(this.url, postData).then(response => {
if (response.data.code === 200) {
this.$message({ duration: 2000, type: 'success', message: this.$t('tip.saveSuccess') })
this.$router.push({
path: '/knowledgeBase',
t: +new Date()
})
} else {
this.$message.error(response.data.message)
}
}).catch(e => {
console.error(e)
if (e.response.data && e.response.data.message) {
this.$message.error(e.response.data.message)
} else {
this.$message.error('Something went wrong...')
}
}).finally(() => {
this.blockOperation.save = false
})
} else {
this.blockOperation.save = false
}
} else {
this.blockOperation.save = false
}
})
},
hasErrorImportedData () {
return this.importedData.filter(d => d.status !== 1).length > 0
},
async getKnowledgeBaseList () {
return await axios.get(this.url, { params: { pageSize: 999 } })
}
},
computed: {
uploadParams () {
return {
type: this.editObject.tagType
}
},
importedTableFirstColumn () {
const t = this.knowledgeBaseType.find(t => t.value === this.importedType)
return t ? t.name : ''
},
activeStep () {
if (this.tagNameFirstBlur) {
return this.uploaded ? 2 : 1
} else {
return 0
}
}
},
watch: {
activeCollapses (n) {
const index0 = n.indexOf('0')
const index1 = n.indexOf('1')
if (index0 > -1) {
if (this.stepHeights[0] === this.stepHeightConstant.collapse) {
this.stepHeights.splice(0, 1, this.stepHeightConstant.first)
}
} else {
if (this.stepHeights[0] === this.stepHeightConstant.first) {
this.stepHeights.splice(0, 1, this.stepHeightConstant.collapse)
}
}
if (index1 > -1) {
if (this.stepHeights[1] === this.stepHeightConstant.collapse) {
this.stepHeights.splice(1, 1, this.stepHeightConstant.second)
}
} else {
if (this.stepHeights[1] === this.stepHeightConstant.second) {
this.stepHeights.splice(1, 1, this.stepHeightConstant.collapse)
}
}
},
importedData (n) {
this.importedPageObj.total = n.length
},
'importedPageObj.pageNo': {
handler (n) {
this.handleShowImportedData()
}
}
},
setup () {
const { query } = useRoute()
const knowledgeBaseId = ref(query.id || '')
const url = api.knowledgeBase
// 空白对象
const blankObject = {
tagName: '',
buildIn: '',
id: '',
tagType: 'ip',
remark: '',
updateTime: ''
}
// form绑定的对象
const editObject = ref(_.cloneDeep(blankObject))
// 折叠组件控制
const activeCollapses = ref(['0', '1', '2'])
// 步骤条控制
const stepHeightConstant = {
collapse: 58,
first: 333,
second: 284
}
const stepHeights = ref([stepHeightConstant.first, stepHeightConstant.second, stepHeightConstant.collapse])
// 所有导入的数据
const importedData = ref([])
// 导入数据的原始数量信息
const originalImportInfo = ref({
total: null,
succeeded: null,
failed: null
})
// table中显示的导入的数据
const showImportedData = ref([])
const importedPageObj = ref({
pageNo: 1,
pageSize: 10,
total: null
})
const importedType = ref('')
// 没上传过文件的提示
const uploadErrorTip = ref('')
// 预览区无内容的提示
const previewErrorTip = ref('')
return {
knowledgeBaseId,
editObject,
tagNameFirstBlur: ref(false),
blankObject,
activeCollapses,
stepHeightConstant,
stepHeights,
knowledgeBaseType,
importedData,
showImportedData,
importedPageObj,
importedType,
baseUrl: BASE_CONFIG.baseUrl,
fileList: ref([]),
uploadHeaders: {
'Cn-Authorization': localStorage.getItem(storageKey.token)
},
uploaded: ref(false),
importedDataNoData: ref(false),
url,
originalImportInfo,
uploadErrorTip,
previewErrorTip,
typeSelectDisable: ref(false),
uploadFileSizeLimit: 100 * 1024 * 1024,
uploadLoading: ref(false),
fileTypeLimit: '.csv'
}
}
}
</script>

View File

@@ -1,82 +0,0 @@
<template>
<div style="height: 100%;">
<cn-data-list
ref="dataList"
:tableId="tableId"
v-model:custom-table-title="tools.customTableTitle"
:api="url"
:from="fromRoute.chart"
:layout="['columnCustomize','elementSet','search']"
@search="search"
>
<template #top-tool-right>
<button
id="account-add"
class="top-tool-btn margin-r-10"
type="button"
@click="add"
>
<i class="cn-icon-add cn-icon"/>
</button>
</template>
<template #default>
<chart-table
ref="dataTable"
v-loading="tools.loading"
:api="url"
:custom-table-title="tools.customTableTitle"
:height="mainTableHeight"
:table-data="tableData"
@delete="del"
@edit="edit"
@orderBy="tableDataSort"
@reload="getTableData"
@selectionChange="selectionChange"
/>
</template>
<template #pagination>
<pagination ref="pagination" :page-obj="pageObj" :table-id="tableId" @pageNo='pageNo' @pageSize='pageSize'></pagination>
</template>
</cn-data-list>
<el-drawer
v-model="rightBox.show"
direction="rtl"
:with-header="false"
destroy-on-close>
<chart-box
:object="object"
@close="closeRightBox"
/>
</el-drawer>
</div>
</template>
<script>
import cnDataList from '@/components/table/CnDataList'
import dataListMixin from '@/mixins/data-list'
import chartTable from '@/components/table/settings/ChartTable'
import chartBox from '@/components/rightBox/settings/ChartBox'
import { api } from '@/utils/api'
export default {
name: 'Chart',
mixins: [dataListMixin],
components: {
cnDataList,
chartTable,
chartBox
},
data () {
return {
url: api.chart,
listUrl: api.chartList,
blankObject: { // 空白对象
id: '',
name: '',
params: '',
i18n: ''
},
tableId: 'chartTable'
}
}
}
</script>

View File

@@ -1,144 +0,0 @@
<template>
<div style="height: 100%;">
<cn-data-list
ref="dataList"
:tableId="tableId"
v-model:custom-table-title="tools.customTableTitle"
:api="url"
:from="fromRoute.galaxyProxy"
:layout="['columnCustomize','elementSet','search']"
@search="search"
>
<template v-slot:top-tool-right>
<button id="galaxy-proxy-clear-cache" class="top-tool-btn margin-r-10" :title="$t('overall.clearCache')"
type="button" @click="clearCache">
<i class="cn-icon cn-icon-clear-cache"></i>
</button>
<button id="galaxy-proxy-add" class="top-tool-btn margin-r-10"
type="button" @click="add">
<i class="cn-icon-add cn-icon"></i>
</button>
<button id="galaxy-proxy-debug" class="top-tool-btn margin-r-10" :title="$t('overall.debug')"
type="button" @click="debug(true,{})">
<i class="cn-icon-category cn-icon"></i>
</button>
<top-tool-more-options
ref="export"
id="model"
:params="searchLabel"
class="top-tool-export margin-l-10 margin-r-10"
export-file-name="galaxyProxy"
export-url="/galaxy/setting/export"
import-url="/galaxy/setting/import"
@afterImport="getTableData"
>
<template v-slot:before>
</template>
</top-tool-more-options>
</template>
<template v-slot:default>
<galaxy-proxy-table
ref="dataTable"
v-loading="tools.loading"
:api="url"
:custom-table-title="tools.customTableTitle"
:height="mainTableHeight"
:table-data="tableData"
@delete="del"
@edit="edit"
@orderBy="tableDataSort"
@reload="getTableData"
@selectionChange="selectionChange"
@copy="copy"
@debug="debugRow"
></galaxy-proxy-table>
</template>
<!-- 分页组件 -->
<template #pagination>
<pagination ref="pagination" :page-obj="pageObj" :table-id="tableId" @pageNo='pageNo' @pageSize='pageSize'></pagination>
</template>
</cn-data-list>
<el-drawer
v-model="rightBox.show"
direction="rtl"
:with-header="false"
destroy-on-close>
<galaxy-proxy-box :object="object" @close="closeRightBox"></galaxy-proxy-box>
</el-drawer>
</div>
<galaxy-proxy-debug
v-model:show-debug="showDebug"
top="5vh"
:show-close="false"
:curGalaxyProxy="curGalaxyProxy"></galaxy-proxy-debug>
</template>
<script>
import cnDataList from '@/components/table/CnDataList'
import galaxyProxyBox from '@/components/rightBox/settings/GalaxyProxyBox'
import galaxyProxyTable from '@/components/table/settings/GalaxyProxyTable'
import dataListMixin from '@/mixins/data-list'
import { api } from '@/utils/api'
import { get, put } from '@/utils/http'
import TopToolMoreOptions from '@/components/common/popBox/TopToolMoreOptions'
import galaxyProxyDebug from '@/components/setting/GalaxyProxyDebug'
export default {
name: 'GalaxyProxy',
components: {
cnDataList,
galaxyProxyBox,
galaxyProxyTable,
TopToolMoreOptions,
galaxyProxyDebug
},
mixins: [dataListMixin],
data () {
return {
url: api.galaxyProxy,
tableId: 'galaxySettingTable', // 需要分页的table的id用于记录每页数量
blankObject: { // 空白对象
name: ''
},
showDebug: false,
curGalaxyProxy: {}
}
},
methods: {
edit (u) {
get(`${this.url}/${u.id}`).then(response => {
if (response.code === 200) {
const editObject = response.data
editObject.targetHeader || (editObject.targetHeader = '')
editObject.preHandle || (editObject.preHandle = '')
editObject.postHandle || (editObject.postHandle = '')
editObject.targetParam || (editObject.targetParam = '')
this.object = editObject
this.rightBox.show = true
}
})
},
debug (isTopDebug, u) {
if (!isTopDebug && u) {
this.curGalaxyProxy = JSON.parse(JSON.stringify(u))
}
this.showDebug = true
},
debugRow (u) {
this.debug(false, u)
},
clearCache () {
put(`${this.url}/clearCache`).then(response => {
if (response.code === 200) {
this.$message({ duration: 2000, type: 'success', message: this.$t('tip.success') })
} else {
this.$message.error(response.msg || response.message)
}
}).catch(() => {
this.$message.error(this.$t('tip.unknownError'))
})
}
}
}
</script>

View File

@@ -1,86 +0,0 @@
<template>
<div style="height: 100%;">
<cn-data-list
ref="dataList"
:tableId="tableId"
v-model:custom-table-title="tools.customTableTitle"
:api="url"
:from="fromRoute.user"
:layout="['columnCustomize','elementSet','search']"
@search="search"
>
<template #top-tool-right>
<button
id="account-add"
v-has="'user_add'"
class="top-tool-btn margin-r-10"
type="button"
@click="add"
>
<i class="cn-icon-add cn-icon"/>
</button>
</template>
<template #default>
<i18n-table
ref="dataTable"
v-loading="tools.loading"
:api="url"
:custom-table-title="tools.customTableTitle"
:height="mainTableHeight"
:table-data="tableData"
@delete="del"
@edit="edit"
@orderBy="tableDataSort"
@reload="getTableData"
@selectionChange="selectionChange"
@showBottomBox="(targetTab, object) => { $refs.dataList.showBottomBox(targetTab, object) }"
/>
</template>
<template #pagination>
<pagination ref="pagination" :page-obj="pageObj" :table-id="tableId" @pageNo='pageNo' @pageSize='pageSize'></pagination>
</template>
</cn-data-list>
<el-drawer
v-model="rightBox.show"
direction="rtl"
:with-header="false"
destroy-on-close>
<i18n-box
:object="object"
@close="closeRightBox"
/>
</el-drawer>
</div>
</template>
<script>
import cnDataList from '@/components/table/CnDataList'
import dataListMixin from '@/mixins/data-list'
import i18nTable from '@/components/table/settings/I18nTable'
import i18nBox from '@/components/rightBox/settings/I18nBox'
import { api } from '@/utils/api'
export default {
name: 'I18n',
mixins: [dataListMixin],
components: {
cnDataList,
i18nTable,
i18nBox
},
data () {
return {
url: api.i18nSys,
blankObject: { // 空白对象
id: '',
name: '',
code: '',
lang: '',
value: ''
},
tableId: 'i18nTable'
}
},
methods: {
}
}
</script>

View File

@@ -1,54 +0,0 @@
<template>
<div style="height: 100%;">
<cn-data-list
ref="dataList"
:api="url"
:tableId="tableId"
:layout="['search', 'elementSet','search']"
v-model:custom-table-title="tools.customTableTitle"
:from="fromRoute.operationLog"
@search="search">
<template v-slot:default>
<operation-log-table
ref="dataTable"
v-loading="tools.loading"
:api="url"
:custom-table-title="tools.customTableTitle"
:height="mainTableHeight"
:table-data="tableData"
@del="del"
@edit="edit"
@orderBy="tableDataSort"
@reload="getTableData"
@selectionChange="selectionChange"
@showBottomBox="(targetTab, object) => { $refs.dataList.showBottomBox(targetTab, object) }"></operation-log-table>
@search="search"
</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 cnDataList from '@/components/table/CnDataList'
import dataListMixin from '@/mixins/data-list'
import operationLogTable from '@/components/table/settings/OperationLogTable'
import { api } from '@/utils/api'
export default {
name: 'operationLog',
components: {
cnDataList,
operationLogTable
},
mixins: [dataListMixin],
data () {
return {
url: api.operationLog,
tableId: 'operationLogTable' // 需要分页的table的id用于记录每页数量
}
}
}
</script>

View File

@@ -1,91 +0,0 @@
<template>
<div style="height: 100%;">
<cn-data-list
ref="dataList"
:tableId="tableId"
v-model:custom-table-title="tools.customTableTitle"
:api="url"
:from="fromRoute.roles"
:layout="['columnCustomize','elementSet','search']"
@search="search"
>
<template v-slot:top-tool-right>
<button id="roles-add" :title="$t('overall.createRole')" class="top-tool-btn margin-r-10"
type="button" @click="add">
<i class="cn-icon-add cn-icon"></i>
</button>
<delete-button id="role-list-batch-delete" :api="url" :delete-objs="batchDeleteObjs" @after="getTableData" @before="delFlag=true"></delete-button>
</template>
<template v-slot:default>
<roles-table
ref="dataTable"
v-loading="tools.loading"
:api="url"
:custom-table-title="tools.customTableTitle"
:height="mainTableHeight"
:table-data="tableData"
@delete="del"
@edit="edit"
@orderBy="tableDataSort"
@reload="getTableData"
@selectionChange="selectionChange"
></roles-table>
</template>
<!-- 分页组件 -->
<template #pagination>
<pagination ref="pagination" :page-obj="pageObj" :table-id="tableId" @pageNo='pageNo' @pageSize='pageSize'></pagination>
</template>
</cn-data-list>
<el-drawer
v-model="rightBox.show"
direction="rtl"
:with-header="false"
destroy-on-close>
<role-box :object="object" @close="closeRightBox"></role-box>
</el-drawer>
</div>
</template>
<script>
import cnDataList from '@/components/table/CnDataList'
import dataListMixin from '@/mixins/data-list'
import rolesTable from '@/components/table/settings/RoleTable'
import roleBox from '@/components/rightBox/settings/RoleBox'
import { api } from '@/utils/api'
import { get } from '@/utils/http'
export default {
name: 'roles',
components: {
cnDataList,
roleBox,
rolesTable
},
mixins: [dataListMixin],
data () {
return {
url: api.role,
tableId: 'rolesTable', // 需要分页的table的id用于记录每页数量
blankObject: { // 空白对象
name: '',
buildIn: '',
i18n: '',
id: '',
menuIds: [],
remark: '',
uby: 0,
utime: ''
}
}
},
methods: {
edit (u) {
get(`${this.url}`, { ids: u.id }).then(response => {
if (response.code === 200) {
this.object = response.data.list[0]
this.rightBox.show = true
}
})
}
}
}
</script>

View File

@@ -1,86 +0,0 @@
<template>
<div style="height: 100%;">
<cn-data-list
ref="dataList"
:tableId="tableId"
v-model:custom-table-title="tools.customTableTitle"
:api="url"
:from="fromRoute.user"
:layout="['columnCustomize','elementSet','search']"
@search="search"
>
<template #top-tool-right>
<button
id="account-add"
class="top-tool-btn margin-r-10"
type="button"
@click="add"
>
<i class="cn-icon-add cn-icon"/>
</button>
</template>
<template #default>
<user-table
ref="dataTable"
v-loading="tools.loading"
:api="url"
:custom-table-title="tools.customTableTitle"
:height="mainTableHeight"
:table-data="tableData"
@delete="del"
@edit="edit"
@orderBy="tableDataSort"
@reload="getTableData"
@selectionChange="selectionChange"
/>
</template>
<template #pagination>
<pagination ref="pagination" :page-obj="pageObj" :table-id="tableId" @pageNo='pageNo' @pageSize='pageSize'></pagination>
</template>
</cn-data-list>
<el-drawer
v-model="rightBox.show"
direction="rtl"
:with-header="false"
destroy-on-close>
<user-box
:object="object"
@close="closeRightBox"
/>
</el-drawer>
</div>
</template>
<script>
import cnDataList from '@/components/table/CnDataList'
import dataListMixin from '@/mixins/data-list'
import userTable from '@/components/table/settings/UserTable'
import userBox from '@/components/rightBox/settings/UserBox'
import { api } from '@/utils/api'
export default {
name: 'User',
mixins: [dataListMixin],
components: {
cnDataList,
userTable,
userBox
},
data () {
return {
url: api.user,
blankObject: { // 空白对象
id: '',
name: '',
username: '',
email: '',
pin: '',
mobile: '',
status: 1,
roleIds: '',
pinChange: ''
},
tableId: 'userTable'
}
}
}
</script>

View File

@@ -1,14 +1,11 @@
import linkBlock from '@/views/charts2/charts/linkMonitor/LinkBlock'
import { mount } from '@vue/test-utils'
import axios from 'axios'
import { mockData, linkInfoData } from './MockData/LinkBlock'
const mockGet1 = mockData.common.data1
const mockGet2 = mockData.common.data2
const mockGet1 = {
data: { status: 200, code: 200, queryKey: '549b4c3bcabf0feee193b834671879de', success: true, message: null, statistics: { elapsed: 3, rows_read: 11480, bytes_read: 459200, result_size: 1214, result_rows: 21 }, job: null, formatType: 'json', meta: [{ name: 'link_id', type: 'string', category: 'Dimension' }, { name: 'egress_bytes', type: 'long', category: 'Metric' }, { name: 'ingress_bytes', type: 'long', category: 'Metric' }], data: { resultType: 'table', result: [{ linkId: '257', egressBytes: '0', egressBitsRate: 0, ingressBytes: '493739879', ingressBitsRate: 1097199.76 }, { linkId: '256', egressBytes: '4147998874', egressBitsRate: 9217775.28, ingressBytes: '0', ingressBitsRate: 0 }, { linkId: '1024', egressBytes: '4229808296', egressBitsRate: 9399574, ingressBytes: '0', ingressBitsRate: 0 }, { linkId: '1793', egressBytes: '0', egressBitsRate: 0, ingressBytes: '604840505', ingressBitsRate: 1344090 }, { linkId: '2817', egressBytes: '0', egressBitsRate: 0, ingressBytes: '430811638', ingressBitsRate: 957359.2 }, { linkId: '0', egressBytes: '819878366014', egressBitsRate: 1821951924.48, ingressBytes: '140774357362', ingressBitsRate: 312831905.28 }, { linkId: '1281', egressBytes: '0', egressBitsRate: 0, ingressBytes: '544675122', ingressBitsRate: 1210389.12 }, { linkId: '2049', egressBytes: '0', egressBitsRate: 0, ingressBytes: '711346274', ingressBitsRate: 1580769.52 }, { linkId: '1536', egressBytes: '4195896971', egressBitsRate: 9324215.52, ingressBytes: '0', ingressBitsRate: 0 }, { linkId: '2305', egressBytes: '0', egressBitsRate: 0, ingressBytes: '524865003', ingressBitsRate: 1166366.64 }, { linkId: '1792', egressBytes: '4145790227', egressBitsRate: 9212867.2, ingressBytes: '0', ingressBitsRate: 0 }, { linkId: '1025', egressBytes: '0', egressBitsRate: 0, ingressBytes: '492227445', ingressBitsRate: 1093838.8 }, { linkId: '2816', egressBytes: '4000074817', egressBitsRate: 8889055.12, ingressBytes: '0', ingressBitsRate: 0 }, { linkId: '513', egressBytes: '0', egressBitsRate: 0, ingressBytes: '1444814826', ingressBitsRate: 3210699.6 }, { linkId: '768', egressBytes: '4370006099', egressBitsRate: 9711124.64, ingressBytes: '0', ingressBitsRate: 0 }, { linkId: '512', egressBytes: '3894190397', egressBitsRate: 8653756.4, ingressBytes: '0', ingressBitsRate: 0 }, { linkId: '769', egressBytes: '0', egressBitsRate: 0, ingressBytes: '1877580759', ingressBitsRate: 4172401.68 }, { linkId: '2304', egressBytes: '3767761711', egressBitsRate: 8372803.84, ingressBytes: '0', ingressBitsRate: 0 }, { linkId: '1537', egressBytes: '0', egressBitsRate: 0, ingressBytes: '367986916', ingressBitsRate: 817748.72 }, { linkId: '1280', egressBytes: '4040444894', egressBitsRate: 8978766.4, ingressBytes: '0', ingressBitsRate: 0 }, { linkId: '2048', egressBytes: '4682050724', egressBitsRate: 10404557.2, ingressBytes: '0', ingressBitsRate: 0 }] }, originalUrl: 'http://192.168.44.55:9999?query=SELECT%20arrayJoin%28splitByChar%28%27_%27%2C%20concat%28toString%28common_egress_link_id%29%2C%20%27_%27%2C%20toString%28common_ingress_link_id%29%29%29%29%20AS%20link_id%2CSUM%28IF%28toString%28common_egress_link_id%29%20%3D%20link_id%2C%20traffic_outbound_byte%2C%200%29%29%20AS%20egress_bytes%2CSUM%28IF%28toString%28common_ingress_link_id%29%20%3D%20link_id%2C%20traffic_inbound_byte%2C%200%29%29%20AS%20ingress_bytes%20FROM%20metric_link%20WHERE%20stat_time%20%3E%3D%201675303793%20AND%20stat_time%20%3C%201675307393%20GROUP%20BY%20link_id&format=json&option=real-time', msg: 'OK' }
}
const mockGet2 = {
data: { status: 200, code: 200, queryKey: 'ee2e820b1275748167cdee82b2b4ea40', success: true, message: null, statistics: { elapsed: 3, rows_read: 11480, bytes_read: 618564, result_size: 1053, result_rows: 10 }, job: null, formatType: 'json', meta: [{ name: 'egress_link_direction', type: 'string', category: 'Dimension' }, { name: 'ingress_link_direction', type: 'string', category: 'Dimension' }, { name: 'egress_bytes', type: 'long', category: 'Metric' }, { name: 'ingress_bytes', type: 'long', category: 'Metric' }], data: { resultType: 'table', result: [{ egressLinkDirection: '太原', ingressLinkDirection: '西宁', egressBytes: '2407509269', egressBitsRate: 5350020.56, ingressBytes: '193368911', ingressBitsRate: 429708.72 }, { egressLinkDirection: '西安', ingressLinkDirection: '西安', egressBytes: '3609358392', egressBitsRate: 8020796.4, ingressBytes: '345009143', ingressBitsRate: 766686.96 }, { egressLinkDirection: '西宁', ingressLinkDirection: '西安', egressBytes: '1273508499', egressBitsRate: 2830018.88, ingressBytes: '122646511', ingressBitsRate: 272547.84 }, { egressLinkDirection: '太原', ingressLinkDirection: '太原', egressBytes: '14840136119', egressBitsRate: 32978080.24, ingressBytes: '3386427658', ingressBitsRate: 7525394.8 }, { egressLinkDirection: '西安', ingressLinkDirection: '太原', egressBytes: '7070361369', egressBitsRate: 15711914.16, ingressBytes: '1853445429', ingressBitsRate: 4118767.6 }, { egressLinkDirection: '西宁', ingressLinkDirection: '太原', egressBytes: '2619231460', egressBitsRate: 5820514.32, ingressBytes: '291561196', ingressBitsRate: 647913.76 }, { egressLinkDirection: '', ingressLinkDirection: '', egressBytes: '409939183007', egressBitsRate: 910975962.24, ingressBytes: '70387178681', ingressBitsRate: 156415952.64 }, { egressLinkDirection: '太原', ingressLinkDirection: '西安', egressBytes: '7808050741', egressBitsRate: 17351223.84, ingressBytes: '1001570985', ingressBitsRate: 2225713.28 }, { egressLinkDirection: '西宁', ingressLinkDirection: '西宁', egressBytes: '337068337', egressBitsRate: 749040.72, ingressBytes: '165230290', ingressBitsRate: 367178.4 }, { egressLinkDirection: '西安', ingressLinkDirection: '西宁', egressBytes: '1508798824', egressBitsRate: 3352886.24, ingressBytes: '133628244', ingressBitsRate: 296951.68 }] }, originalUrl: 'http://192.168.44.55:9999?query=SELECT%20egress_link_direction%20AS%20egress_link_direction%2C%20ingress_link_direction%20AS%20ingress_link_direction%2C%20SUM%28traffic_outbound_byte%29%20AS%20egress_bytes%2C%20SUM%28traffic_inbound_byte%29%20AS%20ingress_bytes%20FROM%20metric_link%20WHERE%20stat_time%20%3E%3D%201675303793%20AND%20stat_time%20%3C%201675307393%20GROUP%20BY%20egress_link_direction%2C%20ingress_link_direction&format=json&option=real-time', msg: 'OK' }
}
const linkInfoData = [{ originalLinkId: '256', linkId: 'Hundredgige1', direction: 'egress', nextHop: '西安', bandwidth: 100000000000 }, { originalLinkId: '257', linkId: 'Hundredgige1', direction: 'ingress', nextHop: '西安', bandwidth: 100000000000 }, { originalLinkId: '512', linkId: 'Hundredgige2', direction: 'egress', nextHop: '太原', bandwidth: 100000000000 }, { originalLinkId: '513', linkId: 'Hundredgige2', direction: 'ingress', nextHop: '太原', bandwidth: 100000000000 }, { originalLinkId: '768', linkId: 'Hundredgige3', direction: 'egress', nextHop: '太原', bandwidth: 100000000000 }, { originalLinkId: '769', linkId: 'Hundredgige3', direction: 'ingress', nextHop: '太原', bandwidth: 100000000000 }, { originalLinkId: '1024', linkId: 'Hundredgige4', direction: 'egress', nextHop: '西宁', bandwidth: 100000000000 }, { originalLinkId: '1025', linkId: 'Hundredgige4', direction: 'ingress', nextHop: '西宁', bandwidth: 100000000000 }, { originalLinkId: '1280', linkId: 'Hundredgige5', direction: 'egress', nextHop: '西安', bandwidth: 100000000000 }, { originalLinkId: '1281', linkId: 'Hundredgige5', direction: 'ingress', nextHop: '西安', bandwidth: 100000000000 }, { originalLinkId: '1536', linkId: 'Hundredgige6', direction: 'egress', nextHop: '太原', bandwidth: 100000000000 }, { originalLinkId: '1537', linkId: 'Hundredgige6', direction: 'ingress', nextHop: '太原', bandwidth: 100000000000 }, { originalLinkId: '1792', linkId: 'Hundredgige7', direction: 'egress', nextHop: '太原', bandwidth: 100000000000 }, { originalLinkId: '1793', linkId: 'Hundredgige7', direction: 'ingress', nextHop: '太原', bandwidth: 100000000000 }, { originalLinkId: '2048', linkId: 'Hundredgige8', direction: 'egress', nextHop: '太原', bandwidth: 100000000000 }, { originalLinkId: '2049', linkId: 'Hundredgige8', direction: 'ingress', nextHop: '太原', bandwidth: 100000000000 }, { originalLinkId: '2304', linkId: 'Hundredgige9', direction: 'egress', nextHop: '太原', bandwidth: 100000000000 }, { originalLinkId: '2305', linkId: 'Hundredgige9', direction: 'ingress', nextHop: '太原', bandwidth: 100000000000 }, { originalLinkId: '2816', linkId: 'Hundredgige10', direction: 'egress', nextHop: '西安', bandwidth: 100000000000 }, { originalLinkId: '2817', linkId: 'Hundredgige10', direction: 'ingress', nextHop: '西安', bandwidth: 100000000000 }]
const linkInfo = JSON.stringify(linkInfoData)
const timeFilter = {
dateRangeValue: -1,
@@ -20,25 +17,26 @@ var wrapper = null
/**
* 进行axios请求并挂载vue实例
* @param list
*
*/
function axiosPostAndMounted (list) {
function axiosPostAndMounted (list1, list2) {
require('vue-router').useRoute.mockReturnValue({ query: {} })
const data = list || mockGet1
const data1 = list1 || mockGet1
const data2 = list2 || mockGet2
// 模拟axios返回数据
axios.get.mockImplementation(url => {
switch (url) {
case '/interface/link/overview/analysis':
return Promise.resolve(data)
return Promise.resolve(data1)
case '/interface/link/overview/nextHopAnalysis':
return Promise.resolve(mockGet2)
return Promise.resolve(data2)
}
})
// 模拟localStorage获取数据
// eslint-disable-next-line no-proto
jest.spyOn(localStorage.__proto__, 'getItem').mockImplementation(key => linkInfo)
jest.spyOn(localStorage.__proto__, 'getItem').mockImplementation(() => linkInfo)
// 加载vue组件获得实例
wrapper = mount(linkBlock, {
@@ -86,44 +84,79 @@ describe('views/charts2/charts/linkMonitor/LinkBlock.vue测试', () => {
resolve()
}, 200))
})
test('鼠标移动到链路蜂窝图第一个测试total显示', async () => {
// 以"Hundredgige3"为例对应出方向linkId为768对应出方向流量为9711124.64
// 对应入方向linkId为769对应入方向流量为4172401.68修改流量测试total
const list = JSON.parse(JSON.stringify(mockGet1))
list.data.data.result[14].egressBitsRate = 9000000.00
list.data.data.result[16].ingressBitsRate = 4000000.00
test('链路蜂窝图和下一跳蜂窝图均无数据', async () => {
const list1 = mockData.empty.data1
const list2 = mockData.empty.data2
axiosPostAndMounted(list)
axiosPostAndMounted(list1, list2)
// 延迟等待渲染。使用wrapper.vm.$nextTick有时不管用例如组件中使用了setTimeout的时候
await new Promise(resolve => setTimeout(() => {
const linkBlockTotal0 = wrapper.get('[test-id="linkBlockTotal0"]')
const linkBlockEgressUsage0 = wrapper.get('[test-id="linkBlockEgressUsage0"]')
const linkBlockIngressUsage0 = wrapper.get('[test-id="linkBlockIngressUsage0"]')
const linkBlockNoData = wrapper.get('[test-id="linkBlockNoData"]')
const nextHpNoData = wrapper.get('[test-id="nextHpNoData"]')
expect(linkBlockTotal0.text()).toBe('13 Mbps')
expect(linkBlockEgressUsage0.text()).toBe('< 0.01%')
expect(linkBlockIngressUsage0.text()).toBe('< 0.01%')
expect(linkBlockNoData.text()).toBe('npm.noData')
expect(nextHpNoData.text()).toBe('npm.noData')
resolve()
}, 200))
})
test('鼠标移动到链路蜂窝图第一个,测试出入流量占比', async () => {
// 以"Hundredgige3"为例修改其出入流量为100000000000测试上行流量占比为100%下行占比为0%的情况
const list = JSON.parse(JSON.stringify(mockGet1))
list.data.data.result[14].egressBitsRate = 100000000000.00
list.data.data.result[16].ingressBitsRate = 0
test('链路蜂窝图上行流量大数值', async () => {
const list1 = mockData.boundary.data1
axiosPostAndMounted(list)
axiosPostAndMounted(list1)
// 延迟等待渲染。使用wrapper.vm.$nextTick有时不管用例如组件中使用了setTimeout的时候
await new Promise(resolve => setTimeout(() => {
const linkBlockTotal0 = wrapper.get('[test-id="linkBlockTotal0"]')
const linkBlockEgressUsage0 = wrapper.get('[test-id="linkBlockEgressUsage0"]')
const linkBlockIngressUsage0 = wrapper.get('[test-id="linkBlockIngressUsage0"]')
const linkBlockEgressUsage1 = wrapper.get('[test-id="linkBlockEgressUsage1"]')
const linkBlockEgressUsage2 = wrapper.get('[test-id="linkBlockEgressUsage2"]')
const linkBlockEgressUsage3 = wrapper.get('[test-id="linkBlockEgressUsage3"]')
const linkBlockEgressUsage4 = wrapper.get('[test-id="linkBlockEgressUsage4"]')
const linkBlockEgressUsage5 = wrapper.get('[test-id="linkBlockEgressUsage5"]')
const linkBlockEgressUsage6 = wrapper.get('[test-id="linkBlockEgressUsage6"]')
const linkBlockEgressUsage7 = wrapper.get('[test-id="linkBlockEgressUsage7"]')
const linkBlockEgressUsage8 = wrapper.get('[test-id="linkBlockEgressUsage8"]')
const linkBlockEgressUsage9 = wrapper.get('[test-id="linkBlockEgressUsage9"]')
// 超大流量时total显示
expect(linkBlockTotal0.text()).toBe('100 Gbps')
// 超大上行流量,上行占比情况
expect(linkBlockEgressUsage0.text()).toBe('100.00%')
expect(linkBlockIngressUsage0.text()).toBe('0%')
expect(linkBlockEgressUsage1.text()).toBe('100.00%')
expect(linkBlockEgressUsage2.text()).toBe('100.00%')
expect(linkBlockEgressUsage3.text()).toBe('100.00%')
expect(linkBlockEgressUsage4.text()).toBe('100.00%')
expect(linkBlockEgressUsage5.text()).toBe('100.00%')
expect(linkBlockEgressUsage6.text()).toBe('100.00%')
expect(linkBlockEgressUsage7.text()).toBe('100.00%')
expect(linkBlockEgressUsage8.text()).toBe('100.00%')
expect(linkBlockEgressUsage9.text()).toBe('100.00%')
resolve()
}, 200))
})
test('下一跳蜂窝图下行流量大数值', async () => {
const list1 = mockData.common.data1
const list2 = mockData.boundary.data2
axiosPostAndMounted(list1, list2)
await new Promise(resolve => setTimeout(() => {
const nextHopTotal0 = wrapper.get('[test-id="nextHopTotal0"]')
const nextHopIngressUsage0 = wrapper.get('[test-id="nextHopIngressUsage0"]')
const nextHopIngressUsage1 = wrapper.get('[test-id="nextHopIngressUsage1"]')
const nextHopIngressUsage2 = wrapper.get('[test-id="nextHopIngressUsage2"]')
const nextHopEgressUsage0 = wrapper.get('[test-id="nextHopEgressUsage0"]')
const nextHopEgressUsage1 = wrapper.get('[test-id="nextHopEgressUsage1"]')
const nextHopEgressUsage2 = wrapper.get('[test-id="nextHopEgressUsage2"]')
// 超大流量时total显示
expect(nextHopTotal0.text()).toBe('30 Tbps')
// 超大上行流量,上行、下行占比情况
expect(nextHopEgressUsage0.text()).toBe('0%')
expect(nextHopEgressUsage1.text()).toBe('0%')
expect(nextHopEgressUsage2.text()).toBe('0%')
expect(nextHopIngressUsage0.text()).toBe('100.00%')
expect(nextHopIngressUsage1.text()).toBe('100.00%')
expect(nextHopIngressUsage2.text()).toBe('100.00%')
resolve()
}, 200))
})

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,240 @@
export const mockData = {
common: {
data1: {
data: { status: 200, code: 200, queryKey: '549b4c3bcabf0feee193b834671879de', success: true, message: null, statistics: { elapsed: 3, rows_read: 11480, bytes_read: 459200, result_size: 1214, result_rows: 21 }, job: null, formatType: 'json', meta: [{ name: 'link_id', type: 'string', category: 'Dimension' }, { name: 'egress_bytes', type: 'long', category: 'Metric' }, { name: 'ingress_bytes', type: 'long', category: 'Metric' }], data: { resultType: 'table', result: [{ linkId: '257', egressBytes: '0', egressBitsRate: 0, ingressBytes: '493739879', ingressBitsRate: 1097199.76 }, { linkId: '256', egressBytes: '4147998874', egressBitsRate: 9217775.28, ingressBytes: '0', ingressBitsRate: 0 }, { linkId: '1024', egressBytes: '4229808296', egressBitsRate: 9399574, ingressBytes: '0', ingressBitsRate: 0 }, { linkId: '1793', egressBytes: '0', egressBitsRate: 0, ingressBytes: '604840505', ingressBitsRate: 1344090 }, { linkId: '2817', egressBytes: '0', egressBitsRate: 0, ingressBytes: '430811638', ingressBitsRate: 957359.2 }, { linkId: '0', egressBytes: '819878366014', egressBitsRate: 1821951924.48, ingressBytes: '140774357362', ingressBitsRate: 312831905.28 }, { linkId: '1281', egressBytes: '0', egressBitsRate: 0, ingressBytes: '544675122', ingressBitsRate: 1210389.12 }, { linkId: '2049', egressBytes: '0', egressBitsRate: 0, ingressBytes: '711346274', ingressBitsRate: 1580769.52 }, { linkId: '1536', egressBytes: '4195896971', egressBitsRate: 9324215.52, ingressBytes: '0', ingressBitsRate: 0 }, { linkId: '2305', egressBytes: '0', egressBitsRate: 0, ingressBytes: '524865003', ingressBitsRate: 1166366.64 }, { linkId: '1792', egressBytes: '4145790227', egressBitsRate: 9212867.2, ingressBytes: '0', ingressBitsRate: 0 }, { linkId: '1025', egressBytes: '0', egressBitsRate: 0, ingressBytes: '492227445', ingressBitsRate: 1093838.8 }, { linkId: '2816', egressBytes: '4000074817', egressBitsRate: 8889055.12, ingressBytes: '0', ingressBitsRate: 0 }, { linkId: '513', egressBytes: '0', egressBitsRate: 0, ingressBytes: '1444814826', ingressBitsRate: 3210699.6 }, { linkId: '768', egressBytes: '4370006099', egressBitsRate: 9711124.64, ingressBytes: '0', ingressBitsRate: 0 }, { linkId: '512', egressBytes: '3894190397', egressBitsRate: 8653756.4, ingressBytes: '0', ingressBitsRate: 0 }, { linkId: '769', egressBytes: '0', egressBitsRate: 0, ingressBytes: '1877580759', ingressBitsRate: 4172401.68 }, { linkId: '2304', egressBytes: '3767761711', egressBitsRate: 8372803.84, ingressBytes: '0', ingressBitsRate: 0 }, { linkId: '1537', egressBytes: '0', egressBitsRate: 0, ingressBytes: '367986916', ingressBitsRate: 817748.72 }, { linkId: '1280', egressBytes: '4040444894', egressBitsRate: 8978766.4, ingressBytes: '0', ingressBitsRate: 0 }, { linkId: '2048', egressBytes: '4682050724', egressBitsRate: 10404557.2, ingressBytes: '0', ingressBitsRate: 0 }] }, originalUrl: 'http://192.168.44.55:9999?query=SELECT%20arrayJoin%28splitByChar%28%27_%27%2C%20concat%28toString%28common_egress_link_id%29%2C%20%27_%27%2C%20toString%28common_ingress_link_id%29%29%29%29%20AS%20link_id%2CSUM%28IF%28toString%28common_egress_link_id%29%20%3D%20link_id%2C%20traffic_outbound_byte%2C%200%29%29%20AS%20egress_bytes%2CSUM%28IF%28toString%28common_ingress_link_id%29%20%3D%20link_id%2C%20traffic_inbound_byte%2C%200%29%29%20AS%20ingress_bytes%20FROM%20metric_link%20WHERE%20stat_time%20%3E%3D%201675303793%20AND%20stat_time%20%3C%201675307393%20GROUP%20BY%20link_id&format=json&option=real-time', msg: 'OK' }
},
data2: {
data: { status: 200, code: 200, queryKey: 'ee2e820b1275748167cdee82b2b4ea40', success: true, message: null, statistics: { elapsed: 3, rows_read: 11480, bytes_read: 618564, result_size: 1053, result_rows: 10 }, job: null, formatType: 'json', meta: [{ name: 'egress_link_direction', type: 'string', category: 'Dimension' }, { name: 'ingress_link_direction', type: 'string', category: 'Dimension' }, { name: 'egress_bytes', type: 'long', category: 'Metric' }, { name: 'ingress_bytes', type: 'long', category: 'Metric' }], data: { resultType: 'table', result: [{ egressLinkDirection: '太原', ingressLinkDirection: '西宁', egressBytes: '2407509269', egressBitsRate: 5350020.56, ingressBytes: '193368911', ingressBitsRate: 429708.72 }, { egressLinkDirection: '西安', ingressLinkDirection: '西安', egressBytes: '3609358392', egressBitsRate: 8020796.4, ingressBytes: '345009143', ingressBitsRate: 766686.96 }, { egressLinkDirection: '西宁', ingressLinkDirection: '西安', egressBytes: '1273508499', egressBitsRate: 2830018.88, ingressBytes: '122646511', ingressBitsRate: 272547.84 }, { egressLinkDirection: '太原', ingressLinkDirection: '太原', egressBytes: '14840136119', egressBitsRate: 32978080.24, ingressBytes: '3386427658', ingressBitsRate: 7525394.8 }, { egressLinkDirection: '西安', ingressLinkDirection: '太原', egressBytes: '7070361369', egressBitsRate: 15711914.16, ingressBytes: '1853445429', ingressBitsRate: 4118767.6 }, { egressLinkDirection: '西宁', ingressLinkDirection: '太原', egressBytes: '2619231460', egressBitsRate: 5820514.32, ingressBytes: '291561196', ingressBitsRate: 647913.76 }, { egressLinkDirection: '', ingressLinkDirection: '', egressBytes: '409939183007', egressBitsRate: 910975962.24, ingressBytes: '70387178681', ingressBitsRate: 156415952.64 }, { egressLinkDirection: '太原', ingressLinkDirection: '西安', egressBytes: '7808050741', egressBitsRate: 17351223.84, ingressBytes: '1001570985', ingressBitsRate: 2225713.28 }, { egressLinkDirection: '西宁', ingressLinkDirection: '西宁', egressBytes: '337068337', egressBitsRate: 749040.72, ingressBytes: '165230290', ingressBitsRate: 367178.4 }, { egressLinkDirection: '西安', ingressLinkDirection: '西宁', egressBytes: '1508798824', egressBitsRate: 3352886.24, ingressBytes: '133628244', ingressBitsRate: 296951.68 }] }, originalUrl: 'http://192.168.44.55:9999?query=SELECT%20egress_link_direction%20AS%20egress_link_direction%2C%20ingress_link_direction%20AS%20ingress_link_direction%2C%20SUM%28traffic_outbound_byte%29%20AS%20egress_bytes%2C%20SUM%28traffic_inbound_byte%29%20AS%20ingress_bytes%20FROM%20metric_link%20WHERE%20stat_time%20%3E%3D%201675303793%20AND%20stat_time%20%3C%201675307393%20GROUP%20BY%20egress_link_direction%2C%20ingress_link_direction&format=json&option=real-time', msg: 'OK' }
}
},
empty: {
data1: {
data: { status: 200, code: 200, data: { resultType: 'table', result: [] }, msg: 'OK' }
},
data2: {
data: { status: 200, code: 200, data: { resultType: 'table', result: [] }, msg: 'OK' }
}
},
boundary: {
data1: {
data: {
status: 200,
code: 200,
queryKey: '549b4c3bcabf0feee193b834671879de',
data: {
result: [
{
linkId: '257',
egressBytes: '0',
egressBitsRate: 0,
ingressBytes: '493739879',
ingressBitsRate: 0
}, {
linkId: '256',
egressBytes: '4147998874',
egressBitsRate: 100000000000.00,
ingressBytes: '0',
ingressBitsRate: 0
}, {
linkId: '1024',
egressBytes: '4229808296',
egressBitsRate: 100000000000.00,
ingressBytes: '0',
ingressBitsRate: 0
}, {
linkId: '1793',
egressBytes: '0',
egressBitsRate: 0,
ingressBytes: '604840505',
ingressBitsRate: 0
}, {
linkId: '2817',
egressBytes: '0',
egressBitsRate: 0,
ingressBytes: '430811638',
ingressBitsRate: 0
}, {
linkId: '0',
egressBytes: '819878366014',
egressBitsRate: 1821951924.48,
ingressBytes: '140774357362',
ingressBitsRate: 312831905.28
}, {
linkId: '1281',
egressBytes: '0',
egressBitsRate: 0,
ingressBytes: '544675122',
ingressBitsRate: 0
}, {
linkId: '2049',
egressBytes: '0',
egressBitsRate: 0,
ingressBytes: '711346274',
ingressBitsRate: 0
}, {
linkId: '1536',
egressBytes: '4195896971',
egressBitsRate: 100000000000.00,
ingressBytes: '0',
ingressBitsRate: 0
}, {
linkId: '2305',
egressBytes: '0',
egressBitsRate: 0,
ingressBytes: '524865003',
ingressBitsRate: 0
}, {
linkId: '1792',
egressBytes: '4145790227',
egressBitsRate: 100000000000.00,
ingressBytes: '0',
ingressBitsRate: 0
}, {
linkId: '1025',
egressBytes: '0',
egressBitsRate: 0,
ingressBytes: '492227445',
ingressBitsRate: 0
}, {
linkId: '2816',
egressBytes: '4000074817',
egressBitsRate: 100000000000.00,
ingressBytes: '0',
ingressBitsRate: 0
}, {
linkId: '513',
egressBytes: '0',
egressBitsRate: 0,
ingressBytes: '1444814826',
ingressBitsRate: 0
}, {
linkId: '768',
egressBytes: '4370006099',
egressBitsRate: 100000000000.00,
ingressBytes: '0',
ingressBitsRate: 0
}, {
linkId: '512',
egressBytes: '3894190397',
egressBitsRate: 100000000000.00,
ingressBytes: '0',
ingressBitsRate: 0
}, {
linkId: '769',
egressBytes: '0',
egressBitsRate: 0,
ingressBytes: '1877580759',
ingressBitsRate: 0
}, {
linkId: '2304',
egressBytes: '3767761711',
egressBitsRate: 100000000000.00,
ingressBytes: '0',
ingressBitsRate: 0
}, {
linkId: '1537',
egressBytes: '0',
egressBitsRate: 0,
ingressBytes: '367986916',
ingressBitsRate: 0
}, {
linkId: '1280',
egressBytes: '4040444894',
egressBitsRate: 100000000000.00,
ingressBytes: '0',
ingressBitsRate: 0
}, {
linkId: '2048',
egressBytes: '4682050724',
egressBitsRate: 100000000000.00,
ingressBytes: '0',
ingressBitsRate: 0
}]
}
}
},
data2: {
data: {
status: 200,
code: 200,
data: {
resultType: 'table',
result: [{
egressLinkDirection: '太原',
ingressLinkDirection: '西宁',
egressBytes: '2407509269',
egressBitsRate: 0,
ingressBytes: '193368911',
ingressBitsRate: 10000000000000.00
}, {
egressLinkDirection: '西安',
ingressLinkDirection: '西安',
egressBytes: '3609358392',
egressBitsRate: 0,
ingressBytes: '345009143',
ingressBitsRate: 10000000000000.00
}, {
egressLinkDirection: '西宁',
ingressLinkDirection: '西安',
egressBytes: '1273508499',
egressBitsRate: 0,
ingressBytes: '122646511',
ingressBitsRate: 10000000000000.00
}, {
egressLinkDirection: '太原',
ingressLinkDirection: '太原',
egressBytes: '14840136119',
egressBitsRate: 0,
ingressBytes: '3386427658',
ingressBitsRate: 10000000000000.00
}, {
egressLinkDirection: '西安',
ingressLinkDirection: '太原',
egressBytes: '7070361369',
egressBitsRate: 0,
ingressBytes: '1853445429',
ingressBitsRate: 10000000000000.00
}, {
egressLinkDirection: '西宁',
ingressLinkDirection: '太原',
egressBytes: '2619231460',
egressBitsRate: 0,
ingressBytes: '291561196',
ingressBitsRate: 10000000000000.00
}, {
egressLinkDirection: '',
ingressLinkDirection: '',
egressBytes: '409939183007',
egressBitsRate: 0,
ingressBytes: '70387178681',
ingressBitsRate: 10000000000000.00
}, {
egressLinkDirection: '太原',
ingressLinkDirection: '西安',
egressBytes: '7808050741',
egressBitsRate: 0,
ingressBytes: '1001570985',
ingressBitsRate: 10000000000000.00
}, {
egressLinkDirection: '西宁',
ingressLinkDirection: '西宁',
egressBytes: '337068337',
egressBitsRate: 0,
ingressBytes: '165230290',
ingressBitsRate: 10000000000000.00
}, {
egressLinkDirection: '西安',
ingressLinkDirection: '西宁',
egressBytes: '1508798824',
egressBitsRate: 0,
ingressBytes: '133628244',
ingressBitsRate: 10000000000000.00
}]
},
msg: 'OK'
}
}
}
}
export const linkInfoData = [{ originalLinkId: '256', linkId: 'Hundredgige1', direction: 'egress', nextHop: '西安', bandwidth: 100000000000 }, { originalLinkId: '257', linkId: 'Hundredgige1', direction: 'ingress', nextHop: '西安', bandwidth: 100000000000 }, { originalLinkId: '512', linkId: 'Hundredgige2', direction: 'egress', nextHop: '太原', bandwidth: 100000000000 }, { originalLinkId: '513', linkId: 'Hundredgige2', direction: 'ingress', nextHop: '太原', bandwidth: 100000000000 }, { originalLinkId: '768', linkId: 'Hundredgige3', direction: 'egress', nextHop: '太原', bandwidth: 100000000000 }, { originalLinkId: '769', linkId: 'Hundredgige3', direction: 'ingress', nextHop: '太原', bandwidth: 100000000000 }, { originalLinkId: '1024', linkId: 'Hundredgige4', direction: 'egress', nextHop: '西宁', bandwidth: 100000000000 }, { originalLinkId: '1025', linkId: 'Hundredgige4', direction: 'ingress', nextHop: '西宁', bandwidth: 100000000000 }, { originalLinkId: '1280', linkId: 'Hundredgige5', direction: 'egress', nextHop: '西安', bandwidth: 100000000000 }, { originalLinkId: '1281', linkId: 'Hundredgige5', direction: 'ingress', nextHop: '西安', bandwidth: 100000000000 }, { originalLinkId: '1536', linkId: 'Hundredgige6', direction: 'egress', nextHop: '太原', bandwidth: 100000000000 }, { originalLinkId: '1537', linkId: 'Hundredgige6', direction: 'ingress', nextHop: '太原', bandwidth: 100000000000 }, { originalLinkId: '1792', linkId: 'Hundredgige7', direction: 'egress', nextHop: '太原', bandwidth: 100000000000 }, { originalLinkId: '1793', linkId: 'Hundredgige7', direction: 'ingress', nextHop: '太原', bandwidth: 100000000000 }, { originalLinkId: '2048', linkId: 'Hundredgige8', direction: 'egress', nextHop: '太原', bandwidth: 100000000000 }, { originalLinkId: '2049', linkId: 'Hundredgige8', direction: 'ingress', nextHop: '太原', bandwidth: 100000000000 }, { originalLinkId: '2304', linkId: 'Hundredgige9', direction: 'egress', nextHop: '太原', bandwidth: 100000000000 }, { originalLinkId: '2305', linkId: 'Hundredgige9', direction: 'ingress', nextHop: '太原', bandwidth: 100000000000 }, { originalLinkId: '2816', linkId: 'Hundredgige10', direction: 'egress', nextHop: '西安', bandwidth: 100000000000 }, { originalLinkId: '2817', linkId: 'Hundredgige10', direction: 'ingress', nextHop: '西安', bandwidth: 100000000000 }]

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,389 @@
export const mockData = {
common: {
data1: {
data: {
status: 200,
code: 200,
queryKey: '87649896d5b7547a0128eb47c2d40853',
success: true,
message: null,
statistics: {
elapsed: 4,
rows_read: 1033063,
bytes_read: 8618120,
result_size: 13807,
result_rows: 101
},
job: null,
formatType: 'json',
meta: [
{
name: 'stat_time',
type: 'long',
category: 'Dimension'
}, {
name: 'egress_bytes',
type: 'long',
category: 'Metric'
}, {
name: 'ingress_bytes',
type: 'long',
category: 'Metric'
}, {
name: 'egress_pkt',
type: 'long',
category: 'Metric'
}, {
name: 'ingress_pkt',
type: 'long',
category: 'Metric'
}, {
name: 'bytes_total',
type: 'long',
category: 'Metric'
}, {
name: 'packets_total',
type: 'long',
category: 'Metric'
}],
data: {
resultType: 'object',
result: [
{
type: 'bytes',
ingressBitsRate: {
values: [['1675388124', '0'], ['1675388160', '4253144'], ['1675388196', '470709.36'], ['1675388232', '0'], ['1675388268', '148192.24'], ['1675388304', '0'], ['1675388340', '577072.48'], ['1675388376', '160431.12'], ['1675388412', '0'], ['1675388448', '1639602.64'], ['1675388484', '0'], ['1675388520', '2074017.36'], ['1675388556', '798924.64'], ['1675388592', '0'], ['1675388628', '884606'], ['1675388664', '0'], ['1675388700', '1373220.48'], ['1675388736', '21305.36'], ['1675388772', '0'], ['1675388808', '1398940.24'], ['1675388844', '0'], ['1675388880', '4474519.52'], ['1675388916', '383473.12'], ['1675388952', '0'], ['1675388988', '582813.36'], ['1675389024', '0'], ['1675389060', '3545078.24'], ['1675389096', '766672'], ['1675389132', '0'], ['1675389168', '2877694'], ['1675389204', '0'], ['1675389240', '2195562.48'], ['1675389276', '2268681.12'], ['1675389312', '0'], ['1675389348', '1438248.88'], ['1675389384', '0'], ['1675389420', '88914.24'], ['1675389456', '363776.24'], ['1675389492', '0'], ['1675389528', '103931.36'], ['1675389564', '0'], ['1675389600', '930861.12'], ['1675389636', '473982.48'], ['1675389672', '0'], ['1675389708', '210004.88'], ['1675389744', '0'], ['1675389780', '764367.52'], ['1675389816', '236745.52'], ['1675389852', '0'], ['1675389888', '199598'], ['1675389924', '0'], ['1675389960', '385563.36'], ['1675389996', '353556.64'], ['1675390032', '0'], ['1675390068', '380246.48'], ['1675390104', '0'], ['1675390140', '456284'], ['1675390176', '2560143.76'], ['1675390212', '0'], ['1675390248', '3806779.36'], ['1675390284', '0'], ['1675390320', '382829.52'], ['1675390356', '225432.48'], ['1675390392', '0'], ['1675390428', '1024283.52'], ['1675390464', '0'], ['1675390500', '494194.88'], ['1675390536', '718094.88'], ['1675390572', '0'], ['1675390608', '373146.64'], ['1675390644', '0'], ['1675390680', '101628.64'], ['1675390716', '977218'], ['1675390752', '0'], ['1675390788', '7263452.48'], ['1675390824', '0'], ['1675390860', '2613115.76'], ['1675390896', '2987862'], ['1675390932', '0'], ['1675390968', '1376989.36'], ['1675391004', '0'], ['1675391040', '2245663.12'], ['1675391076', '602240.64'], ['1675391112', '0'], ['1675391148', '437569.12'], ['1675391184', '0'], ['1675391220', '115680.88'], ['1675391256', '42582.24'], ['1675391292', '0'], ['1675391328', '42002'], ['1675391364', '0'], ['1675391400', '720716'], ['1675391436', '5382.88'], ['1675391472', '0'], ['1675391508', '169074.64'], ['1675391544', '0'], ['1675391580', '1214277.76'], ['1675391616', '1523679.76'], ['1675391652', '0'], ['1675391688', '6382256'], ['1675391724', '0']],
analysis: {
avg: '756870.4',
max: '7263452.48',
min: '0',
p95: '3545078.24'
}
},
totalBitsRate: {
values: [['1675388124', '0'], ['1675388160', '17581092.48'], ['1675388196', '9918148.64'], ['1675388232', '0'], ['1675388268', '13213336.64'], ['1675388304', '0'], ['1675388340', '41123655.76'], ['1675388376', '14569548.64'], ['1675388412', '0'], ['1675388448', '39157977.52'], ['1675388484', '0'], ['1675388520', '15875735.76'], ['1675388556', '10885102.24'], ['1675388592', '0'], ['1675388628', '8943487.12'], ['1675388664', '0'], ['1675388700', '18985121.76'], ['1675388736', '7659627.36'], ['1675388772', '0'], ['1675388808', '9288266.88'], ['1675388844', '0'], ['1675388880', '15999674.24'], ['1675388916', '16802700.48'], ['1675388952', '0'], ['1675388988', '17836499.52'], ['1675389024', '0'], ['1675389060', '22368492'], ['1675389096', '12570182.88'], ['1675389132', '0'], ['1675389168', '19977345.36'], ['1675389204', '0'], ['1675389240', '7747381.76'], ['1675389276', '29050230.64'], ['1675389312', '0'], ['1675389348', '5834855.36'], ['1675389384', '0'], ['1675389420', '22798420.24'], ['1675389456', '9061622.64'], ['1675389492', '0'], ['1675389528', '2391149.76'], ['1675389564', '0'], ['1675389600', '10752915.76'], ['1675389636', '72671214'], ['1675389672', '0'], ['1675389708', '23536865.76'], ['1675389744', '0'], ['1675389780', '6080925.76'], ['1675389816', '27096624.64'], ['1675389852', '0'], ['1675389888', '47355125.36'], ['1675389924', '0'], ['1675389960', '7525635.52'], ['1675389996', '12312211.76'], ['1675390032', '0'], ['1675390068', '9587065.36'], ['1675390104', '0'], ['1675390140', '7763073.36'], ['1675390176', '12692375.36'], ['1675390212', '0'], ['1675390248', '13007133.76'], ['1675390284', '0'], ['1675390320', '3241344.88'], ['1675390356', '13811041.12'], ['1675390392', '0'], ['1675390428', '38206391.36'], ['1675390464', '0'], ['1675390500', '5489114'], ['1675390536', '17855136.88'], ['1675390572', '0'], ['1675390608', '18409624.48'], ['1675390644', '0'], ['1675390680', '15132633.12'], ['1675390716', '19189583.52'], ['1675390752', '0'], ['1675390788', '16803327.36'], ['1675390824', '0'], ['1675390860', '19972804.88'], ['1675390896', '22541580.48'], ['1675390932', '0'], ['1675390968', '21671364.88'], ['1675391004', '0'], ['1675391040', '25293518.24'], ['1675391076', '34056467.52'], ['1675391112', '0'], ['1675391148', '13181229.76'], ['1675391184', '0'], ['1675391220', '12337126.88'], ['1675391256', '5989032.64'], ['1675391292', '0'], ['1675391328', '7393281.36'], ['1675391364', '0'], ['1675391400', '29175007.36'], ['1675391436', '17228925.76'], ['1675391472', '0'], ['1675391508', '7375468'], ['1675391544', '0'], ['1675391580', '16675685.76'], ['1675391616', '22908316'], ['1675391652', '0'], ['1675391688', '13867890.88'], ['1675391724', '0']],
analysis: {
avg: '10578267.2',
max: '72671214',
min: '0',
p95: '34056467.52'
}
},
egressBitsRate: {
values: [['1675388124', '0'], ['1675388160', '13327948.48'], ['1675388196', '9447439.36'], ['1675388232', '0'], ['1675388268', '13065144.48'], ['1675388304', '0'], ['1675388340', '40546583.36'], ['1675388376', '14409117.52'], ['1675388412', '0'], ['1675388448', '37518374.88'], ['1675388484', '0'], ['1675388520', '13801718.48'], ['1675388556', '10086177.52'], ['1675388592', '0'], ['1675388628', '8058881.12'], ['1675388664', '0'], ['1675388700', '17611901.36'], ['1675388736', '7638322'], ['1675388772', '0'], ['1675388808', '7889326.64'], ['1675388844', '0'], ['1675388880', '11525154.64'], ['1675388916', '16419227.36'], ['1675388952', '0'], ['1675388988', '17253686.24'], ['1675389024', '0'], ['1675389060', '18823413.76'], ['1675389096', '11803510.88'], ['1675389132', '0'], ['1675389168', '17099651.36'], ['1675389204', '0'], ['1675389240', '5551819.36'], ['1675389276', '26781549.52'], ['1675389312', '0'], ['1675389348', '4396606.48'], ['1675389384', '0'], ['1675389420', '22709506'], ['1675389456', '8697846.48'], ['1675389492', '0'], ['1675389528', '2287218.48'], ['1675389564', '0'], ['1675389600', '9822054.64'], ['1675389636', '72197231.52'], ['1675389672', '0'], ['1675389708', '23326860.88'], ['1675389744', '0'], ['1675389780', '5316558.24'], ['1675389816', '26859879.12'], ['1675389852', '0'], ['1675389888', '47155527.36'], ['1675389924', '0'], ['1675389960', '7140072.24'], ['1675389996', '11958655.12'], ['1675390032', '0'], ['1675390068', '9206818.88'], ['1675390104', '0'], ['1675390140', '7306789.36'], ['1675390176', '10132231.52'], ['1675390212', '0'], ['1675390248', '9200354.48'], ['1675390284', '0'], ['1675390320', '2858515.36'], ['1675390356', '13585608.64'], ['1675390392', '0'], ['1675390428', '37182107.76'], ['1675390464', '0'], ['1675390500', '4994919.12'], ['1675390536', '17137042'], ['1675390572', '0'], ['1675390608', '18036477.76'], ['1675390644', '0'], ['1675390680', '15031004.48'], ['1675390716', '18212365.52'], ['1675390752', '0'], ['1675390788', '9539874.88'], ['1675390824', '0'], ['1675390860', '17359689.12'], ['1675390896', '19553718.48'], ['1675390932', '0'], ['1675390968', '20294375.52'], ['1675391004', '0'], ['1675391040', '23047855.12'], ['1675391076', '33454226.88'], ['1675391112', '0'], ['1675391148', '12743660.64'], ['1675391184', '0'], ['1675391220', '12221446'], ['1675391256', '5946450.48'], ['1675391292', '0'], ['1675391328', '7351279.36'], ['1675391364', '0'], ['1675391400', '28454291.36'], ['1675391436', '17223542.88'], ['1675391472', '0'], ['1675391508', '7206393.36'], ['1675391544', '0'], ['1675391580', '15461408'], ['1675391616', '21384636.24'], ['1675391652', '0'], ['1675391688', '7485634.88'], ['1675391724', '0']],
analysis: {
avg: '9821396.8',
max: '72197231.52',
min: '0',
p95: '33454226.88'
}
}
},
{
type: 'packets',
ingressPacketsRate: {
values: [['1675388124', '0.00'], ['1675388160', '382.61'], ['1675388196', '44.67'], ['1675388232', '0.00'], ['1675388268', '23.64'], ['1675388304', '0.00'], ['1675388340', '53.75'], ['1675388376', '34.89'], ['1675388412', '0.00'], ['1675388448', '155.25'], ['1675388484', '0.00'], ['1675388520', '186.17'], ['1675388556', '77.81'], ['1675388592', '0.00'], ['1675388628', '84.75'], ['1675388664', '0.00'], ['1675388700', '140.39'], ['1675388736', '9.69'], ['1675388772', '0.00'], ['1675388808', '126.83'], ['1675388844', '0.00'], ['1675388880', '398.50'], ['1675388916', '94.92'], ['1675388952', '0.00'], ['1675388988', '57.33'], ['1675389024', '0.00'], ['1675389060', '326.89'], ['1675389096', '69.06'], ['1675389132', '0.00'], ['1675389168', '253.61'], ['1675389204', '0.00'], ['1675389240', '201.11'], ['1675389276', '203.14'], ['1675389312', '0.00'], ['1675389348', '126.33'], ['1675389384', '0.00'], ['1675389420', '13.86'], ['1675389456', '34.81'], ['1675389492', '0.00'], ['1675389528', '12.47'], ['1675389564', '0.00'], ['1675389600', '107.08'], ['1675389636', '54.39'], ['1675389672', '0.00'], ['1675389708', '24.42'], ['1675389744', '0.00'], ['1675389780', '67.47'], ['1675389816', '35.94'], ['1675389852', '0.00'], ['1675389888', '22.44'], ['1675389924', '0.00'], ['1675389960', '45.64'], ['1675389996', '32.81'], ['1675390032', '0.00'], ['1675390068', '37.72'], ['1675390104', '0.00'], ['1675390140', '43.69'], ['1675390176', '228.97'], ['1675390212', '0.00'], ['1675390248', '392.69'], ['1675390284', '0.00'], ['1675390320', '55.33'], ['1675390356', '47.44'], ['1675390392', '0.00'], ['1675390428', '106.06'], ['1675390464', '0.00'], ['1675390500', '47.58'], ['1675390536', '64.56'], ['1675390572', '0.00'], ['1675390608', '35.94'], ['1675390644', '0.00'], ['1675390680', '17.31'], ['1675390716', '95.47'], ['1675390752', '0.00'], ['1675390788', '638.00'], ['1675390824', '0.00'], ['1675390860', '239.11'], ['1675390896', '290.89'], ['1675390932', '0.00'], ['1675390968', '129.31'], ['1675391004', '0.00'], ['1675391040', '208.83'], ['1675391076', '65.31'], ['1675391112', '0.00'], ['1675391148', '42.17'], ['1675391184', '0.00'], ['1675391220', '17.94'], ['1675391256', '14.33'], ['1675391292', '0.00'], ['1675391328', '6.31'], ['1675391364', '0.00'], ['1675391400', '62.83'], ['1675391436', '2.53'], ['1675391472', '0.00'], ['1675391508', '37.06'], ['1675391544', '0.00'], ['1675391580', '110.00'], ['1675391616', '148.53'], ['1675391652', '0.00'], ['1675391688', '583.64'], ['1675391724', '0.00']],
analysis: {
avg: '72.72',
max: '638.00',
min: '0.00',
p95: '326.89'
}
},
egressPacketsRate: {
values: [['1675388124', '0.00'], ['1675388160', '1835.75'], ['1675388196', '865.61'], ['1675388232', '0.00'], ['1675388268', '1202.69'], ['1675388304', '0.00'], ['1675388340', '3864.69'], ['1675388376', '1428.56'], ['1675388412', '0.00'], ['1675388448', '3433.61'], ['1675388484', '0.00'], ['1675388520', '1228.06'], ['1675388556', '896.42'], ['1675388592', '0.00'], ['1675388628', '740.83'], ['1675388664', '0.00'], ['1675388700', '1576.75'], ['1675388736', '721.92'], ['1675388772', '0.00'], ['1675388808', '700.17'], ['1675388844', '0.00'], ['1675388880', '1058.28'], ['1675388916', '1487.19'], ['1675388952', '0.00'], ['1675388988', '1536.19'], ['1675389024', '0.00'], ['1675389060', '1671.50'], ['1675389096', '1083.58'], ['1675389132', '0.00'], ['1675389168', '1561.64'], ['1675389204', '0.00'], ['1675389240', '549.50'], ['1675389276', '2454.47'], ['1675389312', '0.00'], ['1675389348', '404.53'], ['1675389384', '0.00'], ['1675389420', '2011.22'], ['1675389456', '810.75'], ['1675389492', '0.00'], ['1675389528', '228.50'], ['1675389564', '0.00'], ['1675389600', '910.58'], ['1675389636', '6422.11'], ['1675389672', '0.00'], ['1675389708', '2123.44'], ['1675389744', '0.00'], ['1675389780', '481.97'], ['1675389816', '2462.33'], ['1675389852', '0.00'], ['1675389888', '4183.94'], ['1675389924', '0.00'], ['1675389960', '677.81'], ['1675389996', '1103.31'], ['1675390032', '0.00'], ['1675390068', '851.08'], ['1675390104', '0.00'], ['1675390140', '659.33'], ['1675390176', '936.56'], ['1675390212', '0.00'], ['1675390248', '835.78'], ['1675390284', '0.00'], ['1675390320', '296.28'], ['1675390356', '1205.39'], ['1675390392', '0.00'], ['1675390428', '3288.14'], ['1675390464', '0.00'], ['1675390500', '471.14'], ['1675390536', '1577.00'], ['1675390572', '0.00'], ['1675390608', '1645.36'], ['1675390644', '0.00'], ['1675390680', '1390.75'], ['1675390716', '1612.75'], ['1675390752', '0.00'], ['1675390788', '880.92'], ['1675390824', '0.00'], ['1675390860', '1573.47'], ['1675390896', '1809.56'], ['1675390932', '0.00'], ['1675390968', '1847.53'], ['1675391004', '0.00'], ['1675391040', '2160.33'], ['1675391076', '3126.36'], ['1675391112', '0.00'], ['1675391148', '1166.14'], ['1675391184', '0.00'], ['1675391220', '1166.81'], ['1675391256', '538.75'], ['1675391292', '0.00'], ['1675391328', '681.00'], ['1675391364', '0.00'], ['1675391400', '2580.83'], ['1675391436', '1693.17'], ['1675391472', '0.00'], ['1675391508', '695.89'], ['1675391544', '0.00'], ['1675391580', '1395.19'], ['1675391616', '1920.39'], ['1675391652', '0.00'], ['1675391688', '679.08'], ['1675391724', '0.00']],
analysis: {
avg: '904.03',
max: '6422.11',
min: '0.00',
p95: '3126.36'
}
},
totalPacketsRate: {
values: [['1675388124', '0.00'], ['1675388160', '2218.36'], ['1675388196', '910.28'], ['1675388232', '0.00'], ['1675388268', '1226.33'], ['1675388304', '0.00'], ['1675388340', '3918.44'], ['1675388376', '1463.44'], ['1675388412', '0.00'], ['1675388448', '3588.86'], ['1675388484', '0.00'], ['1675388520', '1414.22'], ['1675388556', '974.22'], ['1675388592', '0.00'], ['1675388628', '825.58'], ['1675388664', '0.00'], ['1675388700', '1717.14'], ['1675388736', '731.61'], ['1675388772', '0.00'], ['1675388808', '827.00'], ['1675388844', '0.00'], ['1675388880', '1456.78'], ['1675388916', '1582.11'], ['1675388952', '0.00'], ['1675388988', '1593.53'], ['1675389024', '0.00'], ['1675389060', '1998.39'], ['1675389096', '1152.64'], ['1675389132', '0.00'], ['1675389168', '1815.25'], ['1675389204', '0.00'], ['1675389240', '750.61'], ['1675389276', '2657.61'], ['1675389312', '0.00'], ['1675389348', '530.86'], ['1675389384', '0.00'], ['1675389420', '2025.08'], ['1675389456', '845.56'], ['1675389492', '0.00'], ['1675389528', '240.97'], ['1675389564', '0.00'], ['1675389600', '1017.67'], ['1675389636', '6476.50'], ['1675389672', '0.00'], ['1675389708', '2147.86'], ['1675389744', '0.00'], ['1675389780', '549.44'], ['1675389816', '2498.28'], ['1675389852', '0.00'], ['1675389888', '4206.39'], ['1675389924', '0.00'], ['1675389960', '723.44'], ['1675389996', '1136.11'], ['1675390032', '0.00'], ['1675390068', '888.81'], ['1675390104', '0.00'], ['1675390140', '703.03'], ['1675390176', '1165.53'], ['1675390212', '0.00'], ['1675390248', '1228.47'], ['1675390284', '0.00'], ['1675390320', '351.61'], ['1675390356', '1252.83'], ['1675390392', '0.00'], ['1675390428', '3394.19'], ['1675390464', '0.00'], ['1675390500', '518.72'], ['1675390536', '1641.56'], ['1675390572', '0.00'], ['1675390608', '1681.31'], ['1675390644', '0.00'], ['1675390680', '1408.06'], ['1675390716', '1708.22'], ['1675390752', '0.00'], ['1675390788', '1518.92'], ['1675390824', '0.00'], ['1675390860', '1812.58'], ['1675390896', '2100.44'], ['1675390932', '0.00'], ['1675390968', '1976.83'], ['1675391004', '0.00'], ['1675391040', '2369.17'], ['1675391076', '3191.67'], ['1675391112', '0.00'], ['1675391148', '1208.31'], ['1675391184', '0.00'], ['1675391220', '1184.75'], ['1675391256', '553.08'], ['1675391292', '0.00'], ['1675391328', '687.31'], ['1675391364', '0.00'], ['1675391400', '2643.67'], ['1675391436', '1695.69'], ['1675391472', '0.00'], ['1675391508', '732.94'], ['1675391544', '0.00'], ['1675391580', '1505.19'], ['1675391616', '2068.92'], ['1675391652', '0.00'], ['1675391688', '1262.72'], ['1675391724', '0.00']],
analysis: {
avg: '976.75',
max: '6476.50',
min: '0.00',
p95: '3191.67'
}
}
}]
},
originalUrl: 'http://192.168.44.55:9999?query=SELECT%20TIME_FLOOR_WITH_FILL%28stat_time%2C%27PT36S%27%2C%27zero%27%29%20AS%20stat_time%2CSUM%28IF%28%20common_egress_link_id%20%3D%202048%2C%20traffic_outbound_byte%2C%200%29%29%20AS%20egress_bytes%2CSUM%28IF%28%20common_ingress_link_id%20%3D%202049%2C%20traffic_inbound_byte%2C%200%29%29%20AS%20ingress_bytes%2CSUM%28IF%28%20common_egress_link_id%20%3D%202048%2C%20traffic_outbound_pkt%2C%200%29%29%20AS%20egress_pkt%2CSUM%28IF%28%20common_ingress_link_id%20%3D%202049%2C%20traffic_inbound_pkt%2C%200%29%29%20AS%20ingress_pkt%2C%28egress_bytes%20%2B%20ingress_bytes%29%20AS%20bytes_total%2C%28egress_pkt%20%2B%20ingress_pkt%29%20AS%20packets_total%20FROM%20metric_link%20WHERE%20stat_time%20%3E%3D%201675388125%20AND%20stat_time%20%3C%201675391725%20%20GROUP%20BY%20stat_time%20ORDER%20BY%20bytes_total%20DESC%20&format=json&option=real-time',
msg: 'OK'
}
},
data2: {
data: {
status: 200,
code: 200,
queryKey: 'a54916e7f363fd065dfaa44ad23d31b5',
success: true,
message: null,
statistics: {
elapsed: 4,
rows_read: 10518,
bytes_read: 1062318,
result_size: 186,
result_rows: 1
},
job: null,
formatType: 'json',
meta: [
{
name: 'total_bytes',
type: 'long',
category: 'Metric'
}, {
name: 'total_packets',
type: 'long',
category: 'Metric'
}, {
name: 'establish_latency_ms',
type: 'double',
category: 'Metric'
}, {
name: 'http_response_latency',
type: 'double',
category: 'Metric'
}, {
name: 'ssl_con_latency',
type: 'double',
category: 'Metric'
}, {
name: 'tcp_lostlen_percent',
type: 'double',
category: 'Metric'
}, {
name: 'pkt_retrans_percent',
type: 'double',
category: 'Metric'
}],
data: {
resultType: 'table',
result: [{
totalBytes: '4426409159',
totalBitsRate: 9836464.8,
totalPackets: '3324302',
establishLatencyMs: 92.9489,
httpResponseLatency: 154.2884,
sslConLatency: 0,
tcpLostlenPercent: 0.0069,
pktRetransPercent: 0.0165
}]
},
originalUrl: 'http://192.168.44.55:9999?query=SELECT%20SUM%28IF%28%20common_egress_link_id%20%3D%201792%2C%20traffic_outbound_byte%2C%200%29%20%2B%20IF%28%20common_ingress_link_id%20%3D%201793%2C%20traffic_inbound_byte%2C%200%29%29%20as%20total_bytes%2CSUM%28IF%28%20common_egress_link_id%20%3D%201792%2C%20traffic_outbound_pkt%2C%200%29%20%2B%20IF%28%20common_ingress_link_id%20%3D%201793%2C%20traffic_inbound_pkt%2C%200%29%29%20AS%20total_packets%2CROUND%28AVG%28avg_establish_latency_ms%29%2C%204%29%20AS%20establish_latency_ms%2CROUND%28AVG%28avg_http_response_latency_ms%29%2C%204%29%20AS%20http_response_latency%2CROUND%28AVG%28avg_ssl_con_latency_ms%29%2C%204%29%20AS%20ssl_con_latency%2CROUND%28AVG%28tcp_lostlen_ratio%29%2C%204%29%20AS%20tcp_lostlen_percent%2CROUND%28AVG%28pkt_retrans_ratio%29%2C%204%29%20AS%20pkt_retrans_percent%20FROM%20metric_link%20WHERE%20stat_time%20%3E%3D%201675403646%20AND%20stat_time%20%3C%201675407246%20&format=json&option=real-time',
msg: 'OK'
}
}
},
empty: {
data1: {
data: {
status: 200,
code: 200,
data: {
resultType: 'table',
result: []
},
msg: 'OK'
}
},
data2: {
data: {
status: 200,
code: 200,
data: {
resultType: 'table',
result: []
},
msg: 'OK'
}
}
},
boundary: {
large: {
data1: {
data: {
status: 200,
code: 200,
data: {
resultType: 'object',
result: [
{
type: 'bytes',
ingressBitsRate: {
values: [['1675388124', '0'], ['1675388160', '4253144'], ['1675388196', '470709.36'], ['1675388232', '0'], ['1675388268', '148192.24'], ['1675388304', '0'], ['1675388340', '577072.48'], ['1675388376', '160431.12'], ['1675388412', '0'], ['1675388448', '1639602.64'], ['1675388484', '0'], ['1675388520', '2074017.36'], ['1675388556', '798924.64'], ['1675388592', '0'], ['1675388628', '884606'], ['1675388664', '0'], ['1675388700', '1373220.48'], ['1675388736', '21305.36'], ['1675388772', '0'], ['1675388808', '1398940.24'], ['1675388844', '0'], ['1675388880', '4474519.52'], ['1675388916', '383473.12'], ['1675388952', '0'], ['1675388988', '582813.36'], ['1675389024', '0'], ['1675389060', '3545078.24'], ['1675389096', '766672'], ['1675389132', '0'], ['1675389168', '2877694'], ['1675389204', '0'], ['1675389240', '2195562.48'], ['1675389276', '2268681.12'], ['1675389312', '0'], ['1675389348', '1438248.88'], ['1675389384', '0'], ['1675389420', '88914.24'], ['1675389456', '363776.24'], ['1675389492', '0'], ['1675389528', '103931.36'], ['1675389564', '0'], ['1675389600', '930861.12'], ['1675389636', '473982.48'], ['1675389672', '0'], ['1675389708', '210004.88'], ['1675389744', '0'], ['1675389780', '764367.52'], ['1675389816', '236745.52'], ['1675389852', '0'], ['1675389888', '199598'], ['1675389924', '0'], ['1675389960', '385563.36'], ['1675389996', '353556.64'], ['1675390032', '0'], ['1675390068', '380246.48'], ['1675390104', '0'], ['1675390140', '456284'], ['1675390176', '2560143.76'], ['1675390212', '0'], ['1675390248', '3806779.36'], ['1675390284', '0'], ['1675390320', '382829.52'], ['1675390356', '225432.48'], ['1675390392', '0'], ['1675390428', '1024283.52'], ['1675390464', '0'], ['1675390500', '494194.88'], ['1675390536', '718094.88'], ['1675390572', '0'], ['1675390608', '373146.64'], ['1675390644', '0'], ['1675390680', '101628.64'], ['1675390716', '977218'], ['1675390752', '0'], ['1675390788', '7263452.48'], ['1675390824', '0'], ['1675390860', '2613115.76'], ['1675390896', '2987862'], ['1675390932', '0'], ['1675390968', '1376989.36'], ['1675391004', '0'], ['1675391040', '2245663.12'], ['1675391076', '602240.64'], ['1675391112', '0'], ['1675391148', '437569.12'], ['1675391184', '0'], ['1675391220', '115680.88'], ['1675391256', '42582.24'], ['1675391292', '0'], ['1675391328', '42002'], ['1675391364', '0'], ['1675391400', '720716'], ['1675391436', '5382.88'], ['1675391472', '0'], ['1675391508', '169074.64'], ['1675391544', '0'], ['1675391580', '1214277.76'], ['1675391616', '1523679.76'], ['1675391652', '0'], ['1675391688', '6382256'], ['1675391724', '0']],
analysis: {
avg: '75687040000000',
max: '7263452.48',
min: '0',
p95: '3545078.24'
}
},
totalBitsRate: {
values: [['1675388124', '0'], ['1675388160', '17581092.48'], ['1675388196', '9918148.64'], ['1675388232', '0'], ['1675388268', '13213336.64'], ['1675388304', '0'], ['1675388340', '41123655.76'], ['1675388376', '14569548.64'], ['1675388412', '0'], ['1675388448', '39157977.52'], ['1675388484', '0'], ['1675388520', '15875735.76'], ['1675388556', '10885102.24'], ['1675388592', '0'], ['1675388628', '8943487.12'], ['1675388664', '0'], ['1675388700', '18985121.76'], ['1675388736', '7659627.36'], ['1675388772', '0'], ['1675388808', '9288266.88'], ['1675388844', '0'], ['1675388880', '15999674.24'], ['1675388916', '16802700.48'], ['1675388952', '0'], ['1675388988', '17836499.52'], ['1675389024', '0'], ['1675389060', '22368492'], ['1675389096', '12570182.88'], ['1675389132', '0'], ['1675389168', '19977345.36'], ['1675389204', '0'], ['1675389240', '7747381.76'], ['1675389276', '29050230.64'], ['1675389312', '0'], ['1675389348', '5834855.36'], ['1675389384', '0'], ['1675389420', '22798420.24'], ['1675389456', '9061622.64'], ['1675389492', '0'], ['1675389528', '2391149.76'], ['1675389564', '0'], ['1675389600', '10752915.76'], ['1675389636', '72671214'], ['1675389672', '0'], ['1675389708', '23536865.76'], ['1675389744', '0'], ['1675389780', '6080925.76'], ['1675389816', '27096624.64'], ['1675389852', '0'], ['1675389888', '47355125.36'], ['1675389924', '0'], ['1675389960', '7525635.52'], ['1675389996', '12312211.76'], ['1675390032', '0'], ['1675390068', '9587065.36'], ['1675390104', '0'], ['1675390140', '7763073.36'], ['1675390176', '12692375.36'], ['1675390212', '0'], ['1675390248', '13007133.76'], ['1675390284', '0'], ['1675390320', '3241344.88'], ['1675390356', '13811041.12'], ['1675390392', '0'], ['1675390428', '38206391.36'], ['1675390464', '0'], ['1675390500', '5489114'], ['1675390536', '17855136.88'], ['1675390572', '0'], ['1675390608', '18409624.48'], ['1675390644', '0'], ['1675390680', '15132633.12'], ['1675390716', '19189583.52'], ['1675390752', '0'], ['1675390788', '16803327.36'], ['1675390824', '0'], ['1675390860', '19972804.88'], ['1675390896', '22541580.48'], ['1675390932', '0'], ['1675390968', '21671364.88'], ['1675391004', '0'], ['1675391040', '25293518.24'], ['1675391076', '34056467.52'], ['1675391112', '0'], ['1675391148', '13181229.76'], ['1675391184', '0'], ['1675391220', '12337126.88'], ['1675391256', '5989032.64'], ['1675391292', '0'], ['1675391328', '7393281.36'], ['1675391364', '0'], ['1675391400', '29175007.36'], ['1675391436', '17228925.76'], ['1675391472', '0'], ['1675391508', '7375468'], ['1675391544', '0'], ['1675391580', '16675685.76'], ['1675391616', '22908316'], ['1675391652', '0'], ['1675391688', '13867890.88'], ['1675391724', '0']],
analysis: {
avg: '10578267.2',
max: '72671214',
min: '0',
p95: '34056467.52'
}
},
egressBitsRate: {
values: [['1675388124', '0'], ['1675388160', '13327948.48'], ['1675388196', '9447439.36'], ['1675388232', '0'], ['1675388268', '13065144.48'], ['1675388304', '0'], ['1675388340', '40546583.36'], ['1675388376', '14409117.52'], ['1675388412', '0'], ['1675388448', '37518374.88'], ['1675388484', '0'], ['1675388520', '13801718.48'], ['1675388556', '10086177.52'], ['1675388592', '0'], ['1675388628', '8058881.12'], ['1675388664', '0'], ['1675388700', '17611901.36'], ['1675388736', '7638322'], ['1675388772', '0'], ['1675388808', '7889326.64'], ['1675388844', '0'], ['1675388880', '11525154.64'], ['1675388916', '16419227.36'], ['1675388952', '0'], ['1675388988', '17253686.24'], ['1675389024', '0'], ['1675389060', '18823413.76'], ['1675389096', '11803510.88'], ['1675389132', '0'], ['1675389168', '17099651.36'], ['1675389204', '0'], ['1675389240', '5551819.36'], ['1675389276', '26781549.52'], ['1675389312', '0'], ['1675389348', '4396606.48'], ['1675389384', '0'], ['1675389420', '22709506'], ['1675389456', '8697846.48'], ['1675389492', '0'], ['1675389528', '2287218.48'], ['1675389564', '0'], ['1675389600', '9822054.64'], ['1675389636', '72197231.52'], ['1675389672', '0'], ['1675389708', '23326860.88'], ['1675389744', '0'], ['1675389780', '5316558.24'], ['1675389816', '26859879.12'], ['1675389852', '0'], ['1675389888', '47155527.36'], ['1675389924', '0'], ['1675389960', '7140072.24'], ['1675389996', '11958655.12'], ['1675390032', '0'], ['1675390068', '9206818.88'], ['1675390104', '0'], ['1675390140', '7306789.36'], ['1675390176', '10132231.52'], ['1675390212', '0'], ['1675390248', '9200354.48'], ['1675390284', '0'], ['1675390320', '2858515.36'], ['1675390356', '13585608.64'], ['1675390392', '0'], ['1675390428', '37182107.76'], ['1675390464', '0'], ['1675390500', '4994919.12'], ['1675390536', '17137042'], ['1675390572', '0'], ['1675390608', '18036477.76'], ['1675390644', '0'], ['1675390680', '15031004.48'], ['1675390716', '18212365.52'], ['1675390752', '0'], ['1675390788', '9539874.88'], ['1675390824', '0'], ['1675390860', '17359689.12'], ['1675390896', '19553718.48'], ['1675390932', '0'], ['1675390968', '20294375.52'], ['1675391004', '0'], ['1675391040', '23047855.12'], ['1675391076', '33454226.88'], ['1675391112', '0'], ['1675391148', '12743660.64'], ['1675391184', '0'], ['1675391220', '12221446'], ['1675391256', '5946450.48'], ['1675391292', '0'], ['1675391328', '7351279.36'], ['1675391364', '0'], ['1675391400', '28454291.36'], ['1675391436', '17223542.88'], ['1675391472', '0'], ['1675391508', '7206393.36'], ['1675391544', '0'], ['1675391580', '15461408'], ['1675391616', '21384636.24'], ['1675391652', '0'], ['1675391688', '7485634.88'], ['1675391724', '0']],
analysis: {
avg: '9821396.8',
max: '72197231.52',
min: '0',
p95: '33454226.88'
}
}
},
{
type: 'packets',
ingressPacketsRate: {
values: [['1675388124', '0.00'], ['1675388160', '382.61'], ['1675388196', '44.67'], ['1675388232', '0.00'], ['1675388268', '23.64'], ['1675388304', '0.00'], ['1675388340', '53.75'], ['1675388376', '34.89'], ['1675388412', '0.00'], ['1675388448', '155.25'], ['1675388484', '0.00'], ['1675388520', '186.17'], ['1675388556', '77.81'], ['1675388592', '0.00'], ['1675388628', '84.75'], ['1675388664', '0.00'], ['1675388700', '140.39'], ['1675388736', '9.69'], ['1675388772', '0.00'], ['1675388808', '126.83'], ['1675388844', '0.00'], ['1675388880', '398.50'], ['1675388916', '94.92'], ['1675388952', '0.00'], ['1675388988', '57.33'], ['1675389024', '0.00'], ['1675389060', '326.89'], ['1675389096', '69.06'], ['1675389132', '0.00'], ['1675389168', '253.61'], ['1675389204', '0.00'], ['1675389240', '201.11'], ['1675389276', '203.14'], ['1675389312', '0.00'], ['1675389348', '126.33'], ['1675389384', '0.00'], ['1675389420', '13.86'], ['1675389456', '34.81'], ['1675389492', '0.00'], ['1675389528', '12.47'], ['1675389564', '0.00'], ['1675389600', '107.08'], ['1675389636', '54.39'], ['1675389672', '0.00'], ['1675389708', '24.42'], ['1675389744', '0.00'], ['1675389780', '67.47'], ['1675389816', '35.94'], ['1675389852', '0.00'], ['1675389888', '22.44'], ['1675389924', '0.00'], ['1675389960', '45.64'], ['1675389996', '32.81'], ['1675390032', '0.00'], ['1675390068', '37.72'], ['1675390104', '0.00'], ['1675390140', '43.69'], ['1675390176', '228.97'], ['1675390212', '0.00'], ['1675390248', '392.69'], ['1675390284', '0.00'], ['1675390320', '55.33'], ['1675390356', '47.44'], ['1675390392', '0.00'], ['1675390428', '106.06'], ['1675390464', '0.00'], ['1675390500', '47.58'], ['1675390536', '64.56'], ['1675390572', '0.00'], ['1675390608', '35.94'], ['1675390644', '0.00'], ['1675390680', '17.31'], ['1675390716', '95.47'], ['1675390752', '0.00'], ['1675390788', '638.00'], ['1675390824', '0.00'], ['1675390860', '239.11'], ['1675390896', '290.89'], ['1675390932', '0.00'], ['1675390968', '129.31'], ['1675391004', '0.00'], ['1675391040', '208.83'], ['1675391076', '65.31'], ['1675391112', '0.00'], ['1675391148', '42.17'], ['1675391184', '0.00'], ['1675391220', '17.94'], ['1675391256', '14.33'], ['1675391292', '0.00'], ['1675391328', '6.31'], ['1675391364', '0.00'], ['1675391400', '62.83'], ['1675391436', '2.53'], ['1675391472', '0.00'], ['1675391508', '37.06'], ['1675391544', '0.00'], ['1675391580', '110.00'], ['1675391616', '148.53'], ['1675391652', '0.00'], ['1675391688', '583.64'], ['1675391724', '0.00']],
analysis: {
avg: '727200000',
max: '638.00',
min: '0.00',
p95: '326.89'
}
},
egressPacketsRate: {
values: [['1675388124', '0.00'], ['1675388160', '1835.75'], ['1675388196', '865.61'], ['1675388232', '0.00'], ['1675388268', '1202.69'], ['1675388304', '0.00'], ['1675388340', '3864.69'], ['1675388376', '1428.56'], ['1675388412', '0.00'], ['1675388448', '3433.61'], ['1675388484', '0.00'], ['1675388520', '1228.06'], ['1675388556', '896.42'], ['1675388592', '0.00'], ['1675388628', '740.83'], ['1675388664', '0.00'], ['1675388700', '1576.75'], ['1675388736', '721.92'], ['1675388772', '0.00'], ['1675388808', '700.17'], ['1675388844', '0.00'], ['1675388880', '1058.28'], ['1675388916', '1487.19'], ['1675388952', '0.00'], ['1675388988', '1536.19'], ['1675389024', '0.00'], ['1675389060', '1671.50'], ['1675389096', '1083.58'], ['1675389132', '0.00'], ['1675389168', '1561.64'], ['1675389204', '0.00'], ['1675389240', '549.50'], ['1675389276', '2454.47'], ['1675389312', '0.00'], ['1675389348', '404.53'], ['1675389384', '0.00'], ['1675389420', '2011.22'], ['1675389456', '810.75'], ['1675389492', '0.00'], ['1675389528', '228.50'], ['1675389564', '0.00'], ['1675389600', '910.58'], ['1675389636', '6422.11'], ['1675389672', '0.00'], ['1675389708', '2123.44'], ['1675389744', '0.00'], ['1675389780', '481.97'], ['1675389816', '2462.33'], ['1675389852', '0.00'], ['1675389888', '4183.94'], ['1675389924', '0.00'], ['1675389960', '677.81'], ['1675389996', '1103.31'], ['1675390032', '0.00'], ['1675390068', '851.08'], ['1675390104', '0.00'], ['1675390140', '659.33'], ['1675390176', '936.56'], ['1675390212', '0.00'], ['1675390248', '835.78'], ['1675390284', '0.00'], ['1675390320', '296.28'], ['1675390356', '1205.39'], ['1675390392', '0.00'], ['1675390428', '3288.14'], ['1675390464', '0.00'], ['1675390500', '471.14'], ['1675390536', '1577.00'], ['1675390572', '0.00'], ['1675390608', '1645.36'], ['1675390644', '0.00'], ['1675390680', '1390.75'], ['1675390716', '1612.75'], ['1675390752', '0.00'], ['1675390788', '880.92'], ['1675390824', '0.00'], ['1675390860', '1573.47'], ['1675390896', '1809.56'], ['1675390932', '0.00'], ['1675390968', '1847.53'], ['1675391004', '0.00'], ['1675391040', '2160.33'], ['1675391076', '3126.36'], ['1675391112', '0.00'], ['1675391148', '1166.14'], ['1675391184', '0.00'], ['1675391220', '1166.81'], ['1675391256', '538.75'], ['1675391292', '0.00'], ['1675391328', '681.00'], ['1675391364', '0.00'], ['1675391400', '2580.83'], ['1675391436', '1693.17'], ['1675391472', '0.00'], ['1675391508', '695.89'], ['1675391544', '0.00'], ['1675391580', '1395.19'], ['1675391616', '1920.39'], ['1675391652', '0.00'], ['1675391688', '679.08'], ['1675391724', '0.00']],
analysis: {
avg: '904030000000',
max: '6422.11',
min: '0.00',
p95: '3126.36'
}
},
totalPacketsRate: {
values: [['1675388124', '0.00'], ['1675388160', '2218.36'], ['1675388196', '910.28'], ['1675388232', '0.00'], ['1675388268', '1226.33'], ['1675388304', '0.00'], ['1675388340', '3918.44'], ['1675388376', '1463.44'], ['1675388412', '0.00'], ['1675388448', '3588.86'], ['1675388484', '0.00'], ['1675388520', '1414.22'], ['1675388556', '974.22'], ['1675388592', '0.00'], ['1675388628', '825.58'], ['1675388664', '0.00'], ['1675388700', '1717.14'], ['1675388736', '731.61'], ['1675388772', '0.00'], ['1675388808', '827.00'], ['1675388844', '0.00'], ['1675388880', '1456.78'], ['1675388916', '1582.11'], ['1675388952', '0.00'], ['1675388988', '1593.53'], ['1675389024', '0.00'], ['1675389060', '1998.39'], ['1675389096', '1152.64'], ['1675389132', '0.00'], ['1675389168', '1815.25'], ['1675389204', '0.00'], ['1675389240', '750.61'], ['1675389276', '2657.61'], ['1675389312', '0.00'], ['1675389348', '530.86'], ['1675389384', '0.00'], ['1675389420', '2025.08'], ['1675389456', '845.56'], ['1675389492', '0.00'], ['1675389528', '240.97'], ['1675389564', '0.00'], ['1675389600', '1017.67'], ['1675389636', '6476.50'], ['1675389672', '0.00'], ['1675389708', '2147.86'], ['1675389744', '0.00'], ['1675389780', '549.44'], ['1675389816', '2498.28'], ['1675389852', '0.00'], ['1675389888', '4206.39'], ['1675389924', '0.00'], ['1675389960', '723.44'], ['1675389996', '1136.11'], ['1675390032', '0.00'], ['1675390068', '888.81'], ['1675390104', '0.00'], ['1675390140', '703.03'], ['1675390176', '1165.53'], ['1675390212', '0.00'], ['1675390248', '1228.47'], ['1675390284', '0.00'], ['1675390320', '351.61'], ['1675390356', '1252.83'], ['1675390392', '0.00'], ['1675390428', '3394.19'], ['1675390464', '0.00'], ['1675390500', '518.72'], ['1675390536', '1641.56'], ['1675390572', '0.00'], ['1675390608', '1681.31'], ['1675390644', '0.00'], ['1675390680', '1408.06'], ['1675390716', '1708.22'], ['1675390752', '0.00'], ['1675390788', '1518.92'], ['1675390824', '0.00'], ['1675390860', '1812.58'], ['1675390896', '2100.44'], ['1675390932', '0.00'], ['1675390968', '1976.83'], ['1675391004', '0.00'], ['1675391040', '2369.17'], ['1675391076', '3191.67'], ['1675391112', '0.00'], ['1675391148', '1208.31'], ['1675391184', '0.00'], ['1675391220', '1184.75'], ['1675391256', '553.08'], ['1675391292', '0.00'], ['1675391328', '687.31'], ['1675391364', '0.00'], ['1675391400', '2643.67'], ['1675391436', '1695.69'], ['1675391472', '0.00'], ['1675391508', '732.94'], ['1675391544', '0.00'], ['1675391580', '1505.19'], ['1675391616', '2068.92'], ['1675391652', '0.00'], ['1675391688', '1262.72'], ['1675391724', '0.00']],
analysis: {
avg: '976750000000',
max: '6476.50',
min: '0.00',
p95: '3191.67'
}
}
}]
}
}
},
data2: {
data: {
status: 200,
code: 200,
data: {
resultType: 'table',
result: [{
totalBytes: '4426409159',
totalBitsRate: 983646480,
totalPackets: '3324302',
establishLatencyMs: 9294.89,
httpResponseLatency: 154.2884,
sslConLatency: 90,
tcpLostlenPercent: 0.69,
pktRetransPercent: 0.165
}]
}
}
}
},
zero: {
data1: {
data: {
status: 200,
code: 200,
data: {
resultType: 'object',
result: [
{
type: 'bytes',
ingressBitsRate: {
values: [['1675388124', '0'], ['1675388160', '4253144'], ['1675388196', '470709.36'], ['1675388232', '0'], ['1675388268', '148192.24'], ['1675388304', '0'], ['1675388340', '577072.48'], ['1675388376', '160431.12'], ['1675388412', '0'], ['1675388448', '1639602.64'], ['1675388484', '0'], ['1675388520', '2074017.36'], ['1675388556', '798924.64'], ['1675388592', '0'], ['1675388628', '884606'], ['1675388664', '0'], ['1675388700', '1373220.48'], ['1675388736', '21305.36'], ['1675388772', '0'], ['1675388808', '1398940.24'], ['1675388844', '0'], ['1675388880', '4474519.52'], ['1675388916', '383473.12'], ['1675388952', '0'], ['1675388988', '582813.36'], ['1675389024', '0'], ['1675389060', '3545078.24'], ['1675389096', '766672'], ['1675389132', '0'], ['1675389168', '2877694'], ['1675389204', '0'], ['1675389240', '2195562.48'], ['1675389276', '2268681.12'], ['1675389312', '0'], ['1675389348', '1438248.88'], ['1675389384', '0'], ['1675389420', '88914.24'], ['1675389456', '363776.24'], ['1675389492', '0'], ['1675389528', '103931.36'], ['1675389564', '0'], ['1675389600', '930861.12'], ['1675389636', '473982.48'], ['1675389672', '0'], ['1675389708', '210004.88'], ['1675389744', '0'], ['1675389780', '764367.52'], ['1675389816', '236745.52'], ['1675389852', '0'], ['1675389888', '199598'], ['1675389924', '0'], ['1675389960', '385563.36'], ['1675389996', '353556.64'], ['1675390032', '0'], ['1675390068', '380246.48'], ['1675390104', '0'], ['1675390140', '456284'], ['1675390176', '2560143.76'], ['1675390212', '0'], ['1675390248', '3806779.36'], ['1675390284', '0'], ['1675390320', '382829.52'], ['1675390356', '225432.48'], ['1675390392', '0'], ['1675390428', '1024283.52'], ['1675390464', '0'], ['1675390500', '494194.88'], ['1675390536', '718094.88'], ['1675390572', '0'], ['1675390608', '373146.64'], ['1675390644', '0'], ['1675390680', '101628.64'], ['1675390716', '977218'], ['1675390752', '0'], ['1675390788', '7263452.48'], ['1675390824', '0'], ['1675390860', '2613115.76'], ['1675390896', '2987862'], ['1675390932', '0'], ['1675390968', '1376989.36'], ['1675391004', '0'], ['1675391040', '2245663.12'], ['1675391076', '602240.64'], ['1675391112', '0'], ['1675391148', '437569.12'], ['1675391184', '0'], ['1675391220', '115680.88'], ['1675391256', '42582.24'], ['1675391292', '0'], ['1675391328', '42002'], ['1675391364', '0'], ['1675391400', '720716'], ['1675391436', '5382.88'], ['1675391472', '0'], ['1675391508', '169074.64'], ['1675391544', '0'], ['1675391580', '1214277.76'], ['1675391616', '1523679.76'], ['1675391652', '0'], ['1675391688', '6382256'], ['1675391724', '0']],
analysis: {
avg: '0.00',
max: '0.00',
min: '0',
p95: '3545078.24'
}
},
totalBitsRate: {
values: [['1675388124', '0'], ['1675388160', '17581092.48'], ['1675388196', '9918148.64'], ['1675388232', '0'], ['1675388268', '13213336.64'], ['1675388304', '0'], ['1675388340', '41123655.76'], ['1675388376', '14569548.64'], ['1675388412', '0'], ['1675388448', '39157977.52'], ['1675388484', '0'], ['1675388520', '15875735.76'], ['1675388556', '10885102.24'], ['1675388592', '0'], ['1675388628', '8943487.12'], ['1675388664', '0'], ['1675388700', '18985121.76'], ['1675388736', '7659627.36'], ['1675388772', '0'], ['1675388808', '9288266.88'], ['1675388844', '0'], ['1675388880', '15999674.24'], ['1675388916', '16802700.48'], ['1675388952', '0'], ['1675388988', '17836499.52'], ['1675389024', '0'], ['1675389060', '22368492'], ['1675389096', '12570182.88'], ['1675389132', '0'], ['1675389168', '19977345.36'], ['1675389204', '0'], ['1675389240', '7747381.76'], ['1675389276', '29050230.64'], ['1675389312', '0'], ['1675389348', '5834855.36'], ['1675389384', '0'], ['1675389420', '22798420.24'], ['1675389456', '9061622.64'], ['1675389492', '0'], ['1675389528', '2391149.76'], ['1675389564', '0'], ['1675389600', '10752915.76'], ['1675389636', '72671214'], ['1675389672', '0'], ['1675389708', '23536865.76'], ['1675389744', '0'], ['1675389780', '6080925.76'], ['1675389816', '27096624.64'], ['1675389852', '0'], ['1675389888', '47355125.36'], ['1675389924', '0'], ['1675389960', '7525635.52'], ['1675389996', '12312211.76'], ['1675390032', '0'], ['1675390068', '9587065.36'], ['1675390104', '0'], ['1675390140', '7763073.36'], ['1675390176', '12692375.36'], ['1675390212', '0'], ['1675390248', '13007133.76'], ['1675390284', '0'], ['1675390320', '3241344.88'], ['1675390356', '13811041.12'], ['1675390392', '0'], ['1675390428', '38206391.36'], ['1675390464', '0'], ['1675390500', '5489114'], ['1675390536', '17855136.88'], ['1675390572', '0'], ['1675390608', '18409624.48'], ['1675390644', '0'], ['1675390680', '15132633.12'], ['1675390716', '19189583.52'], ['1675390752', '0'], ['1675390788', '16803327.36'], ['1675390824', '0'], ['1675390860', '19972804.88'], ['1675390896', '22541580.48'], ['1675390932', '0'], ['1675390968', '21671364.88'], ['1675391004', '0'], ['1675391040', '25293518.24'], ['1675391076', '34056467.52'], ['1675391112', '0'], ['1675391148', '13181229.76'], ['1675391184', '0'], ['1675391220', '12337126.88'], ['1675391256', '5989032.64'], ['1675391292', '0'], ['1675391328', '7393281.36'], ['1675391364', '0'], ['1675391400', '29175007.36'], ['1675391436', '17228925.76'], ['1675391472', '0'], ['1675391508', '7375468'], ['1675391544', '0'], ['1675391580', '16675685.76'], ['1675391616', '22908316'], ['1675391652', '0'], ['1675391688', '13867890.88'], ['1675391724', '0']],
analysis: {
avg: '0.00',
max: '0.00',
min: '0',
p95: '34056467.52'
}
},
egressBitsRate: {
values: [['1675388124', '0'], ['1675388160', '13327948.48'], ['1675388196', '9447439.36'], ['1675388232', '0'], ['1675388268', '13065144.48'], ['1675388304', '0'], ['1675388340', '40546583.36'], ['1675388376', '14409117.52'], ['1675388412', '0'], ['1675388448', '37518374.88'], ['1675388484', '0'], ['1675388520', '13801718.48'], ['1675388556', '10086177.52'], ['1675388592', '0'], ['1675388628', '8058881.12'], ['1675388664', '0'], ['1675388700', '17611901.36'], ['1675388736', '7638322'], ['1675388772', '0'], ['1675388808', '7889326.64'], ['1675388844', '0'], ['1675388880', '11525154.64'], ['1675388916', '16419227.36'], ['1675388952', '0'], ['1675388988', '17253686.24'], ['1675389024', '0'], ['1675389060', '18823413.76'], ['1675389096', '11803510.88'], ['1675389132', '0'], ['1675389168', '17099651.36'], ['1675389204', '0'], ['1675389240', '5551819.36'], ['1675389276', '26781549.52'], ['1675389312', '0'], ['1675389348', '4396606.48'], ['1675389384', '0'], ['1675389420', '22709506'], ['1675389456', '8697846.48'], ['1675389492', '0'], ['1675389528', '2287218.48'], ['1675389564', '0'], ['1675389600', '9822054.64'], ['1675389636', '72197231.52'], ['1675389672', '0'], ['1675389708', '23326860.88'], ['1675389744', '0'], ['1675389780', '5316558.24'], ['1675389816', '26859879.12'], ['1675389852', '0'], ['1675389888', '47155527.36'], ['1675389924', '0'], ['1675389960', '7140072.24'], ['1675389996', '11958655.12'], ['1675390032', '0'], ['1675390068', '9206818.88'], ['1675390104', '0'], ['1675390140', '7306789.36'], ['1675390176', '10132231.52'], ['1675390212', '0'], ['1675390248', '9200354.48'], ['1675390284', '0'], ['1675390320', '2858515.36'], ['1675390356', '13585608.64'], ['1675390392', '0'], ['1675390428', '37182107.76'], ['1675390464', '0'], ['1675390500', '4994919.12'], ['1675390536', '17137042'], ['1675390572', '0'], ['1675390608', '18036477.76'], ['1675390644', '0'], ['1675390680', '15031004.48'], ['1675390716', '18212365.52'], ['1675390752', '0'], ['1675390788', '9539874.88'], ['1675390824', '0'], ['1675390860', '17359689.12'], ['1675390896', '19553718.48'], ['1675390932', '0'], ['1675390968', '20294375.52'], ['1675391004', '0'], ['1675391040', '23047855.12'], ['1675391076', '33454226.88'], ['1675391112', '0'], ['1675391148', '12743660.64'], ['1675391184', '0'], ['1675391220', '12221446'], ['1675391256', '5946450.48'], ['1675391292', '0'], ['1675391328', '7351279.36'], ['1675391364', '0'], ['1675391400', '28454291.36'], ['1675391436', '17223542.88'], ['1675391472', '0'], ['1675391508', '7206393.36'], ['1675391544', '0'], ['1675391580', '15461408'], ['1675391616', '21384636.24'], ['1675391652', '0'], ['1675391688', '7485634.88'], ['1675391724', '0']],
analysis: {
avg: '0.00',
max: '0.00',
min: '0',
p95: '33454226.88'
}
}
},
{
type: 'packets',
ingressPacketsRate: {
values: [['1675388124', '0.00'], ['1675388160', '382.61'], ['1675388196', '44.67'], ['1675388232', '0.00'], ['1675388268', '23.64'], ['1675388304', '0.00'], ['1675388340', '53.75'], ['1675388376', '34.89'], ['1675388412', '0.00'], ['1675388448', '155.25'], ['1675388484', '0.00'], ['1675388520', '186.17'], ['1675388556', '77.81'], ['1675388592', '0.00'], ['1675388628', '84.75'], ['1675388664', '0.00'], ['1675388700', '140.39'], ['1675388736', '9.69'], ['1675388772', '0.00'], ['1675388808', '126.83'], ['1675388844', '0.00'], ['1675388880', '398.50'], ['1675388916', '94.92'], ['1675388952', '0.00'], ['1675388988', '57.33'], ['1675389024', '0.00'], ['1675389060', '326.89'], ['1675389096', '69.06'], ['1675389132', '0.00'], ['1675389168', '253.61'], ['1675389204', '0.00'], ['1675389240', '201.11'], ['1675389276', '203.14'], ['1675389312', '0.00'], ['1675389348', '126.33'], ['1675389384', '0.00'], ['1675389420', '13.86'], ['1675389456', '34.81'], ['1675389492', '0.00'], ['1675389528', '12.47'], ['1675389564', '0.00'], ['1675389600', '107.08'], ['1675389636', '54.39'], ['1675389672', '0.00'], ['1675389708', '24.42'], ['1675389744', '0.00'], ['1675389780', '67.47'], ['1675389816', '35.94'], ['1675389852', '0.00'], ['1675389888', '22.44'], ['1675389924', '0.00'], ['1675389960', '45.64'], ['1675389996', '32.81'], ['1675390032', '0.00'], ['1675390068', '37.72'], ['1675390104', '0.00'], ['1675390140', '43.69'], ['1675390176', '228.97'], ['1675390212', '0.00'], ['1675390248', '392.69'], ['1675390284', '0.00'], ['1675390320', '55.33'], ['1675390356', '47.44'], ['1675390392', '0.00'], ['1675390428', '106.06'], ['1675390464', '0.00'], ['1675390500', '47.58'], ['1675390536', '64.56'], ['1675390572', '0.00'], ['1675390608', '35.94'], ['1675390644', '0.00'], ['1675390680', '17.31'], ['1675390716', '95.47'], ['1675390752', '0.00'], ['1675390788', '638.00'], ['1675390824', '0.00'], ['1675390860', '239.11'], ['1675390896', '290.89'], ['1675390932', '0.00'], ['1675390968', '129.31'], ['1675391004', '0.00'], ['1675391040', '208.83'], ['1675391076', '65.31'], ['1675391112', '0.00'], ['1675391148', '42.17'], ['1675391184', '0.00'], ['1675391220', '17.94'], ['1675391256', '14.33'], ['1675391292', '0.00'], ['1675391328', '6.31'], ['1675391364', '0.00'], ['1675391400', '62.83'], ['1675391436', '2.53'], ['1675391472', '0.00'], ['1675391508', '37.06'], ['1675391544', '0.00'], ['1675391580', '110.00'], ['1675391616', '148.53'], ['1675391652', '0.00'], ['1675391688', '583.64'], ['1675391724', '0.00']],
analysis: {
avg: '0.00',
max: '0.00',
min: '0.00',
p95: '326.89'
}
},
egressPacketsRate: {
values: [['1675388124', '0.00'], ['1675388160', '1835.75'], ['1675388196', '865.61'], ['1675388232', '0.00'], ['1675388268', '1202.69'], ['1675388304', '0.00'], ['1675388340', '3864.69'], ['1675388376', '1428.56'], ['1675388412', '0.00'], ['1675388448', '3433.61'], ['1675388484', '0.00'], ['1675388520', '1228.06'], ['1675388556', '896.42'], ['1675388592', '0.00'], ['1675388628', '740.83'], ['1675388664', '0.00'], ['1675388700', '1576.75'], ['1675388736', '721.92'], ['1675388772', '0.00'], ['1675388808', '700.17'], ['1675388844', '0.00'], ['1675388880', '1058.28'], ['1675388916', '1487.19'], ['1675388952', '0.00'], ['1675388988', '1536.19'], ['1675389024', '0.00'], ['1675389060', '1671.50'], ['1675389096', '1083.58'], ['1675389132', '0.00'], ['1675389168', '1561.64'], ['1675389204', '0.00'], ['1675389240', '549.50'], ['1675389276', '2454.47'], ['1675389312', '0.00'], ['1675389348', '404.53'], ['1675389384', '0.00'], ['1675389420', '2011.22'], ['1675389456', '810.75'], ['1675389492', '0.00'], ['1675389528', '228.50'], ['1675389564', '0.00'], ['1675389600', '910.58'], ['1675389636', '6422.11'], ['1675389672', '0.00'], ['1675389708', '2123.44'], ['1675389744', '0.00'], ['1675389780', '481.97'], ['1675389816', '2462.33'], ['1675389852', '0.00'], ['1675389888', '4183.94'], ['1675389924', '0.00'], ['1675389960', '677.81'], ['1675389996', '1103.31'], ['1675390032', '0.00'], ['1675390068', '851.08'], ['1675390104', '0.00'], ['1675390140', '659.33'], ['1675390176', '936.56'], ['1675390212', '0.00'], ['1675390248', '835.78'], ['1675390284', '0.00'], ['1675390320', '296.28'], ['1675390356', '1205.39'], ['1675390392', '0.00'], ['1675390428', '3288.14'], ['1675390464', '0.00'], ['1675390500', '471.14'], ['1675390536', '1577.00'], ['1675390572', '0.00'], ['1675390608', '1645.36'], ['1675390644', '0.00'], ['1675390680', '1390.75'], ['1675390716', '1612.75'], ['1675390752', '0.00'], ['1675390788', '880.92'], ['1675390824', '0.00'], ['1675390860', '1573.47'], ['1675390896', '1809.56'], ['1675390932', '0.00'], ['1675390968', '1847.53'], ['1675391004', '0.00'], ['1675391040', '2160.33'], ['1675391076', '3126.36'], ['1675391112', '0.00'], ['1675391148', '1166.14'], ['1675391184', '0.00'], ['1675391220', '1166.81'], ['1675391256', '538.75'], ['1675391292', '0.00'], ['1675391328', '681.00'], ['1675391364', '0.00'], ['1675391400', '2580.83'], ['1675391436', '1693.17'], ['1675391472', '0.00'], ['1675391508', '695.89'], ['1675391544', '0.00'], ['1675391580', '1395.19'], ['1675391616', '1920.39'], ['1675391652', '0.00'], ['1675391688', '679.08'], ['1675391724', '0.00']],
analysis: {
avg: '0.00',
max: '0.00',
min: '0.00',
p95: '3126.36'
}
},
totalPacketsRate: {
values: [['1675388124', '0.00'], ['1675388160', '2218.36'], ['1675388196', '910.28'], ['1675388232', '0.00'], ['1675388268', '1226.33'], ['1675388304', '0.00'], ['1675388340', '3918.44'], ['1675388376', '1463.44'], ['1675388412', '0.00'], ['1675388448', '3588.86'], ['1675388484', '0.00'], ['1675388520', '1414.22'], ['1675388556', '974.22'], ['1675388592', '0.00'], ['1675388628', '825.58'], ['1675388664', '0.00'], ['1675388700', '1717.14'], ['1675388736', '731.61'], ['1675388772', '0.00'], ['1675388808', '827.00'], ['1675388844', '0.00'], ['1675388880', '1456.78'], ['1675388916', '1582.11'], ['1675388952', '0.00'], ['1675388988', '1593.53'], ['1675389024', '0.00'], ['1675389060', '1998.39'], ['1675389096', '1152.64'], ['1675389132', '0.00'], ['1675389168', '1815.25'], ['1675389204', '0.00'], ['1675389240', '750.61'], ['1675389276', '2657.61'], ['1675389312', '0.00'], ['1675389348', '530.86'], ['1675389384', '0.00'], ['1675389420', '2025.08'], ['1675389456', '845.56'], ['1675389492', '0.00'], ['1675389528', '240.97'], ['1675389564', '0.00'], ['1675389600', '1017.67'], ['1675389636', '6476.50'], ['1675389672', '0.00'], ['1675389708', '2147.86'], ['1675389744', '0.00'], ['1675389780', '549.44'], ['1675389816', '2498.28'], ['1675389852', '0.00'], ['1675389888', '4206.39'], ['1675389924', '0.00'], ['1675389960', '723.44'], ['1675389996', '1136.11'], ['1675390032', '0.00'], ['1675390068', '888.81'], ['1675390104', '0.00'], ['1675390140', '703.03'], ['1675390176', '1165.53'], ['1675390212', '0.00'], ['1675390248', '1228.47'], ['1675390284', '0.00'], ['1675390320', '351.61'], ['1675390356', '1252.83'], ['1675390392', '0.00'], ['1675390428', '3394.19'], ['1675390464', '0.00'], ['1675390500', '518.72'], ['1675390536', '1641.56'], ['1675390572', '0.00'], ['1675390608', '1681.31'], ['1675390644', '0.00'], ['1675390680', '1408.06'], ['1675390716', '1708.22'], ['1675390752', '0.00'], ['1675390788', '1518.92'], ['1675390824', '0.00'], ['1675390860', '1812.58'], ['1675390896', '2100.44'], ['1675390932', '0.00'], ['1675390968', '1976.83'], ['1675391004', '0.00'], ['1675391040', '2369.17'], ['1675391076', '3191.67'], ['1675391112', '0.00'], ['1675391148', '1208.31'], ['1675391184', '0.00'], ['1675391220', '1184.75'], ['1675391256', '553.08'], ['1675391292', '0.00'], ['1675391328', '687.31'], ['1675391364', '0.00'], ['1675391400', '2643.67'], ['1675391436', '1695.69'], ['1675391472', '0.00'], ['1675391508', '732.94'], ['1675391544', '0.00'], ['1675391580', '1505.19'], ['1675391616', '2068.92'], ['1675391652', '0.00'], ['1675391688', '1262.72'], ['1675391724', '0.00']],
analysis: {
avg: '0.00',
max: '0.00',
min: '0.00',
p95: '3191.67'
}
}
}]
}
}
},
data2: {
data: {
status: 200,
code: 200,
data: {
resultType: 'table',
result: [{
totalBytes: '4426409159',
totalBitsRate: 983646480,
totalPackets: '3324302',
establishLatencyMs: 9294.89,
httpResponseLatency: 154.2884,
sslConLatency: 90,
tcpLostlenPercent: 0.69,
pktRetransPercent: 0.165
}]
}
}
}
}
}
}

File diff suppressed because one or more lines are too long

View File

@@ -1,28 +1,38 @@
import NetworkOverviewDdosDetection from '@/views/charts2/charts/networkOverview/NetworkOverviewDdosDetection'
import { mount } from '@vue/test-utils'
import axios from 'axios'
import { mockData } from './mockData/NetworkOverviewDdosDetection'
const mockGet = {
data: { status: 200, code: 200, queryKey: 'dec6723e173e8fa2b00917dc597bfb27', success: true, message: null, statistics: { elapsed: 0, rows_read: 2, result_size: 58, result_rows: 1 }, job: null, formatType: 'json', meta: [{ name: 'attack_event_count', type: 'long', category: 'Metric' }, { name: 'attacker_count', type: 'long', category: 'Metric' }, { name: 'victim_count', type: 'long', category: 'Metric' }], data: { resultType: 'object', result: [{ attackEventCount: 1200000, attackerCount: 2687878, victimCount: 36676767 }] }, originalUrl: 'http://192.168.44.55:9999?query=SELECT%20COUNT%28*%29%20AS%20attack_event_count%2C%20COUNT%28DISTINCT%28offender_ip%29%29%20AS%20attacker_count%2C%20COUNT%28DISTINCT%28victim_ip%29%29%20AS%20victim_count%20FROM%20security_event%20WHERE%20start_time%20%3E%3D%201675043912%20AND%20start_time%20%3C%201675047512%20AND%20security_type%20%3D%20%27ddos%27&format=json&option=real-time', msg: 'OK' }
}
const mockGet = mockData.common
const timeFilter = {
dateRangeValue: -1,
startTime: 1675043912,
endTime: 1675047512
}
let wrapper = null
describe('views/charts2/charts/networkOverview/NetworkOverviewDdosDetection.vue测试', () => {
test('攻击、受害、攻击数事件ddos检测图', async () => {
/**
* 进行axios请求并挂载vue实例
* @param data
*/
function axiosPostAndMounted (data) {
require('vue-router').useRoute.mockReturnValue({ query: {} })
// 模拟 axios 返回数据
axios.get.mockResolvedValue(mockGet)
const _data = data || mockGet
axios.get.mockResolvedValue(_data)
// 加载vue组件获得实例
const wrapper = mount(NetworkOverviewDdosDetection, {
wrapper = mount(NetworkOverviewDdosDetection, {
propsData: {
timeFilter
}
})
}
describe('views/charts2/charts/networkOverview/NetworkOverviewDdosDetection.vue测试', () => {
test('攻击、受害、攻击数事件ddos检测图', async () => {
axiosPostAndMounted()
const attackEventCount = wrapper.get('[test-id="attackEventCount"]')
const attackerCount = wrapper.get('[test-id="attackerCount"]')
const victimCount = wrapper.get('[test-id="victimCount"]')
@@ -34,4 +44,27 @@ describe('views/charts2/charts/networkOverview/NetworkOverviewDdosDetection.vue
resolve()
}, 200))
})
test('攻击、受害、攻击数事件ddos检测图无数据', async () => {
axiosPostAndMounted(mockData.empty)
await new Promise(resolve => setTimeout(() => {
const noData = wrapper.get('[test-id="noData"]')
expect(noData.text()).toBe('npm.noData')
resolve()
}, 200))
})
test('攻击、受害、攻击数事件ddos检测图数据为0或极大值', async () => {
axiosPostAndMounted(mockData.boundary)
await new Promise(resolve => setTimeout(() => {
const attackEventCount = wrapper.get('[test-id="attackEventCount"]')
const attackerCount = wrapper.get('[test-id="attackerCount"]')
const victimCount = wrapper.get('[test-id="victimCount"]')
expect(attackEventCount.text()).toEqual('120.00 G')
expect(attackerCount.text()).toEqual('0')
expect(victimCount.text()).toEqual('3.67 T')
resolve()
}, 200))
})
})

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,32 @@
export const mockData = {
common: {
data: { status: 200, code: 200, queryKey: 'dec6723e173e8fa2b00917dc597bfb27', success: true, message: null, statistics: { elapsed: 0, rows_read: 2, result_size: 58, result_rows: 1 }, job: null, formatType: 'json', meta: [{ name: 'attack_event_count', type: 'long', category: 'Metric' }, { name: 'attacker_count', type: 'long', category: 'Metric' }, { name: 'victim_count', type: 'long', category: 'Metric' }], data: { resultType: 'object', result: [{ attackEventCount: 1200000, attackerCount: 2687878, victimCount: 36676767 }] }, originalUrl: 'http://192.168.44.55:9999?query=SELECT%20COUNT%28*%29%20AS%20attack_event_count%2C%20COUNT%28DISTINCT%28offender_ip%29%29%20AS%20attacker_count%2C%20COUNT%28DISTINCT%28victim_ip%29%29%20AS%20victim_count%20FROM%20security_event%20WHERE%20start_time%20%3E%3D%201675043912%20AND%20start_time%20%3C%201675047512%20AND%20security_type%20%3D%20%27ddos%27&format=json&option=real-time', msg: 'OK' }
},
empty: {
data: {
status: 200,
code: 200,
data: {
resultType: 'table',
result: []
},
msg: 'OK'
}
},
boundary: {
data: {
status: 200,
code: 200,
data: {
resultType: 'object',
result: [
{
attackEventCount: 120000077777,
attackerCount: 0,
victimCount: 3667676700000
}
]
}
}
}
}

File diff suppressed because one or more lines are too long

View File

@@ -2,6 +2,10 @@ import NpmAppEventTable from '@/views/charts2/charts/npm/NpmAppEventTable'
import { mount } from '@vue/test-utils'
import axios from 'axios'
import ElementPlus from 'element-plus'
import { mockData } from './mockData/NpmAppEventByTable'
let wrapper = null
const mockGet = mockData.common.data
const timeFilter = {
dateRangeValue: -1,
@@ -9,15 +13,18 @@ const timeFilter = {
endTime: 1675731457
}
const mockGet = { data: { status: 200, code: 200, queryKey: '88eeb92e0ddb40c0327db494cfe5c74c', success: true, message: null, statistics: { elapsed: 0, rows_read: 2, result_size: 752, result_rows: 10 }, job: null, formatType: 'json', meta: [{ name: 'app_name', type: 'string', category: 'Dimension' }, { name: 'event_severity', type: 'string', category: 'Dimension' }, { name: 'event_type', type: 'string', category: 'Dimension' }, { name: 'count', type: 'long', category: 'Metric' }], data: { resultType: 'table', result: [{ appName: 'youku', eventSeverity: 'info', eventType: 'http error', count: 6 }, { appName: 'uplive', eventSeverity: 'critical', eventType: 'http error', count: 5 }, { appName: 'youku', eventSeverity: 'low', eventType: 'http error', count: 4 }, { appName: 'apple_hls', eventSeverity: 'info', eventType: 'http error', count: 3 }, { appName: 'apple_hls', eventSeverity: 'low', eventType: 'http error', count: 3 }, { appName: 'apple_hls', eventSeverity: 'medium', eventType: 'http error', count: 2 }, { appName: 'uplive', eventSeverity: 'high', eventType: 'http error', count: 2 }, { appName: 'windows_update', eventSeverity: 'medium', eventType: 'http error', count: 2 }, { appName: 'apple_hls', eventSeverity: 'critical', eventType: 'http error', count: 1 }, { appName: 'cloudflare', eventSeverity: 'info', eventType: 'http error', count: 1 }] }, originalUrl: 'http://192.168.44.55:9999?query=SELECT%20app_name%20AS%20app_name%2C%20event_severity%20AS%20event_severity%2C%20event_type%20AS%20event_type%2C%20COUNT%28*%29%20AS%20count%20FROM%20performance_event%20WHERE%20start_time%20%3E%3D%201675580110%20AND%20end_time%20%3C%201675752910%20AND%20entity_type%20%3D%20%27app%27%20GROUP%20BY%20app_name%2Cevent_severity%2Cevent_type%20ORDER%20BY%20count%20DESC%20%20LIMIT%2010%20&format=json&option=real-time', msg: 'OK' } }
describe('views/charts2/charts/npm/NpmAppEventTable.vue测试', () => {
test('Npm 事件APP事件信息表格 严重程度色块验证', async () => {
/**
* 进行axios请求并挂载vue实例
* @param data
*/
function axiosPostAndMounted (data) {
require('vue-router').useRoute.mockReturnValue({ query: {} })
const _data = data || mockGet
// 模拟 axios 数据
axios.get.mockResolvedValue(mockGet)
axios.get.mockResolvedValue(_data)
// 加载vue组件获得实例
const wrapper = mount(NpmAppEventTable, {
wrapper = mount(NpmAppEventTable, {
global: {
plugins: [ElementPlus]
},
@@ -25,6 +32,11 @@ describe('views/charts2/charts/npm/NpmAppEventTable.vue测试', () => {
timeFilter
}
})
}
describe('views/charts2/charts/npm/NpmAppEventTable.vue测试', () => {
test('Npm 事件APP事件信息表格 严重程度色块验证', async () => {
axiosPostAndMounted()
await new Promise(resolve => setTimeout(() => {
// critical
@@ -96,18 +108,7 @@ describe('views/charts2/charts/npm/NpmAppEventTable.vue测试', () => {
}, 200))
})
test('Npm 事件APP事件信息表格 数据验证(应用数据列)', async () => {
require('vue-router').useRoute.mockReturnValue({ query: {} })
// 模拟 axios 数据
axios.get.mockResolvedValue(mockGet)
// 加载vue组件获得实例
const wrapper = mount(NpmAppEventTable, {
global: {
plugins: [ElementPlus]
},
propsData: {
timeFilter
}
})
axiosPostAndMounted()
await new Promise(resolve => setTimeout(() => {
const textNode0 = wrapper.find('[test-id="appName0"]')
@@ -136,18 +137,7 @@ describe('views/charts2/charts/npm/NpmAppEventTable.vue测试', () => {
}, 200))
})
test('Npm 事件APP事件信息表格 数据验证(严重程度数据列)', async () => {
require('vue-router').useRoute.mockReturnValue({ query: {} })
// 模拟 axios 数据
axios.get.mockResolvedValue(mockGet)
// 加载vue组件获得实例
const wrapper = mount(NpmAppEventTable, {
global: {
plugins: [ElementPlus]
},
propsData: {
timeFilter
}
})
axiosPostAndMounted()
await new Promise(resolve => setTimeout(() => {
const textNode0 = wrapper.find('[test-id="eventSeverity0"]')
@@ -176,18 +166,7 @@ describe('views/charts2/charts/npm/NpmAppEventTable.vue测试', () => {
}, 200))
})
test('Npm 事件APP事件信息表格 数据验证(事件类型数据列)', async () => {
require('vue-router').useRoute.mockReturnValue({ query: {} })
// 模拟 axios 数据
axios.get.mockResolvedValue(mockGet)
// 加载vue组件获得实例
const wrapper = mount(NpmAppEventTable, {
global: {
plugins: [ElementPlus]
},
propsData: {
timeFilter
}
})
axiosPostAndMounted()
await new Promise(resolve => setTimeout(() => {
const textNode0 = wrapper.find('[test-id="eventType0"]')
@@ -216,18 +195,7 @@ describe('views/charts2/charts/npm/NpmAppEventTable.vue测试', () => {
}, 200))
})
test('Npm 事件APP事件信息表格 数据验证(事件数量数据列)', async () => {
require('vue-router').useRoute.mockReturnValue({ query: {} })
// 模拟 axios 数据
axios.get.mockResolvedValue(mockGet)
// 加载vue组件获得实例
const wrapper = mount(NpmAppEventTable, {
global: {
plugins: [ElementPlus]
},
propsData: {
timeFilter
}
})
axiosPostAndMounted()
await new Promise(resolve => setTimeout(() => {
const textNode0 = wrapper.find('[test-id="count0"]')
@@ -255,4 +223,13 @@ describe('views/charts2/charts/npm/NpmAppEventTable.vue测试', () => {
resolve()
}, 200))
})
test('Npm 事件APP事件信息表格 无数据', async () => {
axiosPostAndMounted(mockData.empty.data)
await new Promise(resolve => setTimeout(() => {
const noData = wrapper.get('[test-id="noData"]')
expect(noData.text()).toBe('npm.noData')
resolve()
}, 200))
})
})

File diff suppressed because one or more lines are too long

View File

@@ -1,25 +1,35 @@
import NpmEventsHeader from '@/views/charts2/charts/npm/NpmEventsHeader'
import { mount } from '@vue/test-utils'
import axios from 'axios'
import { mockData } from './mockData/NpmEventsHeader'
// 模拟数据
const chartData = {
data: { status: 200, code: 200, queryKey: '6480498979f7501d822572ebeb9e9665', success: true, message: null, statistics: { elapsed: 0, rows_read: 3, result_size: 167, result_rows: 5 }, job: null, formatType: 'json', meta: [{ name: 'event_severity', type: 'string', category: 'Dimension' }, { name: 'count', type: 'long', category: 'Metric' }], data: { resultType: 'table', result: [{ eventSeverity: 'critical', count: 322334 }, { eventSeverity: 'high', count: 1111 }, { eventSeverity: 'info', count: 122222 }, { eventSeverity: 'low', count: 14456678 }, { eventSeverity: 'medium', count: 2000000 }] }, originalUrl: 'http://192.168.44.55:9999?query=SELECT%20event_severity%20AS%20event_severity%2C%20COUNT%28*%29%20AS%20count%20FROM%20performance_event%20WHERE%20start_time%20%3E%3D%201675026686%20AND%20end_time%20%3C%201675048286%20GROUP%20BY%20event_severity&format=json&option=real-time', msg: 'OK' }
}
const chartData = mockData.common.data
// type
const type = 'severity'
let wrapper = null
describe('views/charts2/charts/npm/NpmEventsHeader.vue测试', () => {
test('严重等级各等级个数npm event 严重等级单值', async () => {
/**
* 进行axios请求并挂载vue实例
* @param data
*/
function axiosPostAndMounted (data) {
require('vue-router').useRoute.mockReturnValue({ query: {} })
// 模拟 axios 返回数据
axios.get.mockResolvedValue(chartData)
const _data = data || chartData
// 模拟 axios 数据
axios.get.mockResolvedValue(_data)
// 加载vue组件获得实例
const wrapper = mount(NpmEventsHeader, {
wrapper = mount(NpmEventsHeader, {
propsData: {
type
}
})
}
describe('views/charts2/charts/npm/NpmEventsHeader.vue测试', () => {
test('严重等级各等级个数npm event 严重等级单值', async () => {
axiosPostAndMounted()
// 严重等级
const severity0 = wrapper.get('[test-id="severity0"]')
const severity1 = wrapper.get('[test-id="severity1"]')
@@ -51,4 +61,40 @@ describe('views/charts2/charts/npm/NpmEventsHeader.vue测试', () => {
resolve()
}, 200))
})
test('请求无数据', async () => {
axiosPostAndMounted(mockData.empty.data)
// 各等级个数
const total0 = wrapper.get('[test-id="total0"]')
const total1 = wrapper.get('[test-id="total1"]')
const total2 = wrapper.get('[test-id="total2"]')
const total3 = wrapper.get('[test-id="total3"]')
const total4 = wrapper.get('[test-id="total4"]')
await new Promise(resolve => setTimeout(() => {
expect(total0.text()).toEqual('-')
expect(total1.text()).toEqual('-')
expect(total2.text()).toEqual('-')
expect(total3.text()).toEqual('-')
expect(total4.text()).toEqual('-')
resolve()
}, 200))
})
test('数据为0或极大', async () => {
axiosPostAndMounted(mockData.boundary.data)
// 各等级个数
const total0 = wrapper.get('[test-id="total0"]')
const total1 = wrapper.get('[test-id="total1"]')
const total2 = wrapper.get('[test-id="total2"]')
const total3 = wrapper.get('[test-id="total3"]')
const total4 = wrapper.get('[test-id="total4"]')
await new Promise(resolve => setTimeout(() => {
expect(total0.text()).toEqual('0')
expect(total1.text()).toEqual('0')
expect(total2.text()).toEqual('0')
expect(total3.text()).toEqual('14,456,678')
expect(total4.text()).toEqual('1,222,225,432,456,789')
resolve()
}, 200))
})
})

File diff suppressed because one or more lines are too long

View File

@@ -2,45 +2,32 @@ import NpmRecentEvents from '@/views/charts2/charts/npm/NpmRecentEvents'
import { mount } from '@vue/test-utils'
import axios from 'axios'
import ElementPlus from 'element-plus'
import { mockData } from './mockData/NpmRecentEvents'
// 未下钻
const mockGet = {
data: { status: 200, code: 200, queryKey: '68d8aa5867b08b926b5bd38c36add9e5', success: true, message: null, statistics: { elapsed: 0, rows_read: 2, result_size: 550, result_rows: 5 }, job: null, formatType: 'json', meta: [{ name: 'event_id', type: 'long', category: 'Metric' }, { name: 'event_severity', type: 'string', category: 'Metric' }, { name: 'event_key', type: 'string', category: 'Metric' }, { name: 'event_type', type: 'string', category: 'Metric' }], data: { resultType: 'table', result: [{ eventId: 1173511643475208200, eventSeverity: 'critical', eventKey: '114.114.114.114 dns error', eventType: 'dns error' }, { eventId: 1173504415263352800, eventSeverity: 'high', eventKey: '116.178.78.241 http error', eventType: 'http error' }, { eventId: 1173492761289025500, eventSeverity: 'medium', eventKey: '223.6.6.6 dns error', eventType: 'dns error' }, { eventId: 1173489002890651600, eventSeverity: 'low', eventKey: '114.114.114.114 dns error', eventType: 'dns error' }, { eventId: 1173482380537620500, eventSeverity: 'info', eventKey: '1.1.1.2 dns error', eventType: 'http error' }, { eventId: 1173482380537620500, eventSeverity: 'critical', eventKey: '1.1.1.2 dns error', eventType: 'dns error' }] }, originalUrl: 'http://192.168.44.55:9999?query=SELECT%20event_id%20AS%20event_id%2Cevent_severity%20AS%20event_severity%2C%20event_key%20AS%20event_key%2C%20event_type%20AS%20event_type%20FROM%20performance_event%20WHERE%20start_time%20%3E%3D%201675227528%20AND%20end_time%20%3C%201675231128%20ORDER%20BY%20start_time%20DESC%20%20LIMIT%208%20&format=json&option=real-time', msg: 'OK' }
}
const mockGet = mockData.common.data1
// 下钻
const mockGet1 = {
data: { status: 200, code: 200, queryKey: 'fc0bd92bf3b48a37310d5c004d8b7a7b', success: true, message: null, statistics: { elapsed: 0, rows_read: 2, result_size: 689, result_rows: 7 }, job: null, formatType: 'json', meta: [{ name: 'event_id', type: 'long', category: 'Metric' }, { name: 'event_severity', type: 'string', category: 'Metric' }, { name: 'event_type', type: 'string', category: 'Metric' }, { name: 'start_time', type: 'long', category: 'Metric' }], data: { resultType: 'table', result: [{ eventId: 1132790825086844900, eventSeverity: 'critical', eventType: 'http error', startTime: 1672802700 }, { eventId: 1132132403379142700, eventSeverity: 'high', eventType: 'dns error', startTime: 1672763400 }, { eventId: 1131441760155689000, eventSeverity: 'low', eventType: 'dns error', startTime: 1672722300 }, { eventId: 1131411523384598500, eventSeverity: 'medium', eventType: 'http error', startTime: 1672720500 }, { eventId: 1131390214323789800, eventSeverity: 'info', eventType: 'dns error', startTime: 1672719300 }, { eventId: 1131306200132968400, eventSeverity: 'critical', eventType: 'http error', startTime: 1672714200 }] }, originalUrl: 'http://192.168.44.55:9999?query=SELECT%20event_id%20AS%20event_id%2Cevent_severity%20AS%20event_severity%2C%20event_type%20AS%20event_type%2C%20start_time%20AS%20start_time%20FROM%20performance_event%20WHERE%20start_time%20%3E%3D%201672675200%20AND%20start_time%20%3C%201677513600%20AND%20server_ip%20%3D%20%27116.178.236.216%27%20ORDER%20BY%20start_time%20DESC&format=json&option=real-time', msg: 'OK' }
}
const query = {
curTab: 'country',
dimensionType: 'ip',
fourthMenu: '116.178.214.84',
fourthPanel: '8',
networkOverviewBeforeTab: 'ip',
panelName: '116.178.214.84',
queryCondition: "common_client_ip='116.178.214.84' OR common_server_ip='116.178.214.84'",
t: '1675236779453',
tabIndex: '1',
tabOperationBeforeType: '',
tabOperationType: '4',
thirdMenu: 'network.ips',
thirdPanel: '12'
}
const mockGet1 = mockData.common.data2
const query = mockData.common.query
const timeFilter = {
dateRangeValue: -1,
startTime: 1675043912,
endTime: 1675047512
}
let wrapper = null
/**
* 进行axios请求并挂载vue实例
* @param data
* @param query
*/
function axiosPostAndMounted (data, query) {
const _query = query || {}
require('vue-router').useRoute.mockReturnValue({ query: _query })
const _data = data || mockGet
axios.get.mockResolvedValue(_data)
describe('views/charts2/charts/npm/NpmRecentEvents.vue测试', () => {
test('npm events 近期事件表格 未下钻', async () => {
require('vue-router').useRoute.mockReturnValue({ query: {} })
// 模拟 axios 返回数据
axios.get.mockResolvedValue(mockGet)
const wrapper = mount(NpmRecentEvents, {
wrapper = mount(NpmRecentEvents, {
propsData: {
timeFilter
},
@@ -48,6 +35,12 @@ describe('views/charts2/charts/npm/NpmRecentEvents.vue测试', () => {
plugins: [ElementPlus]
}
})
}
describe('views/charts2/charts/npm/NpmRecentEvents.vue测试', () => {
test('npm events 近期事件表格 未下钻', async () => {
axiosPostAndMounted()
await new Promise(resolve => setTimeout(() => {
const severity0 = wrapper.get('[test-id="eventSeverity-critical-0"]')
const severity1 = wrapper.get('[test-id="eventSeverity-high-1"]')
@@ -98,18 +91,8 @@ describe('views/charts2/charts/npm/NpmRecentEvents.vue测试', () => {
}, 200))
})
test('npm events 近期事件表格 下钻', async () => {
require('vue-router').useRoute.mockReturnValue({ query: query })
// 模拟 axios 返回数据
axios.get.mockResolvedValue(mockGet1)
axiosPostAndMounted(mockGet1, query)
const wrapper = mount(NpmRecentEvents, {
propsData: {
timeFilter
},
global: {
plugins: [ElementPlus]
}
})
await new Promise(resolve => setTimeout(() => {
const severity0 = wrapper.get('[test-id="eventSeverity-critical-0"]')
const severity1 = wrapper.get('[test-id="eventSeverity-high-1"]')
@@ -144,11 +127,11 @@ describe('views/charts2/charts/npm/NpmRecentEvents.vue测试', () => {
expect(eventType3.text()).toEqual('http error')
expect(eventType4.text()).toEqual('dns error')
const startTime0 = wrapper.get('[test-id="startTime-2023-01-04T11:25:00+08:00-0"]')
const startTime1 = wrapper.get('[test-id="startTime-2023-01-04T00:30:00+08:00-1"]')
const startTime2 = wrapper.get('[test-id="startTime-2023-01-03T13:05:00+08:00-2"]')
const startTime3 = wrapper.get('[test-id="startTime-2023-01-03T12:35:00+08:00-3"]')
const startTime4 = wrapper.get('[test-id="startTime-2023-01-03T12:15:00+08:00-4"]')
const startTime0 = wrapper.get('[test-id="startTime-0"]')
const startTime1 = wrapper.get('[test-id="startTime-1"]')
const startTime2 = wrapper.get('[test-id="startTime-2"]')
const startTime3 = wrapper.get('[test-id="startTime-3"]')
const startTime4 = wrapper.get('[test-id="startTime-4"]')
expect(startTime0.text()).toEqual('2023-01-04T11:25:00+08:00')
expect(startTime1.text()).toEqual('2023-01-04T00:30:00+08:00')
@@ -159,4 +142,13 @@ describe('views/charts2/charts/npm/NpmRecentEvents.vue测试', () => {
resolve()
}, 300))
})
test('npm events 近期事件表格 未下钻、未下钻无数据', async () => {
axiosPostAndMounted(mockData.empty.data)
await new Promise(resolve => setTimeout(() => {
const noData = wrapper.get('[test-id="noData"]')
expect(noData.text()).toBe('npm.thereNoEvents')
resolve()
}, 200))
})
})

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,20 @@
export const mockData = {
common: {
data: {
data: { status: 200, code: 200, queryKey: '88eeb92e0ddb40c0327db494cfe5c74c', success: true, message: null, statistics: { elapsed: 0, rows_read: 2, result_size: 752, result_rows: 10 }, job: null, formatType: 'json', meta: [{ name: 'app_name', type: 'string', category: 'Dimension' }, { name: 'event_severity', type: 'string', category: 'Dimension' }, { name: 'event_type', type: 'string', category: 'Dimension' }, { name: 'count', type: 'long', category: 'Metric' }], data: { resultType: 'table', result: [{ appName: 'youku', eventSeverity: 'info', eventType: 'http error', count: 6 }, { appName: 'uplive', eventSeverity: 'critical', eventType: 'http error', count: 5 }, { appName: 'youku', eventSeverity: 'low', eventType: 'http error', count: 4 }, { appName: 'apple_hls', eventSeverity: 'info', eventType: 'http error', count: 3 }, { appName: 'apple_hls', eventSeverity: 'low', eventType: 'http error', count: 3 }, { appName: 'apple_hls', eventSeverity: 'medium', eventType: 'http error', count: 2 }, { appName: 'uplive', eventSeverity: 'high', eventType: 'http error', count: 2 }, { appName: 'windows_update', eventSeverity: 'medium', eventType: 'http error', count: 2 }, { appName: 'apple_hls', eventSeverity: 'critical', eventType: 'http error', count: 1 }, { appName: 'cloudflare', eventSeverity: 'info', eventType: 'http error', count: 1 }] }, originalUrl: 'http://192.168.44.55:9999?query=SELECT%20app_name%20AS%20app_name%2C%20event_severity%20AS%20event_severity%2C%20event_type%20AS%20event_type%2C%20COUNT%28*%29%20AS%20count%20FROM%20performance_event%20WHERE%20start_time%20%3E%3D%201675580110%20AND%20end_time%20%3C%201675752910%20AND%20entity_type%20%3D%20%27app%27%20GROUP%20BY%20app_name%2Cevent_severity%2Cevent_type%20ORDER%20BY%20count%20DESC%20%20LIMIT%2010%20&format=json&option=real-time', msg: 'OK' }
}
},
empty: {
data: {
data: {
status: 200,
code: 200,
data: {
resultType: 'table',
result: []
},
msg: 'OK'
}
}
}
}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,48 @@
export const mockData = {
common: {
data: {
data: { status: 200, code: 200, queryKey: '6480498979f7501d822572ebeb9e9665', success: true, message: null, statistics: { elapsed: 0, rows_read: 3, result_size: 167, result_rows: 5 }, job: null, formatType: 'json', meta: [{ name: 'event_severity', type: 'string', category: 'Dimension' }, { name: 'count', type: 'long', category: 'Metric' }], data: { resultType: 'table', result: [{ eventSeverity: 'critical', count: 322334 }, { eventSeverity: 'high', count: 1111 }, { eventSeverity: 'info', count: 122222 }, { eventSeverity: 'low', count: 14456678 }, { eventSeverity: 'medium', count: 2000000 }] }, originalUrl: 'http://192.168.44.55:9999?query=SELECT%20event_severity%20AS%20event_severity%2C%20COUNT%28*%29%20AS%20count%20FROM%20performance_event%20WHERE%20start_time%20%3E%3D%201675026686%20AND%20end_time%20%3C%201675048286%20GROUP%20BY%20event_severity&format=json&option=real-time', msg: 'OK' }
}
},
empty: {
data: {
data: {
status: 200,
code: 200,
data: {
resultType: 'table',
result: []
},
msg: 'OK'
}
}
},
boundary: {
data: {
data: {
status: 200,
code: 200,
data: {
resultType: 'table',
result: [
{
eventSeverity: 'critical',
count: 0
}, {
eventSeverity: 'high',
count: 0
}, {
eventSeverity: 'info',
count: 1222225432456789
}, {
eventSeverity: 'low',
count: 14456678
}, {
eventSeverity: 'medium',
count: 0
}]
}
}
}
}
}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,66 @@
export const mockData = {
common: {
data1: {
data: { status: 200, code: 200, queryKey: '68d8aa5867b08b926b5bd38c36add9e5', success: true, message: null, statistics: { elapsed: 0, rows_read: 2, result_size: 550, result_rows: 5 }, job: null, formatType: 'json', meta: [{ name: 'event_id', type: 'long', category: 'Metric' }, { name: 'event_severity', type: 'string', category: 'Metric' }, { name: 'event_key', type: 'string', category: 'Metric' }, { name: 'event_type', type: 'string', category: 'Metric' }], data: { resultType: 'table', result: [{ eventId: 1173511643475208200, eventSeverity: 'critical', eventKey: '114.114.114.114 dns error', eventType: 'dns error' }, { eventId: 1173504415263352800, eventSeverity: 'high', eventKey: '116.178.78.241 http error', eventType: 'http error' }, { eventId: 1173492761289025500, eventSeverity: 'medium', eventKey: '223.6.6.6 dns error', eventType: 'dns error' }, { eventId: 1173489002890651600, eventSeverity: 'low', eventKey: '114.114.114.114 dns error', eventType: 'dns error' }, { eventId: 1173482380537620500, eventSeverity: 'info', eventKey: '1.1.1.2 dns error', eventType: 'http error' }, { eventId: 1173482380537620500, eventSeverity: 'critical', eventKey: '1.1.1.2 dns error', eventType: 'dns error' }] }, originalUrl: 'http://192.168.44.55:9999?query=SELECT%20event_id%20AS%20event_id%2Cevent_severity%20AS%20event_severity%2C%20event_key%20AS%20event_key%2C%20event_type%20AS%20event_type%20FROM%20performance_event%20WHERE%20start_time%20%3E%3D%201675227528%20AND%20end_time%20%3C%201675231128%20ORDER%20BY%20start_time%20DESC%20%20LIMIT%208%20&format=json&option=real-time', msg: 'OK' }
},
data2: {
data: { status: 200, code: 200, queryKey: 'fc0bd92bf3b48a37310d5c004d8b7a7b', success: true, message: null, statistics: { elapsed: 0, rows_read: 2, result_size: 689, result_rows: 7 }, job: null, formatType: 'json', meta: [{ name: 'event_id', type: 'long', category: 'Metric' }, { name: 'event_severity', type: 'string', category: 'Metric' }, { name: 'event_type', type: 'string', category: 'Metric' }, { name: 'start_time', type: 'long', category: 'Metric' }], data: { resultType: 'table', result: [{ eventId: 1132790825086844900, eventSeverity: 'critical', eventType: 'http error', startTime: 1672802700 }, { eventId: 1132132403379142700, eventSeverity: 'high', eventType: 'dns error', startTime: 1672763400 }, { eventId: 1131441760155689000, eventSeverity: 'low', eventType: 'dns error', startTime: 1672722300 }, { eventId: 1131411523384598500, eventSeverity: 'medium', eventType: 'http error', startTime: 1672720500 }, { eventId: 1131390214323789800, eventSeverity: 'info', eventType: 'dns error', startTime: 1672719300 }, { eventId: 1131306200132968400, eventSeverity: 'critical', eventType: 'http error', startTime: 1672714200 }] }, originalUrl: 'http://192.168.44.55:9999?query=SELECT%20event_id%20AS%20event_id%2Cevent_severity%20AS%20event_severity%2C%20event_type%20AS%20event_type%2C%20start_time%20AS%20start_time%20FROM%20performance_event%20WHERE%20start_time%20%3E%3D%201672675200%20AND%20start_time%20%3C%201677513600%20AND%20server_ip%20%3D%20%27116.178.236.216%27%20ORDER%20BY%20start_time%20DESC&format=json&option=real-time', msg: 'OK' }
},
query: {
curTab: 'country',
dimensionType: 'ip',
fourthMenu: '116.178.214.84',
fourthPanel: '8',
networkOverviewBeforeTab: 'ip',
panelName: '116.178.214.84',
queryCondition: "common_client_ip='116.178.214.84' OR common_server_ip='116.178.214.84'",
t: '1675236779453',
tabIndex: '1',
tabOperationBeforeType: '',
tabOperationType: '4',
thirdMenu: 'network.ips',
thirdPanel: '12'
}
},
empty: {
data: {
data: {
status: 200,
code: 200,
data: {
resultType: 'table',
result: []
},
msg: 'OK'
}
}
},
boundary: {
data: {
data: {
status: 200,
code: 200,
data: {
resultType: 'table',
result: [
{
eventSeverity: 'critical',
count: 0
}, {
eventSeverity: 'high',
count: 0
}, {
eventSeverity: 'info',
count: 1222225432456789
}, {
eventSeverity: 'low',
count: 14456678
}, {
eventSeverity: 'medium',
count: 0
}]
}
}
}
}
}