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

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

@@ -10,10 +10,9 @@ None (Top-level page component)
- `on:backup-restore`: Triggered when user requests a restore.
### Data Dependencies
- `GET /api/backups`: Fetch list of backups.
- Response: `Array<BackupConfiguration>`
- `POST /api/backups`: Create new backup.
- Body: `{ type: string, target: string }`
- `POST /api/backups/{id}/restore`: Restore a backup.
*(Note: Actual endpoints depend on Feature 009 implementation; these are the frontend's expected contracts)*
- `GET /api/environments`: Fetch list of available environments.
- `GET /api/storage/files?category=backups`: Fetch list of backup files.
- `POST /api/tasks`: Create new backup task.
- Body: `{ plugin_id: 'superset-backup', params: { environment_id: string } }`
- `PUT /api/environments/{id}/schedule`: Update backup schedule.
- Body: `{ enabled: boolean, cron_expression: string }`

View File

@@ -0,0 +1,47 @@
# Data Model: Frontend Navigation Redesign
## Plugin Configuration
The `PluginConfig` model is extended to support backend-driven navigation.
```python
class PluginConfig(BaseModel):
"""Pydantic model for plugin configuration."""
id: str = Field(..., description="Unique identifier for the plugin")
name: str = Field(..., description="Human-readable name for the plugin")
description: str = Field(..., description="Brief description of what the plugin does")
version: str = Field(..., description="Version of the plugin")
ui_route: Optional[str] = Field(None, description="Frontend route for the plugin UI")
input_schema: Dict[str, Any] = Field(..., description="JSON schema for input parameters", alias="schema")
```
### ui_route
- **Type**: `Optional[str]`
- **Description**: Specifies the client-side route (URL path) where the plugin's custom UI is hosted.
- **Behavior**:
- If `None` (default): The dashboard will open the plugin using the generic `DynamicForm` modal.
- If set (e.g., `"/tools/mapper"`): The dashboard will navigate (`goto`) to this route when the plugin card is clicked.
## Backup Management (New)
### Backup Types
```typescript
// frontend/src/types/backup.ts
export interface BackupFile {
name: string; // e.g., "prod-dashboard-export-2024.zip"
path: string; // Relative path in storage
size: number; // Bytes
created_at: string; // ISO Date
category: 'backups'; // Fixed category
mime_type?: string;
}
export interface BackupState {
isLoading: boolean;
files: BackupFile[];
error: string | null;
selectedBackup: BackupFile | null;
}

View File

@@ -9,6 +9,8 @@
This feature redesigns the frontend navigation to shift from a Navbar-heavy approach to a Dashboard-centric model. Key changes include moving tool access (Mapper, Storage, Backups) to the Dashboard, simplifying the Navbar to global contexts (Tasks, Settings), removing deprecated features (Dataset Search, Environments), and implementing a dedicated Backup Management UI based on backend capabilities from feature 009.
Additionally, the navigation architecture is refactored to be backend-driven. Plugins now expose a `ui_route` property, allowing the frontend to dynamically determine the correct navigation path without hardcoded mapping.
## Technical Context
**Language/Version**: Python 3.9+ (Backend), Node.js 18+ (Frontend)
@@ -51,6 +53,10 @@ specs/015-frontend-nav-redesign/
```text
backend/
├── src/
│ ├── core/
│ │ ├── plugin_base.py # (Modify: Add ui_route property)
│ │ └── plugin_loader.py # (Modify: Populate ui_route in PluginConfig)
│ ├── plugins/ # (Modify: Implement ui_route in all plugins)
│ └── api/routes/ # (Verify backup routes exist)
frontend/
@@ -65,6 +71,7 @@ frontend/
│ │ └── Dashboard.svelte # (Modify: Layout updates)
│ └── routes/
│ ├── +layout.svelte # (Check global nav injection)
│ ├── +page.svelte # (Modify: Use plugin.ui_route for navigation)
│ └── tools/
│ └── backups/ # (New Route)
│ └── +page.svelte

View File

@@ -80,6 +80,8 @@ As a user, I want removed features (Dataset Search, Deployment Environments) to
- **FR-006**: Dashboard MUST NOT contain "Dataset Search" widget or link.
- **FR-007**: Tasks page MUST NOT show the "Run backup" button (backup initiation moves to Backup tool).
- **FR-008**: Navbar MUST retain "Tasks" and "Settings" links.
- **FR-009**: Backup Manager MUST support configuring automated backup schedules (enabled/disabled, cron expression) per environment.
- **FR-010**: Backup List MUST provide a "Go to Storage" action that navigates to the Storage Manager with the correct path selected.
### Key Entities

View File

@@ -68,6 +68,10 @@
- Path: `frontend/src/components/backups/BackupManager.svelte`
- [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`
- [x] T017b [US1] Implement Backup Schedule configuration in BackupManager
- Path: `frontend/src/components/backups/BackupManager.svelte`
- [x] T017c [US1] Implement "Go to Storage" navigation in BackupList
- Path: `frontend/src/components/backups/BackupList.svelte`
## Phase 6: User Story 3 - Deprecation