mirror of
https://github.com/whyour/qinglong.git
synced 2025-05-23 23:06:06 +08:00
修改public服务
This commit is contained in:
parent
9927461ea9
commit
7dd87220ab
|
@ -107,7 +107,7 @@ export function createRandomString(min: number, max: number): string {
|
||||||
newArr.push(arr.splice(Math.random() * arr.length, 1)[0]);
|
newArr.push(arr.splice(Math.random() * arr.length, 1)[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
function getOne(arr) {
|
function getOne(arr: any[]) {
|
||||||
return arr[Math.floor(Math.random() * arr.length)];
|
return arr[Math.floor(Math.random() * arr.length)];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -6,12 +6,15 @@ import config from './config';
|
||||||
const app = express();
|
const app = express();
|
||||||
|
|
||||||
app.get('/api/public/panel/log', (req, res) => {
|
app.get('/api/public/panel/log', (req, res) => {
|
||||||
exec('pm2 logs panel --lines 500', (err, stdout, stderr) => {
|
exec(
|
||||||
|
'pm2 logs panel --lines 500 --nostream --timestamp',
|
||||||
|
(err, stdout, stderr) => {
|
||||||
if (err || stderr) {
|
if (err || stderr) {
|
||||||
return res.send({ code: 400, data: err || stderr });
|
return res.send({ code: 400, data: err || stderr });
|
||||||
}
|
}
|
||||||
return res.send({ code: 200, data: stdout });
|
return res.send({ code: 200, data: stdout });
|
||||||
});
|
},
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
app
|
app
|
||||||
|
|
Loading…
Reference in New Issue
Block a user