policies: add policy log messages to test endpoints

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer
2022-04-01 22:07:35 +02:00
parent 4be238018b
commit d84ff2bbca
18 changed files with 2065 additions and 2302 deletions

View File

@ -2811,6 +2811,11 @@ msgstr "Lokal"
#~ msgid "Locale"
#~ msgstr "Gebietsschema"
#: src/pages/applications/ApplicationCheckAccessForm.ts
#: src/pages/policies/PolicyTestForm.ts
msgid "Log messages"
msgstr ""
#: src/pages/stages/user_login/UserLoginStageForm.ts
msgid "Log the currently pending user in."
msgstr "Melden Sie den aktuell ausstehenden Benutzer an."
@ -3172,6 +3177,11 @@ msgstr "Kein Formular gefunden"
msgid "No integration active"
msgstr "Keine Integrationen aktiv"
#: src/pages/applications/ApplicationCheckAccessForm.ts
#: src/pages/policies/PolicyTestForm.ts
msgid "No log messages."
msgstr ""
#: src/elements/events/ObjectChangelog.ts
#: src/elements/events/UserEvents.ts
msgid "No matching events could be found."

View File

@ -2855,6 +2855,11 @@ msgstr "Local"
#~ msgid "Locale"
#~ msgstr "Locale"
#: src/pages/applications/ApplicationCheckAccessForm.ts
#: src/pages/policies/PolicyTestForm.ts
msgid "Log messages"
msgstr "Log messages"
#: src/pages/stages/user_login/UserLoginStageForm.ts
msgid "Log the currently pending user in."
msgstr "Log the currently pending user in."
@ -3217,6 +3222,11 @@ msgstr "No form found"
msgid "No integration active"
msgstr "No integration active"
#: src/pages/applications/ApplicationCheckAccessForm.ts
#: src/pages/policies/PolicyTestForm.ts
msgid "No log messages."
msgstr "No log messages."
#: src/elements/events/ObjectChangelog.ts
#: src/elements/events/UserEvents.ts
msgid "No matching events could be found."

View File

@ -2804,6 +2804,11 @@ msgstr "Local"
#~ msgid "Locale"
#~ msgstr "Lugar"
#: src/pages/applications/ApplicationCheckAccessForm.ts
#: src/pages/policies/PolicyTestForm.ts
msgid "Log messages"
msgstr ""
#: src/pages/stages/user_login/UserLoginStageForm.ts
msgid "Log the currently pending user in."
msgstr "Registra al usuario pendiente en ese momento."
@ -3165,6 +3170,11 @@ msgstr "No se encontró ningún formulario"
msgid "No integration active"
msgstr "Sin integración activa"
#: src/pages/applications/ApplicationCheckAccessForm.ts
#: src/pages/policies/PolicyTestForm.ts
msgid "No log messages."
msgstr ""
#: src/elements/events/ObjectChangelog.ts
#: src/elements/events/UserEvents.ts
msgid "No matching events could be found."

View File

@ -2835,6 +2835,11 @@ msgstr "Local"
#~ msgid "Locale"
#~ msgstr ""
#: src/pages/applications/ApplicationCheckAccessForm.ts
#: src/pages/policies/PolicyTestForm.ts
msgid "Log messages"
msgstr ""
#: src/pages/stages/user_login/UserLoginStageForm.ts
msgid "Log the currently pending user in."
msgstr "Ouvre la session de l'utilisateur courant."
@ -3196,6 +3201,11 @@ msgstr "Aucun formulaire trouvé"
msgid "No integration active"
msgstr "Aucune intégration active"
#: src/pages/applications/ApplicationCheckAccessForm.ts
#: src/pages/policies/PolicyTestForm.ts
msgid "No log messages."
msgstr ""
#: src/elements/events/ObjectChangelog.ts
#: src/elements/events/UserEvents.ts
msgid "No matching events could be found."

View File

@ -2801,6 +2801,11 @@ msgstr "Lokalny"
#~ msgid "Locale"
#~ msgstr "Język"
#: src/pages/applications/ApplicationCheckAccessForm.ts
#: src/pages/policies/PolicyTestForm.ts
msgid "Log messages"
msgstr ""
#: src/pages/stages/user_login/UserLoginStageForm.ts
msgid "Log the currently pending user in."
msgstr "Loguj aktualnie oczekującego użytkownika."
@ -3162,6 +3167,11 @@ msgstr "Nie znaleziono formularza"
msgid "No integration active"
msgstr "Brak aktywnej integracji"
#: src/pages/applications/ApplicationCheckAccessForm.ts
#: src/pages/policies/PolicyTestForm.ts
msgid "No log messages."
msgstr ""
#: src/elements/events/ObjectChangelog.ts
#: src/elements/events/UserEvents.ts
msgid "No matching events could be found."

View File

@ -2845,6 +2845,11 @@ msgstr ""
#~ msgid "Locale"
#~ msgstr ""
#: src/pages/applications/ApplicationCheckAccessForm.ts
#: src/pages/policies/PolicyTestForm.ts
msgid "Log messages"
msgstr ""
#: src/pages/stages/user_login/UserLoginStageForm.ts
msgid "Log the currently pending user in."
msgstr ""
@ -3207,6 +3212,11 @@ msgstr ""
msgid "No integration active"
msgstr ""
#: src/pages/applications/ApplicationCheckAccessForm.ts
#: src/pages/policies/PolicyTestForm.ts
msgid "No log messages."
msgstr ""
#: src/elements/events/ObjectChangelog.ts
#: src/elements/events/UserEvents.ts
msgid "No matching events could be found."

View File

@ -2805,6 +2805,11 @@ msgstr "Yerel"
#~ msgid "Locale"
#~ msgstr "Yerelleştirme"
#: src/pages/applications/ApplicationCheckAccessForm.ts
#: src/pages/policies/PolicyTestForm.ts
msgid "Log messages"
msgstr ""
#: src/pages/stages/user_login/UserLoginStageForm.ts
msgid "Log the currently pending user in."
msgstr "Şu anda bekleyen kullanıcıya oturum açın."
@ -3166,6 +3171,11 @@ msgstr "Form bulunamadı"
msgid "No integration active"
msgstr "Entegrasyon etkin"
#: src/pages/applications/ApplicationCheckAccessForm.ts
#: src/pages/policies/PolicyTestForm.ts
msgid "No log messages."
msgstr ""
#: src/elements/events/ObjectChangelog.ts
#: src/elements/events/UserEvents.ts
msgid "No matching events could be found."

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,9 +1,11 @@
import { t } from "@lingui/macro";
import { TemplateResult, html } from "lit";
import { CSSResult, TemplateResult, html } from "lit";
import { customElement, property } from "lit/decorators.js";
import { until } from "lit/directives/until.js";
import PFDescriptionList from "@patternfly/patternfly/components/DescriptionList/description-list.css";
import { Application, CoreApi, PolicyTestResult } from "@goauthentik/api";
import { DEFAULT_CONFIG } from "../../api/Config";
@ -42,8 +44,13 @@ export class ApplicationCheckAccessForm extends Form<{ forUser: number }> {
this.result = undefined;
}
static get styles(): CSSResult[] {
return super.styles.concat(PFDescriptionList);
}
renderResult(): TemplateResult {
return html` <ak-form-element-horizontal label=${t`Passing`}>
return html`
<ak-form-element-horizontal label=${t`Passing`}>
<div class="pf-c-form__group-label">
<div class="c-form__horizontal-group">
<span class="pf-c-form__label-text">
@ -70,7 +77,38 @@ export class ApplicationCheckAccessForm extends Form<{ forUser: number }> {
</ul>
</div>
</div>
</ak-form-element-horizontal>`;
</ak-form-element-horizontal>
<ak-form-element-horizontal label=${t`Log messages`}>
<div class="pf-c-form__group-label">
<div class="c-form__horizontal-group">
<dl class="pf-c-description-list pf-m-horizontal">
${(this.result?.logMessages || []).length > 0
? this.result?.logMessages?.map((m) => {
return html`<div class="pf-c-description-list__group">
<dt class="pf-c-description-list__term">
<span class="pf-c-description-list__text"
>${m.log_level}</span
>
</dt>
<dd class="pf-c-description-list__description">
<div class="pf-c-description-list__text">
${m.event}
</div>
</dd>
</div>`;
})
: html`<div class="pf-c-description-list__group">
<dt class="pf-c-description-list__term">
<span class="pf-c-description-list__text"
>${t`No log messages.`}</span
>
</dt>
</div>`}
</dl>
</div>
</div>
</ak-form-element-horizontal>
`;
}
renderForm(): TemplateResult {

View File

@ -2,10 +2,12 @@ import YAML from "yaml";
import { t } from "@lingui/macro";
import { TemplateResult, html } from "lit";
import { CSSResult, TemplateResult, html } from "lit";
import { customElement, property } from "lit/decorators.js";
import { until } from "lit/directives/until.js";
import PFDescriptionList from "@patternfly/patternfly/components/DescriptionList/description-list.css";
import {
CoreApi,
PoliciesApi,
@ -47,8 +49,13 @@ export class PolicyTestForm extends Form<PolicyTestRequest> {
.then((result) => (this.result = result));
};
static get styles(): CSSResult[] {
return super.styles.concat(PFDescriptionList);
}
renderResult(): TemplateResult {
return html` <ak-form-element-horizontal label=${t`Passing`}>
return html`
<ak-form-element-horizontal label=${t`Passing`}>
<div class="pf-c-form__group-label">
<div class="c-form__horizontal-group">
<span class="pf-c-form__label-text">
@ -75,7 +82,39 @@ export class PolicyTestForm extends Form<PolicyTestRequest> {
</ul>
</div>
</div>
</ak-form-element-horizontal>`;
</ak-form-element-horizontal>
<ak-form-element-horizontal label=${t`Log messages`}>
<div class="pf-c-form__group-label">
<div class="c-form__horizontal-group">
<dl class="pf-c-description-list pf-m-horizontal">
${(this.result?.logMessages || []).length > 0
? this.result?.logMessages?.map((m) => {
return html`<div class="pf-c-description-list__group">
<dt class="pf-c-description-list__term">
<span class="pf-c-description-list__text"
>${m.log_level}</span
>
</dt>
<dd class="pf-c-description-list__description">
<div class="pf-c-description-list__text">
${m.event}
</div>
</dd>
</div>`;
})
: html`<div class="pf-c-description-list__group">
<dt class="pf-c-description-list__term">
<span class="pf-c-description-list__text"
>${t`No log messages.`}</span
>
</dt>
</div>`}
</dl>
</div>
</div>
</ak-form-element-horizontal>
`;
}
renderForm(): TemplateResult {