diff --git a/dashboard/src/components/extension/SkillsSection.vue b/dashboard/src/components/extension/SkillsSection.vue index c26f37abe..d8ec137e0 100644 --- a/dashboard/src/components/extension/SkillsSection.vue +++ b/dashboard/src/components/extension/SkillsSection.vue @@ -113,7 +113,7 @@
Neo Skills
-
筛选候选与发布记录
+
{{ tm("skills.neoFilterHint") }}
{{ tm("skills.refresh") }} @@ -188,10 +188,24 @@ {{ tm("skills.neoReject") }} - + Canary - + Stable `${candidateId}:${stage}`; + const isCandidatePromoteLoading = (candidateId, stage) => + !!candidatePromoteLoading[candidatePromoteLoadingKey(candidateId, stage)]; + const isCandidatePromoting = (candidateId) => + isCandidatePromoteLoading(candidateId, "canary") || isCandidatePromoteLoading(candidateId, "stable"); + const promoteCandidate = async (candidate, stage) => { + const candidateId = candidate?.id; + if (!candidateId) return; + const loadingKey = candidatePromoteLoadingKey(candidateId, stage); + if (candidatePromoteLoading[loadingKey]) return; + candidatePromoteLoading[loadingKey] = true; try { const res = await axios.post("/api/skills/neo/promote", { - candidate_id: candidate.id, + candidate_id: candidateId, stage, sync_to_local: true, }); @@ -650,6 +676,8 @@ export default { } } catch (_err) { showMessage(tm("skills.neoPromoteFailed"), "error"); + } finally { + candidatePromoteLoading[loadingKey] = false; } }; @@ -818,6 +846,8 @@ export default { deleteSkill, evaluateCandidate, promoteCandidate, + isCandidatePromoteLoading, + isCandidatePromoting, rollbackRelease, deactivateRelease, handleReleaseLifecycleAction, diff --git a/dashboard/src/i18n/locales/en-US/features/extension.json b/dashboard/src/i18n/locales/en-US/features/extension.json index 41ae7b029..24c32bcd9 100644 --- a/dashboard/src/i18n/locales/en-US/features/extension.json +++ b/dashboard/src/i18n/locales/en-US/features/extension.json @@ -245,6 +245,7 @@ "neoSkillKey": "Filter by skill_key", "neoStatus": "Candidate Status", "neoStage": "Release Stage", + "neoFilterHint": "Filter candidates and release records", "neoAll": "All", "neoCandidates": "Neo Candidates", "neoReleases": "Neo Releases", @@ -258,6 +259,9 @@ "neoRollback": "Rollback", "neoRollbackSuccess": "Rollback succeeded", "neoRollbackFailed": "Rollback failed", + "neoDeactivate": "Deactivate", + "neoDeactivateSuccess": "Deactivated successfully", + "neoDeactivateFailed": "Failed to deactivate", "neoSync": "Sync", "neoSyncSuccess": "Sync succeeded", "neoSyncFailed": "Sync failed", diff --git a/dashboard/src/i18n/locales/zh-CN/features/extension.json b/dashboard/src/i18n/locales/zh-CN/features/extension.json index a419715e1..d132a2641 100644 --- a/dashboard/src/i18n/locales/zh-CN/features/extension.json +++ b/dashboard/src/i18n/locales/zh-CN/features/extension.json @@ -245,6 +245,7 @@ "neoSkillKey": "skill_key 过滤", "neoStatus": "候选状态", "neoStage": "发布阶段", + "neoFilterHint": "筛选候选与发布记录", "neoAll": "全部", "neoCandidates": "Neo Candidates", "neoReleases": "Neo Releases",