[QoL] Add resource allocation warnings and enhanced system detection #298
+69
−42
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR adds quality-of-life improvements to the VM resource configuration experience by providing real-time feedback when users allocate system resources that may impact host performance.
Motivation
Currently, WinBoat validates resource allocation with basic minimum checks (4GB RAM, 2 CPU cores) but doesn't warn users when they're allocating a large percentage of their available system resources. Users can inadvertently allocate too much RAM or CPU without realizing the impact on their host system until performance degradation occurs.
Changes
1. Yellow Warning System
text-yellow-400
) directly below the respective input fields"⚠️ Using 65% of total RAM - high allocation may impact host performance"
2. Enhanced System Detection
getMemoryInfo()
function inspecs.ts
that reads/proc/meminfo
to extract both total and available system memoryMemoryInfo
type withtotalGB
andavailableGB
propertiesgetSpecs()
to provide accurate memory detection3. Improved UI Components
<x-input>
components with native<input type="number">
elements for RAM/CPU allocationflex-row
toflex-col
to accommodate inline warning messagesTechnical Implementation
File:
src/renderer/views/Config.vue
ramWarning
andcpuWarning
null
v-if="ramWarning"
/v-if="cpuWarning"
File:
src/renderer/lib/specs.ts
getMemoryInfo()
function/proc/meminfo
, extractsMemTotal
andMemAvailable
linesMath.round(parseInt(...) / 1024 / 1024 * 100) / 100
MemoryInfo
type for type safetyBenefits
Testing Notes
text-yellow-400
) provides appropriate visual hierarchyScreenshots
Notes
Modified Files
src/renderer/views/Config.vue
(71 additions, 42 deletions)Total Changes: ~113 lines modified
Build Verification
✅ Test Build Completed Successfully
qol-warnings-and-detection