@replicated/portal-components 0.0.17 → 0.0.19
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/components/metadata/registry.json +2 -2
- package/components/metadata/registry.md +2 -2
- package/dist/actions/change-team.d.mts +10 -0
- package/dist/actions/change-team.d.ts +10 -0
- package/dist/actions/change-team.js +399 -0
- package/dist/actions/change-team.js.map +1 -0
- package/dist/actions/index.d.mts +2 -1
- package/dist/actions/index.d.ts +2 -1
- package/dist/actions/index.js +1085 -0
- package/dist/actions/index.js.map +1 -1
- package/dist/actions/install-actions.d.mts +2 -0
- package/dist/actions/install-actions.d.ts +2 -0
- package/dist/actions/install-actions.js +627 -0
- package/dist/actions/install-actions.js.map +1 -0
- package/dist/actions/service-account.d.mts +2 -0
- package/dist/actions/service-account.d.ts +2 -0
- package/dist/actions/service-account.js +320 -0
- package/dist/actions/service-account.js.map +1 -0
- package/dist/actions/support-bundles.d.mts +2 -0
- package/dist/actions/support-bundles.d.ts +2 -0
- package/dist/actions/support-bundles.js +606 -0
- package/dist/actions/support-bundles.js.map +1 -0
- package/dist/actions/team-settings.d.mts +2 -0
- package/dist/actions/team-settings.d.ts +2 -0
- package/dist/actions/team-settings.js +976 -0
- package/dist/actions/team-settings.js.map +1 -0
- package/dist/actions/user-settings.d.mts +2 -0
- package/dist/actions/user-settings.d.ts +2 -0
- package/dist/actions/user-settings.js +568 -0
- package/dist/actions/user-settings.js.map +1 -0
- package/dist/airgap-instances.d.mts +2 -1
- package/dist/airgap-instances.d.ts +2 -1
- package/dist/airgap-instances.js +232 -16
- package/dist/airgap-instances.js.map +1 -1
- package/dist/esm/actions/change-team.js +396 -0
- package/dist/esm/actions/change-team.js.map +1 -0
- package/dist/esm/actions/index.js +1054 -1
- package/dist/esm/actions/index.js.map +1 -1
- package/dist/esm/actions/install-actions.js +620 -0
- package/dist/esm/actions/install-actions.js.map +1 -0
- package/dist/esm/actions/service-account.js +318 -0
- package/dist/esm/actions/service-account.js.map +1 -0
- package/dist/esm/actions/support-bundles.js +601 -0
- package/dist/esm/actions/support-bundles.js.map +1 -0
- package/dist/esm/actions/team-settings.js +962 -0
- package/dist/esm/actions/team-settings.js.map +1 -0
- package/dist/esm/actions/user-settings.js +562 -0
- package/dist/esm/actions/user-settings.js.map +1 -0
- package/dist/esm/airgap-instances.js +232 -16
- package/dist/esm/airgap-instances.js.map +1 -1
- package/dist/esm/helm-install-wizard.js +9 -2
- package/dist/esm/helm-install-wizard.js.map +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/install-actions.js.map +1 -1
- package/dist/esm/instance-card.js +232 -16
- package/dist/esm/instance-card.js.map +1 -1
- package/dist/esm/license-details.js.map +1 -1
- package/dist/esm/linux-install-wizard.js +128 -96
- package/dist/esm/linux-install-wizard.js.map +1 -1
- package/dist/esm/online-instance-list.js +232 -16
- package/dist/esm/online-instance-list.js.map +1 -1
- package/dist/esm/pending-installations.js +4 -3
- package/dist/esm/pending-installations.js.map +1 -1
- package/dist/esm/support-bundle-collection-card.js +10 -4
- package/dist/esm/support-bundle-collection-card.js.map +1 -1
- package/dist/esm/support-bundles-card.js +1 -1
- package/dist/esm/support-bundles-card.js.map +1 -1
- package/dist/esm/support-card.js.map +1 -1
- package/dist/esm/top-nav.js.map +1 -1
- package/dist/esm/update-layout.js.map +1 -1
- package/dist/esm/utils/index.js.map +1 -1
- package/dist/helm-install-wizard.d.mts +3 -2
- package/dist/helm-install-wizard.d.ts +3 -2
- package/dist/helm-install-wizard.js +9 -2
- package/dist/helm-install-wizard.js.map +1 -1
- package/dist/{index-DkjaogsF.d.ts → index-BAiVrSSR.d.mts} +148 -1
- package/dist/{index-DkjaogsF.d.mts → index-DWt-N5od.d.ts} +148 -1
- package/dist/index.d.mts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/install-actions.d.mts +3 -2
- package/dist/install-actions.d.ts +3 -2
- package/dist/install-actions.js.map +1 -1
- package/dist/install-card.d.mts +2 -1
- package/dist/install-card.d.ts +2 -1
- package/dist/instance-card.d.mts +2 -1
- package/dist/instance-card.d.ts +2 -1
- package/dist/instance-card.js +232 -16
- package/dist/instance-card.js.map +1 -1
- package/dist/license-card.d.mts +2 -1
- package/dist/license-card.d.ts +2 -1
- package/dist/license-details.js.map +1 -1
- package/dist/linux-install-wizard.d.mts +6 -6
- package/dist/linux-install-wizard.d.ts +6 -6
- package/dist/linux-install-wizard.js +128 -96
- package/dist/linux-install-wizard.js.map +1 -1
- package/dist/online-instance-list.d.mts +2 -1
- package/dist/online-instance-list.d.ts +2 -1
- package/dist/online-instance-list.js +232 -16
- package/dist/online-instance-list.js.map +1 -1
- package/dist/pending-installations.d.mts +6 -3
- package/dist/pending-installations.d.ts +6 -3
- package/dist/pending-installations.js +4 -3
- package/dist/pending-installations.js.map +1 -1
- package/dist/security-card.d.mts +2 -1
- package/dist/security-card.d.ts +2 -1
- package/dist/styles.css +9 -20
- package/dist/support-bundle-collection-card.js +9 -3
- package/dist/support-bundle-collection-card.js.map +1 -1
- package/dist/support-bundles-card.d.mts +2 -1
- package/dist/support-bundles-card.d.ts +2 -1
- package/dist/support-bundles-card.js +1 -1
- package/dist/support-bundles-card.js.map +1 -1
- package/dist/support-card.js.map +1 -1
- package/dist/top-nav.js.map +1 -1
- package/dist/update-layout.js.map +1 -1
- package/dist/utils/index.js.map +1 -1
- package/package.json +32 -1
|
@@ -183,7 +183,6 @@ var LinuxInstallWizard = ({
|
|
|
183
183
|
getInstallOptionsAction,
|
|
184
184
|
updateInstallOptionsAction,
|
|
185
185
|
onStepChange,
|
|
186
|
-
onNetworkChange,
|
|
187
186
|
onInstallOptionsIdChange,
|
|
188
187
|
initialStep,
|
|
189
188
|
initialNetwork,
|
|
@@ -233,20 +232,39 @@ var LinuxInstallWizard = ({
|
|
|
233
232
|
}
|
|
234
233
|
prevInitialStepRef.current = initialStep;
|
|
235
234
|
}, [initialStep]);
|
|
235
|
+
const hasHydratedNetworkRef = useRef(false);
|
|
236
236
|
useEffect(() => {
|
|
237
|
-
if (initialNetwork !== void 0
|
|
237
|
+
if (!hasHydratedNetworkRef.current && initialNetwork !== void 0) {
|
|
238
238
|
setNetworkAvailability(initialNetwork);
|
|
239
|
+
hasHydratedNetworkRef.current = true;
|
|
239
240
|
}
|
|
240
|
-
}, [initialNetwork
|
|
241
|
+
}, [initialNetwork]);
|
|
242
|
+
const hasMountedRef = useRef(false);
|
|
243
|
+
const prevStepRef = useRef(step);
|
|
244
|
+
const prevInstallOptionsIdRef = useRef(installOptionsId);
|
|
241
245
|
useEffect(() => {
|
|
242
|
-
|
|
243
|
-
}, [
|
|
246
|
+
hasMountedRef.current = true;
|
|
247
|
+
}, []);
|
|
244
248
|
useEffect(() => {
|
|
245
|
-
|
|
246
|
-
|
|
249
|
+
if (!hasMountedRef.current) {
|
|
250
|
+
prevStepRef.current = step;
|
|
251
|
+
return;
|
|
252
|
+
}
|
|
253
|
+
if (step !== prevStepRef.current) {
|
|
254
|
+
onStepChange?.(step);
|
|
255
|
+
prevStepRef.current = step;
|
|
256
|
+
}
|
|
257
|
+
}, [step, onStepChange]);
|
|
247
258
|
useEffect(() => {
|
|
248
|
-
|
|
249
|
-
|
|
259
|
+
if (!hasMountedRef.current) {
|
|
260
|
+
prevInstallOptionsIdRef.current = installOptionsId;
|
|
261
|
+
return;
|
|
262
|
+
}
|
|
263
|
+
if (installOptionsId !== prevInstallOptionsIdRef.current) {
|
|
264
|
+
onInstallOptionsIdChange?.(installOptionsId, "linux");
|
|
265
|
+
prevInstallOptionsIdRef.current = installOptionsId;
|
|
266
|
+
}
|
|
267
|
+
}, [installOptionsId, onInstallOptionsIdChange]);
|
|
250
268
|
useEffect(() => {
|
|
251
269
|
selectedReleaseRef.current = selectedRelease;
|
|
252
270
|
}, [selectedRelease]);
|
|
@@ -292,6 +310,9 @@ var LinuxInstallWizard = ({
|
|
|
292
310
|
if (!selectedRelease || !installOptionsId || !updateInstallOptionsAction) {
|
|
293
311
|
return;
|
|
294
312
|
}
|
|
313
|
+
if (!hasResumedInstallation.current) {
|
|
314
|
+
return;
|
|
315
|
+
}
|
|
295
316
|
const channelId = selectedRelease.channelId;
|
|
296
317
|
const sequence = selectedRelease.channelSequence;
|
|
297
318
|
if (lastUpdateRef.current.channelId === channelId && lastUpdateRef.current.sequence === sequence) {
|
|
@@ -341,6 +362,9 @@ var LinuxInstallWizard = ({
|
|
|
341
362
|
});
|
|
342
363
|
return;
|
|
343
364
|
}
|
|
365
|
+
if (!hasResumedInstallation.current) {
|
|
366
|
+
return;
|
|
367
|
+
}
|
|
344
368
|
console.debug("[linux-install-wizard] Proxy URL changed, will regenerate instructions after 500ms", { proxyUrl });
|
|
345
369
|
const timeoutId = setTimeout(async () => {
|
|
346
370
|
const currentRelease = selectedReleaseRef.current;
|
|
@@ -393,6 +417,7 @@ var LinuxInstallWizard = ({
|
|
|
393
417
|
});
|
|
394
418
|
if (result.instance_name) {
|
|
395
419
|
setInstanceName(result.instance_name);
|
|
420
|
+
setOriginalInstanceName(result.instance_name);
|
|
396
421
|
}
|
|
397
422
|
if (result.service_account_id) {
|
|
398
423
|
setServiceAccountId(result.service_account_id);
|
|
@@ -474,6 +499,13 @@ var LinuxInstallWizard = ({
|
|
|
474
499
|
setIsCreatingServiceAccount(true);
|
|
475
500
|
try {
|
|
476
501
|
const trimmedInstanceName = instanceName.trim();
|
|
502
|
+
console.debug("[linux-install-wizard] handleContinue - checking conditions", {
|
|
503
|
+
serviceAccountId: !!serviceAccountId,
|
|
504
|
+
originalInstanceName,
|
|
505
|
+
trimmedInstanceName,
|
|
506
|
+
networkAvailability,
|
|
507
|
+
installOptionsId: !!installOptionsId
|
|
508
|
+
});
|
|
477
509
|
if (serviceAccountId && originalInstanceName === trimmedInstanceName && installOptionsId && updateInstallOptionsAction) {
|
|
478
510
|
console.debug("[linux-install-wizard] Reusing existing service account, updating install options...");
|
|
479
511
|
const firstRelease = embeddedClusterReleases[0];
|
|
@@ -482,6 +514,8 @@ var LinuxInstallWizard = ({
|
|
|
482
514
|
installOptionsId,
|
|
483
515
|
channelId: firstRelease?.channelId,
|
|
484
516
|
channelReleaseSequence: firstRelease?.channelSequence,
|
|
517
|
+
networkAvailability,
|
|
518
|
+
// Pass current network availability
|
|
485
519
|
includeInstructions: true
|
|
486
520
|
});
|
|
487
521
|
if (firstRelease) {
|
|
@@ -494,7 +528,7 @@ var LinuxInstallWizard = ({
|
|
|
494
528
|
if (result.instructions) {
|
|
495
529
|
setInstructions(result.instructions);
|
|
496
530
|
}
|
|
497
|
-
console.debug("[linux-install-wizard] Transitioning to step 2 (
|
|
531
|
+
console.debug("[linux-install-wizard] Transitioning to step 2 (updated install options)");
|
|
498
532
|
setStep(2);
|
|
499
533
|
onStepChange?.(2);
|
|
500
534
|
return;
|
|
@@ -541,11 +575,9 @@ var LinuxInstallWizard = ({
|
|
|
541
575
|
if (installOptionsResult.instructions) {
|
|
542
576
|
setInstructions(installOptionsResult.instructions);
|
|
543
577
|
}
|
|
544
|
-
onInstallOptionsIdChange?.(optionsId, networkAvailability, "linux");
|
|
545
578
|
}
|
|
546
579
|
console.debug("[linux-install-wizard] Transitioning to step 2");
|
|
547
580
|
setStep(2);
|
|
548
|
-
onStepChange?.(2);
|
|
549
581
|
} catch (error) {
|
|
550
582
|
console.error("[linux-install-wizard] Failed to continue", error);
|
|
551
583
|
const errorMessage = error instanceof Error ? error.message : "Failed to continue";
|
|
@@ -813,90 +845,6 @@ async function handleServerError(statusCode) {
|
|
|
813
845
|
return redirect(`/error?${params.toString()}`);
|
|
814
846
|
}
|
|
815
847
|
|
|
816
|
-
// src/actions/index.ts
|
|
817
|
-
var getApiOrigin = () => {
|
|
818
|
-
return (process.env.REPLICATED_APP_ORIGIN || "https://replicated.app").replace(/\/+$/, "");
|
|
819
|
-
};
|
|
820
|
-
var defineServerAction = (definition) => definition;
|
|
821
|
-
var createServiceAccount = defineServerAction({
|
|
822
|
-
id: "service-account/create",
|
|
823
|
-
description: "Creates a service account for installing applications",
|
|
824
|
-
visibility: "customer",
|
|
825
|
-
tags: ["service-account", "install"],
|
|
826
|
-
async run({ token, name }) {
|
|
827
|
-
if (!token || typeof token !== "string") {
|
|
828
|
-
throw new Error("Service account creation requires a session token");
|
|
829
|
-
}
|
|
830
|
-
if (!name || typeof name !== "string" || !name.trim()) {
|
|
831
|
-
throw new Error("Service account name is required");
|
|
832
|
-
}
|
|
833
|
-
const endpoint = `${getApiOrigin()}/enterprise-portal/team/service-accounts`;
|
|
834
|
-
if (process.env.NODE_ENV !== "production") {
|
|
835
|
-
console.debug(
|
|
836
|
-
"[portal-components] creating service account via %s (Enterprise Portal API)",
|
|
837
|
-
endpoint
|
|
838
|
-
);
|
|
839
|
-
}
|
|
840
|
-
const response = await authenticatedFetch(endpoint, {
|
|
841
|
-
method: "POST",
|
|
842
|
-
token,
|
|
843
|
-
headers: {
|
|
844
|
-
"content-type": "application/json"
|
|
845
|
-
},
|
|
846
|
-
body: JSON.stringify({ account_name: name.trim() })
|
|
847
|
-
});
|
|
848
|
-
if (!response.ok) {
|
|
849
|
-
const errorText = await response.text();
|
|
850
|
-
throw new Error(
|
|
851
|
-
`Service account creation failed (${response.status} ${response.statusText}): ${errorText}`
|
|
852
|
-
);
|
|
853
|
-
}
|
|
854
|
-
const data = await response.json();
|
|
855
|
-
return data;
|
|
856
|
-
}
|
|
857
|
-
});
|
|
858
|
-
var fetchCustomBrandingImpl = async () => {
|
|
859
|
-
const appSlug = process.env.PORTAL_APP_SLUG;
|
|
860
|
-
if (!appSlug) {
|
|
861
|
-
throw new Error("PORTAL_APP_SLUG is not configured");
|
|
862
|
-
}
|
|
863
|
-
const url = `${getApiOrigin()}/enterprise-portal/public/branding?app_slug=${encodeURIComponent(
|
|
864
|
-
appSlug
|
|
865
|
-
)}`;
|
|
866
|
-
if (process.env.NODE_ENV !== "production") {
|
|
867
|
-
console.debug(
|
|
868
|
-
"[portal-components] fetching custom branding via %s (Enterprise Portal API)",
|
|
869
|
-
url
|
|
870
|
-
);
|
|
871
|
-
}
|
|
872
|
-
const response = await fetch(url, {
|
|
873
|
-
headers: {
|
|
874
|
-
accept: "application/json"
|
|
875
|
-
}
|
|
876
|
-
});
|
|
877
|
-
if (!response.ok) {
|
|
878
|
-
throw new Error(
|
|
879
|
-
`Custom branding request failed (${response.status} ${response.statusText})`
|
|
880
|
-
);
|
|
881
|
-
}
|
|
882
|
-
const payload = await response.json();
|
|
883
|
-
const brandingObject = {
|
|
884
|
-
logo: payload.logoUrl,
|
|
885
|
-
title: payload.appName,
|
|
886
|
-
customColor1: payload.primaryColor,
|
|
887
|
-
customColor2: payload.secondaryColor,
|
|
888
|
-
favicon: payload.faviconUrl,
|
|
889
|
-
supportPortalLink: payload.supportPortalLink || ""
|
|
890
|
-
};
|
|
891
|
-
const brandingData = Buffer.from(JSON.stringify(brandingObject)).toString("base64");
|
|
892
|
-
return {
|
|
893
|
-
brandingData,
|
|
894
|
-
documentation: null
|
|
895
|
-
// Documentation not included in new API's public endpoint
|
|
896
|
-
};
|
|
897
|
-
};
|
|
898
|
-
cache(fetchCustomBrandingImpl);
|
|
899
|
-
|
|
900
848
|
// src/actions/install.ts
|
|
901
849
|
async function fetchChannelReleases(input, context) {
|
|
902
850
|
const { token, channelId } = input;
|
|
@@ -1133,6 +1081,90 @@ function filterEmbeddedClusterReleases(releases) {
|
|
|
1133
1081
|
);
|
|
1134
1082
|
}
|
|
1135
1083
|
|
|
1084
|
+
// src/actions/index.ts
|
|
1085
|
+
var getApiOrigin = () => {
|
|
1086
|
+
return (process.env.REPLICATED_APP_ORIGIN || "https://replicated.app").replace(/\/+$/, "");
|
|
1087
|
+
};
|
|
1088
|
+
var defineServerAction = (definition) => definition;
|
|
1089
|
+
var createServiceAccount = defineServerAction({
|
|
1090
|
+
id: "service-account/create",
|
|
1091
|
+
description: "Creates a service account for installing applications",
|
|
1092
|
+
visibility: "customer",
|
|
1093
|
+
tags: ["service-account", "install"],
|
|
1094
|
+
async run({ token, name }) {
|
|
1095
|
+
if (!token || typeof token !== "string") {
|
|
1096
|
+
throw new Error("Service account creation requires a session token");
|
|
1097
|
+
}
|
|
1098
|
+
if (!name || typeof name !== "string" || !name.trim()) {
|
|
1099
|
+
throw new Error("Service account name is required");
|
|
1100
|
+
}
|
|
1101
|
+
const endpoint = `${getApiOrigin()}/enterprise-portal/team/service-accounts`;
|
|
1102
|
+
if (process.env.NODE_ENV !== "production") {
|
|
1103
|
+
console.debug(
|
|
1104
|
+
"[portal-components] creating service account via %s (Enterprise Portal API)",
|
|
1105
|
+
endpoint
|
|
1106
|
+
);
|
|
1107
|
+
}
|
|
1108
|
+
const response = await authenticatedFetch(endpoint, {
|
|
1109
|
+
method: "POST",
|
|
1110
|
+
token,
|
|
1111
|
+
headers: {
|
|
1112
|
+
"content-type": "application/json"
|
|
1113
|
+
},
|
|
1114
|
+
body: JSON.stringify({ account_name: name.trim() })
|
|
1115
|
+
});
|
|
1116
|
+
if (!response.ok) {
|
|
1117
|
+
const errorText = await response.text();
|
|
1118
|
+
throw new Error(
|
|
1119
|
+
`Service account creation failed (${response.status} ${response.statusText}): ${errorText}`
|
|
1120
|
+
);
|
|
1121
|
+
}
|
|
1122
|
+
const data = await response.json();
|
|
1123
|
+
return data;
|
|
1124
|
+
}
|
|
1125
|
+
});
|
|
1126
|
+
var fetchCustomBrandingImpl = async () => {
|
|
1127
|
+
const appSlug = process.env.PORTAL_APP_SLUG;
|
|
1128
|
+
if (!appSlug) {
|
|
1129
|
+
throw new Error("PORTAL_APP_SLUG is not configured");
|
|
1130
|
+
}
|
|
1131
|
+
const url = `${getApiOrigin()}/enterprise-portal/public/branding?app_slug=${encodeURIComponent(
|
|
1132
|
+
appSlug
|
|
1133
|
+
)}`;
|
|
1134
|
+
if (process.env.NODE_ENV !== "production") {
|
|
1135
|
+
console.debug(
|
|
1136
|
+
"[portal-components] fetching custom branding via %s (Enterprise Portal API)",
|
|
1137
|
+
url
|
|
1138
|
+
);
|
|
1139
|
+
}
|
|
1140
|
+
const response = await fetch(url, {
|
|
1141
|
+
headers: {
|
|
1142
|
+
accept: "application/json"
|
|
1143
|
+
}
|
|
1144
|
+
});
|
|
1145
|
+
if (!response.ok) {
|
|
1146
|
+
throw new Error(
|
|
1147
|
+
`Custom branding request failed (${response.status} ${response.statusText})`
|
|
1148
|
+
);
|
|
1149
|
+
}
|
|
1150
|
+
const payload = await response.json();
|
|
1151
|
+
const brandingObject = {
|
|
1152
|
+
logo: payload.logoUrl,
|
|
1153
|
+
title: payload.appName,
|
|
1154
|
+
customColor1: payload.primaryColor,
|
|
1155
|
+
customColor2: payload.secondaryColor,
|
|
1156
|
+
favicon: payload.faviconUrl,
|
|
1157
|
+
supportPortalLink: payload.supportPortalLink || ""
|
|
1158
|
+
};
|
|
1159
|
+
const brandingData = Buffer.from(JSON.stringify(brandingObject)).toString("base64");
|
|
1160
|
+
return {
|
|
1161
|
+
brandingData,
|
|
1162
|
+
documentation: null
|
|
1163
|
+
// Documentation not included in new API's public endpoint
|
|
1164
|
+
};
|
|
1165
|
+
};
|
|
1166
|
+
cache(fetchCustomBrandingImpl);
|
|
1167
|
+
|
|
1136
1168
|
export { LINUX_INSTALL_OPTIONS_KEY, LINUX_INSTALL_SERVICE_ACCOUNT_KEY, LinuxInstallWizard, createInstallOptions, createServiceAccount, fetchChannelReleases, filterEmbeddedClusterReleases, getInstallOptions, updateInstallOptions };
|
|
1137
1169
|
//# sourceMappingURL=linux-install-wizard.js.map
|
|
1138
1170
|
//# sourceMappingURL=linux-install-wizard.js.map
|