Files
authentik/web/src/admin/flows/FlowDiagram.ts
Jens Langhammer dff82e05b9 format
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
2025-06-16 12:30:35 +02:00

34 lines
844 B
TypeScript

import { DEFAULT_CONFIG } from "@goauthentik/common/api/config";
import { Diagram } from "@goauthentik/elements/Diagram";
import "@goauthentik/elements/EmptyState";
import { FlowsApi } from "@goauthentik/api";
import { customElement, property } from "lit/decorators.js";
@customElement("ak-flow-diagram")
export class FlowDiagram extends Diagram {
@property()
flowSlug?: string;
refreshHandler = (): void => {
this.diagram = undefined;
new FlowsApi(DEFAULT_CONFIG)
.flowsInstancesDiagramRetrieve({
slug: this.flowSlug || "",
})
.then((data) => {
this.diagram = data.diagram;
this.requestUpdate();
});
};
}
declare global {
interface HTMLElementTagNameMap {
"ak-flow-diagram": FlowDiagram;
}
}