fix eslint issues (#3410)

This commit is contained in:
Fabian 2021-06-12 19:46:10 +02:00 committed by GitHub
parent 76fb8d26c1
commit 725fc82657
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 15 deletions

View file

@ -132,13 +132,13 @@ export default ({ server, className }: { server: Server; className?: string }) =
:
<React.Fragment>
<div css={tw`flex-1 ml-4 sm:block hidden`}>
<div css={tw`flex justify-center`}>
<Icon icon={faMicrochip} $alarm={alarms.cpu}/>
<IconDescription $alarm={alarms.cpu}>
{stats.cpuUsagePercent.toFixed(2)} %
</IconDescription>
</div>
<p css={tw`text-xs text-neutral-600 text-center mt-1`}>of {cpuLimit}</p>
<div css={tw`flex justify-center`}>
<Icon icon={faMicrochip} $alarm={alarms.cpu}/>
<IconDescription $alarm={alarms.cpu}>
{stats.cpuUsagePercent.toFixed(2)} %
</IconDescription>
</div>
<p css={tw`text-xs text-neutral-600 text-center mt-1`}>of {cpuLimit}</p>
</div>
<div css={tw`flex-1 ml-4 sm:block hidden`}>
<div css={tw`flex justify-center`}>
@ -164,4 +164,4 @@ export default ({ server, className }: { server: Server; className?: string }) =
<div className={'status-bar'}/>
</StatusIndicatorBox>
);
};
};

View file

@ -75,11 +75,11 @@ export default () => {
const webLinksAddon = new WebLinksAddon();
const scrollDownHelperAddon = new ScrollDownHelperAddon();
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 isTransferring = ServerContext.useStoreState(state => state.server.data!.isTransferring);
const [history, setHistory] = usePersistedState<string[]>(`${serverId}:command_history`, []);
const [historyIndex, setHistoryIndex] = useState(-1);
const [ history, setHistory ] = usePersistedState<string[]>(`${serverId}:command_history`, []);
const [ historyIndex, setHistoryIndex ] = useState(-1);
const handleConsoleOutput = (line: string, prelude = false) => terminal.writeln(
(prelude ? TERMINAL_PRELUDE : '') + line.replace(/(?:\r\n|\r|\n)$/im, '') + '\u001b[0m',
@ -127,7 +127,7 @@ export default () => {
const command = e.currentTarget.value;
if (e.key === 'Enter' && command.length > 0) {
setHistory(prevHistory => [command, ...prevHistory!].slice(0, 32));
setHistory(prevHistory => [ command, ...prevHistory! ].slice(0, 32));
setHistoryIndex(-1);
instance && instance.send('send command', command);
@ -161,7 +161,7 @@ export default () => {
return true;
});
}
}, [terminal, connected]);
}, [ terminal, connected ]);
useEventListener('resize', debounce(() => {
if (terminal.element) {
@ -199,7 +199,7 @@ export default () => {
});
}
};
}, [connected, instance]);
}, [ connected, instance ]);
return (
<div css={tw`text-xs font-mono relative`}>

View file

@ -99,7 +99,7 @@ const EditSubuserModal = ({ subuser }: Props) => {
<h2 css={tw`text-2xl`} ref={ref}>
{subuser ? `${canEditUser ? 'Modify' : 'View'} permissions for ${subuser.email}` : 'Create new subuser'}
</h2>
<div>
<div>
<Button type={'submit'} css={tw`w-full sm:w-auto`}>
{subuser ? 'Save' : 'Invite User'}
</Button>