@burdenoff/microfe-channel 2026.608.1 → 2026.624.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/channel/components/AdapterCredentialsForm.js +11 -11
- package/dist/channel/components/AdapterCredentialsForm.js.map +1 -1
- package/dist/channel/modules/channels/pages/ChannelDashboardPage.js +54 -54
- package/dist/channel/modules/channels/pages/ChannelDashboardPage.js.map +1 -1
- package/dist/channel/modules/channels/pages/ChannelDetailsPage.js +456 -462
- package/dist/channel/modules/channels/pages/ChannelDetailsPage.js.map +1 -1
- package/dist/channel/modules/channels/pages/ChannelSettingsPage.js +26 -26
- package/dist/channel/modules/channels/pages/ChannelSettingsPage.js.map +1 -1
- package/dist/channel/modules/channels/pages/ChannelUsersPage.js +226 -252
- package/dist/channel/modules/channels/pages/ChannelUsersPage.js.map +1 -1
- package/dist/channel/modules/channels/pages/ChannelsListPage.js +41 -41
- package/dist/channel/modules/channels/pages/ChannelsListPage.js.map +1 -1
- package/dist/channel/modules/channels/pages/ConnectionDetailsPage.js +30 -30
- package/dist/channel/modules/channels/pages/ConnectionDetailsPage.js.map +1 -1
- package/dist/channel/modules/channels/pages/ConnectionsListPage.js +29 -29
- package/dist/channel/modules/channels/pages/ConnectionsListPage.js.map +1 -1
- package/dist/channel/modules/channels/pages/CreateChannelPage.js +28 -28
- package/dist/channel/modules/channels/pages/CreateChannelPage.js.map +1 -1
- package/dist/channel/modules/channels/pages/CreateConnectionPage.js +8 -8
- package/dist/channel/modules/channels/pages/CreateConnectionPage.js.map +1 -1
- package/dist/channel/modules/channels/pages/DeliveryHistoryPage.js +208 -233
- package/dist/channel/modules/channels/pages/DeliveryHistoryPage.js.map +1 -1
- package/dist/channel/modules/channels/pages/EditChannelPage.js +25 -25
- package/dist/channel/modules/channels/pages/EditChannelPage.js.map +1 -1
- package/dist/channel/modules/channels/pages/EditConnectionPage.js +4 -4
- package/dist/channel/modules/channels/pages/EditConnectionPage.js.map +1 -1
- package/dist/channel/modules/channels/pages/SendMessagePage.js +27 -27
- package/dist/channel/modules/channels/pages/SendMessagePage.js.map +1 -1
- package/dist/channel/modules/channels/pages/WebhookEventsPage.js +29 -29
- package/dist/channel/modules/channels/pages/WebhookEventsPage.js.map +1 -1
- package/package.json +1 -1
|
@@ -51,33 +51,33 @@ function S() {
|
|
|
51
51
|
}, []), I = [...new Set(F.map((e) => e.platform))], L = F.filter((e) => !(k === "healthy" && !e.isHealthy || k === "unhealthy" && e.isHealthy || j !== "all" && e.platform !== j)), R = Math.max(1, Math.ceil(L.length / 10)), z = L.slice(N * 10, (N + 1) * 10);
|
|
52
52
|
return w ? /* @__PURE__ */ v("div", {
|
|
53
53
|
className: "flex items-center justify-center min-h-screen",
|
|
54
|
-
children: /* @__PURE__ */ v(u, { className: "size-8 animate-spin text-
|
|
54
|
+
children: /* @__PURE__ */ v(u, { className: "size-8 animate-spin text-text-secondary" })
|
|
55
55
|
}) : T ? /* @__PURE__ */ y("div", {
|
|
56
56
|
className: "flex flex-col items-center justify-center min-h-screen gap-4",
|
|
57
57
|
children: [
|
|
58
|
-
/* @__PURE__ */ v(o, { className: "size-12 text-
|
|
58
|
+
/* @__PURE__ */ v(o, { className: "size-12 text-status-error-text" }),
|
|
59
59
|
/* @__PURE__ */ v("h1", {
|
|
60
60
|
className: "text-xl font-semibold",
|
|
61
61
|
children: O("channel.loadConnectionsFailed", "Failed to load connections")
|
|
62
62
|
}),
|
|
63
63
|
/* @__PURE__ */ v("p", {
|
|
64
|
-
className: "text-sm text-
|
|
64
|
+
className: "text-sm text-text-secondary",
|
|
65
65
|
children: T
|
|
66
66
|
}),
|
|
67
67
|
/* @__PURE__ */ v("button", {
|
|
68
68
|
type: "button",
|
|
69
69
|
onClick: () => E(),
|
|
70
|
-
className: "px-4 py-2 rounded-lg bg-primary text-primary-
|
|
70
|
+
className: "px-4 py-2 rounded-lg bg-action-primary-bg text-action-primary-text hover:bg-action-primary-bg/90",
|
|
71
71
|
children: O("channel.retry", "Retry")
|
|
72
72
|
})
|
|
73
73
|
]
|
|
74
74
|
}) : /* @__PURE__ */ v(t, {
|
|
75
75
|
permission: n.CHANNEL_CONNECTION_READ,
|
|
76
76
|
children: /* @__PURE__ */ y("div", {
|
|
77
|
-
className: "min-h-screen bg-
|
|
77
|
+
className: "min-h-screen bg-bg-surface",
|
|
78
78
|
children: [
|
|
79
79
|
/* @__PURE__ */ v("div", {
|
|
80
|
-
className: "border-b bg-
|
|
80
|
+
className: "border-b bg-bg-surface",
|
|
81
81
|
"data-tour": "channels-connections-header",
|
|
82
82
|
children: /* @__PURE__ */ v("div", {
|
|
83
83
|
className: "container mx-auto px-6 py-4",
|
|
@@ -89,13 +89,13 @@ function S() {
|
|
|
89
89
|
type: "button",
|
|
90
90
|
onClick: () => c("./list"),
|
|
91
91
|
"aria-label": O("channel.backToChannels", "Back to channels"),
|
|
92
|
-
className: "p-2 hover:bg-
|
|
92
|
+
className: "p-2 hover:bg-bg-sunken rounded-lg transition-colors",
|
|
93
93
|
children: /* @__PURE__ */ v(s, { className: "size-5 " })
|
|
94
94
|
}), /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("h1", {
|
|
95
95
|
className: "text-2xl font-bold",
|
|
96
96
|
children: O("channel.connections", "Connections")
|
|
97
97
|
}), /* @__PURE__ */ y("p", {
|
|
98
|
-
className: "text-sm text-
|
|
98
|
+
className: "text-sm text-text-secondary",
|
|
99
99
|
children: [
|
|
100
100
|
L.length,
|
|
101
101
|
" connection",
|
|
@@ -105,7 +105,7 @@ function S() {
|
|
|
105
105
|
}), S && /* @__PURE__ */ y("button", {
|
|
106
106
|
type: "button",
|
|
107
107
|
onClick: () => c("./create"),
|
|
108
|
-
className: "px-4 py-2 rounded-lg bg-primary text-primary-
|
|
108
|
+
className: "px-4 py-2 rounded-lg bg-action-primary-bg text-action-primary-text hover:bg-action-primary-bg/90 transition-colors flex items-center gap-2",
|
|
109
109
|
children: [/* @__PURE__ */ v(d, { className: "size-4 " }), O("channel.newConnection", "New Connection")]
|
|
110
110
|
})]
|
|
111
111
|
})
|
|
@@ -120,7 +120,7 @@ function S() {
|
|
|
120
120
|
/* @__PURE__ */ y("select", {
|
|
121
121
|
value: j,
|
|
122
122
|
onChange: (e) => M(e.target.value),
|
|
123
|
-
className: "px-4 py-2 rounded-lg border bg-
|
|
123
|
+
className: "px-4 py-2 rounded-lg border bg-bg-surface focus:outline-none focus:ring-2 focus:ring-primary",
|
|
124
124
|
children: [/* @__PURE__ */ v("option", {
|
|
125
125
|
value: "all",
|
|
126
126
|
children: O("channel.allPlatforms", "All Platforms")
|
|
@@ -132,7 +132,7 @@ function S() {
|
|
|
132
132
|
/* @__PURE__ */ y("select", {
|
|
133
133
|
value: k,
|
|
134
134
|
onChange: (e) => A(e.target.value),
|
|
135
|
-
className: "px-4 py-2 rounded-lg border bg-
|
|
135
|
+
className: "px-4 py-2 rounded-lg border bg-bg-surface focus:outline-none focus:ring-2 focus:ring-primary",
|
|
136
136
|
children: [
|
|
137
137
|
/* @__PURE__ */ v("option", {
|
|
138
138
|
value: "all",
|
|
@@ -152,7 +152,7 @@ function S() {
|
|
|
152
152
|
type: "button",
|
|
153
153
|
onClick: () => E(),
|
|
154
154
|
"aria-label": O("channel.refresh", "Refresh"),
|
|
155
|
-
className: "p-2 hover:bg-
|
|
155
|
+
className: "p-2 hover:bg-bg-sunken rounded-lg transition-colors",
|
|
156
156
|
children: /* @__PURE__ */ v(f, {
|
|
157
157
|
className: "size-5 ",
|
|
158
158
|
"aria-hidden": "true"
|
|
@@ -166,26 +166,26 @@ function S() {
|
|
|
166
166
|
children: L.length === 0 ? /* @__PURE__ */ y("div", {
|
|
167
167
|
className: "text-center py-12",
|
|
168
168
|
children: [
|
|
169
|
-
/* @__PURE__ */ v(l, { className: "size-12 mx-auto text-
|
|
169
|
+
/* @__PURE__ */ v(l, { className: "size-12 mx-auto text-text-secondary mb-4" }),
|
|
170
170
|
/* @__PURE__ */ v("h2", {
|
|
171
171
|
className: "text-lg font-semibold mb-2",
|
|
172
172
|
children: O("channel.noConnectionsFound", "No connections found")
|
|
173
173
|
}),
|
|
174
174
|
/* @__PURE__ */ v("p", {
|
|
175
|
-
className: "text-sm text-
|
|
175
|
+
className: "text-sm text-text-secondary mb-4",
|
|
176
176
|
children: C.length === 0 ? O("channel.createChannelFirst", "Create a channel first to add connections") : O("channel.noConnectionsMatchFilter", "No connections match your filters")
|
|
177
177
|
}),
|
|
178
178
|
C.length === 0 ? S ? /* @__PURE__ */ v("button", {
|
|
179
179
|
type: "button",
|
|
180
180
|
onClick: () => c("./create"),
|
|
181
|
-
className: "px-4 py-2 rounded-lg bg-primary text-primary-
|
|
181
|
+
className: "px-4 py-2 rounded-lg bg-action-primary-bg text-action-primary-text hover:bg-action-primary-bg/90",
|
|
182
182
|
children: O("channel.createConnection", "Create Connection")
|
|
183
183
|
}) : null : /* @__PURE__ */ v("button", {
|
|
184
184
|
type: "button",
|
|
185
185
|
onClick: () => {
|
|
186
186
|
A("all"), M("all");
|
|
187
187
|
},
|
|
188
|
-
className: "px-4 py-2 rounded-lg border hover:bg-
|
|
188
|
+
className: "px-4 py-2 rounded-lg border hover:bg-bg-sunken",
|
|
189
189
|
children: O("channel.clearFilters", "Clear Filters")
|
|
190
190
|
})
|
|
191
191
|
]
|
|
@@ -196,7 +196,7 @@ function S() {
|
|
|
196
196
|
return /* @__PURE__ */ v("div", {
|
|
197
197
|
role: "button",
|
|
198
198
|
tabIndex: 0,
|
|
199
|
-
className: "p-4 hover:bg-
|
|
199
|
+
className: "p-4 hover:bg-bg-sunken/50 transition-colors cursor-pointer",
|
|
200
200
|
onClick: () => c(`./${e.channelId}`),
|
|
201
201
|
onKeyDown: (t) => {
|
|
202
202
|
(t.key === "Enter" || t.key === " ") && (t.preventDefault(), c(`./${e.channelId}`));
|
|
@@ -216,7 +216,7 @@ function S() {
|
|
|
216
216
|
className: "font-medium",
|
|
217
217
|
children: e.channelName
|
|
218
218
|
}), /* @__PURE__ */ y("p", {
|
|
219
|
-
className: "text-sm text-
|
|
219
|
+
className: "text-sm text-text-secondary",
|
|
220
220
|
children: [
|
|
221
221
|
e.platform,
|
|
222
222
|
" • ",
|
|
@@ -236,7 +236,7 @@ function S() {
|
|
|
236
236
|
className: "text-status-success-text",
|
|
237
237
|
children: O("channel.activeStatus", "Active")
|
|
238
238
|
}) : e.channelStatus === "INACTIVE" ? /* @__PURE__ */ v("span", {
|
|
239
|
-
className: "text-
|
|
239
|
+
className: "text-text-secondary",
|
|
240
240
|
children: O("channel.inactiveStatus", "Inactive")
|
|
241
241
|
}) : e.channelStatus === "ERROR" ? /* @__PURE__ */ v("span", {
|
|
242
242
|
className: "text-status-error-text",
|
|
@@ -245,14 +245,14 @@ function S() {
|
|
|
245
245
|
className: "text-status-warning-text",
|
|
246
246
|
children: O("channel.suspendedStatus", "Suspended")
|
|
247
247
|
}) : e.channelStatus === "ARCHIVED" ? /* @__PURE__ */ v("span", {
|
|
248
|
-
className: "text-
|
|
248
|
+
className: "text-text-secondary",
|
|
249
249
|
children: O("channel.archivedStatus", "Archived")
|
|
250
250
|
}) : /* @__PURE__ */ v("span", {
|
|
251
|
-
className: "text-
|
|
251
|
+
className: "text-text-secondary",
|
|
252
252
|
children: O("channel.inactiveStatus", "Inactive")
|
|
253
253
|
})
|
|
254
254
|
}), e.lastTestedAt && /* @__PURE__ */ y("p", {
|
|
255
|
-
className: "text-xs text-
|
|
255
|
+
className: "text-xs text-text-secondary",
|
|
256
256
|
children: ["Last tested: ", new Date(e.lastTestedAt).toLocaleDateString()]
|
|
257
257
|
})]
|
|
258
258
|
}),
|
|
@@ -268,7 +268,7 @@ function S() {
|
|
|
268
268
|
label: e.tagId,
|
|
269
269
|
size: "sm"
|
|
270
270
|
}, e.id)), e.tagAssignments.length > 3 && /* @__PURE__ */ y("span", {
|
|
271
|
-
className: "text-xs text-
|
|
271
|
+
className: "text-xs text-text-secondary",
|
|
272
272
|
children: ["+", e.tagAssignments.length - 3]
|
|
273
273
|
})]
|
|
274
274
|
}),
|
|
@@ -278,7 +278,7 @@ function S() {
|
|
|
278
278
|
t.stopPropagation(), c(`/channels/${e.channelId}`);
|
|
279
279
|
},
|
|
280
280
|
"aria-label": O("channel.viewChannelSettings", "View channel settings"),
|
|
281
|
-
className: "p-2 hover:bg-
|
|
281
|
+
className: "p-2 hover:bg-bg-sunken rounded-lg transition-colors",
|
|
282
282
|
children: /* @__PURE__ */ v(p, { className: "size-4 " })
|
|
283
283
|
})
|
|
284
284
|
]
|
|
@@ -287,9 +287,9 @@ function S() {
|
|
|
287
287
|
}, e.connectionId);
|
|
288
288
|
})
|
|
289
289
|
}), L.length > 10 && /* @__PURE__ */ y("div", {
|
|
290
|
-
className: "flex items-center justify-between px-4 py-3 border border-border rounded-lg mt-3",
|
|
290
|
+
className: "flex items-center justify-between px-4 py-3 border border-border-subtle rounded-lg mt-3",
|
|
291
291
|
children: [/* @__PURE__ */ y("p", {
|
|
292
|
-
className: "text-sm text-
|
|
292
|
+
className: "text-sm text-text-secondary",
|
|
293
293
|
children: [
|
|
294
294
|
O("channel.showing", "Showing"),
|
|
295
295
|
" ",
|
|
@@ -316,11 +316,11 @@ function S() {
|
|
|
316
316
|
type: "button",
|
|
317
317
|
onClick: () => P((e) => Math.max(0, e - 1)),
|
|
318
318
|
disabled: N === 0,
|
|
319
|
-
className: "px-3 py-1.5 text-sm border border-border rounded-lg hover:bg-
|
|
319
|
+
className: "px-3 py-1.5 text-sm border border-border-subtle rounded-lg hover:bg-bg-sunken transition-colors disabled:opacity-40 disabled:cursor-not-allowed",
|
|
320
320
|
children: O("channel.previous", "Previous")
|
|
321
321
|
}),
|
|
322
322
|
/* @__PURE__ */ y("span", {
|
|
323
|
-
className: "text-sm text-
|
|
323
|
+
className: "text-sm text-text-secondary",
|
|
324
324
|
children: [
|
|
325
325
|
N + 1,
|
|
326
326
|
" / ",
|
|
@@ -331,7 +331,7 @@ function S() {
|
|
|
331
331
|
type: "button",
|
|
332
332
|
onClick: () => P((e) => Math.min(R - 1, e + 1)),
|
|
333
333
|
disabled: N >= R - 1,
|
|
334
|
-
className: "px-3 py-1.5 text-sm border border-border rounded-lg hover:bg-
|
|
334
|
+
className: "px-3 py-1.5 text-sm border border-border-subtle rounded-lg hover:bg-bg-sunken transition-colors disabled:opacity-40 disabled:cursor-not-allowed",
|
|
335
335
|
children: O("channel.next", "Next")
|
|
336
336
|
})
|
|
337
337
|
]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConnectionsListPage.js","names":[],"sources":["../../../../../src/channel/modules/channels/pages/ConnectionsListPage.tsx"],"sourcesContent":["/**\n * Connections List Page\n *\n * Displays all connections across channels with their status.\n */\n\nimport { useState, useEffect } from 'react';\nimport { useNavigate } from 'react-router-dom';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\nimport { usePermissions } from '@burdenoff/fe-libs/shared/providers/shell';\nimport { TagBadge } from '@burdenoff/fe-libs/tag';\nimport {\n ArrowLeft,\n Plus,\n Loader2,\n AlertCircle,\n CheckCircle2,\n XCircle,\n RefreshCw,\n Settings,\n Link,\n} from 'lucide-react';\nimport { useChannels } from '../../../hooks/useChannels';\nimport { PermissionGuard } from '../../../components/PermissionGuard';\nimport { CHANNEL_PERMISSIONS } from '../../../constants/permissions';\n\nconst HEALTH_CONFIG: Record<string, { icon: typeof CheckCircle2; color: string; label: string }> = {\n true: { icon: CheckCircle2, color: 'text-status-success-text', label: 'Healthy' },\n false: { icon: XCircle, color: 'text-status-error-text', label: 'Unhealthy' },\n};\n\nexport function ConnectionsListPage() {\n const navigate = useNavigate();\n const { hasPermission } = usePermissions();\n // Creating connections is admin-only (channel-connection:create) — hide otherwise.\n const canConnectionCreate = hasPermission(CHANNEL_PERMISSIONS.CHANNEL_CONNECTION_CREATE);\n const { channels, isLoading, error, refetch } = useChannels();\n\n // Poll for connection status updates every 60 s.\n // connectionStatusChanged subscription is scoped to a single channelId;\n // this page shows all connections, so polling is used instead.\n useEffect(() => {\n const timer = setInterval(() => {\n void refetch();\n }, 60_000);\n return () => clearInterval(timer);\n }, [refetch]);\n const { t } = useI18n();\n const tr = (key: string, fallback: string): string => {\n const value = t(key);\n return value === key ? fallback : value;\n };\n\n // Filter state\n const [healthFilter, setHealthFilter] = useState<string>('all');\n const [platformFilter, setPlatformFilter] = useState<string>('all');\n const pageSize = 10;\n const [currentPage, setCurrentPage] = useState(0);\n\n // Get all connections from channels (single-pass; avoids filter().map() double traversal)\n const connections = channels.reduce<\n Array<{\n channelId: string;\n channelName: string;\n platform: (typeof channels)[number]['platform'];\n adapterType: (typeof channels)[number]['adapterType'];\n channelStatus: (typeof channels)[number]['status'];\n connectionId: string;\n isActive: boolean;\n isHealthy: boolean;\n needsTokenRefresh: boolean;\n lastTestedAt: string | null | undefined;\n authType: NonNullable<(typeof channels)[number]['connection']>['authType'];\n tagAssignments: NonNullable<\n NonNullable<(typeof channels)[number]['connection']>['tagAssignments']\n >;\n }>\n >((acc, ch) => {\n const conn = ch.connection;\n if (!conn) return acc;\n acc.push({\n channelId: ch.id,\n channelName: ch.name,\n platform: ch.platform,\n adapterType: ch.adapterType,\n channelStatus: ch.status,\n connectionId: conn.id,\n isActive: conn.isActive,\n isHealthy: conn.isHealthy,\n needsTokenRefresh: conn.needsTokenRefresh,\n lastTestedAt: conn.lastTestedAt,\n authType: conn.authType,\n tagAssignments: conn.tagAssignments ?? [],\n });\n return acc;\n }, []);\n\n // Get unique platforms\n const platforms = [...new Set(connections.map((c) => c.platform))];\n\n // Apply filters\n const filteredConnections = connections.filter((conn) => {\n if (healthFilter === 'healthy' && !conn.isHealthy) return false;\n if (healthFilter === 'unhealthy' && conn.isHealthy) return false;\n if (platformFilter !== 'all' && conn.platform !== platformFilter) return false;\n return true;\n });\n\n const totalPages = Math.max(1, Math.ceil(filteredConnections.length / pageSize));\n const pagedConnections = filteredConnections.slice(\n currentPage * pageSize,\n (currentPage + 1) * pageSize\n );\n\n if (isLoading) {\n return (\n <div className=\"flex items-center justify-center min-h-screen\">\n <Loader2 className=\"size-8 animate-spin text-muted-foreground\" />\n </div>\n );\n }\n\n if (error) {\n return (\n <div className=\"flex flex-col items-center justify-center min-h-screen gap-4\">\n <AlertCircle className=\"size-12 text-destructive\" />\n <h1 className=\"text-xl font-semibold\">\n {tr('channel.loadConnectionsFailed', 'Failed to load connections')}\n </h1>\n <p className=\"text-sm text-muted-foreground\">{error}</p>\n <button\n type=\"button\"\n onClick={() => refetch()}\n className=\"px-4 py-2 rounded-lg bg-primary text-primary-foreground hover:bg-primary/90\"\n >\n {tr('channel.retry', 'Retry')}\n </button>\n </div>\n );\n }\n\n return (\n <PermissionGuard permission={CHANNEL_PERMISSIONS.CHANNEL_CONNECTION_READ}>\n <div className=\"min-h-screen bg-background\">\n {/* Header */}\n <div className=\"border-b bg-card\" data-tour=\"channels-connections-header\">\n <div className=\"container mx-auto px-6 py-4\">\n <div className=\"flex items-center justify-between\">\n <div className=\"flex items-center gap-4\">\n <button\n type=\"button\"\n onClick={() => navigate('./list')}\n aria-label={tr('channel.backToChannels', 'Back to channels')}\n className=\"p-2 hover:bg-muted rounded-lg transition-colors\"\n >\n <ArrowLeft className=\"size-5 \" />\n </button>\n <div>\n <h1 className=\"text-2xl font-bold\">{tr('channel.connections', 'Connections')}</h1>\n <p className=\"text-sm text-muted-foreground\">\n {filteredConnections.length} connection\n {filteredConnections.length !== 1 ? 's' : ''}\n </p>\n </div>\n </div>\n {canConnectionCreate && (\n <button\n type=\"button\"\n onClick={() => navigate('./create')}\n className=\"px-4 py-2 rounded-lg bg-primary text-primary-foreground hover:bg-primary/90 transition-colors flex items-center gap-2\"\n >\n <Plus className=\"size-4 \" />\n {tr('channel.newConnection', 'New Connection')}\n </button>\n )}\n </div>\n </div>\n </div>\n\n {/* Filters */}\n <div className=\"container mx-auto px-6 py-4\" data-tour=\"channels-connections-filters\">\n <div className=\"flex items-center gap-4\">\n <select\n value={platformFilter}\n onChange={(e) => setPlatformFilter(e.target.value)}\n className=\"px-4 py-2 rounded-lg border bg-background focus:outline-none focus:ring-2 focus:ring-primary\"\n >\n <option value=\"all\">{tr('channel.allPlatforms', 'All Platforms')}</option>\n {platforms.map((p) => (\n <option key={p} value={p}>\n {p}\n </option>\n ))}\n </select>\n\n <select\n value={healthFilter}\n onChange={(e) => setHealthFilter(e.target.value)}\n className=\"px-4 py-2 rounded-lg border bg-background focus:outline-none focus:ring-2 focus:ring-primary\"\n >\n <option value=\"all\">{tr('channel.allStatus', 'All Status')}</option>\n <option value=\"healthy\">{tr('channel.healthy', 'Healthy')}</option>\n <option value=\"unhealthy\">{tr('channel.unhealthy', 'Unhealthy')}</option>\n </select>\n\n <button\n type=\"button\"\n onClick={() => refetch()}\n aria-label={tr('channel.refresh', 'Refresh')}\n className=\"p-2 hover:bg-muted rounded-lg transition-colors\"\n >\n <RefreshCw className=\"size-5 \" aria-hidden=\"true\" />\n </button>\n </div>\n </div>\n\n {/* Connections List */}\n <div className=\"container mx-auto px-6 pb-8\">\n {filteredConnections.length === 0 ? (\n <div className=\"text-center py-12\">\n <Link className=\"size-12 mx-auto text-muted-foreground mb-4\" />\n <h2 className=\"text-lg font-semibold mb-2\">\n {tr('channel.noConnectionsFound', 'No connections found')}\n </h2>\n <p className=\"text-sm text-muted-foreground mb-4\">\n {channels.length === 0\n ? tr('channel.createChannelFirst', 'Create a channel first to add connections')\n : tr('channel.noConnectionsMatchFilter', 'No connections match your filters')}\n </p>\n {channels.length === 0 ? (\n canConnectionCreate ? (\n <button\n type=\"button\"\n onClick={() => navigate('./create')}\n className=\"px-4 py-2 rounded-lg bg-primary text-primary-foreground hover:bg-primary/90\"\n >\n {tr('channel.createConnection', 'Create Connection')}\n </button>\n ) : null\n ) : (\n <button\n type=\"button\"\n onClick={() => {\n setHealthFilter('all');\n setPlatformFilter('all');\n }}\n className=\"px-4 py-2 rounded-lg border hover:bg-muted\"\n >\n {tr('channel.clearFilters', 'Clear Filters')}\n </button>\n )}\n </div>\n ) : (\n <>\n <div className=\"border rounded-lg divide-y\">\n {pagedConnections.map((conn) => {\n const health = HEALTH_CONFIG[String(conn.isHealthy)] || HEALTH_CONFIG.false;\n const HealthIcon = health.icon;\n\n return (\n <div\n key={conn.connectionId}\n role=\"button\"\n tabIndex={0}\n className=\"p-4 hover:bg-muted/50 transition-colors cursor-pointer\"\n onClick={() => navigate(`./${conn.channelId}`)}\n onKeyDown={(e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n navigate(`./${conn.channelId}`);\n }\n }}\n >\n <div className=\"flex items-center justify-between\">\n <div className=\"flex items-center gap-4\">\n <div className={health.color} aria-label={health.label}>\n <HealthIcon className=\"size-5 \" aria-hidden=\"true\" />\n </div>\n <div>\n <p className=\"font-medium\">{conn.channelName}</p>\n <p className=\"text-sm text-muted-foreground\">\n {conn.platform} • {conn.adapterType} • {conn.authType}\n </p>\n </div>\n </div>\n\n <div className=\"flex items-center gap-4\">\n <div className=\"text-right\">\n <p className=\"text-sm\">\n {conn.channelStatus === 'ACTIVE' ? (\n <span className=\"text-status-success-text\">\n {tr('channel.activeStatus', 'Active')}\n </span>\n ) : conn.channelStatus === 'INACTIVE' ? (\n <span className=\"text-muted-foreground\">\n {tr('channel.inactiveStatus', 'Inactive')}\n </span>\n ) : conn.channelStatus === 'ERROR' ? (\n <span className=\"text-status-error-text\">\n {tr('channel.errorStatus', 'Error')}\n </span>\n ) : conn.channelStatus === 'SUSPENDED' ? (\n <span className=\"text-status-warning-text\">\n {tr('channel.suspendedStatus', 'Suspended')}\n </span>\n ) : conn.channelStatus === 'ARCHIVED' ? (\n <span className=\"text-muted-foreground\">\n {tr('channel.archivedStatus', 'Archived')}\n </span>\n ) : (\n <span className=\"text-muted-foreground\">\n {tr('channel.inactiveStatus', 'Inactive')}\n </span>\n )}\n </p>\n {conn.lastTestedAt && (\n <p className=\"text-xs text-muted-foreground\">\n Last tested: {new Date(conn.lastTestedAt).toLocaleDateString()}\n </p>\n )}\n </div>\n\n {conn.needsTokenRefresh && (\n <span className=\"px-2 py-1 text-xs bg-status-warning-bg-subtle text-status-warning-text rounded\">\n Token Expires\n </span>\n )}\n\n {conn.tagAssignments.length > 0 && (\n <div className=\"flex flex-wrap gap-1\" aria-label=\"Connection tags\">\n {conn.tagAssignments.slice(0, 3).map((a) => (\n <TagBadge key={a.id} id={a.tagId} label={a.tagId} size=\"sm\" />\n ))}\n {conn.tagAssignments.length > 3 && (\n <span className=\"text-xs text-muted-foreground\">\n +{conn.tagAssignments.length - 3}\n </span>\n )}\n </div>\n )}\n\n <button\n type=\"button\"\n onClick={(e) => {\n e.stopPropagation();\n navigate(`/channels/${conn.channelId}`);\n }}\n aria-label={tr('channel.viewChannelSettings', 'View channel settings')}\n className=\"p-2 hover:bg-muted rounded-lg transition-colors\"\n >\n <Settings className=\"size-4 \" />\n </button>\n </div>\n </div>\n </div>\n );\n })}\n </div>\n {/* Pagination */}\n {filteredConnections.length > pageSize && (\n <div className=\"flex items-center justify-between px-4 py-3 border border-border rounded-lg mt-3\">\n <p className=\"text-sm text-muted-foreground\">\n {tr('channel.showing', 'Showing')}{' '}\n <span className=\"font-medium\">\n {currentPage * pageSize + 1}–\n {Math.min((currentPage + 1) * pageSize, filteredConnections.length)}\n </span>{' '}\n {tr('channel.of', 'of')}{' '}\n <span className=\"font-medium\">{filteredConnections.length}</span>\n </p>\n <div className=\"flex items-center gap-2\">\n <button\n type=\"button\"\n onClick={() => setCurrentPage((p) => Math.max(0, p - 1))}\n disabled={currentPage === 0}\n className=\"px-3 py-1.5 text-sm border border-border rounded-lg hover:bg-muted transition-colors disabled:opacity-40 disabled:cursor-not-allowed\"\n >\n {tr('channel.previous', 'Previous')}\n </button>\n <span className=\"text-sm text-muted-foreground\">\n {currentPage + 1} / {totalPages}\n </span>\n <button\n type=\"button\"\n onClick={() => setCurrentPage((p) => Math.min(totalPages - 1, p + 1))}\n disabled={currentPage >= totalPages - 1}\n className=\"px-3 py-1.5 text-sm border border-border rounded-lg hover:bg-muted transition-colors disabled:opacity-40 disabled:cursor-not-allowed\"\n >\n {tr('channel.next', 'Next')}\n </button>\n </div>\n </div>\n )}\n </>\n )}\n </div>\n </div>\n </PermissionGuard>\n );\n}\n"],"mappings":";;;;;;;;;;;AA0BA,IAAM,IAA6F;CACjG,MAAM;EAAE,MAAM;EAAc,OAAO;EAA4B,OAAO;EAAW;CACjF,OAAO;EAAE,MAAM;EAAS,OAAO;EAA0B,OAAO;EAAa;CAC9E;AAED,SAAgB,IAAsB;CACpC,IAAM,IAAW,GAAa,EACxB,EAAE,qBAAkB,GAAgB,EAEpC,IAAsB,EAAc,EAAoB,0BAA0B,EAClF,EAAE,aAAU,cAAW,UAAO,eAAY,GAAa;AAK7D,SAAgB;EACd,IAAM,IAAQ,kBAAkB;AACzB,MAAS;KACb,IAAO;AACV,eAAa,cAAc,EAAM;IAChC,CAAC,EAAQ,CAAC;CACb,IAAM,EAAE,SAAM,GAAS,EACjB,KAAM,GAAa,MAA6B;EACpD,IAAM,IAAQ,EAAE,EAAI;AACpB,SAAO,MAAU,IAAM,IAAW;IAI9B,CAAC,GAAc,KAAmB,EAAiB,MAAM,EACzD,CAAC,GAAgB,KAAqB,EAAiB,MAAM,EAE7D,CAAC,GAAa,KAAkB,EAAS,EAAE,EAG3C,IAAc,EAAS,QAiB1B,GAAK,MAAO;EACb,IAAM,IAAO,EAAG;AAgBhB,SAfK,KACL,EAAI,KAAK;GACP,WAAW,EAAG;GACd,aAAa,EAAG;GAChB,UAAU,EAAG;GACb,aAAa,EAAG;GAChB,eAAe,EAAG;GAClB,cAAc,EAAK;GACnB,UAAU,EAAK;GACf,WAAW,EAAK;GAChB,mBAAmB,EAAK;GACxB,cAAc,EAAK;GACnB,UAAU,EAAK;GACf,gBAAgB,EAAK,kBAAkB,EAAE;GAC1C,CAAC,EAdgB;IAgBjB,EAAE,CAAC,EAGA,IAAY,CAAC,GAAG,IAAI,IAAI,EAAY,KAAK,MAAM,EAAE,SAAS,CAAC,CAAC,EAG5D,IAAsB,EAAY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AAG,+BAA+B,wBAAwB;YACtE,WAAU;sBAEV,kBAAC,GAAD,EAAU,WAAU,WAAY,CAAA;YACzB,CAAA;WACL;YACF;;QACF,EA7FC,EAAK,aA6FN;QAER;MACE,CAAA,EAEL,EAAoB,SAAS,MAC5B,kBAAC,OAAD;MAAK,WAAU;gBAAf,CACE,kBAAC,KAAD;OAAG,WAAU;iBAAb;QACG,EAAG,mBAAmB,UAAU;QAAE;QACnC,kBAAC,QAAD;SAAM,WAAU;mBAAhB;UACG,IAAc,KAAW;UAAE;UAC3B,KAAK,KAAK,IAAc,KAAK,IAAU,EAAoB,OAAO;UAC9D;;QAAC;QACP,EAAG,cAAc,KAAK;QAAE;QACzB,kBAAC,QAAD;SAAM,WAAU;mBAAe,EAAoB;SAAc,CAAA;QAC/D;UACJ,kBAAC,OAAD;OAAK,WAAU;iBAAf;QACE,kBAAC,UAAD;SACE,MAAK;SACL,eAAe,GAAgB,MAAM,KAAK,IAAI,GAAG,IAAI,EAAE,CAAC;SACxD,UAAU,MAAgB;SAC1B,WAAU;mBAET,EAAG,oBAAoB,WAAW;SAC5B,CAAA;QACT,kBAAC,QAAD;SAAM,WAAU;mBAAhB;UACG,IAAc;UAAE;UAAI;UAChB;;QACP,kBAAC,UAAD;SACE,MAAK;SACL,eAAe,GAAgB,MAAM,KAAK,IAAI,IAAa,GAAG,IAAI,EAAE,CAAC;SACrE,UAAU,KAAe,IAAa;SACtC,WAAU;mBAET,EAAG,gBAAgB,OAAO;SACpB,CAAA;QACL;SACF;QAEP,EAAA,CAAA;KAED,CAAA;IACF;;EACU,CAAA"}
|
|
1
|
+
{"version":3,"file":"ConnectionsListPage.js","names":[],"sources":["../../../../../src/channel/modules/channels/pages/ConnectionsListPage.tsx"],"sourcesContent":["/**\n * Connections List Page\n *\n * Displays all connections across channels with their status.\n */\n\nimport { useState, useEffect } from 'react';\nimport { useNavigate } from 'react-router-dom';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\nimport { usePermissions } from '@burdenoff/fe-libs/shared/providers/shell';\nimport { TagBadge } from '@burdenoff/fe-libs/tag';\nimport {\n ArrowLeft,\n Plus,\n Loader2,\n AlertCircle,\n CheckCircle2,\n XCircle,\n RefreshCw,\n Settings,\n Link,\n} from 'lucide-react';\nimport { useChannels } from '../../../hooks/useChannels';\nimport { PermissionGuard } from '../../../components/PermissionGuard';\nimport { CHANNEL_PERMISSIONS } from '../../../constants/permissions';\n\nconst HEALTH_CONFIG: Record<string, { icon: typeof CheckCircle2; color: string; label: string }> = {\n true: { icon: CheckCircle2, color: 'text-status-success-text', label: 'Healthy' },\n false: { icon: XCircle, color: 'text-status-error-text', label: 'Unhealthy' },\n};\n\nexport function ConnectionsListPage() {\n const navigate = useNavigate();\n const { hasPermission } = usePermissions();\n // Creating connections is admin-only (channel-connection:create) — hide otherwise.\n const canConnectionCreate = hasPermission(CHANNEL_PERMISSIONS.CHANNEL_CONNECTION_CREATE);\n const { channels, isLoading, error, refetch } = useChannels();\n\n // Poll for connection status updates every 60 s.\n // connectionStatusChanged subscription is scoped to a single channelId;\n // this page shows all connections, so polling is used instead.\n useEffect(() => {\n const timer = setInterval(() => {\n void refetch();\n }, 60_000);\n return () => clearInterval(timer);\n }, [refetch]);\n const { t } = useI18n();\n const tr = (key: string, fallback: string): string => {\n const value = t(key);\n return value === key ? fallback : value;\n };\n\n // Filter state\n const [healthFilter, setHealthFilter] = useState<string>('all');\n const [platformFilter, setPlatformFilter] = useState<string>('all');\n const pageSize = 10;\n const [currentPage, setCurrentPage] = useState(0);\n\n // Get all connections from channels (single-pass; avoids filter().map() double traversal)\n const connections = channels.reduce<\n Array<{\n channelId: string;\n channelName: string;\n platform: (typeof channels)[number]['platform'];\n adapterType: (typeof channels)[number]['adapterType'];\n channelStatus: (typeof channels)[number]['status'];\n connectionId: string;\n isActive: boolean;\n isHealthy: boolean;\n needsTokenRefresh: boolean;\n lastTestedAt: string | null | undefined;\n authType: NonNullable<(typeof channels)[number]['connection']>['authType'];\n tagAssignments: NonNullable<\n NonNullable<(typeof channels)[number]['connection']>['tagAssignments']\n >;\n }>\n >((acc, ch) => {\n const conn = ch.connection;\n if (!conn) return acc;\n acc.push({\n channelId: ch.id,\n channelName: ch.name,\n platform: ch.platform,\n adapterType: ch.adapterType,\n channelStatus: ch.status,\n connectionId: conn.id,\n isActive: conn.isActive,\n isHealthy: conn.isHealthy,\n needsTokenRefresh: conn.needsTokenRefresh,\n lastTestedAt: conn.lastTestedAt,\n authType: conn.authType,\n tagAssignments: conn.tagAssignments ?? [],\n });\n return acc;\n }, []);\n\n // Get unique platforms\n const platforms = [...new Set(connections.map((c) => c.platform))];\n\n // Apply filters\n const filteredConnections = connections.filter((conn) => {\n if (healthFilter === 'healthy' && !conn.isHealthy) return false;\n if (healthFilter === 'unhealthy' && conn.isHealthy) return false;\n if (platformFilter !== 'all' && conn.platform !== platformFilter) return false;\n return true;\n });\n\n const totalPages = Math.max(1, Math.ceil(filteredConnections.length / pageSize));\n const pagedConnections = filteredConnections.slice(\n currentPage * pageSize,\n (currentPage + 1) * pageSize\n );\n\n if (isLoading) {\n return (\n <div className=\"flex items-center justify-center min-h-screen\">\n <Loader2 className=\"size-8 animate-spin text-text-secondary\" />\n </div>\n );\n }\n\n if (error) {\n return (\n <div className=\"flex flex-col items-center justify-center min-h-screen gap-4\">\n <AlertCircle className=\"size-12 text-status-error-text\" />\n <h1 className=\"text-xl font-semibold\">\n {tr('channel.loadConnectionsFailed', 'Failed to load connections')}\n </h1>\n <p className=\"text-sm text-text-secondary\">{error}</p>\n <button\n type=\"button\"\n onClick={() => refetch()}\n className=\"px-4 py-2 rounded-lg bg-action-primary-bg text-action-primary-text hover:bg-action-primary-bg/90\"\n >\n {tr('channel.retry', 'Retry')}\n </button>\n </div>\n );\n }\n\n return (\n <PermissionGuard permission={CHANNEL_PERMISSIONS.CHANNEL_CONNECTION_READ}>\n <div className=\"min-h-screen bg-bg-surface\">\n {/* Header */}\n <div className=\"border-b bg-bg-surface\" data-tour=\"channels-connections-header\">\n <div className=\"container mx-auto px-6 py-4\">\n <div className=\"flex items-center justify-between\">\n <div className=\"flex items-center gap-4\">\n <button\n type=\"button\"\n onClick={() => navigate('./list')}\n aria-label={tr('channel.backToChannels', 'Back to channels')}\n className=\"p-2 hover:bg-bg-sunken rounded-lg transition-colors\"\n >\n <ArrowLeft className=\"size-5 \" />\n </button>\n <div>\n <h1 className=\"text-2xl font-bold\">{tr('channel.connections', 'Connections')}</h1>\n <p className=\"text-sm text-text-secondary\">\n {filteredConnections.length} connection\n {filteredConnections.length !== 1 ? 's' : ''}\n </p>\n </div>\n </div>\n {canConnectionCreate && (\n <button\n type=\"button\"\n onClick={() => navigate('./create')}\n className=\"px-4 py-2 rounded-lg bg-action-primary-bg text-action-primary-text hover:bg-action-primary-bg/90 transition-colors flex items-center gap-2\"\n >\n <Plus className=\"size-4 \" />\n {tr('channel.newConnection', 'New Connection')}\n </button>\n )}\n </div>\n </div>\n </div>\n\n {/* Filters */}\n <div className=\"container mx-auto px-6 py-4\" data-tour=\"channels-connections-filters\">\n <div className=\"flex items-center gap-4\">\n <select\n value={platformFilter}\n onChange={(e) => setPlatformFilter(e.target.value)}\n className=\"px-4 py-2 rounded-lg border bg-bg-surface focus:outline-none focus:ring-2 focus:ring-primary\"\n >\n <option value=\"all\">{tr('channel.allPlatforms', 'All Platforms')}</option>\n {platforms.map((p) => (\n <option key={p} value={p}>\n {p}\n </option>\n ))}\n </select>\n\n <select\n value={healthFilter}\n onChange={(e) => setHealthFilter(e.target.value)}\n className=\"px-4 py-2 rounded-lg border bg-bg-surface focus:outline-none focus:ring-2 focus:ring-primary\"\n >\n <option value=\"all\">{tr('channel.allStatus', 'All Status')}</option>\n <option value=\"healthy\">{tr('channel.healthy', 'Healthy')}</option>\n <option value=\"unhealthy\">{tr('channel.unhealthy', 'Unhealthy')}</option>\n </select>\n\n <button\n type=\"button\"\n onClick={() => refetch()}\n aria-label={tr('channel.refresh', 'Refresh')}\n className=\"p-2 hover:bg-bg-sunken rounded-lg transition-colors\"\n >\n <RefreshCw className=\"size-5 \" aria-hidden=\"true\" />\n </button>\n </div>\n </div>\n\n {/* Connections List */}\n <div className=\"container mx-auto px-6 pb-8\">\n {filteredConnections.length === 0 ? (\n <div className=\"text-center py-12\">\n <Link className=\"size-12 mx-auto text-text-secondary mb-4\" />\n <h2 className=\"text-lg font-semibold mb-2\">\n {tr('channel.noConnectionsFound', 'No connections found')}\n </h2>\n <p className=\"text-sm text-text-secondary mb-4\">\n {channels.length === 0\n ? tr('channel.createChannelFirst', 'Create a channel first to add connections')\n : tr('channel.noConnectionsMatchFilter', 'No connections match your filters')}\n </p>\n {channels.length === 0 ? (\n canConnectionCreate ? (\n <button\n type=\"button\"\n onClick={() => navigate('./create')}\n className=\"px-4 py-2 rounded-lg bg-action-primary-bg text-action-primary-text hover:bg-action-primary-bg/90\"\n >\n {tr('channel.createConnection', 'Create Connection')}\n </button>\n ) : null\n ) : (\n <button\n type=\"button\"\n onClick={() => {\n setHealthFilter('all');\n setPlatformFilter('all');\n }}\n className=\"px-4 py-2 rounded-lg border hover:bg-bg-sunken\"\n >\n {tr('channel.clearFilters', 'Clear Filters')}\n </button>\n )}\n </div>\n ) : (\n <>\n <div className=\"border rounded-lg divide-y\">\n {pagedConnections.map((conn) => {\n const health = HEALTH_CONFIG[String(conn.isHealthy)] || HEALTH_CONFIG.false;\n const HealthIcon = health.icon;\n\n return (\n <div\n key={conn.connectionId}\n role=\"button\"\n tabIndex={0}\n className=\"p-4 hover:bg-bg-sunken/50 transition-colors cursor-pointer\"\n onClick={() => navigate(`./${conn.channelId}`)}\n onKeyDown={(e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n navigate(`./${conn.channelId}`);\n }\n }}\n >\n <div className=\"flex items-center justify-between\">\n <div className=\"flex items-center gap-4\">\n <div className={health.color} aria-label={health.label}>\n <HealthIcon className=\"size-5 \" aria-hidden=\"true\" />\n </div>\n <div>\n <p className=\"font-medium\">{conn.channelName}</p>\n <p className=\"text-sm text-text-secondary\">\n {conn.platform} • {conn.adapterType} • {conn.authType}\n </p>\n </div>\n </div>\n\n <div className=\"flex items-center gap-4\">\n <div className=\"text-right\">\n <p className=\"text-sm\">\n {conn.channelStatus === 'ACTIVE' ? (\n <span className=\"text-status-success-text\">\n {tr('channel.activeStatus', 'Active')}\n </span>\n ) : conn.channelStatus === 'INACTIVE' ? (\n <span className=\"text-text-secondary\">\n {tr('channel.inactiveStatus', 'Inactive')}\n </span>\n ) : conn.channelStatus === 'ERROR' ? (\n <span className=\"text-status-error-text\">\n {tr('channel.errorStatus', 'Error')}\n </span>\n ) : conn.channelStatus === 'SUSPENDED' ? (\n <span className=\"text-status-warning-text\">\n {tr('channel.suspendedStatus', 'Suspended')}\n </span>\n ) : conn.channelStatus === 'ARCHIVED' ? (\n <span className=\"text-text-secondary\">\n {tr('channel.archivedStatus', 'Archived')}\n </span>\n ) : (\n <span className=\"text-text-secondary\">\n {tr('channel.inactiveStatus', 'Inactive')}\n </span>\n )}\n </p>\n {conn.lastTestedAt && (\n <p className=\"text-xs text-text-secondary\">\n Last tested: {new Date(conn.lastTestedAt).toLocaleDateString()}\n </p>\n )}\n </div>\n\n {conn.needsTokenRefresh && (\n <span className=\"px-2 py-1 text-xs bg-status-warning-bg-subtle text-status-warning-text rounded\">\n Token Expires\n </span>\n )}\n\n {conn.tagAssignments.length > 0 && (\n <div className=\"flex flex-wrap gap-1\" aria-label=\"Connection tags\">\n {conn.tagAssignments.slice(0, 3).map((a) => (\n <TagBadge key={a.id} id={a.tagId} label={a.tagId} size=\"sm\" />\n ))}\n {conn.tagAssignments.length > 3 && (\n <span className=\"text-xs text-text-secondary\">\n +{conn.tagAssignments.length - 3}\n </span>\n )}\n </div>\n )}\n\n <button\n type=\"button\"\n onClick={(e) => {\n e.stopPropagation();\n navigate(`/channels/${conn.channelId}`);\n }}\n aria-label={tr('channel.viewChannelSettings', 'View channel settings')}\n className=\"p-2 hover:bg-bg-sunken rounded-lg transition-colors\"\n >\n <Settings className=\"size-4 \" />\n </button>\n </div>\n </div>\n </div>\n );\n })}\n </div>\n {/* Pagination */}\n {filteredConnections.length > pageSize && (\n <div className=\"flex items-center justify-between px-4 py-3 border border-border-subtle rounded-lg mt-3\">\n <p className=\"text-sm text-text-secondary\">\n {tr('channel.showing', 'Showing')}{' '}\n <span className=\"font-medium\">\n {currentPage * pageSize + 1}–\n {Math.min((currentPage + 1) * pageSize, filteredConnections.length)}\n </span>{' '}\n {tr('channel.of', 'of')}{' '}\n <span className=\"font-medium\">{filteredConnections.length}</span>\n </p>\n <div className=\"flex items-center gap-2\">\n <button\n type=\"button\"\n onClick={() => setCurrentPage((p) => Math.max(0, p - 1))}\n disabled={currentPage === 0}\n className=\"px-3 py-1.5 text-sm border border-border-subtle rounded-lg hover:bg-bg-sunken transition-colors disabled:opacity-40 disabled:cursor-not-allowed\"\n >\n {tr('channel.previous', 'Previous')}\n </button>\n <span className=\"text-sm text-text-secondary\">\n {currentPage + 1} / {totalPages}\n </span>\n <button\n type=\"button\"\n onClick={() => setCurrentPage((p) => Math.min(totalPages - 1, p + 1))}\n disabled={currentPage >= totalPages - 1}\n className=\"px-3 py-1.5 text-sm border border-border-subtle rounded-lg hover:bg-bg-sunken transition-colors disabled:opacity-40 disabled:cursor-not-allowed\"\n >\n {tr('channel.next', 'Next')}\n </button>\n </div>\n </div>\n )}\n </>\n )}\n </div>\n </div>\n </PermissionGuard>\n );\n}\n"],"mappings":";;;;;;;;;;;AA0BA,IAAM,IAA6F;CACjG,MAAM;EAAE,MAAM;EAAc,OAAO;EAA4B,OAAO;EAAW;CACjF,OAAO;EAAE,MAAM;EAAS,OAAO;EAA0B,OAAO;EAAa;CAC9E;AAED,SAAgB,IAAsB;CACpC,IAAM,IAAW,GAAa,EACxB,EAAE,qBAAkB,GAAgB,EAEpC,IAAsB,EAAc,EAAoB,0BAA0B,EAClF,EAAE,aAAU,cAAW,UAAO,eAAY,GAAa;AAK7D,SAAgB;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QAAD;SAAM,WAAU;mBAAe,EAAoB;SAAc,CAAA;QAC/D;UACJ,kBAAC,OAAD;OAAK,WAAU;iBAAf;QACE,kBAAC,UAAD;SACE,MAAK;SACL,eAAe,GAAgB,MAAM,KAAK,IAAI,GAAG,IAAI,EAAE,CAAC;SACxD,UAAU,MAAgB;SAC1B,WAAU;mBAET,EAAG,oBAAoB,WAAW;SAC5B,CAAA;QACT,kBAAC,QAAD;SAAM,WAAU;mBAAhB;UACG,IAAc;UAAE;UAAI;UAChB;;QACP,kBAAC,UAAD;SACE,MAAK;SACL,eAAe,GAAgB,MAAM,KAAK,IAAI,IAAa,GAAG,IAAI,EAAE,CAAC;SACrE,UAAU,KAAe,IAAa;SACtC,WAAU;mBAET,EAAG,gBAAgB,OAAO;SACpB,CAAA;QACL;SACF;QAEP,EAAA,CAAA;KAED,CAAA;IACF;;EACU,CAAA"}
|
|
@@ -158,16 +158,16 @@ function D() {
|
|
|
158
158
|
children: [/* @__PURE__ */ C("button", {
|
|
159
159
|
type: "button",
|
|
160
160
|
onClick: () => c(-1),
|
|
161
|
-
className: "p-2 text-
|
|
161
|
+
className: "p-2 text-text-secondary hover:text-text-primary hover:bg-surface-hover rounded-lg transition-colors",
|
|
162
162
|
children: /* @__PURE__ */ C(s, { size: 20 })
|
|
163
163
|
}), /* @__PURE__ */ w("div", { children: [/* @__PURE__ */ w("h1", {
|
|
164
|
-
className: "text-xl font-bold text-
|
|
164
|
+
className: "text-xl font-bold text-text-primary flex items-center gap-2",
|
|
165
165
|
children: [/* @__PURE__ */ C(_, {
|
|
166
166
|
size: 22,
|
|
167
167
|
className: "text-accent-primary"
|
|
168
168
|
}), m("channel.createChannel", "Create Channel")]
|
|
169
169
|
}), /* @__PURE__ */ C("p", {
|
|
170
|
-
className: "text-sm text-
|
|
170
|
+
className: "text-sm text-text-secondary mt-0.5",
|
|
171
171
|
children: m("channel.createChannelSubtitle", "Set up a new communication channel")
|
|
172
172
|
})] })]
|
|
173
173
|
})
|
|
@@ -223,14 +223,14 @@ function D() {
|
|
|
223
223
|
/* @__PURE__ */ w("div", {
|
|
224
224
|
className: "grid gap-5 lg:grid-cols-2",
|
|
225
225
|
children: [/* @__PURE__ */ w("div", {
|
|
226
|
-
className: "p-5 bg-surface border border-border rounded-lg space-y-4",
|
|
226
|
+
className: "p-5 bg-surface border border-border-subtle rounded-lg space-y-4",
|
|
227
227
|
children: [
|
|
228
228
|
/* @__PURE__ */ C("h2", {
|
|
229
|
-
className: "text-sm font-semibold text-
|
|
229
|
+
className: "text-sm font-semibold text-text-primary uppercase tracking-wider",
|
|
230
230
|
children: m("channel.basicInformation", "Basic Information")
|
|
231
231
|
}),
|
|
232
232
|
/* @__PURE__ */ w("div", { children: [/* @__PURE__ */ w("label", {
|
|
233
|
-
className: "block text-sm font-medium text-
|
|
233
|
+
className: "block text-sm font-medium text-text-primary mb-1.5",
|
|
234
234
|
children: [
|
|
235
235
|
m("channel.name", "Name"),
|
|
236
236
|
" ",
|
|
@@ -247,11 +247,11 @@ function D() {
|
|
|
247
247
|
...t,
|
|
248
248
|
name: e.target.value
|
|
249
249
|
})),
|
|
250
|
-
className: "w-full px-3 py-2 text-sm bg-surface border border-border rounded-lg focus:outline-none focus:ring-2 focus:ring-action-primary-bg/50 placeholder:text-
|
|
250
|
+
className: "w-full px-3 py-2 text-sm bg-surface border border-border-subtle rounded-lg focus:outline-none focus:ring-2 focus:ring-action-primary-bg/50 placeholder:text-text-secondary",
|
|
251
251
|
placeholder: m("channel.namePlaceholder", "e.g., Primary Email, SMS Alerts")
|
|
252
252
|
})] }),
|
|
253
253
|
/* @__PURE__ */ w("div", { children: [/* @__PURE__ */ C("label", {
|
|
254
|
-
className: "block text-sm font-medium text-
|
|
254
|
+
className: "block text-sm font-medium text-text-primary mb-1.5",
|
|
255
255
|
children: m("channel.description", "Description")
|
|
256
256
|
}), /* @__PURE__ */ C("textarea", {
|
|
257
257
|
"aria-label": m("channel.descriptionPlaceholder", "Optional description of this channel's purpose"),
|
|
@@ -261,20 +261,20 @@ function D() {
|
|
|
261
261
|
description: e.target.value
|
|
262
262
|
})),
|
|
263
263
|
rows: 3,
|
|
264
|
-
className: "w-full px-3 py-2 text-sm bg-surface border border-border rounded-lg focus:outline-none focus:ring-2 focus:ring-action-primary-bg/50 resize-none placeholder:text-
|
|
264
|
+
className: "w-full px-3 py-2 text-sm bg-surface border border-border-subtle rounded-lg focus:outline-none focus:ring-2 focus:ring-action-primary-bg/50 resize-none placeholder:text-text-secondary",
|
|
265
265
|
placeholder: m("channel.descriptionPlaceholder", "Optional description of this channel's purpose")
|
|
266
266
|
})] })
|
|
267
267
|
]
|
|
268
268
|
}), /* @__PURE__ */ w("div", {
|
|
269
|
-
className: "p-5 bg-surface border border-border rounded-lg space-y-4",
|
|
269
|
+
className: "p-5 bg-surface border border-border-subtle rounded-lg space-y-4",
|
|
270
270
|
children: [
|
|
271
271
|
/* @__PURE__ */ C("h2", {
|
|
272
|
-
className: "text-sm font-semibold text-
|
|
272
|
+
className: "text-sm font-semibold text-text-primary uppercase tracking-wider",
|
|
273
273
|
children: m("channel.providerStatus", "Provider & Status")
|
|
274
274
|
}),
|
|
275
275
|
/* @__PURE__ */ w("div", { children: [
|
|
276
276
|
/* @__PURE__ */ C("label", {
|
|
277
|
-
className: "block text-sm font-medium text-
|
|
277
|
+
className: "block text-sm font-medium text-text-primary mb-1.5",
|
|
278
278
|
children: m("channel.providerAdapter", "Provider / Adapter")
|
|
279
279
|
}),
|
|
280
280
|
/* @__PURE__ */ w("select", {
|
|
@@ -283,7 +283,7 @@ function D() {
|
|
|
283
283
|
...t,
|
|
284
284
|
adapterType: e.target.value
|
|
285
285
|
})),
|
|
286
|
-
className: "w-full px-3 py-2 text-sm bg-surface border border-border rounded-lg focus:outline-none focus:ring-2 focus:ring-action-primary-bg/50 text-
|
|
286
|
+
className: "w-full px-3 py-2 text-sm bg-surface border border-border-subtle rounded-lg focus:outline-none focus:ring-2 focus:ring-action-primary-bg/50 text-text-primary",
|
|
287
287
|
children: [/* @__PURE__ */ C("option", {
|
|
288
288
|
value: "",
|
|
289
289
|
children: m("channel.selectProvider", "Select a provider (optional)")
|
|
@@ -293,7 +293,7 @@ function D() {
|
|
|
293
293
|
}, e.value))]
|
|
294
294
|
}),
|
|
295
295
|
/* @__PURE__ */ C("p", {
|
|
296
|
-
className: "mt-1 text-[11px] text-
|
|
296
|
+
className: "mt-1 text-[11px] text-text-secondary",
|
|
297
297
|
children: k ? m("channel.providersAvailableForPlatform", `${O.length} providers available for ${k.label}`) : m("channel.selectPlatformFirst", "Select a platform first")
|
|
298
298
|
})
|
|
299
299
|
] }),
|
|
@@ -301,7 +301,7 @@ function D() {
|
|
|
301
301
|
className: "grid gap-4 sm:grid-cols-2",
|
|
302
302
|
children: [/* @__PURE__ */ w("div", { children: [
|
|
303
303
|
/* @__PURE__ */ C("label", {
|
|
304
|
-
className: "block text-sm font-medium text-
|
|
304
|
+
className: "block text-sm font-medium text-text-primary mb-1.5",
|
|
305
305
|
children: m("channel.status", "Status")
|
|
306
306
|
}),
|
|
307
307
|
/* @__PURE__ */ w("select", {
|
|
@@ -310,7 +310,7 @@ function D() {
|
|
|
310
310
|
...t,
|
|
311
311
|
status: e.target.value
|
|
312
312
|
})),
|
|
313
|
-
className: "w-full px-3 py-2 text-sm bg-surface border border-border rounded-lg focus:outline-none focus:ring-2 focus:ring-action-primary-bg/50 text-
|
|
313
|
+
className: "w-full px-3 py-2 text-sm bg-surface border border-border-subtle rounded-lg focus:outline-none focus:ring-2 focus:ring-action-primary-bg/50 text-text-primary",
|
|
314
314
|
children: [/* @__PURE__ */ C("option", {
|
|
315
315
|
value: "ACTIVE",
|
|
316
316
|
children: m("channel.status.active", "Active")
|
|
@@ -320,13 +320,13 @@ function D() {
|
|
|
320
320
|
})]
|
|
321
321
|
}),
|
|
322
322
|
/* @__PURE__ */ C("p", {
|
|
323
|
-
className: "mt-1 text-[11px] text-
|
|
323
|
+
className: "mt-1 text-[11px] text-text-secondary",
|
|
324
324
|
children: x.status === "ACTIVE" ? m("channel.statusHint.active", "Ready to send immediately") : m("channel.statusHint.inactive", "Configure before activating")
|
|
325
325
|
})
|
|
326
326
|
] }), /* @__PURE__ */ w("div", { children: [
|
|
327
327
|
/* @__PURE__ */ C("label", {
|
|
328
328
|
htmlFor: "create-channel-priority",
|
|
329
|
-
className: "block text-sm font-medium text-
|
|
329
|
+
className: "block text-sm font-medium text-text-primary mb-1.5",
|
|
330
330
|
children: m("channel.priority", "Priority")
|
|
331
331
|
}),
|
|
332
332
|
/* @__PURE__ */ C("input", {
|
|
@@ -340,10 +340,10 @@ function D() {
|
|
|
340
340
|
})),
|
|
341
341
|
min: 0,
|
|
342
342
|
max: 100,
|
|
343
|
-
className: "w-full px-3 py-2 text-sm bg-surface border border-border rounded-lg focus:outline-none focus:ring-2 focus:ring-action-primary-bg/50"
|
|
343
|
+
className: "w-full px-3 py-2 text-sm bg-surface border border-border-subtle rounded-lg focus:outline-none focus:ring-2 focus:ring-action-primary-bg/50"
|
|
344
344
|
}),
|
|
345
345
|
/* @__PURE__ */ C("p", {
|
|
346
|
-
className: "mt-1 text-[11px] text-
|
|
346
|
+
className: "mt-1 text-[11px] text-text-secondary",
|
|
347
347
|
children: m("channel.priorityHint", "Lower = higher priority (0-100)")
|
|
348
348
|
})
|
|
349
349
|
] })]
|
|
@@ -352,9 +352,9 @@ function D() {
|
|
|
352
352
|
})]
|
|
353
353
|
}),
|
|
354
354
|
/* @__PURE__ */ w("div", {
|
|
355
|
-
className: "p-5 bg-surface border border-border rounded-lg space-y-4",
|
|
355
|
+
className: "p-5 bg-surface border border-border-subtle rounded-lg space-y-4",
|
|
356
356
|
children: [/* @__PURE__ */ w("h2", {
|
|
357
|
-
className: "text-sm font-semibold text-
|
|
357
|
+
className: "text-sm font-semibold text-text-primary uppercase tracking-wider",
|
|
358
358
|
children: [
|
|
359
359
|
m("channel.platform", "Platform"),
|
|
360
360
|
" ",
|
|
@@ -370,7 +370,7 @@ function D() {
|
|
|
370
370
|
return /* @__PURE__ */ w("button", {
|
|
371
371
|
type: "button",
|
|
372
372
|
onClick: () => A(e.value),
|
|
373
|
-
className: `relative flex flex-col items-center gap-1.5 p-3 rounded-lg border transition-all text-center ${n ? `${e.color} border-current ring-1 ring-current` : "border-border hover:bg-surface-hover text-
|
|
373
|
+
className: `relative flex flex-col items-center gap-1.5 p-3 rounded-lg border transition-all text-center ${n ? `${e.color} border-current ring-1 ring-current` : "border-border-subtle hover:bg-surface-hover text-text-secondary hover:text-text-primary"}`,
|
|
374
374
|
children: [
|
|
375
375
|
n && /* @__PURE__ */ C(l, {
|
|
376
376
|
size: 14,
|
|
@@ -396,12 +396,12 @@ function D() {
|
|
|
396
396
|
className: "grid gap-4 lg:grid-cols-2",
|
|
397
397
|
children: /* @__PURE__ */ w("div", { children: [
|
|
398
398
|
/* @__PURE__ */ w("label", {
|
|
399
|
-
className: "block text-sm font-medium text-
|
|
399
|
+
className: "block text-sm font-medium text-text-primary mb-1.5",
|
|
400
400
|
children: [
|
|
401
401
|
m("channel.platformConfig", "Platform Config"),
|
|
402
402
|
" ",
|
|
403
403
|
/* @__PURE__ */ C("span", {
|
|
404
|
-
className: "text-[10px] text-
|
|
404
|
+
className: "text-[10px] text-text-secondary",
|
|
405
405
|
children: "(JSON)"
|
|
406
406
|
})
|
|
407
407
|
]
|
|
@@ -414,11 +414,11 @@ function D() {
|
|
|
414
414
|
platformConfig: e.target.value
|
|
415
415
|
})),
|
|
416
416
|
rows: 3,
|
|
417
|
-
className: "w-full px-3 py-2 text-sm bg-surface border border-border rounded-lg focus:outline-none focus:ring-2 focus:ring-action-primary-bg/50 resize-none font-mono placeholder:text-
|
|
417
|
+
className: "w-full px-3 py-2 text-sm bg-surface border border-border-subtle rounded-lg focus:outline-none focus:ring-2 focus:ring-action-primary-bg/50 resize-none font-mono placeholder:text-text-secondary",
|
|
418
418
|
placeholder: m("channel.platformConfigPlaceholder", "{\"fromEmail\": \"noreply@example.com\"}")
|
|
419
419
|
}),
|
|
420
420
|
/* @__PURE__ */ C("p", {
|
|
421
|
-
className: "mt-1 text-[11px] text-
|
|
421
|
+
className: "mt-1 text-[11px] text-text-secondary",
|
|
422
422
|
children: m("channel.platformConfigHint", "Platform-specific configuration as JSON")
|
|
423
423
|
})
|
|
424
424
|
] })
|
|
@@ -429,7 +429,7 @@ function D() {
|
|
|
429
429
|
children: [/* @__PURE__ */ C("button", {
|
|
430
430
|
type: "button",
|
|
431
431
|
onClick: () => c("/channels/list"),
|
|
432
|
-
className: "px-4 py-2 text-sm text-
|
|
432
|
+
className: "px-4 py-2 text-sm text-text-secondary hover:text-text-primary hover:bg-surface-hover border border-border-subtle rounded-lg transition-colors",
|
|
433
433
|
children: m("channel.cancel", "Cancel")
|
|
434
434
|
}), /* @__PURE__ */ w("button", {
|
|
435
435
|
type: "submit",
|