web: add execute button to flow view page

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2021-03-23 16:06:08 +01:00
parent 33787d0685
commit 45c1072291
2 changed files with 27 additions and 9 deletions

View File

@ -75,7 +75,7 @@ export class ApplicationViewPage extends LitElement {
<ak-tabs> <ak-tabs>
<section slot="page-1" data-tab-title="${gettext("Overview")}" class="pf-c-page__main-section pf-m-no-padding-mobile"> <section slot="page-1" data-tab-title="${gettext("Overview")}" class="pf-c-page__main-section pf-m-no-padding-mobile">
<div class="pf-l-gallery pf-m-gutter"> <div class="pf-l-gallery pf-m-gutter">
<div class="pf-c-card pf-c-card-aggregate pf-l-gallery__item pf-m-4-col" style="grid-column-end: span 3;grid-row-end: span 2;"> <div class="pf-c-card pf-l-gallery__item" style="grid-column-end: span 3;grid-row-end: span 2;">
<div class="pf-c-card__title">${gettext("Logins over the last 24 hours")}</div> <div class="pf-c-card__title">${gettext("Logins over the last 24 hours")}</div>
<div class="pf-c-card__body"> <div class="pf-c-card__body">
${this.application && html` ${this.application && html`
@ -83,7 +83,7 @@ export class ApplicationViewPage extends LitElement {
</ak-charts-application-authorize>`} </ak-charts-application-authorize>`}
</div> </div>
</div> </div>
<div class="pf-c-card pf-c-card-aggregate pf-l-gallery__item pf-m-2-col"> <div class="pf-c-card pf-l-gallery__item">
<div class="pf-c-card__title">${gettext("Related")}</div> <div class="pf-c-card__title">${gettext("Related")}</div>
<div class="pf-c-card__body"> <div class="pf-c-card__body">
<dl class="pf-c-description-list"> <dl class="pf-c-description-list">
@ -104,7 +104,7 @@ export class ApplicationViewPage extends LitElement {
</dl> </dl>
</div> </div>
</div> </div>
<div class="pf-c-card pf-c-card-aggregate pf-l-gallery__item pf-m-4-col" style="grid-column-end: span 3;grid-row-end: span 2;"> <div class="pf-c-card pf-l-gallery__item" style="grid-column-end: span 3;grid-row-end: span 2;">
<div class="pf-c-card__title">${gettext("Changelog")}</div> <div class="pf-c-card__title">${gettext("Changelog")}</div>
<div class="pf-c-card__body"> <div class="pf-c-card__body">
<ak-object-changelog <ak-object-changelog

View File

@ -16,9 +16,8 @@ import PFCard from "@patternfly/patternfly/components/Card/card.css";
import PFContent from "@patternfly/patternfly/components/Content/content.css"; import PFContent from "@patternfly/patternfly/components/Content/content.css";
import AKGlobal from "../../authentik.css"; import AKGlobal from "../../authentik.css";
import PFBase from "@patternfly/patternfly/patternfly-base.css"; import PFBase from "@patternfly/patternfly/patternfly-base.css";
import PFFlex from "@patternfly/patternfly/utilities/Flex/flex.css"; import PFGallery from "@patternfly/patternfly/layouts/Gallery/gallery.css";
import PFDisplay from "@patternfly/patternfly/utilities/Display/display.css"; import { AdminURLManager } from "../../api/legacy";
import PFSizing from "@patternfly/patternfly/utilities/Sizing/sizing.css";
@customElement("ak-flow-view") @customElement("ak-flow-view")
export class FlowViewPage extends LitElement { export class FlowViewPage extends LitElement {
@ -35,7 +34,7 @@ export class FlowViewPage extends LitElement {
flow!: Flow; flow!: Flow;
static get styles(): CSSResult[] { static get styles(): CSSResult[] {
return [PFBase, PFPage, PFCard, PFContent, PFFlex, PFSizing, PFDisplay, AKGlobal].concat( return [PFBase, PFPage, PFCard, PFContent, PFGallery, AKGlobal].concat(
css` css`
img.pf-icon { img.pf-icon {
max-height: 24px; max-height: 24px;
@ -62,8 +61,8 @@ export class FlowViewPage extends LitElement {
</section> </section>
<ak-tabs> <ak-tabs>
<div slot="page-1" data-tab-title="${gettext("Flow Overview")}" class="pf-c-page__main-section pf-m-no-padding-mobile"> <div slot="page-1" data-tab-title="${gettext("Flow Overview")}" class="pf-c-page__main-section pf-m-no-padding-mobile">
<div class="pf-u-display-flex"> <div class="pf-l-gallery pf-m-gutter">
<div class="pf-u-w-75"> <div class="pf-c-card pf-l-gallery__item" style="grid-column-end: span 3;grid-row-end: span 2;">
<div class="pf-c-card"> <div class="pf-c-card">
<div class="pf-c-card__body"> <div class="pf-c-card__body">
<ak-flow-diagram flowSlug=${this.flow.slug}> <ak-flow-diagram flowSlug=${this.flow.slug}>
@ -71,6 +70,25 @@ export class FlowViewPage extends LitElement {
</div> </div>
</div> </div>
</div> </div>
<div class="pf-c-card pf-l-gallery__item">
<div class="pf-c-card__title">${gettext("Related")}</div>
<div class="pf-c-card__body">
<dl class="pf-c-description-list">
<div class="pf-c-description-list__group">
<dt class="pf-c-description-list__term">
<span class="pf-c-description-list__text">${gettext("Execute flow")}</span>
</dt>
<dd class="pf-c-description-list__description">
<div class="pf-c-description-list__text">
<a class="pf-c-button pf-m-secondary ak-root-link" href="${AdminURLManager.flows(`${this.flow.pk}/execute/?next=/%23${window.location.href}`)}">
${gettext("Execute")}
</a>
</div>
</dd>
</div>
</dl>
</div>
</div>
</div> </div>
</div> </div>
<div slot="page-2" data-tab-title="${gettext("Stage Bindings")}" class="pf-c-page__main-section pf-m-no-padding-mobile"> <div slot="page-2" data-tab-title="${gettext("Stage Bindings")}" class="pf-c-page__main-section pf-m-no-padding-mobile">