Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 27 additions & 27 deletions Terraform/vm properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,45 +9,45 @@ Legacy UI is only documented in it's current state and is no longer being develo
| name: string | x | x | x | x |
| host: string | x | x | x | x |
| state: enum | x | x | x | x |
| clustered: bool | x | x | x | (fix) |
| cluster_name: string | x | x | x | |
| clustered: bool | x | x | x | x |
| cluster_name: string | x | x | x | x |
| id: Hyper-V ID | x | x | x | - |
| cpu_cores: integer | x | x | x | x |
| startup_memory_gb: double | x | x | x | |
| startup_memory_gb: double | x | x | x | x |
| Current_memory_gb: double | x | x | x | x |
| dynamic_memory_memory_gb_min: double | x | x | x | x |
| dynamic_memory_memory_gb_max: double | x | x | x | x |
| dynamic_memory_memory_prcnt_buffer: integer | x | x | x | |
| secure_boot_enabled: bool | x | x | x | |
| secure_boot_template: string | x | x | x | |
| trusted_platform_module_enabled: bool | x | x | x | |
| key_protector_kind: string | x | x | x | |
| primary_boot_device: string | x | x | x | |
| dynamic_memory_memory_prcnt_buffer: integer | x | x | x | x |
| secure_boot_enabled: bool | x | x | x | x |
| secure_boot_template: string | x | x | x | x |
| trusted_platform_module_enabled: bool | x | x | x | x |
| key_protector_kind: string | x | x | x | x |
| primary_boot_device: string | x | x | x | x |
| disk: object (0+ instances) | x | x | x | x |
| id: GUID - state only | x | x | x | - |
| size_gb: double | x | x | x | x |
| storage_class: related to host resources/path | x | x | x | |
| storage_class: related to host resources/path | x | x | x | x |
| path: string | x | x | x | x |
| network_if: object (0+ instances) | x | x | x | x |
| id: GUID - state only | x | x | x | - |
| adapter_name: string | x | x | x | x |
| network: string | x | x | x | x |
| virtual_switch: string | x | x | x | |
| vlan_id: integer | x | x | x | |
| mac_address: string | x | x | x | |
| virtual_switch: string | x | x | x | x |
| vlan_id: integer | x | x | x | x |
| mac_address: string | x | x | x | x |
| ip_addresses: string[] | x | x | x | x |
| dhcp_guard: bool | x | x | x | |
| router_guard: bool | x | x | x | |
| mac_spoof_guard: bool | x | x | x | |
| mac_address_config: "Dynamic" or "Static" | x | x | x | |
| min_bandwidth_mbps: integer | x | x | x | |
| max_bandwidth_mbps: integer | x | x | x | |
| dhcp_guard: bool | x | x | x | x |
| router_guard: bool | x | x | x | x |
| mac_spoof_guard: bool | x | x | x | x |
| mac_address_config: "Dynamic" or "Static" | x | x | x | x |
| min_bandwidth_mbps: integer | x | x | x | x |
| max_bandwidth_mbps: integer | x | x | x | x |
| operating_system: string | x | x | x | x |
| host_recovery_action: enum | x | x | x | |
| host_stop_action: enum | x | x | x | |
| integration_svcs_shutdown: bool | x | x | x | |
| integration_svcs_time: bool | x | x | x | |
| integration_svcs_data_exchange: bool | x | x | x | |
| integration_svcs_heartbeat: bool | x | x | x | |
| integration_svcs_vss_backup: bool | x | x | x | |
| integration_svcs_guest_services: bool | x | x | x | |
| host_recovery_action: enum | x | x | x | x |
| host_stop_action: enum | x | x | x | x |
| integration_svcs_shutdown: bool | x | x | x | x |
| integration_svcs_time: bool | x | x | x | x |
| integration_svcs_data_exchange: bool | x | x | x | x |
| integration_svcs_heartbeat: bool | x | x | x | x |
| integration_svcs_vss_backup: bool | x | x | x | x |
| integration_svcs_guest_services: bool | x | x | x | x |
22 changes: 22 additions & 0 deletions next-ui/src/lib/stores/inventoryStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export interface VM {
memory_min_gb?: number; // For dynamic memory
memory_max_gb?: number; // For dynamic memory
dynamic_memory_enabled?: boolean;
dynamic_memory_buffer?: number;
ip_addresses?: string[];
ip_address?: string; // Fallback for single IP
notes?: string | string[];
Expand All @@ -39,6 +40,19 @@ export interface VM {
generation?: number | string;
version?: string;
created_at?: string;
secure_boot_enabled?: boolean;
secure_boot_template?: string;
trusted_platform_module_enabled?: boolean;
key_protector_kind?: string;
primary_boot_device?: string;
host_recovery_action?: string;
host_stop_action?: string;
integration_services_shutdown?: boolean;
integration_services_time?: boolean;
integration_services_data_exchange?: boolean;
integration_services_heartbeat?: boolean;
integration_services_vss_backup?: boolean;
integration_services_guest_services?: boolean;
disks?: Array<{
id?: string;
name?: string;
Expand All @@ -47,6 +61,7 @@ export interface VM {
size_gb?: number;
size?: string;
path?: string;
storage_class?: string;
}>;
networks?: Array<{
id?: string;
Expand All @@ -55,6 +70,13 @@ export interface VM {
network?: string;
virtual_switch?: string;
vlan_id?: number;
mac_address?: string;
mac_address_config?: string;
dhcp_guard?: boolean;
router_guard?: boolean;
mac_spoof_guard?: boolean;
min_bandwidth_mbps?: number;
max_bandwidth_mbps?: number;
}>;
}

Expand Down
105 changes: 71 additions & 34 deletions next-ui/src/lib/utils/vm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,13 +185,44 @@ export function extractIpAddresses(vm: VM): string {
* Extract IP addresses from network adapter
*/
export function extractAdapterAddresses(adapter: any): string {
if (!adapter) {
return '—';
}
if (Array.isArray(adapter.ip_addresses) && adapter.ip_addresses.length > 0) {
return adapter.ip_addresses.join(', ');
}
return '—';
if (!adapter) {
return '—';
}
if (Array.isArray(adapter.ip_addresses) && adapter.ip_addresses.length > 0) {
return adapter.ip_addresses.join(', ');
}
return '—';
}

/**
* Format boolean settings with enterprise-friendly labels
*/
export function formatBooleanSetting(value: boolean | undefined | null, fallback = '—'): string {
if (typeof value === 'undefined' || value === null) {
return fallback;
}
return value ? 'Enabled' : 'Disabled';
}

/**
* Format bandwidth range if present
*/
export function formatBandwidthRange(min?: number | null, max?: number | null): string {
const parts: string[] = [];

if (typeof min !== 'undefined' && min !== null) {
parts.push(`Min ${min} Mbps`);
}

if (typeof max !== 'undefined' && max !== null) {
parts.push(`Max ${max} Mbps`);
}

if (parts.length === 0) {
return '—';
}

return parts.join(' · ');
}

/**
Expand Down Expand Up @@ -390,31 +421,37 @@ export function buildMemoryHardwareItems(vm: VM): Array<{ label: string; value:
const resolvedMemory = resolveVmMemoryValue(vm);
const isDynamic = vm.dynamic_memory_enabled === true;

items.push({
label: 'Memory',
value: formatMemory(resolvedMemory, isDynamic)
});

if (isDynamic) {
if (typeof vm.memory_startup_gb !== 'undefined') {
items.push({
label: 'Startup Memory',
value: formatMemoryAmount(vm.memory_startup_gb)
});
}
if (typeof vm.memory_min_gb !== 'undefined') {
items.push({
label: 'Minimum Memory',
value: formatMemoryAmount(vm.memory_min_gb)
});
}
if (typeof vm.memory_max_gb !== 'undefined') {
items.push({
label: 'Maximum Memory',
value: formatMemoryAmount(vm.memory_max_gb)
});
}
}

return items;
items.push({
label: 'Memory',
value: formatMemory(resolvedMemory, isDynamic)
});

if (isDynamic) {
if (typeof vm.memory_startup_gb !== 'undefined') {
items.push({
label: 'Startup Memory',
value: formatMemoryAmount(vm.memory_startup_gb)
});
}
if (typeof vm.memory_min_gb !== 'undefined') {
items.push({
label: 'Minimum Memory',
value: formatMemoryAmount(vm.memory_min_gb)
});
}
if (typeof vm.memory_max_gb !== 'undefined') {
items.push({
label: 'Maximum Memory',
value: formatMemoryAmount(vm.memory_max_gb)
});
}
if (typeof vm.dynamic_memory_buffer !== 'undefined') {
items.push({
label: 'Dynamic Memory Buffer',
value: `${vm.dynamic_memory_buffer}%`
});
}
}

return items;
}
Loading