[FEATURE] Adjust more server controllers
This commit is contained in:
parent
62c966a6bd
commit
37e3dc2ae9
16 changed files with 281 additions and 173 deletions
18
lib/controllers/status-controller.js
Normal file
18
lib/controllers/status-controller.js
Normal file
|
@ -0,0 +1,18 @@
|
|||
import { getDeployments } from "../k8s/k8s-server-control.js";
|
||||
import { getInstances } from "../k8s/server-control.js";
|
||||
import { sendError } from "../util/ExpressClientError.js";
|
||||
|
||||
export function serverList(req, res) {
|
||||
getDeployments()
|
||||
.then((sd) => res.json(sd.map((s) => s.metadata.name.substring(4))))
|
||||
.catch((e) => {
|
||||
ERR("SERVER CONTROL", e);
|
||||
res.status(500).send("Couldn't get server list");
|
||||
});
|
||||
}
|
||||
|
||||
export function serverInstances(req, res) {
|
||||
getInstances()
|
||||
.then((i) => res.json(i))
|
||||
.catch(sendError(res));
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue