@burdenoff/microfe-security 2026.625.1 → 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 +11 -10
- 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 +7 -15
- 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 +5 -2
- package/dist/security/pages/ProviderDetailPage.js.map +1 -1
- package/dist/security/pages/ProvidersPage.js +51 -51
- package/dist/security/pages/ProvidersPage.js.map +1 -1
- package/dist/security/pages/SecurityDashboardPage.js +40 -37
- 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 +112 -113
- 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/VaultsDashboardPage.js +45 -42
- package/dist/security/pages/VaultsDashboardPage.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { useSecurity as e } from "../providers/SecurityProvider.js";
|
|
2
2
|
import { PageLayout as t } from "../components/PageLayout.js";
|
|
3
|
-
import { Button as n, Card as r,
|
|
4
|
-
import { useSecurityStore as
|
|
5
|
-
import { ActivityTimeline as
|
|
6
|
-
import { useVaultAuditLogs as
|
|
7
|
-
import { useState as
|
|
8
|
-
import { jsx as
|
|
9
|
-
import { Activity as
|
|
3
|
+
import { Button as n, Card as r, Select as i } from "../components/ui.js";
|
|
4
|
+
import { useSecurityStore as a } from "../store/securityStore.js";
|
|
5
|
+
import { ActivityTimeline as o } from "../components/ActivityTimeline.js";
|
|
6
|
+
import { useVaultAuditLogs as s } from "../hooks/useAuditLog.js";
|
|
7
|
+
import { useState as c } from "react";
|
|
8
|
+
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
9
|
+
import { Activity as d, AlertTriangle as f, Loader2 as p, RefreshCw as m } from "lucide-react";
|
|
10
|
+
import { IllustratedEmptyState as h } from "@burdenoff/fe-libs/ui";
|
|
10
11
|
//#region src/security/pages/AuditLogPage.tsx
|
|
11
|
-
var
|
|
12
|
+
var g = [
|
|
12
13
|
{
|
|
13
14
|
value: "all",
|
|
14
15
|
label: "All Actions"
|
|
@@ -74,137 +75,137 @@ var _ = [
|
|
|
74
75
|
label: "Export Completed"
|
|
75
76
|
}
|
|
76
77
|
];
|
|
77
|
-
function
|
|
78
|
-
let { basePath:
|
|
79
|
-
|
|
80
|
-
let [
|
|
81
|
-
|
|
82
|
-
let { data:
|
|
83
|
-
return
|
|
78
|
+
function _() {
|
|
79
|
+
let { basePath: _ = "/" } = e();
|
|
80
|
+
a((e) => e.auditFilter), a((e) => e.updateAuditFilter);
|
|
81
|
+
let [v, y] = c("all"), [b, x] = c(""), [S, C] = c(""), w = {};
|
|
82
|
+
v !== "all" && (w.action = v), b && (w.dateFrom = b), S && (w.dateTo = S);
|
|
83
|
+
let { data: T, loading: E, error: D, refetch: O } = s(void 0, Object.keys(w).length > 0 ? w : void 0, { limit: 50 }), k = T?.getVaultAuditLogs?.items ?? [];
|
|
84
|
+
return T?.getVaultAuditLogs?.total, /* @__PURE__ */ l(t, {
|
|
84
85
|
title: "Audit Log",
|
|
85
86
|
description: "Track all security-related actions across vaults and secrets.",
|
|
86
87
|
breadcrumbs: [{
|
|
87
88
|
label: "Security",
|
|
88
|
-
path:
|
|
89
|
+
path: _
|
|
89
90
|
}, { label: "Audit Log" }],
|
|
90
|
-
children: /* @__PURE__ */
|
|
91
|
+
children: /* @__PURE__ */ u("div", {
|
|
91
92
|
className: "space-y-6",
|
|
92
93
|
children: [
|
|
93
|
-
/* @__PURE__ */
|
|
94
|
+
/* @__PURE__ */ l(r, {
|
|
94
95
|
className: "p-4",
|
|
95
|
-
children: /* @__PURE__ */
|
|
96
|
+
children: /* @__PURE__ */ u("div", {
|
|
96
97
|
className: "flex flex-col sm:flex-row gap-3",
|
|
97
98
|
children: [
|
|
98
|
-
/* @__PURE__ */
|
|
99
|
+
/* @__PURE__ */ l(i, {
|
|
99
100
|
label: "Action",
|
|
100
|
-
value:
|
|
101
|
-
onChange:
|
|
102
|
-
options:
|
|
101
|
+
value: v,
|
|
102
|
+
onChange: y,
|
|
103
|
+
options: g,
|
|
103
104
|
className: "w-full sm:w-[200px]"
|
|
104
105
|
}),
|
|
105
|
-
/* @__PURE__ */
|
|
106
|
+
/* @__PURE__ */ u("div", {
|
|
106
107
|
className: "space-y-1.5 w-full sm:w-auto",
|
|
107
|
-
children: [/* @__PURE__ */
|
|
108
|
+
children: [/* @__PURE__ */ l("label", {
|
|
108
109
|
htmlFor: "audit-date-from",
|
|
109
110
|
className: "text-sm font-medium text-text-primary",
|
|
110
111
|
children: "From"
|
|
111
|
-
}), /* @__PURE__ */
|
|
112
|
+
}), /* @__PURE__ */ l("input", {
|
|
112
113
|
id: "audit-date-from",
|
|
113
114
|
"aria-label": "Audit log start date",
|
|
114
115
|
type: "date",
|
|
115
|
-
value:
|
|
116
|
-
onChange: (e) =>
|
|
116
|
+
value: b,
|
|
117
|
+
onChange: (e) => x(e.target.value),
|
|
117
118
|
className: "flex h-9 w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-1 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]"
|
|
118
119
|
})]
|
|
119
120
|
}),
|
|
120
|
-
/* @__PURE__ */
|
|
121
|
+
/* @__PURE__ */ u("div", {
|
|
121
122
|
className: "space-y-1.5 w-full sm:w-auto",
|
|
122
|
-
children: [/* @__PURE__ */
|
|
123
|
+
children: [/* @__PURE__ */ l("label", {
|
|
123
124
|
htmlFor: "audit-date-to",
|
|
124
125
|
className: "text-sm font-medium text-text-primary",
|
|
125
126
|
children: "To"
|
|
126
|
-
}), /* @__PURE__ */
|
|
127
|
+
}), /* @__PURE__ */ l("input", {
|
|
127
128
|
id: "audit-date-to",
|
|
128
129
|
"aria-label": "Audit log end date",
|
|
129
130
|
type: "date",
|
|
130
|
-
value:
|
|
131
|
-
onChange: (e) =>
|
|
131
|
+
value: S,
|
|
132
|
+
onChange: (e) => C(e.target.value),
|
|
132
133
|
className: "flex h-9 w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-1 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]"
|
|
133
134
|
})]
|
|
134
135
|
})
|
|
135
136
|
]
|
|
136
137
|
})
|
|
137
138
|
}),
|
|
138
|
-
|
|
139
|
+
D && (("graphQLErrors" in D && Array.isArray(D.graphQLErrors) ? D.graphQLErrors : []).some((e) => e.extensions?.code === "FORBIDDEN" || e.extensions?.code === "UNAUTHORIZED") || /forbidden|unauthor/i.test(D.message) ? /* @__PURE__ */ l(r, {
|
|
139
140
|
className: "p-6 border-warning/20 bg-warning/5",
|
|
140
|
-
children: /* @__PURE__ */
|
|
141
|
+
children: /* @__PURE__ */ u("div", {
|
|
141
142
|
className: "flex items-start gap-4",
|
|
142
|
-
children: [/* @__PURE__ */
|
|
143
|
+
children: [/* @__PURE__ */ l("div", {
|
|
143
144
|
className: "p-2 rounded-lg bg-warning/10",
|
|
144
|
-
children: /* @__PURE__ */
|
|
145
|
-
}), /* @__PURE__ */
|
|
145
|
+
children: /* @__PURE__ */ l(f, { className: "size-6 text-warning" })
|
|
146
|
+
}), /* @__PURE__ */ u("div", {
|
|
146
147
|
className: "flex-1",
|
|
147
|
-
children: [/* @__PURE__ */
|
|
148
|
+
children: [/* @__PURE__ */ l("h3", {
|
|
148
149
|
className: "font-semibold text-text-primary mb-1",
|
|
149
150
|
children: "Audit log access restricted"
|
|
150
|
-
}), /* @__PURE__ */
|
|
151
|
+
}), /* @__PURE__ */ l("p", {
|
|
151
152
|
className: "text-sm text-text-secondary",
|
|
152
153
|
children: "Your role doesn't include permission to view security audit logs. Contact your workspace owner or security administrator if you need access for compliance review."
|
|
153
154
|
})]
|
|
154
155
|
})]
|
|
155
156
|
})
|
|
156
|
-
}) : /* @__PURE__ */
|
|
157
|
+
}) : /* @__PURE__ */ l(r, {
|
|
157
158
|
className: "p-6 border-status-error-border/20 bg-status-error-bg/5",
|
|
158
|
-
children: /* @__PURE__ */
|
|
159
|
+
children: /* @__PURE__ */ u("div", {
|
|
159
160
|
className: "flex items-start gap-4",
|
|
160
|
-
children: [/* @__PURE__ */
|
|
161
|
+
children: [/* @__PURE__ */ l("div", {
|
|
161
162
|
className: "p-2 rounded-lg bg-status-error-bg/10",
|
|
162
|
-
children: /* @__PURE__ */
|
|
163
|
-
}), /* @__PURE__ */
|
|
163
|
+
children: /* @__PURE__ */ l(f, { className: "size-6 text-status-error-text" })
|
|
164
|
+
}), /* @__PURE__ */ u("div", {
|
|
164
165
|
className: "flex-1",
|
|
165
166
|
children: [
|
|
166
|
-
/* @__PURE__ */
|
|
167
|
+
/* @__PURE__ */ l("h3", {
|
|
167
168
|
className: "font-semibold text-status-error-text mb-1",
|
|
168
169
|
children: "Failed to load audit logs"
|
|
169
170
|
}),
|
|
170
|
-
/* @__PURE__ */
|
|
171
|
+
/* @__PURE__ */ l("p", {
|
|
171
172
|
className: "text-sm text-text-secondary mb-3",
|
|
172
|
-
children:
|
|
173
|
+
children: D.message
|
|
173
174
|
}),
|
|
174
|
-
/* @__PURE__ */
|
|
175
|
+
/* @__PURE__ */ u(n, {
|
|
175
176
|
variant: "outline",
|
|
176
177
|
size: "sm",
|
|
177
|
-
onClick: () =>
|
|
178
|
-
children: [/* @__PURE__ */
|
|
178
|
+
onClick: () => O(),
|
|
179
|
+
children: [/* @__PURE__ */ l(m, { className: "size-4" }), "Retry"]
|
|
179
180
|
})
|
|
180
181
|
]
|
|
181
182
|
})]
|
|
182
183
|
})
|
|
183
184
|
})),
|
|
184
|
-
|
|
185
|
+
E && /* @__PURE__ */ l("div", {
|
|
185
186
|
className: "flex items-center justify-center py-16",
|
|
186
|
-
children: /* @__PURE__ */
|
|
187
|
+
children: /* @__PURE__ */ l(p, { className: "size-8 animate-spin text-primary" })
|
|
187
188
|
}),
|
|
188
|
-
!
|
|
189
|
+
!E && !D && k.length > 0 && /* @__PURE__ */ u(r, {
|
|
189
190
|
className: "p-6",
|
|
190
|
-
children: [/* @__PURE__ */
|
|
191
|
+
children: [/* @__PURE__ */ l("div", {
|
|
191
192
|
className: "flex items-center justify-between mb-6",
|
|
192
|
-
children: /* @__PURE__ */
|
|
193
|
+
children: /* @__PURE__ */ u("h2", {
|
|
193
194
|
className: "text-lg font-bold text-text-primary flex items-center gap-2",
|
|
194
|
-
children: [/* @__PURE__ */
|
|
195
|
+
children: [/* @__PURE__ */ l(d, { className: "size-5 text-primary" }), "Activity Timeline"]
|
|
195
196
|
})
|
|
196
|
-
}), /* @__PURE__ */
|
|
197
|
+
}), /* @__PURE__ */ l(o, { entries: k })]
|
|
197
198
|
}),
|
|
198
|
-
!
|
|
199
|
-
|
|
199
|
+
!E && !D && k.length === 0 && /* @__PURE__ */ l(h, {
|
|
200
|
+
illustration: v !== "all" || b || S ? "empty-search" : "empty-data",
|
|
200
201
|
title: "No audit logs",
|
|
201
|
-
description:
|
|
202
|
+
description: v !== "all" || b || S ? "No logs match the selected filters." : "Audit logs will appear here as actions are performed."
|
|
202
203
|
})
|
|
203
204
|
]
|
|
204
205
|
})
|
|
205
206
|
});
|
|
206
207
|
}
|
|
207
208
|
//#endregion
|
|
208
|
-
export {
|
|
209
|
+
export { _ as AuditLogPage };
|
|
209
210
|
|
|
210
211
|
//# sourceMappingURL=AuditLogPage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AuditLogPage.js","names":[],"sources":["../../../src/security/pages/AuditLogPage.tsx"],"sourcesContent":["import { useState } from 'react';\nimport { FileSearch, Loader2, AlertTriangle, RefreshCw, Activity } from 'lucide-react';\nimport { PageLayout } from '../components/PageLayout';\nimport { ActivityTimeline } from '../components/ActivityTimeline';\nimport { Button, Card, Select, EmptyState } from '../components/ui';\nimport { useVaultAuditLogs } from '../hooks/useAuditLog';\nimport { useSecurityStore } from '../store/securityStore';\nimport { useSecurity } from '../providers/SecurityProvider';\nimport type { AuditAction } from '../types';\n\nconst ACTION_OPTIONS: Array<{ value: string; label: string }> = [\n { value: 'all', label: 'All Actions' },\n { value: 'vault.created', label: 'Vault Created' },\n { value: 'vault.updated', label: 'Vault Updated' },\n { value: 'vault.deleted', label: 'Vault Deleted' },\n { value: 'vault.locked', label: 'Vault Locked' },\n { value: 'vault.unlocked', label: 'Vault Unlocked' },\n { value: 'secret.created', label: 'Secret Created' },\n { value: 'secret.updated', label: 'Secret Updated' },\n { value: 'secret.deleted', label: 'Secret Deleted' },\n { value: 'secret.accessed', label: 'Secret Accessed' },\n { value: 'secret.rotated', label: 'Secret Rotated' },\n { value: 'member.added', label: 'Member Added' },\n { value: 'member.removed', label: 'Member Removed' },\n { value: 'provider.synced', label: 'Provider Synced' },\n { value: 'import.completed', label: 'Import Completed' },\n { value: 'export.completed', label: 'Export Completed' },\n];\n\nexport function AuditLogPage() {\n const { basePath = '/' } = useSecurity();\n const auditFilter = useSecurityStore((s) => s.auditFilter);\n const updateAuditFilter = useSecurityStore((s) => s.updateAuditFilter);\n\n const [actionFilter, setActionFilter] = useState<string>('all');\n const [dateFrom, setDateFrom] = useState('');\n const [dateTo, setDateTo] = useState('');\n\n const filter: Record<string, unknown> = {};\n if (actionFilter !== 'all') filter.action = actionFilter;\n if (dateFrom) filter.dateFrom = dateFrom;\n if (dateTo) filter.dateTo = dateTo;\n\n const { data, loading, error, refetch } = useVaultAuditLogs(\n undefined,\n Object.keys(filter).length > 0 ? filter : undefined,\n { limit: 50 }\n );\n\n const auditLogs = data?.getVaultAuditLogs?.items ?? [];\n const totalLogs = data?.getVaultAuditLogs?.total ?? 0;\n\n return (\n <PageLayout\n title=\"Audit Log\"\n description=\"Track all security-related actions across vaults and secrets.\"\n breadcrumbs={[{ label: 'Security', path: basePath }, { label: 'Audit Log' }]}\n >\n <div className=\"space-y-6\">\n {/* Filters */}\n <Card className=\"p-4\">\n <div className=\"flex flex-col sm:flex-row gap-3\">\n <Select\n label=\"Action\"\n value={actionFilter}\n onChange={setActionFilter}\n options={ACTION_OPTIONS}\n className=\"w-full sm:w-[200px]\"\n />\n <div className=\"space-y-1.5 w-full sm:w-auto\">\n <label htmlFor=\"audit-date-from\" className=\"text-sm font-medium text-text-primary\">\n From\n </label>\n <input\n id=\"audit-date-from\"\n aria-label=\"Audit log start date\"\n type=\"date\"\n value={dateFrom}\n onChange={(e) => setDateFrom(e.target.value)}\n className=\"flex h-9 w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-1 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]\"\n />\n </div>\n <div className=\"space-y-1.5 w-full sm:w-auto\">\n <label htmlFor=\"audit-date-to\" className=\"text-sm font-medium text-text-primary\">\n To\n </label>\n <input\n id=\"audit-date-to\"\n aria-label=\"Audit log end date\"\n type=\"date\"\n value={dateTo}\n onChange={(e) => setDateTo(e.target.value)}\n className=\"flex h-9 w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-1 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]\"\n />\n </div>\n </div>\n </Card>\n\n {/* Error */}\n {error &&\n (() => {\n // Surface a friendlier message when the backend denies the read\n // (audit-log requires action:\"read\", resource:\"audit-log\" — typically\n // only granted to security/compliance roles, not regular workspace\n // admins). Without this branch the page renders the generic\n // destructive card with \"Forbidden\" which doesn't tell the user\n // who to talk to. Apollo v4 hides graphQLErrors behind a category\n // type guard so duck-type the field rather than asserting it.\n const apolloErrors =\n 'graphQLErrors' in error &&\n Array.isArray((error as { graphQLErrors?: unknown }).graphQLErrors)\n ? (error as { graphQLErrors: Array<{ extensions?: { code?: string } }> })\n .graphQLErrors\n : [];\n const isForbidden =\n apolloErrors.some(\n (e) => e.extensions?.code === 'FORBIDDEN' || e.extensions?.code === 'UNAUTHORIZED'\n ) || /forbidden|unauthor/i.test(error.message);\n\n if (isForbidden) {\n return (\n <Card className=\"p-6 border-warning/20 bg-warning/5\">\n <div className=\"flex items-start gap-4\">\n <div className=\"p-2 rounded-lg bg-warning/10\">\n <AlertTriangle className=\"size-6 text-warning\" />\n </div>\n <div className=\"flex-1\">\n <h3 className=\"font-semibold text-text-primary mb-1\">\n Audit log access restricted\n </h3>\n <p className=\"text-sm text-text-secondary\">\n Your role doesn't include permission to view security audit logs. Contact\n your workspace owner or security administrator if you need access for\n compliance review.\n </p>\n </div>\n </div>\n </Card>\n );\n }\n\n return (\n <Card className=\"p-6 border-status-error-border/20 bg-status-error-bg/5\">\n <div className=\"flex items-start gap-4\">\n <div className=\"p-2 rounded-lg bg-status-error-bg/10\">\n <AlertTriangle className=\"size-6 text-status-error-text\" />\n </div>\n <div className=\"flex-1\">\n <h3 className=\"font-semibold text-status-error-text mb-1\">\n Failed to load audit logs\n </h3>\n <p className=\"text-sm text-text-secondary mb-3\">{error.message}</p>\n <Button variant=\"outline\" size=\"sm\" onClick={() => refetch()}>\n <RefreshCw className=\"size-4\" />\n Retry\n </Button>\n </div>\n </div>\n </Card>\n );\n })()}\n\n {/* Loading */}\n {loading && (\n <div className=\"flex items-center justify-center py-16\">\n <Loader2 className=\"size-8 animate-spin text-primary\" />\n </div>\n )}\n\n {/* Audit logs timeline */}\n {!loading && !error && auditLogs.length > 0 && (\n <Card className=\"p-6\">\n <div className=\"flex items-center justify-between mb-6\">\n <h2 className=\"text-lg font-bold text-text-primary flex items-center gap-2\">\n <Activity className=\"size-5 text-primary\" />\n Activity Timeline\n </h2>\n </div>\n <ActivityTimeline entries={auditLogs} />\n </Card>\n )}\n\n {/* Empty */}\n {!loading && !error && auditLogs.length === 0 && (\n <EmptyState\n icon={<FileSearch className=\"size-12 text-text-secondary/30\" />}\n title=\"No audit logs\"\n description={\n actionFilter !== 'all' || dateFrom || dateTo\n ? 'No logs match the selected filters.'\n : 'Audit logs will appear here as actions are performed.'\n }\n />\n )}\n </div>\n </PageLayout>\n );\n}\n"],"mappings":";;;;;;;;;;AAUA,IAAM,IAA0D;CAC9D;EAAE,OAAO;EAAO,OAAO;EAAe;CACtC;EAAE,OAAO;EAAiB,OAAO;EAAiB;CAClD;EAAE,OAAO;EAAiB,OAAO;EAAiB;CAClD;EAAE,OAAO;EAAiB,OAAO;EAAiB;CAClD;EAAE,OAAO;EAAgB,OAAO;EAAgB;CAChD;EAAE,OAAO;EAAkB,OAAO;EAAkB;CACpD;EAAE,OAAO;EAAkB,OAAO;EAAkB;CACpD;EAAE,OAAO;EAAkB,OAAO;EAAkB;CACpD;EAAE,OAAO;EAAkB,OAAO;EAAkB;CACpD;EAAE,OAAO;EAAmB,OAAO;EAAmB;CACtD;EAAE,OAAO;EAAkB,OAAO;EAAkB;CACpD;EAAE,OAAO;EAAgB,OAAO;EAAgB;CAChD;EAAE,OAAO;EAAkB,OAAO;EAAkB;CACpD;EAAE,OAAO;EAAmB,OAAO;EAAmB;CACtD;EAAE,OAAO;EAAoB,OAAO;EAAoB;CACxD;EAAE,OAAO;EAAoB,OAAO;EAAoB;CACzD;AAED,SAAgB,IAAe;CAC7B,IAAM,EAAE,cAAW,QAAQ,GAAa;AAEd,CADN,GAAkB,MAAM,EAAE,YAAY,EAChC,GAAkB,MAAM,EAAE,kBAAkB;CAEtE,IAAM,CAAC,GAAc,KAAmB,EAAiB,MAAM,EACzD,CAAC,GAAU,KAAe,EAAS,GAAG,EACtC,CAAC,GAAQ,KAAa,EAAS,GAAG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AW,KAC1C,kBAAC,GAAD;KACE,MAAM,kBAAC,GAAD,EAAY,WAAU,kCAAmC,CAAA;KAC/D,OAAM;KACN,aACE,MAAiB,SAAS,KAAY,IAClC,wCACA;KAEN,CAAA;IAEA;;EACK,CAAA"}
|
|
1
|
+
{"version":3,"file":"AuditLogPage.js","names":[],"sources":["../../../src/security/pages/AuditLogPage.tsx"],"sourcesContent":["import { useState } from 'react';\nimport { Loader2, AlertTriangle, RefreshCw, Activity } from 'lucide-react';\nimport { IllustratedEmptyState } from '@burdenoff/fe-libs/ui';\nimport { PageLayout } from '../components/PageLayout';\nimport { ActivityTimeline } from '../components/ActivityTimeline';\nimport { Button, Card, Select } from '../components/ui';\nimport { useVaultAuditLogs } from '../hooks/useAuditLog';\nimport { useSecurityStore } from '../store/securityStore';\nimport { useSecurity } from '../providers/SecurityProvider';\nimport type { AuditAction } from '../types';\n\nconst ACTION_OPTIONS: Array<{ value: string; label: string }> = [\n { value: 'all', label: 'All Actions' },\n { value: 'vault.created', label: 'Vault Created' },\n { value: 'vault.updated', label: 'Vault Updated' },\n { value: 'vault.deleted', label: 'Vault Deleted' },\n { value: 'vault.locked', label: 'Vault Locked' },\n { value: 'vault.unlocked', label: 'Vault Unlocked' },\n { value: 'secret.created', label: 'Secret Created' },\n { value: 'secret.updated', label: 'Secret Updated' },\n { value: 'secret.deleted', label: 'Secret Deleted' },\n { value: 'secret.accessed', label: 'Secret Accessed' },\n { value: 'secret.rotated', label: 'Secret Rotated' },\n { value: 'member.added', label: 'Member Added' },\n { value: 'member.removed', label: 'Member Removed' },\n { value: 'provider.synced', label: 'Provider Synced' },\n { value: 'import.completed', label: 'Import Completed' },\n { value: 'export.completed', label: 'Export Completed' },\n];\n\nexport function AuditLogPage() {\n const { basePath = '/' } = useSecurity();\n const auditFilter = useSecurityStore((s) => s.auditFilter);\n const updateAuditFilter = useSecurityStore((s) => s.updateAuditFilter);\n\n const [actionFilter, setActionFilter] = useState<string>('all');\n const [dateFrom, setDateFrom] = useState('');\n const [dateTo, setDateTo] = useState('');\n\n const filter: Record<string, unknown> = {};\n if (actionFilter !== 'all') filter.action = actionFilter;\n if (dateFrom) filter.dateFrom = dateFrom;\n if (dateTo) filter.dateTo = dateTo;\n\n const { data, loading, error, refetch } = useVaultAuditLogs(\n undefined,\n Object.keys(filter).length > 0 ? filter : undefined,\n { limit: 50 }\n );\n\n const auditLogs = data?.getVaultAuditLogs?.items ?? [];\n const totalLogs = data?.getVaultAuditLogs?.total ?? 0;\n\n return (\n <PageLayout\n title=\"Audit Log\"\n description=\"Track all security-related actions across vaults and secrets.\"\n breadcrumbs={[{ label: 'Security', path: basePath }, { label: 'Audit Log' }]}\n >\n <div className=\"space-y-6\">\n {/* Filters */}\n <Card className=\"p-4\">\n <div className=\"flex flex-col sm:flex-row gap-3\">\n <Select\n label=\"Action\"\n value={actionFilter}\n onChange={setActionFilter}\n options={ACTION_OPTIONS}\n className=\"w-full sm:w-[200px]\"\n />\n <div className=\"space-y-1.5 w-full sm:w-auto\">\n <label htmlFor=\"audit-date-from\" className=\"text-sm font-medium text-text-primary\">\n From\n </label>\n <input\n id=\"audit-date-from\"\n aria-label=\"Audit log start date\"\n type=\"date\"\n value={dateFrom}\n onChange={(e) => setDateFrom(e.target.value)}\n className=\"flex h-9 w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-1 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]\"\n />\n </div>\n <div className=\"space-y-1.5 w-full sm:w-auto\">\n <label htmlFor=\"audit-date-to\" className=\"text-sm font-medium text-text-primary\">\n To\n </label>\n <input\n id=\"audit-date-to\"\n aria-label=\"Audit log end date\"\n type=\"date\"\n value={dateTo}\n onChange={(e) => setDateTo(e.target.value)}\n className=\"flex h-9 w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-1 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]\"\n />\n </div>\n </div>\n </Card>\n\n {/* Error */}\n {error &&\n (() => {\n // Surface a friendlier message when the backend denies the read\n // (audit-log requires action:\"read\", resource:\"audit-log\" — typically\n // only granted to security/compliance roles, not regular workspace\n // admins). Without this branch the page renders the generic\n // destructive card with \"Forbidden\" which doesn't tell the user\n // who to talk to. Apollo v4 hides graphQLErrors behind a category\n // type guard so duck-type the field rather than asserting it.\n const apolloErrors =\n 'graphQLErrors' in error &&\n Array.isArray((error as { graphQLErrors?: unknown }).graphQLErrors)\n ? (error as { graphQLErrors: Array<{ extensions?: { code?: string } }> })\n .graphQLErrors\n : [];\n const isForbidden =\n apolloErrors.some(\n (e) => e.extensions?.code === 'FORBIDDEN' || e.extensions?.code === 'UNAUTHORIZED'\n ) || /forbidden|unauthor/i.test(error.message);\n\n if (isForbidden) {\n return (\n <Card className=\"p-6 border-warning/20 bg-warning/5\">\n <div className=\"flex items-start gap-4\">\n <div className=\"p-2 rounded-lg bg-warning/10\">\n <AlertTriangle className=\"size-6 text-warning\" />\n </div>\n <div className=\"flex-1\">\n <h3 className=\"font-semibold text-text-primary mb-1\">\n Audit log access restricted\n </h3>\n <p className=\"text-sm text-text-secondary\">\n Your role doesn't include permission to view security audit logs. Contact\n your workspace owner or security administrator if you need access for\n compliance review.\n </p>\n </div>\n </div>\n </Card>\n );\n }\n\n return (\n <Card className=\"p-6 border-status-error-border/20 bg-status-error-bg/5\">\n <div className=\"flex items-start gap-4\">\n <div className=\"p-2 rounded-lg bg-status-error-bg/10\">\n <AlertTriangle className=\"size-6 text-status-error-text\" />\n </div>\n <div className=\"flex-1\">\n <h3 className=\"font-semibold text-status-error-text mb-1\">\n Failed to load audit logs\n </h3>\n <p className=\"text-sm text-text-secondary mb-3\">{error.message}</p>\n <Button variant=\"outline\" size=\"sm\" onClick={() => refetch()}>\n <RefreshCw className=\"size-4\" />\n Retry\n </Button>\n </div>\n </div>\n </Card>\n );\n })()}\n\n {/* Loading */}\n {loading && (\n <div className=\"flex items-center justify-center py-16\">\n <Loader2 className=\"size-8 animate-spin text-primary\" />\n </div>\n )}\n\n {/* Audit logs timeline */}\n {!loading && !error && auditLogs.length > 0 && (\n <Card className=\"p-6\">\n <div className=\"flex items-center justify-between mb-6\">\n <h2 className=\"text-lg font-bold text-text-primary flex items-center gap-2\">\n <Activity className=\"size-5 text-primary\" />\n Activity Timeline\n </h2>\n </div>\n <ActivityTimeline entries={auditLogs} />\n </Card>\n )}\n\n {/* Empty */}\n {!loading && !error && auditLogs.length === 0 && (\n <IllustratedEmptyState\n illustration={\n actionFilter !== 'all' || dateFrom || dateTo ? 'empty-search' : 'empty-data'\n }\n title=\"No audit logs\"\n description={\n actionFilter !== 'all' || dateFrom || dateTo\n ? 'No logs match the selected filters.'\n : 'Audit logs will appear here as actions are performed.'\n }\n />\n )}\n </div>\n </PageLayout>\n );\n}\n"],"mappings":";;;;;;;;;;;AAWA,IAAM,IAA0D;CAC9D;EAAE,OAAO;EAAO,OAAO;EAAe;CACtC;EAAE,OAAO;EAAiB,OAAO;EAAiB;CAClD;EAAE,OAAO;EAAiB,OAAO;EAAiB;CAClD;EAAE,OAAO;EAAiB,OAAO;EAAiB;CAClD;EAAE,OAAO;EAAgB,OAAO;EAAgB;CAChD;EAAE,OAAO;EAAkB,OAAO;EAAkB;CACpD;EAAE,OAAO;EAAkB,OAAO;EAAkB;CACpD;EAAE,OAAO;EAAkB,OAAO;EAAkB;CACpD;EAAE,OAAO;EAAkB,OAAO;EAAkB;CACpD;EAAE,OAAO;EAAmB,OAAO;EAAmB;CACtD;EAAE,OAAO;EAAkB,OAAO;EAAkB;CACpD;EAAE,OAAO;EAAgB,OAAO;EAAgB;CAChD;EAAE,OAAO;EAAkB,OAAO;EAAkB;CACpD;EAAE,OAAO;EAAmB,OAAO;EAAmB;CACtD;EAAE,OAAO;EAAoB,OAAO;EAAoB;CACxD;EAAE,OAAO;EAAoB,OAAO;EAAoB;CACzD;AAED,SAAgB,IAAe;CAC7B,IAAM,EAAE,cAAW,QAAQ,GAAa;AAEd,CADN,GAAkB,MAA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BAAd,CACE,kBAAC,GAAD,EAAU,WAAU,uBAAwB,CAAA,EAAA,oBAEzC;;MACD,CAAA,EACN,kBAAC,GAAD,EAAkB,SAAS,GAAa,CAAA,CACnC;;IAIR,CAAC,KAAW,CAAC,KAAS,EAAU,WAAW,KAC1C,kBAAC,GAAD;KACE,cACE,MAAiB,SAAS,KAAY,IAAS,iBAAiB;KAElE,OAAM;KACN,aACE,MAAiB,SAAS,KAAY,IAClC,wCACA;KAEN,CAAA;IAEA;;EACK,CAAA"}
|
|
@@ -162,9 +162,12 @@ function j() {
|
|
|
162
162
|
/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("p", {
|
|
163
163
|
className: "text-xs font-medium text-text-secondary uppercase tracking-wider mb-1",
|
|
164
164
|
children: "Status"
|
|
165
|
-
}), /* @__PURE__ */
|
|
165
|
+
}), /* @__PURE__ */ y(r, {
|
|
166
166
|
variant: z.syncEnabled ? "success" : "outline",
|
|
167
|
-
children: z.syncEnabled
|
|
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"]
|
|
168
171
|
})] }),
|
|
169
172
|
/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("p", {
|
|
170
173
|
className: "text-xs font-medium text-text-secondary uppercase tracking-wider mb-1",
|
|
@@ -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 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 ? '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,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,gBA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C9E,kBAAC,KAAD;OAAG,WAAU;iBAAmC;OAE5C,CAAA;MACA;OAEH;MACH;MAEN,kBAAC,GAAD;GACE,QAAQ;GACR,eAAe,EAAqB,GAAM;GAC1C,WAAW;GACX,OAAM;GACN,aAAa,wCAAwC,EAAS,MAAM;GACpE,cAAc,IAAW,gBAAgB;GACzC,SAAQ;GACR,CAAA,CACS"}
|
|
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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WACb,gBACA;QAER,WAAU;kBAET,EAAI;QACC,CAAA;OAEX;MACD;OACE,KAAK;OACL,QAAQ;OACR,OAAO,MACL,kBAAC,QAAD;QAAM,WAAU;kBACb,EAAI;QACA,CAAA;OAEV;MACD;OACE,KAAK;OACL,QAAQ;OACR,OAAO,MACL,kBAAC,QAAD;QAAM,WAAU;kBACb,EAAI,aAAa,GAAG,EAAI,WAAW,MAAM;QACrC,CAAA;OAEV;MACD;OACE,KAAK;OACL,QAAQ;OACR,OAAO,MACL,EAAI,eACF,kBAAC,OAAD;QAAK,WAAU;kBAAf,CACE,kBAAC,GAAD,EAAS,WAAU,YAAa,CAAA,EAChC,kBAAC,QAAD;SAAM,WAAU;SAAW,OAAO,EAAI;mBACnC,EAAI;SACA,CAAA,CACH;YAEN,kBAAC,QAAD;QAAM,WAAU;kBAAsB;QAAQ,CAAA;OAEnD;MACF;KAEH,CAAA,GAEF,kBAAC,OAAD;KAAK,WAAU;eAAf;MACE,kBAAC,IAAD,EAAM,WAAU,+CAAgD,CAAA;MAChE,kBAAC,KAAD;OAAG,WAAU;iBAA0C;OAAuB,CAAA;MAC9E,kBAAC,KAAD;OAAG,WAAU;iBAAmC;OAE5C,CAAA;MACA;OAEH;MACH;MAEN,kBAAC,GAAD;GACE,QAAQ;GACR,eAAe,EAAqB,GAAM;GAC1C,WAAW;GACX,OAAM;GACN,aAAa,wCAAwC,EAAS,MAAM;GACpE,cAAc,IAAW,gBAAgB;GACzC,SAAQ;GACR,CAAA,CACS"}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { useSecurity as e } from "../providers/SecurityProvider.js";
|
|
2
2
|
import { PageLayout as t } from "../components/PageLayout.js";
|
|
3
|
-
import { Badge as n, Button as r, Card as i,
|
|
4
|
-
import { useGetVaults as
|
|
5
|
-
import { useVaultIntegrations as
|
|
6
|
-
import { getProviderTypeInfo as
|
|
7
|
-
import { useState as
|
|
8
|
-
import { useNavigate as
|
|
9
|
-
import { jsx as
|
|
10
|
-
import { AlertTriangle as
|
|
11
|
-
import { GlassCard as S } from "@burdenoff/fe-libs/ui";
|
|
3
|
+
import { Badge as n, Button as r, Card as i, Select as a } from "../components/ui.js";
|
|
4
|
+
import { useGetVaults as o } from "../hooks/useVaultQueries.js";
|
|
5
|
+
import { useVaultIntegrations as s } from "../hooks/useProviderQueries.js";
|
|
6
|
+
import { getProviderTypeInfo as c } from "../constants/providers.js";
|
|
7
|
+
import { useState as l } from "react";
|
|
8
|
+
import { useNavigate as u } from "react-router-dom";
|
|
9
|
+
import { jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
10
|
+
import { AlertTriangle as p, CheckCircle as m, Clock as h, Cloud as g, Loader2 as _, Lock as v, RefreshCw as y, XCircle as b } from "lucide-react";
|
|
11
|
+
import { GlassCard as x, IllustratedEmptyState as S } from "@burdenoff/fe-libs/ui";
|
|
12
12
|
//#region src/security/pages/ProvidersPage.tsx
|
|
13
13
|
function C() {
|
|
14
|
-
let { basePath: C = "/", navigate: w } = e(), T =
|
|
14
|
+
let { basePath: C = "/", navigate: w } = e(), T = u(), [E, D] = l(""), { data: O, loading: k } = o(void 0, { limit: 100 }), A = O?.getVaults?.items ?? [], { data: j, loading: M, error: N, refetch: P } = s(E || void 0), F = j?.getVaultIntegrations?.items ?? [], I = (e) => {
|
|
15
15
|
w ? w(e) : T(e);
|
|
16
16
|
}, L = [{
|
|
17
17
|
value: "",
|
|
@@ -23,128 +23,128 @@ function C() {
|
|
|
23
23
|
connected: {
|
|
24
24
|
label: "Connected",
|
|
25
25
|
variant: "success",
|
|
26
|
-
icon:
|
|
26
|
+
icon: m
|
|
27
27
|
},
|
|
28
28
|
disconnected: {
|
|
29
29
|
label: "Disconnected",
|
|
30
30
|
variant: "outline",
|
|
31
|
-
icon:
|
|
31
|
+
icon: b
|
|
32
32
|
},
|
|
33
33
|
error: {
|
|
34
34
|
label: "Error",
|
|
35
35
|
variant: "destructive",
|
|
36
|
-
icon:
|
|
36
|
+
icon: p
|
|
37
37
|
},
|
|
38
38
|
syncing: {
|
|
39
39
|
label: "Syncing",
|
|
40
40
|
variant: "warning",
|
|
41
|
-
icon:
|
|
41
|
+
icon: y
|
|
42
42
|
}
|
|
43
43
|
};
|
|
44
|
-
return /* @__PURE__ */
|
|
44
|
+
return /* @__PURE__ */ d(t, {
|
|
45
45
|
title: "Providers",
|
|
46
46
|
description: "Connect external secret management providers.",
|
|
47
47
|
breadcrumbs: [{
|
|
48
48
|
label: "Security",
|
|
49
49
|
path: C
|
|
50
50
|
}, { label: "Providers" }],
|
|
51
|
-
children: /* @__PURE__ */
|
|
51
|
+
children: /* @__PURE__ */ f("div", {
|
|
52
52
|
className: "space-y-6",
|
|
53
53
|
children: [
|
|
54
|
-
/* @__PURE__ */
|
|
54
|
+
/* @__PURE__ */ d(x, {
|
|
55
55
|
treatment: "insight",
|
|
56
56
|
className: "p-4",
|
|
57
|
-
children: /* @__PURE__ */
|
|
57
|
+
children: /* @__PURE__ */ d("p", {
|
|
58
58
|
className: "text-sm text-text-secondary",
|
|
59
59
|
children: "Provider sync infrastructure is available, but guided provider onboarding is still being finalized. Existing connections can be reviewed here."
|
|
60
60
|
})
|
|
61
61
|
}),
|
|
62
|
-
/* @__PURE__ */
|
|
62
|
+
/* @__PURE__ */ d("div", {
|
|
63
63
|
className: "max-w-sm",
|
|
64
|
-
children: /* @__PURE__ */
|
|
64
|
+
children: /* @__PURE__ */ d(a, {
|
|
65
65
|
label: "Vault",
|
|
66
66
|
value: E,
|
|
67
67
|
onChange: D,
|
|
68
68
|
options: L
|
|
69
69
|
})
|
|
70
70
|
}),
|
|
71
|
-
!E && !k && /* @__PURE__ */
|
|
71
|
+
!E && !k && /* @__PURE__ */ f(i, {
|
|
72
72
|
className: "p-8 text-center",
|
|
73
|
-
children: [/* @__PURE__ */
|
|
73
|
+
children: [/* @__PURE__ */ d(v, { className: "size-10 text-text-secondary mx-auto mb-3" }), /* @__PURE__ */ d("p", {
|
|
74
74
|
className: "text-sm text-text-secondary",
|
|
75
75
|
children: "Select a vault to view its provider integrations."
|
|
76
76
|
})]
|
|
77
77
|
}),
|
|
78
|
-
k && /* @__PURE__ */
|
|
78
|
+
k && /* @__PURE__ */ d("div", {
|
|
79
79
|
className: "flex items-center justify-center py-16",
|
|
80
|
-
children: /* @__PURE__ */
|
|
80
|
+
children: /* @__PURE__ */ d(_, { className: "size-8 animate-spin text-primary" })
|
|
81
81
|
}),
|
|
82
|
-
E && M && /* @__PURE__ */
|
|
82
|
+
E && M && /* @__PURE__ */ d("div", {
|
|
83
83
|
className: "flex items-center justify-center py-16",
|
|
84
|
-
children: /* @__PURE__ */
|
|
84
|
+
children: /* @__PURE__ */ d(_, { className: "size-8 animate-spin text-primary" })
|
|
85
85
|
}),
|
|
86
|
-
E && N && /* @__PURE__ */
|
|
86
|
+
E && N && /* @__PURE__ */ d(i, {
|
|
87
87
|
className: "p-6",
|
|
88
|
-
children: /* @__PURE__ */
|
|
88
|
+
children: /* @__PURE__ */ f("div", {
|
|
89
89
|
className: "flex items-start gap-4",
|
|
90
|
-
children: [/* @__PURE__ */
|
|
91
|
-
/* @__PURE__ */
|
|
90
|
+
children: [/* @__PURE__ */ d(p, { className: "size-6 text-status-error-text" }), /* @__PURE__ */ f("div", { children: [
|
|
91
|
+
/* @__PURE__ */ d("h3", {
|
|
92
92
|
className: "font-semibold text-status-error-text",
|
|
93
93
|
children: "Failed to load providers"
|
|
94
94
|
}),
|
|
95
|
-
/* @__PURE__ */
|
|
95
|
+
/* @__PURE__ */ d("p", {
|
|
96
96
|
className: "text-sm text-text-secondary mt-1",
|
|
97
97
|
children: N.message
|
|
98
98
|
}),
|
|
99
|
-
/* @__PURE__ */
|
|
99
|
+
/* @__PURE__ */ f(r, {
|
|
100
100
|
variant: "outline",
|
|
101
101
|
size: "sm",
|
|
102
102
|
className: "mt-3",
|
|
103
103
|
onClick: () => P(),
|
|
104
|
-
children: [/* @__PURE__ */
|
|
104
|
+
children: [/* @__PURE__ */ d(y, { className: "size-4" }), "Retry"]
|
|
105
105
|
})
|
|
106
106
|
] })]
|
|
107
107
|
})
|
|
108
108
|
}),
|
|
109
|
-
E && !M && !N && F.length > 0 && /* @__PURE__ */
|
|
109
|
+
E && !M && !N && F.length > 0 && /* @__PURE__ */ d("div", {
|
|
110
110
|
className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",
|
|
111
111
|
children: F.map((e) => {
|
|
112
|
-
let t =
|
|
113
|
-
return /* @__PURE__ */
|
|
112
|
+
let t = c(e.providerType), r = R[e.status ?? "disconnected"] ?? R.disconnected, a = r.icon;
|
|
113
|
+
return /* @__PURE__ */ f(i, {
|
|
114
114
|
onClick: () => I(`${C}/providers/${E}/${e.id}`),
|
|
115
115
|
className: "p-5",
|
|
116
|
-
children: [/* @__PURE__ */
|
|
116
|
+
children: [/* @__PURE__ */ f("div", {
|
|
117
117
|
className: "flex items-start justify-between mb-3",
|
|
118
|
-
children: [/* @__PURE__ */
|
|
118
|
+
children: [/* @__PURE__ */ f("div", {
|
|
119
119
|
className: "flex items-center gap-3",
|
|
120
|
-
children: [/* @__PURE__ */
|
|
120
|
+
children: [/* @__PURE__ */ d("div", {
|
|
121
121
|
className: "p-2 rounded-lg bg-action-primary-bg/10",
|
|
122
|
-
children: /* @__PURE__ */
|
|
123
|
-
}), /* @__PURE__ */
|
|
122
|
+
children: /* @__PURE__ */ d(g, { className: "size-5 text-primary" })
|
|
123
|
+
}), /* @__PURE__ */ f("div", { children: [/* @__PURE__ */ d("h3", {
|
|
124
124
|
className: "font-bold text-text-primary",
|
|
125
125
|
children: e.displayName || t.label
|
|
126
|
-
}), /* @__PURE__ */
|
|
126
|
+
}), /* @__PURE__ */ d("p", {
|
|
127
127
|
className: "text-xs text-text-secondary",
|
|
128
128
|
children: t.label
|
|
129
129
|
})] })]
|
|
130
|
-
}), /* @__PURE__ */
|
|
130
|
+
}), /* @__PURE__ */ f(n, {
|
|
131
131
|
variant: r.variant,
|
|
132
132
|
className: "text-[10px] uppercase font-bold",
|
|
133
|
-
children: [/* @__PURE__ */
|
|
133
|
+
children: [/* @__PURE__ */ d(a, { className: "size-3" }), r.label]
|
|
134
134
|
})]
|
|
135
|
-
}), /* @__PURE__ */
|
|
135
|
+
}), /* @__PURE__ */ f("div", {
|
|
136
136
|
className: "flex items-center gap-4 text-xs text-text-secondary pt-3 border-t border-border-subtle/40 mt-3",
|
|
137
|
-
children: [e.syncEnabled ? /* @__PURE__ */
|
|
137
|
+
children: [e.syncEnabled ? /* @__PURE__ */ f("span", {
|
|
138
138
|
className: "bg-bg-sunken px-1.5 py-0.5 rounded",
|
|
139
139
|
children: [
|
|
140
140
|
"Sync: ",
|
|
141
141
|
e.syncIntervalMinutes,
|
|
142
142
|
"m"
|
|
143
143
|
]
|
|
144
|
-
}) : null, e.lastSyncAt ? /* @__PURE__ */
|
|
144
|
+
}) : null, e.lastSyncAt ? /* @__PURE__ */ f("span", {
|
|
145
145
|
className: "flex items-center gap-1",
|
|
146
|
-
children: [/* @__PURE__ */
|
|
147
|
-
}) : /* @__PURE__ */
|
|
146
|
+
children: [/* @__PURE__ */ d(h, { className: "size-3" }), new Date(e.lastSyncAt).toLocaleDateString()]
|
|
147
|
+
}) : /* @__PURE__ */ d("span", {
|
|
148
148
|
className: "italic opacity-60",
|
|
149
149
|
children: "Never synced"
|
|
150
150
|
})]
|
|
@@ -152,8 +152,8 @@ function C() {
|
|
|
152
152
|
}, e.id);
|
|
153
153
|
})
|
|
154
154
|
}),
|
|
155
|
-
E && !M && !N && F.length === 0 && /* @__PURE__ */
|
|
156
|
-
|
|
155
|
+
E && !M && !N && F.length === 0 && /* @__PURE__ */ d(S, {
|
|
156
|
+
illustration: "empty-generic",
|
|
157
157
|
title: "No providers connected",
|
|
158
158
|
description: "Provider onboarding is being finalized. Existing connections will appear here when configured."
|
|
159
159
|
})
|