web: add button to create application on provider page

This commit is contained in:
Jens Langhammer
2021-02-16 20:00:34 +01:00
parent 0b75a0028b
commit 416d949d80
7 changed files with 46 additions and 23 deletions

View File

@ -4,11 +4,15 @@ export const SLUG_REGEX = "[-a-zA-Z0-9_]+";
export const ID_REGEX = "\\d+";
export const UUID_REGEX = "[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}";
export interface RouteArgs {
[key: string]: string;
}
export class Route {
url: RegExp;
private element?: TemplateResult;
private callback?: (args: { [key: string]: string }) => TemplateResult;
private callback?: (args: RouteArgs) => TemplateResult;
constructor(url: RegExp, element?: TemplateResult) {
this.url = url;
@ -24,12 +28,12 @@ export class Route {
return this;
}
then(render: (args: { [key: string]: string }) => TemplateResult): Route {
then(render: (args: RouteArgs) => TemplateResult): Route {
this.callback = render;
return this;
}
render(args: { [key: string]: string }): TemplateResult {
render(args: RouteArgs): TemplateResult {
if (this.callback) {
return this.callback(args);
}