[FEATURE] Cleaned up terminal display

This commit is contained in:
Dunemask 2024-02-10 17:36:18 -07:00
parent 4959d6c1fe
commit a804a6e98b
7 changed files with 36 additions and 25 deletions

View file

@ -26,9 +26,13 @@ export async function webConsoleLogs(socket) {
const log = new k8s.Log(kc);
const logStream = new stream.PassThrough();
logStream.on("data", (chunk) =>
socket.emit("push", Buffer.from(chunk).toString()),
);
var logstreamBuffer = "";
logStream.on("data", (chunk) => {
const bufferString = Buffer.from(chunk).toString();
if (!bufferString.includes("\n")) return (logstreamBuffer += bufferString);
const clientChunks = `${logstreamBuffer}${bufferString}`.split("\n");
for (var c of clientChunks) socket.emit("push", c);
});
log
.log(namespace, mcsPods[0], containerName, logStream, {
follow: true,

View file

@ -67,7 +67,7 @@ function createBackupSecret(serverSpec) {
`endpoint = ${backupHost}`,
`acl = private`,
`no_check_bucket = true`,
`no_check_container = true`
`no_check_container = true`,
].join("\n");
backupYaml.data["rclone.conf"] = Buffer.from(rcloneConfig).toString("base64");
return backupYaml;

View file

@ -17,7 +17,6 @@ const cairoAuthenticate = async (token) => {
// Middleware
const cairoAuthHandler = (req, res, next) => {
if (!req.token) return res.status(401).send("Cairo auth required!");
VERB("AUTH", `${MCL_CAIRO_URL}/api/user/info`);
cairoAuthenticate(req.token)
.then((authData) => (req.cairoId = authData.id))
.then(() => next())