fix(striker-ui): adjust server list header, show node list in dashboard

main
Tsu-ba-me 1 year ago
parent 5d1ab29955
commit f59ed30ff6
  1. 10
      striker-ui/pages/index.tsx

@ -7,6 +7,7 @@ import { Add as AddIcon } from '@mui/icons-material';
import API_BASE_URL from '../lib/consts/API_BASE_URL'; import API_BASE_URL from '../lib/consts/API_BASE_URL';
import { DIVIDER } from '../lib/consts/DEFAULT_THEME'; import { DIVIDER } from '../lib/consts/DEFAULT_THEME';
import AnvilSummaryList from '../components/Anvils/AnvilSummaryList';
import { Preview } from '../components/Display'; import { Preview } from '../components/Display';
import fetchJSON from '../lib/fetchers/fetchJSON'; import fetchJSON from '../lib/fetchers/fetchJSON';
import Header from '../components/Header'; import Header from '../components/Header';
@ -17,6 +18,7 @@ import { Panel, PanelHeader } from '../components/Panels';
import periodicFetch from '../lib/fetchers/periodicFetch'; import periodicFetch from '../lib/fetchers/periodicFetch';
import ProvisionServerDialog from '../components/ProvisionServerDialog'; import ProvisionServerDialog from '../components/ProvisionServerDialog';
import Spinner from '../components/Spinner'; import Spinner from '../components/Spinner';
import { HeaderText } from '../components/Text';
import { last } from '../lib/time'; import { last } from '../lib/time';
type ServerListItem = ServerOverviewMetadata & { type ServerListItem = ServerOverviewMetadata & {
@ -223,6 +225,10 @@ const Dashboard: FC = () => {
) : ( ) : (
<> <>
<PanelHeader> <PanelHeader>
<HeaderText>Servers</HeaderText>
<IconButton onClick={() => setIsOpenProvisionServerDialog(true)}>
<AddIcon />
</IconButton>
<OutlinedInput <OutlinedInput
placeholder="Search by server name" placeholder="Search by server name"
onChange={({ target: { value } }) => { onChange={({ target: { value } }) => {
@ -232,9 +238,6 @@ const Dashboard: FC = () => {
sx={{ marginRight: '.6em' }} sx={{ marginRight: '.6em' }}
value={inputSearchTerm} value={inputSearchTerm}
/> />
<IconButton onClick={() => setIsOpenProvisionServerDialog(true)}>
<AddIcon />
</IconButton>
</PanelHeader> </PanelHeader>
{createServerPreviewContainer(includeServers, router)} {createServerPreviewContainer(includeServers, router)}
{includeServers.length > 0 && ( {includeServers.length > 0 && (
@ -244,6 +247,7 @@ const Dashboard: FC = () => {
</> </>
)} )}
</Panel> </Panel>
<AnvilSummaryList />
<ProvisionServerDialog <ProvisionServerDialog
dialogProps={{ open: isOpenProvisionServerDialog }} dialogProps={{ open: isOpenProvisionServerDialog }}
onClose={() => { onClose={() => {

Loading…
Cancel
Save