@svadmin/lite 0.27.0 → 0.30.1
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/components/LiteAbacPolicyMatrix.svelte +128 -0
- package/dist/components/LiteAbacPolicyMatrix.svelte.d.ts +16 -0
- package/dist/components/LiteApiPlayground.svelte +103 -0
- package/dist/components/LiteApiPlayground.svelte.d.ts +10 -0
- package/dist/components/LiteApprovalChainBuilder.svelte +120 -0
- package/dist/components/LiteApprovalChainBuilder.svelte.d.ts +15 -0
- package/dist/components/LiteAuditTrailInspector.svelte +166 -0
- package/dist/components/LiteAuditTrailInspector.svelte.d.ts +23 -0
- package/dist/components/LiteBillingInvoiceDrawer.svelte +100 -0
- package/dist/components/LiteBillingInvoiceDrawer.svelte.d.ts +16 -0
- package/dist/components/LiteChartAnnotationOverlay.svelte +101 -0
- package/dist/components/LiteChartAnnotationOverlay.svelte.d.ts +16 -0
- package/dist/components/LiteColumnMappingTable.svelte +105 -0
- package/dist/components/LiteColumnMappingTable.svelte.d.ts +14 -0
- package/dist/components/LiteDashboardGridLayout.svelte +108 -0
- package/dist/components/LiteDashboardGridLayout.svelte.d.ts +16 -0
- package/dist/components/LiteDashboardLayoutStorage.svelte +88 -0
- package/dist/components/LiteDashboardLayoutStorage.svelte.d.ts +16 -0
- package/dist/components/LiteDataImportDropzone.svelte +89 -0
- package/dist/components/LiteDataImportDropzone.svelte.d.ts +10 -0
- package/dist/components/LiteDataLineageGraph.svelte +100 -0
- package/dist/components/LiteDataLineageGraph.svelte.d.ts +15 -0
- package/dist/components/LiteDataMaskPolicyEngine.svelte +131 -0
- package/dist/components/LiteDataMaskPolicyEngine.svelte.d.ts +16 -0
- package/dist/components/LiteDataScreenContainer.svelte +34 -0
- package/dist/components/LiteDataScreenContainer.svelte.d.ts +9 -0
- package/dist/components/LiteElectronicSealStamp.svelte +56 -0
- package/dist/components/LiteElectronicSealStamp.svelte.d.ts +9 -0
- package/dist/components/LiteEnvVariableEditor.svelte +114 -0
- package/dist/components/LiteEnvVariableEditor.svelte.d.ts +15 -0
- package/dist/components/LiteFormulaField.svelte +44 -0
- package/dist/components/LiteFormulaField.svelte.d.ts +11 -0
- package/dist/components/LiteGeoScatterMap.svelte +117 -0
- package/dist/components/LiteGeoScatterMap.svelte.d.ts +16 -0
- package/dist/components/LiteHmacSignatureCalculator.svelte +84 -0
- package/dist/components/LiteHmacSignatureCalculator.svelte.d.ts +10 -0
- package/dist/components/LiteImportPreviewValidator.svelte +136 -0
- package/dist/components/LiteImportPreviewValidator.svelte.d.ts +16 -0
- package/dist/components/LiteLiveStreamLogViewer.svelte +84 -0
- package/dist/components/LiteLiveStreamLogViewer.svelte.d.ts +14 -0
- package/dist/components/LiteOmnibarCommandPalette.svelte +111 -0
- package/dist/components/LiteOmnibarCommandPalette.svelte.d.ts +15 -0
- package/dist/components/LitePeriodComparisonCard.svelte +60 -0
- package/dist/components/LitePeriodComparisonCard.svelte.d.ts +11 -0
- package/dist/components/LitePermissionSimulator.svelte +90 -0
- package/dist/components/LitePermissionSimulator.svelte.d.ts +14 -0
- package/dist/components/LitePivotMatrix.svelte +138 -0
- package/dist/components/LitePivotMatrix.svelte.d.ts +18 -0
- package/dist/components/LitePlanUsageQuotaBar.svelte +96 -0
- package/dist/components/LitePlanUsageQuotaBar.svelte.d.ts +15 -0
- package/dist/components/LiteQueryAiExplainer.svelte +85 -0
- package/dist/components/LiteQueryAiExplainer.svelte.d.ts +10 -0
- package/dist/components/LiteScheduledJobManager.svelte +116 -0
- package/dist/components/LiteScheduledJobManager.svelte.d.ts +16 -0
- package/dist/components/LiteScreenAntiLeakGuard.svelte +56 -0
- package/dist/components/LiteScreenAntiLeakGuard.svelte.d.ts +8 -0
- package/dist/components/LiteSecureDataExporter.svelte +101 -0
- package/dist/components/LiteSecureDataExporter.svelte.d.ts +12 -0
- package/dist/components/LiteSqlConsole.svelte +128 -0
- package/dist/components/LiteSqlConsole.svelte.d.ts +16 -0
- package/dist/components/LiteSystemCapacityForecastCard.svelte +88 -0
- package/dist/components/LiteSystemCapacityForecastCard.svelte.d.ts +11 -0
- package/dist/components/LiteSystemHealthCheckDashboard.svelte +142 -0
- package/dist/components/LiteSystemHealthCheckDashboard.svelte.d.ts +18 -0
- package/dist/components/LiteTableAggregationFooter.svelte +76 -0
- package/dist/components/LiteTableAggregationFooter.svelte.d.ts +14 -0
- package/dist/components/LiteTenantContextSwitcher.svelte +173 -0
- package/dist/components/LiteTenantContextSwitcher.svelte.d.ts +27 -0
- package/dist/components/LiteTenantQuotasMatrix.svelte +117 -0
- package/dist/components/LiteTenantQuotasMatrix.svelte.d.ts +17 -0
- package/dist/components/LiteThreadedCommentDrawer.svelte +60 -0
- package/dist/components/LiteThreadedCommentDrawer.svelte.d.ts +15 -0
- package/dist/components/LiteTierFeatureComparison.svelte +97 -0
- package/dist/components/LiteTierFeatureComparison.svelte.d.ts +18 -0
- package/dist/components/LiteWebhookSimulator.svelte +120 -0
- package/dist/components/LiteWebhookSimulator.svelte.d.ts +11 -0
- package/dist/components/LiteWorkflowNodeInspector.svelte +79 -0
- package/dist/components/LiteWorkflowNodeInspector.svelte.d.ts +11 -0
- package/dist/index.d.ts +40 -0
- package/dist/index.js +47 -0
- package/package.json +2 -2
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
interface Column {
|
|
3
|
+
name: string;
|
|
4
|
+
type?: string;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
interface Props {
|
|
8
|
+
title?: string;
|
|
9
|
+
query?: string;
|
|
10
|
+
columns?: Column[];
|
|
11
|
+
rows?: Record<string, string | number | null>[];
|
|
12
|
+
rowCount?: number;
|
|
13
|
+
executionTimeMs?: number;
|
|
14
|
+
class?: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
let {
|
|
18
|
+
title = 'SQL 只读查询控制台',
|
|
19
|
+
query = 'SELECT id, tenant_id, name, created_at FROM sys_tenants LIMIT 10;',
|
|
20
|
+
columns = [
|
|
21
|
+
{ name: 'id', type: 'uuid' },
|
|
22
|
+
{ name: 'tenant_id', type: 'varchar' },
|
|
23
|
+
{ name: 'name', type: 'varchar' },
|
|
24
|
+
{ name: 'created_at', type: 'timestamp' }
|
|
25
|
+
],
|
|
26
|
+
rows = [
|
|
27
|
+
{ id: '1a2b-3c4d', tenant_id: 't_enterprise', name: '上海华东研发中心', created_at: '2026-11-10 10:00:00' },
|
|
28
|
+
{ id: '5e6f-7g8h', tenant_id: 't_standard', name: '北京华北创新科技', created_at: '2026-11-11 14:30:00' }
|
|
29
|
+
],
|
|
30
|
+
rowCount = 2,
|
|
31
|
+
executionTimeMs = 12,
|
|
32
|
+
class: className = '',
|
|
33
|
+
}: Props = $props();
|
|
34
|
+
</script>
|
|
35
|
+
|
|
36
|
+
<div
|
|
37
|
+
class="lite-sql-console {className}"
|
|
38
|
+
data-svadmin-component="LiteSqlConsole"
|
|
39
|
+
role="region"
|
|
40
|
+
aria-label="SQL Console"
|
|
41
|
+
>
|
|
42
|
+
<header class="lite-sql-header">
|
|
43
|
+
<div class="lite-sql-title-wrap">
|
|
44
|
+
<span class="lite-sql-tag">READONLY</span>
|
|
45
|
+
<h4 class="lite-sql-title">{title}</h4>
|
|
46
|
+
</div>
|
|
47
|
+
<span class="lite-sql-stats">{rowCount} 行记录 · 耗时 {executionTimeMs}ms</span>
|
|
48
|
+
</header>
|
|
49
|
+
|
|
50
|
+
<div class="lite-sql-query-box">
|
|
51
|
+
<code>{query}</code>
|
|
52
|
+
</div>
|
|
53
|
+
|
|
54
|
+
<div class="lite-sql-table-wrap">
|
|
55
|
+
<table class="lite-sql-table">
|
|
56
|
+
<thead>
|
|
57
|
+
<tr>
|
|
58
|
+
{#each columns as col (col)}
|
|
59
|
+
<th>{col.name} <span class="lite-sql-col-type">({col.type ?? 'text'})</span></th>
|
|
60
|
+
{/each}
|
|
61
|
+
</tr>
|
|
62
|
+
</thead>
|
|
63
|
+
<tbody>
|
|
64
|
+
{#each rows as row, rIdx (rIdx)}
|
|
65
|
+
<tr>
|
|
66
|
+
{#each columns as col (col)}
|
|
67
|
+
<td>{row[col.name] ?? 'NULL'}</td>
|
|
68
|
+
{/each}
|
|
69
|
+
</tr>
|
|
70
|
+
{/each}
|
|
71
|
+
</tbody>
|
|
72
|
+
</table>
|
|
73
|
+
</div>
|
|
74
|
+
</div>
|
|
75
|
+
|
|
76
|
+
<style>
|
|
77
|
+
.lite-sql-console {
|
|
78
|
+
border: 1px solid #e5e6eb;
|
|
79
|
+
border-radius: 6px;
|
|
80
|
+
background: #ffffff;
|
|
81
|
+
font-size: 12px;
|
|
82
|
+
overflow: hidden;
|
|
83
|
+
}
|
|
84
|
+
.lite-sql-header {
|
|
85
|
+
display: flex;
|
|
86
|
+
justify-content: space-between;
|
|
87
|
+
align-items: center;
|
|
88
|
+
padding: 10px 14px;
|
|
89
|
+
background: #f7f8fa;
|
|
90
|
+
border-bottom: 1px solid #e5e6eb;
|
|
91
|
+
}
|
|
92
|
+
.lite-sql-title-wrap { display: flex; align-items: center; }
|
|
93
|
+
.lite-sql-title-wrap > * + * { margin-left: 8px; }
|
|
94
|
+
.lite-sql-tag {
|
|
95
|
+
font-size: 10px;
|
|
96
|
+
font-weight: 700;
|
|
97
|
+
color: #165dff;
|
|
98
|
+
background: #e8f3ff;
|
|
99
|
+
padding: 2px 6px;
|
|
100
|
+
border-radius: 4px;
|
|
101
|
+
}
|
|
102
|
+
.lite-sql-title { margin: 0; font-size: 13px; font-weight: 600; color: #1d2129; }
|
|
103
|
+
.lite-sql-stats { font-size: 11px; color: #86909c; font-family: monospace; }
|
|
104
|
+
.lite-sql-query-box {
|
|
105
|
+
padding: 10px 14px;
|
|
106
|
+
background: #272e3b;
|
|
107
|
+
color: #f2f3f5;
|
|
108
|
+
font-family: monospace;
|
|
109
|
+
font-size: 11px;
|
|
110
|
+
overflow-x: auto;
|
|
111
|
+
}
|
|
112
|
+
.lite-sql-table-wrap { overflow-x: auto; }
|
|
113
|
+
.lite-sql-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 11px; }
|
|
114
|
+
.lite-sql-table th {
|
|
115
|
+
padding: 8px 12px;
|
|
116
|
+
background: #f2f3f5;
|
|
117
|
+
border-bottom: 1px solid #e5e6eb;
|
|
118
|
+
color: #4e5969;
|
|
119
|
+
font-weight: 600;
|
|
120
|
+
}
|
|
121
|
+
.lite-sql-col-type { font-size: 10px; color: #86909c; font-weight: normal; }
|
|
122
|
+
.lite-sql-table td {
|
|
123
|
+
padding: 8px 12px;
|
|
124
|
+
border-bottom: 1px solid #f2f3f5;
|
|
125
|
+
color: #1d2129;
|
|
126
|
+
font-family: monospace;
|
|
127
|
+
}
|
|
128
|
+
</style>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
interface Column {
|
|
2
|
+
name: string;
|
|
3
|
+
type?: string;
|
|
4
|
+
}
|
|
5
|
+
interface Props {
|
|
6
|
+
title?: string;
|
|
7
|
+
query?: string;
|
|
8
|
+
columns?: Column[];
|
|
9
|
+
rows?: Record<string, string | number | null>[];
|
|
10
|
+
rowCount?: number;
|
|
11
|
+
executionTimeMs?: number;
|
|
12
|
+
class?: string;
|
|
13
|
+
}
|
|
14
|
+
declare const LiteSqlConsole: import("svelte").Component<Props, {}, "">;
|
|
15
|
+
type LiteSqlConsole = ReturnType<typeof LiteSqlConsole>;
|
|
16
|
+
export default LiteSqlConsole;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
interface Props {
|
|
3
|
+
resourceName?: string;
|
|
4
|
+
currentUsage?: number;
|
|
5
|
+
hardLimit?: number;
|
|
6
|
+
unit?: string;
|
|
7
|
+
estimatedDaysRemaining?: number;
|
|
8
|
+
class?: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
let {
|
|
12
|
+
resourceName = 'PostgreSQL 云数据库存储空间',
|
|
13
|
+
currentUsage = 920,
|
|
14
|
+
hardLimit = 1000,
|
|
15
|
+
unit = 'GB',
|
|
16
|
+
estimatedDaysRemaining = 14,
|
|
17
|
+
class: className = '',
|
|
18
|
+
}: Props = $props();
|
|
19
|
+
|
|
20
|
+
const pct = $derived(hardLimit > 0 ? Math.min(100, Math.round((currentUsage / hardLimit) * 100)) : 0);
|
|
21
|
+
</script>
|
|
22
|
+
|
|
23
|
+
<div
|
|
24
|
+
class="lite-capacity-card {className}"
|
|
25
|
+
data-svadmin-component="LiteSystemCapacityForecastCard"
|
|
26
|
+
role="region"
|
|
27
|
+
aria-label="System Capacity Forecast"
|
|
28
|
+
>
|
|
29
|
+
<header class="lite-cap-header">
|
|
30
|
+
<div>
|
|
31
|
+
<span class="lite-cap-label">容量趋势预测</span>
|
|
32
|
+
<h4 class="lite-cap-name">{resourceName}</h4>
|
|
33
|
+
</div>
|
|
34
|
+
<span class="lite-cap-countdown">预计 {estimatedDaysRemaining} 天后达上限</span>
|
|
35
|
+
</header>
|
|
36
|
+
|
|
37
|
+
<div class="lite-cap-body">
|
|
38
|
+
<div class="lite-cap-metrics">
|
|
39
|
+
<span class="lite-cap-val font-mono">{currentUsage}</span>
|
|
40
|
+
<span class="lite-cap-max">/ {hardLimit} {unit} ({pct}%)</span>
|
|
41
|
+
</div>
|
|
42
|
+
<div class="lite-cap-track">
|
|
43
|
+
<div
|
|
44
|
+
class="lite-cap-bar"
|
|
45
|
+
class:lite-bar-warn={pct >= 75 && pct < 90}
|
|
46
|
+
class:lite-bar-danger={pct >= 90}
|
|
47
|
+
style="width: {pct}%;"
|
|
48
|
+
></div>
|
|
49
|
+
</div>
|
|
50
|
+
</div>
|
|
51
|
+
</div>
|
|
52
|
+
|
|
53
|
+
<style>
|
|
54
|
+
.lite-capacity-card {
|
|
55
|
+
border: 1px solid #e5e6eb;
|
|
56
|
+
border-radius: 6px;
|
|
57
|
+
background: #ffffff;
|
|
58
|
+
font-size: 12px;
|
|
59
|
+
overflow: hidden;
|
|
60
|
+
}
|
|
61
|
+
.lite-cap-header {
|
|
62
|
+
display: flex;
|
|
63
|
+
justify-content: space-between;
|
|
64
|
+
align-items: flex-start;
|
|
65
|
+
padding: 10px 14px;
|
|
66
|
+
background: #f7f8fa;
|
|
67
|
+
border-bottom: 1px solid #e5e6eb;
|
|
68
|
+
}
|
|
69
|
+
.lite-cap-label { font-size: 10px; color: #86909c; }
|
|
70
|
+
.lite-cap-name { margin: 2px 0 0; font-size: 13px; font-weight: 600; color: #1d2129; }
|
|
71
|
+
.lite-cap-countdown {
|
|
72
|
+
font-size: 10px;
|
|
73
|
+
font-weight: 600;
|
|
74
|
+
color: #f53f3f;
|
|
75
|
+
background: #ffece8;
|
|
76
|
+
padding: 2px 6px;
|
|
77
|
+
border-radius: 3px;
|
|
78
|
+
}
|
|
79
|
+
.lite-cap-body { padding: 12px 14px; }
|
|
80
|
+
.lite-cap-metrics { margin-bottom: 6px; font-size: 12px; }
|
|
81
|
+
.lite-cap-val { font-size: 18px; font-weight: 700; color: #1d2129; }
|
|
82
|
+
.font-mono { font-family: monospace; }
|
|
83
|
+
.lite-cap-max { color: #86909c; margin-left: 4px; }
|
|
84
|
+
.lite-cap-track { height: 6px; background: #f2f3f5; border-radius: 3px; overflow: hidden; }
|
|
85
|
+
.lite-cap-bar { height: 100%; background: #165dff; border-radius: 3px; }
|
|
86
|
+
.lite-bar-warn { background: #ff7d00; }
|
|
87
|
+
.lite-bar-danger { background: #f53f3f; }
|
|
88
|
+
</style>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
interface Props {
|
|
2
|
+
resourceName?: string;
|
|
3
|
+
currentUsage?: number;
|
|
4
|
+
hardLimit?: number;
|
|
5
|
+
unit?: string;
|
|
6
|
+
estimatedDaysRemaining?: number;
|
|
7
|
+
class?: string;
|
|
8
|
+
}
|
|
9
|
+
declare const LiteSystemCapacityForecastCard: import("svelte").Component<Props, {}, "">;
|
|
10
|
+
type LiteSystemCapacityForecastCard = ReturnType<typeof LiteSystemCapacityForecastCard>;
|
|
11
|
+
export default LiteSystemCapacityForecastCard;
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
interface ServiceItem {
|
|
3
|
+
id: string;
|
|
4
|
+
name: string;
|
|
5
|
+
endpoint: string;
|
|
6
|
+
status: 'healthy' | 'degraded' | 'unhealthy';
|
|
7
|
+
latencyMs: number;
|
|
8
|
+
details?: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
interface Props {
|
|
12
|
+
title?: string;
|
|
13
|
+
environment?: string;
|
|
14
|
+
version?: string;
|
|
15
|
+
services?: ServiceItem[];
|
|
16
|
+
class?: string;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
let {
|
|
20
|
+
title = '系统链路健康自检大盘',
|
|
21
|
+
environment = 'production-east-01',
|
|
22
|
+
version = 'v2.8.4-enterprise',
|
|
23
|
+
services = [
|
|
24
|
+
{ id: 's1', name: 'PostgreSQL 主数据库集群', endpoint: 'db.internal.svc:5432', status: 'healthy', latencyMs: 3, details: '连接池活跃度 18/100' },
|
|
25
|
+
{ id: 's2', name: 'Redis 分布式缓存与锁', endpoint: 'redis-master.internal:6379', status: 'healthy', latencyMs: 1, details: '命中率 99.4%' },
|
|
26
|
+
{ id: 's3', name: 'MinIO / S3 企业对象存储', endpoint: 's3.oss-cn-shanghai.internal', status: 'healthy', latencyMs: 18, details: '读写探测成功' },
|
|
27
|
+
{ id: 's4', name: 'SupaAuth / SSO 统一鉴权', endpoint: 'auth.svadmin.internal/v1', status: 'healthy', latencyMs: 12, details: 'JWT 验签通畅' },
|
|
28
|
+
{ id: 's5', name: 'RabbitMQ 异步事件消息队列', endpoint: 'mq-node1.cluster.internal:5672', status: 'degraded', latencyMs: 145, details: '死信队列堆积 42 条' }
|
|
29
|
+
],
|
|
30
|
+
class: className = '',
|
|
31
|
+
}: Props = $props();
|
|
32
|
+
|
|
33
|
+
const healthyCount = $derived(services.filter(s => s.status === 'healthy').length);
|
|
34
|
+
const avgLatency = $derived(
|
|
35
|
+
services.length > 0 ? Math.round(services.reduce((a, b) => a + b.latencyMs, 0) / services.length) : 0
|
|
36
|
+
);
|
|
37
|
+
</script>
|
|
38
|
+
|
|
39
|
+
<div
|
|
40
|
+
class="lite-health-dash {className}"
|
|
41
|
+
data-svadmin-component="LiteSystemHealthCheckDashboard"
|
|
42
|
+
role="region"
|
|
43
|
+
aria-label="System Health Dashboard"
|
|
44
|
+
>
|
|
45
|
+
<header class="lite-health-header">
|
|
46
|
+
<div>
|
|
47
|
+
<h4 class="lite-health-title">{title}</h4>
|
|
48
|
+
<span class="lite-health-meta">环境: {environment} · 版本: {version}</span>
|
|
49
|
+
</div>
|
|
50
|
+
<div class="lite-health-kpi">
|
|
51
|
+
<span class="lite-kpi-pill">健康组件: <strong>{healthyCount}/{services.length}</strong></span>
|
|
52
|
+
<span class="lite-kpi-pill">平均延时: <strong class="font-mono">{avgLatency}ms</strong></span>
|
|
53
|
+
</div>
|
|
54
|
+
</header>
|
|
55
|
+
|
|
56
|
+
<div class="lite-health-table-wrap">
|
|
57
|
+
<table class="lite-health-table">
|
|
58
|
+
<thead>
|
|
59
|
+
<tr>
|
|
60
|
+
<th>服务组件名称</th>
|
|
61
|
+
<th>连接端点</th>
|
|
62
|
+
<th>链路状态</th>
|
|
63
|
+
<th>往返延时</th>
|
|
64
|
+
<th>检测指标详情</th>
|
|
65
|
+
</tr>
|
|
66
|
+
</thead>
|
|
67
|
+
<tbody>
|
|
68
|
+
{#each services as s (s.id)}
|
|
69
|
+
<tr>
|
|
70
|
+
<td class="lite-td-srvname">{s.name}</td>
|
|
71
|
+
<td class="lite-td-endpoint font-mono">{s.endpoint}</td>
|
|
72
|
+
<td>
|
|
73
|
+
<span
|
|
74
|
+
class="lite-status-pill"
|
|
75
|
+
class:lite-pill-healthy={s.status === 'healthy'}
|
|
76
|
+
class:lite-pill-warn={s.status === 'degraded'}
|
|
77
|
+
class:lite-pill-err={s.status === 'unhealthy'}
|
|
78
|
+
>
|
|
79
|
+
{s.status === 'healthy' ? '运行健康' : s.status === 'degraded' ? '性能亚健康' : '链路故障'}
|
|
80
|
+
</span>
|
|
81
|
+
</td>
|
|
82
|
+
<td class="lite-td-latency font-mono">{s.latencyMs} ms</td>
|
|
83
|
+
<td class="lite-td-detail">{s.details ?? '—'}</td>
|
|
84
|
+
</tr>
|
|
85
|
+
{/each}
|
|
86
|
+
</tbody>
|
|
87
|
+
</table>
|
|
88
|
+
</div>
|
|
89
|
+
</div>
|
|
90
|
+
|
|
91
|
+
<style>
|
|
92
|
+
.lite-health-dash {
|
|
93
|
+
border: 1px solid #e5e6eb;
|
|
94
|
+
border-radius: 6px;
|
|
95
|
+
background: #ffffff;
|
|
96
|
+
font-size: 12px;
|
|
97
|
+
overflow: hidden;
|
|
98
|
+
}
|
|
99
|
+
.lite-health-header {
|
|
100
|
+
display: flex;
|
|
101
|
+
justify-content: space-between;
|
|
102
|
+
align-items: center;
|
|
103
|
+
padding: 10px 14px;
|
|
104
|
+
background: #f7f8fa;
|
|
105
|
+
border-bottom: 1px solid #e5e6eb;
|
|
106
|
+
}
|
|
107
|
+
.lite-health-title { margin: 0; font-size: 13px; font-weight: 600; color: #1d2129; }
|
|
108
|
+
.lite-health-meta { font-size: 11px; color: #86909c; display: block; margin-top: 2px; }
|
|
109
|
+
.lite-health-kpi { display: flex; }
|
|
110
|
+
.lite-health-kpi > * + * { margin-left: 8px; }
|
|
111
|
+
.lite-kpi-pill { font-size: 11px; background: #ffffff; border: 1px solid #e5e6eb; padding: 2px 8px; border-radius: 4px; color: #4e5969; }
|
|
112
|
+
.lite-kpi-pill strong { color: #165dff; }
|
|
113
|
+
.lite-health-table-wrap { overflow-x: auto; }
|
|
114
|
+
.lite-health-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 11px; }
|
|
115
|
+
.lite-health-table th {
|
|
116
|
+
padding: 8px 12px;
|
|
117
|
+
background: #f2f3f5;
|
|
118
|
+
border-bottom: 1px solid #e5e6eb;
|
|
119
|
+
color: #4e5969;
|
|
120
|
+
font-weight: 600;
|
|
121
|
+
}
|
|
122
|
+
.lite-health-table td {
|
|
123
|
+
padding: 8px 12px;
|
|
124
|
+
border-bottom: 1px solid #f2f3f5;
|
|
125
|
+
color: #1d2129;
|
|
126
|
+
}
|
|
127
|
+
.lite-td-srvname { font-weight: 600; }
|
|
128
|
+
.font-mono { font-family: monospace; }
|
|
129
|
+
.lite-td-endpoint { color: #4e5969; }
|
|
130
|
+
.lite-status-pill {
|
|
131
|
+
display: inline-block;
|
|
132
|
+
padding: 1px 6px;
|
|
133
|
+
border-radius: 3px;
|
|
134
|
+
font-size: 10px;
|
|
135
|
+
font-weight: 600;
|
|
136
|
+
}
|
|
137
|
+
.lite-pill-healthy { background: #e8ffea; color: #00b42a; }
|
|
138
|
+
.lite-pill-warn { background: #fff7e8; color: #ff7d00; }
|
|
139
|
+
.lite-pill-err { background: #ffece8; color: #f53f3f; }
|
|
140
|
+
.lite-td-latency { font-weight: 600; }
|
|
141
|
+
.lite-td-detail { color: #86909c; }
|
|
142
|
+
</style>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
interface ServiceItem {
|
|
2
|
+
id: string;
|
|
3
|
+
name: string;
|
|
4
|
+
endpoint: string;
|
|
5
|
+
status: 'healthy' | 'degraded' | 'unhealthy';
|
|
6
|
+
latencyMs: number;
|
|
7
|
+
details?: string;
|
|
8
|
+
}
|
|
9
|
+
interface Props {
|
|
10
|
+
title?: string;
|
|
11
|
+
environment?: string;
|
|
12
|
+
version?: string;
|
|
13
|
+
services?: ServiceItem[];
|
|
14
|
+
class?: string;
|
|
15
|
+
}
|
|
16
|
+
declare const LiteSystemHealthCheckDashboard: import("svelte").Component<Props, {}, "">;
|
|
17
|
+
type LiteSystemHealthCheckDashboard = ReturnType<typeof LiteSystemHealthCheckDashboard>;
|
|
18
|
+
export default LiteSystemHealthCheckDashboard;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
interface AggItem {
|
|
3
|
+
label: string;
|
|
4
|
+
subtotal: string | number;
|
|
5
|
+
grandTotal: string | number;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
interface Props {
|
|
9
|
+
|
|
10
|
+
aggregations?: AggItem[];
|
|
11
|
+
selectedCount?: number;
|
|
12
|
+
totalCount?: number;
|
|
13
|
+
class?: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
let {
|
|
17
|
+
|
|
18
|
+
aggregations = [
|
|
19
|
+
{ label: '订单总金额 (¥)', subtotal: '¥ 128,450.00', grandTotal: '¥ 1,489,200.00' },
|
|
20
|
+
{ label: '已结算税额 (¥)', subtotal: '¥ 11,560.50', grandTotal: '¥ 134,028.00' },
|
|
21
|
+
{ label: '商品总件数', subtotal: '450 件', grandTotal: '5,200 件' }
|
|
22
|
+
],
|
|
23
|
+
selectedCount = 12,
|
|
24
|
+
totalCount = 140,
|
|
25
|
+
class: className = '',
|
|
26
|
+
}: Props = $props();
|
|
27
|
+
</script>
|
|
28
|
+
|
|
29
|
+
<div
|
|
30
|
+
class="lite-agg-footer {className}"
|
|
31
|
+
data-svadmin-component="LiteTableAggregationFooter"
|
|
32
|
+
role="region"
|
|
33
|
+
aria-label="Table Aggregation Footer"
|
|
34
|
+
>
|
|
35
|
+
<div class="lite-agg-left">
|
|
36
|
+
<span class="lite-agg-selection">已选 <strong class="lite-count">{selectedCount}</strong> 项 / 共 {totalCount} 条记录</span>
|
|
37
|
+
</div>
|
|
38
|
+
|
|
39
|
+
<div class="lite-agg-right">
|
|
40
|
+
{#each aggregations as agg (agg.label)}
|
|
41
|
+
<div class="lite-agg-cell">
|
|
42
|
+
<span class="lite-agg-label">{agg.label}</span>
|
|
43
|
+
<div class="lite-agg-vals">
|
|
44
|
+
<span class="lite-val-sub">选中小计: <strong>{agg.subtotal}</strong></span>
|
|
45
|
+
<span class="lite-val-total">全表合计: <strong>{agg.grandTotal}</strong></span>
|
|
46
|
+
</div>
|
|
47
|
+
</div>
|
|
48
|
+
{/each}
|
|
49
|
+
</div>
|
|
50
|
+
</div>
|
|
51
|
+
|
|
52
|
+
<style>
|
|
53
|
+
.lite-agg-footer {
|
|
54
|
+
border: 1px solid #e5e6eb;
|
|
55
|
+
border-radius: 6px;
|
|
56
|
+
background: #f7f8fa;
|
|
57
|
+
padding: 10px 14px;
|
|
58
|
+
font-size: 11px;
|
|
59
|
+
display: flex;
|
|
60
|
+
justify-content: space-between;
|
|
61
|
+
align-items: center;
|
|
62
|
+
flex-wrap: wrap;
|
|
63
|
+
}
|
|
64
|
+
.lite-agg-footer > * + * { margin-left: 12px; }
|
|
65
|
+
.lite-agg-left { color: #4e5969; }
|
|
66
|
+
.lite-count { color: #165dff; }
|
|
67
|
+
.lite-agg-right { display: flex; align-items: center; flex-wrap: wrap; }
|
|
68
|
+
.lite-agg-right > * + * { margin-left: 16px; }
|
|
69
|
+
.lite-agg-cell { display: flex; flex-direction: column; text-align: right; }
|
|
70
|
+
.lite-agg-cell > * + * { margin-top: 2px; }
|
|
71
|
+
.lite-agg-label { font-size: 10px; color: #86909c; font-weight: 500; }
|
|
72
|
+
.lite-agg-vals { display: flex; font-family: monospace; font-size: 11px; }
|
|
73
|
+
.lite-agg-vals > * + * { margin-left: 10px; }
|
|
74
|
+
.lite-val-sub strong { color: #165dff; }
|
|
75
|
+
.lite-val-total strong { color: #1d2129; }
|
|
76
|
+
</style>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
interface AggItem {
|
|
2
|
+
label: string;
|
|
3
|
+
subtotal: string | number;
|
|
4
|
+
grandTotal: string | number;
|
|
5
|
+
}
|
|
6
|
+
interface Props {
|
|
7
|
+
aggregations?: AggItem[];
|
|
8
|
+
selectedCount?: number;
|
|
9
|
+
totalCount?: number;
|
|
10
|
+
class?: string;
|
|
11
|
+
}
|
|
12
|
+
declare const LiteTableAggregationFooter: import("svelte").Component<Props, {}, "">;
|
|
13
|
+
type LiteTableAggregationFooter = ReturnType<typeof LiteTableAggregationFooter>;
|
|
14
|
+
export default LiteTableAggregationFooter;
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
export interface TenantRole {
|
|
3
|
+
id: string;
|
|
4
|
+
name: string;
|
|
5
|
+
isPrimary?: boolean;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export interface TenantItem {
|
|
9
|
+
id: string;
|
|
10
|
+
name: string;
|
|
11
|
+
code?: string;
|
|
12
|
+
type?: 'group' | 'subsidiary' | 'division' | 'store' | 'workspace';
|
|
13
|
+
logo?: string;
|
|
14
|
+
tier?: 'free' | 'pro' | 'enterprise';
|
|
15
|
+
roles?: (TenantRole | string)[];
|
|
16
|
+
status?: 'active' | 'suspended' | 'trial';
|
|
17
|
+
memberCount?: number;
|
|
18
|
+
description?: string;
|
|
19
|
+
parentId?: string;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
interface Props {
|
|
23
|
+
currentTenantId?: string;
|
|
24
|
+
tenants?: TenantItem[];
|
|
25
|
+
userRole?: string;
|
|
26
|
+
class?: string;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
let {
|
|
30
|
+
currentTenantId = 'tenant-corp-01',
|
|
31
|
+
tenants = [
|
|
32
|
+
{ id: 'tenant-corp-01', name: '星谷数智总集团', code: 'HQ-GLOBAL', type: 'group', tier: 'enterprise' },
|
|
33
|
+
{ id: 'tenant-east-02', name: '华东大区创新科技中心', code: 'DIV-EAST', type: 'subsidiary', tier: 'enterprise' },
|
|
34
|
+
],
|
|
35
|
+
userRole = '全局系统主管',
|
|
36
|
+
class: className = '',
|
|
37
|
+
}: Props = $props();
|
|
38
|
+
|
|
39
|
+
const currentTenant = $derived(
|
|
40
|
+
tenants.find((t) => t.id === currentTenantId) ?? tenants[0]
|
|
41
|
+
);
|
|
42
|
+
</script>
|
|
43
|
+
|
|
44
|
+
<div
|
|
45
|
+
class="lite-tenant-switcher {className}"
|
|
46
|
+
data-svadmin-component="LiteTenantContextSwitcher"
|
|
47
|
+
role="region"
|
|
48
|
+
aria-label="Tenant Context Switcher"
|
|
49
|
+
>
|
|
50
|
+
<div class="lite-tenant-trigger">
|
|
51
|
+
<div class="lite-tenant-badge">
|
|
52
|
+
<span class="lite-tenant-icon">🏢</span>
|
|
53
|
+
</div>
|
|
54
|
+
<div class="lite-tenant-info">
|
|
55
|
+
<div class="lite-tenant-name-row">
|
|
56
|
+
<span class="lite-tenant-name">{currentTenant?.name ?? '当前租户'}</span>
|
|
57
|
+
{#if currentTenant?.tier}
|
|
58
|
+
<span class="lite-tier-tag">{currentTenant.tier}</span>
|
|
59
|
+
{/if}
|
|
60
|
+
</div>
|
|
61
|
+
<span class="lite-tenant-code">{currentTenant?.code ?? userRole}</span>
|
|
62
|
+
</div>
|
|
63
|
+
<span class="lite-caret">▼</span>
|
|
64
|
+
</div>
|
|
65
|
+
|
|
66
|
+
<div class="lite-tenant-noscript-list">
|
|
67
|
+
<span class="lite-list-title">可用组织与工作区 (SSR 降级静态展示):</span>
|
|
68
|
+
<ul class="lite-tenants-ul">
|
|
69
|
+
{#each tenants as t (t.id)}
|
|
70
|
+
<li class="lite-tenant-li" class:lite-tenant-active={t.id === currentTenantId}>
|
|
71
|
+
<span class="lite-tenant-bullet">•</span>
|
|
72
|
+
<span class="lite-tenant-li-name">{t.name}</span>
|
|
73
|
+
{#if t.code}<span class="lite-tenant-li-code">({t.code})</span>{/if}
|
|
74
|
+
{#if t.id === currentTenantId}<span class="lite-active-mark">[当前]</span>{/if}
|
|
75
|
+
</li>
|
|
76
|
+
{/each}
|
|
77
|
+
</ul>
|
|
78
|
+
</div>
|
|
79
|
+
</div>
|
|
80
|
+
|
|
81
|
+
<style>
|
|
82
|
+
.lite-tenant-switcher {
|
|
83
|
+
border: 1px solid #e5e6eb;
|
|
84
|
+
border-radius: 6px;
|
|
85
|
+
background: #ffffff;
|
|
86
|
+
font-size: 12px;
|
|
87
|
+
overflow: hidden;
|
|
88
|
+
padding: 8px 12px;
|
|
89
|
+
}
|
|
90
|
+
.lite-tenant-trigger {
|
|
91
|
+
display: flex;
|
|
92
|
+
align-items: center;
|
|
93
|
+
padding-bottom: 8px;
|
|
94
|
+
border-bottom: 1px dashed #e5e6eb;
|
|
95
|
+
}
|
|
96
|
+
.lite-tenant-badge {
|
|
97
|
+
width: 28px;
|
|
98
|
+
height: 28px;
|
|
99
|
+
border-radius: 4px;
|
|
100
|
+
background: #f2f3f5;
|
|
101
|
+
display: flex;
|
|
102
|
+
align-items: center;
|
|
103
|
+
justify-content: center;
|
|
104
|
+
font-size: 14px;
|
|
105
|
+
margin-right: 8px;
|
|
106
|
+
}
|
|
107
|
+
.lite-tenant-info {
|
|
108
|
+
flex: 1;
|
|
109
|
+
display: flex;
|
|
110
|
+
flex-direction: column;
|
|
111
|
+
}
|
|
112
|
+
.lite-tenant-name-row {
|
|
113
|
+
display: flex;
|
|
114
|
+
align-items: center;
|
|
115
|
+
}
|
|
116
|
+
.lite-tenant-name-row > * + * { margin-left: 6px; }
|
|
117
|
+
.lite-tenant-name {
|
|
118
|
+
font-weight: 600;
|
|
119
|
+
color: #1d2129;
|
|
120
|
+
margin-right: 6px;
|
|
121
|
+
}
|
|
122
|
+
.lite-tier-tag {
|
|
123
|
+
font-size: 9px;
|
|
124
|
+
background: #e8f3ff;
|
|
125
|
+
color: #165dff;
|
|
126
|
+
padding: 1px 4px;
|
|
127
|
+
border-radius: 2px;
|
|
128
|
+
text-transform: uppercase;
|
|
129
|
+
}
|
|
130
|
+
.lite-tenant-code {
|
|
131
|
+
font-size: 10px;
|
|
132
|
+
color: #86909c;
|
|
133
|
+
}
|
|
134
|
+
.lite-caret {
|
|
135
|
+
font-size: 10px;
|
|
136
|
+
color: #86909c;
|
|
137
|
+
margin-left: 8px;
|
|
138
|
+
}
|
|
139
|
+
.lite-tenant-noscript-list {
|
|
140
|
+
margin-top: 6px;
|
|
141
|
+
font-size: 11px;
|
|
142
|
+
color: #4e5969;
|
|
143
|
+
}
|
|
144
|
+
.lite-list-title {
|
|
145
|
+
font-size: 10px;
|
|
146
|
+
color: #86909c;
|
|
147
|
+
}
|
|
148
|
+
.lite-tenants-ul {
|
|
149
|
+
list-style: none;
|
|
150
|
+
padding: 0;
|
|
151
|
+
margin: 4px 0 0;
|
|
152
|
+
}
|
|
153
|
+
.lite-tenant-li {
|
|
154
|
+
display: flex;
|
|
155
|
+
align-items: center;
|
|
156
|
+
padding: 2px 0;
|
|
157
|
+
}
|
|
158
|
+
.lite-tenant-bullet {
|
|
159
|
+
margin-right: 4px;
|
|
160
|
+
}
|
|
161
|
+
.lite-tenant-li-code {
|
|
162
|
+
margin-left: 4px;
|
|
163
|
+
}
|
|
164
|
+
.lite-active-mark {
|
|
165
|
+
margin-left: 4px;
|
|
166
|
+
font-size: 10px;
|
|
167
|
+
color: #165dff;
|
|
168
|
+
}
|
|
169
|
+
.lite-tenant-active {
|
|
170
|
+
color: #165dff;
|
|
171
|
+
font-weight: 600;
|
|
172
|
+
}
|
|
173
|
+
</style>
|