fix: make Creator cabinet readable on wide screens

This commit is contained in:
m
2026-08-21 03:15:07 +03:00
parent 918748ca57
commit 4226c986d7
2 changed files with 18 additions and 15 deletions
+6 -3
View File
@@ -65,7 +65,9 @@ async function request(path, options = {}) {
}
if (!response.ok) {
const detail = (await response.text()).trim();
throw new Error(detail || `Ошибка ${response.status}`);
const error = new Error(detail || `Ошибка ${response.status}`);
error.status = response.status;
throw error;
}
return response.json();
}
@@ -335,8 +337,9 @@ async function runDiagnostics() {
try {
await run();
return {label, key, state: "ok", detail: `Ответ получен · ${Math.round(performance.now() - started)} мс`};
} catch (_) {
return {label, key, state: "error", detail: "Сервис или контекст недоступен"};
} catch (error) {
const detail = error?.status === 400 ? "Нужны параметры рабочего контекста" : error?.status === 401 ? "Сессия истекла" : error?.status >= 500 ? "Сервис временно недоступен" : "Проверка не пройдена";
return {label, key, state: "error", detail};
}
}));
list.replaceChildren(...results.map((result) => createDiagnosticItem(result.label, result.key, result.state, result.detail)));