From 18c034a104c711fde67af0e697f670e34580f95a Mon Sep 17 00:00:00 2001 From: ChaotiCryptidz Date: Mon, 10 Jan 2022 14:57:53 +0000 Subject: [PATCH] merge some translations into common ones --- src/allPages.ts | 121 ------------------ src/pages.tsx | 4 + src/translations/en.js | 72 ++++------- src/ui/pages/Access/Auth/AuthViewConfig.tsx | 4 +- .../Auth/userpass/UserPassUserDelete.tsx | 2 +- .../Access/Auth/userpass/UserPassUserEdit.tsx | 12 +- .../Access/Auth/userpass/UserPassUserNew.tsx | 6 +- .../Access/Auth/userpass/UserPassUserView.tsx | 12 +- .../Auth/userpass/UserPassUsersList.tsx | 2 +- src/ui/pages/Policies/PoliciesHome.tsx | 2 +- src/ui/pages/Policies/PolicyDelete.tsx | 2 +- src/ui/pages/Policies/PolicyEdit.tsx | 2 +- src/ui/pages/Policies/PolicyNew.tsx | 4 +- src/ui/pages/Policies/PolicyView.tsx | 4 +- src/ui/pages/Secrets/DeleteSecretsEngine.tsx | 2 +- .../pages/Secrets/KeyValue/KeyValueDelete.tsx | 2 +- .../pages/Secrets/KeyValue/KeyValueEdit.tsx | 2 +- src/ui/pages/Secrets/KeyValue/KeyValueNew.tsx | 2 +- .../pages/Secrets/KeyValue/KeyValueView.tsx | 2 +- .../pages/Secrets/NewEngines/NewKVEngine.tsx | 4 +- .../Secrets/NewEngines/NewTOTPEngine.tsx | 4 +- .../Secrets/NewEngines/NewTransitEngine.tsx | 4 +- src/ui/pages/Secrets/SSH/SSH_List.tsx | 54 ++++++++ src/ui/pages/Secrets/SecretsHome.tsx | 11 +- src/ui/pages/Secrets/TOTP/TOTPDelete.tsx | 2 +- src/ui/pages/Secrets/TOTP/TOTPList.tsx | 6 +- src/ui/pages/Secrets/TOTP/TOTPNew.tsx | 4 +- .../pages/Secrets/Transit/TransitDecrypt.tsx | 2 +- .../pages/Secrets/Transit/TransitEncrypt.tsx | 2 +- src/ui/pages/Secrets/Transit/TransitList.tsx | 4 +- src/ui/pages/Secrets/Transit/TransitNew.tsx | 4 +- .../pages/Secrets/Transit/TransitRewrap.tsx | 2 +- src/ui/pages/Secrets/Transit/TransitView.tsx | 6 +- 33 files changed, 142 insertions(+), 226 deletions(-) delete mode 100644 src/allPages.ts create mode 100644 src/ui/pages/Secrets/SSH/SSH_List.tsx diff --git a/src/allPages.ts b/src/allPages.ts deleted file mode 100644 index 0f350ab..0000000 --- a/src/allPages.ts +++ /dev/null @@ -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 { -// return getObjectKeys(this.pages); -// } -// async getPage(pageID: string): Promise { -// return this.pages[pageID]; -// } -//} -// -//export const pageList = new PageList(allPages); diff --git a/src/pages.tsx b/src/pages.tsx index db0c242..c33edb1 100644 --- a/src/pages.tsx +++ b/src/pages.tsx @@ -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 = () => ( @@ -106,6 +107,9 @@ export const Main = () => ( api={api} /> + + + diff --git a/src/translations/en.js b/src/translations/en.js index 2c02c90..23bca91 100644 --- a/src/translations/en.js +++ b/src/translations/en.js @@ -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", }; diff --git a/src/ui/pages/Access/Auth/AuthViewConfig.tsx b/src/ui/pages/Access/Auth/AuthViewConfig.tsx index fb7e975..a8c7c84 100644 --- a/src/ui/pages/Access/Auth/AuthViewConfig.tsx +++ b/src/ui/pages/Access/Auth/AuthViewConfig.tsx @@ -49,11 +49,11 @@ export class AuthViewConfig extends Component { route(userPassUserListURL(baseMount)); }} > - {i18next.t("userpass_user_delete_btn")} + {i18next.t("common_delete")} diff --git a/src/ui/pages/Access/Auth/userpass/UserPassUserEdit.tsx b/src/ui/pages/Access/Auth/userpass/UserPassUserEdit.tsx index 5eb0bec..d22f577 100644 --- a/src/ui/pages/Access/Auth/userpass/UserPassUserEdit.tsx +++ b/src/ui/pages/Access/Auth/userpass/UserPassUserEdit.tsx @@ -35,7 +35,7 @@ export class UserPassUserEdit extends Component @@ -46,7 +46,7 @@ export class UserPassUserEdit extends Component{i18next.t("auth_common_generated_tokens")}

- + - + - + - + diff --git a/src/ui/pages/Access/Auth/userpass/UserPassUserNew.tsx b/src/ui/pages/Access/Auth/userpass/UserPassUserNew.tsx index bfb0c6f..227e6b6 100644 --- a/src/ui/pages/Access/Auth/userpass/UserPassUserNew.tsx +++ b/src/ui/pages/Access/Auth/userpass/UserPassUserNew.tsx @@ -21,7 +21,7 @@ export class UserPassUserNew extends Component { class="uk-input uk-form-width-large" name="username" type="text" - placeholder={i18next.t("auth_common_username")} + placeholder={i18next.t("common_username")} /> @@ -29,13 +29,13 @@ export class UserPassUserNew extends Component { class="uk-input uk-form-width-large" name="password" type="password" - placeholder={i18next.t("auth_common_password")} + placeholder={i18next.t("common_password")} />

diff --git a/src/ui/pages/Access/Auth/userpass/UserPassUserView.tsx b/src/ui/pages/Access/Auth/userpass/UserPassUserView.tsx index 2f2811c..21c9326 100644 --- a/src/ui/pages/Access/Auth/userpass/UserPassUserView.tsx +++ b/src/ui/pages/Access/Auth/userpass/UserPassUserView.tsx @@ -36,7 +36,7 @@ export class UserPassUserView extends Component - {i18next.t("userpass_user_view_delete_btn")} + {i18next.t("common_delete")}

@@ -59,15 +59,15 @@ export class UserPassUserView extends Component - {i18next.t("userpass_user_list_new_btn")} + {i18next.t("common_new")}
    diff --git a/src/ui/pages/Policies/PoliciesHome.tsx b/src/ui/pages/Policies/PoliciesHome.tsx index b822fdf..31312a6 100644 --- a/src/ui/pages/Policies/PoliciesHome.tsx +++ b/src/ui/pages/Policies/PoliciesHome.tsx @@ -35,7 +35,7 @@ export class PoliciesHome extends Component - {i18next.t("policies_home_new_btn")} + {i18next.t("common_new")}

    diff --git a/src/ui/pages/Policies/PolicyDelete.tsx b/src/ui/pages/Policies/PolicyDelete.tsx index 533b3fe..d97377f 100644 --- a/src/ui/pages/Policies/PolicyDelete.tsx +++ b/src/ui/pages/Policies/PolicyDelete.tsx @@ -25,7 +25,7 @@ export class PolicyDelete extends Component { } }} > - {i18next.t("policy_delete_btn")} + {i18next.t("common_delete")} diff --git a/src/ui/pages/Policies/PolicyEdit.tsx b/src/ui/pages/Policies/PolicyEdit.tsx index fe713e6..0fb79f8 100644 --- a/src/ui/pages/Policies/PolicyEdit.tsx +++ b/src/ui/pages/Policies/PolicyEdit.tsx @@ -83,7 +83,7 @@ export class PolicyEditor extends Component diff --git a/src/ui/pages/Policies/PolicyNew.tsx b/src/ui/pages/Policies/PolicyNew.tsx index 89cc5c3..8aa6b63 100644 --- a/src/ui/pages/Policies/PolicyNew.tsx +++ b/src/ui/pages/Policies/PolicyNew.tsx @@ -35,13 +35,13 @@ export class PolicyNew extends Component {

    diff --git a/src/ui/pages/Policies/PolicyView.tsx b/src/ui/pages/Policies/PolicyView.tsx index 0dec434..3abdd90 100644 --- a/src/ui/pages/Policies/PolicyView.tsx +++ b/src/ui/pages/Policies/PolicyView.tsx @@ -36,7 +36,7 @@ export class PolicyView extends Component< route(policyEditURL(this.state.policyName)); }} > - {i18next.t("policy_view_edit_btn")} + {i18next.t("common_edit")} {this.state.policyName !== "default" && ( )}

    diff --git a/src/ui/pages/Secrets/DeleteSecretsEngine.tsx b/src/ui/pages/Secrets/DeleteSecretsEngine.tsx index 1526d28..be11dc5 100644 --- a/src/ui/pages/Secrets/DeleteSecretsEngine.tsx +++ b/src/ui/pages/Secrets/DeleteSecretsEngine.tsx @@ -25,7 +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 699f613..e199e31 100644 --- a/src/ui/pages/Secrets/KeyValue/KeyValueDelete.tsx +++ b/src/ui/pages/Secrets/KeyValue/KeyValueDelete.tsx @@ -27,7 +27,7 @@ export class KeyValueDelete extends Component { window.history.back(); }} > - {i18next.t("kv_delete_btn")} + {i18next.t("common_delete")} diff --git a/src/ui/pages/Secrets/KeyValue/KeyValueEdit.tsx b/src/ui/pages/Secrets/KeyValue/KeyValueEdit.tsx index 2286cf0..8696448 100644 --- a/src/ui/pages/Secrets/KeyValue/KeyValueEdit.tsx +++ b/src/ui/pages/Secrets/KeyValue/KeyValueEdit.tsx @@ -96,7 +96,7 @@ export class KVEditor extends Component { onUpdate={(code) => this.onCodeUpdate(code)} /> ); diff --git a/src/ui/pages/Secrets/KeyValue/KeyValueNew.tsx b/src/ui/pages/Secrets/KeyValue/KeyValueNew.tsx index 23308ae..89b3d5f 100644 --- a/src/ui/pages/Secrets/KeyValue/KeyValueNew.tsx +++ b/src/ui/pages/Secrets/KeyValue/KeyValueNew.tsx @@ -37,7 +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 a03f897..52f69df 100644 --- a/src/ui/pages/Secrets/KeyValue/KeyValueView.tsx +++ b/src/ui/pages/Secrets/KeyValue/KeyValueView.tsx @@ -106,7 +106,7 @@ export class KeyValueView extends Component ); }} > - {i18next.t("kv_secret_edit_btn")} + {i18next.t("common_edit")} )}

    diff --git a/src/ui/pages/Secrets/NewEngines/NewKVEngine.tsx b/src/ui/pages/Secrets/NewEngines/NewKVEngine.tsx index fa6c103..a6c52c5 100644 --- a/src/ui/pages/Secrets/NewEngines/NewKVEngine.tsx +++ b/src/ui/pages/Secrets/NewEngines/NewKVEngine.tsx @@ -20,7 +20,7 @@ export class NewKVEngine extends Component { 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 /> @@ -37,7 +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 27287e7..2396391 100644 --- a/src/ui/pages/Secrets/NewEngines/NewTOTPEngine.tsx +++ b/src/ui/pages/Secrets/NewEngines/NewTOTPEngine.tsx @@ -20,14 +20,14 @@ export class NewTOTPEngine extends Component { 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 />

    diff --git a/src/ui/pages/Secrets/NewEngines/NewTransitEngine.tsx b/src/ui/pages/Secrets/NewEngines/NewTransitEngine.tsx index d8c08fd..266bc21 100644 --- a/src/ui/pages/Secrets/NewEngines/NewTransitEngine.tsx +++ b/src/ui/pages/Secrets/NewEngines/NewTransitEngine.tsx @@ -19,14 +19,14 @@ export class NewTransitEngine extends Component { 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 />

    diff --git a/src/ui/pages/Secrets/SSH/SSH_List.tsx b/src/ui/pages/Secrets/SSH/SSH_List.tsx new file mode 100644 index 0000000..aff6b02 --- /dev/null +++ b/src/ui/pages/Secrets/SSH/SSH_List.tsx @@ -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 { + 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 ( + <> + + +

    + {sshCaps.includes("create") && ( + + )} + {mountCaps.includes("delete") && ( + + )} +

    + + ); + } +} diff --git a/src/ui/pages/Secrets/SecretsHome.tsx b/src/ui/pages/Secrets/SecretsHome.tsx index cfe56c8..48bc311 100644 --- a/src/ui/pages/Secrets/SecretsHome.tsx +++ b/src/ui/pages/Secrets/SecretsHome.tsx @@ -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; diff --git a/src/ui/pages/Secrets/TOTP/TOTPDelete.tsx b/src/ui/pages/Secrets/TOTP/TOTPDelete.tsx index 4fc551b..9881d23 100644 --- a/src/ui/pages/Secrets/TOTP/TOTPDelete.tsx +++ b/src/ui/pages/Secrets/TOTP/TOTPDelete.tsx @@ -26,7 +26,7 @@ export class TOTPDelete extends Component { route(totpListURL(baseMount)); }} > - {i18next.t("kv_delete_btn")} + {i18next.t("common_delete")} diff --git a/src/ui/pages/Secrets/TOTP/TOTPList.tsx b/src/ui/pages/Secrets/TOTP/TOTPList.tsx index 7091303..ac33b65 100644 --- a/src/ui/pages/Secrets/TOTP/TOTPList.tsx +++ b/src/ui/pages/Secrets/TOTP/TOTPList.tsx @@ -56,7 +56,7 @@ export class RefreshingTOTPGridItem extends Component - {i18next.t("totp_view_secret_delete_btn")} + {i18next.t("common_delete")} )} @@ -135,7 +135,7 @@ export class TOTPList extends Component { route(totpNewURL(baseMount)); }} > - {i18next.t("totp_view_new_btn")} + {i18next.t("common_new")} )} {mountCaps.includes("delete") && ( @@ -145,7 +145,7 @@ export class TOTPList extends Component { route(delSecretsEngineURL(baseMount)); }} > - {i18next.t("totp_view_delete_btn")} + {i18next.t("common_delete")} )}

    diff --git a/src/ui/pages/Secrets/TOTP/TOTPNew.tsx b/src/ui/pages/Secrets/TOTP/TOTPNew.tsx index c4532d5..df7be47 100644 --- a/src/ui/pages/Secrets/TOTP/TOTPNew.tsx +++ b/src/ui/pages/Secrets/TOTP/TOTPNew.tsx @@ -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 /> @@ -112,7 +112,7 @@ export class TOTPNewForm extends Component< diff --git a/src/ui/pages/Secrets/Transit/TransitDecrypt.tsx b/src/ui/pages/Secrets/Transit/TransitDecrypt.tsx index e4276ab..81b28f9 100644 --- a/src/ui/pages/Secrets/Transit/TransitDecrypt.tsx +++ b/src/ui/pages/Secrets/Transit/TransitDecrypt.tsx @@ -39,7 +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 d36d9f0..c3fa078 100644 --- a/src/ui/pages/Secrets/Transit/TransitEncrypt.tsx +++ b/src/ui/pages/Secrets/Transit/TransitEncrypt.tsx @@ -39,7 +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 b6b0f70..61f9abc 100644 --- a/src/ui/pages/Secrets/Transit/TransitList.tsx +++ b/src/ui/pages/Secrets/Transit/TransitList.tsx @@ -101,7 +101,7 @@ export class TransitList extends Component - {i18next.t("transit_view_new_btn")} + {i18next.t("common_new")} )} {mountCaps.includes("delete") && ( @@ -111,7 +111,7 @@ export class TransitList extends Component - {i18next.t("transit_view_delete_btn")} + {i18next.t("common_delete")} )}

    diff --git a/src/ui/pages/Secrets/Transit/TransitNew.tsx b/src/ui/pages/Secrets/Transit/TransitNew.tsx index 076b280..e21ae6a 100644 --- a/src/ui/pages/Secrets/Transit/TransitNew.tsx +++ b/src/ui/pages/Secrets/Transit/TransitNew.tsx @@ -31,7 +31,7 @@ export class TransitNew extends Component { @@ -59,7 +59,7 @@ export class TransitNew extends Component {

    diff --git a/src/ui/pages/Secrets/Transit/TransitRewrap.tsx b/src/ui/pages/Secrets/Transit/TransitRewrap.tsx index bdb556c..6a3fed1 100644 --- a/src/ui/pages/Secrets/Transit/TransitRewrap.tsx +++ b/src/ui/pages/Secrets/Transit/TransitRewrap.tsx @@ -75,7 +75,7 @@ export class TransitRewrap extends Component

    diff --git a/src/ui/pages/Secrets/Transit/TransitView.tsx b/src/ui/pages/Secrets/Transit/TransitView.tsx index 1bdb8fe..c03823d 100644 --- a/src/ui/pages/Secrets/Transit/TransitView.tsx +++ b/src/ui/pages/Secrets/Transit/TransitView.tsx @@ -32,7 +32,7 @@ export class TransitView extends Component {transitKey.supports_encryption && (