mirror of
https://github.com/easydiffusion/easydiffusion.git
synced 2025-08-14 02:05:21 +02:00
Unify IP info with devices, into a system_info table
This commit is contained in:
@ -196,34 +196,6 @@ function playSound() {
|
||||
})
|
||||
}
|
||||
}
|
||||
function setSystemInfo(devices) {
|
||||
let cpu = devices.all.cpu.name
|
||||
let allGPUs = Object.keys(devices.all).filter(d => d != 'cpu')
|
||||
let activeGPUs = Object.keys(devices.active)
|
||||
|
||||
function ID_TO_TEXT(d) {
|
||||
let info = devices.all[d]
|
||||
if ("mem_free" in info && "mem_total" in info) {
|
||||
return `${info.name} <small>(${d}) (${info.mem_free.toFixed(1)}Gb free / ${info.mem_total.toFixed(1)} Gb total)</small>`
|
||||
} else {
|
||||
return `${info.name} <small>(${d}) (no memory info)</small>`
|
||||
}
|
||||
}
|
||||
|
||||
allGPUs = allGPUs.map(ID_TO_TEXT)
|
||||
activeGPUs = activeGPUs.map(ID_TO_TEXT)
|
||||
|
||||
let systemInfo = `
|
||||
<table>
|
||||
<tr><td><label>Processor:</label></td><td class="value">${cpu}</td></tr>
|
||||
<tr><td><label>Compatible Graphics Cards (all):</label></td><td class="value">${allGPUs.join('</br>')}</td></tr>
|
||||
<tr><td></td><td> </td></tr>
|
||||
<tr><td><label>Used for rendering 🔥:</label></td><td class="value">${activeGPUs.join('</br>')}</td></tr>
|
||||
</table>`
|
||||
|
||||
let systemInfoEl = document.querySelector('#system-info')
|
||||
systemInfoEl.innerHTML = systemInfo
|
||||
}
|
||||
|
||||
async function healthCheck() {
|
||||
try {
|
||||
@ -258,7 +230,7 @@ async function healthCheck() {
|
||||
break
|
||||
}
|
||||
if (serverState.devices) {
|
||||
setSystemInfo(serverState.devices)
|
||||
setDeviceInfo(serverState.devices)
|
||||
}
|
||||
serverState.time = Date.now()
|
||||
} catch (e) {
|
||||
|
Reference in New Issue
Block a user