From 4de290a73c4dfe780d4727a6b154823bf0eb50a9 Mon Sep 17 00:00:00 2001 From: Hong Jiarong Date: Fri, 24 Jul 2026 14:39:26 +0800 Subject: [PATCH] fix(hub): lock provider id during BYOK rotate + scroll/focus feedback MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Clicking 轮换 on a BYOK provider row prefilled the 供应方 ID below but gave no signal — no scroll, no focus, no toast — so it looked dead ("点不进去"). The 供应方 ID input stayed editable too: changing it silently created a new connection (version 1) instead of rotating the one clicked. - startRotate now locks the id (readonly), scrolls the form into view, focuses 接口地址, and toasts "已填入供应方 X…". - Heading switches between 轮换凭据 · and 新建 / 轮换 BYOK 凭据; an inline hint explains how to create a different provider (清空). - save() distinguishes create vs rotate via the returned activeVersion (version 1 → 已创建 BYOK 连接, else 凭据已轮换). - Add toastInfo to $lib/toast for the info-level affordance. Backend unchanged: list/rotate/reject-member/reject-platform-overwrite tests already pass; this is a UI feedback + id-lock fix. --- hub/admin-web/src/lib/toast.ts | 3 +++ .../src/routes/admin/provider/+page.svelte | 26 ++++++++++++++----- 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/hub/admin-web/src/lib/toast.ts b/hub/admin-web/src/lib/toast.ts index ad89770..1b16d50 100644 --- a/hub/admin-web/src/lib/toast.ts +++ b/hub/admin-web/src/lib/toast.ts @@ -32,3 +32,6 @@ export function toastSuccess(message: string): void { export function toastError(message: string): void { pushToast(message, 'error', 5000); } +export function toastInfo(message: string): void { + pushToast(message, 'info'); +} diff --git a/hub/admin-web/src/routes/admin/provider/+page.svelte b/hub/admin-web/src/routes/admin/provider/+page.svelte index 383ecc7..b098f82 100644 --- a/hub/admin-web/src/routes/admin/provider/+page.svelte +++ b/hub/admin-web/src/routes/admin/provider/+page.svelte @@ -1,4 +1,5 @@