web/admin: show warning on provider when not used with outpost

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer
2021-11-05 01:05:43 +01:00
parent 909461e533
commit 3005ca17bd
9 changed files with 80 additions and 3 deletions

View File

@ -4,6 +4,7 @@ import { CSSResult, LitElement, TemplateResult, html } from "lit";
import { customElement, property } from "lit/decorators.js";
import AKGlobal from "../../../authentik.css";
import PFBanner from "@patternfly/patternfly/components/Banner/banner.css";
import PFButton from "@patternfly/patternfly/components/Button/button.css";
import PFCard from "@patternfly/patternfly/components/Card/card.css";
import PFContent from "@patternfly/patternfly/components/Content/content.css";
@ -55,6 +56,7 @@ export class ProxyProviderViewPage extends LitElement {
PFContent,
PFCard,
PFDescriptionList,
PFBanner,
AKGlobal,
];
}
@ -71,7 +73,17 @@ export class ProxyProviderViewPage extends LitElement {
if (!this.provider) {
return html``;
}
return html`<ak-tabs>
return html` <ak-tabs>
${this.provider?.assignedApplicationName
? html``
: html`<div slot="header" class="pf-c-banner pf-m-warning">
${t`Warning: Provider is not used by an Application.`}
</div>`}
${this.provider?.outpostSet.length < 1
? html`<div slot="header" class="pf-c-banner pf-m-warning">
${t`Warning: Provider is not used by any Outpost.`}
</div>`
: html``}
<section
slot="page-overview"
data-tab-title="${t`Overview`}"