MCPcopy Create free account
hub / github.com/1Panel-dev/1Panel / doSendMessage

Function doSendMessage

frontend/src/store/modules/process.ts:67–92  ·  view source on GitHub ↗
(type: 'ps' | 'net')

Source from the content-addressed store, hash-verified

65 };
66
67 const doSendMessage = (type: 'ps' | 'net') => {
68 pendingRequestType = type;
69
70 if (type === 'ps') {
71 isPsFetching.value = true;
72 psLoading.value = psData.value.length === 0;
73
74 const searchParams = { ...psSearch };
75 if (typeof searchParams.pid === 'string') {
76 searchParams.pid = Number(searchParams.pid);
77 }
78 websocket!.send(JSON.stringify(searchParams));
79 } else {
80 isNetFetching.value = true;
81 netLoading.value = netData.value.length === 0;
82
83 const searchParams = { ...netSearch };
84 if (typeof searchParams.processID === 'string') {
85 searchParams.processID = Number(searchParams.processID);
86 }
87 if (typeof searchParams.port === 'string') {
88 searchParams.port = Number(searchParams.port);
89 }
90 websocket!.send(JSON.stringify(searchParams));
91 }
92 };
93
94 const onMessage = (event: MessageEvent) => {
95 try {

Callers 3

onMessageFunction · 0.85
sendPsMessageFunction · 0.85
sendNetMessageFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected