2019-06-29 06:17:29 +01:00
|
|
|
import React from 'react';
|
2019-06-30 00:14:32 +01:00
|
|
|
import Console from '@/components/server/Console';
|
2019-07-10 05:25:57 +01:00
|
|
|
import { ServerContext } from '@/state/server';
|
2019-09-18 05:59:35 +01:00
|
|
|
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
|
|
import { faServer } from '@fortawesome/free-solid-svg-icons/faServer';
|
|
|
|
import { faCircle } from '@fortawesome/free-solid-svg-icons/faCircle';
|
|
|
|
import classNames from 'classnames';
|
2019-06-29 06:17:29 +01:00
|
|
|
|
2019-06-30 00:59:50 +01:00
|
|
|
export default () => {
|
2019-09-18 05:59:35 +01:00
|
|
|
const server = ServerContext.useStoreState(state => state.server.data!);
|
2019-07-10 05:25:57 +01:00
|
|
|
const status = ServerContext.useStoreState(state => state.status.value);
|
2019-06-30 00:59:50 +01:00
|
|
|
|
|
|
|
return (
|
|
|
|
<div className={'my-10 flex'}>
|
2019-09-18 05:59:35 +01:00
|
|
|
<div className={'flex-1 ml-4'}>
|
|
|
|
<div className={'rounded shadow-md bg-neutral-700'}>
|
|
|
|
<div className={'bg-neutral-900 rounded-t p-3 border-b border-black'}>
|
|
|
|
<p className={'text-sm uppercase'}>
|
|
|
|
<FontAwesomeIcon icon={faServer} className={'mr-1 text-neutral-300'}/> {server.name}
|
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
<div className={'p-3'}>
|
|
|
|
<p className={'text-xs uppercase'}>
|
|
|
|
<FontAwesomeIcon
|
|
|
|
icon={faCircle}
|
|
|
|
className={classNames('mr-1', {
|
|
|
|
'text-red-500': status === 'offline',
|
|
|
|
'text-yellow-500': ['running', 'offline'].indexOf(status) < 0,
|
|
|
|
'text-green-500': status === 'running',
|
|
|
|
})}
|
|
|
|
/>
|
|
|
|
{status}
|
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2019-06-30 00:59:50 +01:00
|
|
|
<div className={'mx-4 w-3/4 mr-4'}>
|
|
|
|
<Console/>
|
|
|
|
</div>
|
2019-06-30 00:14:32 +01:00
|
|
|
</div>
|
2019-06-30 00:59:50 +01:00
|
|
|
);
|
|
|
|
};
|