@svadmin/ui 0.121.0 → 0.125.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app.css +757 -7
- package/dist/app.theme.css +757 -7
- package/dist/components/AbacPolicyMatrix.svelte +356 -0
- package/dist/components/AbacPolicyMatrix.svelte.d.ts +30 -0
- package/dist/components/AboutSettings.svelte +1 -1
- package/dist/components/ActionPalette.svelte +272 -0
- package/dist/components/ActionPalette.svelte.d.ts +23 -0
- package/dist/components/AdminCopilotWidget.svelte +316 -0
- package/dist/components/AdminCopilotWidget.svelte.d.ts +33 -0
- package/dist/components/AnnouncementBanner.svelte +325 -0
- package/dist/components/AnnouncementBanner.svelte.d.ts +49 -0
- package/dist/components/ApiPlayground.svelte +255 -0
- package/dist/components/ApiPlayground.svelte.d.ts +24 -0
- package/dist/components/ApprovalChainBuilder.svelte +262 -0
- package/dist/components/ApprovalChainBuilder.svelte.d.ts +20 -0
- package/dist/components/ApprovalTimeline.svelte +8 -1
- package/dist/components/AsyncExportModal.svelte +551 -0
- package/dist/components/AsyncExportModal.svelte.d.ts +50 -0
- package/dist/components/AudioFeedbackProvider.svelte +131 -0
- package/dist/components/AudioFeedbackProvider.svelte.d.ts +11 -0
- package/dist/components/AuditLogViewer.svelte +1 -1
- package/dist/components/AuditTrailInspector.svelte +448 -0
- package/dist/components/AuditTrailInspector.svelte.d.ts +44 -0
- package/dist/components/BatchEditModal.svelte +266 -0
- package/dist/components/BatchEditModal.svelte.d.ts +27 -0
- package/dist/components/BillingInvoiceDrawer.svelte +206 -0
- package/dist/components/BillingInvoiceDrawer.svelte.d.ts +30 -0
- package/dist/components/CanvasAnnotation.svelte +1 -1
- package/dist/components/ChartAnnotationOverlay.svelte +228 -0
- package/dist/components/ChartAnnotationOverlay.svelte.d.ts +21 -0
- package/dist/components/ClusterTopologyGraph.svelte +317 -0
- package/dist/components/ClusterTopologyGraph.svelte.d.ts +31 -0
- package/dist/components/ColumnFilterBuilder.svelte +135 -0
- package/dist/components/ColumnFilterBuilder.svelte.d.ts +20 -0
- package/dist/components/ColumnMappingTable.svelte +174 -0
- package/dist/components/ColumnMappingTable.svelte.d.ts +23 -0
- package/dist/components/ColumnSettings.svelte +1 -1
- package/dist/components/ColumnVisibilityDrawer.svelte +541 -0
- package/dist/components/ColumnVisibilityDrawer.svelte.d.ts +16 -0
- package/dist/components/ConcurrentConflictModal.svelte +7 -7
- package/dist/components/ConversionFunnel.svelte +154 -0
- package/dist/components/ConversionFunnel.svelte.d.ts +22 -0
- package/dist/components/CronExpressionBuilder.svelte +1 -1
- package/dist/components/CursorListFooter.svelte +67 -0
- package/dist/components/CursorListFooter.svelte.d.ts +17 -0
- package/dist/components/DashboardGridLayout.svelte +309 -0
- package/dist/components/DashboardGridLayout.svelte.d.ts +30 -0
- package/dist/components/DashboardLayoutStorage.svelte +278 -0
- package/dist/components/DashboardLayoutStorage.svelte.d.ts +23 -0
- package/dist/components/DataFreshnessIndicator.svelte +149 -0
- package/dist/components/DataFreshnessIndicator.svelte.d.ts +20 -0
- package/dist/components/DataImportDropzone.svelte +215 -0
- package/dist/components/DataImportDropzone.svelte.d.ts +24 -0
- package/dist/components/DataLineageGraph.svelte +203 -0
- package/dist/components/DataLineageGraph.svelte.d.ts +26 -0
- package/dist/components/DataMaskPolicyEngine.svelte +291 -0
- package/dist/components/DataMaskPolicyEngine.svelte.d.ts +25 -0
- package/dist/components/DataScopeRuleEditor.svelte +142 -0
- package/dist/components/DataScopeRuleEditor.svelte.d.ts +19 -0
- package/dist/components/DataScreenContainer.svelte +160 -0
- package/dist/components/DataScreenContainer.svelte.d.ts +15 -0
- package/dist/components/DecisionTable.svelte +1 -1
- package/dist/components/DevTools.svelte +4 -4
- package/dist/components/DraggableRowTable.svelte +1 -1
- package/dist/components/DualApprovalGate.svelte +485 -0
- package/dist/components/DualApprovalGate.svelte.d.ts +58 -0
- package/dist/components/EditableTable.svelte +1 -1
- package/dist/components/ElectronicSealStamp.svelte +102 -0
- package/dist/components/ElectronicSealStamp.svelte.d.ts +14 -0
- package/dist/components/EnvVariableEditor.svelte +284 -0
- package/dist/components/EnvVariableEditor.svelte.d.ts +17 -0
- package/dist/components/ExcelImportWizard.svelte +2 -2
- package/dist/components/FeatureAnnouncementModal.svelte +173 -0
- package/dist/components/FeatureAnnouncementModal.svelte.d.ts +21 -0
- package/dist/components/FilterTagBar.svelte +210 -0
- package/dist/components/FilterTagBar.svelte.d.ts +23 -0
- package/dist/components/FormulaField.svelte +149 -0
- package/dist/components/FormulaField.svelte.d.ts +18 -0
- package/dist/components/GeoScatterMap.svelte +225 -0
- package/dist/components/GeoScatterMap.svelte.d.ts +22 -0
- package/dist/components/GlobalShortcuts.svelte +1 -1
- package/dist/components/HmacSignatureCalculator.svelte +199 -0
- package/dist/components/HmacSignatureCalculator.svelte.d.ts +10 -0
- package/dist/components/I18nLanguagePackEditor.svelte +208 -0
- package/dist/components/I18nLanguagePackEditor.svelte.d.ts +17 -0
- package/dist/components/ImageCropper.svelte +1 -1
- package/dist/components/ImportPreviewValidator.svelte +239 -0
- package/dist/components/ImportPreviewValidator.svelte.d.ts +26 -0
- package/dist/components/ImportWizard.svelte +1 -1
- package/dist/components/IncidentWarRoomDrawer.svelte +194 -0
- package/dist/components/IncidentWarRoomDrawer.svelte.d.ts +24 -0
- package/dist/components/JsonSchemaForm.svelte +5 -5
- package/dist/components/JsonViewer.svelte +11 -11
- package/dist/components/KeyboardShortcutsModal.svelte +362 -0
- package/dist/components/KeyboardShortcutsModal.svelte.d.ts +22 -0
- package/dist/components/KpiCard.svelte +5 -5
- package/dist/components/ListPagination.svelte +39 -3
- package/dist/components/LiveStreamLogViewer.svelte +185 -0
- package/dist/components/LiveStreamLogViewer.svelte.d.ts +21 -0
- package/dist/components/MasterDetailView.svelte +1 -1
- package/dist/components/MasterSubTableDrawer.svelte +223 -0
- package/dist/components/MasterSubTableDrawer.svelte.d.ts +25 -0
- package/dist/components/MetricGrid.svelte +2 -2
- package/dist/components/MicroAppBridge.svelte +59 -0
- package/dist/components/MicroAppBridge.svelte.d.ts +11 -0
- package/dist/components/MockDataInterceptor.svelte +292 -0
- package/dist/components/MockDataInterceptor.svelte.d.ts +27 -0
- package/dist/components/OfflineSyncBanner.svelte +1 -1
- package/dist/components/OmnibarCommandPalette.svelte +320 -0
- package/dist/components/OmnibarCommandPalette.svelte.d.ts +27 -0
- package/dist/components/OrgChart.svelte +1 -1
- package/dist/components/OrgTreePicker.svelte +1 -1
- package/dist/components/OtpInput.svelte +5 -5
- package/dist/components/PageSkeleton.svelte +19 -5
- package/dist/components/PageSkeleton.svelte.d.ts +5 -3
- package/dist/components/PdfDocumentViewer.svelte +2 -2
- package/dist/components/PeriodComparisonCard.svelte +142 -0
- package/dist/components/PeriodComparisonCard.svelte.d.ts +16 -0
- package/dist/components/PermissionSimulator.svelte +319 -0
- package/dist/components/PermissionSimulator.svelte.d.ts +34 -0
- package/dist/components/PivotDrilldownModal.svelte +6 -6
- package/dist/components/PivotMatrix.svelte +271 -0
- package/dist/components/PivotMatrix.svelte.d.ts +32 -0
- package/dist/components/PivotTable.svelte +1 -1
- package/dist/components/PlanUsageQuotaBar.svelte +154 -0
- package/dist/components/PlanUsageQuotaBar.svelte.d.ts +26 -0
- package/dist/components/Popconfirm.svelte +20 -8
- package/dist/components/Popconfirm.svelte.d.ts +3 -1
- package/dist/components/PricingCard.svelte +1 -1
- package/dist/components/PricingTable.svelte +1 -1
- package/dist/components/PrintableBill.svelte +2 -2
- package/dist/components/PrintableReportLayout.svelte +259 -0
- package/dist/components/PrintableReportLayout.svelte.d.ts +32 -0
- package/dist/components/ProSkeleton.svelte +10 -6
- package/dist/components/ProSkeleton.svelte.d.ts +2 -0
- package/dist/components/QueryAiExplainer.svelte +148 -0
- package/dist/components/QueryAiExplainer.svelte.d.ts +16 -0
- package/dist/components/QueryBuilder.svelte +456 -0
- package/dist/components/QueryBuilder.svelte.d.ts +33 -0
- package/dist/components/ResultPage.svelte +2 -2
- package/dist/components/RolePermissionComparator.svelte +273 -0
- package/dist/components/RolePermissionComparator.svelte.d.ts +28 -0
- package/dist/components/RuleExpressionBuilder.svelte +380 -0
- package/dist/components/RuleExpressionBuilder.svelte.d.ts +31 -0
- package/dist/components/SafeDeleteConfirm.svelte +5 -5
- package/dist/components/SankeyChart.svelte +111 -0
- package/dist/components/SankeyChart.svelte.d.ts +22 -0
- package/dist/components/ScheduledJobManager.svelte +225 -0
- package/dist/components/ScheduledJobManager.svelte.d.ts +23 -0
- package/dist/components/SchemaVisualModeler.svelte +336 -0
- package/dist/components/SchemaVisualModeler.svelte.d.ts +17 -0
- package/dist/components/ScreenAntiLeakGuard.svelte +88 -0
- package/dist/components/ScreenAntiLeakGuard.svelte.d.ts +12 -0
- package/dist/components/SecureDataExporter.svelte +296 -0
- package/dist/components/SecureDataExporter.svelte.d.ts +29 -0
- package/dist/components/SensitiveDataMask.svelte +81 -22
- package/dist/components/SensitiveDataMask.svelte.d.ts +15 -10
- package/dist/components/ServerStatusGrid.svelte +179 -0
- package/dist/components/ServerStatusGrid.svelte.d.ts +21 -0
- package/dist/components/SessionTimeoutGuard.svelte +154 -0
- package/dist/components/SessionTimeoutGuard.svelte.d.ts +25 -0
- package/dist/components/SignaturePad.svelte +1 -1
- package/dist/components/SliderCaptcha.svelte +1 -1
- package/dist/components/SnapshotTimelineReplay.svelte +219 -0
- package/dist/components/SnapshotTimelineReplay.svelte.d.ts +19 -0
- package/dist/components/SplitPaneLayout.svelte +1 -1
- package/dist/components/SpreadsheetView.svelte +1 -1
- package/dist/components/SqlConsole.svelte +247 -0
- package/dist/components/SqlConsole.svelte.d.ts +20 -0
- package/dist/components/StepForm.svelte +1 -1
- package/dist/components/StepWizard.svelte +513 -0
- package/dist/components/StepWizard.svelte.d.ts +49 -0
- package/dist/components/SystemCapacityForecastCard.svelte +132 -0
- package/dist/components/SystemCapacityForecastCard.svelte.d.ts +19 -0
- package/dist/components/SystemHealthCheckDashboard.svelte +306 -0
- package/dist/components/SystemHealthCheckDashboard.svelte.d.ts +24 -0
- package/dist/components/TableAggregationFooter.svelte +173 -0
- package/dist/components/TableAggregationFooter.svelte.d.ts +22 -0
- package/dist/components/TableClipboardManager.svelte +307 -0
- package/dist/components/TableClipboardManager.svelte.d.ts +13 -0
- package/dist/components/TaskCenter.svelte +46 -38
- package/dist/components/TenantContextSwitcher.svelte +314 -0
- package/dist/components/TenantContextSwitcher.svelte.d.ts +35 -0
- package/dist/components/TenantQuotasMatrix.svelte +229 -0
- package/dist/components/TenantQuotasMatrix.svelte.d.ts +22 -0
- package/dist/components/TextDiffViewer.svelte +613 -0
- package/dist/components/TextDiffViewer.svelte.d.ts +39 -0
- package/dist/components/ThreadedCommentDrawer.svelte +246 -0
- package/dist/components/ThreadedCommentDrawer.svelte.d.ts +26 -0
- package/dist/components/TierFeatureComparison.svelte +147 -0
- package/dist/components/TierFeatureComparison.svelte.d.ts +28 -0
- package/dist/components/TreeTransfer.svelte +1 -1
- package/dist/components/TreeTransferSelect.svelte +333 -0
- package/dist/components/TreeTransferSelect.svelte.d.ts +18 -0
- package/dist/components/UnsavedChangesGuard.svelte +5 -5
- package/dist/components/UsageCard.svelte +1 -1
- package/dist/components/VersionDiffViewer.svelte +1 -1
- package/dist/components/VirtualCardGrid.svelte +180 -0
- package/dist/components/VirtualCardGrid.svelte.d.ts +65 -0
- package/dist/components/VirtualTable.svelte +1 -1
- package/dist/components/VirtualTreeSelect.svelte +1 -1
- package/dist/components/WebhookSimulator.svelte +263 -0
- package/dist/components/WebhookSimulator.svelte.d.ts +26 -0
- package/dist/components/WidgetContainer.svelte +204 -0
- package/dist/components/WidgetContainer.svelte.d.ts +31 -0
- package/dist/components/WorkflowDesigner.svelte +3 -3
- package/dist/components/WorkflowExecutionTracker.svelte +131 -0
- package/dist/components/WorkflowExecutionTracker.svelte.d.ts +19 -0
- package/dist/components/WorkflowGraphDesigner.svelte +202 -0
- package/dist/components/WorkflowGraphDesigner.svelte.d.ts +24 -0
- package/dist/components/WorkflowNodeInspector.svelte +217 -0
- package/dist/components/WorkflowNodeInspector.svelte.d.ts +24 -0
- package/dist/components/WorkflowProcessCard.svelte +1 -1
- package/dist/components/WorkflowStepper.svelte +250 -0
- package/dist/components/WorkflowStepper.svelte.d.ts +27 -0
- package/dist/components/charts/GaugeChart.svelte +1 -1
- package/dist/components/list-i18n.d.ts +7 -0
- package/dist/components/list-i18n.js +14 -0
- package/dist/components/ui/button/button.svelte +3 -1
- package/dist/components/ui/button/button.svelte.d.ts +1 -0
- package/dist/components/ui/tooltip/tooltip-content.svelte +1 -1
- package/dist/components/useAudioAlert.d.svelte.ts +1 -0
- package/dist/components/useAudioAlert.svelte.d.ts +13 -0
- package/dist/components/useAudioAlert.svelte.js +90 -0
- package/dist/components/useDynamicLocale.d.svelte.ts +1 -0
- package/dist/components/useDynamicLocale.svelte.d.ts +10 -0
- package/dist/components/useDynamicLocale.svelte.js +40 -0
- package/dist/components/useFormulaEngine.d.svelte.ts +1 -0
- package/dist/components/useFormulaEngine.svelte.d.ts +9 -0
- package/dist/components/useFormulaEngine.svelte.js +209 -0
- package/dist/components/useHotkeys.d.svelte.ts +1 -0
- package/dist/components/useHotkeys.svelte.d.ts +44 -0
- package/dist/components/useHotkeys.svelte.js +190 -0
- package/dist/components/useMicroAppEvent.d.svelte.ts +1 -0
- package/dist/components/useMicroAppEvent.svelte.d.ts +16 -0
- package/dist/components/useMicroAppEvent.svelte.js +61 -0
- package/dist/components/usePrintExport.d.svelte.ts +1 -0
- package/dist/components/usePrintExport.svelte.d.ts +11 -0
- package/dist/components/usePrintExport.svelte.js +45 -0
- package/dist/components/useSessionTimeout.d.svelte.ts +1 -0
- package/dist/components/useSessionTimeout.svelte.d.ts +28 -0
- package/dist/components/useSessionTimeout.svelte.js +182 -0
- package/dist/components/useStorageCache.d.svelte.ts +1 -0
- package/dist/components/useStorageCache.svelte.d.ts +49 -0
- package/dist/components/useStorageCache.svelte.js +229 -0
- package/dist/components/useTableClipboard.d.svelte.ts +1 -0
- package/dist/components/useTableClipboard.svelte.d.ts +28 -0
- package/dist/components/useTableClipboard.svelte.js +116 -0
- package/dist/components.css +1 -1
- package/dist/index.d.ts +96 -11
- package/dist/index.js +146 -1
- package/package.json +4 -4
|
@@ -0,0 +1,307 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
import {
|
|
4
|
+
ClipboardCopy,
|
|
5
|
+
ClipboardPaste,
|
|
6
|
+
Check,
|
|
7
|
+
X,
|
|
8
|
+
FileSpreadsheet,
|
|
9
|
+
ArrowRight,
|
|
10
|
+
Undo2,
|
|
11
|
+
} from '@lucide/svelte';
|
|
12
|
+
import { useTranslation } from '@svadmin/core/i18n';
|
|
13
|
+
import { cn } from '../utils.js';
|
|
14
|
+
import { Button } from './ui/button/index.js';
|
|
15
|
+
import {
|
|
16
|
+
type ColumnDef,
|
|
17
|
+
type ColumnMapping,
|
|
18
|
+
type ParsedClipboardTable,
|
|
19
|
+
parseClipboardText,
|
|
20
|
+
matchColumnsToDefinitions,
|
|
21
|
+
copyRowsToClipboard,
|
|
22
|
+
} from './useTableClipboard.svelte.js';
|
|
23
|
+
|
|
24
|
+
export interface TableClipboardManagerProps {
|
|
25
|
+
columns: ColumnDef[];
|
|
26
|
+
selectedRows?: Record<string, unknown>[] | undefined;
|
|
27
|
+
class?: string | undefined;
|
|
28
|
+
onPasteConfirmed?: ((rows: Record<string, unknown>[], mode: 'append' | 'overwrite') => void) | undefined;
|
|
29
|
+
onUndo?: (() => void) | undefined;
|
|
30
|
+
children?: Snippet | undefined;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
let {
|
|
34
|
+
columns,
|
|
35
|
+
selectedRows = [],
|
|
36
|
+
class: className = '',
|
|
37
|
+
onPasteConfirmed,
|
|
38
|
+
onUndo,
|
|
39
|
+
children,
|
|
40
|
+
}: TableClipboardManagerProps = $props();
|
|
41
|
+
|
|
42
|
+
const i18n = useTranslation();
|
|
43
|
+
const chinese = $derived(i18n.locale.startsWith('zh'));
|
|
44
|
+
|
|
45
|
+
let isModalOpen = $state(false);
|
|
46
|
+
let isCopySuccess = $state(false);
|
|
47
|
+
let pasteMode = $state<'append' | 'overwrite'>('append');
|
|
48
|
+
let parsedTable = $state<ParsedClipboardTable | null>(null);
|
|
49
|
+
let columnMappings = $state<ColumnMapping[]>([]);
|
|
50
|
+
let hasUndoableAction = $state(false);
|
|
51
|
+
|
|
52
|
+
async function handleCopySelection() {
|
|
53
|
+
if (selectedRows.length === 0) return;
|
|
54
|
+
const ok = await copyRowsToClipboard(selectedRows, columns);
|
|
55
|
+
if (ok) {
|
|
56
|
+
isCopySuccess = true;
|
|
57
|
+
setTimeout(() => {
|
|
58
|
+
isCopySuccess = false;
|
|
59
|
+
}, 1500);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
function handleProcessText(rawText: string) {
|
|
64
|
+
if (!rawText.trim()) return;
|
|
65
|
+
const parsed = parseClipboardText(rawText, columns);
|
|
66
|
+
if (parsed.rowCount === 0) return;
|
|
67
|
+
|
|
68
|
+
parsedTable = parsed;
|
|
69
|
+
columnMappings = matchColumnsToDefinitions(parsed.headers, columns);
|
|
70
|
+
isModalOpen = true;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
async function handlePasteFromButton() {
|
|
74
|
+
if (typeof navigator !== 'undefined' && navigator.clipboard) {
|
|
75
|
+
try {
|
|
76
|
+
const text = await navigator.clipboard.readText();
|
|
77
|
+
handleProcessText(text);
|
|
78
|
+
} catch {
|
|
79
|
+
// Clipboard read blocked
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
function handleKeydown(e: KeyboardEvent) {
|
|
85
|
+
// Cmd+V / Ctrl+V
|
|
86
|
+
if ((e.metaKey || e.ctrlKey) && e.key.toLowerCase() === 'v') {
|
|
87
|
+
const target = e.target as HTMLElement | null;
|
|
88
|
+
if (target && (target.tagName === 'INPUT' || target.tagName === 'TEXTAREA' || target.isContentEditable)) {
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
void handlePasteFromButton();
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
function handleConfirmPaste() {
|
|
96
|
+
if (!parsedTable) return;
|
|
97
|
+
|
|
98
|
+
const mappedRows: Record<string, unknown>[] = parsedTable.rows.map((row) => {
|
|
99
|
+
const obj: Record<string, unknown> = {};
|
|
100
|
+
columnMappings.forEach((map) => {
|
|
101
|
+
const targetKey = map.matchedColumnKey ?? map.clipboardHeader;
|
|
102
|
+
obj[targetKey] = row[map.clipboardHeader] ?? '';
|
|
103
|
+
});
|
|
104
|
+
return obj;
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
onPasteConfirmed?.(mappedRows, pasteMode);
|
|
108
|
+
hasUndoableAction = true;
|
|
109
|
+
isModalOpen = false;
|
|
110
|
+
parsedTable = null;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
function handleUndo() {
|
|
114
|
+
onUndo?.();
|
|
115
|
+
hasUndoableAction = false;
|
|
116
|
+
}
|
|
117
|
+
</script>
|
|
118
|
+
|
|
119
|
+
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
|
120
|
+
<div
|
|
121
|
+
data-svadmin-component="TableClipboardManager"
|
|
122
|
+
class={cn('inline-flex items-center gap-2', className)}
|
|
123
|
+
onkeydown={handleKeydown}
|
|
124
|
+
>
|
|
125
|
+
{#if children}
|
|
126
|
+
{@render children()}
|
|
127
|
+
{/if}
|
|
128
|
+
|
|
129
|
+
<div class="flex items-center gap-1.5 rounded-lg border border-border bg-card p-1 shadow-2xs text-xs">
|
|
130
|
+
<!-- Copy selected rows button -->
|
|
131
|
+
<Button
|
|
132
|
+
type="button"
|
|
133
|
+
variant="ghost"
|
|
134
|
+
size="sm"
|
|
135
|
+
class="h-7 px-2 gap-1 text-[11px]"
|
|
136
|
+
disabled={selectedRows.length === 0}
|
|
137
|
+
onclick={handleCopySelection}
|
|
138
|
+
title={chinese ? '复制选中行到剪贴板 (Excel TSV 格式)' : 'Copy selected rows as TSV'}
|
|
139
|
+
>
|
|
140
|
+
{#if isCopySuccess}
|
|
141
|
+
<Check class="h-3.5 w-3.5 text-success" />
|
|
142
|
+
<span class="text-success">{chinese ? '已复制' : 'Copied'}</span>
|
|
143
|
+
{:else}
|
|
144
|
+
<ClipboardCopy class="h-3.5 w-3.5 text-muted-foreground" />
|
|
145
|
+
<span>
|
|
146
|
+
{chinese
|
|
147
|
+
? selectedRows.length > 0
|
|
148
|
+
? `复制选中 (${selectedRows.length})`
|
|
149
|
+
: '复制选中'
|
|
150
|
+
: selectedRows.length > 0
|
|
151
|
+
? `Copy (${selectedRows.length})`
|
|
152
|
+
: 'Copy'}
|
|
153
|
+
</span>
|
|
154
|
+
{/if}
|
|
155
|
+
</Button>
|
|
156
|
+
|
|
157
|
+
<div class="h-3.5 w-px bg-border"></div>
|
|
158
|
+
|
|
159
|
+
<!-- Paste from clipboard button -->
|
|
160
|
+
<Button
|
|
161
|
+
type="button"
|
|
162
|
+
variant="ghost"
|
|
163
|
+
size="sm"
|
|
164
|
+
class="h-7 px-2 gap-1 text-[11px]"
|
|
165
|
+
onclick={handlePasteFromButton}
|
|
166
|
+
title={chinese ? '从剪贴板粘贴 Excel / 表格数据' : 'Paste table data from clipboard'}
|
|
167
|
+
>
|
|
168
|
+
<ClipboardPaste class="h-3.5 w-3.5 text-muted-foreground" />
|
|
169
|
+
<span>{chinese ? '粘贴表格' : 'Paste'}</span>
|
|
170
|
+
</Button>
|
|
171
|
+
|
|
172
|
+
{#if hasUndoableAction && onUndo}
|
|
173
|
+
<div class="h-3.5 w-px bg-border"></div>
|
|
174
|
+
<Button
|
|
175
|
+
type="button"
|
|
176
|
+
variant="ghost"
|
|
177
|
+
size="sm"
|
|
178
|
+
class="h-7 px-2 gap-1 text-[11px] text-muted-foreground hover:text-foreground"
|
|
179
|
+
onclick={handleUndo}
|
|
180
|
+
title={chinese ? '撤销上次粘贴' : 'Undo last paste'}
|
|
181
|
+
>
|
|
182
|
+
<Undo2 class="h-3.5 w-3.5" />
|
|
183
|
+
<span>{chinese ? '撤销' : 'Undo'}</span>
|
|
184
|
+
</Button>
|
|
185
|
+
{/if}
|
|
186
|
+
</div>
|
|
187
|
+
</div>
|
|
188
|
+
|
|
189
|
+
<!-- Paste Preview Modal Dialog -->
|
|
190
|
+
{#if isModalOpen && parsedTable}
|
|
191
|
+
<div
|
|
192
|
+
role="dialog"
|
|
193
|
+
aria-modal="true"
|
|
194
|
+
aria-labelledby="clipboard-preview-title"
|
|
195
|
+
class="fixed inset-0 z-50 flex items-center justify-center p-4 bg-background/80 backdrop-blur-sm"
|
|
196
|
+
>
|
|
197
|
+
<div
|
|
198
|
+
class="relative z-10 flex flex-col w-full max-w-2xl max-h-[85vh] rounded-md border border-border bg-card text-card-foreground shadow-[var(--shadow-overlay)] overflow-hidden animate-in fade-in zoom-in-95 duration-150"
|
|
199
|
+
>
|
|
200
|
+
<!-- Header -->
|
|
201
|
+
<div class="flex items-center justify-between border-b border-border/70 px-6 py-4 bg-card">
|
|
202
|
+
<div class="flex items-center gap-2.5 text-primary">
|
|
203
|
+
<FileSpreadsheet class="h-5 w-5" />
|
|
204
|
+
<h3 id="clipboard-preview-title" class="text-base font-semibold text-foreground">
|
|
205
|
+
{chinese ? '剪贴板数据导入预览' : 'Paste Data Preview'}
|
|
206
|
+
</h3>
|
|
207
|
+
</div>
|
|
208
|
+
<button
|
|
209
|
+
type="button"
|
|
210
|
+
onclick={() => (isModalOpen = false)}
|
|
211
|
+
class="flex h-7 w-7 items-center justify-center rounded-sm text-muted-foreground hover:bg-muted hover:text-foreground transition-colors cursor-pointer"
|
|
212
|
+
aria-label="Close"
|
|
213
|
+
>
|
|
214
|
+
<X class="h-4 w-4" />
|
|
215
|
+
</button>
|
|
216
|
+
</div>
|
|
217
|
+
|
|
218
|
+
<!-- Overview bar -->
|
|
219
|
+
<div class="flex items-center justify-between border-b border-border/60 bg-muted/20 px-6 py-3 text-xs">
|
|
220
|
+
<span class="text-muted-foreground">
|
|
221
|
+
{chinese
|
|
222
|
+
? `解析出 ${parsedTable.rowCount} 行数据,${parsedTable.colCount} 列`
|
|
223
|
+
: `Detected ${parsedTable.rowCount} rows, ${parsedTable.colCount} columns`}
|
|
224
|
+
</span>
|
|
225
|
+
|
|
226
|
+
<div class="flex items-center gap-3">
|
|
227
|
+
<span class="font-medium text-foreground">{chinese ? '写入方式:' : 'Mode:'}</span>
|
|
228
|
+
<label class="inline-flex items-center gap-1 cursor-pointer">
|
|
229
|
+
<input type="radio" value="append" bind:group={pasteMode} class="text-primary" />
|
|
230
|
+
<span>{chinese ? '追加为新行' : 'Append'}</span>
|
|
231
|
+
</label>
|
|
232
|
+
<label class="inline-flex items-center gap-1 cursor-pointer">
|
|
233
|
+
<input type="radio" value="overwrite" bind:group={pasteMode} class="text-primary" />
|
|
234
|
+
<span>{chinese ? '覆盖已有行' : 'Overwrite'}</span>
|
|
235
|
+
</label>
|
|
236
|
+
</div>
|
|
237
|
+
</div>
|
|
238
|
+
|
|
239
|
+
<!-- Column Mapping List -->
|
|
240
|
+
<div class="px-6 py-3 border-b border-border/50 bg-background text-xs">
|
|
241
|
+
<div class="font-semibold text-muted-foreground mb-2 uppercase tracking-wider text-[11px]">
|
|
242
|
+
{chinese ? '字段映射对齐' : 'Column Alignment'}
|
|
243
|
+
</div>
|
|
244
|
+
<div class="flex flex-wrap gap-2">
|
|
245
|
+
{#each columnMappings as map (map.clipboardIndex)}
|
|
246
|
+
<div class="inline-flex items-center gap-1.5 rounded-md border border-border bg-muted/30 px-2.5 py-1">
|
|
247
|
+
<span class="font-medium text-foreground">{map.clipboardHeader}</span>
|
|
248
|
+
<ArrowRight class="h-3 w-3 text-muted-foreground" />
|
|
249
|
+
{#if map.matchedColumnLabel}
|
|
250
|
+
<span class="text-success font-medium">{map.matchedColumnLabel}</span>
|
|
251
|
+
{:else}
|
|
252
|
+
<span class="text-muted-foreground italic">{chinese ? '未映射' : 'Unmapped'}</span>
|
|
253
|
+
{/if}
|
|
254
|
+
</div>
|
|
255
|
+
{/each}
|
|
256
|
+
</div>
|
|
257
|
+
</div>
|
|
258
|
+
|
|
259
|
+
<!-- Data Preview Table (First 5 rows) -->
|
|
260
|
+
<div class="flex-1 overflow-y-auto px-6 py-4">
|
|
261
|
+
<div class="text-[11px] font-semibold text-muted-foreground mb-2 uppercase tracking-wider">
|
|
262
|
+
{chinese ? '前 5 行数据预览' : 'First 5 Rows Preview'}
|
|
263
|
+
</div>
|
|
264
|
+
<div class="rounded-lg border border-border overflow-x-auto">
|
|
265
|
+
<table class="w-full text-left text-xs border-collapse">
|
|
266
|
+
<thead class="bg-muted/40 border-b border-border">
|
|
267
|
+
<tr>
|
|
268
|
+
<th class="p-2 font-mono text-[11px] text-muted-foreground w-10">#</th>
|
|
269
|
+
{#each parsedTable.headers as h (h)}
|
|
270
|
+
<th class="p-2 font-medium text-foreground whitespace-nowrap">{h}</th>
|
|
271
|
+
{/each}
|
|
272
|
+
</tr>
|
|
273
|
+
</thead>
|
|
274
|
+
<tbody class="divide-y divide-border/60">
|
|
275
|
+
{#each parsedTable.rawGrid.slice(0, 5) as row, idx (idx)}
|
|
276
|
+
<tr class="hover:bg-muted/30">
|
|
277
|
+
<td class="p-2 font-mono text-[11px] text-muted-foreground">{idx + 1}</td>
|
|
278
|
+
{#each row as cell, cellIdx (cellIdx)}
|
|
279
|
+
<td class="p-2 text-foreground whitespace-nowrap max-w-44 truncate">{cell}</td>
|
|
280
|
+
{/each}
|
|
281
|
+
</tr>
|
|
282
|
+
{/each}
|
|
283
|
+
</tbody>
|
|
284
|
+
</table>
|
|
285
|
+
</div>
|
|
286
|
+
</div>
|
|
287
|
+
|
|
288
|
+
<!-- Footer -->
|
|
289
|
+
<div class="flex items-center justify-between border-t border-border/70 px-6 py-4 bg-card">
|
|
290
|
+
<span class="text-[11px] text-muted-foreground">
|
|
291
|
+
{chinese ? '确认后将把表格数据批量导入' : 'Confirm to write parsed rows to table'}
|
|
292
|
+
</span>
|
|
293
|
+
|
|
294
|
+
<div class="flex items-center gap-2">
|
|
295
|
+
<Button type="button" variant="ghost" size="sm" onclick={() => (isModalOpen = false)}>
|
|
296
|
+
{chinese ? '取消' : 'Cancel'}
|
|
297
|
+
</Button>
|
|
298
|
+
|
|
299
|
+
<Button type="button" size="sm" onclick={handleConfirmPaste} class="gap-1 min-w-24">
|
|
300
|
+
<Check class="h-3.5 w-3.5" />
|
|
301
|
+
<span>{chinese ? '确认导入' : 'Confirm'}</span>
|
|
302
|
+
</Button>
|
|
303
|
+
</div>
|
|
304
|
+
</div>
|
|
305
|
+
</div>
|
|
306
|
+
</div>
|
|
307
|
+
{/if}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
import { type ColumnDef } from './useTableClipboard.svelte.js';
|
|
3
|
+
export interface TableClipboardManagerProps {
|
|
4
|
+
columns: ColumnDef[];
|
|
5
|
+
selectedRows?: Record<string, unknown>[] | undefined;
|
|
6
|
+
class?: string | undefined;
|
|
7
|
+
onPasteConfirmed?: ((rows: Record<string, unknown>[], mode: 'append' | 'overwrite') => void) | undefined;
|
|
8
|
+
onUndo?: (() => void) | undefined;
|
|
9
|
+
children?: Snippet | undefined;
|
|
10
|
+
}
|
|
11
|
+
declare const TableClipboardManager: import("svelte").Component<TableClipboardManagerProps, {}, "">;
|
|
12
|
+
type TableClipboardManager = ReturnType<typeof TableClipboardManager>;
|
|
13
|
+
export default TableClipboardManager;
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
import * as Sheet from './ui/sheet/index.js';
|
|
16
16
|
import { Button } from './ui/button/index.js';
|
|
17
17
|
import { cn } from '../utils.js';
|
|
18
|
+
import { useTranslation } from '@svadmin/core/i18n';
|
|
18
19
|
|
|
19
20
|
export type BackgroundTaskStatus = 'pending' | 'running' | 'completed' | 'failed' | 'cancelled';
|
|
20
21
|
|
|
@@ -52,14 +53,16 @@
|
|
|
52
53
|
class?: string;
|
|
53
54
|
}
|
|
54
55
|
|
|
56
|
+
const i18n = useTranslation();
|
|
57
|
+
|
|
55
58
|
let {
|
|
56
59
|
open = $bindable(false),
|
|
57
60
|
tasks = [],
|
|
58
|
-
title
|
|
59
|
-
description
|
|
60
|
-
emptyText
|
|
61
|
+
title,
|
|
62
|
+
description,
|
|
63
|
+
emptyText,
|
|
61
64
|
showTrigger = false,
|
|
62
|
-
triggerText
|
|
65
|
+
triggerText,
|
|
63
66
|
children,
|
|
64
67
|
onclose,
|
|
65
68
|
ondownload,
|
|
@@ -70,6 +73,11 @@
|
|
|
70
73
|
class: className,
|
|
71
74
|
}: TaskCenterProps = $props();
|
|
72
75
|
|
|
76
|
+
const titleText = $derived(title ?? i18n.t('taskCenter.title'));
|
|
77
|
+
const descriptionText = $derived(description ?? i18n.t('taskCenter.description'));
|
|
78
|
+
const emptyTextValue = $derived(emptyText ?? i18n.t('taskCenter.empty'));
|
|
79
|
+
const triggerTextValue = $derived(triggerText ?? i18n.t('taskCenter.trigger'));
|
|
80
|
+
|
|
73
81
|
let activeTab = $state<'all' | 'running' | 'pending' | 'completed' | 'failed'>('all');
|
|
74
82
|
|
|
75
83
|
const runningCount = $derived(tasks.filter((t) => t.status === 'running').length);
|
|
@@ -94,10 +102,10 @@
|
|
|
94
102
|
|
|
95
103
|
function formatDuration(seconds: number | undefined): string {
|
|
96
104
|
if (seconds == null || seconds < 0) return '';
|
|
97
|
-
if (seconds < 60) return
|
|
105
|
+
if (seconds < 60) return i18n.t('taskCenter.seconds', { count: Math.round(seconds) });
|
|
98
106
|
const mins = Math.floor(seconds / 60);
|
|
99
107
|
const secs = Math.round(seconds % 60);
|
|
100
|
-
return
|
|
108
|
+
return i18n.t('taskCenter.minutes', { minutes: mins, seconds: secs });
|
|
101
109
|
}
|
|
102
110
|
|
|
103
111
|
function handleDownload(task: BackgroundTask) {
|
|
@@ -140,14 +148,14 @@
|
|
|
140
148
|
size="sm"
|
|
141
149
|
class="relative flex items-center gap-1.5"
|
|
142
150
|
onclick={() => (open = true)}
|
|
143
|
-
aria-label=
|
|
151
|
+
aria-label={i18n.t('taskCenter.open')}
|
|
144
152
|
data-svadmin-action="open-task-center"
|
|
145
153
|
>
|
|
146
154
|
<Activity class={cn('h-4 w-4', runningCount > 0 ? 'text-primary animate-pulse' : 'text-muted-foreground')} />
|
|
147
|
-
<span>{
|
|
155
|
+
<span>{triggerTextValue}</span>
|
|
148
156
|
{#if runningCount > 0}
|
|
149
157
|
<span
|
|
150
|
-
class="ml-1 inline-flex items-center justify-center h-4 min-w-[1rem] px-1 text-
|
|
158
|
+
class="ml-1 inline-flex items-center justify-center h-4 min-w-[1rem] px-1 text-xs font-semibold rounded-full bg-primary text-primary-foreground"
|
|
151
159
|
data-svadmin-counter="running-tasks"
|
|
152
160
|
>
|
|
153
161
|
{runningCount}
|
|
@@ -163,9 +171,9 @@
|
|
|
163
171
|
<div>
|
|
164
172
|
<h2 class="text-base font-semibold text-foreground flex items-center gap-2">
|
|
165
173
|
<Activity class="h-4 w-4 text-primary" />
|
|
166
|
-
{
|
|
174
|
+
{titleText}
|
|
167
175
|
</h2>
|
|
168
|
-
<p class="text-xs text-muted-foreground mt-0.5">{
|
|
176
|
+
<p class="text-xs text-muted-foreground mt-0.5">{descriptionText}</p>
|
|
169
177
|
</div>
|
|
170
178
|
<div class="flex items-center gap-1">
|
|
171
179
|
{#if onrefresh}
|
|
@@ -174,7 +182,7 @@
|
|
|
174
182
|
size="icon"
|
|
175
183
|
class="h-8 w-8 text-muted-foreground hover:text-foreground"
|
|
176
184
|
onclick={() => onrefresh?.()}
|
|
177
|
-
aria-label=
|
|
185
|
+
aria-label={i18n.t('taskCenter.refresh')}
|
|
178
186
|
data-svadmin-action="refresh-tasks"
|
|
179
187
|
>
|
|
180
188
|
<RotateCw class="h-4 w-4" />
|
|
@@ -188,7 +196,7 @@
|
|
|
188
196
|
open = false;
|
|
189
197
|
onclose?.();
|
|
190
198
|
}}
|
|
191
|
-
aria-label=
|
|
199
|
+
aria-label={i18n.t('taskCenter.close')}
|
|
192
200
|
data-svadmin-action="close-task-center"
|
|
193
201
|
>
|
|
194
202
|
<X class="h-4 w-4" />
|
|
@@ -212,7 +220,7 @@
|
|
|
212
220
|
onclick={() => (activeTab = 'all')}
|
|
213
221
|
data-svadmin-tab="all"
|
|
214
222
|
>
|
|
215
|
-
|
|
223
|
+
{i18n.t('taskCenter.tab.all')} ({tasks.length})
|
|
216
224
|
</button>
|
|
217
225
|
<button
|
|
218
226
|
type="button"
|
|
@@ -227,10 +235,10 @@
|
|
|
227
235
|
onclick={() => (activeTab = 'running')}
|
|
228
236
|
data-svadmin-tab="running"
|
|
229
237
|
>
|
|
230
|
-
|
|
238
|
+
{i18n.t('taskCenter.tab.running')}
|
|
231
239
|
{#if runningCount > 0}
|
|
232
240
|
<span class="inline-flex h-1.5 w-1.5 rounded-full bg-primary animate-pulse"></span>
|
|
233
|
-
<span class="text-
|
|
241
|
+
<span class="text-xs bg-primary/10 text-primary px-1 rounded">{runningCount}</span>
|
|
234
242
|
{/if}
|
|
235
243
|
</button>
|
|
236
244
|
<button
|
|
@@ -246,7 +254,7 @@
|
|
|
246
254
|
onclick={() => (activeTab = 'pending')}
|
|
247
255
|
data-svadmin-tab="pending"
|
|
248
256
|
>
|
|
249
|
-
|
|
257
|
+
{i18n.t('taskCenter.tab.pending')} ({pendingCount})
|
|
250
258
|
</button>
|
|
251
259
|
<button
|
|
252
260
|
type="button"
|
|
@@ -261,7 +269,7 @@
|
|
|
261
269
|
onclick={() => (activeTab = 'completed')}
|
|
262
270
|
data-svadmin-tab="completed"
|
|
263
271
|
>
|
|
264
|
-
|
|
272
|
+
{i18n.t('taskCenter.tab.completed')} ({completedCount})
|
|
265
273
|
</button>
|
|
266
274
|
<button
|
|
267
275
|
type="button"
|
|
@@ -276,7 +284,7 @@
|
|
|
276
284
|
onclick={() => (activeTab = 'failed')}
|
|
277
285
|
data-svadmin-tab="failed"
|
|
278
286
|
>
|
|
279
|
-
|
|
287
|
+
{i18n.t('taskCenter.tab.failed')} ({failedCount})
|
|
280
288
|
</button>
|
|
281
289
|
</div>
|
|
282
290
|
|
|
@@ -289,7 +297,7 @@
|
|
|
289
297
|
data-svadmin-action="clear-completed"
|
|
290
298
|
>
|
|
291
299
|
<Trash2 class="h-3 w-3 mr-1" />
|
|
292
|
-
|
|
300
|
+
{i18n.t('taskCenter.clear')}
|
|
293
301
|
</Button>
|
|
294
302
|
{/if}
|
|
295
303
|
</div>
|
|
@@ -299,7 +307,7 @@
|
|
|
299
307
|
{#if filteredTasks.length === 0}
|
|
300
308
|
<div class="flex flex-col items-center justify-center py-16 text-center text-muted-foreground">
|
|
301
309
|
<Inbox class="h-10 w-10 stroke-1 text-muted-foreground/40 mb-3" />
|
|
302
|
-
<p class="text-sm">{
|
|
310
|
+
<p class="text-sm">{emptyTextValue}</p>
|
|
303
311
|
</div>
|
|
304
312
|
{:else}
|
|
305
313
|
{#each filteredTasks as task (task.id)}
|
|
@@ -321,29 +329,29 @@
|
|
|
321
329
|
</span>
|
|
322
330
|
<!-- Status Badge -->
|
|
323
331
|
{#if task.status === 'running'}
|
|
324
|
-
<span class="inline-flex items-center gap-1 text-
|
|
332
|
+
<span class="inline-flex items-center gap-1 text-xs font-medium px-2 py-0.5 rounded-full bg-primary/10 text-primary">
|
|
325
333
|
<RotateCw class="h-3 w-3 animate-spin" />
|
|
326
|
-
|
|
334
|
+
{i18n.t('taskCenter.status.running')}
|
|
327
335
|
</span>
|
|
328
336
|
{:else if task.status === 'pending'}
|
|
329
|
-
<span class="inline-flex items-center gap-1 text-
|
|
337
|
+
<span class="inline-flex items-center gap-1 text-xs font-medium px-2 py-0.5 rounded-full bg-muted text-muted-foreground">
|
|
330
338
|
<Clock class="h-3 w-3" />
|
|
331
|
-
|
|
339
|
+
{i18n.t('taskCenter.status.pending')}
|
|
332
340
|
</span>
|
|
333
341
|
{:else if task.status === 'completed'}
|
|
334
|
-
<span class="inline-flex items-center gap-1 text-
|
|
342
|
+
<span class="inline-flex items-center gap-1 text-xs font-medium px-2 py-0.5 rounded-full bg-success/15 text-success">
|
|
335
343
|
<CheckCircle2 class="h-3 w-3" />
|
|
336
|
-
|
|
344
|
+
{i18n.t('taskCenter.status.completed')}
|
|
337
345
|
</span>
|
|
338
346
|
{:else if task.status === 'failed'}
|
|
339
|
-
<span class="inline-flex items-center gap-1 text-
|
|
347
|
+
<span class="inline-flex items-center gap-1 text-xs font-medium px-2 py-0.5 rounded-full bg-destructive/15 text-destructive">
|
|
340
348
|
<AlertCircle class="h-3 w-3" />
|
|
341
|
-
|
|
349
|
+
{i18n.t('taskCenter.status.failed')}
|
|
342
350
|
</span>
|
|
343
351
|
{:else if task.status === 'cancelled'}
|
|
344
|
-
<span class="inline-flex items-center gap-1 text-
|
|
352
|
+
<span class="inline-flex items-center gap-1 text-xs font-medium px-2 py-0.5 rounded-full bg-muted text-muted-foreground">
|
|
345
353
|
<XCircle class="h-3 w-3" />
|
|
346
|
-
|
|
354
|
+
{i18n.t('taskCenter.status.cancelled')}
|
|
347
355
|
</span>
|
|
348
356
|
{/if}
|
|
349
357
|
</div>
|
|
@@ -352,7 +360,7 @@
|
|
|
352
360
|
{/if}
|
|
353
361
|
</div>
|
|
354
362
|
|
|
355
|
-
<span class="text-
|
|
363
|
+
<span class="text-xs text-muted-foreground whitespace-nowrap">
|
|
356
364
|
{formatTime(task.createdAt)}
|
|
357
365
|
</span>
|
|
358
366
|
</div>
|
|
@@ -382,7 +390,7 @@
|
|
|
382
390
|
{/if}
|
|
383
391
|
</span>
|
|
384
392
|
{#if task.estimatedSecondsRemaining != null && task.status === 'running'}
|
|
385
|
-
<span
|
|
393
|
+
<span>{i18n.t('taskCenter.remaining', { duration: formatDuration(task.estimatedSecondsRemaining) })}</span>
|
|
386
394
|
{/if}
|
|
387
395
|
</div>
|
|
388
396
|
</div>
|
|
@@ -397,8 +405,8 @@
|
|
|
397
405
|
|
|
398
406
|
<!-- Card Action Footer -->
|
|
399
407
|
<div class="mt-3 pt-2.5 border-t border-border/60 flex items-center justify-between text-xs">
|
|
400
|
-
<span class="text-muted-foreground text-
|
|
401
|
-
|
|
408
|
+
<span class="text-muted-foreground text-xs">
|
|
409
|
+
{i18n.t('taskCenter.id')}: <span class="font-mono">{task.id}</span>
|
|
402
410
|
</span>
|
|
403
411
|
<div class="flex items-center gap-1">
|
|
404
412
|
{#if task.status === 'completed' && (task.downloadUrl || ondownload)}
|
|
@@ -410,7 +418,7 @@
|
|
|
410
418
|
data-svadmin-action="download-result"
|
|
411
419
|
>
|
|
412
420
|
<Download class="h-3 w-3 mr-1" />
|
|
413
|
-
|
|
421
|
+
{i18n.t('taskCenter.download')}
|
|
414
422
|
</Button>
|
|
415
423
|
{/if}
|
|
416
424
|
|
|
@@ -423,7 +431,7 @@
|
|
|
423
431
|
data-svadmin-action="retry-task"
|
|
424
432
|
>
|
|
425
433
|
<RotateCw class="h-3 w-3 mr-1" />
|
|
426
|
-
|
|
434
|
+
{i18n.t('taskCenter.retry')}
|
|
427
435
|
</Button>
|
|
428
436
|
{/if}
|
|
429
437
|
|
|
@@ -436,7 +444,7 @@
|
|
|
436
444
|
data-svadmin-action="cancel-task"
|
|
437
445
|
>
|
|
438
446
|
<XCircle class="h-3 w-3 mr-1" />
|
|
439
|
-
|
|
447
|
+
{i18n.t('taskCenter.cancel')}
|
|
440
448
|
</Button>
|
|
441
449
|
{/if}
|
|
442
450
|
</div>
|