Add access home page.
This commit is contained in:
parent
db02e0e91b
commit
ec3ebe3356
|
@ -26,6 +26,8 @@ import { TransitViewPage } from "./pages/Secrets/Transit/TransitView";
|
|||
import { TransitViewSecretPage } from "./pages/Secrets/Transit/TransitViewSecret";
|
||||
import { UnsealPage } from "./pages/Unseal";
|
||||
import { getObjectKeys } from "./utils";
|
||||
import { AccessHomePage } from "./pages/Access/AccessHome";
|
||||
|
||||
|
||||
/* eslint-disable */
|
||||
import { PageType } from "z-pagerouter";
|
||||
|
@ -38,6 +40,7 @@ type pagesList = {
|
|||
export const allPages: pagesList = {
|
||||
HOME: new HomePage(),
|
||||
SECRETS_HOME: new SecretsHomePage(),
|
||||
ACCESS_HOME: new AccessHomePage(),
|
||||
ME: new MePage(),
|
||||
TOTP: new TOTPViewPage(),
|
||||
NEW_TOTP: new NewTOTPPage(),
|
||||
|
|
70
src/pages/Access/AccessHome.ts
Normal file
70
src/pages/Access/AccessHome.ts
Normal file
|
@ -0,0 +1,70 @@
|
|||
import { MountType, getMounts } from "../../api/sys/getMounts";
|
||||
import { Page } from "../../types/Page";
|
||||
import { getCapabilitiesPath } from "../../api/sys/getCapabilities";
|
||||
import { makeElement } from "z-makeelement";
|
||||
import { prePageChecks, setErrorText } from "../../pageUtils";
|
||||
import { sortedObjectMap } from "../../utils";
|
||||
import i18next from "i18next";
|
||||
import { Tile } from "../../elements/Tile";
|
||||
|
||||
export class AccessHomePage extends Page {
|
||||
constructor() {
|
||||
super();
|
||||
}
|
||||
async goBack(): Promise<void> {
|
||||
await this.router.changePage("HOME");
|
||||
}
|
||||
async render(): Promise<void> {
|
||||
await this.router.setPageContent("");
|
||||
if (!(await prePageChecks(this.router))) return;
|
||||
|
||||
this.router.setPageContent(
|
||||
makeElement({
|
||||
tag: "div",
|
||||
class: "uk-child-width-1-1@s uk-child-width-1-2@m uk-grid-small uk-grid-match",
|
||||
attributes: { "uk-grid": "" },
|
||||
children: [
|
||||
Tile({
|
||||
title: i18next.t("access_auth_methods_title"),
|
||||
description: i18next.t("access_auth_methods_description"),
|
||||
icon: "sign-in",
|
||||
onclick: async () => {
|
||||
setErrorText(i18next.t("not_implemented"));
|
||||
//await this.router.changePage("SECRETS_HOME");
|
||||
},
|
||||
}),
|
||||
Tile({
|
||||
title: i18next.t("access_entities_title"),
|
||||
description: i18next.t("access_entities_description"),
|
||||
icon: "user",
|
||||
onclick: async () => {
|
||||
setErrorText(i18next.t("not_implemented"));
|
||||
//await this.router.changePage("SECRETS_HOME");
|
||||
},
|
||||
}),
|
||||
Tile({
|
||||
title: i18next.t("access_groups_title"),
|
||||
description: i18next.t("access_groups_description"),
|
||||
icon: "users",
|
||||
onclick: async () => {
|
||||
setErrorText(i18next.t("not_implemented"));
|
||||
//await this.router.changePage("SECRETS_HOME");
|
||||
},
|
||||
}),
|
||||
Tile({
|
||||
title: i18next.t("access_leases_title"),
|
||||
description: i18next.t("access_leases_description"),
|
||||
icon: "unlock",
|
||||
onclick: async () => {
|
||||
setErrorText(i18next.t("not_implemented"));
|
||||
//await this.router.changePage("SECRETS_HOME");
|
||||
},
|
||||
}),
|
||||
],
|
||||
}),
|
||||
);
|
||||
}
|
||||
get name(): string {
|
||||
return i18next.t("access_home_page_title");
|
||||
}
|
||||
}
|
|
@ -59,7 +59,7 @@ export class HomePage extends Page {
|
|||
}
|
||||
}
|
||||
|
||||
textList.appendChild(
|
||||
homePageContent.appendChild(
|
||||
makeElement({
|
||||
tag: "div",
|
||||
class:
|
||||
|
@ -74,6 +74,14 @@ export class HomePage extends Page {
|
|||
await this.router.changePage("SECRETS_HOME");
|
||||
},
|
||||
}),
|
||||
Tile({
|
||||
title: i18next.t("home_access_title"),
|
||||
description: i18next.t("home_access_description"),
|
||||
icon: "users",
|
||||
onclick: async () => {
|
||||
await this.router.changePage("ACCESS_HOME");
|
||||
},
|
||||
}),
|
||||
],
|
||||
}),
|
||||
);
|
||||
|
|
14
src/translations/en.js
vendored
14
src/translations/en.js
vendored
|
@ -12,6 +12,7 @@ module.exports = {
|
|||
|
||||
// General Notification Messages
|
||||
notification_copy_success: "Copied to clipboard.",
|
||||
not_implemented: "Not Yet Implemented",
|
||||
|
||||
// Copyable Modal
|
||||
copy_modal_download_btn: "Download",
|
||||
|
@ -39,6 +40,8 @@ module.exports = {
|
|||
home_your_token_expires_in: "Your token expires in {{date, until_date}}",
|
||||
home_secrets_title: "Secrets",
|
||||
home_secrets_description: "View, create and manage secrets.",
|
||||
home_access_title: "Access",
|
||||
home_access_description: "Manage who and what has access to vault and how they can authenticate.",
|
||||
|
||||
// Secrets Home Page
|
||||
secrets_home_page_title: "Secrets",
|
||||
|
@ -203,4 +206,15 @@ module.exports = {
|
|||
transit_rewrap_input_placeholder: "Cyphertext",
|
||||
transit_rewrap_rewrap_btn: "Rewrap",
|
||||
transit_rewrap_result_modal_title: "Rewrap Result",
|
||||
|
||||
// Access Home
|
||||
access_home_page_title: "Access",
|
||||
access_auth_methods_title: "Authentication Methods",
|
||||
access_auth_methods_description: "View and manage the allowed authentication methods.",
|
||||
access_entities_title: "Entities",
|
||||
access_entities_description: "View and manage who and what can access the vault.",
|
||||
access_groups_title: "Groups",
|
||||
access_groups_description: "View and manage groups of entities.",
|
||||
access_leases_title: "Leases",
|
||||
access_leases_description: "View and manage the leases of entities.",
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue