@burdenoff/microfe-security 2026.624.2 → 2026.625.2
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/security/components/PageLayout.js +35 -18
- package/dist/security/components/PageLayout.js.map +1 -1
- package/dist/security/components/SecurityScoreCard.js +29 -27
- package/dist/security/components/SecurityScoreCard.js.map +1 -1
- package/dist/security/components/VaultCard.js +8 -1
- package/dist/security/components/VaultCard.js.map +1 -1
- package/dist/security/components/ui.js +9 -17
- package/dist/security/components/ui.js.map +1 -1
- package/dist/security/pages/AccessReviewPage.js +42 -42
- package/dist/security/pages/AccessReviewPage.js.map +1 -1
- package/dist/security/pages/AuditLogPage.js +63 -62
- package/dist/security/pages/AuditLogPage.js.map +1 -1
- package/dist/security/pages/ProviderDetailPage.js +125 -127
- package/dist/security/pages/ProviderDetailPage.js.map +1 -1
- package/dist/security/pages/ProvidersPage.js +130 -125
- package/dist/security/pages/ProvidersPage.js.map +1 -1
- package/dist/security/pages/SecretCreatePage.js +73 -68
- package/dist/security/pages/SecretCreatePage.js.map +1 -1
- package/dist/security/pages/SecretDetailPage.js +141 -149
- package/dist/security/pages/SecretDetailPage.js.map +1 -1
- package/dist/security/pages/SecurityDashboardPage.js +92 -85
- package/dist/security/pages/SecurityDashboardPage.js.map +1 -1
- package/dist/security/pages/SharedWithMePage.js +49 -49
- package/dist/security/pages/SharedWithMePage.js.map +1 -1
- package/dist/security/pages/VaultDetailPage.js +136 -183
- package/dist/security/pages/VaultDetailPage.js.map +1 -1
- package/dist/security/pages/VaultSettingsPage.js +191 -196
- package/dist/security/pages/VaultSettingsPage.js.map +1 -1
- package/dist/security/pages/VaultShareViewer.js +61 -59
- package/dist/security/pages/VaultShareViewer.js.map +1 -1
- package/dist/security/pages/VaultsDashboardPage.js +74 -69
- package/dist/security/pages/VaultsDashboardPage.js.map +1 -1
- package/package.json +2 -2
|
@@ -3,225 +3,223 @@ import { cn as t } from "../utils/cn.js";
|
|
|
3
3
|
import { PageLayout as n } from "../components/PageLayout.js";
|
|
4
4
|
import { Badge as r, Button as i, Card as a } from "../components/ui.js";
|
|
5
5
|
import { ConfirmDialog as o } from "../components/ConfirmDialog.js";
|
|
6
|
-
import { useDeleteIntegration as s, useTriggerSync as c, useVaultIntegrations as
|
|
7
|
-
import { getProviderTypeInfo as
|
|
8
|
-
import { nativeConfirm as
|
|
9
|
-
import { useState as
|
|
10
|
-
import { useNavigate as
|
|
11
|
-
import { jsx as
|
|
12
|
-
import { AlertTriangle as
|
|
13
|
-
import {
|
|
6
|
+
import { useDeleteIntegration as s, useTriggerSync as c, useVaultIntegrations as l, useVaultSyncLogs as u } from "../hooks/useProviderQueries.js";
|
|
7
|
+
import { getProviderTypeInfo as d } from "../constants/providers.js";
|
|
8
|
+
import { nativeConfirm as f, nativeImpact as p, nativeNotify as m } from "../../utils/nativeBridge.js";
|
|
9
|
+
import { useState as h } from "react";
|
|
10
|
+
import { useNavigate as g, useParams as _ } from "react-router-dom";
|
|
11
|
+
import { jsx as v, jsxs as y } from "react/jsx-runtime";
|
|
12
|
+
import { AlertTriangle as b, ArrowLeft as x, CheckCircle as S, Clock as C, Cloud as w, Info as ee, Loader2 as T, RefreshCw as E, Trash2 as D, XCircle as O } from "lucide-react";
|
|
13
|
+
import { CTAOverflowMenu as k, ResponsiveTable as A } from "@burdenoff/fe-libs/ui";
|
|
14
14
|
//#region src/security/pages/ProviderDetailPage.tsx
|
|
15
|
-
function
|
|
16
|
-
let { vaultId:
|
|
17
|
-
|
|
18
|
-
},
|
|
19
|
-
if (
|
|
20
|
-
await
|
|
15
|
+
function j() {
|
|
16
|
+
let { vaultId: j, providerId: M } = _(), { basePath: N = "/", navigate: P } = e(), F = g(), { data: I, loading: L, error: R } = l(j), z = (I?.getVaultIntegrations?.items ?? []).find((e) => e.id === M), { data: B, loading: V } = u(M), H = B?.getVaultSyncLogs?.items ?? [], [U, { loading: W }] = s(), [G, { loading: K }] = c(), [q, J] = h(!1), Y = (e) => {
|
|
17
|
+
P ? P(e) : F(e);
|
|
18
|
+
}, X = () => Y(`${N}/providers`), Z = async () => {
|
|
19
|
+
if (M) try {
|
|
20
|
+
await G({ variables: { integrationId: M } });
|
|
21
21
|
} catch (e) {
|
|
22
22
|
console.error("Sync failed:", e);
|
|
23
23
|
}
|
|
24
|
-
},
|
|
25
|
-
if (
|
|
26
|
-
await
|
|
24
|
+
}, Q = async () => {
|
|
25
|
+
if (M) try {
|
|
26
|
+
await U({ variables: { id: M } }), m("success"), X();
|
|
27
27
|
} catch (e) {
|
|
28
|
-
console.error("Delete failed:", e),
|
|
28
|
+
console.error("Delete failed:", e), m("error");
|
|
29
29
|
}
|
|
30
|
-
},
|
|
31
|
-
|
|
32
|
-
let e = await
|
|
30
|
+
}, te = async () => {
|
|
31
|
+
p("medium");
|
|
32
|
+
let e = await f({
|
|
33
33
|
title: "Delete Provider",
|
|
34
34
|
message: "Delete this provider? This cannot be undone.",
|
|
35
35
|
okButtonTitle: "Delete",
|
|
36
36
|
cancelButtonTitle: "Cancel"
|
|
37
37
|
});
|
|
38
38
|
if (e === null) {
|
|
39
|
-
|
|
39
|
+
J(!0);
|
|
40
40
|
return;
|
|
41
41
|
}
|
|
42
|
-
e && await
|
|
42
|
+
e && await Q();
|
|
43
43
|
};
|
|
44
|
-
if (
|
|
44
|
+
if (L && !z) return /* @__PURE__ */ v(n, {
|
|
45
45
|
title: "Loading...",
|
|
46
46
|
breadcrumbs: [{
|
|
47
47
|
label: "Security",
|
|
48
|
-
path:
|
|
48
|
+
path: N
|
|
49
49
|
}, {
|
|
50
50
|
label: "Providers",
|
|
51
|
-
path: `${
|
|
51
|
+
path: `${N}/providers`
|
|
52
52
|
}],
|
|
53
|
-
children: /* @__PURE__ */
|
|
53
|
+
children: /* @__PURE__ */ v("div", {
|
|
54
54
|
className: "flex items-center justify-center py-16",
|
|
55
|
-
children: /* @__PURE__ */
|
|
55
|
+
children: /* @__PURE__ */ v(T, { className: "size-8 animate-spin text-primary" })
|
|
56
56
|
})
|
|
57
57
|
});
|
|
58
|
-
if (
|
|
58
|
+
if (R || !L && !z) return /* @__PURE__ */ v(n, {
|
|
59
59
|
title: "Error",
|
|
60
60
|
breadcrumbs: [{
|
|
61
61
|
label: "Security",
|
|
62
|
-
path:
|
|
62
|
+
path: N
|
|
63
63
|
}, {
|
|
64
64
|
label: "Providers",
|
|
65
|
-
path: `${
|
|
65
|
+
path: `${N}/providers`
|
|
66
66
|
}],
|
|
67
|
-
children: /* @__PURE__ */
|
|
67
|
+
children: /* @__PURE__ */ v(a, {
|
|
68
68
|
className: "p-6",
|
|
69
|
-
children: /* @__PURE__ */
|
|
69
|
+
children: /* @__PURE__ */ y("div", {
|
|
70
70
|
className: "flex items-start gap-4",
|
|
71
|
-
children: [/* @__PURE__ */
|
|
72
|
-
/* @__PURE__ */
|
|
71
|
+
children: [/* @__PURE__ */ v(b, { className: "size-6 text-status-error-text" }), /* @__PURE__ */ y("div", { children: [
|
|
72
|
+
/* @__PURE__ */ v("h3", {
|
|
73
73
|
className: "font-semibold text-status-error-text",
|
|
74
74
|
children: "Provider not found"
|
|
75
75
|
}),
|
|
76
|
-
/* @__PURE__ */
|
|
76
|
+
/* @__PURE__ */ v("p", {
|
|
77
77
|
className: "text-sm text-text-secondary mt-1",
|
|
78
|
-
children:
|
|
78
|
+
children: R?.message ?? "The requested provider could not be found."
|
|
79
79
|
}),
|
|
80
|
-
/* @__PURE__ */
|
|
80
|
+
/* @__PURE__ */ y(i, {
|
|
81
81
|
variant: "outline",
|
|
82
82
|
size: "sm",
|
|
83
83
|
className: "mt-4",
|
|
84
|
-
onClick:
|
|
85
|
-
children: [/* @__PURE__ */
|
|
84
|
+
onClick: X,
|
|
85
|
+
children: [/* @__PURE__ */ v(x, { className: "size-4" }), "Back to Providers"]
|
|
86
86
|
})
|
|
87
87
|
] })]
|
|
88
88
|
})
|
|
89
89
|
})
|
|
90
90
|
});
|
|
91
|
-
let $ =
|
|
92
|
-
return /* @__PURE__ */
|
|
93
|
-
title:
|
|
91
|
+
let $ = d(z.providerType);
|
|
92
|
+
return /* @__PURE__ */ y(n, {
|
|
93
|
+
title: z.displayName || $.label,
|
|
94
94
|
description: $.description,
|
|
95
95
|
breadcrumbs: [
|
|
96
96
|
{
|
|
97
97
|
label: "Security",
|
|
98
|
-
path:
|
|
98
|
+
path: N
|
|
99
99
|
},
|
|
100
100
|
{
|
|
101
101
|
label: "Providers",
|
|
102
|
-
path: `${
|
|
102
|
+
path: `${N}/providers`
|
|
103
103
|
},
|
|
104
|
-
{ label:
|
|
104
|
+
{ label: z.displayName || $.label }
|
|
105
105
|
],
|
|
106
|
-
actions: /* @__PURE__ */
|
|
106
|
+
actions: /* @__PURE__ */ y("div", {
|
|
107
107
|
className: "flex items-center gap-2",
|
|
108
|
-
children: [
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
className: "hidden sm:inline",
|
|
132
|
-
children: "Remove"
|
|
133
|
-
})]
|
|
134
|
-
})
|
|
135
|
-
]
|
|
108
|
+
children: [/* @__PURE__ */ y(i, {
|
|
109
|
+
variant: "outline",
|
|
110
|
+
size: "sm",
|
|
111
|
+
onClick: X,
|
|
112
|
+
children: [/* @__PURE__ */ v(x, { className: "size-4" }), /* @__PURE__ */ v("span", {
|
|
113
|
+
className: "hidden sm:inline",
|
|
114
|
+
children: "Back"
|
|
115
|
+
})]
|
|
116
|
+
}), /* @__PURE__ */ v(k, {
|
|
117
|
+
primary: {
|
|
118
|
+
label: K ? "Syncing..." : "Sync Now",
|
|
119
|
+
icon: /* @__PURE__ */ v(E, { className: t("size-4", K && "animate-spin") }),
|
|
120
|
+
disabled: K,
|
|
121
|
+
onSelect: () => void Z()
|
|
122
|
+
},
|
|
123
|
+
actions: [{
|
|
124
|
+
label: "Remove",
|
|
125
|
+
icon: /* @__PURE__ */ v(D, { className: "size-4" }),
|
|
126
|
+
intent: "destructive",
|
|
127
|
+
disabled: W,
|
|
128
|
+
onSelect: () => void te()
|
|
129
|
+
}]
|
|
130
|
+
})]
|
|
136
131
|
}),
|
|
137
|
-
children: [/* @__PURE__ */
|
|
132
|
+
children: [/* @__PURE__ */ y("div", {
|
|
138
133
|
className: "space-y-6",
|
|
139
|
-
children: [/* @__PURE__ */
|
|
134
|
+
children: [/* @__PURE__ */ y(a, {
|
|
140
135
|
className: "p-6",
|
|
141
|
-
children: [/* @__PURE__ */
|
|
136
|
+
children: [/* @__PURE__ */ y("div", {
|
|
142
137
|
className: "flex items-center gap-2 mb-6",
|
|
143
|
-
children: [/* @__PURE__ */
|
|
138
|
+
children: [/* @__PURE__ */ v("div", {
|
|
144
139
|
className: "p-2 rounded-lg bg-action-primary-bg/10 text-primary",
|
|
145
|
-
children: /* @__PURE__ */
|
|
146
|
-
}), /* @__PURE__ */
|
|
140
|
+
children: /* @__PURE__ */ v(w, { className: "size-5" })
|
|
141
|
+
}), /* @__PURE__ */ v("h2", {
|
|
147
142
|
className: "text-lg font-bold text-text-primary",
|
|
148
143
|
children: "Integration Settings"
|
|
149
144
|
})]
|
|
150
|
-
}), /* @__PURE__ */
|
|
145
|
+
}), /* @__PURE__ */ y("div", {
|
|
151
146
|
className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-6 text-sm",
|
|
152
147
|
children: [
|
|
153
|
-
/* @__PURE__ */
|
|
148
|
+
/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("p", {
|
|
154
149
|
className: "text-xs font-medium text-text-secondary uppercase tracking-wider mb-1",
|
|
155
150
|
children: "Provider Type"
|
|
156
|
-
}), /* @__PURE__ */
|
|
151
|
+
}), /* @__PURE__ */ v("p", {
|
|
157
152
|
className: "font-semibold text-text-primary",
|
|
158
153
|
children: $.label
|
|
159
154
|
})] }),
|
|
160
|
-
/* @__PURE__ */
|
|
155
|
+
/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("p", {
|
|
161
156
|
className: "text-xs font-medium text-text-secondary uppercase tracking-wider mb-1",
|
|
162
157
|
children: "Sync Direction"
|
|
163
|
-
}), /* @__PURE__ */
|
|
158
|
+
}), /* @__PURE__ */ v("p", {
|
|
164
159
|
className: "font-semibold text-text-primary capitalize",
|
|
165
|
-
children:
|
|
160
|
+
children: z.syncDirection ?? "bidirectional"
|
|
166
161
|
})] }),
|
|
167
|
-
/* @__PURE__ */
|
|
162
|
+
/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("p", {
|
|
168
163
|
className: "text-xs font-medium text-text-secondary uppercase tracking-wider mb-1",
|
|
169
164
|
children: "Status"
|
|
170
|
-
}), /* @__PURE__ */
|
|
171
|
-
variant:
|
|
172
|
-
children:
|
|
165
|
+
}), /* @__PURE__ */ y(r, {
|
|
166
|
+
variant: z.syncEnabled ? "success" : "outline",
|
|
167
|
+
children: [z.syncEnabled && /* @__PURE__ */ v("span", {
|
|
168
|
+
"aria-hidden": "true",
|
|
169
|
+
className: "size-1.5 rounded-full bg-status-success-text motion-safe:animate-vc-glow-pulse"
|
|
170
|
+
}), z.syncEnabled ? "Enabled" : "Disabled"]
|
|
173
171
|
})] }),
|
|
174
|
-
/* @__PURE__ */
|
|
172
|
+
/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("p", {
|
|
175
173
|
className: "text-xs font-medium text-text-secondary uppercase tracking-wider mb-1",
|
|
176
174
|
children: "Sync Interval"
|
|
177
|
-
}), /* @__PURE__ */
|
|
175
|
+
}), /* @__PURE__ */ y("p", {
|
|
178
176
|
className: "font-semibold text-text-primary",
|
|
179
|
-
children: [
|
|
177
|
+
children: [z.syncIntervalMinutes ?? 0, " minutes"]
|
|
180
178
|
})] }),
|
|
181
|
-
/* @__PURE__ */
|
|
179
|
+
/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("p", {
|
|
182
180
|
className: "text-xs font-medium text-text-secondary uppercase tracking-wider mb-1",
|
|
183
181
|
children: "Added On"
|
|
184
|
-
}), /* @__PURE__ */
|
|
182
|
+
}), /* @__PURE__ */ v("p", {
|
|
185
183
|
className: "font-semibold text-text-primary",
|
|
186
|
-
children: new Date(
|
|
184
|
+
children: new Date(z.createdAt).toLocaleDateString()
|
|
187
185
|
})] }),
|
|
188
|
-
|
|
186
|
+
z.lastSyncAt && /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("p", {
|
|
189
187
|
className: "text-xs font-medium text-text-secondary uppercase tracking-wider mb-1",
|
|
190
188
|
children: "Last Successful Sync"
|
|
191
|
-
}), /* @__PURE__ */
|
|
189
|
+
}), /* @__PURE__ */ y("div", {
|
|
192
190
|
className: "flex items-center gap-1.5 font-semibold text-text-primary",
|
|
193
|
-
children: [/* @__PURE__ */
|
|
191
|
+
children: [/* @__PURE__ */ v(S, { className: "size-3.5 text-status-success-text" }), new Date(z.lastSyncAt).toLocaleString()]
|
|
194
192
|
})] })
|
|
195
193
|
]
|
|
196
194
|
})]
|
|
197
|
-
}), /* @__PURE__ */
|
|
195
|
+
}), /* @__PURE__ */ y(a, {
|
|
198
196
|
className: "p-6 shadow-sm border-border-subtle/60",
|
|
199
|
-
children: [/* @__PURE__ */
|
|
197
|
+
children: [/* @__PURE__ */ y("div", {
|
|
200
198
|
className: "flex items-center justify-between mb-6",
|
|
201
|
-
children: [/* @__PURE__ */
|
|
199
|
+
children: [/* @__PURE__ */ y("div", {
|
|
202
200
|
className: "flex items-center gap-2",
|
|
203
|
-
children: [/* @__PURE__ */
|
|
201
|
+
children: [/* @__PURE__ */ v(C, { className: "size-5 text-primary" }), /* @__PURE__ */ v("h2", {
|
|
204
202
|
className: "text-lg font-bold text-text-primary",
|
|
205
203
|
children: "Sync History"
|
|
206
204
|
})]
|
|
207
|
-
}), /* @__PURE__ */
|
|
205
|
+
}), /* @__PURE__ */ y(r, {
|
|
208
206
|
variant: "outline",
|
|
209
207
|
className: "bg-bg-sunken",
|
|
210
|
-
children: [
|
|
208
|
+
children: [H.length, " runs"]
|
|
211
209
|
})]
|
|
212
|
-
}),
|
|
210
|
+
}), V ? /* @__PURE__ */ v("div", {
|
|
213
211
|
className: "flex justify-center py-12",
|
|
214
|
-
children: /* @__PURE__ */
|
|
215
|
-
}) :
|
|
212
|
+
children: /* @__PURE__ */ v(T, { className: "size-8 animate-spin text-primary/40" })
|
|
213
|
+
}) : H.length > 0 ? /* @__PURE__ */ v(A, {
|
|
216
214
|
className: "border border-border-subtle/60 rounded-lg",
|
|
217
|
-
data:
|
|
215
|
+
data: H,
|
|
218
216
|
rowKey: (e) => e.id,
|
|
219
217
|
columns: [
|
|
220
218
|
{
|
|
221
219
|
key: "time",
|
|
222
220
|
header: "Time",
|
|
223
221
|
priority: "primary",
|
|
224
|
-
cell: (e) => /* @__PURE__ */
|
|
222
|
+
cell: (e) => /* @__PURE__ */ v("span", {
|
|
225
223
|
className: "whitespace-nowrap",
|
|
226
224
|
children: new Date(e.startedAt).toLocaleString()
|
|
227
225
|
})
|
|
@@ -229,7 +227,7 @@ function A() {
|
|
|
229
227
|
{
|
|
230
228
|
key: "status",
|
|
231
229
|
header: "Status",
|
|
232
|
-
cell: (e) => /* @__PURE__ */
|
|
230
|
+
cell: (e) => /* @__PURE__ */ v(r, {
|
|
233
231
|
variant: e.status === "COMPLETED" ? "success" : e.status === "FAILED" ? "destructive" : "warning",
|
|
234
232
|
className: "text-[10px] uppercase",
|
|
235
233
|
children: e.status
|
|
@@ -238,7 +236,7 @@ function A() {
|
|
|
238
236
|
{
|
|
239
237
|
key: "synced",
|
|
240
238
|
header: "Synced",
|
|
241
|
-
cell: (e) => /* @__PURE__ */
|
|
239
|
+
cell: (e) => /* @__PURE__ */ v("span", {
|
|
242
240
|
className: "font-medium text-text-primary tabular-nums",
|
|
243
241
|
children: e.secretsSynced
|
|
244
242
|
})
|
|
@@ -246,7 +244,7 @@ function A() {
|
|
|
246
244
|
{
|
|
247
245
|
key: "duration",
|
|
248
246
|
header: "Duration",
|
|
249
|
-
cell: (e) => /* @__PURE__ */
|
|
247
|
+
cell: (e) => /* @__PURE__ */ v("span", {
|
|
250
248
|
className: "text-text-secondary tabular-nums",
|
|
251
249
|
children: e.durationMs ? `${e.durationMs}ms` : "-"
|
|
252
250
|
})
|
|
@@ -254,46 +252,46 @@ function A() {
|
|
|
254
252
|
{
|
|
255
253
|
key: "errors",
|
|
256
254
|
header: "Errors",
|
|
257
|
-
cell: (e) => e.errorMessage ? /* @__PURE__ */
|
|
255
|
+
cell: (e) => e.errorMessage ? /* @__PURE__ */ y("div", {
|
|
258
256
|
className: "flex items-center gap-1.5 text-status-error-text max-w-xs truncate",
|
|
259
|
-
children: [/* @__PURE__ */
|
|
257
|
+
children: [/* @__PURE__ */ v(O, { className: "size-3.5" }), /* @__PURE__ */ v("span", {
|
|
260
258
|
className: "truncate",
|
|
261
259
|
title: e.errorMessage,
|
|
262
260
|
children: e.errorMessage
|
|
263
261
|
})]
|
|
264
|
-
}) : /* @__PURE__ */
|
|
262
|
+
}) : /* @__PURE__ */ v("span", {
|
|
265
263
|
className: "text-text-secondary",
|
|
266
264
|
children: "-"
|
|
267
265
|
})
|
|
268
266
|
}
|
|
269
267
|
]
|
|
270
|
-
}) : /* @__PURE__ */
|
|
268
|
+
}) : /* @__PURE__ */ y("div", {
|
|
271
269
|
className: "text-center py-12 border-2 border-dashed border-border-subtle/40 rounded-xl bg-bg-sunken/10",
|
|
272
270
|
children: [
|
|
273
|
-
/* @__PURE__ */
|
|
274
|
-
/* @__PURE__ */
|
|
271
|
+
/* @__PURE__ */ v(ee, { className: "size-12 text-text-secondary/30 mx-auto mb-3" }),
|
|
272
|
+
/* @__PURE__ */ v("p", {
|
|
275
273
|
className: "text-sm text-text-secondary font-medium",
|
|
276
274
|
children: "No sync logs found."
|
|
277
275
|
}),
|
|
278
|
-
/* @__PURE__ */
|
|
276
|
+
/* @__PURE__ */ v("p", {
|
|
279
277
|
className: "text-xs text-text-secondary mt-1",
|
|
280
278
|
children: "Sync history will appear here after the first synchronization run."
|
|
281
279
|
})
|
|
282
280
|
]
|
|
283
281
|
})]
|
|
284
282
|
})]
|
|
285
|
-
}), /* @__PURE__ */
|
|
286
|
-
isOpen:
|
|
287
|
-
onClose: () =>
|
|
288
|
-
onConfirm:
|
|
283
|
+
}), /* @__PURE__ */ v(o, {
|
|
284
|
+
isOpen: q,
|
|
285
|
+
onClose: () => J(!1),
|
|
286
|
+
onConfirm: Q,
|
|
289
287
|
title: "Remove Provider",
|
|
290
288
|
description: `Are you sure you want to remove this ${$.label} connection? Synced secrets will remain but will no longer auto-update.`,
|
|
291
|
-
confirmLabel:
|
|
289
|
+
confirmLabel: W ? "Removing..." : "Remove Provider",
|
|
292
290
|
variant: "destructive"
|
|
293
291
|
})]
|
|
294
292
|
});
|
|
295
293
|
}
|
|
296
294
|
//#endregion
|
|
297
|
-
export {
|
|
295
|
+
export { j as ProviderDetailPage };
|
|
298
296
|
|
|
299
297
|
//# sourceMappingURL=ProviderDetailPage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProviderDetailPage.js","names":[],"sources":["../../../src/security/pages/ProviderDetailPage.tsx"],"sourcesContent":["import { useParams, useNavigate } from 'react-router-dom';\nimport {\n ArrowLeft,\n RefreshCw,\n Trash2,\n Cloud,\n Loader2,\n AlertTriangle,\n CheckCircle,\n Clock,\n XCircle,\n Info,\n} from 'lucide-react';\nimport {\n ResponsiveTable,\n type ResponsiveTableColumn,\n} from '@burdenoff/fe-libs/ui';\nimport { PageLayout } from '../components/PageLayout';\nimport { ConfirmDialog } from '../components/ConfirmDialog';\nimport { Button, Card, Badge } from '../components/ui';\nimport {\n useVaultIntegrations,\n useDeleteIntegration,\n useTriggerSync,\n useVaultSyncLogs,\n} from '../hooks/useProviderQueries';\nimport { useSecurity } from '../providers/SecurityProvider';\nimport { getProviderTypeInfo } from '../constants/providers';\nimport { useState } from 'react';\nimport { cn } from '../utils/cn';\nimport type { ProviderType } from '../types';\nimport { nativeConfirm, nativeImpact, nativeNotify } from '../../utils/nativeBridge';\n\nexport function ProviderDetailPage() {\n const { vaultId, providerId } = useParams<{ vaultId: string; providerId: string }>();\n const { basePath = '/', navigate: shellNavigate } = useSecurity();\n const routerNavigate = useNavigate();\n\n const { data, loading, error } = useVaultIntegrations(vaultId);\n const providers = data?.getVaultIntegrations?.items ?? [];\n const provider = providers.find((p: any) => p.id === providerId);\n\n const { data: logsData, loading: logsLoading } = useVaultSyncLogs(providerId);\n const syncLogs = logsData?.getVaultSyncLogs?.items ?? [];\n\n const [deleteProvider, { loading: deleting }] = useDeleteIntegration();\n const [triggerSync, { loading: syncing }] = useTriggerSync();\n const [showDeleteConfirm, setShowDeleteConfirm] = useState(false);\n\n const handleNavigate = (path: string) => {\n if (shellNavigate) {\n shellNavigate(path);\n } else {\n routerNavigate(path);\n }\n };\n\n const handleBack = () => handleNavigate(`${basePath}/providers`);\n\n const handleSync = async () => {\n if (!providerId) return;\n try {\n await triggerSync({ variables: { integrationId: providerId } });\n } catch (err) {\n console.error('Sync failed:', err);\n }\n };\n\n const handleDelete = async () => {\n if (!providerId) return;\n try {\n await deleteProvider({ variables: { id: providerId } });\n void nativeNotify('success');\n handleBack();\n } catch (err) {\n console.error('Delete failed:', err);\n void nativeNotify('error');\n }\n };\n\n const requestDelete = async () => {\n void nativeImpact('medium');\n const result = await nativeConfirm({\n title: 'Delete Provider',\n message: 'Delete this provider? This cannot be undone.',\n okButtonTitle: 'Delete',\n cancelButtonTitle: 'Cancel',\n });\n if (result === null) {\n setShowDeleteConfirm(true);\n return;\n }\n if (result) {\n await handleDelete();\n }\n };\n\n if (loading && !provider) {\n return (\n <PageLayout\n title=\"Loading...\"\n breadcrumbs={[\n { label: 'Security', path: basePath },\n { label: 'Providers', path: `${basePath}/providers` },\n ]}\n >\n <div className=\"flex items-center justify-center py-16\">\n <Loader2 className=\"size-8 animate-spin text-primary\" />\n </div>\n </PageLayout>\n );\n }\n\n if (error || (!loading && !provider)) {\n return (\n <PageLayout\n title=\"Error\"\n breadcrumbs={[\n { label: 'Security', path: basePath },\n { label: 'Providers', path: `${basePath}/providers` },\n ]}\n >\n <Card className=\"p-6\">\n <div className=\"flex items-start gap-4\">\n <AlertTriangle className=\"size-6 text-status-error-text\" />\n <div>\n <h3 className=\"font-semibold text-status-error-text\">Provider not found</h3>\n <p className=\"text-sm text-text-secondary mt-1\">\n {error?.message ?? 'The requested provider could not be found.'}\n </p>\n <Button variant=\"outline\" size=\"sm\" className=\"mt-4\" onClick={handleBack}>\n <ArrowLeft className=\"size-4\" />\n Back to Providers\n </Button>\n </div>\n </div>\n </Card>\n </PageLayout>\n );\n }\n\n const typeInfo = getProviderTypeInfo(provider.providerType as ProviderType);\n\n return (\n <PageLayout\n title={(provider.displayName as string) || typeInfo.label}\n description={typeInfo.description}\n breadcrumbs={[\n { label: 'Security', path: basePath },\n { label: 'Providers', path: `${basePath}/providers` },\n { label: (provider.displayName as string) || typeInfo.label },\n ]}\n actions={\n <div className=\"flex items-center gap-2\">\n <Button variant=\"outline\" size=\"sm\" onClick={handleBack}>\n <ArrowLeft className=\"size-4\" />\n <span className=\"hidden sm:inline\">Back</span>\n </Button>\n <Button variant=\"outline\" size=\"sm\" onClick={handleSync} disabled={syncing}>\n <RefreshCw className={cn('size-4', syncing && 'animate-spin')} />\n {syncing ? 'Syncing...' : 'Sync Now'}\n </Button>\n <Button\n variant=\"destructive\"\n size=\"sm\"\n onClick={() => void requestDelete()}\n disabled={deleting}\n >\n <Trash2 className=\"size-4\" />\n <span className=\"hidden sm:inline\">Remove</span>\n </Button>\n </div>\n }\n >\n <div className=\"space-y-6\">\n {/* Configuration */}\n <Card className=\"p-6\">\n <div className=\"flex items-center gap-2 mb-6\">\n <div className=\"p-2 rounded-lg bg-action-primary-bg/10 text-primary\">\n <Cloud className=\"size-5\" />\n </div>\n <h2 className=\"text-lg font-bold text-text-primary\">Integration Settings</h2>\n </div>\n\n <div className=\"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-6 text-sm\">\n <div>\n <p className=\"text-xs font-medium text-text-secondary uppercase tracking-wider mb-1\">\n Provider Type\n </p>\n <p className=\"font-semibold text-text-primary\">{typeInfo.label}</p>\n </div>\n <div>\n <p className=\"text-xs font-medium text-text-secondary uppercase tracking-wider mb-1\">\n Sync Direction\n </p>\n <p className=\"font-semibold text-text-primary capitalize\">\n {(provider.syncDirection as string) ?? 'bidirectional'}\n </p>\n </div>\n <div>\n <p className=\"text-xs font-medium text-text-secondary uppercase tracking-wider mb-1\">\n Status\n </p>\n <Badge variant={provider.syncEnabled ? 'success' : 'outline'}>\n {provider.syncEnabled ? 'Enabled' : 'Disabled'}\n </Badge>\n </div>\n <div>\n <p className=\"text-xs font-medium text-text-secondary uppercase tracking-wider mb-1\">\n Sync Interval\n </p>\n <p className=\"font-semibold text-text-primary\">\n {(provider.syncIntervalMinutes as number) ?? 0} minutes\n </p>\n </div>\n <div>\n <p className=\"text-xs font-medium text-text-secondary uppercase tracking-wider mb-1\">\n Added On\n </p>\n <p className=\"font-semibold text-text-primary\">\n {new Date(provider.createdAt as string).toLocaleDateString()}\n </p>\n </div>\n {provider.lastSyncAt && (\n <div>\n <p className=\"text-xs font-medium text-text-secondary uppercase tracking-wider mb-1\">\n Last Successful Sync\n </p>\n <div className=\"flex items-center gap-1.5 font-semibold text-text-primary\">\n <CheckCircle className=\"size-3.5 text-status-success-text\" />\n {new Date(provider.lastSyncAt as string).toLocaleString()}\n </div>\n </div>\n )}\n </div>\n </Card>\n\n {/* Sync History */}\n <Card className=\"p-6 shadow-sm border-border-subtle/60\">\n <div className=\"flex items-center justify-between mb-6\">\n <div className=\"flex items-center gap-2\">\n <Clock className=\"size-5 text-primary\" />\n <h2 className=\"text-lg font-bold text-text-primary\">Sync History</h2>\n </div>\n <Badge variant=\"outline\" className=\"bg-bg-sunken\">\n {syncLogs.length} runs\n </Badge>\n </div>\n\n {logsLoading ? (\n <div className=\"flex justify-center py-12\">\n <Loader2 className=\"size-8 animate-spin text-primary/40\" />\n </div>\n ) : syncLogs.length > 0 ? (\n <ResponsiveTable<any>\n className=\"border border-border-subtle/60 rounded-lg\"\n data={syncLogs}\n rowKey={(log) => log.id}\n columns={\n [\n {\n key: 'time',\n header: 'Time',\n priority: 'primary',\n cell: (log) => (\n <span className=\"whitespace-nowrap\">\n {new Date(log.startedAt).toLocaleString()}\n </span>\n ),\n },\n {\n key: 'status',\n header: 'Status',\n cell: (log) => (\n <Badge\n variant={\n log.status === 'COMPLETED'\n ? 'success'\n : log.status === 'FAILED'\n ? 'destructive'\n : 'warning'\n }\n className=\"text-[10px] uppercase\"\n >\n {log.status}\n </Badge>\n ),\n },\n {\n key: 'synced',\n header: 'Synced',\n cell: (log) => (\n <span className=\"font-medium text-text-primary tabular-nums\">\n {log.secretsSynced}\n </span>\n ),\n },\n {\n key: 'duration',\n header: 'Duration',\n cell: (log) => (\n <span className=\"text-text-secondary tabular-nums\">\n {log.durationMs ? `${log.durationMs}ms` : '-'}\n </span>\n ),\n },\n {\n key: 'errors',\n header: 'Errors',\n cell: (log) =>\n log.errorMessage ? (\n <div className=\"flex items-center gap-1.5 text-status-error-text max-w-xs truncate\">\n <XCircle className=\"size-3.5\" />\n <span className=\"truncate\" title={log.errorMessage}>\n {log.errorMessage}\n </span>\n </div>\n ) : (\n <span className=\"text-text-secondary\">-</span>\n ),\n },\n ] satisfies ResponsiveTableColumn<any>[]\n }\n />\n ) : (\n <div className=\"text-center py-12 border-2 border-dashed border-border-subtle/40 rounded-xl bg-bg-sunken/10\">\n <Info className=\"size-12 text-text-secondary/30 mx-auto mb-3\" />\n <p className=\"text-sm text-text-secondary font-medium\">No sync logs found.</p>\n <p className=\"text-xs text-text-secondary mt-1\">\n Sync history will appear here after the first synchronization run.\n </p>\n </div>\n )}\n </Card>\n </div>\n\n <ConfirmDialog\n isOpen={showDeleteConfirm}\n onClose={() => setShowDeleteConfirm(false)}\n onConfirm={handleDelete}\n title=\"Remove Provider\"\n description={`Are you sure you want to remove this ${typeInfo.label} connection? Synced secrets will remain but will no longer auto-update.`}\n confirmLabel={deleting ? 'Removing...' : 'Remove Provider'}\n variant=\"destructive\"\n />\n </PageLayout>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;AAiCA,SAAgB,IAAqB;CACnC,IAAM,EAAE,YAAS,kBAAe,GAAoD,EAC9E,EAAE,cAAW,KAAK,UAAU,MAAkB,GAAa,EAC3D,IAAiB,GAAa,EAE9B,EAAE,SAAM,YAAS,aAAU,GAAqB,EAAQ,EAExD,KADY,GAAM,sBAAsB,SAAS,EAAE,EAC9B,MAAM,MAAW,EAAE,OAAO,EAAW,EAE1D,EAAE,MAAM,GAAU,SAAS,MAAgB,EAAiB,EAAW,EACvE,IAAW,GAAU,kBAAkB,SAAS,EAAE,EAElD,CAAC,GAAgB,EAAE,SAAS,OAAc,GAAsB,EAChE,CAAC,GAAa,EAAE,SAAS,OAAa,GAAgB,EACtD,CAAC,GAAmB,KAAwB,EAAS,GAAM,EAE3D,KAAkB,MAAiB;AACvC,EAAI,IACF,EAAc,EAAK,GAEnB,EAAe,EAAK;IAIlB,UAAmB,EAAe,GAAG,EAAS,YAAY,EAE1D,IAAa,YAAY;AACxB,QACL,KAAI;AACF,SAAM,EAAY,EAAE,WAAW,EAAE,eAAe,GAAY,EAAE,CAAC;WACxD,GAAK;AACZ,WAAQ,MAAM,gBAAgB,EAAI;;IAIhC,IAAe,YAAY;AAC1B,QACL,KAAI;AAGF,GAFA,MAAM,EAAe,EAAE,WAAW,EAAE,IAAI,GAAY,EAAE,CAAC,EAClD,EAAa,UAAU,EAC5B,GAAY;WACL,GAAK;AAEP,GADL,QAAQ,MAAM,kBAAkB,EAAI,EAC/B,EAAa,QAAQ;;IAIxB,IAAgB,YAAY;AAC3B,IAAa,SAAS;EAC3B,IAAM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ACS"}
|
|
1
|
+
{"version":3,"file":"ProviderDetailPage.js","names":[],"sources":["../../../src/security/pages/ProviderDetailPage.tsx"],"sourcesContent":["import { useParams, useNavigate } from 'react-router-dom';\nimport {\n ArrowLeft,\n RefreshCw,\n Trash2,\n Cloud,\n Loader2,\n AlertTriangle,\n CheckCircle,\n Clock,\n XCircle,\n Info,\n} from 'lucide-react';\nimport {\n ResponsiveTable,\n type ResponsiveTableColumn,\n GlassCard,\n CTAOverflowMenu,\n} from '@burdenoff/fe-libs/ui';\nimport { PageLayout } from '../components/PageLayout';\nimport { ConfirmDialog } from '../components/ConfirmDialog';\nimport { Button, Card, Badge } from '../components/ui';\nimport {\n useVaultIntegrations,\n useDeleteIntegration,\n useTriggerSync,\n useVaultSyncLogs,\n} from '../hooks/useProviderQueries';\nimport { useSecurity } from '../providers/SecurityProvider';\nimport { getProviderTypeInfo } from '../constants/providers';\nimport { useState } from 'react';\nimport { cn } from '../utils/cn';\nimport type { ProviderType } from '../types';\nimport { nativeConfirm, nativeImpact, nativeNotify } from '../../utils/nativeBridge';\n\nexport function ProviderDetailPage() {\n const { vaultId, providerId } = useParams<{ vaultId: string; providerId: string }>();\n const { basePath = '/', navigate: shellNavigate } = useSecurity();\n const routerNavigate = useNavigate();\n\n const { data, loading, error } = useVaultIntegrations(vaultId);\n const providers = data?.getVaultIntegrations?.items ?? [];\n const provider = providers.find((p: any) => p.id === providerId);\n\n const { data: logsData, loading: logsLoading } = useVaultSyncLogs(providerId);\n const syncLogs = logsData?.getVaultSyncLogs?.items ?? [];\n\n const [deleteProvider, { loading: deleting }] = useDeleteIntegration();\n const [triggerSync, { loading: syncing }] = useTriggerSync();\n const [showDeleteConfirm, setShowDeleteConfirm] = useState(false);\n\n const handleNavigate = (path: string) => {\n if (shellNavigate) {\n shellNavigate(path);\n } else {\n routerNavigate(path);\n }\n };\n\n const handleBack = () => handleNavigate(`${basePath}/providers`);\n\n const handleSync = async () => {\n if (!providerId) return;\n try {\n await triggerSync({ variables: { integrationId: providerId } });\n } catch (err) {\n console.error('Sync failed:', err);\n }\n };\n\n const handleDelete = async () => {\n if (!providerId) return;\n try {\n await deleteProvider({ variables: { id: providerId } });\n void nativeNotify('success');\n handleBack();\n } catch (err) {\n console.error('Delete failed:', err);\n void nativeNotify('error');\n }\n };\n\n const requestDelete = async () => {\n void nativeImpact('medium');\n const result = await nativeConfirm({\n title: 'Delete Provider',\n message: 'Delete this provider? This cannot be undone.',\n okButtonTitle: 'Delete',\n cancelButtonTitle: 'Cancel',\n });\n if (result === null) {\n setShowDeleteConfirm(true);\n return;\n }\n if (result) {\n await handleDelete();\n }\n };\n\n if (loading && !provider) {\n return (\n <PageLayout\n title=\"Loading...\"\n breadcrumbs={[\n { label: 'Security', path: basePath },\n { label: 'Providers', path: `${basePath}/providers` },\n ]}\n >\n <div className=\"flex items-center justify-center py-16\">\n <Loader2 className=\"size-8 animate-spin text-primary\" />\n </div>\n </PageLayout>\n );\n }\n\n if (error || (!loading && !provider)) {\n return (\n <PageLayout\n title=\"Error\"\n breadcrumbs={[\n { label: 'Security', path: basePath },\n { label: 'Providers', path: `${basePath}/providers` },\n ]}\n >\n <Card className=\"p-6\">\n <div className=\"flex items-start gap-4\">\n <AlertTriangle className=\"size-6 text-status-error-text\" />\n <div>\n <h3 className=\"font-semibold text-status-error-text\">Provider not found</h3>\n <p className=\"text-sm text-text-secondary mt-1\">\n {error?.message ?? 'The requested provider could not be found.'}\n </p>\n <Button variant=\"outline\" size=\"sm\" className=\"mt-4\" onClick={handleBack}>\n <ArrowLeft className=\"size-4\" />\n Back to Providers\n </Button>\n </div>\n </div>\n </Card>\n </PageLayout>\n );\n }\n\n const typeInfo = getProviderTypeInfo(provider.providerType as ProviderType);\n\n return (\n <PageLayout\n title={(provider.displayName as string) || typeInfo.label}\n description={typeInfo.description}\n breadcrumbs={[\n { label: 'Security', path: basePath },\n { label: 'Providers', path: `${basePath}/providers` },\n { label: (provider.displayName as string) || typeInfo.label },\n ]}\n actions={\n // Boff UI 2.0: quiet \"Back\", a single primary CTA (\"Sync Now\"), and the\n // destructive \"Remove\" tucked into the overflow menu.\n <div className=\"flex items-center gap-2\">\n <Button variant=\"outline\" size=\"sm\" onClick={handleBack}>\n <ArrowLeft className=\"size-4\" />\n <span className=\"hidden sm:inline\">Back</span>\n </Button>\n <CTAOverflowMenu\n primary={{\n label: syncing ? 'Syncing...' : 'Sync Now',\n icon: <RefreshCw className={cn('size-4', syncing && 'animate-spin')} />,\n disabled: syncing,\n onSelect: () => void handleSync(),\n }}\n actions={[\n {\n label: 'Remove',\n icon: <Trash2 className=\"size-4\" />,\n intent: 'destructive',\n disabled: deleting,\n onSelect: () => void requestDelete(),\n },\n ]}\n />\n </div>\n }\n >\n <div className=\"space-y-6\">\n {/* Configuration */}\n <Card className=\"p-6\">\n <div className=\"flex items-center gap-2 mb-6\">\n <div className=\"p-2 rounded-lg bg-action-primary-bg/10 text-primary\">\n <Cloud className=\"size-5\" />\n </div>\n <h2 className=\"text-lg font-bold text-text-primary\">Integration Settings</h2>\n </div>\n\n <div className=\"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-6 text-sm\">\n <div>\n <p className=\"text-xs font-medium text-text-secondary uppercase tracking-wider mb-1\">\n Provider Type\n </p>\n <p className=\"font-semibold text-text-primary\">{typeInfo.label}</p>\n </div>\n <div>\n <p className=\"text-xs font-medium text-text-secondary uppercase tracking-wider mb-1\">\n Sync Direction\n </p>\n <p className=\"font-semibold text-text-primary capitalize\">\n {(provider.syncDirection as string) ?? 'bidirectional'}\n </p>\n </div>\n <div>\n <p className=\"text-xs font-medium text-text-secondary uppercase tracking-wider mb-1\">\n Status\n </p>\n <Badge variant={provider.syncEnabled ? 'success' : 'outline'}>\n {provider.syncEnabled && (\n <span\n aria-hidden=\"true\"\n className=\"size-1.5 rounded-full bg-status-success-text motion-safe:animate-vc-glow-pulse\"\n />\n )}\n {provider.syncEnabled ? 'Enabled' : 'Disabled'}\n </Badge>\n </div>\n <div>\n <p className=\"text-xs font-medium text-text-secondary uppercase tracking-wider mb-1\">\n Sync Interval\n </p>\n <p className=\"font-semibold text-text-primary\">\n {(provider.syncIntervalMinutes as number) ?? 0} minutes\n </p>\n </div>\n <div>\n <p className=\"text-xs font-medium text-text-secondary uppercase tracking-wider mb-1\">\n Added On\n </p>\n <p className=\"font-semibold text-text-primary\">\n {new Date(provider.createdAt as string).toLocaleDateString()}\n </p>\n </div>\n {provider.lastSyncAt && (\n <div>\n <p className=\"text-xs font-medium text-text-secondary uppercase tracking-wider mb-1\">\n Last Successful Sync\n </p>\n <div className=\"flex items-center gap-1.5 font-semibold text-text-primary\">\n <CheckCircle className=\"size-3.5 text-status-success-text\" />\n {new Date(provider.lastSyncAt as string).toLocaleString()}\n </div>\n </div>\n )}\n </div>\n </Card>\n\n {/* Sync History */}\n <Card className=\"p-6 shadow-sm border-border-subtle/60\">\n <div className=\"flex items-center justify-between mb-6\">\n <div className=\"flex items-center gap-2\">\n <Clock className=\"size-5 text-primary\" />\n <h2 className=\"text-lg font-bold text-text-primary\">Sync History</h2>\n </div>\n <Badge variant=\"outline\" className=\"bg-bg-sunken\">\n {syncLogs.length} runs\n </Badge>\n </div>\n\n {logsLoading ? (\n <div className=\"flex justify-center py-12\">\n <Loader2 className=\"size-8 animate-spin text-primary/40\" />\n </div>\n ) : syncLogs.length > 0 ? (\n <ResponsiveTable<any>\n className=\"border border-border-subtle/60 rounded-lg\"\n data={syncLogs}\n rowKey={(log) => log.id}\n columns={\n [\n {\n key: 'time',\n header: 'Time',\n priority: 'primary',\n cell: (log) => (\n <span className=\"whitespace-nowrap\">\n {new Date(log.startedAt).toLocaleString()}\n </span>\n ),\n },\n {\n key: 'status',\n header: 'Status',\n cell: (log) => (\n <Badge\n variant={\n log.status === 'COMPLETED'\n ? 'success'\n : log.status === 'FAILED'\n ? 'destructive'\n : 'warning'\n }\n className=\"text-[10px] uppercase\"\n >\n {log.status}\n </Badge>\n ),\n },\n {\n key: 'synced',\n header: 'Synced',\n cell: (log) => (\n <span className=\"font-medium text-text-primary tabular-nums\">\n {log.secretsSynced}\n </span>\n ),\n },\n {\n key: 'duration',\n header: 'Duration',\n cell: (log) => (\n <span className=\"text-text-secondary tabular-nums\">\n {log.durationMs ? `${log.durationMs}ms` : '-'}\n </span>\n ),\n },\n {\n key: 'errors',\n header: 'Errors',\n cell: (log) =>\n log.errorMessage ? (\n <div className=\"flex items-center gap-1.5 text-status-error-text max-w-xs truncate\">\n <XCircle className=\"size-3.5\" />\n <span className=\"truncate\" title={log.errorMessage}>\n {log.errorMessage}\n </span>\n </div>\n ) : (\n <span className=\"text-text-secondary\">-</span>\n ),\n },\n ] satisfies ResponsiveTableColumn<any>[]\n }\n />\n ) : (\n <div className=\"text-center py-12 border-2 border-dashed border-border-subtle/40 rounded-xl bg-bg-sunken/10\">\n <Info className=\"size-12 text-text-secondary/30 mx-auto mb-3\" />\n <p className=\"text-sm text-text-secondary font-medium\">No sync logs found.</p>\n <p className=\"text-xs text-text-secondary mt-1\">\n Sync history will appear here after the first synchronization run.\n </p>\n </div>\n )}\n </Card>\n </div>\n\n <ConfirmDialog\n isOpen={showDeleteConfirm}\n onClose={() => setShowDeleteConfirm(false)}\n onConfirm={handleDelete}\n title=\"Remove Provider\"\n description={`Are you sure you want to remove this ${typeInfo.label} connection? Synced secrets will remain but will no longer auto-update.`}\n confirmLabel={deleting ? 'Removing...' : 'Remove Provider'}\n variant=\"destructive\"\n />\n </PageLayout>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;AAmCA,SAAgB,IAAqB;CACnC,IAAM,EAAE,YAAS,kBAAe,GAAoD,EAC9E,EAAE,cAAW,KAAK,UAAU,MAAkB,GAAa,EAC3D,IAAiB,GAAa,EAE9B,EAAE,SAAM,YAAS,aAAU,EAAqB,EAAQ,EAExD,KADY,GAAM,sBAAsB,SAAS,EAAE,EAC9B,MAAM,MAAW,EAAE,OAAO,EAAW,EAE1D,EAAE,MAAM,GAAU,SAAS,MAAgB,EAAiB,EAAW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