1
0
Fork 0

merge some translations into common ones

This commit is contained in:
ChaotiCryptidz 2022-01-10 14:57:53 +00:00
parent c29bb1dc1b
commit 18c034a104
33 changed files with 142 additions and 226 deletions

View file

@ -1,121 +0,0 @@
//import { PageType } from "./pagerouter/PageType";
//
//import { AccessHomePage } from "./ui/pages/Access/AccessHome";
//import { AuthHomePage } from "./ui/pages/Access/Auth/AuthHome";
//import { AuthViewConfigPage } from "./ui/pages/Access/Auth/AuthViewConfig";
//import { DeleteSecretsEnginePage } from "./ui/pages/Secrets/DeleteSecretsEngine";
//import { HomePage } from "./ui/pages/Home";
//import { KeyValueDeletePage } from "./ui/pages/Secrets/KeyValue/KeyValueDelete";
//import { KeyValueNewPage } from "./ui/pages/Secrets/KeyValue/KeyValueNew";
//import { KeyValueSecretEditPage } from "./ui/pages/Secrets/KeyValue/KeyValueSecretsEdit";
//import { KeyValueSecretPage } from "./ui/pages/Secrets/KeyValue/KeyValueSecret";
//import { KeyValueVersionsPage } from "./ui/pages/Secrets/KeyValue/KeyValueVersions";
//import { KeyValueViewPage } from "./ui/pages/Secrets/KeyValue/KeyValueView";
//import { LoginPage } from "./ui/pages/Login";
//import { MePage } from "./ui/pages/Me";
//import { NewKVEnginePage } from "./ui/pages/Secrets/NewEngines/NewKVEngine";
//import { NewSecretsEnginePage } from "./ui/pages/Secrets/NewSecretsEngine";
//import { NewTOTPEnginePage } from "./ui/pages/Secrets/NewEngines/NewTOTPEngine";
//import { NewTransitEnginePage } from "./ui/pages/Secrets/NewEngines/NewTransitEngine";
//import { NewTransitKeyPage } from "./ui/pages/Secrets/Transit/NewTransitKey";
//import { Page } from "./types/Page";
//import { PoliciesHomePage } from "./ui/pages/Policies/PoliciesHome";
//import { PolicyDeletePage } from "./ui/pages/Policies/PolicyDelete";
//import { PolicyEditPage } from "./ui/pages/Policies/PolicyEdit";
//import { PolicyNewPage } from "./ui/pages/Policies/PolicyNew";
//import { PolicyViewPage } from "./ui/pages/Policies/PolicyView";
//import { PwGenPage } from "./ui/pages/PwGen";
//import { SecretsHomePage } from "./ui/pages/Secrets/SecretsHome";
//import { SetLanguagePage } from "./ui/pages/SetLanguage";
//import { SetVaultURLPage } from "./ui/pages/SetVaultURL";
//import { TOTPDeletePage } from "./ui/pages/Secrets/TOTP/TOTPDelete";
//import { TOTPNewPage } from "./ui/pages/Secrets/TOTP/TOTPNew";
//import { TOTPViewPage } from "./ui/pages/Secrets/TOTP/TOTPView";
//import { TransitDecryptPage } from "./ui/pages/Secrets/Transit/TransitDecrypt";
//import { TransitEncryptPage } from "./ui/pages/Secrets/Transit/TransitEncrypt";
//import { TransitRewrapPage } from "./ui/pages/Secrets/Transit/TransitRewrap";
//import { TransitViewPage } from "./ui/pages/Secrets/Transit/TransitView";
//import { TransitViewSecretPage } from "./ui/pages/Secrets/Transit/TransitViewSecret";
//import { UnsealPage } from "./ui/pages/Unseal";
//import { UserPassUserDeletePage } from "./ui/pages/Access/Auth/userpass/UserPassUserDelete";
//import { UserPassUserEditPage } from "./ui/pages/Access/Auth/userpass/UserPassUserEdit";
//import { UserPassUserNewPage } from "./ui/pages/Access/Auth/userpass/UserPassUserNew";
//import { UserPassUserViewPage } from "./ui/pages/Access/Auth/userpass/UserPassUserView";
//import { UserPassUsersListPage } from "./ui/pages/Access/Auth/userpass/UserPassUsersList";
//import { getObjectKeys } from "./utils";
//
//type pagesList = {
// [key: string]: Page;
//};
//
//export const allPages: pagesList = {
// HOME: new HomePage(),
// LOGIN: new LoginPage(),
// SET_VAULT_URL: new SetVaultURLPage(),
// UNSEAL: new UnsealPage(),
// SET_LANGUAGE: new SetLanguagePage(),
// ME: new MePage(),
// PW_GEN: new PwGenPage(),
//
// POLICIES_HOME: new PoliciesHomePage(),
// POLICY_VIEW: new PolicyViewPage(),
// POLICY_NEW: new PolicyNewPage(),
// POLICY_EDIT: new PolicyEditPage(),
// POLICY_DELETE: new PolicyDeletePage(),
//
// ACCESS_HOME: new AccessHomePage(),
//
// AUTH_HOME: new AuthHomePage(),
// AUTH_VIEW_CONFIG: new AuthViewConfigPage(),
//
// USERPASS_USERS_LIST: new UserPassUsersListPage(),
// USERPASS_USER_VIEW: new UserPassUserViewPage(),
// USERPASS_USER_EDIT: new UserPassUserEditPage(),
// USERPASS_USER_NEW: new UserPassUserNewPage(),
// USERPASS_USER_DELETE: new UserPassUserDeletePage(),
//
// SECRETS_HOME: new SecretsHomePage(),
//
// TOTP_VIEW: new TOTPViewPage(),
// TOTP_NEW: new TOTPNewPage(),
// TOTP_DELETE: new TOTPDeletePage(),
//
// TRANSIT_VIEW: new TransitViewPage(),
// TRANSIT_NEW_KEY: new NewTransitKeyPage(),
// TRANSIT_VIEW_SECRET: new TransitViewSecretPage(),
// TRANSIT_ENCRYPT: new TransitEncryptPage(),
// TRANSIT_DECRYPT: new TransitDecryptPage(),
// TRANSIT_REWRAP: new TransitRewrapPage(),
//
// KEY_VALUE_VIEW: new KeyValueViewPage(),
// KEY_VALUE_SECRET: new KeyValueSecretPage(),
// KEY_VALUE_VERSIONS: new KeyValueVersionsPage(),
// KEY_VALUE_NEW_SECRET: new KeyValueNewPage(),
// KEY_VALUE_DELETE: new KeyValueDeletePage(),
// KEY_VALUE_SECRET_EDIT: new KeyValueSecretEditPage(),
//
// DELETE_SECRET_ENGINE: new DeleteSecretsEnginePage(),
//
// NEW_SECRETS_ENGINE: new NewSecretsEnginePage(),
// NEW_KV_ENGINE: new NewKVEnginePage(),
// NEW_TOTP_ENGINE: new NewTOTPEnginePage(),
// NEW_TRANSIT_ENGINE: new NewTransitEnginePage(),
//};
//
//// This should implement all o PageListType
//class PageList {
// constructor(pages: pagesList) {
// this.pages = pages;
// }
//
// private pages: pagesList;
//
// async getPageIDs(): Promise<string[]> {
// return getObjectKeys(this.pages);
// }
// async getPage(pageID: string): Promise<PageType> {
// return this.pages[pageID];
// }
//}
//
//export const pageList = new PageList(allPages);

View file

@ -42,6 +42,7 @@ import { UserPassUserEdit } from "./ui/pages/Access/Auth/userpass/UserPassUserEd
import { UserPassUserNew } from "./ui/pages/Access/Auth/userpass/UserPassUserNew";
import { UserPassUserView } from "./ui/pages/Access/Auth/userpass/UserPassUserView";
import { UserPassUsersList } from "./ui/pages/Access/Auth/userpass/UserPassUsersList";
import { SSH_List } from "./ui/pages/Secrets/SSH/SSH_List";
export const Main = () => (
<Router>
@ -106,6 +107,9 @@ export const Main = () => (
api={api}
/>
<SSH_List path="/secrets/ssh/list/:baseMount" settings={settings} api={api} />
<PoliciesHome path="/policies" settings={settings} api={api} />
<PolicyNew path="/policies/new" settings={settings} api={api} />
<PolicyView path="/policies/view/:policyName" settings={settings} api={api} />

View file

@ -10,6 +10,24 @@ module.exports = {
refresh_btn: "Refresh",
me_btn: "Me/Settings",
// Common buttons / placeholders
common_new: "New",
common_edit: "Edit",
common_create: "Create",
common_delete: "Delete",
common_copy: "Copy",
common_username: "Username",
common_password: "Password",
common_name: "Name",
// Common but for options inside secrets engines
common_cidrs: "Bound CIDRs",
common_exp_max_ttl: "Explicit Maximum TTL",
common_max_ttl: "Maximum TTL",
common_initial_ttl: "Initial TTL",
common_default_lease_ttl: "Default Lease TTL",
common_max_lease_ttl: "Max Lease TTL",
// General Notification Messages
notification_copy_success: "Copied to clipboard.",
not_implemented: "Not Yet Implemented",
@ -65,20 +83,14 @@ module.exports = {
// New KV Engine Page
new_kv_engine_title: "New Key/Value Engine",
new_kv_engine_name_input: "Name",
new_kv_engine_version_1: "Version 1",
new_kv_engine_version_2: "Version 2",
new_kv_engine_create_btn: "Create",
// New KV Engine Page
new_totp_engine_title: "New TOTP Engine",
new_totp_engine_name_input: "Name",
new_totp_engine_create_btn: "Create",
// New Transit Engine Page
new_transit_engine_title: "New Transit Engine",
new_transit_engine_name_input: "Name",
new_transit_engine_create_btn: "Create",
// Unseal Page
unseal_vault_text: "Unseal the Vault",
@ -110,14 +122,12 @@ module.exports = {
// Key Value Delete Page
kv_delete_title: "K/V Delete",
kv_delete_text: "Are you sure you want to delete this?",
kv_delete_btn: "Delete",
kv_delete_suffix: " (delete)",
// Key Value New Page
kv_new_title: "K/V New",
kv_new_suffix: " (new)",
kv_new_path: "Relative Path",
kv_new_create_btn: "Create Empty Secret",
// Key Value Secret Page
kv_secret_title: "K/V Secret",
@ -128,12 +138,10 @@ module.exports = {
kv_secret_delete_btn: "Delete",
kv_secret_delete_all_btn: "Delete All Versions",
kv_secret_delete_version_btn: "Delete Version {{ version }}",
kv_secret_edit_btn: "Edit",
kv_secret_versions_btn: "Versions",
// Key Value Secret Editor Page
kv_sec_edit_title: "K/V Edit",
kv_sec_edit_btn: "Edit",
kv_sec_edit_loading: "Loading Editor..",
kv_sec_edit_invalid_json_err: "Invalid JSON",
kv_sec_edit_suffix: " (edit)",
@ -153,9 +161,6 @@ module.exports = {
// TOTP View Page
totp_view_title: "TOTP",
totp_view_new_btn: "New",
totp_view_delete_btn: "Delete",
totp_view_secret_delete_btn: "Delete",
totp_view_loading: "Loading TOTP Codes..",
totp_view_empty: "You seem to have no TOTP codes here, would you like to create one?",
totp_view_loading_box: "Loading..",
@ -163,12 +168,10 @@ module.exports = {
// New TOTP Key Page
totp_new_title: "New TOTP Key",
totp_new_suffix: " (new)",
totp_new_name_text: "TOTP Key Name",
totp_new_info:
"You need either a key or a URI, URI prefered but may not work. Just scan the QR code and copy the URL.",
totp_new_uri_input: "URI",
totp_new_key_input: "Key",
totp_new_add_btn: "Add TOTP Key",
totp_new_switch_to_qr_btn: "Switch to QR Input",
totp_new_switch_back_to_manual_input_btn: "Switch back to manual input",
@ -176,29 +179,26 @@ module.exports = {
totp_delete_title: "Delete TOTP Key",
totp_delete_suffix: " (delete)",
totp_delete_text: "Are you sure you want to delete this TOTP secret?",
totp_delete_button: "Delete",
// Transit Commmon
transit_encrypt: "Encrypt",
transit_decrypt: "Decrypt",
transit_rewrap: "Rewrap",
// Transit View Page
transit_view_title: "Transit View",
transit_view_new_btn: "New",
transit_view_delete_btn: "Delete",
transit_view_none_here_text:
"You seem to have no transit keys here, would you like to create one?",
transit_new_key_title: "New Transit Key",
transit_new_key_name_input: "Name",
transit_new_key_create_btn: "Create",
transit_new_key_suffix: " (new)",
// Transit View Secret Page
transit_view_secret_title: "Transit Secret View",
transit_view_encrypt_text: "Encrypt",
transit_view_encrypt_icon_text: "Encryption Icon",
transit_view_encrypt_description: "Encrypt some plaintext or base64 encoded binary.",
transit_view_decrypt_text: "Decrypt",
transit_view_decrypt_description: "Decrypt some cyphertext.",
transit_view_decrypt_icon_text: "Decryption Icon",
transit_view_rewrap_text: "Rewrap",
transit_view_rewrap_description: "Rewrap ciphertext using a different key version.",
transit_view_rewrap_icon_text: "Rewrap Icon",
@ -207,7 +207,6 @@ module.exports = {
transit_encrypt_suffix: " (encrypt)",
transit_encrypt_input_placeholder: "Plaintext or base64",
transit_encrypt_already_encoded_checkbox: "Is the data already encoded in base64?",
transit_encrypt_encrypt_btn: "Encrypt",
transit_encrypt_encryption_result_modal_title: "Encryption Result",
// Transit Decrypt Page
@ -215,7 +214,6 @@ module.exports = {
transit_decrypt_suffix: " (decrypt)",
transit_decrypt_input_placeholder: "Cyphertext",
transit_decrypt_decode_checkbox: "Should the plaintext be base64 decoded?",
transit_decrypt_decrypt_btn: "Decrypt",
transit_decrypt_decryption_result_modal_title: "Decryption Result",
// Transit Rewrap Page
@ -224,14 +222,12 @@ module.exports = {
transit_rewrap_version_option_text: "{{version_num}}",
transit_rewrap_latest_version_option_text: "{{version_num}} (latest)",
transit_rewrap_input_placeholder: "Cyphertext",
transit_rewrap_rewrap_btn: "Rewrap",
transit_rewrap_result_modal_title: "Rewrap Result",
// Delete Secret Engine Page
delete_secrets_engine_title: "Delete Secret Engine ({{mount}})",
delete_secrets_engine_message:
"Are you sure you want to delete this secrets engine and all the data stored within? This can't be reversed.",
delete_secrets_engine_delete_btn: "Delete",
// Access Home
access_home_page_title: "Access",
@ -259,68 +255,48 @@ module.exports = {
auth_view_config_local: "Local",
auth_view_config_seal_wrap: "Seal Wrap",
auth_view_config_list_when_unauth: "List when unauthenticated?",
auth_view_config_default_lease_ttl: "Default Lease TTL",
auth_view_config_max_lease_ttl: "Max Lease TTL",
auth_view_config_token_type: "Token Type",
// UserPass Common
auth_common_username: "Username",
auth_common_password: "Password",
auth_common_zero_default: "When one of these fields is 0, that means use the default value",
auth_common_generated_tokens: "These settings apply to the tokens generated when logging in",
auth_common_cidrs: "Bound CIDRs",
auth_common_exp_max_ttl: "Explicit Maximum TTL",
auth_common_max_ttl: "Maximum TTL",
auth_common_default_policy_attached: "Do Not Attach 'default' Policy",
auth_common_max_token_uses: "Maximum Uses",
auth_common_token_peroid: "Period (seconds)",
auth_common_policies: "Policies",
auth_common_initial_ttl: "Initial TTL",
auth_common_type: "Token Type",
// userpass Users List
userpass_users_list_title: "Users List",
userpass_user_list_new_btn: "New",
// userpass User View
userpass_user_view_title: "User View",
userpass_user_view_edit_btn: "Edit",
userpass_user_view_delete_btn: "Delete",
// userpass user edit
userpass_user_edit_title: "User Edit",
userpass_user_edit_submit_btn: "Submit",
// userpass user new
userpass_user_new_title: "New User",
userpass_user_new_create_btn: "Create",
userpass_user_delete_title: "Delete User",
userpass_user_delete_text:
"Are you sure you want to delete this user? This action can't be reversed.",
userpass_user_delete_btn: "Delete User",
// Policies Home
policies_home_title: "Policies",
policies_home_new_btn: "New",
// Policy View
policy_view_title: "Policy View ({{policy}})",
policy_view_edit_btn: "Edit",
policy_view_delete_btn: "Delete",
// Policy New
policy_new_title: "Create New Policy",
policy_new_name_placeholder: "Policy Name",
policy_new_create_btn: "Create",
policy_new_already_exists: "This policy already exists.",
// Policy Edit
policy_edit_title: "Edit Policy ({{policy}})",
policy_edit_edit_btn: "Edit",
// Policy Delete
policy_delete_title: "Delete Policy ({{policy}})",
policy_delete_text:
"Are you sure you want to delete this policy? It can't be reversed and there is a chance that all permissions will break.",
policy_delete_btn: "Delete Policy",
};

View file

@ -49,11 +49,11 @@ export class AuthViewConfig extends Component<DefaultPageProps, { authMethod: Au
content={toStr(authMethod.config.listing_visibility)}
/>
<HeaderAndContent
title={i18next.t("auth_view_config_default_lease_ttl")}
title={i18next.t("common_default_lease_ttl")}
content={toStr(authMethod.config.default_lease_ttl)}
/>
<HeaderAndContent
title={i18next.t("auth_view_config_max_lease_ttl")}
title={i18next.t("common_max_lease_ttl")}
content={toStr(authMethod.config.max_lease_ttl)}
/>
<HeaderAndContent

View file

@ -22,7 +22,7 @@ export class UserPassUserDelete extends Component<DefaultPageProps> {
route(userPassUserListURL(baseMount));
}}
>
{i18next.t("userpass_user_delete_btn")}
{i18next.t("common_delete")}
</button>
</div>
</>

View file

@ -35,7 +35,7 @@ export class UserPassUserEdit extends Component<DefaultPageProps, { user_data: U
class="uk-input uk-form-width-large"
name="password"
type="password"
placeholder={i18next.t("auth_common_password")}
placeholder={i18next.t("common_password")}
/>
<Margin>
@ -46,7 +46,7 @@ export class UserPassUserEdit extends Component<DefaultPageProps, { user_data: U
<p>{i18next.t("auth_common_generated_tokens")}</p>
</Margin>
<InputWithTitle title={i18next.t("auth_common_cidrs")}>
<InputWithTitle title={i18next.t("common_cidrs")}>
<input
class="uk-input uk-form-width-large"
name="cidrs"
@ -54,7 +54,7 @@ export class UserPassUserEdit extends Component<DefaultPageProps, { user_data: U
value={user_data.token_bound_cidrs.join()}
/>
</InputWithTitle>
<InputWithTitle title={i18next.t("auth_common_exp_max_ttl")}>
<InputWithTitle title={i18next.t("common_exp_max_ttl")}>
<input
class="uk-input uk-form-width-large"
name="exp_max_ttl"
@ -62,7 +62,7 @@ export class UserPassUserEdit extends Component<DefaultPageProps, { user_data: U
value={toStr(user_data.token_explicit_max_ttl)}
/>
</InputWithTitle>
<InputWithTitle title={i18next.t("auth_common_max_ttl")}>
<InputWithTitle title={i18next.t("common_max_ttl")}>
<input
class="uk-input uk-form-width-large"
name="max_ttl"
@ -102,7 +102,7 @@ export class UserPassUserEdit extends Component<DefaultPageProps, { user_data: U
value={user_data.token_policies.join()}
/>
</InputWithTitle>
<InputWithTitle title={i18next.t("auth_common_initial_ttl")}>
<InputWithTitle title={i18next.t("common_initial_ttl")}>
<input
class="uk-input uk-form-width-large"
name="initial_ttl"
@ -113,7 +113,7 @@ export class UserPassUserEdit extends Component<DefaultPageProps, { user_data: U
<p class="uk-text-danger" id="errorText" />
<MarginInline>
<button class="uk-button uk-button-primary" type="submit">
{i18next.t("userpass_user_edit_submit_btn")}
{i18next.t("common_edit")}
</button>
</MarginInline>
</Form>

View file

@ -21,7 +21,7 @@ export class UserPassUserNew extends Component<DefaultPageProps> {
class="uk-input uk-form-width-large"
name="username"
type="text"
placeholder={i18next.t("auth_common_username")}
placeholder={i18next.t("common_username")}
/>
</Margin>
<Margin>
@ -29,13 +29,13 @@ export class UserPassUserNew extends Component<DefaultPageProps> {
class="uk-input uk-form-width-large"
name="password"
type="password"
placeholder={i18next.t("auth_common_password")}
placeholder={i18next.t("common_password")}
/>
</Margin>
<p class="uk-text-danger" id="errorText" />
<MarginInline>
<button class="uk-button uk-button-primary" type="submit">
{i18next.t("userpass_user_new_create_btn")}
{i18next.t("common_create")}
</button>
</MarginInline>
</Form>

View file

@ -36,7 +36,7 @@ export class UserPassUserView extends Component<DefaultPageProps, { user_data: U
route(userPassUserDeleteURL(baseMount, user));
}}
>
{i18next.t("userpass_user_view_delete_btn")}
{i18next.t("common_delete")}
</button>
<button
class="uk-button uk-button-primary"
@ -44,7 +44,7 @@ export class UserPassUserView extends Component<DefaultPageProps, { user_data: U
route(userPassUserEditURL(baseMount, user));
}}
>
{i18next.t("userpass_user_view_edit_btn")}
{i18next.t("common_edit")}
</button>
</p>
@ -59,15 +59,15 @@ export class UserPassUserView extends Component<DefaultPageProps, { user_data: U
<table class="uk-table">
<tbody>
<HeaderAndContent
title={i18next.t("auth_common_cidrs")}
title={i18next.t("common_cidrs")}
content={user_data.token_bound_cidrs.join()}
/>
<HeaderAndContent
title={i18next.t("auth_common_exp_max_ttl")}
title={i18next.t("common_exp_max_ttl")}
content={toStr(user_data.token_explicit_max_ttl)}
/>
<HeaderAndContent
title={i18next.t("auth_common_max_ttl")}
title={i18next.t("common_max_ttl")}
content={toStr(user_data.token_max_ttl)}
/>
<HeaderAndContent
@ -87,7 +87,7 @@ export class UserPassUserView extends Component<DefaultPageProps, { user_data: U
content={user_data.token_policies.join()}
/>
<HeaderAndContent
title={i18next.t("auth_common_initial_ttl")}
title={i18next.t("common_initial_ttl")}
content={toStr(user_data.token_ttl)}
/>
<HeaderAndContent

View file

@ -27,7 +27,7 @@ export class UserPassUsersList extends Component<DefaultPageProps, { users: stri
route(userPassUserNewURL(baseMount));
}}
>
{i18next.t("userpass_user_list_new_btn")}
{i18next.t("common_new")}
</button>
<ul>

View file

@ -35,7 +35,7 @@ export class PoliciesHome extends Component<DefaultPageProps, { policies: string
route(policyNewURL());
}}
>
{i18next.t("policies_home_new_btn")}
{i18next.t("common_new")}
</button>
</p>

View file

@ -25,7 +25,7 @@ export class PolicyDelete extends Component<DefaultPageProps> {
}
}}
>
{i18next.t("policy_delete_btn")}
{i18next.t("common_delete")}
</button>
</div>
</>

View file

@ -83,7 +83,7 @@ export class PolicyEditor extends Component<PolicyEditorProps, PolicyEditorState
</Margin>
<MarginInline>
<button class="uk-button uk-button-primary" onClick={() => this.editorSave()}>
{i18next.t("policy_edit_edit_btn")}
{i18next.t("common_edit")}
</button>
</MarginInline>
</div>

View file

@ -35,13 +35,13 @@ export class PolicyNew extends Component<DefaultPageProps> {
<input
class="uk-input uk-form-width-medium"
name="name"
placeholder={i18next.t("policy_new_name_placeholder")}
placeholder={i18next.t("common_name")}
required
/>
</Margin>
<p class="uk-text-danger" id="errorText" />
<button class="uk-button uk-button-primary" type="submit">
{i18next.t("policy_new_create_btn")}
{i18next.t("common_create")}
</button>
</Form>
</div>

View file

@ -36,7 +36,7 @@ export class PolicyView extends Component<
route(policyEditURL(this.state.policyName));
}}
>
{i18next.t("policy_view_edit_btn")}
{i18next.t("common_edit")}
</button>
{this.state.policyName !== "default" && (
<button
@ -45,7 +45,7 @@ export class PolicyView extends Component<
route(policyDeleteURL(this.state.policyName));
}}
>
{i18next.t("policy_view_delete_btn")}
{i18next.t("common_delete")}
</button>
)}
</p>

View file

@ -25,7 +25,7 @@ export class DeleteSecretsEngine extends Component<DefaultPageProps> {
<MarginInline>
<button class="uk-button uk-button-danger" type="submit">
{i18next.t("delete_secrets_engine_delete_btn")}
{i18next.t("common_delete")}
</button>
</MarginInline>
</Form>

View file

@ -27,7 +27,7 @@ export class KeyValueDelete extends Component<DefaultPageProps> {
window.history.back();
}}
>
{i18next.t("kv_delete_btn")}
{i18next.t("common_delete")}
</button>
</div>
</>

View file

@ -96,7 +96,7 @@ export class KVEditor extends Component<KVEditProps, KVEditState> {
onUpdate={(code) => this.onCodeUpdate(code)}
/>
<button class="uk-button uk-button-primary" onClick={() => this.editorSave()}>
{i18next.t("kv_sec_edit_btn")}
{i18next.t("common_edit")}
</button>
</div>
);

View file

@ -37,7 +37,7 @@ export class KeyValueNew extends Component<DefaultPageProps> {
</Margin>
<p class="uk-text-danger" id="errorText" />
<button class="uk-button uk-button-primary" type="submit">
{i18next.t("kv_new_create_btn")}
{i18next.t("common_create")}
</button>
</Form>
</div>

View file

@ -106,7 +106,7 @@ export class KeyValueView extends Component<DefaultPageProps, KeyValueViewState>
);
}}
>
{i18next.t("kv_secret_edit_btn")}
{i18next.t("common_edit")}
</button>
)}
</p>

View file

@ -20,7 +20,7 @@ export class NewKVEngine extends Component<DefaultPageProps> {
class="uk-input uk-form-width-medium"
name="name"
type="text"
placeholder={i18next.t("new_kv_engine_name_input")}
placeholder={i18next.t("common_name")}
required
/>
</Margin>
@ -37,7 +37,7 @@ export class NewKVEngine extends Component<DefaultPageProps> {
<p class="uk-text-danger" id="errorText" />
<MarginInline>
<button class="uk-button uk-button-primary" type="submit">
{i18next.t("new_kv_engine_create_btn")}
{i18next.t("common_create")}
</button>
</MarginInline>
</Form>

View file

@ -20,14 +20,14 @@ export class NewTOTPEngine extends Component<DefaultPageProps> {
class="uk-input uk-form-width-medium"
name="name"
type="text"
placeholder={i18next.t("new_totp_engine_name_input")}
placeholder={i18next.t("common_name")}
required
/>
</Margin>
<p class="uk-text-danger" id="errorText" />
<MarginInline>
<button class="uk-button uk-button-primary" type="submit">
{i18next.t("new_totp_engine_create_btn")}
{i18next.t("common_create")}
</button>
</MarginInline>
</Form>

View file

@ -19,14 +19,14 @@ export class NewTransitEngine extends Component<DefaultPageProps> {
class="uk-input uk-form-width-medium"
name="name"
type="text"
placeholder={i18next.t("new_transit_engine_name_input")}
placeholder={i18next.t("common_name")}
required
/>
</Margin>
<p class="uk-text-danger" id="errorText" />
<MarginInline>
<button class="uk-button uk-button-primary" type="submit">
{i18next.t("new_transit_engine_create_btn")}
{i18next.t("common_create")}
</button>
</MarginInline>
</Form>

View file

@ -0,0 +1,54 @@
import { CapabilitiesType } from "../../../../api/types/capabilities";
import { Component, JSX } from "preact";
import { DefaultPageProps } from "../../../../types/DefaultPageProps";
import { SecretTitleElement } from "../SecretTitleElement";
import { delSecretsEngineURL, transitNewSecretURL, transitViewSecretURL } from "../../pageLinks";
import { route } from "preact-router";
import i18next from "i18next";
export class SSH_List extends Component<DefaultPageProps, { caps: CapabilitiesType }> {
async componentDidMount() {
const baseMount = this.props.matches["baseMount"];
const mountsPath = "/sys/mounts/" + baseMount;
const caps = await this.props.api.getCapabilitiesPath([mountsPath, baseMount]);
this.setState({ caps });
}
render() {
if (!this.state.caps) return;
const baseMount = this.props.matches["baseMount"];
const mountsPath = "/sys/mounts/" + baseMount;
const mountCaps = this.state.caps[mountsPath];
const sshCaps = this.state.caps[baseMount];
return (
<>
<SecretTitleElement type="ssh" baseMount={baseMount} />
<p>
{sshCaps.includes("create") && (
<button
class="uk-button uk-button-primary"
onClick={async () => {
route(transitNewSecretURL(baseMount));
}}
>
{i18next.t("transit_view_new_btn")}
</button>
)}
{mountCaps.includes("delete") && (
<button
class="uk-button uk-button-danger"
onClick={async () => {
route(delSecretsEngineURL(baseMount));
}}
>
{i18next.t("transit_view_delete_btn")}
</button>
)}
</p>
</>
);
}
}

View file

@ -7,7 +7,7 @@ import { route } from "preact-router";
import { sortedObjectMap } from "../../../utils";
import i18next from "i18next";
const supportedMountTypes = ["kv", "totp", "transit", "cubbyhole"];
const supportedMountTypes = ["kv", "totp", "transit", "cubbyhole", "ssh"];
export function isSupportedMount(mount: MountType): boolean {
if (typeof mount != "object") return false;
@ -31,15 +31,18 @@ function MountLink(props: MountLinkProps): JSX.Element {
if (mount.type == "kv") {
linkText = `K/V (v${mount.options.version}) - ${baseMount}`;
mountPathType = "kv";
} else if (mount.type == "cubbyhole") {
linkText = `Cubbyhole - ${baseMount}`;
mountPathType = "kv";
} else if (mount.type == "totp") {
linkText = `TOTP - ${baseMount}`;
mountPathType = "totp";
} else if (mount.type == "transit") {
linkText = `Transit - ${baseMount}`;
mountPathType = "transit";
} else if (mount.type == "cubbyhole") {
linkText = `Cubbyhole - ${baseMount}`;
mountPathType = "kv";
} else if (mount.type == "ssh") {
linkText = `SSH - ${baseMount}`;
mountPathType = "ssh";
}
const link = "/secrets/" + mountPathType + "/list/" + baseMount;

View file

@ -26,7 +26,7 @@ export class TOTPDelete extends Component<DefaultPageProps> {
route(totpListURL(baseMount));
}}
>
{i18next.t("kv_delete_btn")}
{i18next.t("common_delete")}
</button>
</div>
</>

View file

@ -56,7 +56,7 @@ export class RefreshingTOTPGridItem extends Component<TOTPGridItemProps, { totpV
route("/secrets/totp/delete/" + this.props.baseMount + "/" + this.props.totpKey);
}}
>
{i18next.t("totp_view_secret_delete_btn")}
{i18next.t("common_delete")}
</button>
)}
</MarginInline>
@ -135,7 +135,7 @@ export class TOTPList extends Component<DefaultPageProps, TOTPListState> {
route(totpNewURL(baseMount));
}}
>
{i18next.t("totp_view_new_btn")}
{i18next.t("common_new")}
</button>
)}
{mountCaps.includes("delete") && (
@ -145,7 +145,7 @@ export class TOTPList extends Component<DefaultPageProps, TOTPListState> {
route(delSecretsEngineURL(baseMount));
}}
>
{i18next.t("totp_view_delete_btn")}
{i18next.t("common_delete")}
</button>
)}
</p>

View file

@ -57,7 +57,7 @@ export class TOTPNewForm extends Component<
class="uk-input uk-form-width-medium"
name="name"
type="text"
placeholder={i18next.t("totp_new_name_text")}
placeholder={i18next.t("common_name")}
required
/>
</Margin>
@ -112,7 +112,7 @@ export class TOTPNewForm extends Component<
<MarginInline>
<button class="uk-button uk-button-primary" type="submit">
{i18next.t("totp_new_add_btn")}
{i18next.t("common_create")}
</button>
</MarginInline>
</Form>

View file

@ -39,7 +39,7 @@ export class TransitDecrypt extends Component<DefaultPageProps> {
</InputWithTitle>
<p class="uk-text-danger" id="errorText" />
<button class="uk-button uk-button-primary" type="submit">
{i18next.t("transit_decrypt_decrypt_btn")}
{i18next.t("transit_decrypt")}
</button>
<div id="modalAttachmentPoint" />
</Form>

View file

@ -39,7 +39,7 @@ export class TransitEncrypt extends Component<DefaultPageProps> {
</InputWithTitle>
<p class="uk-text-danger" id="errorText" />
<button class="uk-button uk-button-primary" type="submit">
{i18next.t("transit_encrypt_encrypt_btn")}
{i18next.t("transit_encrypt")}
</button>
<div id="modalAttachmentPoint" />
</Form>

View file

@ -101,7 +101,7 @@ export class TransitList extends Component<DefaultPageProps, { caps: Capabilitie
route(transitNewSecretURL(baseMount));
}}
>
{i18next.t("transit_view_new_btn")}
{i18next.t("common_new")}
</button>
)}
{mountCaps.includes("delete") && (
@ -111,7 +111,7 @@ export class TransitList extends Component<DefaultPageProps, { caps: Capabilitie
route(delSecretsEngineURL(baseMount));
}}
>
{i18next.t("transit_view_delete_btn")}
{i18next.t("common_delete")}
</button>
)}
</p>

View file

@ -31,7 +31,7 @@ export class TransitNew extends Component<DefaultPageProps> {
<input
class="uk-input uk-form-width-medium"
name="name"
placeholder={i18next.t("transit_new_key_name_input")}
placeholder={i18next.t("common_name")}
type="text"
required
/>
@ -59,7 +59,7 @@ export class TransitNew extends Component<DefaultPageProps> {
<p class="uk-text-danger" id="errorText" />
<MarginInline>
<button class="uk-button uk-button-primary" type="submit">
{i18next.t("transit_new_key_create_btn")}
{i18next.t("common_create")}
</button>
</MarginInline>
</Form>

View file

@ -75,7 +75,7 @@ export class TransitRewrap extends Component<DefaultPageProps, { transitKey: Tra
</Margin>
<p class="uk-text-danger" id="errorText" />
<button class="uk-button uk-button-primary" type="submit">
{i18next.t("transit_rewrap_rewrap_btn")}
{i18next.t("transit_rewrap")}
</button>
<div id="modalAttachmentPoint" />
</Form>

View file

@ -32,7 +32,7 @@ export class TransitView extends Component<DefaultPageProps, { transitKey: Trans
<Grid size={GridSizes.MATCHING_TWO_ROWS}>
{transitKey.supports_encryption && (
<Tile
title={i18next.t("transit_view_encrypt_text")}
title={i18next.t("transit_encrypt")}
description={i18next.t("transit_view_encrypt_description")}
icon="lock"
iconText={i18next.t("transit_view_encrypt_icon_text")}
@ -41,7 +41,7 @@ export class TransitView extends Component<DefaultPageProps, { transitKey: Trans
)}
{transitKey.supports_decryption && (
<Tile
title={i18next.t("transit_view_decrypt_text")}
title={i18next.t("transit_decrypt")}
description={i18next.t("transit_view_decrypt_description")}
icon="mail"
iconText={i18next.t("transit_view_decrypt_icon_text")}
@ -50,7 +50,7 @@ export class TransitView extends Component<DefaultPageProps, { transitKey: Trans
)}
{transitKey.supports_decryption && (
<Tile
title={i18next.t("transit_view_rewrap_text")}
title={i18next.t("transit_rewrap")}
description={i18next.t("transit_view_rewrap_description")}
icon="code"
iconText={i18next.t("transit_view_rewrap_icon_text")}