修复地区查询错误的BUG

This commit is contained in:
CN-JS-HuiBai
2026-04-05 17:35:02 +08:00
parent f997b6236c
commit b2c37b8fe3
2 changed files with 22 additions and 16 deletions

View File

@@ -10,7 +10,7 @@ const httpAgent = new http.Agent({ keepAlive: true });
const httpsAgent = new https.Agent({ keepAlive: true, rejectUnauthorized: false });
const serverIdMap = new Map(); // token -> { instance, job, source }
const SECRET = crypto.randomBytes(16).toString('hex');
const SECRET = process.env.APP_SECRET || 'prom-data-panel-stable-secret-key-123';
function getServerToken(instance, job, source) {
const hash = crypto.createHmac('sha256', SECRET)
@@ -363,10 +363,7 @@ async function getOverviewMetrics(url, sourceName) {
tx: totalTraffic24hTx,
total: totalTraffic24hRx + totalTraffic24hTx
},
servers: allInstancesList.map(s => {
const { originalInstance, ...rest } = s;
return rest;
})
servers: allInstancesList
};
}