MCPcopy Create free account
hub / github.com/OpenRaiser/PaperFlow / refreshSettings

Function refreshSettings

deployments/desktop/static/app.js:1290–1315  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1288}
1289
1290async function refreshSettings() {
1291 const data = await api("/api/settings");
1292 const paths = data.paths || {};
1293 const rows = [
1294 ["项目根目录", data.project_root],
1295 [".env 文件", data.env_path],
1296 ["数据库", data.database],
1297 ["PDF 保存目录", paths.pdf_dir],
1298 ["精读报告目录", paths.reading_reports_dir],
1299 ["知识库目录", paths.wiki_dir],
1300 ["按月份分目录", paths.monthly_subdir ? "是" : "否"],
1301 ["写入知识库", paths.wiki_ingest ? "是" : "否"],
1302 ["写入飞书文档", paths.write_feishu ? "是" : "否"],
1303 ];
1304 $("settingsList").className = "settings-list";
1305 $("settingsList").innerHTML = rows.map(([key, value]) => `
1306 <div class="setting-item"><strong>${escapeHtml(key)}</strong><br><code>${escapeHtml(value || "")}</code></div>
1307 `).join("");
1308 renderEnvSettings(data.editable_env || []);
1309 ["writeFeishuReports", "directWriteFeishu", "directPdfWriteFeishu"].forEach((id) => {
1310 const target = $(id);
1311 if (target && !target.dataset.userTouched) {
1312 target.checked = Boolean(paths.write_feishu);
1313 }
1314 });
1315}
1316
1317function renderEnvSettings(items) {
1318 const target = $("envSettingsForm");

Callers 1

bootFunction · 0.85

Calls 4

renderEnvSettingsFunction · 0.85
apiFunction · 0.70
$Function · 0.70
escapeHtmlFunction · 0.70

Tested by

no test coverage detected