fix: simplify zotero import modal shell
This commit is contained in:
parent
4db4632ac8
commit
0e62d0fc4e
@ -389,18 +389,6 @@
|
|||||||
projectForm: document.getElementById("create-project-form"),
|
projectForm: document.getElementById("create-project-form"),
|
||||||
projectStatus: document.getElementById("project-status"),
|
projectStatus: document.getElementById("project-status"),
|
||||||
projectList: document.getElementById("project-list"),
|
projectList: document.getElementById("project-list"),
|
||||||
importModal: document.getElementById("import-modal"),
|
|
||||||
importModalOverlay: document.getElementById("import-modal-overlay"),
|
|
||||||
openImportModalButton: document.getElementById("open-import-modal-button"),
|
|
||||||
closeImportModalButton: document.getElementById("close-import-modal-button"),
|
|
||||||
importModalProjectLabel: document.getElementById("import-modal-project-label"),
|
|
||||||
modalSelectedCount: document.getElementById("modal-selected-count"),
|
|
||||||
modalCollectionTree: document.getElementById("modal-collection-tree"),
|
|
||||||
modalCollectionItems: document.getElementById("modal-collection-items"),
|
|
||||||
modalSelectDescendantsButton: document.getElementById("modal-select-descendants-button"),
|
|
||||||
modalClearSelectionButton: document.getElementById("modal-clear-selection-button"),
|
|
||||||
modalImportSelectedItemsButton: document.getElementById("modal-import-selected-items-button"),
|
|
||||||
previewPopover: document.getElementById("item-preview-popover"),
|
|
||||||
currentProjectLabel: document.getElementById("current-project-label"),
|
currentProjectLabel: document.getElementById("current-project-label"),
|
||||||
cardList: document.getElementById("card-list"),
|
cardList: document.getElementById("card-list"),
|
||||||
cardDetail: document.getElementById("card-detail"),
|
cardDetail: document.getElementById("card-detail"),
|
||||||
@ -601,8 +589,9 @@
|
|||||||
method: "POST",
|
method: "POST",
|
||||||
body: JSON.stringify({ prompt }),
|
body: JSON.stringify({ prompt }),
|
||||||
});
|
});
|
||||||
setStatus(elements.recommendStatus, `返回 ${payload.results.length} 条候选引用。`);
|
const results = Array.isArray(payload.results) ? payload.results : [];
|
||||||
renderRecommendationResults(payload.results || []);
|
setStatus(elements.recommendStatus, `返回 ${results.length} 条候选引用。`);
|
||||||
|
renderRecommendationResults(results);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
setStatus(elements.recommendStatus, error.message, true);
|
setStatus(elements.recommendStatus, error.message, true);
|
||||||
}
|
}
|
||||||
@ -620,8 +609,9 @@
|
|||||||
method: "POST",
|
method: "POST",
|
||||||
body: JSON.stringify({ prompt }),
|
body: JSON.stringify({ prompt }),
|
||||||
});
|
});
|
||||||
setStatus(elements.planStatus, `生成 ${payload.sections.length} 个方案段落。`);
|
const sections = Array.isArray(payload.sections) ? payload.sections : [];
|
||||||
renderPlanResults(payload.sections || []);
|
setStatus(elements.planStatus, `生成 ${sections.length} 个方案段落。`);
|
||||||
|
renderPlanResults(sections);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
setStatus(elements.planStatus, error.message, true);
|
setStatus(elements.planStatus, error.message, true);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user