From dc18e867f5ebb269f99d80f70a248a55f4b6238f Mon Sep 17 00:00:00 2001 From: Your Name Date: Fri, 10 Oct 2025 19:39:50 -0400 Subject: [PATCH 1/2] [QoL] Add resource allocation warnings and enhanced system detection - Add percentage-based warnings for RAM (>40%) and CPU (>50%) allocation - Replace x-input components with native HTML5 number inputs - Add yellow warning messages below resource inputs when thresholds exceeded - Change card layout from flex-row to flex-col to accommodate inline warnings - Uses existing getMemoryInfo() for accurate RAM detection from /proc/meminfo This provides proactive user guidance to prevent over-allocation that could impact host system performance. --- src/renderer/views/Config.vue | 113 +++++++++++++++++++++------------- 1 file changed, 71 insertions(+), 42 deletions(-) diff --git a/src/renderer/views/Config.vue b/src/renderer/views/Config.vue index a98a3c4..89d3d99 100644 --- a/src/renderer/views/Config.vue +++ b/src/renderer/views/Config.vue @@ -5,56 +5,68 @@
-
-
- -

- RAM Allocation -

+ class="flex flex-col p-2 py-3 my-0 w-full backdrop-blur-xl backdrop-brightness-150 bg-neutral-800/20"> +
+
+
+ +

+ RAM Allocation +

+
+

+ How many gigabytes of RAM are allocated to the Windows virtual machine +

+
+
+ +

GB

-

- How many gigabytes of RAM are allocated to the Windows virtual machine -

-
-
- -

GB

+

+ {{ ramWarning }} +

-
-
- -

- CPU Cores -

+ class="flex flex-col p-2 py-3 my-0 w-full backdrop-blur-xl backdrop-brightness-150 bg-neutral-800/20"> +
+
+
+ +

+ CPU Cores +

+
+

+ How many CPU Cores are allocated to the Windows virtual machine +

+
+
+ +

Cores

-

- How many CPU Cores are allocated to the Windows virtual machine -

-
-
- -

Cores

+

+ {{ cpuWarning }} +

@@ -538,6 +550,23 @@ function updateApplicationScale(value: string | number) { origApplicationScale.value = clamped; } +// Computed properties for resource warnings +const ramWarning = computed(() => { + const percentage = (ramGB.value / maxRamGB.value) * 100; + if (percentage > 40) { + return `⚠️ Using ${percentage.toFixed(0)}% of total RAM - high allocation may impact host performance`; + } + return null; +}); + +const cpuWarning = computed(() => { + const percentage = (numCores.value / maxNumCores.value) * 100; + if (percentage > 50) { + return `⚠️ Using ${percentage.toFixed(0)}% of total CPU cores - high allocation may impact host performance`; + } + return null; +}); + /** * Assigns the initial values from the Docker Compose file to the reactive refs * so we can display them and track when a change has been made From 5d3b04ec13f2a0422cae733054757646567e44e3 Mon Sep 17 00:00:00 2001 From: Your Name Date: Fri, 10 Oct 2025 20:38:41 -0400 Subject: [PATCH 2/2] Use x-input components with RegEx parsing per maintainer feedback - Replaced native input elements with x-input components - Added RegEx parsing: @input with /^\d+$/.exec() pattern - Kept flex-col layout for warning display - Kept all warning functionality (40% RAM, 50% CPU thresholds) - Changed gap-3 to gap-2, removed font-medium from labels --- src/renderer/views/Config.vue | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/src/renderer/views/Config.vue b/src/renderer/views/Config.vue index 89d3d99..11c9f94 100644 --- a/src/renderer/views/Config.vue +++ b/src/renderer/views/Config.vue @@ -18,17 +18,16 @@ How many gigabytes of RAM are allocated to the Windows virtual machine

-
- + -

GB

+ >
+

GB

@@ -51,17 +50,16 @@ How many CPU Cores are allocated to the Windows virtual machine

-
- + -

Cores

+ >
+

Cores