Skip to content

Commit

Permalink
update variable names, fix redirect to cluster manage
Browse files Browse the repository at this point in the history
  • Loading branch information
alicenstar committed Oct 19, 2023
1 parent 2cfa91d commit 9fc6084
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 17 deletions.
8 changes: 4 additions & 4 deletions web/src/components/UploadLicenseFile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -261,13 +261,13 @@ const UploadLicenseFile = (props: Props) => {
return;
}

if (data.isConfigurable) {
navigate(`/${data.slug}/config`, { replace: true });
if (props.isHelmVM) {
navigate(`/${data.slug}/cluster/manage`, { replace: true });
return;
}

if (props.isHelmVM) {
navigate(`/${data.slug}/cluster/manage`, { replace: true });
if (data.isConfigurable) {
navigate(`/${data.slug}/config`, { replace: true });
return;
}

Expand Down
16 changes: 7 additions & 9 deletions web/src/components/apps/HelmVMClusterManagement.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,15 @@ const HelmVMClusterManagement = ({
kubeletVersion: string;
cpu: {
capacity: number;
available: number;
used: number;
};
memory: {
capacity: number;
available: number;
used: number;
};
pods: {
capacity: number;
available: number;
used: number;
};
labels: string[];
conditions: {
Expand Down Expand Up @@ -273,13 +273,11 @@ const HelmVMClusterManagement = ({
</div>
),
status: n.isReady ? "Ready" : "Not Ready",
cpu: `${(n.cpu.capacity - n.cpu.available).toFixed(
cpu: `${n.cpu.used.toFixed(2)} / ${n.cpu.capacity.toFixed(2)}`,
memory: `${n.memory.used.toFixed(2)}GB / ${n.memory.capacity.toFixed(
2
)} / ${n.cpu.capacity.toFixed(2)}`,
memory: `${(n.memory.capacity - n.memory.available).toFixed(
2
)}GB / ${n.memory.capacity.toFixed(2)}GB`,
pods: `${n.pods.capacity - n.pods.available} / ${n.pods.capacity}`,
)}GB`,
pods: `${n.pods.used} / ${n.pods.capacity}`,
pause: (
<>
<button className="btn secondary">Pause</button>
Expand Down
8 changes: 4 additions & 4 deletions web/src/components/apps/HelmVMViewNode.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,10 @@ const HelmVMViewNode = () => {

const mappedPods = useMemo(() => {
return node?.podList?.map((p) => ({
name: p.metadata.name,
status: p.status.phase,
cpu: null,
memory: null,
name: p.name,
status: p.status,
cpu: p.cpu,
memory: `${p.memory}GB`,
delete: (
<>
<button className="btn red primary">Delete</button>
Expand Down

0 comments on commit 9fc6084

Please sign in to comment.