From 2f5d1e1d51273e9efd76aea4ba23a89d7492cf1a Mon Sep 17 00:00:00 2001 From: tiny-craft <137850705+tiny-craft@users.noreply.github.com> Date: Sat, 19 Aug 2023 01:50:16 +0800 Subject: [PATCH] perf: correct some english words --- frontend/src/langs/en.json | 32 +++++++++++++++++--------------- frontend/src/stores/tab.js | 14 +++++++++----- 2 files changed, 26 insertions(+), 20 deletions(-) diff --git a/frontend/src/langs/en.json b/frontend/src/langs/en.json index f3a1b58..bbc053c 100644 --- a/frontend/src/langs/en.json +++ b/frontend/src/langs/en.json @@ -11,9 +11,9 @@ "new_conn": "Add New Connection", "new_group": "Add New Group", "rename_group": "Rename Group", - "disconnect_all": "Disconnect all connections", + "disconnect_all": "Disconnect all", "filter": "Filter", - "sort_conn": "Resort Connections", + "sort_conn": "Sort Connections", "close_confirm": "Confirm close this tab and connection", "edit_close_confirm": "Please close the relevant connections before editing. Do you want to continue?", "opening_connection": "Opening Connection...", @@ -22,12 +22,12 @@ "forever": "Forever", "rename_key": "Rename Key", "delete_key": "Delete Key", - "batch_delete_key": "Batch Delete Key", + "batch_delete_key": "Batch Delete Keys", "db_index": "Database Index", "key_expression": "Key Expression", - "affected_key": "Affected Key", - "show_affected_key": "Show Affected Key", - "confirm_delete_key": "Confirm Delete {num}", + "affected_key": "Affected Keys", + "show_affected_key": "Show Affected Keys", + "confirm_delete_key": "Confirm Delete {num} Keys", "delete_key_succ": "\"{key}\" has been deleted", "copy_value": "Copy Value", "edit_value": "Edit Value", @@ -38,12 +38,14 @@ "edit_row": "Edit Row", "delete_row": "Delete Row", "search": "Search", + "filter_field": "Filter Field", + "filter_value": "Filter Value", "view_as": "View As", "reload": "Reload", "open_connection": "Open Connection", "open_db": "Open Database", "close_db": "Close Database", - "filter_key": "Filter Keys", + "filter_key": "Filter Key", "disconnect": "Disconnect", "dup_conn": "Duplicate Connection", "remove_conn": "Delete Connection", @@ -54,7 +56,7 @@ "no_group": "No Group", "copy_path": "Copy Path", "batch_delete": "Batch Delete", - "copy_key": "Copy Key Name", + "copy_key": "Copy Key", "remove_key": "Remove Key", "new_conn_title": "New Connection", "edit_conn_title": "Edit Connection", @@ -85,8 +87,8 @@ "new_key_name": "New Key Name", "new_key": "Add New Key", "new_field": "Add New Field", - "overwrite_field": "Overwrite Duplicated Field", - "ignore_field": "Ignore Duplicated Field", + "overwrite_field": "Overwrite Existing Field", + "ignore_field": "Ignore Existing Field", "new_item": "Add New Item", "insert_type": "Insert", "append_item": "Append", @@ -124,14 +126,14 @@ "auto_check_update": "Automatically check for updates", "set_ttl": "Set Key TTL", "persist_key": "Persist Key", - "copy_value_succ": "Value Copied !", + "copy_succ": "Value Copied !", "save_value_succ": "Value Saved !", - "handle_succ": "Handle Success !", - "reload_succ": "Reload Success !", + "handle_succ": "Success!", + "reload_succ": "Reloaded!", "field_required": "This item should not be blank", "spec_field_required": "\"{key}\" should not be blank", - "nonexist_tab_content": "The selected key does not exist. Please retry", - "empty_server_content": "Connect server from left list", + "nonexist_tab_content": "Selected key does not exist. Please retry", + "empty_server_content": "Select and open a connection from the left", "empty_server_list": "No redis server", "reload_when_succ": "Reload immediately after success", "server": "Server", diff --git a/frontend/src/stores/tab.js b/frontend/src/stores/tab.js index 16e4859..edbf481 100644 --- a/frontend/src/stores/tab.js +++ b/frontend/src/stores/tab.js @@ -208,13 +208,17 @@ const useTabStore = defineStore('tab', { * @param {string} server * @param {string|string[]} keys */ - setSelectedKeys(server, keys) { - if (typeof keys === 'string') { - keys = [keys] - } + setSelectedKeys(server, keys = null) { let tab = find(this.tabList, { name: server }) if (tab != null) { - tab.selectedKeys = keys + if (keys == null) { + // select nothing + tab.selectedKeys = [server] + } else if (typeof keys === 'string') { + tab.selectedKeys = [keys] + } else { + tab.selectedKeys = keys + } } }, },