mirror of
https://github.com/goauthentik/authentik.git
synced 2026-08-30 18:51:39 -07:00
web: Point cross-interface links at path-based admin URLs.
This commit is contained in:
committed by
Teffen Ellis
parent
40fbf2eb65
commit
34b7275fec
@@ -3,13 +3,13 @@ import "@patternfly/elements/pf-tooltip/pf-tooltip.js";
|
||||
|
||||
import { isAPIResultReady } from "#common/api/responses";
|
||||
import { pluckErrorDetail } from "#common/errors/network";
|
||||
import { globalAK } from "#common/global";
|
||||
import { actionToLabel, severityToLevel } from "#common/labels";
|
||||
import { formatElapsedTime } from "#common/temporal";
|
||||
|
||||
import { AKElement } from "#elements/Base";
|
||||
import { WithNotifications } from "#elements/mixins/notifications";
|
||||
import { WithSession } from "#elements/mixins/session";
|
||||
import { toAdminInterface } from "#elements/router/core/interfaces";
|
||||
import { SlottedTemplateResult } from "#elements/types";
|
||||
import { ifPresent } from "#elements/utils/attributes";
|
||||
|
||||
@@ -68,8 +68,6 @@ export class NotificationDrawer extends WithNotifications(WithSession(AKElement)
|
||||
`,
|
||||
];
|
||||
|
||||
#APIBase = globalAK().api.base;
|
||||
|
||||
//#region Rendering
|
||||
|
||||
protected renderHyperlink(item: Notification) {
|
||||
@@ -103,7 +101,7 @@ export class NotificationDrawer extends WithNotifications(WithSession(AKElement)
|
||||
html`
|
||||
<a
|
||||
class="pf-c-dropdown__toggle pf-m-plain"
|
||||
href="${this.#APIBase}if/admin/#/events/log/${item.event?.pk}"
|
||||
href=${toAdminInterface(`events/log/${item.event?.pk}`)}
|
||||
aria-label=${msg(str`View details for ${label}`)}
|
||||
>
|
||||
<pf-tooltip position="top" content=${msg("Show details")}>
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { globalAK } from "#common/global";
|
||||
|
||||
import { AKElement } from "#elements/Base";
|
||||
import { WithLicenseSummary } from "#elements/mixins/license";
|
||||
import { toAdminInterface } from "#elements/router/core/interfaces";
|
||||
|
||||
import { LicenseFlagsEnum, LicenseSummaryStatusEnum } from "@goauthentik/api";
|
||||
|
||||
@@ -75,7 +74,7 @@ export class EnterpriseStatusBanner extends WithLicenseSummary(AKElement) {
|
||||
: "pf-m-gold"}"
|
||||
>
|
||||
${message}
|
||||
<a href="${globalAK().api.base}if/admin/#/enterprise/licenses"
|
||||
<a href=${toAdminInterface("enterprise/licenses")}
|
||||
>${msg("Click here for more info.")}</a
|
||||
>
|
||||
</div>`;
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { aki } from "#common/api/client";
|
||||
import { type APIResult, isAPIResultReady } from "#common/api/responses";
|
||||
import { globalAK } from "#common/global";
|
||||
import { applyThemeChoice, formatColorScheme } from "#common/theme";
|
||||
import { createUIConfig, DefaultUIConfig } from "#common/ui/config";
|
||||
import { autoDetectLanguage } from "#common/ui/locale/utils";
|
||||
@@ -20,6 +19,7 @@ import {
|
||||
SessionMixin,
|
||||
UIConfigContext,
|
||||
} from "#elements/mixins/session";
|
||||
import { toAdminInterface, toUserInterface } from "#elements/router/core/interfaces";
|
||||
import type { ReactiveElementHost } from "#elements/types";
|
||||
|
||||
import { AKDrawerChangeEvent } from "#components/notifications/events";
|
||||
@@ -115,7 +115,6 @@ export class SessionContextController extends ReactiveContextController<APIResul
|
||||
return;
|
||||
}
|
||||
|
||||
const base = globalAK().api.base;
|
||||
const group = msg("Session");
|
||||
const weight = 0.5;
|
||||
|
||||
@@ -128,7 +127,7 @@ export class SessionContextController extends ReactiveContextController<APIResul
|
||||
group,
|
||||
weight,
|
||||
action: () => {
|
||||
window.location.assign(`${base}if/user/#/settings`);
|
||||
window.location.assign(toUserInterface("settings"));
|
||||
},
|
||||
},
|
||||
];
|
||||
@@ -168,7 +167,7 @@ export class SessionContextController extends ReactiveContextController<APIResul
|
||||
group,
|
||||
weight,
|
||||
action: () => {
|
||||
window.location.assign(`${base}if/admin/`);
|
||||
window.location.assign(toAdminInterface());
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
@@ -45,10 +45,7 @@ export class LibraryPageApplicationEmptyList
|
||||
public admin = false;
|
||||
|
||||
#renderNewAppButton() {
|
||||
// The admin interface is still hash-routed: keep the legacy hash format.
|
||||
// The admin flip's shim will translate it, so this URL never breaks.
|
||||
const params = encodeURIComponent(JSON.stringify({ createWizard: true }));
|
||||
const href = `${toAdminInterface()}#/core/applications;${params}`;
|
||||
const href = toAdminInterface("core/applications", { "create-wizard": "application" });
|
||||
|
||||
return html`
|
||||
<div class="pf-u-pt-lg">
|
||||
|
||||
Reference in New Issue
Block a user