From 70f63090fedf472c15974efc170b24e31c146e2f Mon Sep 17 00:00:00 2001 From: CityFun <31820853+zhengkunwang223@users.noreply.github.com> Date: Tue, 15 Jul 2025 15:39:56 +0800 Subject: [PATCH] fix: Resolve the issue of failed slave installation (#9519) --- agent/app/dto/response/app.go | 1 + agent/app/service/app_install.go | 2 ++ core/i18n/lang/en.yaml | 4 ++++ core/i18n/lang/ja.yaml | 4 ++++ core/i18n/lang/ko.yaml | 6 +++++- core/i18n/lang/ms.yml | 6 +++++- core/i18n/lang/pt-BR.yaml | 4 ++++ core/i18n/lang/ru.yaml | 4 ++++ core/i18n/lang/tr.yaml | 4 ++++ core/i18n/lang/zh-Hant.yaml | 4 ++++ core/i18n/lang/zh.yaml | 6 +++++- frontend/src/api/modules/app.ts | 5 +++-- frontend/src/composables/useGlobalStore.ts | 12 ++++++++++++ 13 files changed, 57 insertions(+), 5 deletions(-) create mode 100644 frontend/src/composables/useGlobalStore.ts diff --git a/agent/app/dto/response/app.go b/agent/app/dto/response/app.go index 1dd3618b6..1a5aefedc 100644 --- a/agent/app/dto/response/app.go +++ b/agent/app/dto/response/app.go @@ -171,6 +171,7 @@ type AppParam struct { ShowValue string `json:"showValue"` Required bool `json:"required"` Multiple bool `json:"multiple"` + Label dto.Locale `json:"label"` } type AppConfig struct { diff --git a/agent/app/service/app_install.go b/agent/app/service/app_install.go index e73de2b47..ced89b67e 100644 --- a/agent/app/service/app_install.go +++ b/agent/app/service/app_install.go @@ -715,6 +715,7 @@ func (a *AppInstallService) GetParams(id uint) (*response.AppConfig, error) { } appParam.LabelZh = form.LabelZh appParam.LabelEn = form.LabelEn + appParam.Label = form.Label appParam.Value = v if form.Type == "service" { appInstall, _ := appInstallRepo.GetFirst(appInstallRepo.WithServiceName(v.(string))) @@ -768,6 +769,7 @@ func (a *AppInstallService) GetParams(id uint) (*response.AppConfig, error) { Values: form.Values, Multiple: form.Multiple, Required: form.Required, + Label: form.Label, }) } } diff --git a/core/i18n/lang/en.yaml b/core/i18n/lang/en.yaml index 10e843f24..93fad7599 100644 --- a/core/i18n/lang/en.yaml +++ b/core/i18n/lang/en.yaml @@ -198,3 +198,7 @@ SystemMode: "mode: " ErrVerifyToken: 'Token verification error, please reset and scan again.' ErrInvalidToken: 'Invalid token, please reset and scan again.' ErrExpiredToken: 'Token has expired, please reset and scan again.' + +#cluster +ErrMasterDelete: "Unable to delete the master node, please delete the slave nodes first." +ClusterNameIsExist: "Cluster name already exists." \ No newline at end of file diff --git a/core/i18n/lang/ja.yaml b/core/i18n/lang/ja.yaml index 4eb05bd77..fb81b4fea 100644 --- a/core/i18n/lang/ja.yaml +++ b/core/i18n/lang/ja.yaml @@ -199,3 +199,7 @@ SystemMode: "モード: " ErrVerifyToken: 'トークンの検証エラーです。リセット後、再度QRコードをスキャンしてください。' ErrInvalidToken: '無効なトークンです。リセット後、再度QRコードをスキャンしてください。' ErrExpiredToken: 'トークンの有効期限が切れました。リセット後、再度QRコードをスキャンしてください。' + +#cluster +ErrMasterDelete: "マスターノードを削除できません。スレーブノードを先に削除してください。" +ClusterNameIsExist: "クラスタ名は既に存在します。" \ No newline at end of file diff --git a/core/i18n/lang/ko.yaml b/core/i18n/lang/ko.yaml index b5797624b..096c2a521 100644 --- a/core/i18n/lang/ko.yaml +++ b/core/i18n/lang/ko.yaml @@ -197,4 +197,8 @@ SystemMode: "모드: " #mobile app ErrVerifyToken: '토큰 검증 오류가 발생했습니다. 재설정 후 다시 스캔해 주세요.' ErrInvalidToken: '유효하지 않은 토큰입니다. 재설정 후 다시 스캔해 주세요.' -ErrExpiredToken: '토큰이 만료되었습니다. 재설정 후 다시 스캔해 주세요.' \ No newline at end of file +ErrExpiredToken: '토큰이 만료되었습니다. 재설정 후 다시 스캔해 주세요.' + +#cluster +ErrMasterDelete: "마스터 노드를 삭제할 수 없습니다. 슬레이브 노드를 먼저 삭제하세요." +ClusterNameIsExist: "클러스터 이름이 이미 존재합니다." \ No newline at end of file diff --git a/core/i18n/lang/ms.yml b/core/i18n/lang/ms.yml index 32831aced..9ad888b93 100644 --- a/core/i18n/lang/ms.yml +++ b/core/i18n/lang/ms.yml @@ -192,4 +192,8 @@ UserInfoAddr: "Alamat panel: " UserInfoPassHelp: "Petua: Untuk menukar kata laluan, anda boleh menjalankan arahan: " DBConnErr: "Ralat: Gagal memulakan sambungan pangkalan data, {{ .err }}" SystemVersion: "Versi: " -SystemMode: "Mod: " \ No newline at end of file +SystemMode: "Mod: " + +#cluster +ErrMasterDelete: "Tidak dapat menghapus nod utama, sila hapuskan nod perantara dahulu." +ClusterNameIsExist: "Nama kluster sudah wujud." \ No newline at end of file diff --git a/core/i18n/lang/pt-BR.yaml b/core/i18n/lang/pt-BR.yaml index 4da758dd0..214599468 100644 --- a/core/i18n/lang/pt-BR.yaml +++ b/core/i18n/lang/pt-BR.yaml @@ -198,3 +198,7 @@ SystemMode: "modo: " ErrVerifyToken: 'Erro de verificação do token, por favor, reinicie e escaneie novamente.' ErrInvalidToken: 'Token inválido, por favor, reinicie e escaneie novamente.' ErrExpiredToken: 'O token expirou, por favor, reinicie e escaneie novamente.' + +#cluster +ErrMasterDelete: "Não é possível excluir o nó mestre, exclua os nós escravos primeiro." +ClusterNameIsExist: "O nome do cluster já existe." \ No newline at end of file diff --git a/core/i18n/lang/ru.yaml b/core/i18n/lang/ru.yaml index 05f07431c..d28974088 100644 --- a/core/i18n/lang/ru.yaml +++ b/core/i18n/lang/ru.yaml @@ -198,3 +198,7 @@ SystemMode: "Режим:" ErrVerifyToken: 'шибка проверки токена, пожалуйста, сбросьте и отсканируйте снова.' ErrInvalidToken: 'Неверный токен, пожалуйста, сбросьте и отсканируйте снова.' ErrExpiredToken: 'Токен истек, пожалуйста, сбросьте и отсканируйте снова.' + +#cluster +ErrMasterDelete: "Невозможно удалить основной узел, сначала удалите подчиненные узлы." +ClusterNameIsExist: "Имя кластера уже существует." \ No newline at end of file diff --git a/core/i18n/lang/tr.yaml b/core/i18n/lang/tr.yaml index 4feec584b..ebe08a755 100644 --- a/core/i18n/lang/tr.yaml +++ b/core/i18n/lang/tr.yaml @@ -196,3 +196,7 @@ SystemMode: "mod: " ErrVerifyToken: 'Token doğrulama hatası, lütfen sıfırlayın ve tekrar tarayın.' ErrInvalidToken: 'Geçersiz token, lütfen sıfırlayın ve tekrar tarayın.' ErrExpiredToken: 'Token süresi dolmuş, lütfen sıfırlayın ve tekrar tarayın.' + +#cluster +ErrMasterDelete: "Ana düğümü silinemiyor, lütfen önce alt düğümleri silin." +ClusterNameIsExist: "Küme adı zaten var." \ No newline at end of file diff --git a/core/i18n/lang/zh-Hant.yaml b/core/i18n/lang/zh-Hant.yaml index dc13ddb86..da459d8ed 100644 --- a/core/i18n/lang/zh-Hant.yaml +++ b/core/i18n/lang/zh-Hant.yaml @@ -207,3 +207,7 @@ NodeFile: "節點文件" ErrVerifyToken: '令牌驗證錯誤,請重設後再次掃碼' ErrInvalidToken: '無效的令牌,請重設後再次掃碼' ErrExpiredToken: '令牌過期,請重設後再次掃碼' + +#cluster +ErrMasterDelete: "無法刪除主節點,請先刪除從節點。" +ClusterNameIsExist: "集群名稱已存在。" \ No newline at end of file diff --git a/core/i18n/lang/zh.yaml b/core/i18n/lang/zh.yaml index 0e2688928..05dddee2f 100644 --- a/core/i18n/lang/zh.yaml +++ b/core/i18n/lang/zh.yaml @@ -206,4 +206,8 @@ NodeFile: "节点文件" #mobile app ErrVerifyToken: '令牌验证错误,请重置后再次扫码' ErrInvalidToken: '无效的令牌,请重置后再次扫码' -ErrExpiredToken: '令牌过期,请重置后再次扫码' \ No newline at end of file +ErrExpiredToken: '令牌过期,请重置后再次扫码' + +#cluster +ErrMasterDelete: "无法删除主节点,请先删除从节点" +ClusterNameIsExist: "集群名称已存在" \ No newline at end of file diff --git a/frontend/src/api/modules/app.ts b/frontend/src/api/modules/app.ts index 5109ec3c4..c05e2d746 100644 --- a/frontend/src/api/modules/app.ts +++ b/frontend/src/api/modules/app.ts @@ -27,8 +27,9 @@ export const getAppTags = () => { return http.get('apps/tags'); }; -export const getAppDetail = (appID: number, version: string, type: string) => { - return http.get(`apps/detail/${appID}/${version}/${type}`); +export const getAppDetail = (appID: number, version: string, type: string, node?: string) => { + const params = node ? `?operateNode=${node}` : ''; + return http.get(`apps/detail/${appID}/${version}/${type}${params}`); }; export const getAppDetailByID = (id: number) => { diff --git a/frontend/src/composables/useGlobalStore.ts b/frontend/src/composables/useGlobalStore.ts new file mode 100644 index 000000000..51097074b --- /dev/null +++ b/frontend/src/composables/useGlobalStore.ts @@ -0,0 +1,12 @@ +import { GlobalStore } from '@/store'; +import { storeToRefs } from 'pinia'; + +export const useGlobalStore = () => { + const globalStore = GlobalStore(); + const storeRefs = storeToRefs(globalStore); + + return { + globalStore, + ...storeRefs, + }; +};