diff --git a/src/main.tsx b/src/main.tsx
index 393ed22..4dbac5e 100644
--- a/src/main.tsx
+++ b/src/main.tsx
@@ -12,9 +12,9 @@ UIkit.use(Icons);
import Prism from "prismjs";
// Don't Sort These!
import "prismjs/components/prism-hcl";
+import "prismjs/components/prism-javascript";
import "prismjs/components/prism-json";
import "prismjs/components/prism-json5";
-import "prismjs/components/prism-javascript";
import "prismjs/components/prism-yaml";
Prism.highlightAll();
@@ -24,17 +24,17 @@ Prism.highlightAll();
import translations from "./translations/index.mjs";
// Actual Imports
-import { formatDistance } from "./formatDistance";
import { Main } from "./pages";
import { NavBar } from "./ui/elements/NavBar";
import { ThemeLoader } from "./ThemeLoader";
import { api } from "./globalAPI";
+import { formatDistance } from "./formatDistance";
import { getCurrentUrl, route } from "preact-router";
+import { pageChecks } from "./pageUtils";
import { playground } from "./playground";
import { render } from "preact";
import { settings } from "./globalSettings";
import i18next from "i18next";
-import { pageChecks } from "./pageUtils";
async function onLoad(): Promise {
document.documentElement.dir = settings.pageDirection;
@@ -52,7 +52,7 @@ async function onLoad(): Promise {
document.body,
);
- pageChecks(getCurrentUrl(), api, settings);
+ await pageChecks(getCurrentUrl(), api, settings);
if (process.env.NODE_ENV == "development") {
await playground();
diff --git a/src/pageUtils.ts b/src/pageUtils.ts
index bbc32c7..4190924 100644
--- a/src/pageUtils.ts
+++ b/src/pageUtils.ts
@@ -10,7 +10,7 @@ export async function pageChecks(url: string, api: API, settings: Settings): Pro
if (settings.language.length == 0) {
route("/set_language", true);
- return true
+ return true;
}
if (url.startsWith("/me") || url.startsWith("/pw_gen")) return;
@@ -19,7 +19,7 @@ export async function pageChecks(url: string, api: API, settings: Settings): Pro
if (settings.apiURL.length == 0) {
route("/set_vault_url", false);
- return true
+ return true;
}
if (url.startsWith("/unseal")) return;
@@ -27,7 +27,7 @@ export async function pageChecks(url: string, api: API, settings: Settings): Pro
const sealStatus = await api.getSealStatus();
if (sealStatus.sealed) {
route("/unseal", true);
- return true
+ return true;
}
if (url.startsWith("/login")) return;
diff --git a/src/pages.tsx b/src/pages.tsx
index d3c2c2b..6738d58 100644
--- a/src/pages.tsx
+++ b/src/pages.tsx
@@ -1,7 +1,7 @@
import { api } from "./globalAPI";
+import { pageChecks } from "./pageUtils";
import { settings } from "./globalSettings";
import Router from "preact-router";
-import { pageChecks } from "./pageUtils";
import { AccessHomePage } from "./ui/pages/Access/AccessHome";
import { AuthHome } from "./ui/pages/Access/Auth/AuthHome";
@@ -47,9 +47,11 @@ import { UserPassUserView } from "./ui/pages/Access/Auth/userpass/UserPassUserVi
import { UserPassUsersList } from "./ui/pages/Access/Auth/userpass/UserPassUsersList";
export const Main = () => (
- {
- pageChecks(e.url, api, settings);
- }}>
+ {
+ await pageChecks(e.url, api, settings);
+ }}
+ >
@@ -92,11 +94,7 @@ export const Main = () => (
-
+
diff --git a/src/translations/en.js b/src/translations/en.js
index 320b688..89a275b 100644
--- a/src/translations/en.js
+++ b/src/translations/en.js
@@ -69,6 +69,11 @@ module.exports = {
home_policies_title: "Policies",
home_policies_description: "Manage policies and permissions.",
+ // Set Vault URL Page
+ set_vault_url_title: "Set Vault URL",
+ set_vault_url_placeholder: "Vault URL",
+ set_vault_url_set_btn: "Set Vault URL",
+
// Secrets Home Page
secrets_home_page_title: "Secrets",
secrets_home_new_secrets_engine_button: "New Secrets Engine",
diff --git a/src/ui/elements/Button.tsx b/src/ui/elements/Button.tsx
new file mode 100644
index 0000000..023f937
--- /dev/null
+++ b/src/ui/elements/Button.tsx
@@ -0,0 +1,34 @@
+import { JSX } from "preact";
+import { route } from "preact-router";
+
+export type ButtonProps = {
+ color: "primary" | "danger" | "secondary";
+ text: string;
+ // Either one or the other, pref on route when possible.
+ route?: string;
+ onClick?: () => unknown;
+ type?: "submit" | null;
+};
+
+export function Button(props: ButtonProps): JSX.Element {
+ const classes = "uk-button " + ("uk-button-" + props.color);
+ if (props.route) {
+ return (
+
+ );
+ } else {
+ return (
+
+ );
+ }
+}
diff --git a/src/ui/pages/Access/Auth/AuthHome.tsx b/src/ui/pages/Access/Auth/AuthHome.tsx
index 928e570..bcb3954 100644
--- a/src/ui/pages/Access/Auth/AuthHome.tsx
+++ b/src/ui/pages/Access/Auth/AuthHome.tsx
@@ -1,4 +1,5 @@
import { AuthMethod } from "../../../../api/types/auth";
+import { Button } from "../../../elements/Button";
import { Component, JSX } from "preact";
import { DefaultPageProps } from "../../../../types/DefaultPageProps";
import { PageTitle } from "../../../elements/PageTitle";
@@ -28,26 +29,25 @@ export function AuthListElement(props: AuthListElementProps): JSX.Element {
{` (${props.method.accessor})`}
{isViewable && (
-
+ />
)}
-
-
+
+
+
);
diff --git a/src/ui/pages/Access/Auth/userpass/UserPassUserDelete.tsx b/src/ui/pages/Access/Auth/userpass/UserPassUserDelete.tsx
index 331a3b0..f55e83c 100644
--- a/src/ui/pages/Access/Auth/userpass/UserPassUserDelete.tsx
+++ b/src/ui/pages/Access/Auth/userpass/UserPassUserDelete.tsx
@@ -1,3 +1,4 @@
+import { Button } from "../../../../elements/Button";
import { Component } from "preact";
import { DefaultPageProps } from "../../../../../types/DefaultPageProps";
import { PageTitle } from "../../../../elements/PageTitle";
@@ -15,15 +16,14 @@ export class UserPassUserDelete extends Component {
{i18next.t("userpass_user_delete_text")}
-
+ />
>
);
diff --git a/src/ui/pages/Access/Auth/userpass/UserPassUserEdit.tsx b/src/ui/pages/Access/Auth/userpass/UserPassUserEdit.tsx
index 177b1a2..afbc669 100644
--- a/src/ui/pages/Access/Auth/userpass/UserPassUserEdit.tsx
+++ b/src/ui/pages/Access/Auth/userpass/UserPassUserEdit.tsx
@@ -1,3 +1,4 @@
+import { Button } from "../../../../elements/Button";
import { Component } from "preact";
import { DefaultPageProps } from "../../../../../types/DefaultPageProps";
import { Form } from "../../../../elements/Form";
@@ -112,9 +113,7 @@ export class UserPassUserEdit extends Component
-
+
>
diff --git a/src/ui/pages/Access/Auth/userpass/UserPassUserNew.tsx b/src/ui/pages/Access/Auth/userpass/UserPassUserNew.tsx
index 227e6b6..c0e7997 100644
--- a/src/ui/pages/Access/Auth/userpass/UserPassUserNew.tsx
+++ b/src/ui/pages/Access/Auth/userpass/UserPassUserNew.tsx
@@ -1,3 +1,4 @@
+import { Button } from "../../../../elements/Button";
import { Component } from "preact";
import { DefaultPageProps } from "../../../../../types/DefaultPageProps";
import { Form } from "../../../../elements/Form";
@@ -34,9 +35,7 @@ export class UserPassUserNew extends Component {
-
+
>
diff --git a/src/ui/pages/Access/Auth/userpass/UserPassUserView.tsx b/src/ui/pages/Access/Auth/userpass/UserPassUserView.tsx
index 83da5e2..2ac6ee8 100644
--- a/src/ui/pages/Access/Auth/userpass/UserPassUserView.tsx
+++ b/src/ui/pages/Access/Auth/userpass/UserPassUserView.tsx
@@ -1,10 +1,10 @@
+import { Button } from "../../../../elements/Button";
import { Component } from "preact";
import { DefaultPageProps } from "../../../../../types/DefaultPageProps";
import { HeaderAndContent } from "../../../../elements/HeaderAndContent";
import { Margin } from "../../../../elements/Margin";
import { PageTitle } from "../../../../elements/PageTitle";
import { UserType } from "../../../../../api/types/user";
-import { route } from "preact-router";
import { toStr } from "../../../../../utils";
import { userPassUserDeleteURL, userPassUserEditURL } from "../../../pageLinks";
import i18next from "i18next";
@@ -30,22 +30,16 @@ export class UserPassUserView extends Component
-
-
+
+
diff --git a/src/ui/pages/Access/Auth/userpass/UserPassUsersList.tsx b/src/ui/pages/Access/Auth/userpass/UserPassUsersList.tsx
index c03472f..f6c6156 100644
--- a/src/ui/pages/Access/Auth/userpass/UserPassUsersList.tsx
+++ b/src/ui/pages/Access/Auth/userpass/UserPassUsersList.tsx
@@ -1,5 +1,7 @@
+import { Button } from "../../../../elements/Button";
import { Component } from "preact";
import { DefaultPageProps } from "../../../../../types/DefaultPageProps";
+import { Margin } from "../../../../elements/Margin";
import { PageTitle } from "../../../../elements/PageTitle";
import { route } from "preact-router";
import { userPassUserNewURL, userPassUserViewURL } from "../../../pageLinks";
@@ -20,15 +22,13 @@ export class UserPassUsersList extends Component
-
+
+
+
{...this.state.users.map((user) => (
diff --git a/src/ui/pages/Login.tsx b/src/ui/pages/Login.tsx
index fa603ca..6770a29 100644
--- a/src/ui/pages/Login.tsx
+++ b/src/ui/pages/Login.tsx
@@ -1,3 +1,4 @@
+import { Button } from "../elements/Button";
import { Component, JSX } from "preact";
import { DefaultPageProps } from "../../types/DefaultPageProps";
import { Form } from "../elements/Form";
@@ -27,9 +28,7 @@ export class TokenLoginForm extends Component {
/>
-
+
);
@@ -83,9 +82,7 @@ export class UsernameLoginForm extends Component {
/>
-
+
);
diff --git a/src/ui/pages/Policies/PoliciesHome.tsx b/src/ui/pages/Policies/PoliciesHome.tsx
index 9ab41a5..44f790f 100644
--- a/src/ui/pages/Policies/PoliciesHome.tsx
+++ b/src/ui/pages/Policies/PoliciesHome.tsx
@@ -1,3 +1,4 @@
+import { Button } from "../../elements/Button";
import { Component } from "preact";
import { DefaultPageProps } from "../../../types/DefaultPageProps";
import { Margin } from "../../elements/Margin";
@@ -26,14 +27,7 @@ export class PoliciesHome extends Component
-
+
diff --git a/src/ui/pages/Policies/PolicyDelete.tsx b/src/ui/pages/Policies/PolicyDelete.tsx
index d97377f..668e329 100644
--- a/src/ui/pages/Policies/PolicyDelete.tsx
+++ b/src/ui/pages/Policies/PolicyDelete.tsx
@@ -1,3 +1,4 @@
+import { Button } from "../../elements/Button";
import { Component } from "preact";
import { DefaultPageProps } from "../../../types/DefaultPageProps";
import { PageTitle } from "../../elements/PageTitle";
@@ -13,8 +14,9 @@ export class PolicyDelete extends Component {
{i18next.t("policy_delete_text")}
-
+ />
>
);
diff --git a/src/ui/pages/Policies/PolicyEdit.tsx b/src/ui/pages/Policies/PolicyEdit.tsx
index 0fb79f8..a67e521 100644
--- a/src/ui/pages/Policies/PolicyEdit.tsx
+++ b/src/ui/pages/Policies/PolicyEdit.tsx
@@ -1,3 +1,4 @@
+import { Button } from "../../elements/Button";
import { CodeEditor } from "../../elements/CodeEditor";
import { Component, JSX } from "preact";
import { DefaultPageProps } from "../../../types/DefaultPageProps";
@@ -82,9 +83,11 @@ export class PolicyEditor extends Component
-
+
);
diff --git a/src/ui/pages/Policies/PolicyNew.tsx b/src/ui/pages/Policies/PolicyNew.tsx
index 8aa6b63..5b73d38 100644
--- a/src/ui/pages/Policies/PolicyNew.tsx
+++ b/src/ui/pages/Policies/PolicyNew.tsx
@@ -1,3 +1,4 @@
+import { Button } from "../../elements/Button";
import { Component } from "preact";
import { DefaultPageProps } from "../../../types/DefaultPageProps";
import { Form } from "../../elements/Form";
@@ -40,9 +41,7 @@ export class PolicyNew extends Component {
/>
-
+
>
diff --git a/src/ui/pages/Policies/PolicyView.tsx b/src/ui/pages/Policies/PolicyView.tsx
index 2d82235..f84af39 100644
--- a/src/ui/pages/Policies/PolicyView.tsx
+++ b/src/ui/pages/Policies/PolicyView.tsx
@@ -1,10 +1,10 @@
+import { Button } from "../../elements/Button";
import { CodeBlock } from "../../elements/CodeBlock";
import { Component } from "preact";
import { DefaultPageProps } from "../../../types/DefaultPageProps";
import { Margin } from "../../elements/Margin";
import { PageTitle } from "../../elements/PageTitle";
import { policyDeleteURL, policyEditURL } from "../pageLinks";
-import { route } from "preact-router";
import i18next from "i18next";
export class PolicyView extends Component<
@@ -27,23 +27,17 @@ export class PolicyView extends Component<
-
+
{this.state.policyName !== "default" && (
-
+
)}
diff --git a/src/ui/pages/PwGen.tsx b/src/ui/pages/PwGen.tsx
index eaba998..0b2dd62 100644
--- a/src/ui/pages/PwGen.tsx
+++ b/src/ui/pages/PwGen.tsx
@@ -1,3 +1,4 @@
+import { Button } from "../elements/Button";
import { Component, JSX, createRef } from "preact";
import { CopyableInputBox } from "../elements/CopyableInputBox";
import { DefaultPageProps } from "../../types/DefaultPageProps";
@@ -132,9 +133,11 @@ export class PasswordGenerator extends Component
-
+
>
diff --git a/src/ui/pages/Secrets/DeleteSecretsEngine.tsx b/src/ui/pages/Secrets/DeleteSecretsEngine.tsx
index be11dc5..0987a73 100644
--- a/src/ui/pages/Secrets/DeleteSecretsEngine.tsx
+++ b/src/ui/pages/Secrets/DeleteSecretsEngine.tsx
@@ -1,3 +1,4 @@
+import { Button } from "../../elements/Button";
import { Component } from "preact";
import { DefaultPageProps } from "../../../types/DefaultPageProps";
import { Form } from "../../elements/Form";
@@ -24,9 +25,7 @@ export class DeleteSecretsEngine extends Component
{
-
+
>
diff --git a/src/ui/pages/Secrets/KeyValue/KeyValueDelete.tsx b/src/ui/pages/Secrets/KeyValue/KeyValueDelete.tsx
index 6480637..d8ca957 100644
--- a/src/ui/pages/Secrets/KeyValue/KeyValueDelete.tsx
+++ b/src/ui/pages/Secrets/KeyValue/KeyValueDelete.tsx
@@ -1,3 +1,4 @@
+import { Button } from "../../../elements/Button";
import { Component } from "preact";
import { DefaultPageProps } from "../../../../types/DefaultPageProps";
import { SecretTitleElement } from "../SecretTitleElement";
@@ -12,6 +13,13 @@ export class KeyValueDelete extends Component {
const item = this.props.matches["item"];
const version = this.props.matches["version"];
+ // If deleting a secret when version is null,
+ // redirect back to list rather than secret
+ const buttonRoute =
+ version == "null"
+ ? kvListURL(baseMount, secretPath)
+ : kvViewURL(baseMount, secretPath, item, "null");
+
return (
<>
{
/>
{i18next.t("kv_delete_text")}
-
+ />
>
);
diff --git a/src/ui/pages/Secrets/KeyValue/KeyValueEdit.tsx b/src/ui/pages/Secrets/KeyValue/KeyValueEdit.tsx
index d2feaef..ec3ad6c 100644
--- a/src/ui/pages/Secrets/KeyValue/KeyValueEdit.tsx
+++ b/src/ui/pages/Secrets/KeyValue/KeyValueEdit.tsx
@@ -1,3 +1,4 @@
+import { Button } from "../../../elements/Button";
import { CodeEditor } from "../../../elements/CodeEditor";
import { Component, JSX, createRef } from "preact";
import { DefaultPageProps } from "../../../../types/DefaultPageProps";
@@ -45,7 +46,7 @@ export function validateData(str: string, syntax = "json"): boolean {
try {
parseData(str, syntax);
} catch (e) {
- let err = e as Error;
+ const err = e as Error;
setErrorText(err.message);
return false;
}
@@ -169,9 +170,7 @@ export class KVEditor extends Component {
code={this.getStringKVData(this.state.kvData)}
onUpdate={(code) => this.onCodeUpdate(code)}
/>
-
+
);
}
diff --git a/src/ui/pages/Secrets/KeyValue/KeyValueList.tsx b/src/ui/pages/Secrets/KeyValue/KeyValueList.tsx
index d056b5e..3a10e11 100644
--- a/src/ui/pages/Secrets/KeyValue/KeyValueList.tsx
+++ b/src/ui/pages/Secrets/KeyValue/KeyValueList.tsx
@@ -1,3 +1,4 @@
+import { Button } from "../../../elements/Button";
import { Component, JSX, createRef } from "preact";
import { DefaultPageProps } from "../../../../types/DefaultPageProps";
import { DoesNotExistError } from "../../../../types/internalErrors";
@@ -175,24 +176,18 @@ export class KeyValueList extends Component
/>
{this.state.pathCaps.includes("create") && (
-
+
)}
{secretPath.length == 0 && this.state.mountCaps.includes("delete") && (
-
+
)}
{this.state.mountType == "cubbyhole" && {i18next.t("kv_view_cubbyhole_text")}
}
diff --git a/src/ui/pages/Secrets/KeyValue/KeyValueNew.tsx b/src/ui/pages/Secrets/KeyValue/KeyValueNew.tsx
index 89b3d5f..7bbfd27 100644
--- a/src/ui/pages/Secrets/KeyValue/KeyValueNew.tsx
+++ b/src/ui/pages/Secrets/KeyValue/KeyValueNew.tsx
@@ -1,3 +1,4 @@
+import { Button } from "../../../elements/Button";
import { Component } from "preact";
import { DefaultPageProps } from "../../../../types/DefaultPageProps";
import { Form } from "../../../elements/Form";
@@ -36,9 +37,7 @@ export class KeyValueNew extends Component {
/>
-
+
>
diff --git a/src/ui/pages/Secrets/KeyValue/KeyValueView.tsx b/src/ui/pages/Secrets/KeyValue/KeyValueView.tsx
index e52b5c9..e2b1b15 100644
--- a/src/ui/pages/Secrets/KeyValue/KeyValueView.tsx
+++ b/src/ui/pages/Secrets/KeyValue/KeyValueView.tsx
@@ -1,3 +1,4 @@
+import { Button } from "../../../elements/Button";
import { CodeBlock } from "../../../elements/CodeBlock";
import { Component, JSX } from "preact";
import { CopyableInputBox } from "../../../elements/CopyableInputBox";
@@ -6,7 +7,6 @@ import { DoesNotExistError } from "../../../../types/internalErrors";
import { Grid, GridSizes } from "../../../elements/Grid";
import { SecretTitleElement } from "../SecretTitleElement";
import { kvDeleteURL, kvEditURL, kvVersionsURL } from "../../pageLinks";
-import { route } from "preact-router";
import { sortedObjectMap } from "../../../../utils";
import i18next from "i18next";
@@ -100,6 +100,18 @@ export class KeyValueView extends Component
render() {
if (!this.state.secretInfo) return;
+ // Delete Secret on kv-v1
+ let deleteButtonText = i18next.t("kv_secret_delete_btn");
+ if (this.state.kvVersion == "2" && this.state.secretVersion == "null") {
+ // Delete All
+ deleteButtonText = i18next.t("kv_secret_delete_all_btn");
+ } else if (this.state.kvVersion == "2" && this.state.secretVersion != "null") {
+ // Delete Version X
+ deleteButtonText = i18next.t("kv_secret_delete_version_btn", {
+ version: this.state.secretVersion,
+ });
+ }
+
return (
<>
{
// Delete Button
!this.state.isDeleted && this.state.caps.includes("delete") && (
-
+
)
}
{this.state.secretVersion == "null" && this.state.caps.includes("update") && (
-
+
)}
{!this.state.isDeleted && this.state.kvVersion == "2" && (
-
+
)}
@@ -178,8 +166,9 @@ export class KeyValueView extends Component
{this.state.isDeleted && (
<>
{i18next.t("kv_secret_deleted_text")}
-
+ />
>
)}
diff --git a/src/ui/pages/Secrets/NewEngines/NewKVEngine.tsx b/src/ui/pages/Secrets/NewEngines/NewKVEngine.tsx
index a6c52c5..f5ae8a8 100644
--- a/src/ui/pages/Secrets/NewEngines/NewKVEngine.tsx
+++ b/src/ui/pages/Secrets/NewEngines/NewKVEngine.tsx
@@ -1,3 +1,4 @@
+import { Button } from "../../../elements/Button";
import { Component } from "preact";
import { DefaultPageProps } from "../../../../types/DefaultPageProps";
import { Form } from "../../../elements/Form";
@@ -36,9 +37,7 @@ export class NewKVEngine extends Component {
-
+
>
diff --git a/src/ui/pages/Secrets/NewEngines/NewTOTPEngine.tsx b/src/ui/pages/Secrets/NewEngines/NewTOTPEngine.tsx
index 2396391..0d9b41c 100644
--- a/src/ui/pages/Secrets/NewEngines/NewTOTPEngine.tsx
+++ b/src/ui/pages/Secrets/NewEngines/NewTOTPEngine.tsx
@@ -1,3 +1,4 @@
+import { Button } from "../../../elements/Button";
import { Component } from "preact";
import { DefaultPageProps } from "../../../../types/DefaultPageProps";
import { Form } from "../../../elements/Form";
@@ -26,9 +27,7 @@ export class NewTOTPEngine extends Component {
-
+
,
diff --git a/src/ui/pages/Secrets/NewEngines/NewTransitEngine.tsx b/src/ui/pages/Secrets/NewEngines/NewTransitEngine.tsx
index 266bc21..7f556ab 100644
--- a/src/ui/pages/Secrets/NewEngines/NewTransitEngine.tsx
+++ b/src/ui/pages/Secrets/NewEngines/NewTransitEngine.tsx
@@ -1,3 +1,4 @@
+import { Button } from "../../../elements/Button";
import { Component } from "preact";
import { DefaultPageProps } from "../../../../types/DefaultPageProps";
import { Form } from "../../../elements/Form";
@@ -25,9 +26,7 @@ export class NewTransitEngine extends Component {
-
+
,
diff --git a/src/ui/pages/Secrets/SecretsHome.tsx b/src/ui/pages/Secrets/SecretsHome.tsx
index b5c0098..b967191 100644
--- a/src/ui/pages/Secrets/SecretsHome.tsx
+++ b/src/ui/pages/Secrets/SecretsHome.tsx
@@ -1,8 +1,8 @@
+import { Button } from "../../elements/Button";
import { Component, JSX } from "preact";
import { DefaultPageProps } from "../../../types/DefaultPageProps";
import { MountType } from "../../../api/types/mount";
import { PageTitle } from "../../elements/PageTitle";
-import { route } from "preact-router";
import { sortedObjectMap } from "../../../utils";
import i18next from "i18next";
@@ -77,14 +77,11 @@ export class Secrets extends Component {
{this.state.capabilities.includes("sudo") &&
this.state.capabilities.includes("create") && (
-
+
)}
diff --git a/src/ui/pages/Secrets/TOTP/TOTPDelete.tsx b/src/ui/pages/Secrets/TOTP/TOTPDelete.tsx
index 9881d23..e79b5b6 100644
--- a/src/ui/pages/Secrets/TOTP/TOTPDelete.tsx
+++ b/src/ui/pages/Secrets/TOTP/TOTPDelete.tsx
@@ -1,3 +1,4 @@
+import { Button } from "../../../elements/Button";
import { Component } from "preact";
import { DefaultPageProps } from "../../../../types/DefaultPageProps";
import { SecretTitleElement } from "../SecretTitleElement";
@@ -17,17 +18,16 @@ export class TOTPDelete extends Component {
/>
{i18next.t("totp_delete_text")}
-
+ />
>
);
diff --git a/src/ui/pages/Secrets/TOTP/TOTPList.tsx b/src/ui/pages/Secrets/TOTP/TOTPList.tsx
index 84f7f9a..af4d38b 100644
--- a/src/ui/pages/Secrets/TOTP/TOTPList.tsx
+++ b/src/ui/pages/Secrets/TOTP/TOTPList.tsx
@@ -1,3 +1,4 @@
+import { Button } from "../../../elements/Button";
import { CapabilitiesType } from "../../../../api/types/capabilities";
import { Component, JSX } from "preact";
import { CopyableInputBox } from "../../../elements/CopyableInputBox";
@@ -6,9 +7,13 @@ import { DoesNotExistError } from "../../../../types/internalErrors";
import { Grid, GridSizes } from "../../../elements/Grid";
import { MarginInline } from "../../../elements/MarginInline";
import { SecretTitleElement } from "../SecretTitleElement";
-import { delSecretsEngineURL, totpNewGeneratedURL, totpNewURL } from "../../pageLinks";
+import {
+ delSecretsEngineURL,
+ totpDeleteURL,
+ totpNewGeneratedURL,
+ totpNewURL,
+} from "../../pageLinks";
import { removeDoubleSlash } from "../../../../utils";
-import { route } from "preact-router";
import { setErrorText } from "../../../../pageUtils";
import i18next from "i18next";
@@ -50,14 +55,11 @@ export class RefreshingTOTPGridItem extends Component
{this.props.canDelete && (
-
+
)}
@@ -129,34 +131,25 @@ export class TOTPList extends Component {
{totpCaps.includes("create") && (
-
+
)}
{totpCaps.includes("create") && (
-
+
)}
{mountCaps.includes("delete") && (
-
+
)}
diff --git a/src/ui/pages/Secrets/TOTP/TOTPNew.tsx b/src/ui/pages/Secrets/TOTP/TOTPNew.tsx
index df7be47..9bf4a5d 100644
--- a/src/ui/pages/Secrets/TOTP/TOTPNew.tsx
+++ b/src/ui/pages/Secrets/TOTP/TOTPNew.tsx
@@ -1,3 +1,4 @@
+import { Button } from "../../../elements/Button";
import { Component, JSX, createRef } from "preact";
import { DefaultPageProps } from "../../../../types/DefaultPageProps";
import { Form } from "../../../elements/Form";
@@ -95,25 +96,23 @@ export class TOTPNewForm extends Component<
)}
-
+ />
-
+
);
diff --git a/src/ui/pages/Secrets/TOTP/TOTPNewGenerated.tsx b/src/ui/pages/Secrets/TOTP/TOTPNewGenerated.tsx
index d33d697..2111a98 100644
--- a/src/ui/pages/Secrets/TOTP/TOTPNewGenerated.tsx
+++ b/src/ui/pages/Secrets/TOTP/TOTPNewGenerated.tsx
@@ -1,3 +1,4 @@
+import { Button } from "../../../elements/Button";
import { Component, JSX, createRef } from "preact";
import { CopyableInputBox } from "../../../elements/CopyableInputBox";
import { DefaultPageProps } from "../../../../types/DefaultPageProps";
@@ -9,6 +10,7 @@ import { NewTOTPResp } from "../../../../api/types/totp";
import { SecretTitleElement } from "../SecretTitleElement";
import { route } from "preact-router";
import { setErrorText } from "../../../../pageUtils";
+import { totpListURL } from "../../pageLinks";
import i18next from "i18next";
export class TOTPNewGeneratedForm extends Component<
@@ -94,9 +96,7 @@ export class TOTPNewGeneratedForm extends Component<
-
+
);
@@ -106,14 +106,11 @@ export class TOTPNewGeneratedForm extends Component<
{i18next.t("totp_new_generated_warning")}
-
+
>
);
}
diff --git a/src/ui/pages/Secrets/Transit/TransitDecrypt.tsx b/src/ui/pages/Secrets/Transit/TransitDecrypt.tsx
index 81b28f9..1dbef0f 100644
--- a/src/ui/pages/Secrets/Transit/TransitDecrypt.tsx
+++ b/src/ui/pages/Secrets/Transit/TransitDecrypt.tsx
@@ -1,3 +1,4 @@
+import { Button } from "../../../elements/Button";
import { Component, render } from "preact";
import { CopyableModal } from "../../../elements/CopyableModal";
import { DefaultPageProps } from "../../../../types/DefaultPageProps";
@@ -38,9 +39,7 @@ export class TransitDecrypt extends Component
{
-
+
>
diff --git a/src/ui/pages/Secrets/Transit/TransitEncrypt.tsx b/src/ui/pages/Secrets/Transit/TransitEncrypt.tsx
index c3fa078..ba7cef1 100644
--- a/src/ui/pages/Secrets/Transit/TransitEncrypt.tsx
+++ b/src/ui/pages/Secrets/Transit/TransitEncrypt.tsx
@@ -1,3 +1,4 @@
+import { Button } from "../../../elements/Button";
import { Component, render } from "preact";
import { CopyableModal } from "../../../elements/CopyableModal";
import { DefaultPageProps } from "../../../../types/DefaultPageProps";
@@ -38,9 +39,7 @@ export class TransitEncrypt extends Component {
-
+
>
diff --git a/src/ui/pages/Secrets/Transit/TransitList.tsx b/src/ui/pages/Secrets/Transit/TransitList.tsx
index 61f9abc..6a8f272 100644
--- a/src/ui/pages/Secrets/Transit/TransitList.tsx
+++ b/src/ui/pages/Secrets/Transit/TransitList.tsx
@@ -1,3 +1,4 @@
+import { Button } from "../../../elements/Button";
import { CapabilitiesType } from "../../../../api/types/capabilities";
import { Component, JSX } from "preact";
import { DefaultPageProps } from "../../../../types/DefaultPageProps";
@@ -95,24 +96,18 @@ export class TransitList extends Component
{transitCaps.includes("create") && (
-
+
)}
{mountCaps.includes("delete") && (
-
+
)}
{
-
+
>
diff --git a/src/ui/pages/Secrets/Transit/TransitRewrap.tsx b/src/ui/pages/Secrets/Transit/TransitRewrap.tsx
index 6a3fed1..fda5bd5 100644
--- a/src/ui/pages/Secrets/Transit/TransitRewrap.tsx
+++ b/src/ui/pages/Secrets/Transit/TransitRewrap.tsx
@@ -1,3 +1,4 @@
+import { Button } from "../../../elements/Button";
import { Component, render } from "preact";
import { CopyableModal } from "../../../elements/CopyableModal";
import { DefaultPageProps } from "../../../../types/DefaultPageProps";
@@ -74,9 +75,7 @@ export class TransitRewrap extends Component
-
+
>
diff --git a/src/ui/pages/SetLanguage.tsx b/src/ui/pages/SetLanguage.tsx
index 9e77427..8f7692a 100644
--- a/src/ui/pages/SetLanguage.tsx
+++ b/src/ui/pages/SetLanguage.tsx
@@ -2,6 +2,7 @@
import translations from "../../translations/index.mjs";
// ts-unignore
+import { Button } from "../elements/Button";
import { Component } from "preact";
import { DefaultPageProps } from "../../types/DefaultPageProps";
import { Form } from "../elements/Form";
@@ -32,9 +33,7 @@ export class SetLanguage extends Component {
-
+
>
diff --git a/src/ui/pages/SetVaultURL.tsx b/src/ui/pages/SetVaultURL.tsx
index b03930d..1527486 100644
--- a/src/ui/pages/SetVaultURL.tsx
+++ b/src/ui/pages/SetVaultURL.tsx
@@ -1,30 +1,30 @@
+import { Button } from "../elements/Button";
import { Component } from "preact";
import { DefaultPageProps } from "../../types/DefaultPageProps";
import { Form } from "../elements/Form";
import { Margin } from "../elements/Margin";
import { PageTitle } from "../elements/PageTitle";
import { route } from "preact-router";
+import i18next from "i18next";
export class SetVaultURL extends Component {
render() {
return (
<>
-
+
>
diff --git a/src/ui/pages/Unseal.tsx b/src/ui/pages/Unseal.tsx
index 5c522a8..28050d9 100644
--- a/src/ui/pages/Unseal.tsx
+++ b/src/ui/pages/Unseal.tsx
@@ -1,3 +1,4 @@
+import { Button } from "../elements/Button";
import { Component, JSX } from "preact";
import { DefaultPageProps } from "../../types/DefaultPageProps";
import { Form } from "../elements/Form";
@@ -35,9 +36,7 @@ export function UnsealFormInput(props: UnsealFormInputProps): JSX.Element {
/>
-
+
);
@@ -122,8 +121,13 @@ export class Unseal extends Component {
this.submitKey(code)} />
)}
-
+ />
>
);