From 3bf6595c59ebed583da8f78da159572b979631c2 Mon Sep 17 00:00:00 2001 From: Yang <774655719@qq.com> Date: Thu, 13 Jun 2024 18:00:11 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=88=97=E8=A1=A8=E6=98=8E=E7=BB=86?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../layout/manage/manage.component.html | 2 +- .../layout/manage/path/path.component.html | 103 +++++++++++++++++- .../layout/manage/path/path.component.ts | 69 +++++------- 3 files changed, 131 insertions(+), 43 deletions(-) diff --git a/src/app/routes/config/layout/manage/manage.component.html b/src/app/routes/config/layout/manage/manage.component.html index 84409e3..4285227 100644 --- a/src/app/routes/config/layout/manage/manage.component.html +++ b/src/app/routes/config/layout/manage/manage.component.html @@ -138,7 +138,7 @@ - + diff --git a/src/app/routes/config/layout/manage/path/path.component.html b/src/app/routes/config/layout/manage/path/path.component.html index cd913ac..e7b50a2 100644 --- a/src/app/routes/config/layout/manage/path/path.component.html +++ b/src/app/routes/config/layout/manage/path/path.component.html @@ -1,4 +1,103 @@ - -
cdfddffff
\ No newline at end of file + + +
+ + + + 访问源IP + 访问频次 + 操作 + + + + + {{ data.req_ip }} + {{ data.req_frequency }} + + 白名单 + + 灰名单 + + + + + + + + + 账号 + 访问频次 + 工号 + 操作 + + + + + {{ data.req_account }} + {{ data.req_frequency }} + {{ data.req_jobnum }} + + 白名单 + + 灰名单 + + + + + + + + + 接口地址 + 访问IP + 访问账号 + 访问频次 + 工号 + 操作 + + + + + {{ data.interface_addr }} + {{ data.req_ip }} + {{ data.req_account }} + {{ data.req_frequency }} + {{ data.req_jobnum }} + + 白名单 + + 灰名单 + + + + + + + + + 菜单名称 + 访问IP + 访问账号 + 访问频次 + 工号 + 操作 + + + + + {{ data.menu_name }} + {{ data.req_ip }} + {{ data.req_account }} + {{ data.req_frequency }} + {{ data.req_jobnum }} + + 白名单 + + 灰名单 + + + + +
diff --git a/src/app/routes/config/layout/manage/path/path.component.ts b/src/app/routes/config/layout/manage/path/path.component.ts index dc645e2..08c8eba 100644 --- a/src/app/routes/config/layout/manage/path/path.component.ts +++ b/src/app/routes/config/layout/manage/path/path.component.ts @@ -10,12 +10,11 @@ import { NoticeService } from '../../../service/https/notice.service'; export class PathComponent implements OnInit { @Input() datas: any; data; - mailData: any; - messageData: any; - qywechatData: any; - dingtalkData: any; - wechartRobotData: any; - dingdingRobotData: any; + viewType = 'ip'; + ipData: []; + accountData: []; + interfaceData: []; + menuData: []; constructor( private noticeService: NoticeService, @@ -23,47 +22,37 @@ export class PathComponent implements OnInit { ) {} ngOnInit() { - this.queryData(); + // this.queryData(); + console.log('11111'); + const jsonStr = '{"type":3,"http://190.89.233.2:8909/getpublicconfig":[{"req_ip":"192.156.3.12","interface_addr":"http://190.89.233.2:8909/getpublicconfig","req_jobnum":43327,"req_frequency":43,"req_account":"liuhr"},{"req_ip":"192.156.3.12","interface_addr":"http://190.89.233.2:8909/getpublicconfig","req_jobnum":43328,"req_frequency":44,"req_account":"sunxq01"},{"req_ip":"192.156.3.18","interface_addr":"http://190.89.233.2:8909/getpublicconfig","req_jobnum":65341,"req_frequency":45,"req_account":"shicl"},{"req_ip":"192.106.3.33","interface_addr":"http://190.89.233.2:8909/getpublicconfig","req_jobnum":65342,"req_frequency":46,"req_account":"gongxs"},{"req_ip":"192.106.3.34","interface_addr":"http://190.89.233.2:8909/getpublicconfig","req_jobnum":65343,"req_frequency":47,"req_account":"sunzs"}]}' + if (this.datas == null) { + this.datas = JSON.parse(jsonStr); + } + this.parseData(this.datas); } - queryData() { - this.noticeService.queryConfig().subscribe( - resp => { - if (resp.status === 200) { - // console.log(resp.data); - this.data = resp.data; - this.processData(this.data); + parseData(datas: any) { + for (const dataKey in datas) { + if (datas.hasOwnProperty(dataKey)) { + if (dataKey === 'type') { + this.viewType = datas[dataKey]; } else { - this.message.error(resp.msg); + this.data = datas[dataKey]; } - }, - error => { - this.message.error('服务器错误'); } - ); + } } - processData(allData) { - allData.forEach((item) => { - if (item.type === 'mail') { - this.mailData = item; - } - if (item.type === 'message') { - this.messageData = item; - } - if (item.type === 'qywechat') { - this.qywechatData = item; - } - if (item.type === 'dingtalk') { - this.dingtalkData = item; - } - if (item.type === 'webhook') { - this.wechartRobotData = item; - } - if (item.type === 'robot') { - this.dingdingRobotData = item; - } - }); + clickWihteList(data) { + alert("点击白名单"); + } + + clickGreyList(data) { + alert("点击灰名单"); + } + + clickFrequency(data) { + alert("点击超链接"); } } From e8d932deaa18888f64628f2de98f0063ac66f8e1 Mon Sep 17 00:00:00 2001 From: Yang <774655719@qq.com> Date: Thu, 13 Jun 2024 18:00:31 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=88=97=E8=A1=A8=E6=98=8E=E7=BB=86?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../config/layout/manage/path/path.component.ts | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/src/app/routes/config/layout/manage/path/path.component.ts b/src/app/routes/config/layout/manage/path/path.component.ts index 08c8eba..86cc095 100644 --- a/src/app/routes/config/layout/manage/path/path.component.ts +++ b/src/app/routes/config/layout/manage/path/path.component.ts @@ -10,11 +10,7 @@ import { NoticeService } from '../../../service/https/notice.service'; export class PathComponent implements OnInit { @Input() datas: any; data; - viewType = 'ip'; - ipData: []; - accountData: []; - interfaceData: []; - menuData: []; + viewType = 0; constructor( private noticeService: NoticeService, @@ -22,12 +18,10 @@ export class PathComponent implements OnInit { ) {} ngOnInit() { - // this.queryData(); - console.log('11111'); - const jsonStr = '{"type":3,"http://190.89.233.2:8909/getpublicconfig":[{"req_ip":"192.156.3.12","interface_addr":"http://190.89.233.2:8909/getpublicconfig","req_jobnum":43327,"req_frequency":43,"req_account":"liuhr"},{"req_ip":"192.156.3.12","interface_addr":"http://190.89.233.2:8909/getpublicconfig","req_jobnum":43328,"req_frequency":44,"req_account":"sunxq01"},{"req_ip":"192.156.3.18","interface_addr":"http://190.89.233.2:8909/getpublicconfig","req_jobnum":65341,"req_frequency":45,"req_account":"shicl"},{"req_ip":"192.106.3.33","interface_addr":"http://190.89.233.2:8909/getpublicconfig","req_jobnum":65342,"req_frequency":46,"req_account":"gongxs"},{"req_ip":"192.106.3.34","interface_addr":"http://190.89.233.2:8909/getpublicconfig","req_jobnum":65343,"req_frequency":47,"req_account":"sunzs"}]}' - if (this.datas == null) { - this.datas = JSON.parse(jsonStr); - } + // const jsonStr = '{"type":3,"http://190.89.233.2:8909/getpublicconfig":[{"req_ip":"192.156.3.12","interface_addr":"http://190.89.233.2:8909/getpublicconfig","req_jobnum":43327,"req_frequency":43,"req_account":"liuhr"},{"req_ip":"192.156.3.12","interface_addr":"http://190.89.233.2:8909/getpublicconfig","req_jobnum":43328,"req_frequency":44,"req_account":"sunxq01"},{"req_ip":"192.156.3.18","interface_addr":"http://190.89.233.2:8909/getpublicconfig","req_jobnum":65341,"req_frequency":45,"req_account":"shicl"},{"req_ip":"192.106.3.33","interface_addr":"http://190.89.233.2:8909/getpublicconfig","req_jobnum":65342,"req_frequency":46,"req_account":"gongxs"},{"req_ip":"192.106.3.34","interface_addr":"http://190.89.233.2:8909/getpublicconfig","req_jobnum":65343,"req_frequency":47,"req_account":"sunzs"}]}' + // if (this.datas == null) { + // this.datas = JSON.parse(jsonStr); + // } this.parseData(this.datas); }