events: include full group in event notification

This commit is contained in:
Jens Langhammer
2021-01-14 16:58:21 +01:00
parent 7ff679b1a3
commit 1342266368
6 changed files with 121 additions and 18 deletions

View File

@ -0,0 +1,25 @@
import { DefaultClient, QueryArguments, PBResponse } from "./Client";
export class Notification {
pk: string;
name: string;
mode: string;
mode_verbose: string;
webhook_url: string;
constructor() {
throw Error();
}
static get(pk: string): Promise<Transport> {
return DefaultClient.fetch<Transport>(["events", "transports", pk]);
}
static list(filter?: QueryArguments): Promise<PBResponse<Transport>> {
return DefaultClient.fetch<PBResponse<Transport>>(["events", "transports"], filter);
}
static adminUrl(rest: string): string {
return `/administration/events/transports/${rest}`;
}
}

View File

@ -1,11 +1,12 @@
import { DefaultClient, QueryArguments, PBResponse } from "./Client";
import { Group } from "./Groups";
export class Trigger {
pk: string;
name: string;
transports: string[];
severity: string;
group?: string;
group?: Group;
constructor() {
throw Error();

13
web/src/api/Groups.ts Normal file
View File

@ -0,0 +1,13 @@
export class Group {
group_uuid: string;
name: string;
is_superuser: boolean;
attributes: object;
parent?: Group;
constructor() {
throw Error();
}
}