From 2a5a61c23cb6f756d778c591b2b47dfd93588881 Mon Sep 17 00:00:00 2001
From: ChaotiCryptidz
Date: Tue, 18 Jan 2022 12:06:22 +0000
Subject: [PATCH]
>
);
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
-
- {i18next.t("common_edit")}
-
+
>
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 {
-
- {i18next.t("common_create")}
-
+
>
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
- {
- route(userPassUserDeleteURL(baseMount, user));
- }}
- >
- {i18next.t("common_delete")}
-
- {
- route(userPassUserEditURL(baseMount, user));
- }}
- >
- {i18next.t("common_edit")}
-
+
+
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
-
{
- route(userPassUserNewURL(baseMount));
- }}
- >
- {i18next.t("common_new")}
-
+
+
+
{...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 {
/>
-
- {i18next.t("log_in_btn")}
-
+
);
@@ -83,9 +82,7 @@ export class UsernameLoginForm extends Component {
/>
-
- {i18next.t("log_in_btn")}
-
+
);
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
- {
- route(policyNewURL());
- }}
- >
- {i18next.t("common_new")}
-
+
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")}
- {
try {
await this.props.api.deletePolicy(policyName);
@@ -24,9 +26,7 @@ export class PolicyDelete extends Component {
setErrorText(error.message);
}
}}
- >
- {i18next.t("common_delete")}
-
+ />
>
);
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
- this.editorSave()}>
- {i18next.t("common_edit")}
-
+ this.editorSave()}
+ />
);
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 {
/>
-
- {i18next.t("common_create")}
-
+
>
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<
- {
- route(policyEditURL(this.state.policyName));
- }}
- >
- {i18next.t("common_edit")}
-
+
{this.state.policyName !== "default" && (
- {
- route(policyDeleteURL(this.state.policyName));
- }}
- >
- {i18next.t("common_delete")}
-
+
)}
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
-
- {i18next.t("password_generator_generate_btn")}
-
+
>
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
{
-
- {i18next.t("common_delete")}
-
+
>
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")}
- {
await this.props.api.deleteSecret(baseMount, secretPath, item, version);
- if (version == "null") {
- route(kvListURL(baseMount, secretPath));
- } else {
- route(kvViewURL(baseMount, secretPath, item, "null"));
- }
+ route(buttonRoute);
}}
- >
- {i18next.t("common_delete")}
-
+ />
>
);
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)}
/>
- this.editorSave()}>
- {i18next.t("common_edit")}
-
+ this.editorSave()} />
);
}
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") && (
- {
- route(kvNewURL(baseMount, secretPath));
- }}
- >
- {i18next.t("kv_view_new_btn")}
-
+
)}
{secretPath.length == 0 && this.state.mountCaps.includes("delete") && (
- {
- route(delSecretsEngineURL(baseMount));
- }}
- >
- {i18next.t("kv_view_delete_btn")}
-
+
)}
{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 {
/>
-
- {i18next.t("common_create")}
-
+
>
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") && (
- {
- route(
- kvDeleteURL(
- this.state.baseMount,
- this.state.secretPath,
- this.state.secretItem,
- this.state.secretVersion,
- ),
- );
- }}
- >
- {((): string => {
- // 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 deleteButtonText;
- })()}
-
+
)
}
{this.state.secretVersion == "null" && this.state.caps.includes("update") && (
- {
- route(
- kvEditURL(this.state.baseMount, this.state.secretPath, this.state.secretItem),
- );
- }}
- >
- {i18next.t("common_edit")}
-
+
)}
{!this.state.isDeleted && this.state.kvVersion == "2" && (
- {
- route(
- kvVersionsURL(
- this.state.baseMount,
- this.state.secretPath,
- this.state.secretItem,
- ),
- );
- }}
- >
- {i18next.t("kv_secret_versions_btn")}
-
+
)}
@@ -178,8 +166,9 @@ export class KeyValueView extends Component
{this.state.isDeleted && (
<>
{i18next.t("kv_secret_deleted_text")}
- {
await this.props.api.undeleteSecret(
this.state.baseMount,
@@ -187,12 +176,11 @@ export class KeyValueView extends Component
this.state.secretItem,
this.state.secretVersion,
);
+ // Is there a better way to force refresh of a Component?
this.setState({});
await this.componentDidMount();
}}
- >
- {i18next.t("kv_secret_restore_btn")}
-
+ />
>
)}
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 {
-
- {i18next.t("common_create")}
-
+
>
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 {
-
- {i18next.t("common_create")}
-
+
,
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 {
-
- {i18next.t("common_create")}
-
+
,
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") && (
- {
- route("/secrets/new_secrets_engine");
- }}
- >
- {i18next.t("secrets_home_new_secrets_engine_button")}
-
+
)}
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")}
- {
const baseMount = this.props.matches["baseMount"];
const item = this.props.matches["item"];
await this.props.api.deleteTOTP(baseMount, item);
route(totpListURL(baseMount));
}}
- >
- {i18next.t("common_delete")}
-
+ />
>
);
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 && (
- {
- route("/secrets/totp/delete/" + this.props.baseMount + "/" + this.props.totpKey);
- }}
- >
- {i18next.t("common_delete")}
-
+
)}
@@ -129,34 +131,25 @@ export class TOTPList extends Component {
{totpCaps.includes("create") && (
- {
- route(totpNewURL(baseMount));
- }}
- >
- {i18next.t("common_new")}
-
+
)}
{totpCaps.includes("create") && (
- {
- route(totpNewGeneratedURL(baseMount));
- }}
- >
- {i18next.t("totp_new_generated")}
-
+
)}
{mountCaps.includes("delete") && (
- {
- route(delSecretsEngineURL(baseMount));
- }}
- >
- {i18next.t("common_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<
)}
- {
this.setState({ qrMode: !this.state.qrMode });
}}
- >
- {!this.state.qrMode
- ? i18next.t("totp_new_switch_to_qr_btn")
- : i18next.t("totp_new_switch_back_to_manual_input_btn")}
-
+ />
-
- {i18next.t("common_create")}
-
+
);
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<
-
- {i18next.t("common_create")}
-
+
);
@@ -106,14 +106,11 @@ export class TOTPNewGeneratedForm extends Component<
{i18next.t("totp_new_generated_warning")}
-
{
- route("/secrets/totp/list/" + this.props.baseMount);
- }}
- >
- {i18next.t("common_back")}
-
+
>
);
}
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
{
-
- {i18next.t("transit_decrypt")}
-
+
>
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 {
-
- {i18next.t("transit_encrypt")}
-
+
>
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") && (
- {
- route(transitNewSecretURL(baseMount));
- }}
- >
- {i18next.t("common_new")}
-
+
)}
{mountCaps.includes("delete") && (
- {
- route(delSecretsEngineURL(baseMount));
- }}
- >
- {i18next.t("common_delete")}
-
+
)}
{
-
- {i18next.t("common_create")}
-
+
>
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
-
- {i18next.t("transit_rewrap")}
-
+
>
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 {
-
- {i18next.t("set_language_btn")}
-
+
>
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 {
/>
-
- {i18next.t("unseal_submit_key_btn")}
-
+
);
@@ -122,8 +121,13 @@ export class Unseal extends Component {
this.submitKey(code)} />
)}
- {
let newMethod: string;
if (this.state.mode == UnsealInputModes.FORM_INPUT) {
@@ -133,11 +137,7 @@ export class Unseal extends Component {
}
this.setState({ mode: newMethod });
}}
- >
- {this.state.mode == UnsealInputModes.QR_INPUT
- ? i18next.t("unseal_input_btn")
- : i18next.t("unseal_qr_btn")}
-
+ />
>
);