fixed terminal stuff

This commit is contained in:
biersoeckli
2024-11-28 10:27:03 +00:00
parent 1e4bb32bbe
commit c599941485
4 changed files with 4818 additions and 9 deletions

View File

@@ -4,7 +4,7 @@
"private": true,
"scripts": {
"dev": "next dev",
"dev-live": "bun src/server.ts",
"dev-live": "tsc src/server.ts",
"build": "next build && tsc --project tsconfig.server.json",
"start": "next start",
"start-prod": "cross-env NODE_ENV=production node dist/server.js",

View File

@@ -17,17 +17,17 @@ import { Label } from "@radix-ui/react-dropdown-menu";
class MonitorAppService {
async getRessourceData() {
console.log("gugus");
//console.log("gugus");
return "miau";
}
async getPodsFromDeployment(namespace: string, deploymentName: string): Promise<void> {
const pods = await k3s.core.listNamespacedPod(namespace, undefined, undefined, undefined, undefined, `app=${deploymentName}`);
console.log(namespace);
console.log(deploymentName);
console.log(pods.body.items);
// console.log(namespace);
// console.log(deploymentName);
//console.log(pods.body.items);
for (const pod of pods.body.items) {
console.log(pod.metadata?.name);
//console.log(pod.metadata?.name);
}
}

View File

@@ -5,7 +5,6 @@ import * as k8s from '@kubernetes/client-node';
import stream from 'stream';
import { StreamUtils } from "../../shared/utils/stream.utils";
import WebSocket from "ws";
import crypto from 'crypto';
interface TerminalStrean {
stdoutStream: stream.PassThrough;
@@ -46,7 +45,7 @@ export class TerminalService {
const stderrStream = new stream.PassThrough();
const stdinStream = new stream.PassThrough();
console.log('starting exec')
exec.exec(
await exec.exec(
terminalInfo.namespace,
terminalInfo.podName,
terminalInfo.containerName,
@@ -59,7 +58,7 @@ export class TerminalService {
stdinStream,
false /* tty */,
(status: k8s.V1Status) => {
console.log('Exited with status:');
console.log('[EXIT] Exited with status:');
console.log(JSON.stringify(status, null, 2));
stderrStream!.end();
stdoutStream!.end();

4810
yarn.lock Normal file

File diff suppressed because it is too large Load Diff