mirror of
https://github.com/ubicloud/ubicloud.git
synced 2025-10-04 13:52:06 +08:00
Currently, this uses 3 tabs, overview, networking, and settings. This change exposed that the firewall rule display and restart action were undertested, so this adds appropriate tests.
36 lines
1.2 KiB
Text
36 lines
1.2 KiB
Text
<% if @vm.display_state != "running" %>
|
|
<div class="auto-refresh hidden" data-interval="10"></div>
|
|
<% end %>
|
|
|
|
<% data = [
|
|
["ID", @vm.ubid],
|
|
["Name", @vm.name],
|
|
["Location", @vm.display_location],
|
|
["Size", @vm.display_size],
|
|
["Storage", (@vm.storage_size_gib > 0) ? "#{@vm.storage_size_gib} GB" : nil]
|
|
]
|
|
if (gpu = @vm.display_gpu)
|
|
data << ["GPU", gpu]
|
|
end
|
|
subnet = @vm.nics.first.private_subnet
|
|
data += [
|
|
["IPv4", @vm.ip4_enabled ? @vm.ephemeral_net4 : "Not enabled", { copyable: @vm.ip4_enabled }],
|
|
["IPv6", @vm.ip6, { copyable: true }],
|
|
[
|
|
"SSH Command",
|
|
"<span class='bg-slate-100 text-rose-500 font-mono px-2 py-1 rounded'>#{h("ssh -i <PRIVATE_KEY_PATH> #{@vm.unix_user}@#{@vm.ephemeral_net4 || @vm.ip6}")}</span>",
|
|
{ escape: false }
|
|
],
|
|
["Private IPv4", @vm.private_ipv4, { copyable: true }],
|
|
["Private IPv6", @vm.private_ipv6, { copyable: true }],
|
|
[
|
|
"Private subnet",
|
|
"<a href='#{path(subnet)}' class='text-rose-500 hover:underline'>#{subnet.name}</a>",
|
|
{ escape: false }
|
|
]
|
|
] %>
|
|
|
|
<%== part(
|
|
"components/kv_data_card",
|
|
data:
|
|
) %>
|