fix: restore LLM profile test connectivity buttons (lost from git)

Frontend test functionality was implemented but never committed to git.
Re-adds:
- profiles.js: testCard(), testForm(), _showTestResult(), test btn in renderCard
- api.js: testProfile(id) and probeConnectivity(body) methods
- index.html: 测试连通性 button + result div in profile form
- app.css: .btn-test and .profile-test-result styles

Backend /probe and /{id}/test endpoints were already present in llm_profiles.py.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
2026-06-23 13:58:43 +08:00
parent 7cc3aff95a
commit 1dc7ab9727
4 changed files with 94 additions and 0 deletions

View File

@@ -65,4 +65,16 @@ const API = {
});
},
applyProfiles(body) { return API.post("/api/llm-profiles/apply", body); },
// 测试已保存 profile 的连通性
testProfile(id) {
return fetch(`/api/llm-profiles/${encodeURIComponent(id)}/test`, { method: "POST" })
.then(async r => {
if (!r.ok) { const d = await API._extractError(r); throw new Error(d); }
return r.json();
});
},
// 测试表单中填写的内联参数(保存前即可测试)
probeConnectivity(body) { return API.post("/api/llm-profiles/probe", body); },
};