Apply new eslint rules; default to prettier for styling
This commit is contained in:
parent
f22cce8881
commit
dc84af9937
218 changed files with 3876 additions and 3564 deletions
|
@ -11,13 +11,13 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|||
import { faExclamationTriangle } from '@fortawesome/free-solid-svg-icons';
|
||||
|
||||
const PIDLimitModalFeature = () => {
|
||||
const [ visible, setVisible ] = useState(false);
|
||||
const [ loading ] = useState(false);
|
||||
const [visible, setVisible] = useState(false);
|
||||
const [loading] = useState(false);
|
||||
|
||||
const status = ServerContext.useStoreState(state => state.status.value);
|
||||
const status = ServerContext.useStoreState((state) => state.status.value);
|
||||
const { clearFlashes } = useFlash();
|
||||
const { connected, instance } = ServerContext.useStoreState(state => state.socket);
|
||||
const isAdmin = useStoreState(state => state.user.data!.rootAdmin);
|
||||
const { connected, instance } = ServerContext.useStoreState((state) => state.socket);
|
||||
const isAdmin = useStoreState((state) => state.user.data!.rootAdmin);
|
||||
|
||||
useEffect(() => {
|
||||
if (!connected || !instance || status === 'running') return;
|
||||
|
@ -32,7 +32,7 @@ const PIDLimitModalFeature = () => {
|
|||
];
|
||||
|
||||
const listener = (line: string) => {
|
||||
if (errors.some(p => line.toLowerCase().includes(p))) {
|
||||
if (errors.some((p) => line.toLowerCase().includes(p))) {
|
||||
setVisible(true);
|
||||
}
|
||||
};
|
||||
|
@ -42,45 +42,63 @@ const PIDLimitModalFeature = () => {
|
|||
return () => {
|
||||
instance.removeListener(SocketEvent.CONSOLE_OUTPUT, listener);
|
||||
};
|
||||
}, [ connected, instance, status ]);
|
||||
}, [connected, instance, status]);
|
||||
|
||||
useEffect(() => {
|
||||
clearFlashes('feature:pidLimit');
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<Modal visible={visible} onDismissed={() => setVisible(false)} closeOnBackground={false} showSpinnerOverlay={loading}>
|
||||
<Modal
|
||||
visible={visible}
|
||||
onDismissed={() => setVisible(false)}
|
||||
closeOnBackground={false}
|
||||
showSpinnerOverlay={loading}
|
||||
>
|
||||
<FlashMessageRender key={'feature:pidLimit'} css={tw`mb-4`} />
|
||||
{isAdmin ?
|
||||
{isAdmin ? (
|
||||
<>
|
||||
<div css={tw`mt-4 sm:flex items-center`}>
|
||||
<FontAwesomeIcon css={tw`pr-4`} icon={faExclamationTriangle} color={'orange'} size={'4x'}/>
|
||||
<FontAwesomeIcon css={tw`pr-4`} icon={faExclamationTriangle} color={'orange'} size={'4x'} />
|
||||
<h2 css={tw`text-2xl mb-4 text-neutral-100 `}>Memory or process limit reached...</h2>
|
||||
</div>
|
||||
<p css={tw`mt-4`}>This server has reached the maximum process or memory limit.</p>
|
||||
<p css={tw`mt-4`}>Increasing <code css={tw`font-mono bg-neutral-900`}>container_pid_limit</code> in the wings configuration, <code css={tw`font-mono bg-neutral-900`}>config.yml</code>, might help resolve this issue.</p>
|
||||
<p css={tw`mt-4`}><b>Note: Wings must be restarted for the configuration file changes to take effect</b></p>
|
||||
<p css={tw`mt-4`}>
|
||||
Increasing <code css={tw`font-mono bg-neutral-900`}>container_pid_limit</code> in the wings
|
||||
configuration, <code css={tw`font-mono bg-neutral-900`}>config.yml</code>, might help resolve
|
||||
this issue.
|
||||
</p>
|
||||
<p css={tw`mt-4`}>
|
||||
<b>Note: Wings must be restarted for the configuration file changes to take effect</b>
|
||||
</p>
|
||||
<div css={tw`mt-8 sm:flex items-center justify-end`}>
|
||||
<Button onClick={() => setVisible(false)} css={tw`w-full sm:w-auto border-transparent`}>
|
||||
Close
|
||||
</Button>
|
||||
</div>
|
||||
</>
|
||||
:
|
||||
) : (
|
||||
<>
|
||||
<div css={tw`mt-4 sm:flex items-center`}>
|
||||
<FontAwesomeIcon css={tw`pr-4`} icon={faExclamationTriangle} color={'orange'} size={'4x'}/>
|
||||
<FontAwesomeIcon css={tw`pr-4`} icon={faExclamationTriangle} color={'orange'} size={'4x'} />
|
||||
<h2 css={tw`text-2xl mb-4 text-neutral-100`}>Possible resource limit reached...</h2>
|
||||
</div>
|
||||
<p css={tw`mt-4`}>This server is attempting to use more resources than allocated. Please contact the administrator and give them the error below.</p>
|
||||
<p css={tw`mt-4`}><code css={tw`font-mono bg-neutral-900`}>pthread_create failed, Possibly out of memory or process/resource limits reached</code></p>
|
||||
<p css={tw`mt-4`}>
|
||||
This server is attempting to use more resources than allocated. Please contact the administrator
|
||||
and give them the error below.
|
||||
</p>
|
||||
<p css={tw`mt-4`}>
|
||||
<code css={tw`font-mono bg-neutral-900`}>
|
||||
pthread_create failed, Possibly out of memory or process/resource limits reached
|
||||
</code>
|
||||
</p>
|
||||
<div css={tw`mt-8 sm:flex items-center justify-end`}>
|
||||
<Button onClick={() => setVisible(false)} css={tw`w-full sm:w-auto border-transparent`}>
|
||||
Close
|
||||
</Button>
|
||||
</div>
|
||||
</>
|
||||
}
|
||||
)}
|
||||
</Modal>
|
||||
);
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue