web: add event transports UI

This commit is contained in:
Jens Langhammer
2021-01-12 22:03:50 +01:00
parent cac94792fa
commit cb36a3c8c7
6 changed files with 126 additions and 9 deletions

View File

@ -0,0 +1,25 @@
import { DefaultClient, QueryArguments, PBResponse } from "./Client";
export class Transport {
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}`;
}
}