mirror of
https://github.com/pterodactyl/panel.git
synced 2024-11-23 01:22:30 +01:00
Update Console.tsx
This commit is contained in:
parent
28844bf62c
commit
8f2e90d1e8
@ -60,7 +60,7 @@ export default () => {
|
|||||||
const terminal = useMemo(() => new Terminal({ ...terminalProps }), []);
|
const terminal = useMemo(() => new Terminal({ ...terminalProps }), []);
|
||||||
const fitAddon = new FitAddon();
|
const fitAddon = new FitAddon();
|
||||||
const searchAddon = new SearchAddon();
|
const searchAddon = new SearchAddon();
|
||||||
const SearchBar = new SearchBarAddon({ searchAddon });
|
const searchBar = new SearchBarAddon({ searchAddon });
|
||||||
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' ]);
|
||||||
|
|
||||||
@ -90,7 +90,7 @@ export default () => {
|
|||||||
terminal.open(ref.current);
|
terminal.open(ref.current);
|
||||||
terminal.loadAddon(fitAddon);
|
terminal.loadAddon(fitAddon);
|
||||||
terminal.loadAddon(searchAddon);
|
terminal.loadAddon(searchAddon);
|
||||||
terminal.loadAddon(SearchBar);
|
terminal.loadAddon(searchBar);
|
||||||
fitAddon.fit();
|
fitAddon.fit();
|
||||||
|
|
||||||
// Add support for capturing keys
|
// Add support for capturing keys
|
||||||
@ -102,12 +102,12 @@ export default () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (e.ctrlKey && e.key === 'f') {
|
if (e.ctrlKey && e.key === 'f') {
|
||||||
SearchBar.show();
|
searchBar.show();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (e.key === 'Escape') {
|
if (e.key === 'Escape') {
|
||||||
SearchBar.hidden();
|
searchBar.hidden();
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user