Updates
This commit is contained in:
parent
921375c53d
commit
f3b42bc206
@ -49,15 +49,15 @@ export default function TtydIframe({
|
|||||||
<Span size="small" variant="faded">
|
<Span size="small" variant="faded">
|
||||||
{title}
|
{title}
|
||||||
</Span>
|
</Span>
|
||||||
<LucideIcon
|
{/* <LucideIcon
|
||||||
name="ChevronRight"
|
name="ChevronRight"
|
||||||
size={15}
|
size={15}
|
||||||
opacity={0.3}
|
opacity={0.3}
|
||||||
/>
|
/> */}
|
||||||
</Fragment>
|
</Fragment>
|
||||||
) : null}
|
) : null}
|
||||||
|
|
||||||
<Span size="small" variant="faded">
|
{/* <Span size="small" variant="faded">
|
||||||
<a
|
<a
|
||||||
href={url}
|
href={url}
|
||||||
target="_blank"
|
target="_blank"
|
||||||
@ -65,7 +65,7 @@ export default function TtydIframe({
|
|||||||
>
|
>
|
||||||
{url}
|
{url}
|
||||||
</a>
|
</a>
|
||||||
</Span>
|
</Span> */}
|
||||||
</Row>
|
</Row>
|
||||||
<Row>
|
<Row>
|
||||||
<Button
|
<Button
|
||||||
|
|||||||
@ -0,0 +1,66 @@
|
|||||||
|
import Stack from "@/twui/components/layout/Stack";
|
||||||
|
import {
|
||||||
|
Dispatch,
|
||||||
|
SetStateAction,
|
||||||
|
useContext,
|
||||||
|
useEffect,
|
||||||
|
useRef,
|
||||||
|
useState,
|
||||||
|
} from "react";
|
||||||
|
import { AppContext } from "@/src/pages/_app";
|
||||||
|
import {
|
||||||
|
NormalizedServerObject,
|
||||||
|
ParsedDeploymentServiceConfig,
|
||||||
|
} from "@/src/types";
|
||||||
|
import Select, { TWUISelectOptionObject } from "@/twui/components/form/Select";
|
||||||
|
|
||||||
|
type Props = {
|
||||||
|
service: ParsedDeploymentServiceConfig;
|
||||||
|
server: NormalizedServerObject;
|
||||||
|
setLog: Dispatch<SetStateAction<string | undefined>>;
|
||||||
|
};
|
||||||
|
|
||||||
|
export default function ServiceClusterServerLogSelector({
|
||||||
|
service,
|
||||||
|
server,
|
||||||
|
setLog: externalSetLog,
|
||||||
|
}: Props) {
|
||||||
|
const { pageProps } = useContext(AppContext);
|
||||||
|
|
||||||
|
const logs = service.logs;
|
||||||
|
|
||||||
|
const log_strings = logs?.map((l) => (typeof l == "string" ? l : l.cmd));
|
||||||
|
|
||||||
|
const [log, setLog] = useState(log_strings?.[0]);
|
||||||
|
const [isCustomLog, setIsCustomLog] = useState(false);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
externalSetLog(log);
|
||||||
|
}, [log]);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Stack className="w-full gap-0">
|
||||||
|
<Select
|
||||||
|
options={[
|
||||||
|
...(log_strings?.map(
|
||||||
|
(l) =>
|
||||||
|
({ value: l, title: l }) as TWUISelectOptionObject,
|
||||||
|
) || []),
|
||||||
|
{
|
||||||
|
value: "custom",
|
||||||
|
title: "--Custom--",
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
changeHandler={(v) => {
|
||||||
|
if (v == "custom") {
|
||||||
|
setIsCustomLog(true);
|
||||||
|
} else {
|
||||||
|
setIsCustomLog(false);
|
||||||
|
setLog(v);
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
{isCustomLog}
|
||||||
|
</Stack>
|
||||||
|
);
|
||||||
|
}
|
||||||
@ -4,6 +4,7 @@ import { AppContext } from "@/src/pages/_app";
|
|||||||
import {
|
import {
|
||||||
NormalizedServerObject,
|
NormalizedServerObject,
|
||||||
ParsedDeploymentServiceConfig,
|
ParsedDeploymentServiceConfig,
|
||||||
|
ServerTerminalTargets,
|
||||||
TtydInfoObject,
|
TtydInfoObject,
|
||||||
WebSocketDataType,
|
WebSocketDataType,
|
||||||
} from "@/src/types";
|
} from "@/src/types";
|
||||||
@ -13,13 +14,21 @@ import Loading from "@/twui/components/elements/Loading";
|
|||||||
import Center from "@/twui/components/layout/Center";
|
import Center from "@/twui/components/layout/Center";
|
||||||
import TtydIframe from "@/src/components/general/ttyd-iframe";
|
import TtydIframe from "@/src/components/general/ttyd-iframe";
|
||||||
import useIntersectionObserver from "@/twui/components/hooks/useIntersectionObserver";
|
import useIntersectionObserver from "@/twui/components/hooks/useIntersectionObserver";
|
||||||
|
import useStatus from "@/twui/components/hooks/useStatus";
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
service: ParsedDeploymentServiceConfig;
|
service: ParsedDeploymentServiceConfig;
|
||||||
server: NormalizedServerObject;
|
server: NormalizedServerObject;
|
||||||
|
target: (typeof ServerTerminalTargets)[number]["name"];
|
||||||
|
log?: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
export default function ServiceClusterServerViews({ service, server }: Props) {
|
export default function ServiceClusterServerViews({
|
||||||
|
service,
|
||||||
|
server,
|
||||||
|
target,
|
||||||
|
log,
|
||||||
|
}: Props) {
|
||||||
const { pageProps, ws } = useContext(AppContext);
|
const { pageProps, ws } = useContext(AppContext);
|
||||||
|
|
||||||
const viewRef = useRef<HTMLDivElement>(undefined);
|
const viewRef = useRef<HTMLDivElement>(undefined);
|
||||||
@ -27,26 +36,62 @@ export default function ServiceClusterServerViews({ service, server }: Props) {
|
|||||||
const { data } = useWebSocketEventHandler<WebSocketDataType>();
|
const { data } = useWebSocketEventHandler<WebSocketDataType>();
|
||||||
const { isIntersecting } = useIntersectionObserver({ elementRef: viewRef });
|
const { isIntersecting } = useIntersectionObserver({ elementRef: viewRef });
|
||||||
|
|
||||||
const [ttydLogs, setTtydLogs] = useState<TtydInfoObject>();
|
const [ttyd, setTtyd] = useState<TtydInfoObject>();
|
||||||
|
|
||||||
|
const { refresh, setRefresh } = useStatus();
|
||||||
|
|
||||||
const WsReqSentRef = useRef(false);
|
const WsReqSentRef = useRef(false);
|
||||||
|
|
||||||
|
function sendKillPort() {
|
||||||
|
if (ttyd?.port) {
|
||||||
|
ws.sendData({
|
||||||
|
event: "client:kill-port",
|
||||||
|
server,
|
||||||
|
service: _.omit(service, ["servers"]),
|
||||||
|
port: ttyd.port,
|
||||||
|
log,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!ws?.socket || WsReqSentRef.current) {
|
if (!ws?.socket || WsReqSentRef.current) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ws.sendData({
|
if (target == "logs") {
|
||||||
event: "client:service-server-logs",
|
ws.sendData({
|
||||||
server,
|
event: "client:service-server-logs",
|
||||||
service: _.omit(service, ["servers"]),
|
server,
|
||||||
});
|
service: _.omit(service, ["servers"]),
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
ws.sendData({
|
||||||
|
event: "client:service-server-shell",
|
||||||
|
server,
|
||||||
|
service: _.omit(service, ["servers"]),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
WsReqSentRef.current = true;
|
WsReqSentRef.current = true;
|
||||||
}, [ws]);
|
|
||||||
|
return function () {
|
||||||
|
sendKillPort();
|
||||||
|
};
|
||||||
|
}, [ws, refresh]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (ttydLogs) return;
|
if (WsReqSentRef.current) {
|
||||||
|
sendKillPort();
|
||||||
|
|
||||||
|
setTtyd(undefined);
|
||||||
|
WsReqSentRef.current = false;
|
||||||
|
setRefresh((prev) => prev + 1);
|
||||||
|
}
|
||||||
|
}, [target]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (ttyd) return;
|
||||||
|
|
||||||
if (
|
if (
|
||||||
data?.event == "server:service-server-logs" &&
|
data?.event == "server:service-server-logs" &&
|
||||||
@ -54,53 +99,45 @@ export default function ServiceClusterServerViews({ service, server }: Props) {
|
|||||||
data.server?.private_ip == server.private_ip
|
data.server?.private_ip == server.private_ip
|
||||||
) {
|
) {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
setTtydLogs(data.ttyd);
|
setTtyd(data.ttyd);
|
||||||
|
}, 2000);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (
|
||||||
|
data?.event == "server:service-server-shell" &&
|
||||||
|
data?.ttyd &&
|
||||||
|
data.server?.private_ip == server.private_ip
|
||||||
|
) {
|
||||||
|
setTimeout(() => {
|
||||||
|
setTtyd(data.ttyd);
|
||||||
}, 2000);
|
}, 2000);
|
||||||
}
|
}
|
||||||
}, [data]);
|
}, [data]);
|
||||||
|
|
||||||
console.log("isIntersecting", isIntersecting);
|
|
||||||
console.log("ttydLogs", ttydLogs);
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!ttydLogs?.port) return;
|
if (!ttyd?.port) return;
|
||||||
|
|
||||||
if (!isIntersecting) {
|
if (!isIntersecting) {
|
||||||
ws.sendData({
|
sendKillPort();
|
||||||
event: "client:kill-port",
|
|
||||||
server,
|
|
||||||
service: _.omit(service, ["servers"]),
|
|
||||||
port: ttydLogs.port,
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}, [isIntersecting]);
|
}, [isIntersecting]);
|
||||||
|
|
||||||
const dev_logs_url = ttydLogs?.port
|
// const dev_logs_url = ttydLogs?.port
|
||||||
? `http://localhost:${ttydLogs.port}`
|
// ? `http://localhost:${ttydLogs.port}`
|
||||||
: undefined;
|
// : undefined;
|
||||||
|
|
||||||
const title = (
|
const title = (
|
||||||
<>
|
<>
|
||||||
{service.service_name} service <code>{server.private_ip}</code> Logs
|
<code>{server.private_ip}</code> {target}
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Stack className="gap-0 w-full" componentRef={viewRef as any}>
|
<Stack className="gap-0 w-full" componentRef={viewRef as any}>
|
||||||
{isIntersecting && ttydLogs?.url && ttydLogs.port ? (
|
{isIntersecting && ttyd?.url && ttyd.port ? (
|
||||||
<Stack className="gap-0">
|
<Stack className="gap-0">
|
||||||
{/* {dev_logs_url ? (
|
|
||||||
<TtydIframe
|
|
||||||
url={dev_logs_url}
|
|
||||||
title={title}
|
|
||||||
wrapperProps={{
|
|
||||||
className: "border-none",
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
) : null}
|
|
||||||
<hr /> */}
|
|
||||||
<TtydIframe
|
<TtydIframe
|
||||||
url={ttydLogs?.url}
|
url={ttyd?.url}
|
||||||
title={title}
|
title={title}
|
||||||
wrapperProps={{
|
wrapperProps={{
|
||||||
className: "border-none",
|
className: "border-none",
|
||||||
@ -108,7 +145,7 @@ export default function ServiceClusterServerViews({ service, server }: Props) {
|
|||||||
/>
|
/>
|
||||||
</Stack>
|
</Stack>
|
||||||
) : (
|
) : (
|
||||||
<Center className="p-10 h-[400px]">
|
<Center className="p-10 h-[460px]">
|
||||||
<Loading />
|
<Loading />
|
||||||
</Center>
|
</Center>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@ -1,14 +1,18 @@
|
|||||||
import Stack from "@/twui/components/layout/Stack";
|
import Stack from "@/twui/components/layout/Stack";
|
||||||
import { useContext, useRef } from "react";
|
import { useContext, useRef, useState } from "react";
|
||||||
import { AppContext } from "@/src/pages/_app";
|
import { AppContext } from "@/src/pages/_app";
|
||||||
import {
|
import {
|
||||||
NormalizedServerObject,
|
NormalizedServerObject,
|
||||||
ParsedDeploymentServiceConfig,
|
ParsedDeploymentServiceConfig,
|
||||||
|
ServerTerminalTargets,
|
||||||
} from "@/src/types";
|
} from "@/src/types";
|
||||||
import useIntersectionObserver from "@/twui/components/hooks/useIntersectionObserver";
|
import useIntersectionObserver from "@/twui/components/hooks/useIntersectionObserver";
|
||||||
import Center from "@/twui/components/layout/Center";
|
import Center from "@/twui/components/layout/Center";
|
||||||
import Loading from "@/twui/components/elements/Loading";
|
import Loading from "@/twui/components/elements/Loading";
|
||||||
import ServiceClusterServerViews from "./cluster-server-views";
|
import ServiceClusterServerViews from "./cluster-server-views";
|
||||||
|
import Row from "@/twui/components/layout/Row";
|
||||||
|
import Button from "@/twui/components/layout/Button";
|
||||||
|
import ServiceClusterServerLogSelector from "./cluster-server-log-selector";
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
service: ParsedDeploymentServiceConfig;
|
service: ParsedDeploymentServiceConfig;
|
||||||
@ -21,14 +25,47 @@ export default function ServiceClusterServer({ service, server }: Props) {
|
|||||||
const elementRef = useRef<HTMLDivElement>(undefined);
|
const elementRef = useRef<HTMLDivElement>(undefined);
|
||||||
const { isIntersecting } = useIntersectionObserver({ elementRef });
|
const { isIntersecting } = useIntersectionObserver({ elementRef });
|
||||||
|
|
||||||
|
const [target, setTarget] =
|
||||||
|
useState<(typeof ServerTerminalTargets)[number]["name"]>("logs");
|
||||||
|
|
||||||
|
const [log, setLog] = useState<string>();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Stack className="grid-cell gap-0" componentRef={elementRef as any}>
|
<Stack className="grid-cell gap-0" componentRef={elementRef as any}>
|
||||||
<Stack className="grid-cell-content">
|
<Stack className="grid-cell-content">
|
||||||
<code>{server.private_ip}</code>
|
<Row className="w-full justify-between">
|
||||||
|
<Row>
|
||||||
|
<code>{server.private_ip}</code>
|
||||||
|
</Row>
|
||||||
|
<Row>
|
||||||
|
{ServerTerminalTargets.map((targ, index) => {
|
||||||
|
const is_active = targ.name == target;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Button
|
||||||
|
title={`${targ.name}`}
|
||||||
|
onClick={() => {
|
||||||
|
setTarget(targ.name);
|
||||||
|
}}
|
||||||
|
size="smaller"
|
||||||
|
color="gray"
|
||||||
|
variant={is_active ? undefined : "outlined"}
|
||||||
|
>
|
||||||
|
{targ.name}
|
||||||
|
</Button>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</Row>
|
||||||
|
</Row>
|
||||||
|
<ServiceClusterServerLogSelector
|
||||||
|
{...{ server, service, setLog }}
|
||||||
|
/>
|
||||||
</Stack>
|
</Stack>
|
||||||
<hr />
|
<hr />
|
||||||
{isIntersecting ? (
|
{isIntersecting ? (
|
||||||
<ServiceClusterServerViews {...{ server, service }} />
|
<ServiceClusterServerViews
|
||||||
|
{...{ server, service, target, log }}
|
||||||
|
/>
|
||||||
) : (
|
) : (
|
||||||
<Center>
|
<Center>
|
||||||
<Loading />
|
<Loading />
|
||||||
|
|||||||
@ -50,7 +50,7 @@ export default async function grabTtydServerInfo({
|
|||||||
|
|
||||||
cmd += ` root@${server?.private_ip}`;
|
cmd += ` root@${server?.private_ip}`;
|
||||||
|
|
||||||
if (final_first_log) {
|
if (paradigm == "logs" && final_first_log) {
|
||||||
cmd += ` ${final_first_log}`;
|
cmd += ` ${final_first_log}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -232,6 +232,7 @@ export const WebSocketEvents = [
|
|||||||
"client:ping",
|
"client:ping",
|
||||||
"client:service-server-logs",
|
"client:service-server-logs",
|
||||||
"client:kill-port",
|
"client:kill-port",
|
||||||
|
"client:service-server-shell",
|
||||||
|
|
||||||
"server:ping",
|
"server:ping",
|
||||||
"server:error",
|
"server:error",
|
||||||
@ -241,6 +242,7 @@ export const WebSocketEvents = [
|
|||||||
"server:update",
|
"server:update",
|
||||||
"server:service-server-logs",
|
"server:service-server-logs",
|
||||||
"server:killed-port",
|
"server:killed-port",
|
||||||
|
"server:service-server-shell",
|
||||||
] as const;
|
] as const;
|
||||||
|
|
||||||
export type WebSocketDataType = {
|
export type WebSocketDataType = {
|
||||||
@ -250,6 +252,7 @@ export type WebSocketDataType = {
|
|||||||
server?: NormalizedServerObject;
|
server?: NormalizedServerObject;
|
||||||
ttyd?: TtydInfoObject;
|
ttyd?: TtydInfoObject;
|
||||||
port?: string | number;
|
port?: string | number;
|
||||||
|
log?: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type WebSocketMessageParam = {
|
export type WebSocketMessageParam = {
|
||||||
@ -291,3 +294,8 @@ export type WebSocketConnectedUserData = {
|
|||||||
child_processes: ChildProcess[];
|
child_processes: ChildProcess[];
|
||||||
ports: (string | number)[];
|
ports: (string | number)[];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const ServerTerminalTargets = [
|
||||||
|
{ name: "logs" },
|
||||||
|
{ name: "shell" },
|
||||||
|
] as const;
|
||||||
|
|||||||
@ -6,7 +6,7 @@ type Params = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export default async function killPort({ port, exec_options }: Params) {
|
export default async function killPort({ port, exec_options }: Params) {
|
||||||
const kill_ports_cmd = `ss -tlnp | awk -v p=${port} 'NR>1 {split($4,a,":"); if(a[length(a)]==p) print $6}' | grep -oP 'pid=\K[0-9]+' | xargs -r kill -9`;
|
const kill_ports_cmd = `ss -tlnp | awk -v p=${port} 'NR>1 {split($4,a,":"); if(a[length(a)]==p) print $6}' | grep -oP 'pid=\\K[0-9]+' | xargs -r kill -9`;
|
||||||
|
|
||||||
execSync(kill_ports_cmd, {
|
execSync(kill_ports_cmd, {
|
||||||
...exec_options,
|
...exec_options,
|
||||||
|
|||||||
@ -2,6 +2,7 @@ import { WebSocketMessageParam } from "@/src/types";
|
|||||||
import sendData from "../(utils)/send-data";
|
import sendData from "../(utils)/send-data";
|
||||||
import sendError from "../(utils)/send-error";
|
import sendError from "../(utils)/send-error";
|
||||||
import grabConnectedWebsocketUserdata from "../(utils)/grab-connected-websocket-user-data";
|
import grabConnectedWebsocketUserdata from "../(utils)/grab-connected-websocket-user-data";
|
||||||
|
import killPort from "../(utils)/kill-port";
|
||||||
|
|
||||||
export default async function socketClientKillPort({
|
export default async function socketClientKillPort({
|
||||||
ws,
|
ws,
|
||||||
@ -15,7 +16,15 @@ export default async function socketClientKillPort({
|
|||||||
|
|
||||||
const connected_user_data = grabConnectedWebsocketUserdata({ user });
|
const connected_user_data = grabConnectedWebsocketUserdata({ user });
|
||||||
|
|
||||||
console.log("connected_user_data", connected_user_data);
|
console.log("port", port);
|
||||||
|
|
||||||
|
if (port) {
|
||||||
|
await killPort({ port, exec_options: { stdio: "inherit" } });
|
||||||
|
|
||||||
|
connected_user_data.ports = connected_user_data.ports.filter(
|
||||||
|
(p) => p != port,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
sendData(ws, {
|
sendData(ws, {
|
||||||
event: "server:killed-port",
|
event: "server:killed-port",
|
||||||
|
|||||||
@ -19,8 +19,6 @@ export default async function socketClientServiceServerLogs({
|
|||||||
paradigm: "logs",
|
paradigm: "logs",
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log("ttyd", ttyd);
|
|
||||||
|
|
||||||
sendData(ws, {
|
sendData(ws, {
|
||||||
event: "server:service-server-logs",
|
event: "server:service-server-logs",
|
||||||
ttyd,
|
ttyd,
|
||||||
|
|||||||
30
src/websocket/events/client-service-server-shell.ts
Normal file
30
src/websocket/events/client-service-server-shell.ts
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
import { WebSocketMessageParam } from "@/src/types";
|
||||||
|
import sendData from "../(utils)/send-data";
|
||||||
|
import sendError from "../(utils)/send-error";
|
||||||
|
import grabTtydServerInfo from "@/src/functions/ttyd/grab-ttyd-service-info";
|
||||||
|
|
||||||
|
export default async function socketClientServiceServerShell({
|
||||||
|
ws,
|
||||||
|
data,
|
||||||
|
}: WebSocketMessageParam) {
|
||||||
|
try {
|
||||||
|
const user = ws.data.user;
|
||||||
|
const service = data?.service;
|
||||||
|
const server = data?.server;
|
||||||
|
|
||||||
|
const ttyd = await grabTtydServerInfo({
|
||||||
|
server,
|
||||||
|
service,
|
||||||
|
user,
|
||||||
|
paradigm: "terminal",
|
||||||
|
});
|
||||||
|
|
||||||
|
sendData(ws, {
|
||||||
|
event: "server:service-server-shell",
|
||||||
|
ttyd,
|
||||||
|
server,
|
||||||
|
});
|
||||||
|
} catch (error: any) {
|
||||||
|
sendError(ws, "Service Server Logs Error! " + error.message);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -9,6 +9,7 @@ import socketClientPing from "./events/client-ping";
|
|||||||
import debugLog from "@moduletrace/datasquirel/dist/package-shared/utils/logging/debug-log";
|
import debugLog from "@moduletrace/datasquirel/dist/package-shared/utils/logging/debug-log";
|
||||||
import socketClientServiceServerLogs from "./events/client-service-server-logs";
|
import socketClientServiceServerLogs from "./events/client-service-server-logs";
|
||||||
import socketClientKillPort from "./events/client-kill-port";
|
import socketClientKillPort from "./events/client-kill-port";
|
||||||
|
import socketClientServiceServerShell from "./events/client-service-server-shell";
|
||||||
|
|
||||||
type Param = {
|
type Param = {
|
||||||
ws: ServerWebSocket<WebSocketData>;
|
ws: ServerWebSocket<WebSocketData>;
|
||||||
@ -47,6 +48,14 @@ export default async function socketMessage({ ws, message }: Param) {
|
|||||||
});
|
});
|
||||||
await socketClientServiceServerLogs(websocketMessageParams);
|
await socketClientServiceServerLogs(websocketMessageParams);
|
||||||
break;
|
break;
|
||||||
|
case "client:service-server-shell":
|
||||||
|
debugLog({
|
||||||
|
log: `${userRef} Getting Service Server Shell ...`,
|
||||||
|
addTime: true,
|
||||||
|
label,
|
||||||
|
});
|
||||||
|
await socketClientServiceServerShell(websocketMessageParams);
|
||||||
|
break;
|
||||||
case "client:kill-port":
|
case "client:kill-port":
|
||||||
debugLog({
|
debugLog({
|
||||||
log: `${userRef} Killing Port ${data.port} ...`,
|
log: `${userRef} Killing Port ${data.port} ...`,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user