more beautiful
This commit is contained in:
parent
2712b803ce
commit
390ea78993
1 changed files with 9 additions and 6 deletions
15
shcloud.py
15
shcloud.py
|
@ -73,12 +73,15 @@ def select_servertype():
|
|||
table.add_column("Cores", justify="left", style="red", no_wrap=True)
|
||||
table.add_column("Memory", justify="left", style="red", no_wrap=True)
|
||||
table.add_column("Disk", justify="left", style="blue", no_wrap=True)
|
||||
table.add_column("Storage Type", justify="center", style="blue", no_wrap=True)
|
||||
table.add_column("CPU Type", justify="center", style="cyan2", no_wrap=True)
|
||||
table.add_column("Deprecated", justify="center", style="grey46", no_wrap=True)
|
||||
#table.add_column("Storage Type", justify="center", style="blue", no_wrap=True)
|
||||
#table.add_column("CPU Type", justify="center", style="cyan2", no_wrap=True)
|
||||
#table.add_column("Deprecated", justify="center", style="grey46", no_wrap=True)
|
||||
table.add_column("Hourly", justify="left", style="cyan2", no_wrap=True)
|
||||
table.add_column("Monthly", justify="left", style="cyan2", no_wrap=True)
|
||||
|
||||
for m in models:
|
||||
table.add_row(str(m.id), str(m.name), str(m.description), str(m.cores), str(int(m.memory)) + " GB", str(m.disk) + " GB", str(m.storage_type), str(m.cpu_type), str(m.deprecated))
|
||||
if str(m.cpu_type) == "shared":
|
||||
table.add_row(str(m.id), str(m.name), str(m.description), str(m.cores), str(int(m.memory)) + " GB", str(m.disk) + " GB", format(float(m.prices[0]["price_hourly"]["gross"]), '.2f') + " €", format(float(m.prices[0]["price_monthly"]["gross"]), '.2f') + " €")
|
||||
console.print(table)
|
||||
return(Prompt.ask("Selection: ", default="cpx31"))
|
||||
|
||||
|
@ -111,10 +114,10 @@ if sys.argv[1] == "delete":
|
|||
s = client.servers.get_by_name(server_name)
|
||||
progress.update(task_search, completed=1, total=1)
|
||||
if s == None:
|
||||
console.print("[red]Server not found")
|
||||
console.print("[red]:heavy_multiplication_x: Server not found")
|
||||
exit(0)
|
||||
else:
|
||||
console.print("[green]Server found")
|
||||
console.print("[green]:heavy_check_mark: Server found")
|
||||
delete_server(s)
|
||||
exit(0)
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue