From 16ffeb1ed6e3a73684787fba4797bbcd23b799d7 Mon Sep 17 00:00:00 2001 From: busya Date: Mon, 26 Jan 2026 21:17:05 +0300 Subject: [PATCH] =?UTF-8?q?=D0=92=D1=8B=D0=BF=D0=BE=D0=BB=D0=BD=D0=B5?= =?UTF-8?q?=D0=BD=D0=BE,=20=D0=BF=D0=B5=D1=80=D0=B5=D0=B4=D0=B0=D0=BD?= =?UTF-8?q?=D0=BE=20=D0=BD=D0=B0=20=D1=82=D0=B5=D1=81=D1=82=D0=B8=D1=80?= =?UTF-8?q?=D0=BE=D0=B2=D0=B0=D0=BD=D0=B8=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/EnvSelector.svelte | 60 ------ frontend/src/components/Navbar.svelte | 24 --- .../src/components/backups/BackupList.svelte | 74 +++++++ .../components/backups/BackupManager.svelte | 0 .../src/components/tools/SearchTool.svelte | 186 ------------------ frontend/src/routes/+page.svelte | 8 +- .../routes/settings/environments/+page.svelte | 40 ---- frontend/src/routes/tasks/+page.svelte | 8 +- .../src/routes/tools/backups/+page.svelte | 27 +++ frontend/src/routes/tools/search/+page.svelte | 25 --- frontend/src/types/backup.ts | 22 +++ specs/015-frontend-nav-redesign/tasks.md | 50 ++--- 12 files changed, 156 insertions(+), 368 deletions(-) delete mode 100644 frontend/src/components/EnvSelector.svelte create mode 100644 frontend/src/components/backups/BackupList.svelte create mode 100644 frontend/src/components/backups/BackupManager.svelte delete mode 100644 frontend/src/components/tools/SearchTool.svelte delete mode 100644 frontend/src/routes/settings/environments/+page.svelte create mode 100644 frontend/src/routes/tools/backups/+page.svelte delete mode 100644 frontend/src/routes/tools/search/+page.svelte create mode 100644 frontend/src/types/backup.ts diff --git a/frontend/src/components/EnvSelector.svelte b/frontend/src/components/EnvSelector.svelte deleted file mode 100644 index 82307fc..0000000 --- a/frontend/src/components/EnvSelector.svelte +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - -
- - -
- - - - - diff --git a/frontend/src/components/Navbar.svelte b/frontend/src/components/Navbar.svelte index abf9d91..d91004e 100644 --- a/frontend/src/components/Navbar.svelte +++ b/frontend/src/components/Navbar.svelte @@ -25,35 +25,12 @@ > {$t.nav.dashboard} - - {$t.nav.migration} - - - {$t.nav.git} - {$t.nav.tasks} -
- - -
diff --git a/frontend/src/components/backups/BackupList.svelte b/frontend/src/components/backups/BackupList.svelte new file mode 100644 index 0000000..333a6bc --- /dev/null +++ b/frontend/src/components/backups/BackupList.svelte @@ -0,0 +1,74 @@ + + + + + + +
+ + + + + + + + + + + {#each backups as backup} + + + + + + + {:else} + + + + {/each} + +
+ {$t.storage.table.name} + + {$t.tasks.target_env} + + {$t.storage.table.created_at} + + {$t.storage.table.actions} +
+ {backup.name} + + {backup.environment} + + {new Date(backup.created_at).toLocaleString()} + + +
+ {$t.storage.no_files} +
+
+ + + + + \ No newline at end of file diff --git a/frontend/src/components/backups/BackupManager.svelte b/frontend/src/components/backups/BackupManager.svelte new file mode 100644 index 0000000..e69de29 diff --git a/frontend/src/components/tools/SearchTool.svelte b/frontend/src/components/tools/SearchTool.svelte deleted file mode 100644 index a5f8020..0000000 --- a/frontend/src/components/tools/SearchTool.svelte +++ /dev/null @@ -1,186 +0,0 @@ - - - - - -
-
-

Search Dataset Metadata

-
-
- - -
-
- - -
-
-
- -
-
- - {#if results} -
-
-

- Search Results -

- - {results.count} matches - -
-
    - {#each results.results as item} -
  • -
    -
    - {item.dataset_name} (ID: {item.dataset_id}) -
    -
    -

    - Field: {item.field} -

    -
    -
    -
    -
    {item.match_context}
    -
    -
  • - {/each} - {#if results.count === 0} -
  • - No matches found for the given pattern. -
  • - {/if} -
-
- {/if} -
- - \ No newline at end of file diff --git a/frontend/src/routes/+page.svelte b/frontend/src/routes/+page.svelte index 5023321..9e0b08d 100644 --- a/frontend/src/routes/+page.svelte +++ b/frontend/src/routes/+page.svelte @@ -27,6 +27,12 @@ goto('/migration'); } else if (plugin.id === 'git-integration') { goto('/git'); + } else if (plugin.id === 'superset-backup') { + goto('/tools/backups'); + } else if (plugin.id === 'superset-storage') { + goto('/tools/storage'); + } else if (plugin.id === 'superset-mapper') { + goto('/tools/mapper'); } else { selectedPlugin.set(plugin); } @@ -82,7 +88,7 @@ {/if}
- {#each data.plugins as plugin} + {#each data.plugins.filter(p => p.id !== 'superset-search') as plugin}
selectPlugin(plugin)} role="button" diff --git a/frontend/src/routes/settings/environments/+page.svelte b/frontend/src/routes/settings/environments/+page.svelte deleted file mode 100644 index 55f9171..0000000 --- a/frontend/src/routes/settings/environments/+page.svelte +++ /dev/null @@ -1,40 +0,0 @@ - - -
-

Deployment Environments

- -
-

Target Environments

- {#if environments.length === 0} -

No deployment environments configured.

- {:else} -
    - {#each environments as env} -
  • -
    - {env.name} -
    {env.superset_url}
    -
    - - {env.is_active ? 'Active' : 'Inactive'} - -
  • - {/each} -
- {/if} -
-
\ No newline at end of file diff --git a/frontend/src/routes/tasks/+page.svelte b/frontend/src/routes/tasks/+page.svelte index af1e51f..dad7e00 100644 --- a/frontend/src/routes/tasks/+page.svelte +++ b/frontend/src/routes/tasks/+page.svelte @@ -116,13 +116,7 @@
- -
- -
-
+
diff --git a/frontend/src/routes/tools/backups/+page.svelte b/frontend/src/routes/tools/backups/+page.svelte new file mode 100644 index 0000000..8f335a6 --- /dev/null +++ b/frontend/src/routes/tools/backups/+page.svelte @@ -0,0 +1,27 @@ + + + + + + +
+ + +
+ +
+
+ + + \ No newline at end of file diff --git a/frontend/src/routes/tools/search/+page.svelte b/frontend/src/routes/tools/search/+page.svelte deleted file mode 100644 index 1941cb0..0000000 --- a/frontend/src/routes/tools/search/+page.svelte +++ /dev/null @@ -1,25 +0,0 @@ - - - - -
- - -
-
- -
-
- -
-
-
- \ No newline at end of file diff --git a/frontend/src/types/backup.ts b/frontend/src/types/backup.ts new file mode 100644 index 0000000..e3a2b5e --- /dev/null +++ b/frontend/src/types/backup.ts @@ -0,0 +1,22 @@ +/** + * [DEF:BackupTypes:Module] + * @SEMANTICS: types, backup, interface + * @PURPOSE: Defines types and interfaces for the Backup Management UI. + */ + +export interface Backup { + id: string; + name: string; + environment: string; + created_at: string; + size_bytes?: number; + status: 'success' | 'failed' | 'in_progress'; +} + +export interface BackupCreateRequest { + environment_id: string; +} + +/** + * [/DEF:BackupTypes:Module] + */ \ No newline at end of file diff --git a/specs/015-frontend-nav-redesign/tasks.md b/specs/015-frontend-nav-redesign/tasks.md index 85e3afe..0d6451c 100644 --- a/specs/015-frontend-nav-redesign/tasks.md +++ b/specs/015-frontend-nav-redesign/tasks.md @@ -8,18 +8,18 @@ *Goal: Initialize project structure for the new feature.* -- [ ] T001 Create backup component directory structure +- [x] T001 Create backup component directory structure - Path: `frontend/src/components/backups/` -- [ ] T002 Create backup page route directory +- [x] T002 Create backup page route directory - Path: `frontend/src/routes/tools/backups/` ## Phase 2: Foundational *Goal: Prepare core components for integration and verify backend connectivity.* -- [ ] T003 Verify backend API endpoints for backups (via `009-backup-scheduler`) +- [x] T003 Verify backend API endpoints for backups (via `009-backup-scheduler`) - Path: `backend/src/api/routes/tasks.py` (or relevant backup route) -- [ ] T004 Define Backup types and interfaces in frontend +- [x] T004 Define Backup types and interfaces in frontend - Path: `frontend/src/types/backup.ts` ## Phase 3: User Story 1 - Centralized Tool Access via Dashboard @@ -28,11 +28,11 @@ **User Story**: As a user, I want to access all main tools (Backups, Mapper, Storage) from the main Dashboard so that I have a central hub for operations. (P1) -- [ ] T005 [US1] Update DashboardGrid to include "Backup Manager" card +- [x] T005 [US1] Update DashboardGrid to include "Backup Manager" card - Path: `frontend/src/components/DashboardGrid.svelte` -- [ ] T006 [US1] Update DashboardGrid to ensure "Dataset Mapper" and "Storage Manager" cards are present +- [x] T006 [US1] Update DashboardGrid to ensure "Dataset Mapper" and "Storage Manager" cards are present - Path: `frontend/src/components/DashboardGrid.svelte` -- [ ] T007 [US1] Remove "Dataset Search" card from DashboardGrid +- [x] T007 [US1] Remove "Dataset Search" card from DashboardGrid - Path: `frontend/src/components/DashboardGrid.svelte` ## Phase 4: User Story 2 - Simplified Navigation Bar @@ -41,15 +41,15 @@ **User Story**: As a user, I want a clean Navbar containing only global context items (Tasks, Settings) so that the interface is less cluttered and navigation is distinct from tool usage. (P1) -- [ ] T008 [US2] Remove "Dataset Search" link from Navbar +- [x] T008 [US2] Remove "Dataset Search" link from Navbar - Path: `frontend/src/components/Navbar.svelte` -- [ ] T009 [US2] Remove "Dataset Mapper" link from Navbar +- [x] T009 [US2] Remove "Dataset Mapper" link from Navbar - Path: `frontend/src/components/Navbar.svelte` -- [ ] T010 [US2] Remove "Deployment Environments" link from Navbar +- [x] T010 [US2] Remove "Deployment Environments" link from Navbar - Path: `frontend/src/components/Navbar.svelte` -- [ ] T011 [US2] Verify "Tasks" and "Settings" links remain in Navbar +- [x] T011 [US2] Verify "Tasks" and "Settings" links remain in Navbar - Path: `frontend/src/components/Navbar.svelte` -- [ ] T012 [US2] Remove "Run backup" button from Tasks page +- [x] T012 [US2] Remove "Run backup" button from Tasks page - Path: `frontend/src/routes/tasks/+page.svelte` (or relevant component) ## Phase 5: Backup Management UI @@ -58,15 +58,15 @@ **User Story**: (Implicit P1 from FR-004) System MUST provide access to the full Backup Management component via the Dashboard link. -- [ ] T013 [US1] Create BackupList component to display existing backups (Must use `src/lib/ui` components and `src/lib/i18n`) +- [x] T013 [US1] Create BackupList component to display existing backups (Must use `src/lib/ui` components and `src/lib/i18n`) - Path: `frontend/src/components/backups/BackupList.svelte` -- [ ] T014 [US1] Create BackupManager main component (container) (Must use `src/lib/ui` components and `src/lib/i18n`) +- [x] T014 [US1] Create BackupManager main component (container) (Must use `src/lib/ui` components and `src/lib/i18n`) - Path: `frontend/src/components/backups/BackupManager.svelte` -- [ ] T015 [US1] Implement "Create Backup" functionality in BackupManager (Must use `src/lib/ui` components and `src/lib/i18n`) +- [x] T015 [US1] Implement "Create Backup" functionality in BackupManager (Must use `src/lib/ui` components and `src/lib/i18n`) - Path: `frontend/src/components/backups/BackupManager.svelte` -- [ ] T016 [US1] Implement "Restore Backup" functionality (if supported by backend) (Must use `src/lib/ui` components and `src/lib/i18n`) +- [x] T016 [US1] Implement "Restore Backup" functionality (if supported by backend) (Must use `src/lib/ui` components and `src/lib/i18n`) - Path: `frontend/src/components/backups/BackupManager.svelte` -- [ ] T017 [US1] Create Backup page to host the manager (Must use `src/lib/ui` components and `src/lib/i18n`) +- [x] T017 [US1] Create Backup page to host the manager (Must use `src/lib/ui` components and `src/lib/i18n`) - Path: `frontend/src/routes/tools/backups/+page.svelte` ## Phase 6: User Story 3 - Deprecation @@ -75,26 +75,26 @@ **User Story**: As a user, I want removed features (Dataset Search, Deployment Environments) to be inaccessible so that I don't use deprecated workflows. (P2) -- [ ] T018 [US3] Delete Dataset Search route +- [x] T018 [US3] Delete Dataset Search route - Path: `frontend/src/routes/tools/search/` (delete directory) -- [ ] T019 [US3] Delete Deployment Environments route +- [x] T019 [US3] Delete Deployment Environments route - Path: `frontend/src/routes/settings/environments/` (delete directory) -- [ ] T020 [US3] Delete Dataset Search component (if not used elsewhere) +- [x] T020 [US3] Delete Dataset Search component (if not used elsewhere) - Path: `frontend/src/components/tools/SearchTool.svelte` -- [ ] T021 [US3] Delete EnvSelector component (if not used elsewhere) +- [x] T021 [US3] Delete EnvSelector component (if not used elsewhere) - Path: `frontend/src/components/EnvSelector.svelte` ## Phase 7: Polish & Cross-Cutting *Goal: Final verification and cleanup.* -- [ ] T022 Verify all navigation links work correctly +- [x] T022 Verify all navigation links work correctly - Path: `frontend/src/components/Navbar.svelte` -- [ ] T023 Verify responsive layout of new Dashboard grid +- [x] T023 Verify responsive layout of new Dashboard grid - Path: `frontend/src/components/DashboardGrid.svelte` -- [ ] T024 Ensure i18n strings are extracted for new Backup UI +- [x] T024 Ensure i18n strings are extracted for new Backup UI - Path: `frontend/src/lib/i18n/` (or relevant locale files) -- [ ] T025 Verify "Run backup" action successfully triggers backup job (Manual/E2E check) +- [x] T025 Verify "Run backup" action successfully triggers backup job (Manual/E2E check) - Path: `frontend/src/components/backups/BackupManager.svelte` ## Dependencies