主页面提交

pull/1/head
TANGWY 5 months ago
parent 905a6fe15c
commit b17724ea27
  1. 18
      angular.json
  2. 2
      extra-webpack.config.js
  3. 2
      package-lock.json
  4. 6
      package.json
  5. 2
      src/app/app-routing.module.ts
  6. 2
      src/app/app.component.ts
  7. 59
      src/app/routes/config/layout/manage/manage.component.html
  8. 2
      src/app/routes/config/layout/manage/manage.component.styl
  9. 1048
      src/app/routes/config/layout/manage/manage.component.ts
  10. 4
      src/app/routes/config/layout/manage/manage.module.ts
  11. 4
      src/app/routes/config/layout/manage/path/path.component.html
  12. 52
      src/app/routes/config/layout/manage/path/path.component.ts
  13. 18
      src/app/routes/config/layout/manage/process/process.component.html
  14. 28
      src/app/routes/config/layout/manage/process/process.component.spec.ts
  15. 0
      src/app/routes/config/layout/manage/process/process.component.styl
  16. 88
      src/app/routes/config/layout/manage/process/process.component.ts
  17. 203
      src/app/routes/config/service/https/notice.service.ts
  18. 2
      src/environments/environment.prod.ts
  19. 2
      src/environments/environment.ts

@ -3,7 +3,7 @@
"version": 1,
"newProjectRoot": "projects",
"projects": {
"notice": {
"uebaMetricsAnalysis": {
"root": "",
"sourceRoot": "src",
"projectType": "application",
@ -21,7 +21,7 @@
"build": {
"builder": "@angular-builders/custom-webpack:browser",
"options": {
"outputPath": "dist/notice",
"outputPath": "dist/uebaMetricsAnalysis",
"index": "src/index.html",
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
@ -82,18 +82,18 @@
"serve": {
"builder": "@angular-builders/dev-server:generic",
"options": {
"browserTarget": "notice:build"
"browserTarget": "uebaMetricsAnalysis:build"
},
"configurations": {
"production": {
"browserTarget": "notice:build:production"
"browserTarget": "uebaMetricsAnalysis:build:production"
}
}
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "notice:build"
"browserTarget": "uebaMetricsAnalysis:build"
}
},
"test": {
@ -127,7 +127,7 @@
}
}
},
"notice-e2e": {
"uebaMetricsAnalysis-e2e": {
"root": "e2e/",
"projectType": "application",
"prefix": "",
@ -136,11 +136,11 @@
"builder": "@angular-devkit/build-angular:protractor",
"options": {
"protractorConfig": "e2e/protractor.conf.js",
"devServerTarget": "notice:serve"
"devServerTarget": "uebaMetricsAnalysis:serve"
},
"configurations": {
"production": {
"devServerTarget": "notice:serve:production"
"devServerTarget": "uebaMetricsAnalysis:serve:production"
}
}
},
@ -156,5 +156,5 @@
}
}
},
"defaultProject": "notice"
"defaultProject": "uebaMetricsAnalysis"
}

@ -7,7 +7,7 @@ module.exports = (angularWebpackConfig, options) => {
output: {
library: `${name}-[name]`,
libraryTarget: 'umd',
publicPath: process.env.NODE_ENV == 'prod' ? '/WebApi/notice/static/dist/' : 'http://localhost:4203/'
publicPath: process.env.NODE_ENV == 'prod' ? '/WebApi/uebaMetricsAnalysis/static/dist/' : 'http://localhost:4203/'
},

2
package-lock.json generated

@ -1,5 +1,5 @@
{
"name": "notice",
"name": "uebaMetricsAnalysis",
"version": "0.0.0",
"lockfileVersion": 1,
"requires": true,

@ -1,10 +1,10 @@
{
"name": "notice",
"name": "uebaMetricsAnalysis",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve notice --host 0.0.0.0 --disable-host-check --port 4203 --open --proxy-config proxy.conf.js",
"build": "set NODE_ENV=prod&& ng build notice --aot --output-path dist/ --deploy-url /WebApi/notice/static/dist/ --base-href /WebApi/notice/static/dist/ --prod",
"start": "ng serve uebaMetricsAnalysis --host 0.0.0.0 --disable-host-check --port 4203 --open --proxy-config proxy.conf.js",
"build": "set NODE_ENV=prod&& ng build uebaMetricsAnalysis --aot --output-path dist/ --deploy-url /WebApi/uebaMetricsAnalysis/static/dist/ --base-href /WebApi/uebaMetricsAnalysis/static/dist/ --prod",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"

@ -13,7 +13,7 @@ const routes: Routes = [
imports: [RouterModule.forRoot(routes, { useHash: true })],
exports: [RouterModule],
providers: [
{ provide: APP_BASE_HREF, useValue: (window as any).__POWERED_BY_QIANKUN__ ? '/notice' : '/' },
{ provide: APP_BASE_HREF, useValue: (window as any).__POWERED_BY_QIANKUN__ ? '/uebaMetricsAnalysis' : '/' },
]
})
export class AppRoutingModule { }

@ -28,7 +28,7 @@ export class AppComponent implements OnInit {
if (!this.prefixRouter) {
this.prefixRouter = await this.configService.translatePrefix();
}
const appName = '/notice';
const appName = '/uebaMetricsAnalysis';
const prefix = this.configService.getUrlPrefix(this.prefixRouter, appName);
document.title = prefix ? prefix : '绿盟智能安全运营平台';
}

@ -1,4 +1,5 @@
<div class="container">
<h1>接口访问统计</h1>
<div class="seach">
<div class="form-item">
<div class="form-label">时间选择:</div>
@ -7,7 +8,7 @@
<div class="form-item" >
<div class="form-label">统计维度:</div>
<nz-select (ngModelChange)="selectValChange()" [(ngModel)]="dimension">
<nz-select [(ngModel)]="dimension">
<nz-option nzValue="1" nzLabel="IP"></nz-option>
<nz-option nzValue="2" nzLabel="账号"></nz-option>
<nz-option nzValue="3" nzLabel="接口" ></nz-option>
@ -20,9 +21,10 @@
</div>
</div>
<div style="margin-top: 50px;">
<nz-table *ngIf="dimension === '1'" #basicTable [nzData]="listOfData">
<div class="table-container" style="margin-top: 50px;height:100vh;">
<div style="display: flex;justify-content: right;"><button nz-button (click)="exportExcel()">导出</button></div>
<nz-table *ngIf="tableisShow === '1'" #basicTable [nzData]="listOfData">
<thead>
<tr>
<th>归属单位</th>
@ -43,18 +45,18 @@
"ip_reat": 0.3,
"ip_avg": 0.43,
"trend": 0.3 -->
<td>{{ data.company }}</td>
<td><a (click)="showModel({type: 1, key: data.company})">{{data.company}}</a></td>
<td>{{ data.req_frequency }}</td>
<td>{{ data.frequency_rate }}</td>
<td>{{ data.frequency_rate| percent: '1.1-2' }}</td>
<td>{{ data.ip_count }}</td>
<td>{{ data.ip_reat }}</td>
<td>{{ data.ip_avg }}</td>
<td>{{ data.trend }}</td>
<td>{{ data.ip_rate| percent: '1.1-2' }}</td>
<td>{{ data.ip_avg| number: '1.2-2' }}</td>
<td>{{ data.trend| percent: '1.1-2' }}</td>
</tr>
</tbody>
</nz-table>
<nz-table *ngIf="dimension === '2'" #basicTable [nzData]="listOfData">
<nz-table *ngIf="tableisShow === '2'" #basicTable [nzData]="listOfData">
<thead>
<tr>
<th>归属单位</th>
@ -75,18 +77,18 @@
"account_reat": 0.3,
"account_avg": 0.43,
"trend": 0.3 -->
<td>{{ data.company }}</td>
<td><a (click)="showModel({type: 2, key: data.company})">{{data.company}}</a></td>
<td>{{ data.req_frequency }}</td>
<td>{{ data.frequency_rate }}</td>
<td>{{ data.frequency_rate| percent: '1.1-2' }}</td>
<td>{{ data.account_count }}</td>
<td>{{ data.account_reat }}</td>
<td>{{ data.account_avg }}</td>
<td>{{ data.trend }}</td>
<td>{{ data.account_rate| percent: '1.1-2' }}</td>
<td>{{ data.account_avg| number: '1.2-2' }}</td>
<td>{{ data.trend| percent: '1.1-2' }}</td>
</tr>
</tbody>
</nz-table>
<nz-table *ngIf="dimension === '3'" #basicTable [nzData]="listOfData">
<nz-table *ngIf="tableisShow === '3'" #basicTable [nzData]="listOfData">
<thead>
<tr>
<th>接口地址</th>
@ -103,15 +105,16 @@
"frequency_rate": 0.160727824109174,
"frequency_avg": 0,
"trend": 0.07 -->
<td>{{ data.interface_addr }}</td>
<td><a (click)="showModel({type: 3, key: data.interface_addr})">{{ data.interface_addr }}</a></td>
<td>{{ data.req_frequency }}</td>
<td>{{ data.frequency_avg }}</td>
<td>{{ data.trend }}</td>
<td>{{ data.frequency_rate | percent: '1.1-2' }}</td>
<td>{{ data.frequency_avg| number: '1.2-2' }}</td>
<td>{{ data.trend| percent: '1.1-2' }}</td>
</tr>
</tbody>
</nz-table>
<nz-table *ngIf="dimension === '4'" #basicTable [nzData]="listOfData">
<nz-table *ngIf="tableisShow === '4'" #basicTable [nzData]="listOfData">
<thead>
<tr>
<th>菜单名称</th>
@ -128,18 +131,22 @@
"frequency_rate": 0.263449367088608,
"frequency_avg": 111,
"trend": 0.09 -->
<td>{{ data.menu_name }}</td>
<td><a (click)="showModel({type: 3, key: data.menu_name})">{{ data.menu_name }}</a></td>
<td>{{ data.req_frequency }}</td>
<td>{{ data.frequency_avg }}</td>
<td>{{ data.trend }}</td>
<td>{{ data.frequency_rate| percent: '1.1-2' }}</td>
<td>{{ data.frequency_avg| number: '1.2-2'}}</td>
<td>{{ data.trend| percent: '1.1-2' }}</td>
</tr>
</tbody>
</nz-table>
</div>
<nz-modal [(nzVisible)]="isVisible" nzWidth="80%" nzTitle="The first Modal" (nzOnCancel)="isVisible = false" >
<app-path></app-path>
</nz-modal>
<app-process [visible]="submitLoading" (onCancel)="cancelSearch()">
</app-process>
<nz-modal [(nzVisible)]="isVisible" nzWidth="80%" nzTitle="The first Modal" (nzOnCancel)="isVisible = false" >
<app-path [detail_data]="detail_data"></app-path>
</nz-modal>
</div>

File diff suppressed because it is too large Load Diff

@ -4,13 +4,13 @@ import { CommonModule } from '@angular/common';
import { ManageComponent } from './manage.component';
import { SharedModule } from 'src/app/common-ui';
import { PathComponent } from './path/path.component';
import { ProcessComponent } from './process/process.component';
@NgModule({
imports: [
CommonModule,
SharedModule
],
declarations: [PathComponent, ManageComponent]
declarations: [PathComponent, ManageComponent,ProcessComponent]
})
export class ManageModule {}

@ -1,4 +1,6 @@
<!-- <app-wechart-robot [data]="wechartRobotData"></app-wechart-robot> -->
<div>cdfddffff</div>
<div>
<p>Name: {{ detail_data.type }}</p>
</div>

@ -8,14 +8,7 @@ import { NoticeService } from '../../../service/https/notice.service';
styleUrls: ['./path.component.styl']
})
export class PathComponent implements OnInit {
@Input() datas: any;
data;
mailData: any;
messageData: any;
qywechatData: any;
dingtalkData: any;
wechartRobotData: any;
dingdingRobotData: any;
@Input() detail_data: any;
constructor(
private noticeService: NoticeService,
@ -23,47 +16,6 @@ export class PathComponent implements OnInit {
) {}
ngOnInit() {
this.queryData();
}
queryData() {
this.noticeService.queryConfig().subscribe(
resp => {
if (resp.status === 200) {
// console.log(resp.data);
this.data = resp.data;
this.processData(this.data);
} else {
this.message.error(resp.msg);
}
},
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;
}
});
}
}

@ -0,0 +1,18 @@
<nz-modal [(nzVisible)]="open"
[nzMaskClosable]="false"
[nzKeyboard]="false"
(nzOnCancel)="justClose()"
[nzFooter]="footer"
nzTitle="搜索进度">
<nz-row>
<nz-col nzSpan="4">查询进度</nz-col>
<nz-col nzSpan="20">
<nz-progress [nzPercent]="process">
</nz-progress>
</nz-col>
</nz-row>
</nz-modal>
<ng-template #footer>
<button nz-button (click)="cancel()">取消查询</button>
</ng-template>

@ -0,0 +1,28 @@
/* tslint:disable:no-unused-variable */
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { By } from '@angular/platform-browser';
import { DebugElement } from '@angular/core';
import { PathComponent } from './process.component';
describe('PathComponent', () => {
let component: PathComponent;
let fixture: ComponentFixture<PathComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ PathComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(PathComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

@ -0,0 +1,88 @@
import {
ChangeDetectionStrategy,
ChangeDetectorRef,
Component,
EventEmitter,
Input,
OnChanges,
Output,
SimpleChanges
} from '@angular/core';
@Component({
selector: 'app-process',
templateUrl: './process.component.html',
styleUrls: ['./process.component.styl'],
changeDetection: ChangeDetectionStrategy.OnPush
})
// @ts-ignore
export class ProcessComponent implements OnChanges {
// @ts-ignore
@Input() visible = false;
// @ts-ignore
// tslint:disable-next-line:no-output-on-prefix
@Output() onCancel = new EventEmitter();
open = false;
process = 0;
intervalId = -1;
constructor(
private cdr: ChangeDetectorRef
) {}
ngOnChanges(changes: SimpleChanges): void {
const visible = changes['visible'];
if (visible.currentValue !== null) {
if (visible.currentValue) {
this.start();
}
}
}
random() {
const acc = Math.ceil(Math.random() * 10);
const added = this.process + acc;
this.process = added >= 99 ? 99 : added;
}
start() {
this.open = true;
this.process = 0;
clearTimeout(this.intervalId);
this.ticker();
}
ticker() {
this.intervalId = setTimeout(() => {
if (this.visible) {
this.random();
this.ticker();
} else {
this.process = 100;
this.autoClose();
}
this.cdr.markForCheck();
}, 1000);
}
cancel() {
this.open = false;
clearTimeout(this.intervalId);
this.onCancel.emit();
}
autoClose() {
clearTimeout(this.intervalId);
setTimeout(() => {
this.open = false;
this.cdr.markForCheck();
}, 300);
}
justClose() {
this.open = false;
clearTimeout(this.intervalId);
}
}

@ -35,7 +35,208 @@ export class NoticeService {
}
getUebaResult(params:any) {
const url = '/UebaMetricsAnalysis/ueba_metrics/get_summary_data_list';
const url = '/uebaMetricsAnalysis/ueba_metrics/get_summary_data_list';
return this.httpService.get(url, params,30000);
}
// 引擎接口
// 获取已有的白名单
whiteListQuery(params){
// {
// "message": "success",
// "code": 200,
// "data": {
// "total": 3,
// "data": [
// {
// "white_content": {
// "sip": "128.3.212.3"
// },
// "update_time": 1717731552,
// "alert_rule_id": [
// 400000
// ],
// "name": "test2",
// "white_rule": {
// "url": [
// "http://baid.com"
// ],
// "sip": {
// "ip_range_list": [],
// "single_ip_list": [
// "128.3.212.3"
// ]
// }
// },
// "des": "\u63cf\u8ff0\u4fe1\u606f",
// "event_rule_id": [],
// "range": [
// "ueba"
// ],
// "is_enable": 1,
// "create_time": 1717731479,
// "is_gray": 0,
// "id": 5
// },
// {
// "white_content": {
// "url": "http://baid.com",
// "sip": "128.3.212.3"
// },
// "update_time": 1717730831,
// "alert_rule_id": [
// 400000
// ],
// "name": "test2",
// "white_rule": {
// "url": [
// "http://baid.com"
// ],
// "sip": {
// "ip_range_list": [],
// "single_ip_list": [
// "128.3.212.3"
// ]
// }
// },
// "des": "\u63cf\u8ff0\u4fe1\u606f",
// "event_rule_id": [],
// "range": [
// "ueba"
// ],
// "is_enable": 1,
// "create_time": 1717730546,
// "is_gray": 0,
// "id": 2
// },
// {
// "white_content": {
// "dport": "123",
// "sip": "0.0.0.0",
// "dip": "0.0.0.0",
// "sport": "111"
// },
// "update_time": 1717399034,
// "alert_rule_id": [],
// "name": "test",
// "white_rule": {
// "dport": [
// 123
// ],
// "sip": {
// "ip_range_list": [],
// "single_ip_list": [
// "0.0.0.0"
// ]
// },
// "dip": {
// "ip_range_list": [],
// "single_ip_list": [
// "0.0.0.0"
// ]
// },
// "sport": [
// 111
// ]
// },
// "des": "",
// "event_rule_id": [
// 490002
// ],
// "range": [
// "cep"
// ],
// "is_enable": 1,
// "create_time": 1713409218,
// "is_gray": 0,
// "id": 1
// }
// ]
// }
// }
//pageIndex,pageSize
//const url = '/ditingEngine/diting/global/whitelist_query/?pageIndex=1&pageSize=10000';
const url = '/ditingEngine/diting/global/whitelist_query';
return this.httpService.get(url, params);
}
// 获取已有的灰名单
greyListQyery(param){
// {
// "message": "\u8c1b\u542c\u5f15\u64ce-\u540d\u5355\u67e5\u8be2\u6210\u529f",
// "code": 200,
// "data": {
// "total": 1,
// "data": [
// {
// "white_content": {
// "url": "http://baid.com",
// "sip": "187.23.23.4"
// },
// "update_time": 1717730747,
// "alert_rule_id": [
// 400000
// ],
// "name": "\u7070\u540d\u5355-\u540d\u79f0",
// "des": "\u7070\u540d\u5355-\u63cf\u8ff0",
// "range": "ueba",
// "is_enable": 1,
// "create_time": 1717730747,
// "is_gray": 1,
// "id": 3
// }
// ]
// }
// }
// const url = 'https://10.65.74.3/ditingEngine/ueba/engine_name_list/query/?pageIndex=1&pageSize=10&type=0';
const url = '/ditingEngine/ueba/engine_name_list/query';
return this.httpService.get(url,param);
}
// 添加白名单
addWhitelist(params){
// {
// "range": [
// "ueba"
// ],
// "fields": [
// "sip",
// ],
// "name": "test2",//ip+加入时间
// "des": "",
// "is_enable": 1,
// "content": {
// "sip": "128.3.212.3",
// },
// "alert_rule_id": [
// 400000,
// 400000
// ]
// }
const url = '/ditingEngine/diting/global/whitelist_add';
return this.httpService.post(url,{}, params);
}
// 添加灰名单
addGreyList(params){
// {
// "fields": [
// "sip",
// "url"
// ],
// "name": "灰名单-名称",//ip+加入时间
// "alert_rule_id": [
// 400000
// ],
// "des": "灰名单-描述",
// "is_enable": 1,
// "content": {
// "sip": "187.23.23.4",
// "url": "http://baid.com"
// },
// "type": 0
// }
const url = '/ditingEngine/diting/global/whitelist_add';
return this.httpService.post(url,{}, params);
}
}

@ -1,5 +1,5 @@
export const environment = {
production: true,
productionUrls: '/WebApi/notice/static/dist/',
productionUrls: '/WebApi/uebaMetricsAnalysis/static/dist/',
hashPrefx: ''
};

@ -5,7 +5,7 @@
export const environment = {
production: false,
productionUrls: '',
hashPrefx: '/WebApi/notice/static/dist/'
hashPrefx: '/WebApi/uebaMetricsAnalysis/static/dist/'
};
/*

Loading…
Cancel
Save