mirror of
https://codeberg.org/ashley/poke.git
synced 2024-11-10 07:58:28 +01:00
add system information
This commit is contained in:
parent
298c618150
commit
7afbbd03f8
1 changed files with 8 additions and 0 deletions
|
@ -27,6 +27,7 @@ function getJson(str) {
|
|||
}
|
||||
|
||||
const pkg = require("../../../package.json");
|
||||
const os = require('os');
|
||||
const cnf = require("../../../config.json");
|
||||
const innertube = require("../libpoketube-youtubei-objects.json");
|
||||
|
||||
|
@ -214,6 +215,9 @@ app.use("/sb/i/:v/:imagePath/:img", async function (req, res) {
|
|||
.fetch("https://invid-api.poketube.fun/api/v1/stats")
|
||||
.then((res) => res.text())
|
||||
.then((txt) => getJson(txt));
|
||||
|
||||
const cpus = os.cpus();
|
||||
const totalMemory = os.totalmem();
|
||||
|
||||
const response = {
|
||||
pt_version: {
|
||||
|
@ -226,6 +230,10 @@ app.use("/sb/i/:v/:imagePath/:img", async function (req, res) {
|
|||
vernum: versionnumber,
|
||||
codename,
|
||||
config:cnf,
|
||||
system:{
|
||||
ram:`${totalMemory / (1024 * 1024 * 1024)} GB`,
|
||||
cpu:cpus[0].model,
|
||||
},
|
||||
packages: {
|
||||
libpt: version,
|
||||
node: process.version,
|
||||
|
|
Loading…
Reference in a new issue