feat: show resources from template
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@ -68,9 +68,6 @@ export interface VmInstance {
|
|||||||
ssh_key_id: number;
|
ssh_key_id: number;
|
||||||
created: string;
|
created: string;
|
||||||
expires: string;
|
expires: string;
|
||||||
cpu: number;
|
|
||||||
memory: number;
|
|
||||||
disk_size: number;
|
|
||||||
disk_id: number;
|
disk_id: number;
|
||||||
status?: VmStatus;
|
status?: VmStatus;
|
||||||
mac_address: string;
|
mac_address: string;
|
||||||
|
@ -6,11 +6,12 @@ export default function VpsResources({ vm }: { vm: VmInstance | VmTemplate }) {
|
|||||||
const region =
|
const region =
|
||||||
"region_id" in vm ? vm.region?.name : vm.template?.region?.name;
|
"region_id" in vm ? vm.region?.name : vm.template?.region?.name;
|
||||||
const status = "status" in vm ? vm.status : undefined;
|
const status = "status" in vm ? vm.status : undefined;
|
||||||
|
const template = "template" in vm ? vm.template : vm as VmTemplate;
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className="text-xs text-neutral-400">
|
<div className="text-xs text-neutral-400">
|
||||||
{vm.cpu} vCPU, <BytesSize value={vm.memory} /> RAM,{" "}
|
{template?.cpu} vCPU, <BytesSize value={template?.memory ?? 0} /> RAM,{" "}
|
||||||
<BytesSize value={vm.disk_size} /> {diskType?.toUpperCase()},{" "}
|
<BytesSize value={template?.disk_size ?? 0} /> {diskType?.toUpperCase()},{" "}
|
||||||
{region && <>Location: {region}</>}
|
{region && <>Location: {region}</>}
|
||||||
</div>
|
</div>
|
||||||
{status && status.state === "running" && (
|
{status && status.state === "running" && (
|
||||||
|
Reference in New Issue
Block a user