Закончили редизайн, обновили интерфейс бэкапа

This commit is contained in:
2026-01-26 22:12:35 +03:00
parent 16ffeb1ed6
commit 1042b35d1b
23 changed files with 572 additions and 94 deletions

View File

@@ -95,7 +95,10 @@ async function requestApi(endpoint, method = 'GET', body = null) {
const response = await fetch(`${API_BASE_URL}${endpoint}`, options);
if (!response.ok) {
const errorData = await response.json().catch(() => ({}));
throw new Error(errorData.detail || `API request failed with status ${response.status}`);
const message = errorData.detail
? (typeof errorData.detail === 'string' ? errorData.detail : JSON.stringify(errorData.detail))
: `API request failed with status ${response.status}`;
throw new Error(message);
}
return await response.json();
} catch (error) {
@@ -132,6 +135,7 @@ export const api = {
// [/DEF:api_module:Module]
// Export individual functions for easier use in components
export { requestApi };
export const getPlugins = api.getPlugins;
export const getTasks = api.getTasks;
export const getTask = api.getTask;