web: migrate Policy list to web
This commit is contained in:
		| @ -1,15 +1,18 @@ | ||||
| import { DefaultClient, BaseInheritanceModel, AKResponse, QueryArguments } from "./Client"; | ||||
| import { TypeCreate } from "./Providers"; | ||||
|  | ||||
| export class Policy implements BaseInheritanceModel { | ||||
|     pk: string; | ||||
|     name: string; | ||||
|     execution_logging: boolean; | ||||
|     object_type: string; | ||||
|     verbose_name: string; | ||||
|     verbose_name_plural: string; | ||||
|     bound_to: number; | ||||
|  | ||||
|     constructor() { | ||||
|         throw Error(); | ||||
|     } | ||||
|     object_type: string; | ||||
|     verbose_name: string; | ||||
|     verbose_name_plural: string; | ||||
|  | ||||
|     static get(pk: string): Promise<Policy> { | ||||
|         return DefaultClient.fetch<Policy>(["policies", "all", pk]); | ||||
| @ -24,4 +27,12 @@ export class Policy implements BaseInheritanceModel { | ||||
|             return r.count; | ||||
|         }); | ||||
|     } | ||||
|  | ||||
|     static getTypes(): Promise<TypeCreate[]> { | ||||
|         return DefaultClient.fetch<TypeCreate[]>(["policies", "all", "types"]); | ||||
|     } | ||||
|  | ||||
|     static adminUrl(rest: string): string { | ||||
|         return `/administration/policies/${rest}`; | ||||
|     } | ||||
| } | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 Jens Langhammer
					Jens Langhammer