@svadmin/ui 0.129.0 → 0.131.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.
Files changed (91) hide show
  1. package/dist/app.css +403 -0
  2. package/dist/app.theme.css +403 -0
  3. package/dist/components/AboutSettings.svelte +1 -1
  4. package/dist/components/AccessRevocationMatrix.svelte +425 -0
  5. package/dist/components/AccessRevocationMatrix.svelte.d.ts +27 -0
  6. package/dist/components/AudioVisualInspector.svelte +458 -0
  7. package/dist/components/AudioVisualInspector.svelte.d.ts +53 -0
  8. package/dist/components/AuditSnapshotCapture.svelte +328 -0
  9. package/dist/components/AuditSnapshotCapture.svelte.d.ts +28 -0
  10. package/dist/components/CannedResponsePicker.svelte +257 -0
  11. package/dist/components/CannedResponsePicker.svelte.d.ts +22 -0
  12. package/dist/components/ContentModerationCenter.svelte +166 -0
  13. package/dist/components/ContentModerationCenter.svelte.d.ts +11 -0
  14. package/dist/components/ContractClauseDiffViewer.svelte +566 -0
  15. package/dist/components/ContractClauseDiffViewer.svelte.d.ts +53 -0
  16. package/dist/components/DataImportPipeline.svelte +577 -0
  17. package/dist/components/DataImportPipeline.svelte.d.ts +35 -0
  18. package/dist/components/DataRetentionPolicyEditor.svelte +455 -0
  19. package/dist/components/DataRetentionPolicyEditor.svelte.d.ts +10 -0
  20. package/dist/components/ElectronicSealInspector.svelte +450 -0
  21. package/dist/components/ElectronicSealInspector.svelte.d.ts +72 -0
  22. package/dist/components/EmployeeOffboardingAuditor.svelte +405 -0
  23. package/dist/components/EmployeeOffboardingAuditor.svelte.d.ts +39 -0
  24. package/dist/components/FeatureFlagStudio.svelte +583 -0
  25. package/dist/components/FeatureFlagStudio.svelte.d.ts +12 -0
  26. package/dist/components/FieldMappingBuilder.svelte +393 -0
  27. package/dist/components/FieldMappingBuilder.svelte.d.ts +39 -0
  28. package/dist/components/GatewayRouteEditor.svelte +493 -0
  29. package/dist/components/GatewayRouteEditor.svelte.d.ts +34 -0
  30. package/dist/components/HotkeysHelpModal.svelte +286 -0
  31. package/dist/components/HotkeysHelpModal.svelte.d.ts +21 -0
  32. package/dist/components/I18nStudio.svelte +635 -0
  33. package/dist/components/I18nStudio.svelte.d.ts +23 -0
  34. package/dist/components/IpAccessRuleEditor.svelte +290 -0
  35. package/dist/components/IpAccessRuleEditor.svelte.d.ts +19 -0
  36. package/dist/components/IpWhitelistDrawer.svelte +94 -0
  37. package/dist/components/IpWhitelistDrawer.svelte.d.ts +10 -0
  38. package/dist/components/MediaAuthenticityAuditCard.svelte +357 -0
  39. package/dist/components/MediaAuthenticityAuditCard.svelte.d.ts +64 -0
  40. package/dist/components/MediaGallery.svelte +575 -0
  41. package/dist/components/MediaGallery.svelte.d.ts +34 -0
  42. package/dist/components/NotificationCenter.svelte +20 -1
  43. package/dist/components/NotificationCenter.svelte.d.ts +2 -0
  44. package/dist/components/NotificationDrawer.svelte +242 -0
  45. package/dist/components/NotificationDrawer.svelte.d.ts +40 -0
  46. package/dist/components/PrintDocument.svelte +95 -0
  47. package/dist/components/PrintDocument.svelte.d.ts +10 -0
  48. package/dist/components/PrintPreviewModal.svelte +52 -0
  49. package/dist/components/PrintPreviewModal.svelte.d.ts +11 -0
  50. package/dist/components/PrintTemplateDesigner.svelte +280 -0
  51. package/dist/components/PrintTemplateDesigner.svelte.d.ts +11 -0
  52. package/dist/components/RateLimitPolicyPanel.svelte +369 -0
  53. package/dist/components/RateLimitPolicyPanel.svelte.d.ts +29 -0
  54. package/dist/components/ResizableSplitter.svelte +246 -0
  55. package/dist/components/ResizableSplitter.svelte.d.ts +18 -0
  56. package/dist/components/SensitiveWordAuditor.svelte +368 -0
  57. package/dist/components/SensitiveWordAuditor.svelte.d.ts +9 -0
  58. package/dist/components/ServiceDeskTicketCard.svelte +297 -0
  59. package/dist/components/ServiceDeskTicketCard.svelte.d.ts +52 -0
  60. package/dist/components/ShiftScheduler.svelte +490 -0
  61. package/dist/components/ShiftScheduler.svelte.d.ts +50 -0
  62. package/dist/components/SslCertificateMonitorCard.svelte +309 -0
  63. package/dist/components/SslCertificateMonitorCard.svelte.d.ts +30 -0
  64. package/dist/components/SsoConnectionStudio.svelte +784 -0
  65. package/dist/components/SsoConnectionStudio.svelte.d.ts +44 -0
  66. package/dist/components/SsoSpMetadataPanel.svelte +44 -0
  67. package/dist/components/SsoSpMetadataPanel.svelte.d.ts +8 -0
  68. package/dist/components/StepUpAuthModal.svelte +448 -0
  69. package/dist/components/StepUpAuthModal.svelte.d.ts +26 -0
  70. package/dist/components/TrafficTopologyInspector.svelte +361 -0
  71. package/dist/components/TrafficTopologyInspector.svelte.d.ts +43 -0
  72. package/dist/components/ip-access-rules.d.ts +24 -0
  73. package/dist/components/ip-access-rules.js +110 -0
  74. package/dist/components/moderation-utils.d.ts +45 -0
  75. package/dist/components/moderation-utils.js +74 -0
  76. package/dist/components/print-document.d.ts +3 -0
  77. package/dist/components/print-document.js +65 -0
  78. package/dist/components/print-utils.d.ts +44 -0
  79. package/dist/components/print-utils.js +68 -0
  80. package/dist/components/retention-utils.d.ts +31 -0
  81. package/dist/components/retention-utils.js +38 -0
  82. package/dist/components/sso-connection-presets.d.ts +2 -0
  83. package/dist/components/sso-connection-presets.js +59 -0
  84. package/dist/components/ui/sheet/sheet.svelte +3 -1
  85. package/dist/components/ui/sheet/sheet.svelte.d.ts +1 -0
  86. package/dist/components/useFeatureFlag.d.svelte.ts +1 -0
  87. package/dist/components/useFeatureFlag.svelte.d.ts +45 -0
  88. package/dist/components/useFeatureFlag.svelte.js +94 -0
  89. package/dist/index.d.ts +35 -0
  90. package/dist/index.js +53 -0
  91. package/package.json +5 -4
@@ -11,7 +11,7 @@
11
11
  const resources = $derived(adminContext.resources.filter((resource) => resource.meta?.['aboutVisible'] !== false));
12
12
  const providerNames = $derived(adminContext.getDataProviderNames());
13
13
  let { version: suppliedVersion, headingLevel = 'h1' }: { version?: string; headingLevel?: 'h1' | 'h2' } = $props();
14
- const buildVersion = "0.129.0";
14
+ const buildVersion = "0.131.0";
15
15
  const version = $derived(suppliedVersion ?? (
16
16
  buildVersion.startsWith('__')
17
17
  ? (i18n.locale === 'zh-CN' ? '开发构建(未提供版本)' : 'Development build (version unavailable)')
@@ -0,0 +1,425 @@
1
+ <script lang="ts">
2
+ import { untrack } from 'svelte';
3
+ export type SystemType = 'cloud' | 'code' | 'vpn' | 'im' | 'database' | 'finance';
4
+ export type PrivilegeLevel = 'superadmin' | 'admin' | 'write' | 'read';
5
+ export type RevocationStatus = 'active' | 'revoking' | 'revoked' | 'failed';
6
+
7
+ export interface TargetSystemAccess {
8
+ id: string;
9
+ systemName: string;
10
+ systemType: SystemType;
11
+ accountIdentifier: string;
12
+ privilegeLevel: PrivilegeLevel;
13
+ status: RevocationStatus;
14
+ lastAccessedAt?: string;
15
+ revokedAt?: string;
16
+ failureReason?: string;
17
+ }
18
+
19
+ interface Props {
20
+ employeeId: string;
21
+ employeeName: string;
22
+ systems?: TargetSystemAccess[];
23
+ batchRevoking?: boolean;
24
+ onRevokeSingle?: (systemId: string) => void;
25
+ onRevokeBatch?: (systemIds: string[]) => void;
26
+ onRetryFailed?: (systemId: string) => void;
27
+ onAuditLogExport?: () => void;
28
+ }
29
+
30
+ const {
31
+ employeeId,
32
+ employeeName,
33
+ systems = [],
34
+ batchRevoking = false,
35
+ onRevokeSingle,
36
+ onRevokeBatch,
37
+ onRetryFailed,
38
+ onAuditLogExport,
39
+ }: Props = $props();
40
+
41
+ let selectedSystemIds = $state<string[]>([]);
42
+ let showBatchConfirm = $state(false);
43
+ let confirmationEmployeeId = $state<string | null>(null);
44
+ let confirmationIds = $state<string[]>([]);
45
+ let observedEmployeeId = untrack(() => employeeId);
46
+ const eligibleIds = $derived(systems.filter(system => system.status === 'active' || system.status === 'failed')
47
+ .map(system => system.id));
48
+ $effect.pre(() => {
49
+ if (employeeId !== observedEmployeeId) {
50
+ observedEmployeeId = employeeId;
51
+ selectedSystemIds = [];
52
+ showBatchConfirm = false;
53
+ confirmationEmployeeId = null;
54
+ confirmationIds = [];
55
+ return;
56
+ }
57
+ const stillEligible = selectedSystemIds.filter(id => eligibleIds.includes(id));
58
+ if (stillEligible.length !== selectedSystemIds.length) {
59
+ selectedSystemIds = stillEligible;
60
+ showBatchConfirm = false;
61
+ }
62
+ });
63
+
64
+ const totalCount = $derived(systems.length);
65
+ const revokedCount = $derived(systems.filter((s) => s.status === 'revoked').length);
66
+ const failedCount = $derived(systems.filter((s) => s.status === 'failed').length);
67
+ const superadminCount = $derived(systems.filter((s) => s.privilegeLevel === 'superadmin').length);
68
+ const pendingRevocationCount = $derived(
69
+ systems.filter((s) => s.status === 'active' || s.status === 'failed').length,
70
+ );
71
+
72
+ const revokedPercentage = $derived(
73
+ totalCount === 0 ? 100 : Math.round((revokedCount / totalCount) * 100),
74
+ );
75
+
76
+ function getSystemTypeLabel(type: SystemType): string {
77
+ switch (type) {
78
+ case 'cloud':
79
+ return '云基础设施';
80
+ case 'code':
81
+ return '代码仓库';
82
+ case 'vpn':
83
+ return '网络网关';
84
+ case 'database':
85
+ return '生产数据库';
86
+ case 'im':
87
+ return '协同办公';
88
+ case 'finance':
89
+ return '财务ERP';
90
+ default:
91
+ return type;
92
+ }
93
+ }
94
+
95
+ function getPrivilegeBadgeClass(level: PrivilegeLevel): string {
96
+ switch (level) {
97
+ case 'superadmin':
98
+ return 'bg-destructive/15 text-destructive border-destructive/30 font-semibold';
99
+ case 'admin':
100
+ return 'bg-warning/15 text-warning dark:text-warning border-warning/30';
101
+ case 'write':
102
+ return 'bg-primary/10 text-primary border-primary/20';
103
+ case 'read':
104
+ default:
105
+ return 'bg-muted text-muted-foreground border-border/50';
106
+ }
107
+ }
108
+
109
+ function getPrivilegeLabel(level: PrivilegeLevel): string {
110
+ switch (level) {
111
+ case 'superadmin':
112
+ return '超级管理员 (Root)';
113
+ case 'admin':
114
+ return '运维管理员';
115
+ case 'write':
116
+ return '读写权限';
117
+ case 'read':
118
+ default:
119
+ return '只读授权';
120
+ }
121
+ }
122
+
123
+ function getStatusBadge(status: RevocationStatus) {
124
+ switch (status) {
125
+ case 'revoked':
126
+ return {
127
+ label: '已回收注销',
128
+ className: 'bg-success/15 text-success dark:text-success border-success/30',
129
+ };
130
+ case 'revoking':
131
+ return {
132
+ label: '回收注销中...',
133
+ className: 'bg-info/15 text-info dark:text-info border-info/30 animate-pulse',
134
+ };
135
+ case 'failed':
136
+ return {
137
+ label: '回收失败',
138
+ className: 'bg-destructive/15 text-destructive border-destructive/30 font-bold',
139
+ };
140
+ case 'active':
141
+ default:
142
+ return {
143
+ label: '特权活跃中',
144
+ className: 'bg-warning/15 text-warning dark:text-warning border-warning/30',
145
+ };
146
+ }
147
+ }
148
+
149
+ function toggleSelect(id: string) {
150
+ if (batchRevoking || !eligibleIds.includes(id)) return;
151
+ showBatchConfirm = false;
152
+ if (selectedSystemIds.includes(id)) {
153
+ selectedSystemIds = selectedSystemIds.filter((item) => item !== id);
154
+ } else {
155
+ selectedSystemIds = [...selectedSystemIds, id];
156
+ }
157
+ }
158
+
159
+ function toggleSelectAll() {
160
+ if (batchRevoking) return;
161
+ showBatchConfirm = false;
162
+ if (selectedSystemIds.length === eligibleIds.length) {
163
+ selectedSystemIds = [];
164
+ } else {
165
+ selectedSystemIds = [...eligibleIds];
166
+ }
167
+ }
168
+
169
+ function handleBatchRevokeTrigger() {
170
+ if (selectedSystemIds.length === 0 || batchRevoking || !onRevokeBatch) return;
171
+ confirmationEmployeeId = employeeId;
172
+ confirmationIds = [...selectedSystemIds];
173
+ showBatchConfirm = true;
174
+ }
175
+
176
+ function confirmBatchRevoke() {
177
+ if (!showBatchConfirm || batchRevoking || !onRevokeBatch || confirmationEmployeeId !== employeeId
178
+ || confirmationIds.length === 0 || !confirmationIds.every(id => eligibleIds.includes(id))) return;
179
+ const approvedIds = [...confirmationIds];
180
+ showBatchConfirm = false;
181
+ selectedSystemIds = [];
182
+ confirmationIds = [];
183
+ onRevokeBatch(approvedIds);
184
+ }
185
+
186
+ function requestSingle(systemId: string) {
187
+ if (batchRevoking) return;
188
+ const system = systems.find(candidate => candidate.id === systemId);
189
+ if (system?.status === 'failed') onRetryFailed?.(systemId);
190
+ else if (system?.status === 'active') onRevokeSingle?.(systemId);
191
+ }
192
+ </script>
193
+
194
+ <div
195
+ class="flex flex-col gap-5 rounded-xl border border-border/80 bg-card p-6 text-card-foreground shadow-sm transition-all"
196
+ data-svadmin-component="AccessRevocationMatrix"
197
+ >
198
+ <!-- 头部特权回收与合规风险总览卡片 -->
199
+ <header class="flex flex-col gap-4 rounded-lg border border-border/60 bg-muted/20 p-5 md:flex-row md:items-center md:justify-between">
200
+ <div class="flex flex-col gap-1.5">
201
+ <div class="flex items-center gap-2">
202
+ <h2 class="text-base font-semibold tracking-tight">企业级特权访问权限回收矩阵</h2>
203
+ <span class="rounded bg-primary/10 px-2 py-0.5 text-xs font-medium text-primary">
204
+ 合规降权防泄密
205
+ </span>
206
+ </div>
207
+ <div class="flex flex-wrap items-center gap-3 text-xs text-muted-foreground">
208
+ <span>被审计离职人: <strong class="font-medium text-foreground">{employeeName}</strong></span>
209
+ <span>员工工号: <code class="rounded bg-muted px-1.5 py-0.5 font-mono">{employeeId}</code></span>
210
+ <span>待回收系统数: <strong class="text-warning dark:text-warning">{pendingRevocationCount}</strong></span>
211
+ </div>
212
+ </div>
213
+
214
+ <!-- 核心统计徽章条 -->
215
+ <div class="grid grid-cols-2 gap-3 sm:grid-cols-4">
216
+ <div class="flex flex-col rounded border border-border/60 bg-background p-2.5 text-center">
217
+ <span class="text-[11px] text-muted-foreground">总受管系统</span>
218
+ <span class="text-base font-bold tabular-nums text-foreground">{totalCount}</span>
219
+ </div>
220
+ <div class="flex flex-col rounded border border-border/60 bg-background p-2.5 text-center">
221
+ <span class="text-[11px] text-muted-foreground">超管权限</span>
222
+ <span class="text-base font-bold tabular-nums text-destructive">{superadminCount}</span>
223
+ </div>
224
+ <div class="flex flex-col rounded border border-border/60 bg-background p-2.5 text-center">
225
+ <span class="text-[11px] text-muted-foreground">回收完成率</span>
226
+ <span class="text-base font-bold tabular-nums text-success dark:text-success">{revokedPercentage}%</span>
227
+ </div>
228
+ <div class="flex flex-col rounded border border-border/60 bg-background p-2.5 text-center">
229
+ <span class="text-[11px] text-muted-foreground">回收失败</span>
230
+ <span class="text-base font-bold tabular-nums {failedCount > 0 ? 'text-destructive font-extrabold' : 'text-muted-foreground'}">
231
+ {failedCount}
232
+ </span>
233
+ </div>
234
+ </div>
235
+ </header>
236
+
237
+ <!-- 操作动作栏 -->
238
+ <div class="flex flex-wrap items-center justify-between gap-3 border-b border-border/40 pb-3">
239
+ <div class="flex items-center gap-3">
240
+ <button
241
+ type="button"
242
+ class="inline-flex items-center gap-1.5 text-xs font-medium text-muted-foreground hover:text-foreground"
243
+ onclick={toggleSelectAll}
244
+ disabled={batchRevoking}
245
+ >
246
+ <span class="flex h-3.5 w-3.5 items-center justify-center rounded border border-border bg-background">
247
+ {#if selectedSystemIds.length > 0 && selectedSystemIds.length === eligibleIds.length}
248
+ ✓
249
+ {/if}
250
+ </span>
251
+ 全选待回收系统
252
+ </button>
253
+
254
+ {#if selectedSystemIds.length > 0}
255
+ <span class="text-xs text-muted-foreground">
256
+ 已选择 <strong class="text-foreground">{selectedSystemIds.length}</strong> 项
257
+ </span>
258
+ {/if}
259
+ </div>
260
+
261
+ <div class="flex items-center gap-2">
262
+ <button
263
+ type="button"
264
+ class="inline-flex items-center gap-1.5 rounded-md border border-border/70 bg-background px-3 py-1.5 text-xs font-medium text-foreground shadow-xs transition-colors hover:bg-muted/80 focus:outline-hidden"
265
+ onclick={onAuditLogExport}
266
+ >
267
+ <svg class="h-3.5 w-3.5 text-muted-foreground" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
268
+ <path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" />
269
+ <polyline points="14 2 14 8 20 8" />
270
+ <line x1="16" y1="13" x2="8" y2="13" />
271
+ <line x1="16" y1="17" x2="8" y2="17" />
272
+ <polyline points="10 9 9 9 8 9" />
273
+ </svg>
274
+ 导出权限清退留痕审计书
275
+ </button>
276
+
277
+ <button
278
+ type="button"
279
+ class="inline-flex items-center gap-1.5 rounded-md bg-destructive px-3.5 py-1.5 text-xs font-semibold text-destructive-foreground shadow-xs transition-colors hover:bg-destructive/90 disabled:opacity-50"
280
+ disabled={selectedSystemIds.length === 0 || batchRevoking || !onRevokeBatch}
281
+ onclick={handleBatchRevokeTrigger}
282
+ >
283
+ <svg class="h-3.5 w-3.5" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
284
+ <path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z" />
285
+ </svg>
286
+ {batchRevoking ? '注销批量执行中...' : `一键批量注销 (${selectedSystemIds.length})`}
287
+ </button>
288
+ </div>
289
+ </div>
290
+
291
+ <!-- 特权系统矩阵列表表格 -->
292
+ <div class="overflow-x-auto rounded-lg border border-border/60 bg-background">
293
+ <table class="w-full text-left text-xs">
294
+ <thead class="border-b border-border/60 bg-muted/40 text-muted-foreground">
295
+ <tr>
296
+ <th class="w-10 px-4 py-3 text-center">选择</th>
297
+ <th class="px-4 py-3">受管系统与分类</th>
298
+ <th class="px-4 py-3">登录账号 / Token 标识</th>
299
+ <th class="px-4 py-3">特权等级</th>
300
+ <th class="px-4 py-3">当前状态</th>
301
+ <th class="px-4 py-3">最近访问 / 回收时间</th>
302
+ <th class="px-4 py-3 text-right">安全操作</th>
303
+ </tr>
304
+ </thead>
305
+ <tbody class="divide-y divide-border/40">
306
+ {#if systems.length === 0}
307
+ <tr>
308
+ <td colspan="7" class="py-10 text-center text-xs text-muted-foreground">
309
+ 未检索到该员工绑定的任何受管系统权限
310
+ </td>
311
+ </tr>
312
+ {:else}
313
+ {#each systems as system (system.id)}
314
+ {@const statusMeta = getStatusBadge(system.status)}
315
+ <tr class="transition-colors hover:bg-muted/10">
316
+ <td class="px-4 py-3 text-center">
317
+ <input
318
+ type="checkbox"
319
+ class="h-4 w-4 rounded border-border"
320
+ disabled={!eligibleIds.includes(system.id) || batchRevoking}
321
+ checked={selectedSystemIds.includes(system.id)}
322
+ onchange={() => toggleSelect(system.id)}
323
+ />
324
+ </td>
325
+ <td class="px-4 py-3">
326
+ <div class="flex flex-col">
327
+ <span class="font-semibold text-foreground">{system.systemName}</span>
328
+ <span class="text-[11px] text-muted-foreground">{getSystemTypeLabel(system.systemType)}</span>
329
+ </div>
330
+ </td>
331
+ <td class="px-4 py-3 font-mono text-muted-foreground">
332
+ {system.accountIdentifier}
333
+ </td>
334
+ <td class="px-4 py-3">
335
+ <span class="rounded-full border px-2 py-0.5 text-[11px] {getPrivilegeBadgeClass(system.privilegeLevel)}">
336
+ {getPrivilegeLabel(system.privilegeLevel)}
337
+ </span>
338
+ </td>
339
+ <td class="px-4 py-3">
340
+ <span class="rounded-full border px-2 py-0.5 text-[11px] {statusMeta.className}">
341
+ {statusMeta.label}
342
+ </span>
343
+ {#if system.status === 'failed' && system.failureReason}
344
+ <div class="mt-1 text-[11px] text-destructive">
345
+ 失败原因: {system.failureReason}
346
+ </div>
347
+ {/if}
348
+ </td>
349
+ <td class="px-4 py-3 text-muted-foreground">
350
+ {#if system.status === 'revoked' && system.revokedAt}
351
+ <span class="text-success dark:text-success">已于 {system.revokedAt} 回收</span>
352
+ {:else if system.lastAccessedAt}
353
+ <span>活跃于: {system.lastAccessedAt}</span>
354
+ {:else}
355
+ <span>-</span>
356
+ {/if}
357
+ </td>
358
+ <td class="px-4 py-3 text-right">
359
+ {#if system.status === 'failed'}
360
+ <button
361
+ type="button"
362
+ class="rounded border border-destructive/40 bg-destructive/10 px-2.5 py-1 text-xs font-medium text-destructive transition-colors hover:bg-destructive/20"
363
+ disabled={batchRevoking || !onRetryFailed}
364
+ onclick={() => requestSingle(system.id)}
365
+ >
366
+ 重试回收
367
+ </button>
368
+ {:else if system.status === 'active'}
369
+ <button
370
+ type="button"
371
+ class="rounded border border-border/80 bg-background px-2.5 py-1 text-xs font-medium text-foreground transition-colors hover:bg-destructive/10 hover:text-destructive"
372
+ disabled={batchRevoking || !onRevokeSingle}
373
+ onclick={() => requestSingle(system.id)}
374
+ >
375
+ 注销回收
376
+ </button>
377
+ {:else if system.status === 'revoking'}
378
+ <span class="text-xs text-muted-foreground">回收执行中</span>
379
+ {:else}
380
+ <span class="text-xs text-success dark:text-success">✓ 权限已终结</span>
381
+ {/if}
382
+ </td>
383
+ </tr>
384
+ {/each}
385
+ {/if}
386
+ </tbody>
387
+ </table>
388
+ </div>
389
+
390
+ <!-- 批量回收高危确认弹窗 Modal -->
391
+ {#if showBatchConfirm}
392
+ <div class="fixed inset-0 z-50 flex items-center justify-center bg-background/80 backdrop-blur-xs">
393
+ <div class="w-full max-w-md rounded-xl border border-border bg-card p-6 shadow-xl">
394
+ <div class="flex items-center gap-2 text-destructive">
395
+ <svg class="h-5 w-5" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
396
+ <path d="M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z" />
397
+ <line x1="12" y1="9" x2="12" y2="13" />
398
+ <line x1="12" y1="17" x2="12.01" y2="17" />
399
+ </svg>
400
+ <h3 class="text-base font-semibold">确认批量注销回收特权账号?</h3>
401
+ </div>
402
+ <p class="mt-2 text-xs text-muted-foreground">
403
+ 即将请求注销选中的 <strong>{confirmationIds.length}</strong> 个系统。实际会话清退、密钥轮转与审计留痕以宿主系统的执行结果为准。
404
+ </p>
405
+ <div class="mt-4 flex justify-end gap-2">
406
+ <button
407
+ type="button"
408
+ class="rounded-md border border-border bg-background px-3 py-1.5 text-xs font-medium text-foreground hover:bg-muted"
409
+ onclick={() => (showBatchConfirm = false)}
410
+ >
411
+ 取消
412
+ </button>
413
+ <button
414
+ type="button"
415
+ class="rounded-md bg-destructive px-3.5 py-1.5 text-xs font-medium text-destructive-foreground hover:bg-destructive/90"
416
+ onclick={confirmBatchRevoke}
417
+ disabled={batchRevoking || !onRevokeBatch}
418
+ >
419
+ 确认执行注销
420
+ </button>
421
+ </div>
422
+ </div>
423
+ </div>
424
+ {/if}
425
+ </div>
@@ -0,0 +1,27 @@
1
+ export type SystemType = 'cloud' | 'code' | 'vpn' | 'im' | 'database' | 'finance';
2
+ export type PrivilegeLevel = 'superadmin' | 'admin' | 'write' | 'read';
3
+ export type RevocationStatus = 'active' | 'revoking' | 'revoked' | 'failed';
4
+ export interface TargetSystemAccess {
5
+ id: string;
6
+ systemName: string;
7
+ systemType: SystemType;
8
+ accountIdentifier: string;
9
+ privilegeLevel: PrivilegeLevel;
10
+ status: RevocationStatus;
11
+ lastAccessedAt?: string;
12
+ revokedAt?: string;
13
+ failureReason?: string;
14
+ }
15
+ interface Props {
16
+ employeeId: string;
17
+ employeeName: string;
18
+ systems?: TargetSystemAccess[];
19
+ batchRevoking?: boolean;
20
+ onRevokeSingle?: (systemId: string) => void;
21
+ onRevokeBatch?: (systemIds: string[]) => void;
22
+ onRetryFailed?: (systemId: string) => void;
23
+ onAuditLogExport?: () => void;
24
+ }
25
+ declare const AccessRevocationMatrix: import("svelte").Component<Props, {}, "">;
26
+ type AccessRevocationMatrix = ReturnType<typeof AccessRevocationMatrix>;
27
+ export default AccessRevocationMatrix;