fix CPU calculation

This commit is contained in:
Raven Scott 2024-11-28 07:23:36 -05:00
parent 2017988ea1
commit ca38ece83f

5
app.js
View File

@ -396,12 +396,15 @@ function openDuplicateModal(container) {
return;
}
console.log("TESTER: " + config.HostConfig?.CpusetCpus)
let CPUs = config.HostConfig?.CpusetCpus.split(",");
// Populate the modal fields with the current configurations
document.getElementById('container-name').value = config.Name.replace(/^\//, '');
document.getElementById('container-hostname').value = config.Config.Hostname.replace(/^\//, '');
document.getElementById('container-image').value = config.Config.Image;
document.getElementById('container-netmode').value = config.HostConfig?.NetworkMode;
document.getElementById('container-cpu').value = config.HostConfig?.CpusetCpus;
document.getElementById('container-cpu').value = CPUs.length;
document.getElementById('container-memory').value = Math.round(config.HostConfig?.Memory / (1024 * 1024));
document.getElementById('container-config').value = JSON.stringify(config, null, 2);