mirror of
https://github.com/biersoeckli/QuickStack.git
synced 2025-12-31 08:19:54 -06:00
fixed terminal stuff
This commit is contained in:
@@ -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",
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user