(type: 'ps' | 'net')
| 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 { |
no outgoing calls
no test coverage detected