fix eslint issues (#3410)
This commit is contained in:
parent
76fb8d26c1
commit
725fc82657
|
@ -132,13 +132,13 @@ export default ({ server, className }: { server: Server; className?: string }) =
|
||||||
:
|
:
|
||||||
<React.Fragment>
|
<React.Fragment>
|
||||||
<div css={tw`flex-1 ml-4 sm:block hidden`}>
|
<div css={tw`flex-1 ml-4 sm:block hidden`}>
|
||||||
<div css={tw`flex justify-center`}>
|
<div css={tw`flex justify-center`}>
|
||||||
<Icon icon={faMicrochip} $alarm={alarms.cpu}/>
|
<Icon icon={faMicrochip} $alarm={alarms.cpu}/>
|
||||||
<IconDescription $alarm={alarms.cpu}>
|
<IconDescription $alarm={alarms.cpu}>
|
||||||
{stats.cpuUsagePercent.toFixed(2)} %
|
{stats.cpuUsagePercent.toFixed(2)} %
|
||||||
</IconDescription>
|
</IconDescription>
|
||||||
</div>
|
</div>
|
||||||
<p css={tw`text-xs text-neutral-600 text-center mt-1`}>of {cpuLimit}</p>
|
<p css={tw`text-xs text-neutral-600 text-center mt-1`}>of {cpuLimit}</p>
|
||||||
</div>
|
</div>
|
||||||
<div css={tw`flex-1 ml-4 sm:block hidden`}>
|
<div css={tw`flex-1 ml-4 sm:block hidden`}>
|
||||||
<div css={tw`flex justify-center`}>
|
<div css={tw`flex justify-center`}>
|
||||||
|
|
|
@ -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`}>
|
||||||
|
|
|
@ -99,7 +99,7 @@ const EditSubuserModal = ({ subuser }: Props) => {
|
||||||
<h2 css={tw`text-2xl`} ref={ref}>
|
<h2 css={tw`text-2xl`} ref={ref}>
|
||||||
{subuser ? `${canEditUser ? 'Modify' : 'View'} permissions for ${subuser.email}` : 'Create new subuser'}
|
{subuser ? `${canEditUser ? 'Modify' : 'View'} permissions for ${subuser.email}` : 'Create new subuser'}
|
||||||
</h2>
|
</h2>
|
||||||
<div>
|
<div>
|
||||||
<Button type={'submit'} css={tw`w-full sm:w-auto`}>
|
<Button type={'submit'} css={tw`w-full sm:w-auto`}>
|
||||||
{subuser ? 'Save' : 'Invite User'}
|
{subuser ? 'Save' : 'Invite User'}
|
||||||
</Button>
|
</Button>
|
||||||
|
|
Loading…
Reference in New Issue