From 6eed549577c4235e9c231720e33dfce6f780bc6e Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Thu, 31 Dec 2020 11:21:52 +0100 Subject: [PATCH] web: add EventInfo case for policy_execution --- web/src/api/Events.ts | 2 +- web/src/pages/events/EventInfo.ts | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/web/src/api/Events.ts b/web/src/api/Events.ts index b0b08fd65..78fcb63e0 100644 --- a/web/src/api/Events.ts +++ b/web/src/api/Events.ts @@ -8,7 +8,7 @@ export interface EventUser { } export interface EventContext { - [key: string]: EventContext | string | number; + [key: string]: EventContext | string | number | string[]; } export class Event { diff --git a/web/src/pages/events/EventInfo.ts b/web/src/pages/events/EventInfo.ts index 78d555028..243e0e859 100644 --- a/web/src/pages/events/EventInfo.ts +++ b/web/src/pages/events/EventInfo.ts @@ -94,6 +94,29 @@ export class EventInfo extends LitElement { ${this.event.context.expression} `; + case "policy_execution": + return html`
+
+

${gettext("Request")}

+
    +
  • ${gettext("Object")}: ${(this.event.context.request as EventContext).obj as string}
  • +
  • ${gettext("Context")}: ${JSON.stringify((this.event.context.request as EventContext).context)}
  • +
+
+
+

${gettext("Result")}

+
    +
  • ${gettext("Passing")}: ${(this.event.context.result as EventContext).passing}
  • +
  • ${gettext("Messages")}: +
      + ${((this.event.context.result as EventContext).messages as string[]).map(msg => { + return html`
    • ${msg}
    • `; + })} +
    +
  • +
+
+
`; case "configuration_error": return html`

${this.event.context.message}

`; case "update_available":