@camunda/ccma-saas-frontend 0.6.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/esm/components/c4-cluster-settings/c4-cluster-settings.d.ts +1 -1
- package/lib/esm/components/c4-cluster-settings/c4-cluster-settings.js +4 -2
- package/lib/esm/components/c4-cluster-settings/c4-cluster-settings.mocks.js +1 -1
- package/lib/esm/components/c4-cluster-settings/c4-cluster-settings.types.d.ts +4 -0
- package/lib/esm/components/c4-cluster-settings/elements/external-identity-provider-modal.js +15 -5
- package/lib/esm/components/c4-cluster-settings/elements/external-identity-provider.d.ts +12 -1
- package/lib/esm/components/c4-cluster-settings/elements/external-identity-provider.js +9 -3
- package/lib/esm/components/c4-cluster-settings/elements/session-settings.d.ts +13 -0
- package/lib/esm/components/c4-cluster-settings/elements/session-settings.js +69 -0
- package/lib/esm/components/c4-create-alert-modal/c4-create-alert-modal.js +19 -1
- package/lib/esm/components/c4-create-alert-modal/c4-create-alert-modal.mocks.js +2 -1
- package/lib/esm/components/c4-create-alert-modal/c4-create-alert-modal.types.d.ts +1 -0
- package/lib/esm/components/c4-create-console-api-client-modal/c4-create-console-api-client-modal.js +12 -0
- package/lib/esm/components/c4-create-ip-whitelist-modal/c4-create-ip-whitelist-modal.js +7 -2
- package/lib/esm/components/c4-delete-organization-modal/c4-delete-organization-modal.d.ts +1 -1
- package/lib/esm/components/c4-delete-organization-modal/c4-delete-organization-modal.js +3 -3
- package/lib/esm/components/c4-delete-organization-modal/c4-delete-organization-modal.types.d.ts +7 -0
- package/lib/esm/components/c4-navigation/c4-navigation.js +17 -9
- package/lib/esm/components/c4-usage-history/elements/usage-history-charts.d.ts +7 -1
- package/lib/esm/components/c4-usage-history/elements/usage-history-charts.js +2 -2
- package/lib/esm/i18n/en/modals/apiclients.json +4 -1
- package/lib/esm/i18n/en/pages/clusterdetails.json +2 -2
- package/lib/esm/i18n/en/pages/orgmanagement.json +9 -1
- package/lib/esm/utils/http-error-message.d.ts +14 -0
- package/lib/esm/utils/http-error-message.js +35 -0
- package/lib/esm/widgets/cluster-details/c4-cluster-details-app.d.ts +3 -0
- package/lib/esm/widgets/cluster-details/c4-cluster-details-app.js +148 -32
- package/lib/esm/widgets/cluster-details/c4-cluster-details-app.types.d.ts +3 -0
- package/lib/esm/widgets/cluster-details/c4-cluster-details-page.js +18 -0
- package/lib/esm/widgets/cluster-details/c4-cluster-details-page.types.d.ts +5 -0
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-alerts-tab.d.ts +1 -0
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-encryption-tab.js +1 -1
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-ip-whitelist-tab.d.ts +1 -1
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-ip-whitelist-tab.js +15 -3
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-settings-tab.js +107 -18
- package/lib/esm/widgets/management/c4-management-app.js +366 -42
- package/lib/esm/widgets/management/tabs/c4-management-api-tab.js +21 -0
- package/lib/esm/widgets/management/tabs/c4-management-usage-tab.d.ts +30 -1
- package/lib/esm/widgets/management/tabs/c4-management-usage-tab.js +34 -14
- package/package.json +4 -4
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
import { type HdpPrometheusDataCapacityDataPoint } from '@camunda/ccma-shared-types';
|
|
1
2
|
import { type JSX } from 'react';
|
|
2
3
|
import type { C4ClusterDetailsAppProps } from './c4-cluster-details-app.types.js';
|
|
3
4
|
export declare function mergeNestedSnapshot<T>(previous: T | undefined, next: T): T;
|
|
5
|
+
export declare function ensureClusterLoadPerDay(perDay: HdpPrometheusDataCapacityDataPoint[]): HdpPrometheusDataCapacityDataPoint[];
|
|
6
|
+
export declare function ensureClusterLoad24h(last24h: HdpPrometheusDataCapacityDataPoint[]): HdpPrometheusDataCapacityDataPoint[];
|
|
4
7
|
export declare const C4ClusterDetailsApp: ((props: C4ClusterDetailsAppProps) => JSX.Element) & {
|
|
5
8
|
displayName: string;
|
|
6
9
|
};
|
|
@@ -4,7 +4,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
4
4
|
* under one or more contributor license agreements. Licensed under a commercial license.
|
|
5
5
|
* You may not use this file except in compliance with the commercial license.
|
|
6
6
|
*/
|
|
7
|
-
import { AuditLoggerService, ConsoleAlertsService, ConsoleByomMonitoringService, ConsoleClusterClientsService, ConsoleClusterParametersService, ConsoleClusterService, HdpService, SaaSJobsService, } from '@camunda/ccma-api';
|
|
7
|
+
import { AuditLoggerService, ConsoleAlertsService, ConsoleByomMonitoringService, ConsoleClusterClientsService, ConsoleClusterParametersService, ConsoleClusterService, HdpService, HttpError, SaaSJobsService, } from '@camunda/ccma-api';
|
|
8
8
|
import { checkVersion, SseEntity, VersionCheckOperator, } from '@camunda/ccma-shared-types';
|
|
9
9
|
import { observer } from 'mobx-react-lite';
|
|
10
10
|
import { useCallback, useEffect, useMemo, useRef, useState, } from 'react';
|
|
@@ -154,7 +154,31 @@ function persistDismissedFailedRestores(ids) {
|
|
|
154
154
|
// localStorage unavailable (private mode / SSR) — dismissal is best-effort.
|
|
155
155
|
}
|
|
156
156
|
}
|
|
157
|
-
|
|
157
|
+
// Client-side dismissal of the "update your BYOM/BYOIDP endpoint after
|
|
158
|
+
// failover" notice (#9679) — same reasoning as above: whether the customer
|
|
159
|
+
// has actually gone and repointed their external monitoring/identity
|
|
160
|
+
// provider at this cluster isn't something Console can observe, so there's
|
|
161
|
+
// no server-computed "done" state to gate on. Keyed by cluster uuid so a
|
|
162
|
+
// different cluster's notice isn't accidentally suppressed.
|
|
163
|
+
const DISMISSED_FAILOVER_URI_NOTICES_KEY = 'c4:dismissedFailoverUriNotices';
|
|
164
|
+
function loadDismissedFailoverUriNotices() {
|
|
165
|
+
try {
|
|
166
|
+
const raw = window.localStorage.getItem(DISMISSED_FAILOVER_URI_NOTICES_KEY);
|
|
167
|
+
return new Set(raw ? JSON.parse(raw) : []);
|
|
168
|
+
}
|
|
169
|
+
catch {
|
|
170
|
+
return new Set();
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
function persistDismissedFailoverUriNotices(ids) {
|
|
174
|
+
try {
|
|
175
|
+
window.localStorage.setItem(DISMISSED_FAILOVER_URI_NOTICES_KEY, JSON.stringify([...ids]));
|
|
176
|
+
}
|
|
177
|
+
catch {
|
|
178
|
+
// localStorage unavailable (private mode / SSR) — dismissal is best-effort.
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
export function ensureClusterLoadPerDay(perDay) {
|
|
158
182
|
const DAY = 24 * 60 * 60 * 1000;
|
|
159
183
|
const now = Date.now();
|
|
160
184
|
const updatedPerDay = perDay.filter((point) => Number.isFinite(point.ts) &&
|
|
@@ -189,7 +213,12 @@ function ensureClusterLoadPerDay(perDay) {
|
|
|
189
213
|
updatedPerDay.sort((a, b) => b.ts - a.ts);
|
|
190
214
|
return updatedPerDay;
|
|
191
215
|
}
|
|
192
|
-
|
|
216
|
+
// Sorts ascending by timestamp (oldest first, "now" last) — the chart plots
|
|
217
|
+
// its array in order left-to-right, matching the 7d/30d convention.
|
|
218
|
+
function sortAscendingByTs(points) {
|
|
219
|
+
return points.sort((a, b) => a.ts - b.ts);
|
|
220
|
+
}
|
|
221
|
+
export function ensureClusterLoad24h(last24h) {
|
|
193
222
|
const HOUR = 60 * 60 * 1000;
|
|
194
223
|
const DAY = 24 * HOUR;
|
|
195
224
|
const now = Date.now();
|
|
@@ -197,36 +226,55 @@ function ensureClusterLoad24h(last24h) {
|
|
|
197
226
|
Number.isFinite(point.min) &&
|
|
198
227
|
Number.isFinite(point.max) &&
|
|
199
228
|
Number.isFinite(point.avg));
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
max: 0,
|
|
211
|
-
avg: 0,
|
|
212
|
-
});
|
|
213
|
-
}
|
|
229
|
+
// No real data at all — fill a full 24h window with zeros so the chart
|
|
230
|
+
// still renders instead of being empty.
|
|
231
|
+
if (updated24h.length === 0) {
|
|
232
|
+
for (let i = 0; i < 24; i += 1) {
|
|
233
|
+
updated24h.push({
|
|
234
|
+
ts: now - i * HOUR,
|
|
235
|
+
min: 0,
|
|
236
|
+
max: 0,
|
|
237
|
+
avg: 0,
|
|
238
|
+
});
|
|
214
239
|
}
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
240
|
+
return sortAscendingByTs(updated24h);
|
|
241
|
+
}
|
|
242
|
+
// We have real data (e.g. a cluster younger than 24h only has a handful of
|
|
243
|
+
// hourly buckets) — never discard it. Only backfill the gap between the
|
|
244
|
+
// most recent real point and "now" when that point is stale, so a
|
|
245
|
+
// still-fresh but incomplete window keeps its real values (including any
|
|
246
|
+
// spikes) instead of being wiped and replaced with zeros.
|
|
247
|
+
const max24h = Math.max(...updated24h.map((item) => item.ts));
|
|
248
|
+
// The most recent real point is itself very stale (e.g. the cluster was
|
|
249
|
+
// paused and its newest hourly bucket is many hours/days old). Padding
|
|
250
|
+
// forward from that point — even capped — could still land far in the
|
|
251
|
+
// past and never reach "now". Fall back to the same full zero-refill
|
|
252
|
+
// anchored at "now" used when there is no real data at all, mirroring how
|
|
253
|
+
// `ensureClusterLoadPerDay` treats a stale latest point.
|
|
254
|
+
if (max24h < now - DAY) {
|
|
255
|
+
updated24h.length = 0;
|
|
256
|
+
for (let i = 0; i < 24; i += 1) {
|
|
257
|
+
updated24h.push({
|
|
258
|
+
ts: now - i * HOUR,
|
|
259
|
+
min: 0,
|
|
260
|
+
max: 0,
|
|
261
|
+
avg: 0,
|
|
262
|
+
});
|
|
263
|
+
}
|
|
264
|
+
return sortAscendingByTs(updated24h);
|
|
265
|
+
}
|
|
266
|
+
if (max24h < now - HOUR) {
|
|
267
|
+
const missingHours = Math.floor((now - max24h) / HOUR);
|
|
268
|
+
for (let i = 1; i < missingHours + 1; i += 1) {
|
|
269
|
+
updated24h.push({
|
|
270
|
+
ts: max24h + i * HOUR,
|
|
271
|
+
min: 0,
|
|
272
|
+
max: 0,
|
|
273
|
+
avg: 0,
|
|
274
|
+
});
|
|
226
275
|
}
|
|
227
276
|
}
|
|
228
|
-
updated24h
|
|
229
|
-
return updated24h;
|
|
277
|
+
return sortAscendingByTs(updated24h);
|
|
230
278
|
}
|
|
231
279
|
function isUnsupportedGenerationStarted(isUnsupportedStarting) {
|
|
232
280
|
if (!isUnsupportedStarting) {
|
|
@@ -315,13 +363,25 @@ export const C4ClusterDetailsApp = observer((props) => {
|
|
|
315
363
|
data.upsertCluster(props.orgId, loaded);
|
|
316
364
|
}
|
|
317
365
|
catch (error) {
|
|
366
|
+
// A cluster that no longer exists (e.g. a stale/typo'd URL) is not an
|
|
367
|
+
// error state worth rendering inline — send the user back to the
|
|
368
|
+
// dashboard instead of showing an empty tab shell with the backend's
|
|
369
|
+
// generic 404 body text. Only short-circuit when a navigation handler
|
|
370
|
+
// is actually available; otherwise fall back to the inline error so
|
|
371
|
+
// the widget never ends up in a blank state.
|
|
372
|
+
if (error instanceof HttpError &&
|
|
373
|
+
error.status === 404 &&
|
|
374
|
+
props.onNavigate) {
|
|
375
|
+
props.onNavigate({ kind: 'dashboard', orgId: props.orgId });
|
|
376
|
+
return;
|
|
377
|
+
}
|
|
318
378
|
setCluster(undefined);
|
|
319
379
|
setClusterError(error instanceof Error ? error.message : 'Failed to load');
|
|
320
380
|
}
|
|
321
381
|
finally {
|
|
322
382
|
setIsClusterLoading(false);
|
|
323
383
|
}
|
|
324
|
-
}, [apiConfig, data, props.clusterId, props.orgId]);
|
|
384
|
+
}, [apiConfig, data, props.clusterId, props.onNavigate, props.orgId]);
|
|
325
385
|
const reloadCreationParameters = useCallback(async () => {
|
|
326
386
|
setIsCreationParametersLoading(true);
|
|
327
387
|
try {
|
|
@@ -483,7 +543,15 @@ export const C4ClusterDetailsApp = observer((props) => {
|
|
|
483
543
|
return next;
|
|
484
544
|
});
|
|
485
545
|
}, []);
|
|
486
|
-
const
|
|
546
|
+
const [dismissedFailoverUriNotices, setDismissedFailoverUriNotices] = useState(loadDismissedFailoverUriNotices);
|
|
547
|
+
const dismissFailoverUriNotice = useCallback((clusterUuid) => {
|
|
548
|
+
setDismissedFailoverUriNotices((prev) => {
|
|
549
|
+
const next = new Set(prev).add(clusterUuid);
|
|
550
|
+
persistDismissedFailoverUriNotices(next);
|
|
551
|
+
return next;
|
|
552
|
+
});
|
|
553
|
+
}, []);
|
|
554
|
+
const primaryBanner = useMemo(() => {
|
|
487
555
|
if (!cluster)
|
|
488
556
|
return undefined;
|
|
489
557
|
if (cluster.restoreInProgress) {
|
|
@@ -825,6 +893,49 @@ export const C4ClusterDetailsApp = observer((props) => {
|
|
|
825
893
|
const [byomError, setByomError] = useState(false);
|
|
826
894
|
const byomLoadedRef = useRef(false);
|
|
827
895
|
const [byomStatus, setByomStatus] = useState({});
|
|
896
|
+
// #9679: a failover cluster carries over the source's BYOM/BYOIDP config
|
|
897
|
+
// as-is, but the customer's external monitoring tool / identity provider
|
|
898
|
+
// still points at the OLD cluster's endpoint — Console can't fix that
|
|
899
|
+
// externally, so this nudges the customer to update it themselves.
|
|
900
|
+
// Combined with primaryBanner further down (this can't be computed
|
|
901
|
+
// there — byomClients isn't declared yet at that point in the component).
|
|
902
|
+
//
|
|
903
|
+
// ponytail: known false positive, accepted rather than engineered around
|
|
904
|
+
// — this fires whenever a failover-destination cluster currently HAS
|
|
905
|
+
// BYOM/BYOIDP config, not specifically when that config was carried over
|
|
906
|
+
// from the source. A customer who sets up monitoring fresh on this
|
|
907
|
+
// cluster (with a correct endpoint from the start) still sees the
|
|
908
|
+
// notice. ByomClient rows do carry a `created` timestamp that could be
|
|
909
|
+
// compared against the cluster's own `created` to guess "looks carried-
|
|
910
|
+
// over", but externalIdpEnabled/externalIdpConfig have no timestamp at
|
|
911
|
+
// all — a heuristic that covers BYOM but silently can't cover BYOIDP
|
|
912
|
+
// would produce harder-to-explain asymmetric behaviour than just always
|
|
913
|
+
// showing it. Cost of the false positive is one extra dismiss click, not
|
|
914
|
+
// incorrect action — revisit if that stops being true (e.g. by tracking
|
|
915
|
+
// "carried over" explicitly at write time).
|
|
916
|
+
const failoverUriBanner = useMemo(() => {
|
|
917
|
+
if (!cluster?.failoverSourceClusterId)
|
|
918
|
+
return undefined;
|
|
919
|
+
if (dismissedFailoverUriNotices.has(cluster.uuid))
|
|
920
|
+
return undefined;
|
|
921
|
+
const hasByom = byomClients.length > 0;
|
|
922
|
+
const hasByoidp = !!cluster.externalIdpEnabled;
|
|
923
|
+
if (!hasByom && !hasByoidp)
|
|
924
|
+
return undefined;
|
|
925
|
+
return {
|
|
926
|
+
kind: 'failoverUriUpdateNeeded',
|
|
927
|
+
hasByom,
|
|
928
|
+
hasByoidp,
|
|
929
|
+
onDismiss: () => dismissFailoverUriNotice(cluster.uuid),
|
|
930
|
+
};
|
|
931
|
+
}, [
|
|
932
|
+
cluster?.failoverSourceClusterId,
|
|
933
|
+
cluster?.uuid,
|
|
934
|
+
cluster?.externalIdpEnabled,
|
|
935
|
+
byomClients.length,
|
|
936
|
+
dismissedFailoverUriNotices,
|
|
937
|
+
dismissFailoverUriNotice,
|
|
938
|
+
]);
|
|
828
939
|
const reloadByom = useCallback(async () => {
|
|
829
940
|
if (!canViewMonitoringTab) {
|
|
830
941
|
setByomClients([]);
|
|
@@ -1035,6 +1146,7 @@ export const C4ClusterDetailsApp = observer((props) => {
|
|
|
1035
1146
|
},
|
|
1036
1147
|
}
|
|
1037
1148
|
: undefined,
|
|
1149
|
+
ignoreHead: params.ignoreHead,
|
|
1038
1150
|
},
|
|
1039
1151
|
});
|
|
1040
1152
|
await reloadAlerts();
|
|
@@ -1387,6 +1499,10 @@ export const C4ClusterDetailsApp = observer((props) => {
|
|
|
1387
1499
|
isCreationParametersLoading,
|
|
1388
1500
|
isSecureConnectivityTabVisible,
|
|
1389
1501
|
]);
|
|
1502
|
+
// primaryBanner takes priority — an active restore, an unmaintained
|
|
1503
|
+
// generation, or disabled authorizations all matter more than a
|
|
1504
|
+
// one-time "update your endpoint" nudge.
|
|
1505
|
+
const banner = primaryBanner ?? failoverUriBanner;
|
|
1390
1506
|
return (_jsxs(_Fragment, { children: [_jsx(C4ClusterDetailsPage, { loading: isClusterLoading || authz.isLoading, clusterName: cluster?.name, isDevelopmentPlan: cluster?.planType?.development, urls: { clusters: urls.clusters }, onNavigateToClusters: () => props.onNavigate?.({ kind: 'clusters', orgId: props.orgId }), menu: {
|
|
1391
1507
|
canRename,
|
|
1392
1508
|
canDelete,
|
|
@@ -66,6 +66,24 @@ function buildBanner(opts) {
|
|
|
66
66
|
onDismiss: banner.onDismiss,
|
|
67
67
|
};
|
|
68
68
|
}
|
|
69
|
+
if (banner.kind === 'failoverUriUpdateNeeded') {
|
|
70
|
+
const title = banner.hasByom && banner.hasByoidp
|
|
71
|
+
? safeTranslate(t, 'c4console:clusterDetails.banner.failoverUriUpdateNeeded.titleBoth', 'Update your monitoring and identity provider settings')
|
|
72
|
+
: banner.hasByoidp
|
|
73
|
+
? safeTranslate(t, 'c4console:clusterDetails.banner.failoverUriUpdateNeeded.titleByoidp', 'Update your identity provider settings')
|
|
74
|
+
: safeTranslate(t, 'c4console:clusterDetails.banner.failoverUriUpdateNeeded.titleByom', 'Update your monitoring settings');
|
|
75
|
+
const subtitle = banner.hasByom && banner.hasByoidp
|
|
76
|
+
? safeTranslate(t, 'c4console:clusterDetails.banner.failoverUriUpdateNeeded.subtitleBoth', 'This cluster replaced another cluster after a failover. Point your external monitoring tool and identity provider at this cluster.')
|
|
77
|
+
: banner.hasByoidp
|
|
78
|
+
? safeTranslate(t, 'c4console:clusterDetails.banner.failoverUriUpdateNeeded.subtitleByoidp', 'This cluster replaced another cluster after a failover. Update your identity provider’s redirect URI to point at this cluster.')
|
|
79
|
+
: safeTranslate(t, 'c4console:clusterDetails.banner.failoverUriUpdateNeeded.subtitleByom', 'This cluster replaced another cluster after a failover. Point your external monitoring tool’s scrape endpoint at this cluster.');
|
|
80
|
+
return {
|
|
81
|
+
kind: 'info',
|
|
82
|
+
title,
|
|
83
|
+
subtitle,
|
|
84
|
+
onDismiss: banner.onDismiss,
|
|
85
|
+
};
|
|
86
|
+
}
|
|
69
87
|
if (banner.kind === 'unsupportedGeneration') {
|
|
70
88
|
const subtitle = banner.isAlphaGeneration
|
|
71
89
|
? safeTranslate(t, 'c4console:clusterDetails.banner.unsupportedGeneration.subtitleAlpha', 'Alpha-generations can’t be updated. Create a new cluster to access the latest features.')
|
|
@@ -12,6 +12,11 @@ export type C4ClusterDetailsPageBanner = {
|
|
|
12
12
|
} | {
|
|
13
13
|
kind: 'restoreFailed';
|
|
14
14
|
onDismiss: () => void;
|
|
15
|
+
} | {
|
|
16
|
+
kind: 'failoverUriUpdateNeeded';
|
|
17
|
+
hasByom: boolean;
|
|
18
|
+
hasByoidp: boolean;
|
|
19
|
+
onDismiss: () => void;
|
|
15
20
|
};
|
|
16
21
|
export type C4ClusterDetailsTab = C4TabProps;
|
|
17
22
|
export interface C4ClusterDetailsPageProps {
|
|
@@ -236,7 +236,7 @@ export const C4ClusterDetailsEncryptionTab = (props) => {
|
|
|
236
236
|
downloadKeyPolicy: 'Download key policy',
|
|
237
237
|
failoverKeyPolicyTitle: 'Action required',
|
|
238
238
|
failoverKeyPolicyText: 'Update your encryption key policy so this cluster can read its restored data.',
|
|
239
|
-
failoverKeyPolicyInstruction: 'This cluster uses the encryption keys from the cluster it was failed over from, so no new key is needed. Grant the three roles below the same key permissions as your original cluster, on both the primary and secondary key. Until then, the restore cannot decrypt your backup data.',
|
|
239
|
+
failoverKeyPolicyInstruction: 'This cluster uses the encryption keys from the cluster it was failed over from, so no new key is needed. Grant the three roles below the same key permissions as your original cluster, on both the primary and secondary key. Until then, the restore cannot decrypt your backup data. Policy changes can take about 10 minutes to propagate, so allow some time after saving before the restore proceeds.',
|
|
240
240
|
failoverKeyPolicyCloneRole: 'Clone role — copies backup data into this cluster',
|
|
241
241
|
failoverKeyPolicyClusterRole: "This cluster's role",
|
|
242
242
|
failoverKeyPolicyReplicationRole: 'Replication role — replicates to the secondary region',
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { RequestBaseParamsConfig } from '@camunda/ccma-api';
|
|
2
|
-
import type
|
|
2
|
+
import { type ConsoleClusterDto } from '@camunda/ccma-shared-types';
|
|
3
3
|
type TranslateFn = (key: string, options?: Record<string, unknown>) => string;
|
|
4
4
|
interface C4ClusterDetailsIpWhitelistTabProps {
|
|
5
5
|
cluster: ConsoleClusterDto | undefined;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { ConsoleIpWhitelistService, ConsoleSecureConnectivityService, } from '@camunda/ccma-api';
|
|
3
|
+
import { normalizeCIDRList, } from '@camunda/ccma-shared-types';
|
|
3
4
|
import { Form } from '@carbon/react';
|
|
4
5
|
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
5
6
|
import { C4ClusterDetailsIpWhitelist } from '../../../components/c4-cluster-details-ip-whitelist/c4-cluster-details-ip-whitelist.js';
|
|
@@ -185,7 +186,10 @@ export const C4ClusterDetailsIpWhitelistTab = (props) => {
|
|
|
185
186
|
trackEvent('clusterOverviewIpWhitelists:updateModal:open', 'Open Update IP Whitelist Modal', { ipIndex });
|
|
186
187
|
const index = ipWhitelistItems.findIndex((ip) => ip.id === String(ipIndex));
|
|
187
188
|
setSelectedIpIndex(index);
|
|
188
|
-
|
|
189
|
+
// Entries stored before allowlist values were normalized can carry
|
|
190
|
+
// stray whitespace; clean it on prefill so re-saving the entry fixes
|
|
191
|
+
// it up.
|
|
192
|
+
setIpValue(normalizeCIDRList(ipWhitelistItems[index]?.ip ?? ''));
|
|
189
193
|
setIpDescription(ipWhitelistItems[index]?.description ?? '');
|
|
190
194
|
setIpMutationError('');
|
|
191
195
|
setUpdateIpOpen(true);
|
|
@@ -230,7 +234,11 @@ export const C4ClusterDetailsIpWhitelistTab = (props) => {
|
|
|
230
234
|
setIpMutationError('');
|
|
231
235
|
try {
|
|
232
236
|
const next = ipWhitelistItems.map((item, index) => index === selectedIpIndex
|
|
233
|
-
? {
|
|
237
|
+
? {
|
|
238
|
+
...item,
|
|
239
|
+
ip: normalizeCIDRList(ipValue),
|
|
240
|
+
description: ipDescription,
|
|
241
|
+
}
|
|
234
242
|
: item);
|
|
235
243
|
await persistIpWhitelist(next);
|
|
236
244
|
setUpdateIpOpen(false);
|
|
@@ -245,7 +253,11 @@ export const C4ClusterDetailsIpWhitelistTab = (props) => {
|
|
|
245
253
|
})();
|
|
246
254
|
}, children: _jsx(Form, { onSubmit: (e) => {
|
|
247
255
|
e.preventDefault();
|
|
248
|
-
}, children: _jsxs(Stack, { gap: 6, children: [ipMutationError && (_jsx(C4InlineNotification, { kind: 'error', title: safeTranslate(t, 'ipwhitelist:update.error.generic', "We're having trouble updating the IP(s)"), subtitle: ipMutationError, lowContrast: true, hideCloseButton: true })), _jsx(TextInput, { id: 'ip-input-whitelist-update', labelText: safeTranslate(t, 'ipwhitelist:create.fields.ips', 'IP(s)'), helperText: safeTranslate(t, 'ipwhitelist:create.fields.ipsHelper', 'Comma separated list of CIDRs, e.g. 10.0.0.0/24,172.10.0.1'), value: ipValue, maxLength: 50,
|
|
256
|
+
}, children: _jsxs(Stack, { gap: 6, children: [ipMutationError && (_jsx(C4InlineNotification, { kind: 'error', title: safeTranslate(t, 'ipwhitelist:update.error.generic', "We're having trouble updating the IP(s)"), subtitle: ipMutationError, lowContrast: true, hideCloseButton: true })), _jsx(TextInput, { id: 'ip-input-whitelist-update', labelText: safeTranslate(t, 'ipwhitelist:create.fields.ips', 'IP(s)'), helperText: safeTranslate(t, 'ipwhitelist:create.fields.ipsHelper', 'Comma separated list of CIDRs, e.g. 10.0.0.0/24,172.10.0.1'), value: ipValue, maxLength: 50,
|
|
257
|
+
// Whitespace is never valid in a CIDR list, and a stray space
|
|
258
|
+
// (typed or pasted) is stored verbatim and breaks the cluster
|
|
259
|
+
// controller — so strip it as the user types.
|
|
260
|
+
onChange: (event) => setIpValue(normalizeCIDRList(event.target.value)) }), _jsx(TextInput, { id: 'name-input-whitelist-update', labelText: safeTranslate(t, 'ipwhitelist:create.fields.description', 'Description (optional)'), value: ipDescription, maxLength: 1024, onChange: (event) => setIpDescription(event.target.value) })] }) }) }), _jsx(Modal, { open: deleteIpOpen, danger: true, modalHeading: `${safeTranslate(t, 'ipwhitelist:delete.heading', 'Delete IP(s)')}: ${ipWhitelistItems[selectedIpIndex]?.ip ?? ''}`, primaryButtonText: safeTranslate(t, 'ipwhitelist:delete.buttons.primary', 'Delete'), secondaryButtonText: safeTranslate(t, 'ipwhitelist:delete.buttons.secondary', 'Cancel'), primaryButtonDisabled: ipMutationBusy, onRequestClose: () => {
|
|
249
261
|
trackEvent('clusterOverviewIpWhitelists:deleteModal:cancel', 'Close Delete IP Whitelist Modal', { ipIndex: selectedIpIndex });
|
|
250
262
|
setDeleteIpOpen(false);
|
|
251
263
|
}, onRequestSubmit: () => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { ConsoleClusterService } from '@camunda/ccma-api';
|
|
3
|
-
import { checkVersion, OPTIMIZE_FILTERING_MIN_VERSION, VersionCheckOperator, } from '@camunda/ccma-shared-types';
|
|
3
|
+
import { BYOIDP_MIN_VERSION, checkVersion, isAppIntegrationsVersionSupported, OPTIMIZE_FILTERING_MIN_VERSION, VersionCheckOperator, } from '@camunda/ccma-shared-types';
|
|
4
4
|
import { Fragment, useCallback, useMemo, useState, } from 'react';
|
|
5
5
|
import { C4ClusterSettings } from '../../../components/c4-cluster-settings/c4-cluster-settings.js';
|
|
6
6
|
import { ExternalIdentityProviderModal, } from '../../../components/c4-cluster-settings/elements/external-identity-provider-modal.js';
|
|
@@ -57,6 +57,8 @@ export const C4ClusterDetailsSettingsTab = (props) => {
|
|
|
57
57
|
const [isUpdatingRba, setIsUpdatingRba] = useState(false);
|
|
58
58
|
const [isUpdatingIdentityAuthorizations, setIsUpdatingIdentityAuthorizations,] = useState(false);
|
|
59
59
|
const [isUpdatingMultiTenancy, setIsUpdatingMultiTenancy] = useState(false);
|
|
60
|
+
const [isUpdatingSessionTimeout, setIsUpdatingSessionTimeout] = useState(false);
|
|
61
|
+
const [isUpdatingSessionHeartbeat, setIsUpdatingSessionHeartbeat] = useState(false);
|
|
60
62
|
// BYOIDP Phase 1 (#3190)
|
|
61
63
|
const [showExternalIdpModal, setShowExternalIdpModal] = useState(false);
|
|
62
64
|
const [isUpdatingExternalIdp, setIsUpdatingExternalIdp] = useState(false);
|
|
@@ -499,6 +501,70 @@ export const C4ClusterDetailsSettingsTab = (props) => {
|
|
|
499
501
|
setIsUpdatingMultiTenancy(false);
|
|
500
502
|
}
|
|
501
503
|
}, [props, runtime.telemetry]);
|
|
504
|
+
// Session idle-timeout config (camunda-security-library ADR-0042,
|
|
505
|
+
// camunda-operator#5863). Both fields feed the generated Identity spec, so a
|
|
506
|
+
// change restarts the cluster — the caller wraps these in
|
|
507
|
+
// applyWithRestartConfirmAsync the same way the optimize data-filters panel does.
|
|
508
|
+
const updateSessionMaxInactiveIntervalMinutes = useCallback(async (minutes) => {
|
|
509
|
+
runtime.telemetry?.track?.('sessionMaxInactiveInterval:confirm', {
|
|
510
|
+
message: `Confirm session idle timeout of ${minutes} minutes`,
|
|
511
|
+
orgId: props.orgId,
|
|
512
|
+
clusterId: props.clusterId,
|
|
513
|
+
minutes,
|
|
514
|
+
});
|
|
515
|
+
setIsUpdatingSessionTimeout(true);
|
|
516
|
+
try {
|
|
517
|
+
await ConsoleClusterService.updateCluster({
|
|
518
|
+
config: props.apiConfig,
|
|
519
|
+
params: { orgId: props.orgId, clusterId: props.clusterId },
|
|
520
|
+
body: { sessionMaxInactiveIntervalMinutes: minutes },
|
|
521
|
+
});
|
|
522
|
+
await props.onReloadCluster();
|
|
523
|
+
}
|
|
524
|
+
catch (error) {
|
|
525
|
+
runtime.telemetry?.captureException?.(error, {
|
|
526
|
+
eventName: 'sessionMaxInactiveInterval:confirm',
|
|
527
|
+
message: 'Error while updating session idle timeout',
|
|
528
|
+
orgId: props.orgId,
|
|
529
|
+
clusterId: props.clusterId,
|
|
530
|
+
minutes,
|
|
531
|
+
});
|
|
532
|
+
setOperationError(error instanceof Error ? error.message : settingUpdateFailedFallback);
|
|
533
|
+
}
|
|
534
|
+
finally {
|
|
535
|
+
setIsUpdatingSessionTimeout(false);
|
|
536
|
+
}
|
|
537
|
+
}, [props, runtime.telemetry, settingUpdateFailedFallback]);
|
|
538
|
+
const updateSessionHeartbeatEnabled = useCallback(async (nextState) => {
|
|
539
|
+
runtime.telemetry?.track?.(`sessionHeartbeat:${nextState}:confirm`, {
|
|
540
|
+
message: `Confirm ${nextState} session heartbeat`,
|
|
541
|
+
orgId: props.orgId,
|
|
542
|
+
clusterId: props.clusterId,
|
|
543
|
+
state: nextState,
|
|
544
|
+
});
|
|
545
|
+
setIsUpdatingSessionHeartbeat(true);
|
|
546
|
+
try {
|
|
547
|
+
await ConsoleClusterService.updateCluster({
|
|
548
|
+
config: props.apiConfig,
|
|
549
|
+
params: { orgId: props.orgId, clusterId: props.clusterId },
|
|
550
|
+
body: { sessionHeartbeatEnabled: nextState },
|
|
551
|
+
});
|
|
552
|
+
await props.onReloadCluster();
|
|
553
|
+
}
|
|
554
|
+
catch (error) {
|
|
555
|
+
runtime.telemetry?.captureException?.(error, {
|
|
556
|
+
eventName: `sessionHeartbeat:${nextState}:confirm`,
|
|
557
|
+
message: 'Error while toggling session heartbeat',
|
|
558
|
+
orgId: props.orgId,
|
|
559
|
+
clusterId: props.clusterId,
|
|
560
|
+
state: nextState,
|
|
561
|
+
});
|
|
562
|
+
setOperationError(error instanceof Error ? error.message : settingUpdateFailedFallback);
|
|
563
|
+
}
|
|
564
|
+
finally {
|
|
565
|
+
setIsUpdatingSessionHeartbeat(false);
|
|
566
|
+
}
|
|
567
|
+
}, [props, runtime.telemetry, settingUpdateFailedFallback]);
|
|
502
568
|
// BYOIDP Phase 1 (#3190): toggle enable/disable. Config + secret are retained on
|
|
503
569
|
// disable (D4), so re-enabling needs no re-entry.
|
|
504
570
|
const updateExternalIdpEnabled = useCallback(async (nextState) => {
|
|
@@ -590,10 +656,16 @@ export const C4ClusterDetailsSettingsTab = (props) => {
|
|
|
590
656
|
const shouldShowMultiTenancy = useMemo(() => {
|
|
591
657
|
return checkClusterVersion('8.8.0-alpha7');
|
|
592
658
|
}, [checkClusterVersion]);
|
|
659
|
+
// Matches the operator's SessionConfigSupported feature gate (camunda-operator
|
|
660
|
+
// #5863), the floor at which both session properties are wired through to
|
|
661
|
+
// Operate/Tasklist/the unified app.
|
|
662
|
+
const shouldShowSessionSettings = useMemo(() => {
|
|
663
|
+
return checkClusterVersion('8.10.0-alpha5');
|
|
664
|
+
}, [checkClusterVersion]);
|
|
593
665
|
// BYOIDP Phase 1 (#3190). TODO(byoidp): byoidp remove gate at GA rollout
|
|
594
666
|
const isByoidpFeatureEnabled = runtime.featureFlags?.isEnabled?.('console.byoidp') ?? false;
|
|
595
667
|
const shouldShowExternalIdp = useMemo(() => {
|
|
596
|
-
return checkClusterVersion(
|
|
668
|
+
return checkClusterVersion(BYOIDP_MIN_VERSION) && isByoidpFeatureEnabled;
|
|
597
669
|
}, [checkClusterVersion, isByoidpFeatureEnabled]);
|
|
598
670
|
const shouldShowOptimizeFiltering = useMemo(() => {
|
|
599
671
|
return (
|
|
@@ -604,25 +676,16 @@ export const C4ClusterDetailsSettingsTab = (props) => {
|
|
|
604
676
|
}, [props.cluster?.hasOptimize, checkClusterVersion]);
|
|
605
677
|
const isAppIntegrationsFeatureEnabled = runtime.featureFlags?.isEnabled?.('console.appIntegrations') ?? false;
|
|
606
678
|
const shouldShowAppIntegrations = useMemo(() => {
|
|
607
|
-
|
|
608
|
-
if (!zeebeVersion || !isAppIntegrationsFeatureEnabled) {
|
|
679
|
+
if (!isAppIntegrationsFeatureEnabled) {
|
|
609
680
|
return false;
|
|
610
681
|
}
|
|
611
|
-
//
|
|
612
|
-
//
|
|
613
|
-
|
|
614
|
-
possiblyVersionOrDockerPath: zeebeVersion,
|
|
615
|
-
trueForSnapshot: 'compare',
|
|
616
|
-
operator: VersionCheckOperator.SameMinor,
|
|
617
|
-
versionToCompareTo: '8.9.0',
|
|
618
|
-
});
|
|
619
|
-
return isIn89Stream
|
|
620
|
-
? checkClusterVersion('8.9.12')
|
|
621
|
-
: checkClusterVersion('8.10.0-alpha3');
|
|
682
|
+
// Shared with the console-backend update guard — see
|
|
683
|
+
// isAppIntegrationsVersionSupported for the version rule itself.
|
|
684
|
+
return isAppIntegrationsVersionSupported(props.cluster?.generation?.versions ?? {});
|
|
622
685
|
}, [
|
|
623
686
|
props.cluster?.generation?.versions?.zeebe,
|
|
687
|
+
props.cluster?.generation?.versions?.connectorBridge,
|
|
624
688
|
isAppIntegrationsFeatureEnabled,
|
|
625
|
-
checkClusterVersion,
|
|
626
689
|
]);
|
|
627
690
|
// Optimize data filters feed the generated spec, so a change restarts the
|
|
628
691
|
// cluster. The toggle/save actions are awaited by the child panel, so route
|
|
@@ -818,6 +881,16 @@ export const C4ClusterDetailsSettingsTab = (props) => {
|
|
|
818
881
|
enabled: props.cluster.externalIdpEnabled ?? false,
|
|
819
882
|
configured: Boolean(props.cluster.externalIdpConfig),
|
|
820
883
|
displayName: props.cluster.externalIdpConfig?.clientName,
|
|
884
|
+
// Saving would create a SecretSync that can never reconcile
|
|
885
|
+
// without the cluster's SecretSource — undefined (older cached
|
|
886
|
+
// responses) fails open rather than disabling BYOIDP everywhere.
|
|
887
|
+
supported: props.cluster.secretSourceProvisioned ?? true,
|
|
888
|
+
unsupportedNotification: props.cluster.secretSourceProvisioned === false
|
|
889
|
+
? {
|
|
890
|
+
title: 'Not available yet',
|
|
891
|
+
subtitle: "This cluster hasn't finished provisioning for secret storage. Save any other cluster setting, then try again.",
|
|
892
|
+
}
|
|
893
|
+
: undefined,
|
|
821
894
|
// BYOIDP (camunda-operator#5760): the secret now reaches the cluster via
|
|
822
895
|
// a cloud secret manager + ESO sync, which is eventually consistent
|
|
823
896
|
// rather than synchronous. Surface the operator's condition instead of
|
|
@@ -883,7 +956,7 @@ export const C4ClusterDetailsSettingsTab = (props) => {
|
|
|
883
956
|
}),
|
|
884
957
|
lowLatencyToggle: {
|
|
885
958
|
enabled: props.cluster.playMode ?? false,
|
|
886
|
-
description: (_jsxs(_Fragment, { children: [safeTranslate(props.t, 'clusterdetails:settings.lowLatency.description', 'When enabled, updates and changes in Modeler
|
|
959
|
+
description: (_jsxs(_Fragment, { children: [safeTranslate(props.t, 'clusterdetails:settings.lowLatency.description', 'When enabled, updates and changes in Modeler Test mode, Operate and Tasklist are applied quicker, which is ideal for testing purposes.'), _jsx("br", {}), _jsx("br", {}), safeTranslate(props.t, 'clusterdetails:settings.lowLatency.warning', 'This setting is not recommended for production environments, as it might reduce individual process instance latency but can slow down general throughput.')] })),
|
|
887
960
|
permissions: {
|
|
888
961
|
mayChange: effectiveCanEdit,
|
|
889
962
|
},
|
|
@@ -953,7 +1026,7 @@ export const C4ClusterDetailsSettingsTab = (props) => {
|
|
|
953
1026
|
mayChange: effectiveCanEdit,
|
|
954
1027
|
},
|
|
955
1028
|
action: {
|
|
956
|
-
label: safeTranslate(props.t, 'clusterdetails:settings.appIntegrations.title', 'Enable
|
|
1029
|
+
label: safeTranslate(props.t, 'clusterdetails:settings.appIntegrations.title', 'Enable app integrations extensions'),
|
|
957
1030
|
onClick: applyWithRestartConfirm(toggleAppIntegrations),
|
|
958
1031
|
disabled: isUpdatingAppIntegrations,
|
|
959
1032
|
},
|
|
@@ -987,6 +1060,22 @@ export const C4ClusterDetailsSettingsTab = (props) => {
|
|
|
987
1060
|
onToggle: handleOptimizeFilteringToggle,
|
|
988
1061
|
onSave: handleOptimizeFilteringSave,
|
|
989
1062
|
},
|
|
1063
|
+
}), ...(shouldShowSessionSettings && {
|
|
1064
|
+
sessionSettings: {
|
|
1065
|
+
title: safeTranslate(props.t, 'clusterdetails:settings.sessionSettings.title', 'Session settings'),
|
|
1066
|
+
// 30 mirrors the operator's own default
|
|
1067
|
+
// (DefaultSessionMaxInactiveIntervalMinutes), applied when the
|
|
1068
|
+
// cluster predates this setting.
|
|
1069
|
+
maxInactiveIntervalMinutes: props.cluster.sessionMaxInactiveIntervalMinutes ?? 30,
|
|
1070
|
+
heartbeatEnabled: props.cluster.sessionHeartbeatEnabled ?? false,
|
|
1071
|
+
permissions: {
|
|
1072
|
+
mayChange: effectiveCanEdit &&
|
|
1073
|
+
!isUpdatingSessionTimeout &&
|
|
1074
|
+
!isUpdatingSessionHeartbeat,
|
|
1075
|
+
},
|
|
1076
|
+
onSaveMaxInactiveInterval: (minutes) => applyWithRestartConfirmAsync(() => updateSessionMaxInactiveIntervalMinutes(minutes)),
|
|
1077
|
+
onToggleHeartbeat: (nextState) => applyWithRestartConfirmAsync(() => updateSessionHeartbeatEnabled(nextState)),
|
|
1078
|
+
},
|
|
990
1079
|
}), dangerZone: {
|
|
991
1080
|
title: safeTranslate(props.t, 'clusterdetails:settings.dangerZone.title', 'Danger zone'),
|
|
992
1081
|
deleteCluster: {
|