Add files via upload

This commit is contained in:
公明
2026-06-09 20:23:09 +08:00
committed by GitHub
parent abef51b805
commit 3392fefedf
8 changed files with 613 additions and 61 deletions
+12 -5
View File
@@ -819,12 +819,19 @@ async function refreshBatchProjectSelectOptions() {
projectSelect.innerHTML = `<option value="">${escapeHtml(noneLabel)}</option>`;
try {
const response = await apiFetch('/api/projects?status=active&limit=200');
if (!response.ok) {
throw new Error(_t('projects.loadProjectsFailed'));
let list = [];
if (typeof fetchAllProjects === 'function') {
list = await fetchAllProjects(false);
} else {
const response = await apiFetch('/api/projects?status=active&limit=500');
if (!response.ok) {
throw new Error(_t('projects.loadProjectsFailed'));
}
const data = await response.json();
list = typeof parseProjectsListResponse === 'function'
? parseProjectsListResponse(data).items
: (Array.isArray(data) ? data : (data.projects || []));
}
const projects = await response.json();
const list = Array.isArray(projects) ? projects : [];
const activeProjectId = typeof getActiveProjectId === 'function' ? getActiveProjectId() || '' : '';
list.forEach((project) => {