core: show all applications a user can access in admin interface (#8343)
* core: show all applications a user can access in admin interface Signed-off-by: Jens Langhammer <jens@goauthentik.io> * minor adjustments Signed-off-by: Jens Langhammer <jens@goauthentik.io> * add relative time Signed-off-by: Jens Langhammer <jens@goauthentik.io> * use relative time in most places Signed-off-by: Jens Langhammer <jens@goauthentik.io> * improve admin dashboard scaling Signed-off-by: Jens Langhammer <jens@goauthentik.io> --------- Signed-off-by: Jens Langhammer <jens@goauthentik.io>
This commit is contained in:
@ -1,3 +1,4 @@
|
||||
import { getRelativeTime } from "@goauthentik/app/common/utils";
|
||||
import { DEFAULT_CONFIG } from "@goauthentik/common/api/config";
|
||||
import { EVENT_NOTIFICATION_DRAWER_TOGGLE, EVENT_REFRESH } from "@goauthentik/common/constants";
|
||||
import { actionToLabel } from "@goauthentik/common/labels";
|
||||
@ -6,6 +7,7 @@ import { me } from "@goauthentik/common/users";
|
||||
import { AKElement } from "@goauthentik/elements/Base";
|
||||
import { showMessage } from "@goauthentik/elements/messages/MessageContainer";
|
||||
import { PaginatedResponse } from "@goauthentik/elements/table/Table";
|
||||
import "@patternfly/elements/pf-tooltip/pf-tooltip.js";
|
||||
|
||||
import { msg, str } from "@lit/localize";
|
||||
import { CSSResult, TemplateResult, css, html } from "lit";
|
||||
@ -132,7 +134,9 @@ export class NotificationDrawer extends AKElement {
|
||||
</div>
|
||||
<p class="pf-c-notification-drawer__list-item-description">${item.body}</p>
|
||||
<small class="pf-c-notification-drawer__list-item-timestamp"
|
||||
>${item.created?.toLocaleString()}</small
|
||||
><pf-tooltip position="top" .content=${item.created?.toLocaleString()}>
|
||||
${getRelativeTime(item.created!)}
|
||||
</pf-tooltip></small
|
||||
>
|
||||
</li>`;
|
||||
}
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
import { getRelativeTime } from "@goauthentik/app/common/utils";
|
||||
import { DEFAULT_CONFIG } from "@goauthentik/common/api/config";
|
||||
import { uiConfig } from "@goauthentik/common/ui/config";
|
||||
import "@goauthentik/components/ak-status-label";
|
||||
@ -86,7 +87,10 @@ export class UserOAuthAccessTokenList extends Table<TokenModel> {
|
||||
return [
|
||||
html`<a href="#/core/providers/${item.provider?.pk}"> ${item.provider?.name} </a>`,
|
||||
html`<ak-status-label type="warning" ?good=${item.revoked}></ak-status-label>`,
|
||||
html`${item.expires?.toLocaleString()}`,
|
||||
html`${item.expires
|
||||
? html`<div>${getRelativeTime(item.expires)}</div>
|
||||
<small>${item.expires.toLocaleString()}</small>`
|
||||
: msg("-")}`,
|
||||
html`${item.scope.join(", ")}`,
|
||||
];
|
||||
}
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
import { getRelativeTime } from "@goauthentik/app/common/utils";
|
||||
import { DEFAULT_CONFIG } from "@goauthentik/common/api/config";
|
||||
import { uiConfig } from "@goauthentik/common/ui/config";
|
||||
import "@goauthentik/components/ak-status-label";
|
||||
@ -87,7 +88,10 @@ export class UserOAuthRefreshTokenList extends Table<TokenModel> {
|
||||
return [
|
||||
html`<a href="#/core/providers/${item.provider?.pk}"> ${item.provider?.name} </a>`,
|
||||
html`<ak-status-label type="warning" ?good=${item.revoked}></ak-status-label>`,
|
||||
html`${item.expires?.toLocaleString()}`,
|
||||
html`${item.expires
|
||||
? html`<div>${getRelativeTime(item.expires)}</div>
|
||||
<small>${item.expires.toLocaleString()}</small>`
|
||||
: msg("-")}`,
|
||||
html`${item.scope.join(", ")}`,
|
||||
];
|
||||
}
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
import { getRelativeTime } from "@goauthentik/app/common/utils";
|
||||
import { DEFAULT_CONFIG } from "@goauthentik/common/api/config";
|
||||
import { uiConfig } from "@goauthentik/common/ui/config";
|
||||
import "@goauthentik/elements/forms/DeleteBulkForm";
|
||||
@ -61,7 +62,10 @@ export class UserConsentList extends Table<UserConsent> {
|
||||
row(item: UserConsent): TemplateResult[] {
|
||||
return [
|
||||
html`${item.application.name}`,
|
||||
html`${item.expires?.toLocaleString()}`,
|
||||
html`${item.expires
|
||||
? html`<div>${getRelativeTime(item.expires)}</div>
|
||||
<small>${item.expires.toLocaleString()}</small>`
|
||||
: msg("-")}`,
|
||||
html`${item.permissions || "-"}`,
|
||||
];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user