Add Gateway device inventory panel
This commit is contained in:
@@ -4,6 +4,7 @@ import path from 'node:path';
|
||||
import { settings } from './config.js';
|
||||
import { createSingboxRuntime } from './singboxRuntime.js';
|
||||
import { buildVersionInfo } from './version.js';
|
||||
import { readNeighborSnapshot } from './adapters/neighbors.js';
|
||||
|
||||
const socketPath = settings.dataplaneSocket;
|
||||
const runtime = createSingboxRuntime({
|
||||
@@ -29,6 +30,9 @@ const server = http.createServer(async (req, res) => {
|
||||
ready,
|
||||
});
|
||||
}
|
||||
if (req.method === 'GET' && req.url === '/devices') {
|
||||
return sendJson(res, 200, readNeighborSnapshot());
|
||||
}
|
||||
if (req.method === 'POST' && req.url === '/apply') {
|
||||
return sendJson(res, 200, await runtime.apply());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user