From 32ed83c9af6912efa56181072d604a1bb818ba40 Mon Sep 17 00:00:00 2001 From: busya Date: Fri, 23 Jan 2026 17:53:46 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9C=D1=83=D0=BB=D1=8C=D1=82=D0=B8=D1=8F?= =?UTF-8?q?=D0=B7=D0=BD=D0=BE=D1=87=D0=BD=D0=BE=D1=81=D1=82=D1=8C=20+=20?= =?UTF-8?q?=D0=BF=D1=80=D0=B8=D1=87=D0=B5=D1=81=D1=8B=D0=B2=D0=B0=D0=BD?= =?UTF-8?q?=D0=B8=D0=B5=20css?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/DashboardGrid.svelte | 85 ++++++----- frontend/src/components/Navbar.svelte | 33 +++-- frontend/src/components/TaskList.svelte | 7 +- frontend/src/components/TaskLogViewer.svelte | 32 ++-- .../src/components/git/BranchSelector.svelte | 74 +++++----- .../src/components/git/CommitHistory.svelte | 26 ++-- frontend/src/components/git/GitManager.svelte | 136 ++++++++--------- .../components/tools/ConnectionForm.svelte | 59 +++----- .../components/tools/ConnectionList.svelte | 30 ++-- frontend/src/routes/+page.svelte | 41 ++++-- frontend/src/routes/git/+page.svelte | 27 ++-- frontend/src/routes/migration/+page.svelte | 20 +-- .../routes/migration/mappings/+page.svelte | 12 +- frontend/src/routes/settings/+page.svelte | 109 +++++++------- frontend/src/routes/settings/git/+page.svelte | 138 +++++++++++------- frontend/src/routes/tasks/+page.svelte | 95 ++++++------ frontend/src/routes/tools/debug/+page.svelte | 21 ++- frontend/src/routes/tools/mapper/+page.svelte | 21 ++- frontend/src/routes/tools/search/+page.svelte | 21 ++- .../checklists/requirements.md | 40 ++--- specs/013-unify-frontend-css/tasks.md | 2 + 21 files changed, 527 insertions(+), 502 deletions(-) diff --git a/frontend/src/components/DashboardGrid.svelte b/frontend/src/components/DashboardGrid.svelte index 5560a1ae7..d90649e78 100644 --- a/frontend/src/components/DashboardGrid.svelte +++ b/frontend/src/components/DashboardGrid.svelte @@ -12,6 +12,8 @@ // [SECTION: IMPORTS] import { createEventDispatcher } from 'svelte'; import type { DashboardMetadata } from '../types/dashboard'; + import { t } from '../lib/i18n'; + import { Button, Input } from '../lib/ui'; import GitManager from './git/GitManager.svelte'; // [/SECTION] @@ -143,64 +145,66 @@
-
- +
-
- +
+
- - - - - + - + {#each paginatedDashboards as dashboard (dashboard.id)} - - + - - - + + - {/each} @@ -209,25 +213,30 @@ -
-
- Showing {currentPage * pageSize + 1} to {Math.min((currentPage + 1) * pageSize, sortedDashboards.length)} of {sortedDashboards.length} dashboards +
+
+ {($t.dashboard?.showing || "") + .replace('{start}', (currentPage * pageSize + 1).toString()) + .replace('{end}', Math.min((currentPage + 1) * pageSize, sortedDashboards.length).toString()) + .replace('{total}', sortedDashboards.length.toString())}
-
- - + {$t.dashboard.next} +
diff --git a/frontend/src/components/Navbar.svelte b/frontend/src/components/Navbar.svelte index 471efb310..65887d73b 100644 --- a/frontend/src/components/Navbar.svelte +++ b/frontend/src/components/Navbar.svelte @@ -7,61 +7,64 @@ -->
Superset Tools -
diff --git a/frontend/src/components/TaskList.svelte b/frontend/src/components/TaskList.svelte index bf9a05f22..4b2154f77 100644 --- a/frontend/src/components/TaskList.svelte +++ b/frontend/src/components/TaskList.svelte @@ -9,6 +9,7 @@ -
-
-
- - {#each branches as branch} - - {/each} - - {#if loading} - - - - - - - {/if} + options={branches.map(b => ({ value: b.name, label: b.name }))} + />
- + + {$t.git.new_branch} +
{#if showCreate} -
- - - + {$t.common.cancel} +
{/if}
diff --git a/frontend/src/components/git/CommitHistory.svelte b/frontend/src/components/git/CommitHistory.svelte index fd85cad04..b0d577023 100644 --- a/frontend/src/components/git/CommitHistory.svelte +++ b/frontend/src/components/git/CommitHistory.svelte @@ -11,6 +11,8 @@ import { onMount } from 'svelte'; import { gitService } from '../../services/gitService'; import { addToast as toast } from '../../lib/toasts.js'; + import { t } from '../../lib/i18n'; + import { Button } from '../../lib/ui'; // [/SECTION] // [SECTION: PROPS] @@ -53,22 +55,22 @@ -
-

- Commit History - -

+
+
+

+ {$t.git.history} +

+ +
{#if loading} -
- - - - - Loading history... +
+
{:else if history.length === 0} -

No commits yet.

+

{$t.git.no_commits}

{:else}
{#each history as commit} diff --git a/frontend/src/components/git/GitManager.svelte b/frontend/src/components/git/GitManager.svelte index cd85ab235..4be9a2b54 100644 --- a/frontend/src/components/git/GitManager.svelte +++ b/frontend/src/components/git/GitManager.svelte @@ -16,6 +16,8 @@ import { onMount } from 'svelte'; import { gitService } from '../../services/gitService'; import { addToast as toast } from '../../lib/toasts.js'; + import { t } from '../../lib/i18n'; + import { Button, Card, PageHeader, Select, Input } from '../../lib/ui'; import BranchSelector from './BranchSelector.svelte'; import CommitModal from './CommitModal.svelte'; import CommitHistory from './CommitHistory.svelte'; @@ -143,17 +145,16 @@ {#if show}
-
-
-

Git Management: {dashboardTitle}

-

ID: {dashboardId}

+ +
ID: {dashboardId}
+
+
- -
+ {#if checkingStatus}
@@ -161,95 +162,94 @@
{:else if !initialized}
-
-

- This dashboard is not yet linked to a Git repository. - Please configure the repository details below. + +

+ {$t.git.not_linked}

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

No Git servers configured. Go to Settings -> Git to add one.

- {/if} -
-
- - + + +
- -
+
{:else}
-

Branch

+

{$t.git.branch}

-
-

Actions

- - -
- - + {$t.git.push} +
-

Deployment

- + {$t.git.deploy} +
diff --git a/frontend/src/components/tools/ConnectionForm.svelte b/frontend/src/components/tools/ConnectionForm.svelte index 80befdd14..d7e92379f 100644 --- a/frontend/src/components/tools/ConnectionForm.svelte +++ b/frontend/src/components/tools/ConnectionForm.svelte @@ -10,6 +10,8 @@ import { createEventDispatcher } from 'svelte'; import { createConnection } from '../../services/connectionService.js'; import { addToast } from '../../lib/toasts.js'; + import { t } from '../../lib/i18n'; + import { Button, Input, Card } from '../../lib/ui'; // [/SECTION] const dispatch = createEventDispatcher(); @@ -17,7 +19,7 @@ let name = ''; let type = 'postgres'; let host = ''; - let port = 5432; + let port = "5432"; let database = ''; let username = ''; let password = ''; @@ -36,7 +38,7 @@ isSubmitting = true; try { const newConnection = await createConnection({ - name, type, host, port, database, username, password + name, type, host, port: Number(port), database, username, password }); addToast('Connection created successfully', 'success'); dispatch('success', newConnection); @@ -57,7 +59,7 @@ function resetForm() { name = ''; host = ''; - port = 5432; + port = "5432"; database = ''; username = ''; password = ''; @@ -66,43 +68,28 @@ -
-

Add New Connection

-
-
- - + + + + +
+ +
-
-
- - -
-
- - -
-
-
- - -
-
-
- - -
-
- - -
+ + + +
+ +
+
- +
-
+
\ No newline at end of file diff --git a/frontend/src/components/tools/ConnectionList.svelte b/frontend/src/components/tools/ConnectionList.svelte index 6e026245d..5e3b7f8d7 100644 --- a/frontend/src/components/tools/ConnectionList.svelte +++ b/frontend/src/components/tools/ConnectionList.svelte @@ -10,6 +10,8 @@ import { onMount, createEventDispatcher } from 'svelte'; import { getConnections, deleteConnection } from '../../services/connectionService.js'; import { addToast } from '../../lib/toasts.js'; + import { t } from '../../lib/i18n'; + import { Button, Card } from '../../lib/ui'; // [/SECTION] const dispatch = createEventDispatcher(); @@ -57,32 +59,30 @@ -
-
-

Saved Connections

-
-
    + +
      {#if isLoading} -
    • Loading...
    • +
    • {$t.common.loading}
    • {:else if connections.length === 0} -
    • No connections saved yet.
    • +
    • {$t.connections?.no_saved || "No connections saved yet."}
    • {:else} {#each connections as conn} -
    • +
    • -
      {conn.name}
      -
      {conn.type}://{conn.username}@{conn.host}:{conn.port}/{conn.database}
      +
      {conn.name}
      +
      {conn.type}://{conn.username}@{conn.host}:{conn.port}/{conn.database}
      - + {$t.connections?.delete || "Delete"} +
    • {/each} {/if}
    -
+ \ No newline at end of file diff --git a/frontend/src/routes/+page.svelte b/frontend/src/routes/+page.svelte index 7eebee68c..50233219f 100644 --- a/frontend/src/routes/+page.svelte +++ b/frontend/src/routes/+page.svelte @@ -5,6 +5,8 @@ import { api } from '../lib/api.js'; import { get } from 'svelte/store'; import { goto } from '$app/navigation'; + import { t } from '$lib/i18n'; + import { Button, Card, PageHeader } from '$lib/ui'; /** @type {import('./$types').PageData} */ export let data; @@ -55,34 +57,43 @@
{#if $selectedTask} - +
+ +
{:else if $selectedPlugin} -

{$selectedPlugin.name}

- - + + + + +
+ +
{:else} -

Available Tools

+ + {#if data.error}
{data.error}
{/if} -
+ +
{#each data.plugins as plugin} -
selectPlugin(plugin)} role="button" tabindex="0" on:keydown={(e) => e.key === 'Enter' && selectPlugin(plugin)} + class="cursor-pointer transition-transform hover:scale-[1.02]" > -

{plugin.name}

-

{plugin.description}

- v{plugin.version} + +

{plugin.description}

+ v{plugin.version} +
{/each}
diff --git a/frontend/src/routes/git/+page.svelte b/frontend/src/routes/git/+page.svelte index f8ac563e9..08071c2d4 100644 --- a/frontend/src/routes/git/+page.svelte +++ b/frontend/src/routes/git/+page.svelte @@ -4,6 +4,8 @@ import DashboardGrid from '../../components/DashboardGrid.svelte'; import { addToast as toast } from '../../lib/toasts.js'; import type { DashboardMetadata } from '../../types/dashboard'; + import { t } from '$lib/i18n'; + import { Button, Card, PageHeader, Select } from '$lib/ui'; let environments: any[] = []; let selectedEnvId = ""; @@ -50,29 +52,22 @@
-
-

Git Dashboard Management

-
- - - {#each environments as env} - - {/each} - + options={environments.map(e => ({ value: e.id, label: e.name }))} + />
-
+ {#if loading}
{:else} -
-

Select Dashboard to Manage

+ {#if fetchingDashboards}

Loading dashboards...

{:else if dashboards.length > 0} @@ -80,7 +75,7 @@ {:else}

No dashboards found in this environment.

{/if} -
+ {/if}
\ No newline at end of file diff --git a/frontend/src/routes/migration/+page.svelte b/frontend/src/routes/migration/+page.svelte index 0b48acbff..762d19df0 100644 --- a/frontend/src/routes/migration/+page.svelte +++ b/frontend/src/routes/migration/+page.svelte @@ -21,6 +21,8 @@ import { selectedTask } from '../../lib/stores.js'; import { resumeTask } from '../../services/taskService.js'; import type { DashboardMetadata, DashboardSelection } from '../../types/dashboard'; + import { t } from '$lib/i18n'; + import { Button, Card, PageHeader } from '$lib/ui'; // [/SECTION] // [SECTION: STATE] @@ -294,19 +296,18 @@
-

Migration Dashboard

+ {#if $selectedTask}
- +
+ +
{:else} {#if loading} @@ -383,13 +384,12 @@
{/if} - + {/if}
diff --git a/frontend/src/routes/migration/mappings/+page.svelte b/frontend/src/routes/migration/mappings/+page.svelte index e10635133..a434fdbb6 100644 --- a/frontend/src/routes/migration/mappings/+page.svelte +++ b/frontend/src/routes/migration/mappings/+page.svelte @@ -14,6 +14,8 @@ import { onMount } from 'svelte'; import EnvSelector from '../../../components/EnvSelector.svelte'; import MappingTable from '../../../components/MappingTable.svelte'; + import { t } from '$lib/i18n'; + import { Button, PageHeader } from '$lib/ui'; // [/SECTION] // [SECTION: STATE] @@ -128,7 +130,7 @@
-

Database Mapping Management

+ {#if loading}

Loading environments...

@@ -149,13 +151,13 @@
- + Fetch Databases & Suggestions +
{#if error} diff --git a/frontend/src/routes/settings/+page.svelte b/frontend/src/routes/settings/+page.svelte index 79f2da938..2e2be53b8 100644 --- a/frontend/src/routes/settings/+page.svelte +++ b/frontend/src/routes/settings/+page.svelte @@ -2,6 +2,8 @@ import { onMount } from 'svelte'; import { updateGlobalSettings, addEnvironment, updateEnvironment, deleteEnvironment, testEnvironmentConnection } from '../../lib/api'; import { addToast } from '../../lib/toasts'; + import { t } from '$lib/i18n'; + import { Button, Input, Card, PageHeader } from '$lib/ui'; /** @type {import('./$types').PageData} */ export let data; @@ -142,7 +144,7 @@
-

Settings

+ {#if data.error}
@@ -150,38 +152,39 @@
{/if} -
-

Global Settings

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

Warning

+

{$t.settings?.env_warning || "No Superset environments configured."}

-
- -
-

Superset Environments

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

Warning

-

No Superset environments configured. You must add at least one environment to perform backups or migrations.

-
- {/if} + {/if}
+ handleSelectAll((e.target as HTMLInputElement).checked)} + class="h-4 w-4 text-blue-600 border-gray-300 rounded focus:ring-blue-500" /> handleSort('title')}> - Title {sortColumn === 'title' ? (sortDirection === 'asc' ? '↑' : '↓') : ''} + handleSort('title')}> + {$t.dashboard.title} {sortColumn === 'title' ? (sortDirection === 'asc' ? '↑' : '↓') : ''} handleSort('last_modified')}> - Last Modified {sortColumn === 'last_modified' ? (sortDirection === 'asc' ? '↑' : '↓') : ''} + handleSort('last_modified')}> + {$t.dashboard.last_modified} {sortColumn === 'last_modified' ? (sortDirection === 'asc' ? '↑' : '↓') : ''} handleSort('status')}> - Status {sortColumn === 'status' ? (sortDirection === 'asc' ? '↑' : '↓') : ''} + handleSort('status')}> + {$t.dashboard.status} {sortColumn === 'status' ? (sortDirection === 'asc' ? '↑' : '↓') : ''} Git{$t.dashboard.git}
+
handleSelectionChange(dashboard.id, (e.target as HTMLInputElement).checked)} + class="h-4 w-4 text-blue-600 border-gray-300 rounded focus:ring-blue-500" /> {dashboard.title}{new Date(dashboard.last_modified).toLocaleDateString()} + {dashboard.title}{new Date(dashboard.last_modified).toLocaleDateString()} {dashboard.status} - + {$t.git.manage} +
- + - + - + @@ -192,9 +195,9 @@ {/each} @@ -202,44 +205,30 @@
Name{$t.connections?.name || "Name"} URLUsername{$t.connections?.user || "Username"} DefaultActions{$t.git?.actions || "Actions"}
{env.username} {env.is_default ? 'Yes' : 'No'} - - - + + +
-
-

{editingEnvId ? 'Edit' : 'Add'} Environment

-
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - +
+

{editingEnvId ? ($t.settings?.env_edit || "Edit Environment") : ($t.settings?.env_add || "Add Environment")}

+
+ + + + + +
+ +
-
- +
+ {#if editingEnvId} - + {/if}
+
diff --git a/frontend/src/routes/settings/git/+page.svelte b/frontend/src/routes/settings/git/+page.svelte index 5371eadf5..aa604d40d 100644 --- a/frontend/src/routes/settings/git/+page.svelte +++ b/frontend/src/routes/settings/git/+page.svelte @@ -1,8 +1,24 @@ - -
-

Git Integration Settings

+ +
+
-
-

Configured Servers

+ {#if configs.length === 0}

No Git servers configured.

{:else} -
    +
      {#each configs as config} -
    • +
    • - {config.name} - ({config.provider}) -
      {config.url}
      +
      + {config.name} + {config.provider} +
      +
      {config.url}
      - + {config.status} -
    {/if} -
+ -
-

Add Git Server

-
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - + +
-
+
-
\ No newline at end of file +
+ + + + + \ No newline at end of file diff --git a/frontend/src/routes/tasks/+page.svelte b/frontend/src/routes/tasks/+page.svelte index 8bf7de261..af1e51f43 100644 --- a/frontend/src/routes/tasks/+page.svelte +++ b/frontend/src/routes/tasks/+page.svelte @@ -12,6 +12,8 @@ import { addToast } from '../../lib/toasts'; import TaskList from '../../components/TaskList.svelte'; import TaskLogViewer from '../../components/TaskLogViewer.svelte'; + import { t } from '$lib/i18n'; + import { Button, Card, PageHeader, Select } from '$lib/ui'; let tasks = []; let environments = []; @@ -114,35 +116,35 @@
-
-

Task Management

- -
+ +
+ +
+
-

Recent Tasks

+

{$t.tasks.recent}

-

Task Details & Logs

+

{$t.tasks.details_logs}

{#if selectedTaskId} -
- t.id === selectedTaskId)?.status} - inline={true} - /> -
+ +
+ t.id === selectedTaskId)?.status} + inline={true} + /> +
+
{:else} -
-

Select a task to view logs and details

+
+

{$t.tasks.select_task}

{/if}
@@ -150,36 +152,29 @@
{#if showBackupModal} -
-
-

Run Manual Backup

-
- - -
-
- - -
+
+
+ +
+