[web-app] 告警通知-接收人配置和消息策略配置。全局字体基础大小修改为12px

This commit is contained in:
tomsun28
2021-12-16 22:10:57 +08:00
parent 0f6a0168d5
commit bf0a193724
12 changed files with 583 additions and 15 deletions

View File

@@ -0,0 +1,16 @@
import { TestBed } from '@angular/core/testing';
import { NoticeReceiverService } from './notice-receiver.service';
describe('NoticeReceiverService', () => {
let service: NoticeReceiverService;
beforeEach(() => {
TestBed.configureTestingModule({});
service = TestBed.inject(NoticeReceiverService);
});
it('should be created', () => {
expect(service).toBeTruthy();
});
});

View File

@@ -0,0 +1,32 @@
import { Injectable } from '@angular/core';
import {HttpClient} from "@angular/common/http";
import {Observable} from "rxjs";
import {Message} from "../pojo/Message";
import {NoticeReceiver} from "../pojo/NoticeReceiver";
const notice_receiver_uri = '/notice/receiver';
const notice_receivers_uri = '/notice/receivers';
@Injectable({
providedIn: 'root'
})
export class NoticeReceiverService {
constructor(private http : HttpClient) { }
public newReceiver(body: NoticeReceiver) : Observable<Message<any>> {
return this.http.post<Message<any>>(notice_receiver_uri, body);
}
public editReceiver(body: NoticeReceiver) : Observable<Message<any>> {
return this.http.put<Message<any>>(notice_receiver_uri, body);
}
public deleteReceiver(receiverId: number) : Observable<Message<any>> {
return this.http.delete<Message<any>>(`${notice_receiver_uri}/${receiverId}`);
}
public getReceivers() : Observable<Message<NoticeReceiver[]>> {
return this.http.get<Message<NoticeReceiver[]>>(notice_receivers_uri);
}
}

View File

@@ -0,0 +1,16 @@
import { TestBed } from '@angular/core/testing';
import { NoticeRuleService } from './notice-rule.service';
describe('NoticeRuleService', () => {
let service: NoticeRuleService;
beforeEach(() => {
TestBed.configureTestingModule({});
service = TestBed.inject(NoticeRuleService);
});
it('should be created', () => {
expect(service).toBeTruthy();
});
});

View File

@@ -0,0 +1,32 @@
import { Injectable } from '@angular/core';
import {Observable} from "rxjs";
import {Message} from "../pojo/Message";
import {HttpClient} from "@angular/common/http";
import {NoticeRule} from "../pojo/NoticeRule";
const notice_rule_uri = '/notice/rule';
const notice_rules_uri = '/notice/rules';
@Injectable({
providedIn: 'root'
})
export class NoticeRuleService {
constructor(private http : HttpClient) { }
public newNoticeRule(body: NoticeRule) : Observable<Message<any>> {
return this.http.post<Message<any>>(notice_rule_uri, body);
}
public editNoticeRule(body: NoticeRule) : Observable<Message<any>> {
return this.http.put<Message<any>>(notice_rule_uri, body);
}
public deleteNoticeRule(ruleId: number) : Observable<Message<any>> {
return this.http.delete<Message<any>>(`${notice_rule_uri}/${ruleId}`);
}
public getNoticeRules() : Observable<Message<NoticeRule[]>> {
return this.http.get<Message<NoticeRule[]>>(notice_rules_uri);
}
}