Fix MemoryMonitor blank on GPU-less deployments
gpu_memory_percent is serialized as JSON null (not omitted) when no GPU is present, but the template checked `!== undefined`, which is true for null too. Calling .toFixed() on that null then threw during render, blanking the whole widget instead of just hiding the GPU row. Only showed up on GPU-less hosts like a Lightsail instance, not on this dev machine which has a GPU.
This commit is contained in:
@@ -60,7 +60,7 @@ onUnmounted(() => {
|
||||
<span class="value">{{ stats.memory_percent.toFixed(1) }}% ({{ formatMemory(stats.memory_used_mb) }} / {{ formatMemory(stats.memory_total_mb) }})</span>
|
||||
</div>
|
||||
|
||||
<div class="stat" v-if="stats.gpu_memory_percent !== undefined">
|
||||
<div class="stat" v-if="stats.gpu_memory_percent != null">
|
||||
<span class="label">GPU</span>
|
||||
<div class="bar">
|
||||
<div class="fill gpu" :style="{ width: stats.gpu_memory_percent + '%' }"></div>
|
||||
|
||||
Reference in New Issue
Block a user