) => {
+ let nodeType = e.currentTarget.value;
let types = selectedNodeTypes;
- if (nodeType === "webserver") {
- types = types.filter((type) => type !== "db" && type !== "search");
- }
-
if (selectedNodeTypes.includes(nodeType)) {
setSelectedNodeTypes(types.filter((type) => type !== nodeType));
} else {
@@ -344,9 +361,12 @@ const HelmVMClusterManagement = ({ fromLicenseFlow = false }) => {
}
};
+ const { data } = useApps();
+
const handleContinue = () => {
- if (data.isConfigurable) {
- navigate(`/${data.slug}/config`, { replace: true });
+ const app = data?.apps?.find((a) => a.name === appName);
+ if (app?.isConfigurable) {
+ navigate(`/${app.slug}/config`, { replace: true });
return;
}
};
@@ -382,15 +402,17 @@ const HelmVMClusterManagement = ({ fromLicenseFlow = false }) => {
)}
- {(nodes?.nodes || testData?.nodes) &&
- (nodes?.nodes || testData?.nodes).map((node, i) => (
+ {(nodesData?.nodes || testData?.nodes) &&
+ (nodesData?.nodes || testData?.nodes).map((node, i) => (
))}
@@ -436,10 +458,7 @@ const HelmVMClusterManagement = ({ fromLicenseFlow = false }) => {
key={nodeType}
className={classNames("BoxedCheckbox", {
"is-active": selectedNodeTypes.includes(nodeType),
- "is-disabled": determineDisabledState(
- nodeType,
- selectedNodeTypes
- ),
+ "is-disabled": determineDisabledState(nodeType),
})}
>
{
type="checkbox"
name={`${nodeType}NodeType`}
value={nodeType}
- disabled={determineDisabledState(nodeType, selectedNodeTypes)}
+ disabled={determineDisabledState(nodeType)}
checked={selectedNodeTypes.includes(nodeType)}
onChange={handleSelectNodeType}
/>
@@ -456,22 +475,25 @@ const HelmVMClusterManagement = ({ fromLicenseFlow = false }) => {
htmlFor={`${nodeType}NodeType`}
className="tw-block u-cursor--pointer u-userSelect--none u-textColor--primary u-fontSize--normal u-fontWeight--medium tw-text-center"
>
- {nodeType}
+ {nodeType === "controller" ? "controlplane" : nodeType}
))}
-
Copied!}
- >
- {`curl ${generatePrimaryAddNodeCommand}?token=abc&labels=${selectedNodeTypes.join(
- ","
- )}`}
-
+ {generateAddNodeCommandLoading &&
Generating command...
}
+ {!generateAddNodeCommandLoading && generateAddNodeCommand?.command && (
+
Copied!
+ }
+ >
+ {generateAddNodeCommand?.command || ""}
+
+ )}
{
if (drainNode && Utilities.sessionRolesHasOneOf(rbacRoles.DRAIN_NODE)) {
if (
@@ -60,17 +62,25 @@ export default function HelmVMNodeRow({
}
}
};
+ console.log("slug", slug);
return (
-
- {node?.name}
-
+ {slug && (
+
+ {node?.name}
+
+ )}
+ {!slug && (
+
+ {node?.name}
+
+ )}
{node?.isPrimaryNode && (
Primary node
diff --git a/web/src/components/apps/HelmVMViewNode.jsx b/web/src/components/apps/HelmVMViewNode.jsx
index c3337352d0..a72f13648f 100644
--- a/web/src/components/apps/HelmVMViewNode.jsx
+++ b/web/src/components/apps/HelmVMViewNode.jsx
@@ -270,7 +270,7 @@ const testData = {
};
const HelmVMViewNode = () => {
- const { nodeName } = useParams();
+ const { slug, nodeName } = useParams();
const { data: nodeData } = useQuery({
queryKey: ["helmVmNode", nodeName],
queryFn: async ({ queryKey }) => {
@@ -366,7 +366,7 @@ const HelmVMViewNode = () => {
{/* Breadcrumbs */}
Cluster Nodes