@burdenoff/microfe-adaptercloud 2026.825.3 → 2026.827.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/adaptercloud/components/ActiveSwitch.d.ts +17 -0
- package/dist/adaptercloud/components/ActiveSwitch.d.ts.map +1 -0
- package/dist/adaptercloud/components/ActiveSwitch.js +28 -0
- package/dist/adaptercloud/components/ActiveSwitch.js.map +1 -0
- package/dist/adaptercloud/components/index.d.ts +1 -0
- package/dist/adaptercloud/components/index.d.ts.map +1 -1
- package/dist/adaptercloud/hooks/useAdapterCloudApi.d.ts +28 -2
- package/dist/adaptercloud/hooks/useAdapterCloudApi.d.ts.map +1 -1
- package/dist/adaptercloud/hooks/useAdapterCloudApi.js +43 -18
- package/dist/adaptercloud/hooks/useAdapterCloudApi.js.map +1 -1
- package/dist/adaptercloud/pages/OverviewPage.d.ts.map +1 -1
- package/dist/adaptercloud/pages/OverviewPage.js +4 -4
- package/dist/adaptercloud/pages/OverviewPage.js.map +1 -1
- package/dist/adaptercloud/pages/adapters/AdaptersListPage.d.ts.map +1 -1
- package/dist/adaptercloud/pages/adapters/AdaptersListPage.js +6 -5
- package/dist/adaptercloud/pages/adapters/AdaptersListPage.js.map +1 -1
- package/dist/adaptercloud/pages/connections/ConnectionDetailPage.d.ts.map +1 -1
- package/dist/adaptercloud/pages/connections/ConnectionDetailPage.js +217 -104
- package/dist/adaptercloud/pages/connections/ConnectionDetailPage.js.map +1 -1
- package/dist/adaptercloud/pages/connections/ConnectionsListPage.d.ts.map +1 -1
- package/dist/adaptercloud/pages/connections/ConnectionsListPage.js +6 -5
- package/dist/adaptercloud/pages/connections/ConnectionsListPage.js.map +1 -1
- package/dist/adaptercloud/pages/costs/CostsPage.d.ts.map +1 -1
- package/dist/adaptercloud/pages/costs/CostsPage.js +183 -156
- package/dist/adaptercloud/pages/costs/CostsPage.js.map +1 -1
- package/dist/adaptercloud/pages/drift/DriftListPage.d.ts.map +1 -1
- package/dist/adaptercloud/pages/drift/DriftListPage.js +108 -107
- package/dist/adaptercloud/pages/drift/DriftListPage.js.map +1 -1
- package/dist/adaptercloud/pages/policies/PoliciesListPage.d.ts.map +1 -1
- package/dist/adaptercloud/pages/policies/PoliciesListPage.js +141 -131
- package/dist/adaptercloud/pages/policies/PoliciesListPage.js.map +1 -1
- package/dist/adaptercloud/pages/policies/PolicyDetailPage.d.ts.map +1 -1
- package/dist/adaptercloud/pages/policies/PolicyDetailPage.js +171 -117
- package/dist/adaptercloud/pages/policies/PolicyDetailPage.js.map +1 -1
- package/dist/adaptercloud/pages/resources/ResourcesListPage.d.ts.map +1 -1
- package/dist/adaptercloud/pages/resources/ResourcesListPage.js +85 -66
- package/dist/adaptercloud/pages/resources/ResourcesListPage.js.map +1 -1
- package/dist/adaptercloud/pages/sync-runs/SyncRunsListPage.d.ts.map +1 -1
- package/dist/adaptercloud/pages/sync-runs/SyncRunsListPage.js +148 -121
- package/dist/adaptercloud/pages/sync-runs/SyncRunsListPage.js.map +1 -1
- package/dist/adaptercloud/pages/violations/ViolationsListPage.d.ts.map +1 -1
- package/dist/adaptercloud/pages/violations/ViolationsListPage.js +145 -144
- package/dist/adaptercloud/pages/violations/ViolationsListPage.js.map +1 -1
- package/dist/utils/pageContext.d.ts +0 -2
- package/dist/utils/pageContext.d.ts.map +1 -1
- package/dist/utils/pageContext.js +25 -10
- package/dist/utils/pageContext.js.map +1 -1
- package/package.json +8 -5
|
@@ -12,29 +12,29 @@ import { useSearchParams as g } from "react-router";
|
|
|
12
12
|
import { jsx as _, jsxs as v } from "react/jsx-runtime";
|
|
13
13
|
import { ResponsiveTable as y } from "@burdenoff/fe-libs/ui";
|
|
14
14
|
//#region src/adaptercloud/pages/resources/ResourcesListPage.tsx
|
|
15
|
-
var b = 25;
|
|
16
|
-
function
|
|
17
|
-
let { navigateTo:
|
|
18
|
-
let n =
|
|
15
|
+
var b = 25, x = 2;
|
|
16
|
+
function S() {
|
|
17
|
+
let { navigateTo: S } = e(), [C] = g(), w = C.get("connectionId") ?? void 0, { t: T } = u(), E = c((e, t) => {
|
|
18
|
+
let n = T(e);
|
|
19
19
|
return n === e ? t : n;
|
|
20
|
-
}, [
|
|
21
|
-
connectionId:
|
|
22
|
-
state:
|
|
23
|
-
resourceType:
|
|
20
|
+
}, [T]), [D, O] = l(""), [k, A] = l(""), [j, M] = l(""), [N, P] = l(0), F = o({
|
|
21
|
+
connectionId: w,
|
|
22
|
+
state: D || void 0,
|
|
23
|
+
resourceType: j || void 0,
|
|
24
24
|
pagination: {
|
|
25
25
|
limit: b,
|
|
26
|
-
offset:
|
|
26
|
+
offset: N
|
|
27
27
|
}
|
|
28
|
-
}),
|
|
29
|
-
e.preventDefault(),
|
|
30
|
-
}, [
|
|
31
|
-
|
|
32
|
-
}, []),
|
|
33
|
-
|
|
34
|
-
}, [
|
|
28
|
+
}), I = F.data?.items ?? [], L = F.data?.pageInfo.hasMore ?? !1, R = F.data?.pageInfo.totalCount, z = c((e) => {
|
|
29
|
+
e.preventDefault(), M(k.trim()), P(0);
|
|
30
|
+
}, [k]), B = c(() => {
|
|
31
|
+
A(""), M(""), P(0);
|
|
32
|
+
}, []), V = c(() => {
|
|
33
|
+
O(""), A(""), M(""), P(0), S("/resources");
|
|
34
|
+
}, [S]), H = [
|
|
35
35
|
{
|
|
36
36
|
key: "name",
|
|
37
|
-
header:
|
|
37
|
+
header: E("adaptercloud.resources.name", "Name"),
|
|
38
38
|
priority: "primary",
|
|
39
39
|
cell: (e) => /* @__PURE__ */ v("div", {
|
|
40
40
|
className: "min-w-0",
|
|
@@ -49,7 +49,7 @@ function x() {
|
|
|
49
49
|
},
|
|
50
50
|
{
|
|
51
51
|
key: "type",
|
|
52
|
-
header:
|
|
52
|
+
header: E("adaptercloud.resources.type", "Type"),
|
|
53
53
|
priority: "primary",
|
|
54
54
|
cell: (e) => /* @__PURE__ */ _("span", {
|
|
55
55
|
className: "font-mono text-xs text-text-primary",
|
|
@@ -58,7 +58,7 @@ function x() {
|
|
|
58
58
|
},
|
|
59
59
|
{
|
|
60
60
|
key: "connection",
|
|
61
|
-
header:
|
|
61
|
+
header: E("adaptercloud.resources.connection", "Connection"),
|
|
62
62
|
priority: "secondary",
|
|
63
63
|
cell: (e) => /* @__PURE__ */ _("span", {
|
|
64
64
|
className: "truncate text-sm text-text-secondary",
|
|
@@ -67,7 +67,7 @@ function x() {
|
|
|
67
67
|
},
|
|
68
68
|
{
|
|
69
69
|
key: "region",
|
|
70
|
-
header:
|
|
70
|
+
header: E("adaptercloud.resources.region", "Region"),
|
|
71
71
|
priority: "secondary",
|
|
72
72
|
cell: (e) => /* @__PURE__ */ _("span", {
|
|
73
73
|
className: "text-sm text-text-secondary",
|
|
@@ -76,7 +76,7 @@ function x() {
|
|
|
76
76
|
},
|
|
77
77
|
{
|
|
78
78
|
key: "cost",
|
|
79
|
-
header:
|
|
79
|
+
header: E("adaptercloud.resources.monthlyCost", "Monthly Cost"),
|
|
80
80
|
priority: "secondary",
|
|
81
81
|
cell: (e) => /* @__PURE__ */ _("span", {
|
|
82
82
|
className: "text-sm tabular-nums text-text-primary",
|
|
@@ -85,16 +85,34 @@ function x() {
|
|
|
85
85
|
},
|
|
86
86
|
{
|
|
87
87
|
key: "state",
|
|
88
|
-
header:
|
|
88
|
+
header: E("adaptercloud.resources.state", "State"),
|
|
89
89
|
priority: "primary",
|
|
90
90
|
cell: (e) => /* @__PURE__ */ _(i, {
|
|
91
91
|
status: e.state,
|
|
92
92
|
label: r[e.state]
|
|
93
93
|
})
|
|
94
94
|
},
|
|
95
|
+
{
|
|
96
|
+
key: "tags",
|
|
97
|
+
header: E("adaptercloud.common.tags", "Tags"),
|
|
98
|
+
priority: "hidden-on-mobile",
|
|
99
|
+
cell: (e) => e.tags.length > 0 ? /* @__PURE__ */ v("div", {
|
|
100
|
+
className: "flex flex-wrap items-center gap-1",
|
|
101
|
+
children: [e.tags.slice(0, x).map((e) => /* @__PURE__ */ _("span", {
|
|
102
|
+
className: "inline-flex items-center rounded-full bg-bg-sunken px-2 py-0.5 text-xs text-text-secondary",
|
|
103
|
+
children: e
|
|
104
|
+
}, e)), e.tags.length > x && /* @__PURE__ */ v("span", {
|
|
105
|
+
className: "text-xs text-text-secondary",
|
|
106
|
+
children: ["+", e.tags.length - x]
|
|
107
|
+
})]
|
|
108
|
+
}) : /* @__PURE__ */ _("span", {
|
|
109
|
+
className: "text-text-tertiary",
|
|
110
|
+
children: "—"
|
|
111
|
+
})
|
|
112
|
+
},
|
|
95
113
|
{
|
|
96
114
|
key: "seen",
|
|
97
|
-
header:
|
|
115
|
+
header: E("adaptercloud.resources.lastSeen", "Last Seen"),
|
|
98
116
|
priority: "hidden-on-mobile",
|
|
99
117
|
cell: (e) => /* @__PURE__ */ _("span", {
|
|
100
118
|
className: "text-xs text-text-secondary",
|
|
@@ -103,110 +121,111 @@ function x() {
|
|
|
103
121
|
}
|
|
104
122
|
];
|
|
105
123
|
return /* @__PURE__ */ v(t, {
|
|
106
|
-
title:
|
|
107
|
-
description:
|
|
124
|
+
title: E("adaptercloud.resources.title", "Resources"),
|
|
125
|
+
description: E("adaptercloud.resources.subtitle", "The unified inventory of everything discovered across every connection."),
|
|
108
126
|
children: [/* @__PURE__ */ v("div", {
|
|
109
127
|
className: "mb-6 flex flex-wrap items-center gap-3",
|
|
110
128
|
children: [
|
|
111
129
|
/* @__PURE__ */ v("select", {
|
|
112
|
-
value:
|
|
130
|
+
value: D,
|
|
113
131
|
onChange: (e) => {
|
|
114
|
-
|
|
132
|
+
O(e.target.value), P(0);
|
|
115
133
|
},
|
|
116
|
-
"aria-label":
|
|
134
|
+
"aria-label": E("adaptercloud.resources.filterByState", "Filter by lifecycle state"),
|
|
117
135
|
className: "w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)] sm:w-auto",
|
|
118
136
|
children: [/* @__PURE__ */ _("option", {
|
|
119
137
|
value: "",
|
|
120
|
-
children:
|
|
138
|
+
children: E("adaptercloud.resources.allStates", "All states")
|
|
121
139
|
}), Object.keys(r).map((e) => /* @__PURE__ */ _("option", {
|
|
122
140
|
value: e,
|
|
123
141
|
children: r[e]
|
|
124
142
|
}, e))]
|
|
125
143
|
}),
|
|
126
144
|
/* @__PURE__ */ v("form", {
|
|
127
|
-
onSubmit:
|
|
145
|
+
onSubmit: z,
|
|
128
146
|
role: "search",
|
|
129
147
|
className: "flex w-full items-center gap-2 sm:w-auto",
|
|
130
148
|
children: [/* @__PURE__ */ v("div", {
|
|
131
149
|
className: "relative w-full sm:w-56",
|
|
132
150
|
children: [/* @__PURE__ */ _("input", {
|
|
133
151
|
type: "text",
|
|
134
|
-
value:
|
|
135
|
-
onChange: (e) =>
|
|
136
|
-
"aria-label":
|
|
137
|
-
placeholder:
|
|
152
|
+
value: k,
|
|
153
|
+
onChange: (e) => A(e.target.value),
|
|
154
|
+
"aria-label": E("adaptercloud.resources.filterType", "Filter by resource type"),
|
|
155
|
+
placeholder: E("adaptercloud.resources.filterTypePlaceholder", "Filter by type…"),
|
|
138
156
|
className: "w-full rounded-lg border border-border-subtle bg-bg-surface py-2 pl-3 pr-9 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
|
|
139
|
-
}),
|
|
157
|
+
}), j && /* @__PURE__ */ _("button", {
|
|
140
158
|
type: "button",
|
|
141
|
-
onClick:
|
|
142
|
-
"aria-label":
|
|
159
|
+
onClick: B,
|
|
160
|
+
"aria-label": E("adaptercloud.resources.clearTypeFilter", "Clear type filter"),
|
|
143
161
|
className: "absolute right-2 top-1/2 -translate-y-1/2 rounded p-0.5 text-text-secondary transition-colors hover:text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]",
|
|
144
162
|
children: /* @__PURE__ */ _(h, { className: "h-4 w-4" })
|
|
145
163
|
})]
|
|
146
164
|
}), /* @__PURE__ */ _("button", {
|
|
147
165
|
type: "submit",
|
|
148
|
-
"aria-label":
|
|
166
|
+
"aria-label": E("adaptercloud.resources.applyTypeFilter", "Apply type filter"),
|
|
149
167
|
className: "inline-flex shrink-0 items-center justify-center rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 text-text-primary transition-colors hover:bg-accent focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]",
|
|
150
168
|
children: /* @__PURE__ */ _(p, { className: "h-4 w-4" })
|
|
151
169
|
})]
|
|
152
170
|
}),
|
|
153
|
-
|
|
171
|
+
w && /* @__PURE__ */ v("span", {
|
|
154
172
|
className: "inline-flex items-center gap-1.5 rounded-full bg-accent-blue-subtle px-2.5 py-1 text-xs text-accent-blue",
|
|
155
|
-
children: [
|
|
173
|
+
children: [E("adaptercloud.resources.scopedToConnection", "Scoped to connection"), /* @__PURE__ */ _("button", {
|
|
156
174
|
type: "button",
|
|
157
|
-
onClick:
|
|
158
|
-
"aria-label":
|
|
175
|
+
onClick: V,
|
|
176
|
+
"aria-label": E("adaptercloud.resources.clearScope", "Clear connection scope"),
|
|
159
177
|
className: "inline-flex items-center rounded p-0.5 font-semibold transition-colors hover:text-accent-blue-hover focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]",
|
|
160
178
|
children: /* @__PURE__ */ _(h, { className: "h-3.5 w-3.5" })
|
|
161
179
|
})]
|
|
162
180
|
})
|
|
163
181
|
]
|
|
164
182
|
}), /* @__PURE__ */ v(a, {
|
|
165
|
-
isLoading:
|
|
166
|
-
isError:
|
|
167
|
-
isEmpty:
|
|
168
|
-
error:
|
|
169
|
-
onRetry: () => void
|
|
170
|
-
emptyTitle:
|
|
171
|
-
emptyDescription:
|
|
183
|
+
isLoading: F.isLoading,
|
|
184
|
+
isError: F.isError,
|
|
185
|
+
isEmpty: I.length === 0,
|
|
186
|
+
error: F.error,
|
|
187
|
+
onRetry: () => void F.refetch(),
|
|
188
|
+
emptyTitle: E("adaptercloud.resources.emptyTitle", "No resources found"),
|
|
189
|
+
emptyDescription: E("adaptercloud.resources.emptyDescription", "Run a discovery sync against a connection to populate the inventory."),
|
|
172
190
|
emptyIcon: /* @__PURE__ */ _(m, { className: "h-10 w-10" }),
|
|
173
191
|
emptyAction: /* @__PURE__ */ _("button", {
|
|
174
192
|
type: "button",
|
|
175
|
-
onClick: () =>
|
|
193
|
+
onClick: () => S("/connections"),
|
|
176
194
|
className: "rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text transition-colors hover:opacity-90",
|
|
177
|
-
children:
|
|
195
|
+
children: E("adaptercloud.resources.goToConnections", "Go to connections")
|
|
178
196
|
}),
|
|
179
197
|
children: [/* @__PURE__ */ _(y, {
|
|
180
|
-
data:
|
|
181
|
-
columns:
|
|
198
|
+
data: I,
|
|
199
|
+
columns: H,
|
|
182
200
|
rowKey: (e) => e.id,
|
|
183
|
-
onRowClick: (e) =>
|
|
184
|
-
}), (
|
|
201
|
+
onRowClick: (e) => S(`/resources/${e.id}`)
|
|
202
|
+
}), (N > 0 || L) && /* @__PURE__ */ v("div", {
|
|
185
203
|
className: "mt-6 flex items-center justify-between",
|
|
186
204
|
children: [
|
|
187
205
|
/* @__PURE__ */ v("button", {
|
|
188
206
|
type: "button",
|
|
189
|
-
disabled:
|
|
190
|
-
onClick: () =>
|
|
207
|
+
disabled: N === 0,
|
|
208
|
+
onClick: () => P((e) => Math.max(0, e - b)),
|
|
191
209
|
className: "inline-flex items-center gap-1 rounded-lg border border-border-subtle px-3 py-2 text-sm font-medium text-text-primary transition-colors hover:bg-accent disabled:cursor-not-allowed disabled:opacity-50",
|
|
192
|
-
children: [/* @__PURE__ */ _(d, { className: "h-4 w-4" }),
|
|
210
|
+
children: [/* @__PURE__ */ _(d, { className: "h-4 w-4" }), E("adaptercloud.common.prev", "Previous")]
|
|
193
211
|
}),
|
|
194
212
|
/* @__PURE__ */ v("span", {
|
|
195
|
-
className: "text-sm text-text-secondary",
|
|
213
|
+
className: "text-sm tabular-nums text-text-secondary",
|
|
196
214
|
children: [
|
|
197
|
-
|
|
215
|
+
E("adaptercloud.common.showing", "Showing"),
|
|
198
216
|
" ",
|
|
199
|
-
|
|
217
|
+
N + 1,
|
|
200
218
|
"–",
|
|
201
|
-
|
|
219
|
+
N + I.length,
|
|
220
|
+
R != null && ` ${E("adaptercloud.common.of", "of")} ${R}`
|
|
202
221
|
]
|
|
203
222
|
}),
|
|
204
223
|
/* @__PURE__ */ v("button", {
|
|
205
224
|
type: "button",
|
|
206
|
-
disabled: !
|
|
207
|
-
onClick: () =>
|
|
225
|
+
disabled: !L,
|
|
226
|
+
onClick: () => P((e) => e + b),
|
|
208
227
|
className: "inline-flex items-center gap-1 rounded-lg border border-border-subtle px-3 py-2 text-sm font-medium text-text-primary transition-colors hover:bg-accent disabled:cursor-not-allowed disabled:opacity-50",
|
|
209
|
-
children: [
|
|
228
|
+
children: [E("adaptercloud.common.next", "Next"), /* @__PURE__ */ _(f, { className: "h-4 w-4" })]
|
|
210
229
|
})
|
|
211
230
|
]
|
|
212
231
|
})]
|
|
@@ -214,6 +233,6 @@ function x() {
|
|
|
214
233
|
});
|
|
215
234
|
}
|
|
216
235
|
//#endregion
|
|
217
|
-
export {
|
|
236
|
+
export { S as ResourcesListPage };
|
|
218
237
|
|
|
219
238
|
//# sourceMappingURL=ResourcesListPage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResourcesListPage.js","names":[],"sources":["../../../../src/adaptercloud/pages/resources/ResourcesListPage.tsx"],"sourcesContent":["/**\n * Resources List Page\n * @module adaptercloud/pages/resources\n *\n * The unified resource inventory across the workspace (`adaListResources`).\n * Supports filtering by lifecycle state, resource type (free text) and, via the\n * `?connectionId=` URL param, by connection. Offset pagination.\n */\n\nimport { useState, useCallback } from 'react';\nimport { useSearchParams } from 'react-router';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\nimport { Server, ChevronLeft, ChevronRight, Search, X } from 'lucide-react';\nimport { ResponsiveTable, type ResponsiveTableColumn } from '@burdenoff/fe-libs/ui';\nimport { PageLayout } from '../../components/PageLayout';\nimport { StatusBadge } from '../../components/StatusBadge';\nimport { DataState } from '../../components/DataState';\nimport { useAdapterCloud } from '../../context/AdapterCloudContext';\nimport { useResources } from '../../hooks/useAdapterCloudApi';\nimport { resourceStateLabels, formatMoney } from '../../utils/domain';\nimport { formatRelativeTime } from '../../utils/formatters';\nimport type { AdaResource, AdaResourceState } from '../../types';\n\nconst PAGE_SIZE = 25;\n\nexport function ResourcesListPage() {\n const { navigateTo } = useAdapterCloud();\n const [searchParams] = useSearchParams();\n const connectionId = searchParams.get('connectionId') ?? undefined;\n\n const { t: translate } = useI18n();\n const t = useCallback(\n (key: string, fallback: string): string => {\n const value = translate(key);\n return value === key ? fallback : value;\n },\n [translate]\n );\n\n const [state, setState] = useState<AdaResourceState | ''>('');\n const [typeInput, setTypeInput] = useState('');\n const [appliedType, setAppliedType] = useState('');\n const [offset, setOffset] = useState(0);\n\n const query = useResources({\n connectionId,\n state: state || undefined,\n resourceType: appliedType || undefined,\n pagination: { limit: PAGE_SIZE, offset },\n });\n\n const items = query.data?.items ?? [];\n const hasMore = query.data?.pageInfo.hasMore ?? false;\n\n const onSearch = useCallback(\n (e: React.FormEvent) => {\n e.preventDefault();\n setAppliedType(typeInput.trim());\n setOffset(0);\n },\n [typeInput]\n );\n\n const clearType = useCallback(() => {\n setTypeInput('');\n setAppliedType('');\n setOffset(0);\n }, []);\n\n // Clearing the connection scope must return to a clean page 1 of the full\n // inventory — reset offset AND the applied filters, then drop the URL param.\n const clearScope = useCallback(() => {\n setState('');\n setTypeInput('');\n setAppliedType('');\n setOffset(0);\n navigateTo('/resources');\n }, [navigateTo]);\n\n const columns: ResponsiveTableColumn<AdaResource>[] = [\n {\n key: 'name',\n header: t('adaptercloud.resources.name', 'Name'),\n priority: 'primary',\n cell: (r) => (\n <div className=\"min-w-0\">\n <p className=\"truncate font-medium text-text-primary\">{r.name}</p>\n <p className=\"truncate text-xs text-text-secondary\">{r.externalId}</p>\n </div>\n ),\n },\n {\n key: 'type',\n header: t('adaptercloud.resources.type', 'Type'),\n priority: 'primary',\n cell: (r) => <span className=\"font-mono text-xs text-text-primary\">{r.resourceType}</span>,\n },\n {\n key: 'connection',\n header: t('adaptercloud.resources.connection', 'Connection'),\n priority: 'secondary',\n cell: (r) => (\n <span className=\"truncate text-sm text-text-secondary\">{r.connection?.name ?? '—'}</span>\n ),\n },\n {\n key: 'region',\n header: t('adaptercloud.resources.region', 'Region'),\n priority: 'secondary',\n cell: (r) => <span className=\"text-sm text-text-secondary\">{r.region ?? '—'}</span>,\n },\n {\n key: 'cost',\n header: t('adaptercloud.resources.monthlyCost', 'Monthly Cost'),\n priority: 'secondary',\n cell: (r) => (\n <span className=\"text-sm tabular-nums text-text-primary\">{formatMoney(r.monthlyCost)}</span>\n ),\n },\n {\n key: 'state',\n header: t('adaptercloud.resources.state', 'State'),\n priority: 'primary',\n cell: (r) => <StatusBadge status={r.state} label={resourceStateLabels[r.state]} />,\n },\n {\n key: 'seen',\n header: t('adaptercloud.resources.lastSeen', 'Last Seen'),\n priority: 'hidden-on-mobile',\n cell: (r) => (\n <span className=\"text-xs text-text-secondary\">\n {r.lastSeenAt ? formatRelativeTime(r.lastSeenAt) : '—'}\n </span>\n ),\n },\n ];\n\n return (\n <PageLayout\n title={t('adaptercloud.resources.title', 'Resources')}\n description={t(\n 'adaptercloud.resources.subtitle',\n 'The unified inventory of everything discovered across every connection.'\n )}\n >\n {/* Filters */}\n <div className=\"mb-6 flex flex-wrap items-center gap-3\">\n <select\n value={state}\n onChange={(e) => {\n setState(e.target.value as AdaResourceState | '');\n setOffset(0);\n }}\n aria-label={t('adaptercloud.resources.filterByState', 'Filter by lifecycle state')}\n className=\"w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)] sm:w-auto\"\n >\n <option value=\"\">{t('adaptercloud.resources.allStates', 'All states')}</option>\n {(Object.keys(resourceStateLabels) as AdaResourceState[]).map((s) => (\n <option key={s} value={s}>\n {resourceStateLabels[s]}\n </option>\n ))}\n </select>\n <form\n onSubmit={onSearch}\n role=\"search\"\n className=\"flex w-full items-center gap-2 sm:w-auto\"\n >\n <div className=\"relative w-full sm:w-56\">\n <input\n type=\"text\"\n value={typeInput}\n onChange={(e) => setTypeInput(e.target.value)}\n aria-label={t('adaptercloud.resources.filterType', 'Filter by resource type')}\n placeholder={t('adaptercloud.resources.filterTypePlaceholder', 'Filter by type…')}\n className=\"w-full rounded-lg border border-border-subtle bg-bg-surface py-2 pl-3 pr-9 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]\"\n />\n {appliedType && (\n <button\n type=\"button\"\n onClick={clearType}\n aria-label={t('adaptercloud.resources.clearTypeFilter', 'Clear type filter')}\n className=\"absolute right-2 top-1/2 -translate-y-1/2 rounded p-0.5 text-text-secondary transition-colors hover:text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]\"\n >\n <X className=\"h-4 w-4\" />\n </button>\n )}\n </div>\n <button\n type=\"submit\"\n aria-label={t('adaptercloud.resources.applyTypeFilter', 'Apply type filter')}\n className=\"inline-flex shrink-0 items-center justify-center rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 text-text-primary transition-colors hover:bg-accent focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]\"\n >\n <Search className=\"h-4 w-4\" />\n </button>\n </form>\n {connectionId && (\n <span className=\"inline-flex items-center gap-1.5 rounded-full bg-accent-blue-subtle px-2.5 py-1 text-xs text-accent-blue\">\n {t('adaptercloud.resources.scopedToConnection', 'Scoped to connection')}\n <button\n type=\"button\"\n onClick={clearScope}\n aria-label={t('adaptercloud.resources.clearScope', 'Clear connection scope')}\n className=\"inline-flex items-center rounded p-0.5 font-semibold transition-colors hover:text-accent-blue-hover focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]\"\n >\n <X className=\"h-3.5 w-3.5\" />\n </button>\n </span>\n )}\n </div>\n\n <DataState\n isLoading={query.isLoading}\n isError={query.isError}\n isEmpty={items.length === 0}\n error={query.error}\n onRetry={() => void query.refetch()}\n emptyTitle={t('adaptercloud.resources.emptyTitle', 'No resources found')}\n emptyDescription={t(\n 'adaptercloud.resources.emptyDescription',\n 'Run a discovery sync against a connection to populate the inventory.'\n )}\n emptyIcon={<Server className=\"h-10 w-10\" />}\n emptyAction={\n <button\n type=\"button\"\n onClick={() => navigateTo('/connections')}\n className=\"rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text transition-colors hover:opacity-90\"\n >\n {t('adaptercloud.resources.goToConnections', 'Go to connections')}\n </button>\n }\n >\n <ResponsiveTable\n data={items}\n columns={columns}\n rowKey={(r) => r.id}\n onRowClick={(r) => navigateTo(`/resources/${r.id}`)}\n />\n\n {(offset > 0 || hasMore) && (\n <div className=\"mt-6 flex items-center justify-between\">\n <button\n type=\"button\"\n disabled={offset === 0}\n onClick={() => setOffset((o) => Math.max(0, o - PAGE_SIZE))}\n className=\"inline-flex items-center gap-1 rounded-lg border border-border-subtle px-3 py-2 text-sm font-medium text-text-primary transition-colors hover:bg-accent disabled:cursor-not-allowed disabled:opacity-50\"\n >\n <ChevronLeft className=\"h-4 w-4\" />\n {t('adaptercloud.common.prev', 'Previous')}\n </button>\n <span className=\"text-sm text-text-secondary\">\n {t('adaptercloud.common.showing', 'Showing')} {offset + 1}–{offset + items.length}\n </span>\n <button\n type=\"button\"\n disabled={!hasMore}\n onClick={() => setOffset((o) => o + PAGE_SIZE)}\n className=\"inline-flex items-center gap-1 rounded-lg border border-border-subtle px-3 py-2 text-sm font-medium text-text-primary transition-colors hover:bg-accent disabled:cursor-not-allowed disabled:opacity-50\"\n >\n {t('adaptercloud.common.next', 'Next')}\n <ChevronRight className=\"h-4 w-4\" />\n </button>\n </div>\n )}\n </DataState>\n </PageLayout>\n );\n}\n"],"mappings":";;;;;;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AD;IACE,MAAK;IACL,eAAe,EAAW,cAAc;IACxC,WAAU;cAET,EAAE,0CAA0C,mBAAmB;GAC1D,CAAA;aAnBZ,CAsBE,kBAAC,GAAD;IACE,MAAM;IACG;IACT,SAAS,MAAM,EAAE;IACjB,aAAa,MAAM,EAAW,cAAc,EAAE,IAAI;GACnD,CAAA,IAEC,IAAS,KAAK,MACd,kBAAC,OAAD;IAAK,WAAU;cAAf;KACE,kBAAC,UAAD;MACE,MAAK;MACL,UAAU,MAAW;MACrB,eAAe,GAAW,MAAM,KAAK,IAAI,GAAG,IAAI,CAAS,CAAC;MAC1D,WAAU;gBAJZ,CAME,kBAAC,GAAD,EAAa,WAAU,UAAW,CAAA,GACjC,EAAE,4BAA4B,UAAU,CACnC;;KACR,kBAAC,QAAD;MAAM,WAAU;gBAAhB;OACG,EAAE,+BAA+B,SAAS;OAAE;OAAE,IAAS;OAAE;OAAE,IAAS,EAAM;MACvE;;KACN,kBAAC,UAAD;MACE,MAAK;MACL,UAAU,CAAC;MACX,eAAe,GAAW,MAAM,IAAI,CAAS;MAC7C,WAAU;gBAJZ,CAMG,EAAE,4BAA4B,MAAM,GACrC,kBAAC,GAAD,EAAc,WAAU,UAAW,CAAA,CAC7B;;IACL;KAEE;IACD;;AAEhB"}
|
|
1
|
+
{"version":3,"file":"ResourcesListPage.js","names":[],"sources":["../../../../src/adaptercloud/pages/resources/ResourcesListPage.tsx"],"sourcesContent":["/**\n * Resources List Page\n * @module adaptercloud/pages/resources\n *\n * The unified resource inventory across the workspace (`adaListResources`).\n * Supports filtering by lifecycle state, resource type (free text) and, via the\n * `?connectionId=` URL param, by connection. Offset pagination.\n */\n\nimport { useState, useCallback } from 'react';\nimport { useSearchParams } from 'react-router';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\nimport { Server, ChevronLeft, ChevronRight, Search, X } from 'lucide-react';\nimport { ResponsiveTable, type ResponsiveTableColumn } from '@burdenoff/fe-libs/ui';\nimport { PageLayout } from '../../components/PageLayout';\nimport { StatusBadge } from '../../components/StatusBadge';\nimport { DataState } from '../../components/DataState';\nimport { useAdapterCloud } from '../../context/AdapterCloudContext';\nimport { useResources } from '../../hooks/useAdapterCloudApi';\nimport { resourceStateLabels, formatMoney } from '../../utils/domain';\nimport { formatRelativeTime } from '../../utils/formatters';\nimport type { AdaResource, AdaResourceState } from '../../types';\n\nconst PAGE_SIZE = 25;\n\n/** Tag chips rendered inline per row before collapsing into a \"+N\" counter. */\nconst TAGS_SHOWN = 2;\n\nexport function ResourcesListPage() {\n const { navigateTo } = useAdapterCloud();\n const [searchParams] = useSearchParams();\n const connectionId = searchParams.get('connectionId') ?? undefined;\n\n const { t: translate } = useI18n();\n const t = useCallback(\n (key: string, fallback: string): string => {\n const value = translate(key);\n return value === key ? fallback : value;\n },\n [translate]\n );\n\n const [state, setState] = useState<AdaResourceState | ''>('');\n const [typeInput, setTypeInput] = useState('');\n const [appliedType, setAppliedType] = useState('');\n const [offset, setOffset] = useState(0);\n\n const query = useResources({\n connectionId,\n state: state || undefined,\n resourceType: appliedType || undefined,\n pagination: { limit: PAGE_SIZE, offset },\n });\n\n const items = query.data?.items ?? [];\n const hasMore = query.data?.pageInfo.hasMore ?? false;\n // Estate-wide total for the current filter. Nullable on older deployed\n // schemas — the footer then falls back to the bare offset range.\n const totalCount = query.data?.pageInfo.totalCount;\n\n const onSearch = useCallback(\n (e: React.FormEvent) => {\n e.preventDefault();\n setAppliedType(typeInput.trim());\n setOffset(0);\n },\n [typeInput]\n );\n\n const clearType = useCallback(() => {\n setTypeInput('');\n setAppliedType('');\n setOffset(0);\n }, []);\n\n // Clearing the connection scope must return to a clean page 1 of the full\n // inventory — reset offset AND the applied filters, then drop the URL param.\n const clearScope = useCallback(() => {\n setState('');\n setTypeInput('');\n setAppliedType('');\n setOffset(0);\n navigateTo('/resources');\n }, [navigateTo]);\n\n const columns: ResponsiveTableColumn<AdaResource>[] = [\n {\n key: 'name',\n header: t('adaptercloud.resources.name', 'Name'),\n priority: 'primary',\n cell: (r) => (\n <div className=\"min-w-0\">\n <p className=\"truncate font-medium text-text-primary\">{r.name}</p>\n <p className=\"truncate text-xs text-text-secondary\">{r.externalId}</p>\n </div>\n ),\n },\n {\n key: 'type',\n header: t('adaptercloud.resources.type', 'Type'),\n priority: 'primary',\n cell: (r) => <span className=\"font-mono text-xs text-text-primary\">{r.resourceType}</span>,\n },\n {\n key: 'connection',\n header: t('adaptercloud.resources.connection', 'Connection'),\n priority: 'secondary',\n cell: (r) => (\n <span className=\"truncate text-sm text-text-secondary\">{r.connection?.name ?? '—'}</span>\n ),\n },\n {\n key: 'region',\n header: t('adaptercloud.resources.region', 'Region'),\n priority: 'secondary',\n cell: (r) => <span className=\"text-sm text-text-secondary\">{r.region ?? '—'}</span>,\n },\n {\n key: 'cost',\n header: t('adaptercloud.resources.monthlyCost', 'Monthly Cost'),\n priority: 'secondary',\n cell: (r) => (\n <span className=\"text-sm tabular-nums text-text-primary\">{formatMoney(r.monthlyCost)}</span>\n ),\n },\n {\n key: 'state',\n header: t('adaptercloud.resources.state', 'State'),\n priority: 'primary',\n cell: (r) => <StatusBadge status={r.state} label={resourceStateLabels[r.state]} />,\n },\n {\n key: 'tags',\n header: t('adaptercloud.common.tags', 'Tags'),\n priority: 'hidden-on-mobile',\n cell: (r) =>\n r.tags.length > 0 ? (\n <div className=\"flex flex-wrap items-center gap-1\">\n {r.tags.slice(0, TAGS_SHOWN).map((tag) => (\n <span\n key={tag}\n className=\"inline-flex items-center rounded-full bg-bg-sunken px-2 py-0.5 text-xs text-text-secondary\"\n >\n {tag}\n </span>\n ))}\n {r.tags.length > TAGS_SHOWN && (\n <span className=\"text-xs text-text-secondary\">+{r.tags.length - TAGS_SHOWN}</span>\n )}\n </div>\n ) : (\n <span className=\"text-text-tertiary\">—</span>\n ),\n },\n {\n key: 'seen',\n header: t('adaptercloud.resources.lastSeen', 'Last Seen'),\n priority: 'hidden-on-mobile',\n cell: (r) => (\n <span className=\"text-xs text-text-secondary\">\n {r.lastSeenAt ? formatRelativeTime(r.lastSeenAt) : '—'}\n </span>\n ),\n },\n ];\n\n return (\n <PageLayout\n title={t('adaptercloud.resources.title', 'Resources')}\n description={t(\n 'adaptercloud.resources.subtitle',\n 'The unified inventory of everything discovered across every connection.'\n )}\n >\n {/* Filters */}\n <div className=\"mb-6 flex flex-wrap items-center gap-3\">\n <select\n value={state}\n onChange={(e) => {\n setState(e.target.value as AdaResourceState | '');\n setOffset(0);\n }}\n aria-label={t('adaptercloud.resources.filterByState', 'Filter by lifecycle state')}\n className=\"w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)] sm:w-auto\"\n >\n <option value=\"\">{t('adaptercloud.resources.allStates', 'All states')}</option>\n {(Object.keys(resourceStateLabels) as AdaResourceState[]).map((s) => (\n <option key={s} value={s}>\n {resourceStateLabels[s]}\n </option>\n ))}\n </select>\n <form\n onSubmit={onSearch}\n role=\"search\"\n className=\"flex w-full items-center gap-2 sm:w-auto\"\n >\n <div className=\"relative w-full sm:w-56\">\n <input\n type=\"text\"\n value={typeInput}\n onChange={(e) => setTypeInput(e.target.value)}\n aria-label={t('adaptercloud.resources.filterType', 'Filter by resource type')}\n placeholder={t('adaptercloud.resources.filterTypePlaceholder', 'Filter by type…')}\n className=\"w-full rounded-lg border border-border-subtle bg-bg-surface py-2 pl-3 pr-9 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]\"\n />\n {appliedType && (\n <button\n type=\"button\"\n onClick={clearType}\n aria-label={t('adaptercloud.resources.clearTypeFilter', 'Clear type filter')}\n className=\"absolute right-2 top-1/2 -translate-y-1/2 rounded p-0.5 text-text-secondary transition-colors hover:text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]\"\n >\n <X className=\"h-4 w-4\" />\n </button>\n )}\n </div>\n <button\n type=\"submit\"\n aria-label={t('adaptercloud.resources.applyTypeFilter', 'Apply type filter')}\n className=\"inline-flex shrink-0 items-center justify-center rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 text-text-primary transition-colors hover:bg-accent focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]\"\n >\n <Search className=\"h-4 w-4\" />\n </button>\n </form>\n {connectionId && (\n <span className=\"inline-flex items-center gap-1.5 rounded-full bg-accent-blue-subtle px-2.5 py-1 text-xs text-accent-blue\">\n {t('adaptercloud.resources.scopedToConnection', 'Scoped to connection')}\n <button\n type=\"button\"\n onClick={clearScope}\n aria-label={t('adaptercloud.resources.clearScope', 'Clear connection scope')}\n className=\"inline-flex items-center rounded p-0.5 font-semibold transition-colors hover:text-accent-blue-hover focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]\"\n >\n <X className=\"h-3.5 w-3.5\" />\n </button>\n </span>\n )}\n </div>\n\n <DataState\n isLoading={query.isLoading}\n isError={query.isError}\n isEmpty={items.length === 0}\n error={query.error}\n onRetry={() => void query.refetch()}\n emptyTitle={t('adaptercloud.resources.emptyTitle', 'No resources found')}\n emptyDescription={t(\n 'adaptercloud.resources.emptyDescription',\n 'Run a discovery sync against a connection to populate the inventory.'\n )}\n emptyIcon={<Server className=\"h-10 w-10\" />}\n emptyAction={\n <button\n type=\"button\"\n onClick={() => navigateTo('/connections')}\n className=\"rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text transition-colors hover:opacity-90\"\n >\n {t('adaptercloud.resources.goToConnections', 'Go to connections')}\n </button>\n }\n >\n <ResponsiveTable\n data={items}\n columns={columns}\n rowKey={(r) => r.id}\n onRowClick={(r) => navigateTo(`/resources/${r.id}`)}\n />\n\n {(offset > 0 || hasMore) && (\n <div className=\"mt-6 flex items-center justify-between\">\n <button\n type=\"button\"\n disabled={offset === 0}\n onClick={() => setOffset((o) => Math.max(0, o - PAGE_SIZE))}\n className=\"inline-flex items-center gap-1 rounded-lg border border-border-subtle px-3 py-2 text-sm font-medium text-text-primary transition-colors hover:bg-accent disabled:cursor-not-allowed disabled:opacity-50\"\n >\n <ChevronLeft className=\"h-4 w-4\" />\n {t('adaptercloud.common.prev', 'Previous')}\n </button>\n <span className=\"text-sm tabular-nums text-text-secondary\">\n {t('adaptercloud.common.showing', 'Showing')} {offset + 1}–{offset + items.length}\n {totalCount != null && ` ${t('adaptercloud.common.of', 'of')} ${totalCount}`}\n </span>\n <button\n type=\"button\"\n disabled={!hasMore}\n onClick={() => setOffset((o) => o + PAGE_SIZE)}\n className=\"inline-flex items-center gap-1 rounded-lg border border-border-subtle px-3 py-2 text-sm font-medium text-text-primary transition-colors hover:bg-accent disabled:cursor-not-allowed disabled:opacity-50\"\n >\n {t('adaptercloud.common.next', 'Next')}\n <ChevronRight className=\"h-4 w-4\" />\n </button>\n </div>\n )}\n </DataState>\n </PageLayout>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;AAuBA,IAAM,IAAY,IAGZ,IAAa;AAEnB,SAAgB,IAAoB;CAClC,IAAM,EAAE,kBAAe,EAAgB,GACjC,CAAC,KAAgB,EAAgB,GACjC,IAAe,EAAa,IAAI,cAAc,KAAK,KAAA,GAEnD,EAAE,GAAG,MAAc,EAAQ,GAC3B,IAAI,GACP,GAAa,MAA6B;EACzC,IAAM,IAAQ,EAAU,CAAG;EAC3B,OAAO,MAAU,IAAM,IAAW;CACpC,GACA,CAAC,CAAS,CACZ,GAEM,CAAC,GAAO,KAAY,EAAgC,EAAE,GACtD,CAAC,GAAW,KAAgB,EAAS,EAAE,GACvC,CAAC,GAAa,KAAkB,EAAS,EAAE,GAC3C,CAAC,GAAQ,KAAa,EAAS,CAAC,GAEhC,IAAQ,EAAa;EACzB;EACA,OAAO,KAAS,KAAA;EAChB,cAAc,KAAe,KAAA;EAC7B,YAAY;GAAE,OAAO;GAAW;EAAO;CACzC,CAAC,GAEK,IAAQ,EAAM,MAAM,SAAS,CAAC,GAC9B,IAAU,EAAM,MAAM,SAAS,WAAW,IAG1C,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,kBAAC,OAAD;IAAK,WAAU;cAAf;KACE,kBAAC,UAAD;MACE,MAAK;MACL,UAAU,MAAW;MACrB,eAAe,GAAW,MAAM,KAAK,IAAI,GAAG,IAAI,CAAS,CAAC;MAC1D,WAAU;gBAJZ,CAME,kBAAC,GAAD,EAAa,WAAU,UAAW,CAAA,GACjC,EAAE,4BAA4B,UAAU,CACnC;;KACR,kBAAC,QAAD;MAAM,WAAU;gBAAhB;OACG,EAAE,+BAA+B,SAAS;OAAE;OAAE,IAAS;OAAE;OAAE,IAAS,EAAM;OAC1E,KAAc,QAAQ,IAAI,EAAE,0BAA0B,IAAI,EAAE,GAAG;MAC5D;;KACN,kBAAC,UAAD;MACE,MAAK;MACL,UAAU,CAAC;MACX,eAAe,GAAW,MAAM,IAAI,CAAS;MAC7C,WAAU;gBAJZ,CAMG,EAAE,4BAA4B,MAAM,GACrC,kBAAC,GAAD,EAAc,WAAU,UAAW,CAAA,CAC7B;;IACL;KAEE;IACD;;AAEhB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SyncRunsListPage.d.ts","sourceRoot":"","sources":["../../../../src/adaptercloud/pages/sync-runs/SyncRunsListPage.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;
|
|
1
|
+
{"version":3,"file":"SyncRunsListPage.d.ts","sourceRoot":"","sources":["../../../../src/adaptercloud/pages/sync-runs/SyncRunsListPage.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AA2FH,wBAAgB,gBAAgB,gCAkV/B"}
|