chore: commit remaining maintenance and model changes
This commit is contained in:
@@ -12,9 +12,10 @@ const BASE = '/maintenance';
|
||||
|
||||
// #region startMaintenance [C:2] [TYPE Function] [SEMANTICS maintenance, start, event]
|
||||
// @BRIEF Start a maintenance event.
|
||||
// @PRE params contains at minimum { tables, start_time }.
|
||||
// @PRE params contains at minimum { environment_id, tables, start_time }.
|
||||
// @POST Returns { task_id, maintenance_id, status }.
|
||||
// @SIDE_EFFECT Creates a maintenance event on the backend.
|
||||
// @DATA_CONTRACT Input: { environment_id: string, tables: string[], start_time: string, end_time?: string, message?: string } -> Output: { task_id: string, maintenance_id: string, status: string }
|
||||
// @RELATION DEPENDS_ON -> [requestApi]
|
||||
export async function startMaintenance<T = unknown>(params: Record<string, unknown>): Promise<T> {
|
||||
return requestApi<T>(`${BASE}/start`, 'POST', params);
|
||||
|
||||
@@ -15,6 +15,7 @@ import { SvelteDate } from "svelte/reactivity";
|
||||
import { addToast } from "$lib/toasts.svelte.js";
|
||||
import { t } from "$lib/i18n/index.svelte.js";
|
||||
import HelpTooltip from "$lib/ui/HelpTooltip.svelte";
|
||||
import { environmentContextStore } from "$lib/stores/environmentContext.svelte.js";
|
||||
|
||||
/** @type {{ onSuccess?: () => void }} */
|
||||
let { onSuccess = () => {} } = $props();
|
||||
@@ -104,7 +105,15 @@ import { SvelteDate } from "svelte/reactivity";
|
||||
|
||||
isSubmitting = true;
|
||||
try {
|
||||
const params = {
|
||||
const envId = environmentContextStore.value?.selectedEnvId;
|
||||
if (!envId) {
|
||||
addToast($t.maintenance?.no_environment || "No environment selected. Please select an environment first.", "error");
|
||||
isSubmitting = false;
|
||||
return;
|
||||
}
|
||||
|
||||
const params: Record<string, unknown> = {
|
||||
environment_id: envId,
|
||||
tables: [trimmedTable],
|
||||
start_time: startTime ? new SvelteDate(startTime).toISOString() : new SvelteDate().toISOString(),
|
||||
};
|
||||
|
||||
@@ -14,9 +14,9 @@
|
||||
// @ACTION runBackupTask() — Starts backup task for this dashboard.
|
||||
// @ACTION goBack() — Navigates back to dashboard list.
|
||||
// @ACTION openDataset(id) — Navigates to dataset detail.
|
||||
// @RELATION DEPENDS_ON -> [api]
|
||||
// @RELATION DEPENDS_ON -> [ApiModule]
|
||||
// @RELATION DEPENDS_ON -> [GitStatusModel]
|
||||
// @RELATION CALLS -> [log]
|
||||
// @RELATION CALLS -> [CotLogger]
|
||||
|
||||
import { goto } from '$app/navigation';
|
||||
import { ROUTES } from '$lib/routes';
|
||||
|
||||
@@ -25,10 +25,10 @@
|
||||
// @ACTION handleGitPull(dashboard) — Pulls from remote.
|
||||
// @ACTION handleGitPush(dashboard) — Pushes to remote.
|
||||
// @ACTION handleBulkBackup() — Executes bulk backup.
|
||||
// @RELATION DEPENDS_ON -> [api]
|
||||
// @RELATION DEPENDS_ON -> [ApiModule]
|
||||
// @RELATION CALLS -> [gitService]
|
||||
// @RELATION BINDS_TO -> [environmentContextStore]
|
||||
// @RELATION CALLS -> [log]
|
||||
// @RELATION CALLS -> [CotLogger]
|
||||
|
||||
import { SvelteSet, SvelteDate } from "svelte/reactivity";
|
||||
import { goto } from "$app/navigation";
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
// @ACTION navigateToDashboard() — Navigates to linked dashboard detail.
|
||||
// @ACTION goBack() — Navigates back to dataset list.
|
||||
// @ACTION getColumnTypeClass() — Returns Tailwind class for column type chip.
|
||||
// @RELATION DEPENDS_ON -> [api]
|
||||
// @RELATION CALLS -> [log]
|
||||
// @RELATION DEPENDS_ON -> [ApiModule]
|
||||
// @RELATION CALLS -> [CotLogger]
|
||||
|
||||
import { goto } from '$app/navigation';
|
||||
import { ROUTES } from '$lib/routes';
|
||||
|
||||
@@ -20,8 +20,8 @@
|
||||
// @ACTION handleBulkGenerateDocs() — Runs bulk generate-docs task.
|
||||
// @ACTION selectDataset(id) — Opens detail preview panel.
|
||||
// @ACTION closeDetail() — Closes detail preview panel.
|
||||
// @RELATION DEPENDS_ON -> [api]
|
||||
// @RELATION CALLS -> [log]
|
||||
// @RELATION DEPENDS_ON -> [ApiModule]
|
||||
// @RELATION CALLS -> [CotLogger]
|
||||
// @INVARIANT DECOMPOSITION GATE: 20+ atoms. If model exceeds 400 lines or 40 methods, split into submodels.
|
||||
|
||||
import { SvelteSet } from 'svelte/reactivity';
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
// @ACTION loadDictionary() / loadEntries() — Fetch data.
|
||||
// @ACTION saveEntry() / addEntry() / deleteEntry() — CRUD.
|
||||
// @ACTION importDictionary() / previewImport() — Import flow.
|
||||
// @RELATION DEPENDS_ON -> [api]
|
||||
// @RELATION CALLS -> [log]
|
||||
// @RELATION DEPENDS_ON -> [ApiModule]
|
||||
// @RELATION CALLS -> [CotLogger]
|
||||
|
||||
import { api } from '$lib/api.js';
|
||||
import { addToast } from '$lib/toasts.svelte.js';
|
||||
|
||||
@@ -11,8 +11,8 @@
|
||||
// @ACTION openScreenshot(path) — Opens screenshot blob URL in new tab.
|
||||
// @ACTION cleanupBlobs() — Revokes all screenshot blob URLs.
|
||||
// @ACTION refresh() — Re-runs loadReport().
|
||||
// @RELATION DEPENDS_ON -> [api]
|
||||
// @RELATION CALLS -> [log]
|
||||
// @RELATION DEPENDS_ON -> [ApiModule]
|
||||
// @RELATION CALLS -> [CotLogger]
|
||||
|
||||
import { api } from '$lib/api.js';
|
||||
import { log } from '$lib/cot-logger';
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// @ACTION openDetail(run) / closeDetail() — Detail panel management.
|
||||
// @ACTION applyFilters() — Reset pagination + reload.
|
||||
// @ACTION handleCancelRun/Retry/Download — Run-level actions.
|
||||
// @RELATION DEPENDS_ON -> [translateApi]
|
||||
// @RELATION DEPENDS_ON -> [TranslateApi]
|
||||
|
||||
import { addToast } from '$lib/toasts.svelte.js';
|
||||
import { _, getT } from '$lib/i18n/index.svelte.js';
|
||||
|
||||
@@ -7,8 +7,8 @@
|
||||
// @ACTION loadInitialData() — Loads environments, LLM providers, dictionaries, and if editing, job data.
|
||||
// @ACTION saveJob() — PUT/POST job configuration.
|
||||
// @ACTION handleTriggerRun(full) — Starts translation run.
|
||||
// @RELATION DEPENDS_ON -> [api]
|
||||
// @RELATION CALLS -> [log]
|
||||
// @RELATION DEPENDS_ON -> [ApiModule]
|
||||
// @RELATION CALLS -> [CotLogger]
|
||||
// @INVARIANT DECOMPOSITION GATE: 50+ atoms, ~400 lines. Model serves as single source of truth for all form state.
|
||||
// @RATIONALE Methods are NOT arrow class fields — they rely on `this` to mutate state. When passed as props
|
||||
// to child components (e.g. onTriggerRun={m.handleTriggerRun}), the binding is lost and `this`
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
// @INVARIANT Screenshot blob URLs are cached per (dashboardId, tabIndex) key. Revoked when cache key is overwritten.
|
||||
// @ACTION toggleDashboard(id) / toggleLogsSent(key) / toggleTaskLogs(key) — Collapsible section toggles.
|
||||
// @ACTION loadScreenshot(path, key) — Loads screenshot blob from storage API.
|
||||
// @RELATION DEPENDS_ON -> [api]
|
||||
// @RELATION DEPENDS_ON -> [ApiModule]
|
||||
|
||||
import { api } from '$lib/api.js';
|
||||
import type { TaskLogEntry } from '$lib/api.js';
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
// @ACTION handleDelete(id) — Deletes task with atomic list removal.
|
||||
// @ACTION handleToggleStatus(task) — Toggles is_active.
|
||||
// @ACTION goToPage(p) — Navigates to page.
|
||||
// @RELATION DEPENDS_ON -> [api]
|
||||
// @RELATION CALLS -> [log]
|
||||
// @RELATION DEPENDS_ON -> [ApiModule]
|
||||
// @RELATION CALLS -> [CotLogger]
|
||||
|
||||
import { goto } from '$app/navigation';
|
||||
import { ROUTES } from '$lib/routes';
|
||||
|
||||
Reference in New Issue
Block a user