From 74bd997f07c5469980ec674d68ce3c6802daefcf Mon Sep 17 00:00:00 2001 From: ssongliu <73214554+ssongliu@users.noreply.github.com> Date: Mon, 15 Jul 2024 18:43:27 +0800 Subject: [PATCH] =?UTF-8?q?pref:=20=E4=BC=98=E5=8C=96=E8=BF=9C=E7=A8=8B?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=BA=93=E5=88=A0=E9=99=A4=E6=8F=90=E7=A4=BA?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=20(#5824)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Refs #5819 #5818 --- backend/utils/common/common.go | 14 +++++++---- frontend/src/lang/modules/en.ts | 5 ++++ frontend/src/lang/modules/tw.ts | 4 ++++ frontend/src/lang/modules/zh.ts | 4 ++++ .../database/mysql/remote/delete/index.vue | 24 +++++-------------- .../postgresql/remote/delete/index.vue | 20 +++++----------- .../database/redis/remote/delete/index.vue | 24 +++++-------------- 7 files changed, 40 insertions(+), 55 deletions(-) diff --git a/backend/utils/common/common.go b/backend/utils/common/common.go index 1f20a2681..d0def7382 100644 --- a/backend/utils/common/common.go +++ b/backend/utils/common/common.go @@ -230,13 +230,17 @@ func RemoveRepeatElement(a interface{}) (ret []interface{}) { } func LoadSizeUnit(value float64) string { - if value > 1048576 { - return fmt.Sprintf("%vM", value/1048576) + val := int64(value) + if val%1024 != 0 { + return fmt.Sprintf("%v", val) } - if value > 1024 { - return fmt.Sprintf("%vK", value/1024) + if val > 1048576 { + return fmt.Sprintf("%vM", val/1048576) } - return fmt.Sprintf("%v", value) + if val > 1024 { + return fmt.Sprintf("%vK", val/1024) + } + return fmt.Sprintf("%v", val) } func LoadSizeUnit2F(value float64) string { diff --git a/frontend/src/lang/modules/en.ts b/frontend/src/lang/modules/en.ts index 832264e7e..02dc6a62b 100644 --- a/frontend/src/lang/modules/en.ts +++ b/frontend/src/lang/modules/en.ts @@ -437,6 +437,11 @@ const message = { remote: 'Remote', remoteDB: 'Remote DB', createRemoteDB: 'Create Remote Server', + unBindRemoteDB: 'Unbind remote server', + unBindForce: 'Force unbind', + unBindForceHelper: 'Ignore all errors during the unbinding process to ensure the final operation is successful', + unBindRemoteHelper: + 'Unbinding the remote database will only remove the binding relationship and will not directly delete the remote database', editRemoteDB: 'Edit Remote Server', localDB: 'Local DB', address: 'DB address', diff --git a/frontend/src/lang/modules/tw.ts b/frontend/src/lang/modules/tw.ts index 1ab29e2b4..e73bc7d80 100644 --- a/frontend/src/lang/modules/tw.ts +++ b/frontend/src/lang/modules/tw.ts @@ -424,6 +424,10 @@ const message = { remote: '遠程', remoteDB: '遠程服務器', createRemoteDB: '添加遠程服務器', + unBindRemoteDB: '解綁遠程服務器', + unBindForce: '強制解綁', + unBindForceHelper: '忽略解綁過程中的所有錯誤,確保最終操作成功', + unBindRemoteHelper: '解綁遠程數據庫只會刪除綁定關係,不會直接刪除遠程數據庫', editRemoteDB: '編輯遠程服務器', localDB: '本地數據庫', address: '數據庫地址', diff --git a/frontend/src/lang/modules/zh.ts b/frontend/src/lang/modules/zh.ts index 5503b1f3a..da790c3f5 100644 --- a/frontend/src/lang/modules/zh.ts +++ b/frontend/src/lang/modules/zh.ts @@ -424,6 +424,10 @@ const message = { remote: '远程', remoteDB: '远程服务器', createRemoteDB: '添加远程服务器', + unBindRemoteDB: '解绑远程服务器', + unBindForce: '强制解绑', + unBindForceHelper: '忽略解绑过程中的所有错误,确保最终操作成功', + unBindRemoteHelper: '解绑远程数据库只会删除绑定关系,不会直接删除远程数据库', editRemoteDB: '编辑远程服务器', localDB: '本地数据库', address: '数据库地址', diff --git a/frontend/src/views/database/mysql/remote/delete/index.vue b/frontend/src/views/database/mysql/remote/delete/index.vue index 04f4b4a63..992c0617b 100644 --- a/frontend/src/views/database/mysql/remote/delete/index.vue +++ b/frontend/src/views/database/mysql/remote/delete/index.vue @@ -1,15 +1,15 @@