fix eslint issues (#3410)
This commit is contained in:
parent
76fb8d26c1
commit
725fc82657
|
@ -75,11 +75,11 @@ export default () => {
|
||||||
const webLinksAddon = new WebLinksAddon();
|
const webLinksAddon = new WebLinksAddon();
|
||||||
const scrollDownHelperAddon = new ScrollDownHelperAddon();
|
const scrollDownHelperAddon = new ScrollDownHelperAddon();
|
||||||
const { connected, instance } = ServerContext.useStoreState(state => state.socket);
|
const { connected, instance } = ServerContext.useStoreState(state => state.socket);
|
||||||
const [canSendCommands] = usePermissions(['control.console']);
|
const [ canSendCommands ] = usePermissions([ 'control.console' ]);
|
||||||
const serverId = ServerContext.useStoreState(state => state.server.data!.id);
|
const serverId = ServerContext.useStoreState(state => state.server.data!.id);
|
||||||
const isTransferring = ServerContext.useStoreState(state => state.server.data!.isTransferring);
|
const isTransferring = ServerContext.useStoreState(state => state.server.data!.isTransferring);
|
||||||
const [history, setHistory] = usePersistedState<string[]>(`${serverId}:command_history`, []);
|
const [ history, setHistory ] = usePersistedState<string[]>(`${serverId}:command_history`, []);
|
||||||
const [historyIndex, setHistoryIndex] = useState(-1);
|
const [ historyIndex, setHistoryIndex ] = useState(-1);
|
||||||
|
|
||||||
const handleConsoleOutput = (line: string, prelude = false) => terminal.writeln(
|
const handleConsoleOutput = (line: string, prelude = false) => terminal.writeln(
|
||||||
(prelude ? TERMINAL_PRELUDE : '') + line.replace(/(?:\r\n|\r|\n)$/im, '') + '\u001b[0m',
|
(prelude ? TERMINAL_PRELUDE : '') + line.replace(/(?:\r\n|\r|\n)$/im, '') + '\u001b[0m',
|
||||||
|
@ -127,7 +127,7 @@ export default () => {
|
||||||
|
|
||||||
const command = e.currentTarget.value;
|
const command = e.currentTarget.value;
|
||||||
if (e.key === 'Enter' && command.length > 0) {
|
if (e.key === 'Enter' && command.length > 0) {
|
||||||
setHistory(prevHistory => [command, ...prevHistory!].slice(0, 32));
|
setHistory(prevHistory => [ command, ...prevHistory! ].slice(0, 32));
|
||||||
setHistoryIndex(-1);
|
setHistoryIndex(-1);
|
||||||
|
|
||||||
instance && instance.send('send command', command);
|
instance && instance.send('send command', command);
|
||||||
|
@ -161,7 +161,7 @@ export default () => {
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}, [terminal, connected]);
|
}, [ terminal, connected ]);
|
||||||
|
|
||||||
useEventListener('resize', debounce(() => {
|
useEventListener('resize', debounce(() => {
|
||||||
if (terminal.element) {
|
if (terminal.element) {
|
||||||
|
@ -199,7 +199,7 @@ export default () => {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}, [connected, instance]);
|
}, [ connected, instance ]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div css={tw`text-xs font-mono relative`}>
|
<div css={tw`text-xs font-mono relative`}>
|
||||||
|
|
Loading…
Reference in New Issue