add ram size

This commit is contained in:
Ashley //// 2024-03-27 11:40:30 +00:00
parent 7afbbd03f8
commit 66308a4283

View file

@ -217,7 +217,8 @@ app.use("/sb/i/:v/:imagePath/:img", async function (req, res) {
.then((txt) => getJson(txt)); .then((txt) => getJson(txt));
const cpus = os.cpus(); const cpus = os.cpus();
const totalMemory = os.totalmem(); const totalMemory = os.totalmem() / (1024 * 1024 * 1024);
const roundedMemory = totalMemory.toFixed(2);
const response = { const response = {
pt_version: { pt_version: {
@ -231,7 +232,7 @@ app.use("/sb/i/:v/:imagePath/:img", async function (req, res) {
codename, codename,
config:cnf, config:cnf,
system:{ system:{
ram:`${totalMemory / (1024 * 1024 * 1024)} GB`, ram:`${roundedMemory} GB`,
cpu:cpus[0].model, cpu:cpus[0].model,
}, },
packages: { packages: {