web/admin: revamped rbac and user settings tabs (#8299)
* web/admin: fix duplicate RBAC preview banner on permission modal Signed-off-by: Jens Langhammer <jens@goauthentik.io> * switch non-embedded permission page to use vertical tabs Signed-off-by: Jens Langhammer <jens@goauthentik.io> * fix some leftover html? Signed-off-by: Jens Langhammer <jens@goauthentik.io> * move stuff into vertical subtab Signed-off-by: Jens Langhammer <jens@goauthentik.io> * show all of users permission tabs on one main tab Signed-off-by: Jens Langhammer <jens@goauthentik.io> * rework role page to match user page Signed-off-by: Jens Langhammer <jens@goauthentik.io> * use separate tabs Signed-off-by: Jens Langhammer <jens@goauthentik.io> * rename role permission tables to match user tables Signed-off-by: Jens Langhammer <jens@goauthentik.io> * rename to credentials and tokens Signed-off-by: Jens Langhammer <jens@goauthentik.io> * add country icon to session list Signed-off-by: Jens Langhammer <jens@goauthentik.io> * add oauth access token list Signed-off-by: Jens Langhammer <jens@goauthentik.io> * add helper to get relative time Signed-off-by: Jens Langhammer <jens@goauthentik.io> * use pfdivider Signed-off-by: Jens Langhammer <jens@goauthentik.io> * replace plain hr with pf-c-divider Signed-off-by: Jens Langhammer <jens@goauthentik.io> * use new logic for showing relative time in charts Signed-off-by: Jens Langhammer <jens@goauthentik.io> * use consistent relative time for event display Signed-off-by: Jens Langhammer <jens@goauthentik.io> * remove more leftovers Signed-off-by: Jens Langhammer <jens@goauthentik.io> * fix some alignment issues on the admin dashboard Signed-off-by: Jens Langhammer <jens@goauthentik.io> * update storybook map Signed-off-by: Jens Langhammer <jens@goauthentik.io> * add sanity check to event app lookup Signed-off-by: Jens Langhammer <jens@goauthentik.io> * make api drawer header fixed Signed-off-by: Jens Langhammer <jens@goauthentik.io> * fix table padding for toggle Signed-off-by: Jens Langhammer <jens@goauthentik.io> * fix notification drawer for user interface Signed-off-by: Jens Langhammer <jens@goauthentik.io> * enable system task search Signed-off-by: Jens Langhammer <jens@goauthentik.io> * fix formatting, exclude generated script from formatting Signed-off-by: Jens Langhammer <jens@goauthentik.io> * web: minor fixes There's a renderer (it's not a component, not yet) for producing definition lists without the risk of missing a class or tag. Breaking conditionally rendered components out to make their use easier to identify. * fix prettier Signed-off-by: Jens Langhammer <jens@goauthentik.io> * fix outpost form Signed-off-by: Jens Langhammer <jens@goauthentik.io> * fix more flaky tests Signed-off-by: Jens Langhammer <jens@goauthentik.io> * re-create locale Signed-off-by: Jens Langhammer <jens@goauthentik.io> * add some description for different permission views Signed-off-by: Jens Langhammer <jens@goauthentik.io> * fix system task search Signed-off-by: Jens Langhammer <jens@goauthentik.io> * update docs Signed-off-by: Jens Langhammer <jens@goauthentik.io> --------- Signed-off-by: Jens Langhammer <jens@goauthentik.io> Co-authored-by: Ken Sternberg <ken@goauthentik.io>
This commit is contained in:
		| @ -19,6 +19,7 @@ import { CSSResult, TemplateResult, css, html } from "lit"; | ||||
| import { customElement, state } from "lit/decorators.js"; | ||||
|  | ||||
| import PFContent from "@patternfly/patternfly/components/Content/content.css"; | ||||
| import PFDivider from "@patternfly/patternfly/components/Divider/divider.css"; | ||||
| import PFList from "@patternfly/patternfly/components/List/list.css"; | ||||
| import PFPage from "@patternfly/patternfly/components/Page/page.css"; | ||||
| import PFGrid from "@patternfly/patternfly/layouts/Grid/grid.css"; | ||||
| @ -41,15 +42,12 @@ export class AdminOverviewPage extends AKElement { | ||||
|             PFPage, | ||||
|             PFContent, | ||||
|             PFList, | ||||
|             PFDivider, | ||||
|             css` | ||||
|                 .row-divider { | ||||
|                     margin-top: -4px; | ||||
|                     margin-bottom: -4px; | ||||
|                 .pf-l-grid__item { | ||||
|                     height: 100%; | ||||
|                 } | ||||
|                 .graph-container { | ||||
|                     height: 20em; | ||||
|                 } | ||||
|                 .big-graph-container { | ||||
|                 .pf-l-grid__item.big-graph-container { | ||||
|                     height: 35em; | ||||
|                 } | ||||
|                 .card-container { | ||||
| @ -82,9 +80,7 @@ export class AdminOverviewPage extends AKElement { | ||||
|                 <div class="pf-l-grid pf-m-gutter"> | ||||
|                     <!-- row 1 --> | ||||
|                     <div class="pf-l-grid__item pf-m-6-col pf-l-grid pf-m-gutter"> | ||||
|                         <div | ||||
|                             class="pf-l-grid__item pf-m-12-col pf-m-6-col-on-xl pf-m-4-col-on-2xl graph-container" | ||||
|                         > | ||||
|                         <div class="pf-l-grid__item pf-m-12-col pf-m-6-col-on-xl pf-m-4-col-on-2xl"> | ||||
|                             <ak-aggregate-card | ||||
|                                 icon="fa fa-share" | ||||
|                                 header=${msg("Quick actions")} | ||||
| @ -136,9 +132,7 @@ export class AdminOverviewPage extends AKElement { | ||||
|                                 </ul> | ||||
|                             </ak-aggregate-card> | ||||
|                         </div> | ||||
|                         <div | ||||
|                             class="pf-l-grid__item pf-m-12-col pf-m-6-col-on-xl pf-m-4-col-on-2xl graph-container" | ||||
|                         > | ||||
|                         <div class="pf-l-grid__item pf-m-12-col pf-m-6-col-on-xl pf-m-4-col-on-2xl"> | ||||
|                             <ak-aggregate-card | ||||
|                                 icon="pf-icon pf-icon-zone" | ||||
|                                 header=${msg("Outpost status")} | ||||
| @ -148,14 +142,14 @@ export class AdminOverviewPage extends AKElement { | ||||
|                             </ak-aggregate-card> | ||||
|                         </div> | ||||
|                         <div | ||||
|                             class="pf-l-grid__item pf-m-12-col pf-m-12-col-on-xl pf-m-4-col-on-2xl graph-container" | ||||
|                             class="pf-l-grid__item pf-m-12-col pf-m-12-col-on-xl pf-m-4-col-on-2xl" | ||||
|                         > | ||||
|                             <ak-aggregate-card icon="fa fa-sync-alt" header=${msg("Sync status")}> | ||||
|                                 <ak-admin-status-chart-sync></ak-admin-status-chart-sync> | ||||
|                             </ak-aggregate-card> | ||||
|                         </div> | ||||
|                         <div class="pf-l-grid__item pf-m-12-col row-divider"> | ||||
|                             <hr /> | ||||
|                         <div class="pf-l-grid__item pf-m-12-col"> | ||||
|                             <hr class="pf-c-divider" /> | ||||
|                         </div> | ||||
|                         <div | ||||
|                             class="pf-l-grid__item pf-m-6-col pf-m-4-col-on-md pf-m-4-col-on-xl card-container" | ||||
| @ -176,8 +170,8 @@ export class AdminOverviewPage extends AKElement { | ||||
|                     <div class="pf-l-grid__item pf-m-6-col"> | ||||
|                         <ak-recent-events pageSize="6"></ak-recent-events> | ||||
|                     </div> | ||||
|                     <div class="pf-l-grid__item pf-m-12-col row-divider"> | ||||
|                         <hr /> | ||||
|                     <div class="pf-l-grid__item pf-m-12-col"> | ||||
|                         <hr class="pf-c-divider" /> | ||||
|                     </div> | ||||
|                     <!-- row 3 --> | ||||
|                     <div | ||||
|  | ||||
| @ -8,6 +8,7 @@ import { CSSResult, TemplateResult, css, html } from "lit"; | ||||
| import { customElement } from "lit/decorators.js"; | ||||
|  | ||||
| import PFContent from "@patternfly/patternfly/components/Content/content.css"; | ||||
| import PFDivider from "@patternfly/patternfly/components/Divider/divider.css"; | ||||
| import PFList from "@patternfly/patternfly/components/List/list.css"; | ||||
| import PFPage from "@patternfly/patternfly/components/Page/page.css"; | ||||
| import PFGrid from "@patternfly/patternfly/layouts/Grid/grid.css"; | ||||
| @ -22,14 +23,8 @@ export class DashboardUserPage extends AKElement { | ||||
|             PFPage, | ||||
|             PFContent, | ||||
|             PFList, | ||||
|             PFDivider, | ||||
|             css` | ||||
|                 .row-divider { | ||||
|                     margin-top: -4px; | ||||
|                     margin-bottom: -4px; | ||||
|                 } | ||||
|                 .graph-container { | ||||
|                     height: 20em; | ||||
|                 } | ||||
|                 .big-graph-container { | ||||
|                     height: 35em; | ||||
|                 } | ||||
| @ -59,8 +54,8 @@ export class DashboardUserPage extends AKElement { | ||||
|                             </ak-charts-admin-model-per-day> | ||||
|                         </ak-aggregate-card> | ||||
|                     </div> | ||||
|                     <div class="pf-l-grid__item pf-m-12-col row-divider"> | ||||
|                         <hr /> | ||||
|                     <div class="pf-l-grid__item pf-m-12-col"> | ||||
|                         <hr class="pf-c-divider" /> | ||||
|                     </div> | ||||
|                     <!-- row 2 --> | ||||
|                     <div | ||||
|  | ||||
| @ -1,4 +1,5 @@ | ||||
| import { EventGeo, EventUser } from "@goauthentik/admin/events/utils"; | ||||
| import { getRelativeTime } from "@goauthentik/app/common/utils"; | ||||
| import { DEFAULT_CONFIG } from "@goauthentik/common/api/config"; | ||||
| import { EventWithContext } from "@goauthentik/common/events"; | ||||
| import { actionToLabel } from "@goauthentik/common/labels"; | ||||
| @ -71,7 +72,8 @@ export class RecentEventsCard extends Table<Event> { | ||||
|             html`<div><a href="${`#/events/log/${item.pk}`}">${actionToLabel(item.action)}</a></div> | ||||
|                 <small>${item.app}</small>`, | ||||
|             EventUser(item), | ||||
|             html`<span>${item.created?.toLocaleString()}</span>`, | ||||
|             html`<div>${getRelativeTime(item.created)}</div> | ||||
|                 <small>${item.created.toLocaleString()}</small>`, | ||||
|             html` <div>${item.clientIp || msg("-")}</div> | ||||
|                 <small>${EventGeo(item)}</small>`, | ||||
|             html`<span>${item.brand?.name || msg("-")}</span>`, | ||||
|  | ||||
| @ -1,8 +1,8 @@ | ||||
| import { DEFAULT_CONFIG } from "@goauthentik/common/api/config"; | ||||
| import { AKChart, RGBAColor } from "@goauthentik/elements/charts/Chart"; | ||||
| import { ChartData, Tick } from "chart.js"; | ||||
| import { ChartData } from "chart.js"; | ||||
|  | ||||
| import { msg, str } from "@lit/localize"; | ||||
| import { msg } from "@lit/localize"; | ||||
| import { customElement } from "lit/decorators.js"; | ||||
|  | ||||
| import { AdminApi, LoginMetrics } from "@goauthentik/api"; | ||||
| @ -13,13 +13,6 @@ export class AdminLoginAuthorizeChart extends AKChart<LoginMetrics> { | ||||
|         return new AdminApi(DEFAULT_CONFIG).adminMetricsRetrieve(); | ||||
|     } | ||||
|  | ||||
|     timeTickCallback(tickValue: string | number, index: number, ticks: Tick[]): string { | ||||
|         const valueStamp = ticks[index]; | ||||
|         const delta = Date.now() - valueStamp.value; | ||||
|         const ago = Math.round(delta / 1000 / 3600 / 24); | ||||
|         return msg(str`${ago} day(s) ago`); | ||||
|     } | ||||
|  | ||||
|     getChartData(data: LoginMetrics): ChartData { | ||||
|         return { | ||||
|             datasets: [ | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 Jens L
					Jens L