web/admin: default to not include current session in flow play, add option to start with current session

closes #2527

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2022-03-18 19:41:03 +01:00
parent bb1f79347b
commit ef371b3750
12 changed files with 59 additions and 13 deletions

View File

@ -6181,6 +6181,10 @@ msgstr "Die Referenz wird auf den Standardwert zurückgesetzt"
msgid "reference will be set to an empty value" msgid "reference will be set to an empty value"
msgstr "Referenz wird auf einen leeren Wert gesetzt" msgstr "Referenz wird auf einen leeren Wert gesetzt"
#: src/pages/flows/FlowViewPage.ts
msgid "with current user"
msgstr ""
#: src/pages/flows/FlowViewPage.ts #: src/pages/flows/FlowViewPage.ts
msgid "with inspector" msgid "with inspector"
msgstr "Mit Inspektor" msgstr "Mit Inspektor"

View File

@ -6303,6 +6303,10 @@ msgstr "reference will be reset to default value"
msgid "reference will be set to an empty value" msgid "reference will be set to an empty value"
msgstr "reference will be set to an empty value" msgstr "reference will be set to an empty value"
#: src/pages/flows/FlowViewPage.ts
msgid "with current user"
msgstr "with current user"
#: src/pages/flows/FlowViewPage.ts #: src/pages/flows/FlowViewPage.ts
msgid "with inspector" msgid "with inspector"
msgstr "with inspector" msgstr "with inspector"

View File

@ -6175,6 +6175,10 @@ msgstr "la referencia se restablecerá al valor predeterminado"
msgid "reference will be set to an empty value" msgid "reference will be set to an empty value"
msgstr "la referencia se establecerá en un valor vacío" msgstr "la referencia se establecerá en un valor vacío"
#: src/pages/flows/FlowViewPage.ts
msgid "with current user"
msgstr ""
#: src/pages/flows/FlowViewPage.ts #: src/pages/flows/FlowViewPage.ts
msgid "with inspector" msgid "with inspector"
msgstr "con inspector" msgstr "con inspector"

View File

@ -6236,6 +6236,10 @@ msgstr "la référence sera réinitialisée à sa valeur par défaut"
msgid "reference will be set to an empty value" msgid "reference will be set to an empty value"
msgstr "la référence sera réinitialisée à une valeur vide" msgstr "la référence sera réinitialisée à une valeur vide"
#: src/pages/flows/FlowViewPage.ts
msgid "with current user"
msgstr ""
#: src/pages/flows/FlowViewPage.ts #: src/pages/flows/FlowViewPage.ts
msgid "with inspector" msgid "with inspector"
msgstr "" msgstr ""

View File

@ -6172,6 +6172,10 @@ msgstr "odniesienie zostanie zresetowane do wartości domyślnej"
msgid "reference will be set to an empty value" msgid "reference will be set to an empty value"
msgstr "referencja zostanie ustawiona na pustą wartość" msgstr "referencja zostanie ustawiona na pustą wartość"
#: src/pages/flows/FlowViewPage.ts
msgid "with current user"
msgstr ""
#: src/pages/flows/FlowViewPage.ts #: src/pages/flows/FlowViewPage.ts
msgid "with inspector" msgid "with inspector"
msgstr "z inspektorem" msgstr "z inspektorem"

View File

@ -6279,6 +6279,10 @@ msgstr ""
msgid "reference will be set to an empty value" msgid "reference will be set to an empty value"
msgstr "" msgstr ""
#: src/pages/flows/FlowViewPage.ts
msgid "with current user"
msgstr ""
#: src/pages/flows/FlowViewPage.ts #: src/pages/flows/FlowViewPage.ts
msgid "with inspector" msgid "with inspector"
msgstr "" msgstr ""

View File

@ -6177,6 +6177,10 @@ msgstr "referans varsayılan değere sıfırlanır"
msgid "reference will be set to an empty value" msgid "reference will be set to an empty value"
msgstr "referans boş bir değere ayarlanacaktır" msgstr "referans boş bir değere ayarlanacaktır"
#: src/pages/flows/FlowViewPage.ts
msgid "with current user"
msgstr ""
#: src/pages/flows/FlowViewPage.ts #: src/pages/flows/FlowViewPage.ts
msgid "with inspector" msgid "with inspector"
msgstr "müfettiş ile" msgstr "müfettiş ile"

View File

@ -6170,6 +6170,10 @@ msgstr "引用将被重置为默认值"
msgid "reference will be set to an empty value" msgid "reference will be set to an empty value"
msgstr "引用将被设置为空值" msgstr "引用将被设置为空值"
#: src/pages/flows/FlowViewPage.ts
msgid "with current user"
msgstr ""
#: src/pages/flows/FlowViewPage.ts #: src/pages/flows/FlowViewPage.ts
msgid "with inspector" msgid "with inspector"
msgstr "附加检视器" msgstr "附加检视器"

View File

@ -6170,6 +6170,10 @@ msgstr "引用将被重置为默认值"
msgid "reference will be set to an empty value" msgid "reference will be set to an empty value"
msgstr "引用将被设置为空值" msgstr "引用将被设置为空值"
#: src/pages/flows/FlowViewPage.ts
msgid "with current user"
msgstr ""
#: src/pages/flows/FlowViewPage.ts #: src/pages/flows/FlowViewPage.ts
msgid "with inspector" msgid "with inspector"
msgstr "和检查员一起" msgstr "和检查员一起"

View File

@ -6170,6 +6170,10 @@ msgstr "引用将被重置为默认值"
msgid "reference will be set to an empty value" msgid "reference will be set to an empty value"
msgstr "引用将被设置为空值" msgstr "引用将被设置为空值"
#: src/pages/flows/FlowViewPage.ts
msgid "with current user"
msgstr ""
#: src/pages/flows/FlowViewPage.ts #: src/pages/flows/FlowViewPage.ts
msgid "with inspector" msgid "with inspector"
msgstr "和检查员一起" msgstr "和检查员一起"

View File

@ -6,7 +6,7 @@ import { customElement, property } from "lit/decorators.js";
import { Flow, FlowsApi } from "@goauthentik/api"; import { Flow, FlowsApi } from "@goauthentik/api";
import { AKResponse } from "../../api/Client"; import { AKResponse } from "../../api/Client";
import { DEFAULT_CONFIG } from "../../api/Config"; import { AndNext, DEFAULT_CONFIG } from "../../api/Config";
import { uiConfig } from "../../common/config"; import { uiConfig } from "../../common/config";
import "../../elements/buttons/SpinnerButton"; import "../../elements/buttons/SpinnerButton";
import "../../elements/forms/ConfirmationForm"; import "../../elements/forms/ConfirmationForm";
@ -113,17 +113,10 @@ export class FlowListPage extends TablePage<Flow> {
<button <button
class="pf-c-button pf-m-plain" class="pf-c-button pf-m-plain"
@click=${() => { @click=${() => {
new FlowsApi(DEFAULT_CONFIG) const finalURL = `${window.location.origin}/if/flows/${item.slug}/${AndNext(
.flowsInstancesExecuteRetrieve({ `${window.location.pathname}#${window.location.hash}`,
slug: item.slug, )}`;
}) window.open(finalURL, "_blank");
.then((link) => {
window.open(
`${link.link}?inspector&next=${encodeURIComponent(
`/#${window.location.href}`,
)}`,
);
});
}} }}
> >
<i class="fas fa-play"></i> <i class="fas fa-play"></i>

View File

@ -119,6 +119,19 @@ export class FlowViewPage extends LitElement {
<div class="pf-c-description-list__text"> <div class="pf-c-description-list__text">
<button <button
class="pf-c-button pf-m-primary" class="pf-c-button pf-m-primary"
@click=${() => {
const finalURL = `${
window.location.origin
}/if/flows/${this.flow.slug}/${AndNext(
`${window.location.pathname}#${window.location.hash}`,
)}`;
window.open(finalURL, "_blank");
}}
>
${t`Normal`}
</button>
<button
class="pf-c-button pf-m-secondary"
@click=${() => { @click=${() => {
new FlowsApi(DEFAULT_CONFIG) new FlowsApi(DEFAULT_CONFIG)
.flowsInstancesExecuteRetrieve({ .flowsInstancesExecuteRetrieve({
@ -134,7 +147,7 @@ export class FlowViewPage extends LitElement {
}); });
}} }}
> >
${t`Normal`} ${t`with current user`}
</button> </button>
<button <button
class="pf-c-button pf-m-secondary" class="pf-c-button pf-m-secondary"