()
| 1336 | } |
| 1337 | |
| 1338 | async function saveSettings() { |
| 1339 | const values = {}; |
| 1340 | document.querySelectorAll("[data-env-key]").forEach((input) => { |
| 1341 | values[input.dataset.envKey] = input.value; |
| 1342 | }); |
| 1343 | setStatus("保存运行设置", true); |
| 1344 | const data = await api("/api/settings", { |
| 1345 | method: "POST", |
| 1346 | body: JSON.stringify({ values }), |
| 1347 | }); |
| 1348 | const paths = data.paths || {}; |
| 1349 | renderEnvSettings(data.editable_env || []); |
| 1350 | ["writeFeishuReports", "directWriteFeishu", "directPdfWriteFeishu"].forEach((id) => { |
| 1351 | const target = $(id); |
| 1352 | if (target) target.checked = Boolean(paths.write_feishu); |
| 1353 | }); |
| 1354 | setStatus("运行设置已保存"); |
| 1355 | } |
| 1356 | |
| 1357 | async function testProvider(kind) { |
| 1358 | const label = kind === "embedding" ? "Embedding" : "LLM"; |
nothing calls this directly
no test coverage detected