@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.
Files changed (81) hide show
  1. package/dist/components/LiteAbacPolicyMatrix.svelte +128 -0
  2. package/dist/components/LiteAbacPolicyMatrix.svelte.d.ts +16 -0
  3. package/dist/components/LiteApiPlayground.svelte +103 -0
  4. package/dist/components/LiteApiPlayground.svelte.d.ts +10 -0
  5. package/dist/components/LiteApprovalChainBuilder.svelte +120 -0
  6. package/dist/components/LiteApprovalChainBuilder.svelte.d.ts +15 -0
  7. package/dist/components/LiteAuditTrailInspector.svelte +166 -0
  8. package/dist/components/LiteAuditTrailInspector.svelte.d.ts +23 -0
  9. package/dist/components/LiteBillingInvoiceDrawer.svelte +100 -0
  10. package/dist/components/LiteBillingInvoiceDrawer.svelte.d.ts +16 -0
  11. package/dist/components/LiteChartAnnotationOverlay.svelte +101 -0
  12. package/dist/components/LiteChartAnnotationOverlay.svelte.d.ts +16 -0
  13. package/dist/components/LiteColumnMappingTable.svelte +105 -0
  14. package/dist/components/LiteColumnMappingTable.svelte.d.ts +14 -0
  15. package/dist/components/LiteDashboardGridLayout.svelte +108 -0
  16. package/dist/components/LiteDashboardGridLayout.svelte.d.ts +16 -0
  17. package/dist/components/LiteDashboardLayoutStorage.svelte +88 -0
  18. package/dist/components/LiteDashboardLayoutStorage.svelte.d.ts +16 -0
  19. package/dist/components/LiteDataImportDropzone.svelte +89 -0
  20. package/dist/components/LiteDataImportDropzone.svelte.d.ts +10 -0
  21. package/dist/components/LiteDataLineageGraph.svelte +100 -0
  22. package/dist/components/LiteDataLineageGraph.svelte.d.ts +15 -0
  23. package/dist/components/LiteDataMaskPolicyEngine.svelte +131 -0
  24. package/dist/components/LiteDataMaskPolicyEngine.svelte.d.ts +16 -0
  25. package/dist/components/LiteDataScreenContainer.svelte +34 -0
  26. package/dist/components/LiteDataScreenContainer.svelte.d.ts +9 -0
  27. package/dist/components/LiteElectronicSealStamp.svelte +56 -0
  28. package/dist/components/LiteElectronicSealStamp.svelte.d.ts +9 -0
  29. package/dist/components/LiteEnvVariableEditor.svelte +114 -0
  30. package/dist/components/LiteEnvVariableEditor.svelte.d.ts +15 -0
  31. package/dist/components/LiteFormulaField.svelte +44 -0
  32. package/dist/components/LiteFormulaField.svelte.d.ts +11 -0
  33. package/dist/components/LiteGeoScatterMap.svelte +117 -0
  34. package/dist/components/LiteGeoScatterMap.svelte.d.ts +16 -0
  35. package/dist/components/LiteHmacSignatureCalculator.svelte +84 -0
  36. package/dist/components/LiteHmacSignatureCalculator.svelte.d.ts +10 -0
  37. package/dist/components/LiteImportPreviewValidator.svelte +136 -0
  38. package/dist/components/LiteImportPreviewValidator.svelte.d.ts +16 -0
  39. package/dist/components/LiteLiveStreamLogViewer.svelte +84 -0
  40. package/dist/components/LiteLiveStreamLogViewer.svelte.d.ts +14 -0
  41. package/dist/components/LiteOmnibarCommandPalette.svelte +111 -0
  42. package/dist/components/LiteOmnibarCommandPalette.svelte.d.ts +15 -0
  43. package/dist/components/LitePeriodComparisonCard.svelte +60 -0
  44. package/dist/components/LitePeriodComparisonCard.svelte.d.ts +11 -0
  45. package/dist/components/LitePermissionSimulator.svelte +90 -0
  46. package/dist/components/LitePermissionSimulator.svelte.d.ts +14 -0
  47. package/dist/components/LitePivotMatrix.svelte +138 -0
  48. package/dist/components/LitePivotMatrix.svelte.d.ts +18 -0
  49. package/dist/components/LitePlanUsageQuotaBar.svelte +96 -0
  50. package/dist/components/LitePlanUsageQuotaBar.svelte.d.ts +15 -0
  51. package/dist/components/LiteQueryAiExplainer.svelte +85 -0
  52. package/dist/components/LiteQueryAiExplainer.svelte.d.ts +10 -0
  53. package/dist/components/LiteScheduledJobManager.svelte +116 -0
  54. package/dist/components/LiteScheduledJobManager.svelte.d.ts +16 -0
  55. package/dist/components/LiteScreenAntiLeakGuard.svelte +56 -0
  56. package/dist/components/LiteScreenAntiLeakGuard.svelte.d.ts +8 -0
  57. package/dist/components/LiteSecureDataExporter.svelte +101 -0
  58. package/dist/components/LiteSecureDataExporter.svelte.d.ts +12 -0
  59. package/dist/components/LiteSqlConsole.svelte +128 -0
  60. package/dist/components/LiteSqlConsole.svelte.d.ts +16 -0
  61. package/dist/components/LiteSystemCapacityForecastCard.svelte +88 -0
  62. package/dist/components/LiteSystemCapacityForecastCard.svelte.d.ts +11 -0
  63. package/dist/components/LiteSystemHealthCheckDashboard.svelte +142 -0
  64. package/dist/components/LiteSystemHealthCheckDashboard.svelte.d.ts +18 -0
  65. package/dist/components/LiteTableAggregationFooter.svelte +76 -0
  66. package/dist/components/LiteTableAggregationFooter.svelte.d.ts +14 -0
  67. package/dist/components/LiteTenantContextSwitcher.svelte +173 -0
  68. package/dist/components/LiteTenantContextSwitcher.svelte.d.ts +27 -0
  69. package/dist/components/LiteTenantQuotasMatrix.svelte +117 -0
  70. package/dist/components/LiteTenantQuotasMatrix.svelte.d.ts +17 -0
  71. package/dist/components/LiteThreadedCommentDrawer.svelte +60 -0
  72. package/dist/components/LiteThreadedCommentDrawer.svelte.d.ts +15 -0
  73. package/dist/components/LiteTierFeatureComparison.svelte +97 -0
  74. package/dist/components/LiteTierFeatureComparison.svelte.d.ts +18 -0
  75. package/dist/components/LiteWebhookSimulator.svelte +120 -0
  76. package/dist/components/LiteWebhookSimulator.svelte.d.ts +11 -0
  77. package/dist/components/LiteWorkflowNodeInspector.svelte +79 -0
  78. package/dist/components/LiteWorkflowNodeInspector.svelte.d.ts +11 -0
  79. package/dist/index.d.ts +40 -0
  80. package/dist/index.js +47 -0
  81. package/package.json +2 -2
@@ -0,0 +1,128 @@
1
+ <script lang="ts">
2
+ export interface AbacPolicyRule {
3
+ id: string;
4
+ name: string;
5
+ resource: string;
6
+ effect: 'allow' | 'mask' | 'require_mfa' | 'deny';
7
+ priority: number;
8
+ enabled: boolean;
9
+ }
10
+
11
+ interface Props {
12
+ title?: string;
13
+ rules?: AbacPolicyRule[];
14
+ class?: string;
15
+ }
16
+
17
+ let {
18
+ title = '企业级 ABAC 访问控制策略矩阵 (SSR 静态列表)',
19
+ rules = [
20
+ { id: 'r1', name: '财务大额调拨审批放行', resource: 'TreasuryPayment', effect: 'allow', priority: 100, enabled: true },
21
+ { id: 'r2', name: '普通专员薪酬资产脱敏', resource: 'EmployeeCompensation', effect: 'mask', priority: 85, enabled: true },
22
+ { id: 'r3', name: '非工作时段审计库阻断', resource: 'AuditArchiveStore', effect: 'deny', priority: 95, enabled: true },
23
+ { id: 'r4', name: '大批量导出强制提权', resource: 'BatchDataExport', effect: 'require_mfa', priority: 90, enabled: true },
24
+ ],
25
+ class: className = '',
26
+ }: Props = $props();
27
+ </script>
28
+
29
+ <div
30
+ class="lite-abac-matrix {className}"
31
+ data-svadmin-component="LiteAbacPolicyMatrix"
32
+ role="region"
33
+ aria-label="ABAC Policy Matrix"
34
+ >
35
+ <header class="lite-abac-header">
36
+ <div class="lite-abac-title-row">
37
+ <span class="lite-abac-icon">🛡️</span>
38
+ <h4 class="lite-abac-title">{title}</h4>
39
+ </div>
40
+ <span class="lite-abac-count">共 {rules.length} 条策略规则</span>
41
+ </header>
42
+
43
+ <div class="lite-abac-table-wrap">
44
+ <table class="lite-abac-table">
45
+ <thead>
46
+ <tr>
47
+ <th>规则名称</th>
48
+ <th>目标资源</th>
49
+ <th>裁决效应</th>
50
+ <th>优先级</th>
51
+ <th>状态</th>
52
+ </tr>
53
+ </thead>
54
+ <tbody>
55
+ {#each rules as r (r.id)}
56
+ <tr>
57
+ <td class="lite-r-name">{r.name}</td>
58
+ <td class="font-mono text-muted">{r.resource}</td>
59
+ <td>
60
+ <span
61
+ class="lite-r-effect"
62
+ class:lite-eff-allow={r.effect === 'allow'}
63
+ class:lite-eff-mask={r.effect === 'mask'}
64
+ class:lite-eff-mfa={r.effect === 'require_mfa'}
65
+ class:lite-eff-deny={r.effect === 'deny'}
66
+ >
67
+ {r.effect}
68
+ </span>
69
+ </td>
70
+ <td class="font-mono">{r.priority}</td>
71
+ <td>
72
+ <span class="lite-status-txt">{r.enabled ? '已启用' : '已停用'}</span>
73
+ </td>
74
+ </tr>
75
+ {/each}
76
+ </tbody>
77
+ </table>
78
+ </div>
79
+ </div>
80
+
81
+ <style>
82
+ .lite-abac-matrix {
83
+ border: 1px solid #e5e6eb;
84
+ border-radius: 6px;
85
+ background: #ffffff;
86
+ font-size: 12px;
87
+ overflow: hidden;
88
+ }
89
+ .lite-abac-header {
90
+ display: flex;
91
+ justify-content: space-between;
92
+ align-items: center;
93
+ padding: 10px 14px;
94
+ background: #f7f8fa;
95
+ border-bottom: 1px solid #e5e6eb;
96
+ }
97
+ .lite-abac-title-row { display: flex; align-items: center; }
98
+ .lite-abac-icon { font-size: 14px; margin-right: 6px; }
99
+ .lite-abac-title { margin: 0; font-size: 13px; font-weight: 600; color: #1d2129; }
100
+ .lite-abac-count { font-size: 11px; color: #86909c; }
101
+ .lite-abac-table-wrap { overflow-x: auto; }
102
+ .lite-abac-table {
103
+ width: 100%;
104
+ border-collapse: collapse;
105
+ font-size: 12px;
106
+ text-align: left;
107
+ }
108
+ .lite-abac-table th, .lite-abac-table td {
109
+ padding: 8px 12px;
110
+ border-bottom: 1px solid #f2f3f5;
111
+ }
112
+ .lite-abac-table th { background: #fafafa; font-weight: 600; color: #4e5969; font-size: 11px; }
113
+ .font-mono { font-family: monospace; font-size: 11px; }
114
+ .text-muted { color: #86909c; }
115
+ .lite-r-name { font-weight: 500; color: #1d2129; }
116
+ .lite-r-effect {
117
+ font-size: 10px;
118
+ font-weight: 600;
119
+ padding: 1px 5px;
120
+ border-radius: 2px;
121
+ text-transform: uppercase;
122
+ }
123
+ .lite-eff-allow { background: #e8ffea; color: #00b42a; }
124
+ .lite-eff-mask { background: #e8f3ff; color: #165dff; }
125
+ .lite-eff-mfa { background: #fff7e8; color: #ff7d00; }
126
+ .lite-eff-deny { background: #ffece8; color: #f53f3f; }
127
+ .lite-status-txt { font-size: 11px; color: #4e5969; }
128
+ </style>
@@ -0,0 +1,16 @@
1
+ export interface AbacPolicyRule {
2
+ id: string;
3
+ name: string;
4
+ resource: string;
5
+ effect: 'allow' | 'mask' | 'require_mfa' | 'deny';
6
+ priority: number;
7
+ enabled: boolean;
8
+ }
9
+ interface Props {
10
+ title?: string;
11
+ rules?: AbacPolicyRule[];
12
+ class?: string;
13
+ }
14
+ declare const LiteAbacPolicyMatrix: import("svelte").Component<Props, {}, "">;
15
+ type LiteAbacPolicyMatrix = ReturnType<typeof LiteAbacPolicyMatrix>;
16
+ export default LiteAbacPolicyMatrix;
@@ -0,0 +1,103 @@
1
+ <script lang="ts">
2
+ interface Props {
3
+ method?: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH';
4
+ url?: string;
5
+ curl?: string;
6
+ responseStatus?: number;
7
+ class?: string;
8
+ }
9
+
10
+ let {
11
+ method = 'GET',
12
+ url = '/api/v1/orders',
13
+ curl = 'curl -X GET "/api/v1/orders"',
14
+ responseStatus = 200,
15
+ class: className = '',
16
+ }: Props = $props();
17
+ </script>
18
+
19
+ <div
20
+ class="lite-api-playground {className}"
21
+ data-svadmin-component="LiteApiPlayground"
22
+ role="region"
23
+ aria-label="API Playground"
24
+ >
25
+ <header class="lite-api-header">
26
+ <span class="lite-api-title">API 调试工作台 (SSR 静态探针)</span>
27
+ <span class="lite-api-method lite-method-{method.toLowerCase()}">{method}</span>
28
+ </header>
29
+
30
+ <div class="lite-api-body">
31
+ <div class="lite-api-request-bar">
32
+ <span class="lite-api-method-badge">{method}</span>
33
+ <code class="lite-api-url">{url}</code>
34
+ </div>
35
+
36
+ <div class="lite-api-curl-box">
37
+ <span class="lite-curl-label">终端 cURL 命令:</span>
38
+ <pre class="lite-curl-code"><code>{curl}</code></pre>
39
+ </div>
40
+
41
+ {#if responseStatus}
42
+ <div class="lite-api-res-badge">
43
+ <span>预估状态: HTTP {responseStatus} OK</span>
44
+ </div>
45
+ {/if}
46
+ </div>
47
+ </div>
48
+
49
+ <style>
50
+ .lite-api-playground {
51
+ border: 1px solid #e5e6eb;
52
+ border-radius: 6px;
53
+ background: #ffffff;
54
+ font-size: 12px;
55
+ overflow: hidden;
56
+ }
57
+ .lite-api-header {
58
+ display: flex;
59
+ justify-content: space-between;
60
+ align-items: center;
61
+ padding: 8px 12px;
62
+ background: #f7f8fa;
63
+ border-bottom: 1px solid #e5e6eb;
64
+ }
65
+ .lite-api-title { font-weight: 600; color: #1d2129; }
66
+ .lite-api-method { font-size: 11px; font-family: monospace; font-weight: 700; }
67
+ .lite-method-get { color: #165dff; }
68
+ .lite-method-post { color: #00b42a; }
69
+ .lite-api-body { padding: 12px; }
70
+ .lite-api-request-bar {
71
+ display: flex;
72
+ align-items: center;
73
+ padding: 6px 10px;
74
+ background: #f7f8fa;
75
+ border: 1px solid #e5e6eb;
76
+ border-radius: 4px;
77
+ font-family: monospace;
78
+ }
79
+ .lite-api-method-badge { font-weight: 700; color: #165dff; }
80
+ .lite-api-url { color: #1d2129; word-break: break-all; }
81
+ .lite-api-curl-box { margin-top: 10px; }
82
+ .lite-curl-label { color: #86909c; font-size: 11px; }
83
+ .lite-curl-code {
84
+ margin: 4px 0 0;
85
+ padding: 8px;
86
+ background: #f7f8fa;
87
+ border: 1px solid #e5e6eb;
88
+ border-radius: 4px;
89
+ font-family: monospace;
90
+ font-size: 11px;
91
+ color: #1d2129;
92
+ white-space: pre-wrap;
93
+ }
94
+ .lite-api-res-badge {
95
+ margin-top: 10px;
96
+ padding: 4px 8px;
97
+ border-radius: 4px;
98
+ background: #e8ffea;
99
+ color: #00b42a;
100
+ font-family: monospace;
101
+ font-weight: 600;
102
+ }
103
+ </style>
@@ -0,0 +1,10 @@
1
+ interface Props {
2
+ method?: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH';
3
+ url?: string;
4
+ curl?: string;
5
+ responseStatus?: number;
6
+ class?: string;
7
+ }
8
+ declare const LiteApiPlayground: import("svelte").Component<Props, {}, "">;
9
+ type LiteApiPlayground = ReturnType<typeof LiteApiPlayground>;
10
+ export default LiteApiPlayground;
@@ -0,0 +1,120 @@
1
+ <script lang="ts">
2
+ interface ApprovalNode {
3
+ id: string;
4
+ title: string;
5
+ approver: string;
6
+ status: 'passed' | 'current' | 'pending';
7
+ mode?: 'serial' | 'parallel';
8
+ }
9
+
10
+ interface Props {
11
+ title?: string;
12
+ nodes?: ApprovalNode[];
13
+ class?: string;
14
+ }
15
+
16
+ let {
17
+ title = '业务审批流链条',
18
+ nodes = [
19
+ { id: 'n1', title: '发起申请', approver: '经办人 (王立)', status: 'passed' },
20
+ { id: 'n2', title: '部门负责人初审', approver: '业务主管 (张明)', status: 'passed' },
21
+ { id: 'n3', title: '财务合规复核', approver: '财务审计组', status: 'current', mode: 'parallel' },
22
+ { id: 'n4', title: '总经理终审', approver: '决策层审批人', status: 'pending' }
23
+ ],
24
+ class: className = '',
25
+ }: Props = $props();
26
+
27
+ function getNodeStyle(st: string): { badge: string; color: string; bg: string } {
28
+ switch (st) {
29
+ case 'passed': return { badge: '✓ 已通过', color: '#00b42a', bg: '#e8ffea' };
30
+ case 'current': return { badge: '● 进行中', color: '#165dff', bg: '#e8f3ff' };
31
+ default: return { badge: '○ 待审批', color: '#86909c', bg: '#f2f3f5' };
32
+ }
33
+ }
34
+ </script>
35
+
36
+ <div
37
+ class="lite-approval-chain {className}"
38
+ data-svadmin-component="LiteApprovalChainBuilder"
39
+ role="region"
40
+ aria-label="Approval Chain"
41
+ >
42
+ <header class="lite-chain-header">
43
+ <h4 class="lite-chain-title">{title}</h4>
44
+ <span class="lite-chain-total">{nodes.length} 级审批节点</span>
45
+ </header>
46
+
47
+ <div class="lite-chain-list">
48
+ {#each nodes as node, idx (node.id)}
49
+ {@const st = getNodeStyle(node.status)}
50
+ <div class="lite-chain-step">
51
+ <div class="lite-step-index">{idx + 1}</div>
52
+ <div class="lite-step-content">
53
+ <div class="lite-step-top">
54
+ <span class="lite-step-name">{node.title}</span>
55
+ <span class="lite-step-badge" style="color: {st.color}; background: {st.bg};">
56
+ {st.badge}
57
+ </span>
58
+ </div>
59
+ <div class="lite-step-approver">
60
+ 审批人: {node.approver}
61
+ {#if node.mode === 'parallel'}
62
+ <span class="lite-step-mode">或签 / 会签</span>
63
+ {/if}
64
+ </div>
65
+ </div>
66
+ </div>
67
+ {/each}
68
+ </div>
69
+ </div>
70
+
71
+ <style>
72
+ .lite-approval-chain {
73
+ border: 1px solid #e5e6eb;
74
+ border-radius: 6px;
75
+ background: #ffffff;
76
+ font-size: 12px;
77
+ overflow: hidden;
78
+ }
79
+ .lite-chain-header {
80
+ display: flex;
81
+ justify-content: space-between;
82
+ align-items: center;
83
+ padding: 10px 14px;
84
+ background: #f7f8fa;
85
+ border-bottom: 1px solid #e5e6eb;
86
+ }
87
+ .lite-chain-title { margin: 0; font-size: 13px; font-weight: 600; color: #1d2129; }
88
+ .lite-chain-total { font-size: 11px; color: #86909c; }
89
+ .lite-chain-list { padding: 12px 14px; }
90
+ .lite-chain-step {
91
+ display: flex;
92
+ align-items: flex-start;
93
+ padding-bottom: 12px;
94
+ margin-bottom: 12px;
95
+ border-bottom: 1px dashed #e5e6eb;
96
+ }
97
+ .lite-chain-step:last-child {
98
+ border-bottom: none;
99
+ padding-bottom: 0;
100
+ margin-bottom: 0;
101
+ }
102
+ .lite-step-index {
103
+ width: 20px;
104
+ height: 20px;
105
+ border-radius: 50%;
106
+ background: #165dff;
107
+ color: #ffffff;
108
+ display: flex;
109
+ align-items: center;
110
+ justify-content: center;
111
+ font-size: 11px;
112
+ font-weight: 700;
113
+ }
114
+ .lite-step-content { flex: 1; }
115
+ .lite-step-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2px; }
116
+ .lite-step-name { font-weight: 600; color: #1d2129; font-size: 12px; }
117
+ .lite-step-badge { font-size: 10px; font-weight: 600; padding: 2px 6px; border-radius: 3px; }
118
+ .lite-step-approver { font-size: 11px; color: #4e5969; }
119
+ .lite-step-mode { font-size: 10px; color: #86909c; margin-left: 6px; background: #f2f3f5; padding: 1px 4px; border-radius: 2px; }
120
+ </style>
@@ -0,0 +1,15 @@
1
+ interface ApprovalNode {
2
+ id: string;
3
+ title: string;
4
+ approver: string;
5
+ status: 'passed' | 'current' | 'pending';
6
+ mode?: 'serial' | 'parallel';
7
+ }
8
+ interface Props {
9
+ title?: string;
10
+ nodes?: ApprovalNode[];
11
+ class?: string;
12
+ }
13
+ declare const LiteApprovalChainBuilder: import("svelte").Component<Props, {}, "">;
14
+ type LiteApprovalChainBuilder = ReturnType<typeof LiteApprovalChainBuilder>;
15
+ export default LiteApprovalChainBuilder;
@@ -0,0 +1,166 @@
1
+ <script lang="ts">
2
+ export interface AuditEventItem {
3
+ id: string;
4
+ timestamp: string;
5
+ actor: { name: string; ip?: string; role?: string };
6
+ action: string;
7
+ actionLabel: string;
8
+ resource: string;
9
+ severity?: 'info' | 'warning' | 'critical';
10
+ status: 'success' | 'failure' | 'blocked';
11
+ traceId?: string;
12
+ }
13
+
14
+ interface Props {
15
+ events?: AuditEventItem[];
16
+ title?: string;
17
+ class?: string;
18
+ }
19
+
20
+ let {
21
+ events = [
22
+ {
23
+ id: 'evt-aud-1091',
24
+ timestamp: '2026-11-12 10:24:18',
25
+ actor: { name: '李思远 (运营主管)', ip: '192.168.10.42', role: 'SecOps Auditor' },
26
+ action: 'tenant_switch',
27
+ actionLabel: '切换工作区租户',
28
+ resource: 'TenantContext',
29
+ severity: 'info',
30
+ status: 'success',
31
+ traceId: 'trc-9821-fa44-a1',
32
+ },
33
+ {
34
+ id: 'evt-aud-1090',
35
+ timestamp: '2026-11-12 09:58:30',
36
+ actor: { name: '赵宏 (财务总监)', ip: '10.8.0.12', role: 'Finance Admin' },
37
+ action: 'permission_grant',
38
+ actionLabel: '跨组织提权审批',
39
+ resource: 'RolePermission',
40
+ severity: 'critical',
41
+ status: 'success',
42
+ traceId: 'trc-8820-cb91-e4',
43
+ },
44
+ ],
45
+ title = '全局操作审计追踪中心 (SSR 降级表格)',
46
+ class: className = '',
47
+ }: Props = $props();
48
+ </script>
49
+
50
+ <div
51
+ class="lite-audit-inspector {className}"
52
+ data-svadmin-component="LiteAuditTrailInspector"
53
+ role="region"
54
+ aria-label="Audit Trail Inspector"
55
+ >
56
+ <header class="lite-audit-header">
57
+ <div class="lite-audit-title-row">
58
+ <span class="lite-shield-icon">🛡️</span>
59
+ <h4 class="lite-audit-title">{title}</h4>
60
+ </div>
61
+ <span class="lite-audit-count">共 {events.length} 条审计日志</span>
62
+ </header>
63
+
64
+ <div class="lite-audit-table-wrap">
65
+ <table class="lite-audit-table">
66
+ <thead>
67
+ <tr>
68
+ <th>时间</th>
69
+ <th>操作人</th>
70
+ <th>动作与资源</th>
71
+ <th>级别</th>
72
+ <th>执行状态</th>
73
+ <th>追踪链路</th>
74
+ </tr>
75
+ </thead>
76
+ <tbody>
77
+ {#each events as evt (evt.id)}
78
+ <tr>
79
+ <td class="font-mono">{evt.timestamp}</td>
80
+ <td>
81
+ <span class="lite-actor-name">{evt.actor.name}</span>
82
+ {#if evt.actor.ip}<span class="lite-actor-ip font-mono">({evt.actor.ip})</span>{/if}
83
+ </td>
84
+ <td>
85
+ <span class="lite-action-label">{evt.actionLabel}</span>
86
+ <span class="lite-target-res">[{evt.resource}]</span>
87
+ </td>
88
+ <td>
89
+ <span
90
+ class="lite-sev-badge"
91
+ class:lite-sev-critical={evt.severity === 'critical'}
92
+ class:lite-sev-warning={evt.severity === 'warning'}
93
+ class:lite-sev-info={evt.severity === 'info'}
94
+ >
95
+ {evt.severity ?? 'info'}
96
+ </span>
97
+ </td>
98
+ <td>
99
+ <span
100
+ class="lite-status-badge"
101
+ class:lite-status-blocked={evt.status === 'blocked'}
102
+ class:lite-status-success={evt.status === 'success'}
103
+ >
104
+ {evt.status}
105
+ </span>
106
+ </td>
107
+ <td class="font-mono text-muted">{evt.traceId ?? '-'}</td>
108
+ </tr>
109
+ {/each}
110
+ </tbody>
111
+ </table>
112
+ </div>
113
+ </div>
114
+
115
+ <style>
116
+ .lite-audit-inspector {
117
+ border: 1px solid #e5e6eb;
118
+ border-radius: 6px;
119
+ background: #ffffff;
120
+ font-size: 12px;
121
+ overflow: hidden;
122
+ }
123
+ .lite-audit-header {
124
+ display: flex;
125
+ justify-content: space-between;
126
+ align-items: center;
127
+ padding: 10px 14px;
128
+ background: #f7f8fa;
129
+ border-bottom: 1px solid #e5e6eb;
130
+ }
131
+ .lite-audit-title-row { display: flex; align-items: center; }
132
+ .lite-shield-icon { font-size: 14px; margin-right: 6px; }
133
+ .lite-audit-title { margin: 0; font-size: 13px; font-weight: 600; color: #1d2129; }
134
+ .lite-audit-count { font-size: 11px; color: #86909c; }
135
+ .lite-audit-table-wrap { overflow-x: auto; }
136
+ .lite-audit-table {
137
+ width: 100%;
138
+ border-collapse: collapse;
139
+ font-size: 12px;
140
+ text-align: left;
141
+ }
142
+ .lite-audit-table th, .lite-audit-table td {
143
+ padding: 8px 12px;
144
+ border-bottom: 1px solid #f2f3f5;
145
+ }
146
+ .lite-audit-table th { background: #fafafa; font-weight: 600; color: #4e5969; font-size: 11px; }
147
+ .font-mono { font-family: monospace; font-size: 11px; }
148
+ .text-muted { color: #86909c; }
149
+ .lite-actor-name { font-weight: 500; color: #1d2129; }
150
+ .lite-actor-ip { font-size: 10px; color: #86909c; margin-left: 4px; }
151
+ .lite-action-label { font-weight: 500; color: #165dff; }
152
+ .lite-target-res { font-size: 10px; color: #86909c; margin-left: 4px; }
153
+ .lite-sev-badge {
154
+ font-size: 10px;
155
+ padding: 1px 4px;
156
+ border-radius: 2px;
157
+ text-transform: uppercase;
158
+ font-weight: 600;
159
+ }
160
+ .lite-sev-critical { background: #ffece8; color: #f53f3f; }
161
+ .lite-sev-warning { background: #fff7e8; color: #ff7d00; }
162
+ .lite-sev-info { background: #e8f3ff; color: #165dff; }
163
+ .lite-status-badge { font-size: 11px; font-weight: 500; }
164
+ .lite-status-success { color: #00b42a; }
165
+ .lite-status-blocked { color: #f53f3f; font-weight: 600; }
166
+ </style>
@@ -0,0 +1,23 @@
1
+ export interface AuditEventItem {
2
+ id: string;
3
+ timestamp: string;
4
+ actor: {
5
+ name: string;
6
+ ip?: string;
7
+ role?: string;
8
+ };
9
+ action: string;
10
+ actionLabel: string;
11
+ resource: string;
12
+ severity?: 'info' | 'warning' | 'critical';
13
+ status: 'success' | 'failure' | 'blocked';
14
+ traceId?: string;
15
+ }
16
+ interface Props {
17
+ events?: AuditEventItem[];
18
+ title?: string;
19
+ class?: string;
20
+ }
21
+ declare const LiteAuditTrailInspector: import("svelte").Component<Props, {}, "">;
22
+ type LiteAuditTrailInspector = ReturnType<typeof LiteAuditTrailInspector>;
23
+ export default LiteAuditTrailInspector;
@@ -0,0 +1,100 @@
1
+ <script lang="ts">
2
+ interface BillItem {
3
+ name: string;
4
+ amount: string | number;
5
+ }
6
+
7
+ interface Props {
8
+ invoiceNo?: string;
9
+ period?: string;
10
+ totalAmount?: string | number;
11
+ status?: string;
12
+ items?: BillItem[];
13
+ downloadUrl?: string;
14
+ class?: string;
15
+ }
16
+
17
+ let {
18
+ invoiceNo = 'INV-202611-001',
19
+ period = '2026-10',
20
+ totalAmount = '¥12,500',
21
+ status = 'paid',
22
+ items = [
23
+ { name: 'SaaS Monthly License', amount: '¥10,000' },
24
+ { name: 'Extra Storage Usage', amount: '¥2,500' },
25
+ ],
26
+ downloadUrl,
27
+ class: className = '',
28
+ }: Props = $props();
29
+ </script>
30
+
31
+ <div
32
+ class="lite-invoice-card {className}"
33
+ data-svadmin-component="LiteBillingInvoiceDrawer"
34
+ role="region"
35
+ aria-label="Billing Invoice Details"
36
+ >
37
+ <header class="lite-inv-header">
38
+ <div>
39
+ <span class="lite-inv-no">账单 #{invoiceNo}</span>
40
+ <span class="lite-inv-period">({period})</span>
41
+ </div>
42
+ <span class="lite-inv-status lite-status-{status.toLowerCase()}">{status.toUpperCase()}</span>
43
+ </header>
44
+
45
+ <div class="lite-inv-body">
46
+ <div class="lite-inv-total">
47
+ <span class="lite-total-label">结算总金额:</span>
48
+ <strong class="lite-total-val">{totalAmount}</strong>
49
+ </div>
50
+
51
+ {#if items.length > 0}
52
+ <ul class="lite-inv-items">
53
+ {#each items as item (item.name)}
54
+ <li>
55
+ <span>{item.name}</span>
56
+ <span class="lite-item-amt">{item.amount}</span>
57
+ </li>
58
+ {/each}
59
+ </ul>
60
+ {/if}
61
+
62
+ {#if downloadUrl}
63
+ <div class="lite-inv-action">
64
+ <a href={downloadUrl} class="lite-inv-download">下载发票 (PDF)</a>
65
+ </div>
66
+ {/if}
67
+ </div>
68
+ </div>
69
+
70
+ <style>
71
+ .lite-invoice-card {
72
+ border: 1px solid #e5e6eb;
73
+ border-radius: 6px;
74
+ background: #ffffff;
75
+ font-size: 12px;
76
+ overflow: hidden;
77
+ }
78
+ .lite-inv-header {
79
+ display: flex;
80
+ justify-content: space-between;
81
+ align-items: center;
82
+ padding: 10px 14px;
83
+ background: #f7f8fa;
84
+ border-bottom: 1px solid #e5e6eb;
85
+ }
86
+ .lite-inv-no { font-weight: 700; font-family: monospace; color: #1d2129; }
87
+ .lite-inv-period { color: #86909c; font-size: 11px; margin-left: 4px; }
88
+ .lite-inv-status { font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 3px; font-family: monospace; }
89
+ .lite-status-paid { background: #e8ffea; color: #00b42a; }
90
+ .lite-status-pending { background: #fff7e8; color: #ff7d00; }
91
+ .lite-inv-body { padding: 12px 14px; }
92
+ .lite-inv-total { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px dashed #e5e6eb; }
93
+ .lite-total-label { color: #4e5969; }
94
+ .lite-total-val { font-size: 16px; color: #165dff; font-family: monospace; }
95
+ .lite-inv-items { list-style: none; margin: 0 0 10px; padding: 0; }
96
+ .lite-inv-items li { display: flex; justify-content: space-between; padding: 4px 0; color: #4e5969; font-size: 11px; }
97
+ .lite-item-amt { font-family: monospace; font-weight: 600; color: #1d2129; }
98
+ .lite-inv-action { text-align: right; margin-top: 8px; }
99
+ .lite-inv-download { display: inline-block; padding: 4px 10px; background: #165dff; color: #ffffff; text-decoration: none; border-radius: 4px; font-weight: 500; font-size: 11px; }
100
+ </style>