mirror of
https://github.com/portainer/portainer.git
synced 2025-07-21 22:39:41 +02:00
fix(websocket): abort websocket when logout EE-6058 (#10372)
This commit is contained in:
parent
9440aa733d
commit
56ab19433a
15 changed files with 227 additions and 49 deletions
|
@ -3,7 +3,7 @@ import { useCurrentStateAndParams } from '@uirouter/react';
|
|||
import { Terminal as TerminalIcon } from 'lucide-react';
|
||||
import { Terminal } from 'xterm';
|
||||
|
||||
import { useLocalStorage } from '@/react/hooks/useLocalStorage';
|
||||
import { get } from '@/react/hooks/useLocalStorage';
|
||||
import { baseHref } from '@/portainer/helpers/pathHelper';
|
||||
import { notifyError } from '@/portainer/services/notifications';
|
||||
|
||||
|
@ -27,7 +27,6 @@ export function ConsoleView() {
|
|||
},
|
||||
} = useCurrentStateAndParams();
|
||||
|
||||
const [jwtToken] = useLocalStorage('JWT', '');
|
||||
const [command, setCommand] = useState('/bin/sh');
|
||||
const [connectionStatus, setConnectionStatus] = useState('closed');
|
||||
const [terminal, setTerminal] = useState(null as Terminal | null);
|
||||
|
@ -170,6 +169,8 @@ export function ConsoleView() {
|
|||
);
|
||||
|
||||
function connectConsole() {
|
||||
const jwtToken = get('JWT', '');
|
||||
|
||||
const params: StringDictionary = {
|
||||
token: jwtToken,
|
||||
endpointId: environmentId,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue