This commit is contained in:
Aleksandr Tcitlionok
2024-12-06 08:14:17 +00:00
parent 0e82320710
commit 5d7ec5c363

View File

@@ -114,12 +114,9 @@ def display_virtual_machines():
table.add_column("Memory (GB)", justify="right", style="cyan") table.add_column("Memory (GB)", justify="right", style="cyan")
table.add_column("Storage", style="magenta") table.add_column("Storage", style="magenta")
table.add_column("Type", style="green") table.add_column("Type", style="green")
table.add_column("Time on Duty", justify="right", style="magenta")
vms = fetch_all("virtual_machines") vms = fetch_all("virtual_machines")
for vm in vms: for vm in vms:
# Convert time_on_duty to a human-readable format
time_on_duty = calculate_time_on_duty_hours(vm[7]) # Ensure index 7 corresponds to time_on_duty
table.add_row( table.add_row(
f"{vm[0]}", f"{vm[0]}",
vm[1], vm[1],
@@ -127,12 +124,12 @@ def display_virtual_machines():
f"{vm[3]}", f"{vm[3]}",
vm[4], vm[4],
vm[5], vm[5],
vm[6], vm[6]
time_on_duty
) )
console.print(table) console.print(table)
def display_kubernetes_nodes(): def display_kubernetes_nodes():
config.load_incluster_config() config.load_incluster_config()
v1 = client.CoreV1Api() v1 = client.CoreV1Api()