feat: show resources from template
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2025-02-17 15:55:49 +00:00
parent 9f364d2854
commit 9c84a927d3
2 changed files with 3 additions and 5 deletions

View File

@ -68,9 +68,6 @@ export interface VmInstance {
ssh_key_id: number;
created: string;
expires: string;
cpu: number;
memory: number;
disk_size: number;
disk_id: number;
status?: VmStatus;
mac_address: string;

View File

@ -6,11 +6,12 @@ export default function VpsResources({ vm }: { vm: VmInstance | VmTemplate }) {
const region =
"region_id" in vm ? vm.region?.name : vm.template?.region?.name;
const status = "status" in vm ? vm.status : undefined;
const template = "template" in vm ? vm.template : vm as VmTemplate;
return (
<>
<div className="text-xs text-neutral-400">
{vm.cpu} vCPU, <BytesSize value={vm.memory} /> RAM,{" "}
<BytesSize value={vm.disk_size} /> {diskType?.toUpperCase()},{" "}
{template?.cpu} vCPU, <BytesSize value={template?.memory ?? 0} /> RAM,{" "}
<BytesSize value={template?.disk_size ?? 0} /> {diskType?.toUpperCase()},{" "}
{region && <>Location: {region}</>}
</div>
{status && status.state === "running" && (