forked from cerc-io/laconic-console
Hide unused tabs and functionalities (#7)
* Hide unused tabs and screens * Remove dxos logo and hide system version * Hide record type buttons * Hide GQL debug button
This commit is contained in:
parent
2cff1360c7
commit
b8852830a0
@ -11,7 +11,7 @@ import Typography from '@material-ui/core/Typography';
|
||||
import blueGrey from '@material-ui/core/colors/blueGrey';
|
||||
import GraphQLIcon from '@material-ui/icons/Adb';
|
||||
|
||||
import DXOSIcon from '../icons/DXOS';
|
||||
// import LaconicIcon from '../icons/Laconic';
|
||||
import { graphqlApi } from '../client';
|
||||
|
||||
const useStyles = makeStyles((theme) => ({
|
||||
@ -51,14 +51,18 @@ const AppBar = ({ config }) => {
|
||||
<MuiAppBar position='fixed' elevation={0}>
|
||||
<Toolbar>
|
||||
<Link classes={{ root: classes.logoLink }} href='/'>
|
||||
<div className={classes.logo}>
|
||||
<DXOSIcon />
|
||||
{/* <div className={classes.logo}>
|
||||
<LaconicIcon />
|
||||
</div> */}
|
||||
<div className={classes.title}>
|
||||
<Typography variant='h6'>Laconic</Typography>
|
||||
</div>
|
||||
</Link>
|
||||
|
||||
<div className={classes.title}>
|
||||
<Typography variant='h6'>{config.app.title}</Typography>
|
||||
</div>
|
||||
<div>
|
||||
{/* <div>
|
||||
<Link
|
||||
className={classes.link}
|
||||
href={graphqlApi(config)}
|
||||
@ -68,7 +72,7 @@ const AppBar = ({ config }) => {
|
||||
>
|
||||
<GraphQLIcon />
|
||||
</Link>
|
||||
</div>
|
||||
</div> */}
|
||||
</Toolbar>
|
||||
</MuiAppBar>
|
||||
|
||||
|
@ -4,8 +4,8 @@
|
||||
|
||||
import clsx from 'clsx';
|
||||
import React from 'react';
|
||||
import { useQuery } from '@apollo/react-hooks';
|
||||
import { useHistory, useParams } from 'react-router';
|
||||
// import { useQuery } from '@apollo/react-hooks';
|
||||
|
||||
import { makeStyles } from '@material-ui/core';
|
||||
import List from '@material-ui/core/List';
|
||||
@ -14,8 +14,8 @@ import ListItemIcon from '@material-ui/core/ListItemIcon';
|
||||
import LinkIcon from '@material-ui/icons/ExitToApp';
|
||||
import ListItemText from '@material-ui/core/ListItemText';
|
||||
|
||||
import EXTENSIONS from '../gql/extensions.graphql';
|
||||
import { useQueryStatusReducer } from '../hooks';
|
||||
// import EXTENSIONS from '../gql/extensions.graphql';
|
||||
// import { useQueryStatusReducer } from '../hooks';
|
||||
|
||||
const useStyles = makeStyles(theme => ({
|
||||
root: {
|
||||
@ -48,8 +48,9 @@ const Sidebar = ({ modules: { services, settings } }) => {
|
||||
const history = useHistory();
|
||||
const { module } = useParams();
|
||||
|
||||
const { data: extensionsData } = useQueryStatusReducer(useQuery(EXTENSIONS));
|
||||
const extensions = extensionsData ? JSON.parse(extensionsData.extensions.json) : [];
|
||||
// const { data: extensionsData } = useQueryStatusReducer(useQuery(EXTENSIONS));
|
||||
// const extensions = extensionsData ? JSON.parse(extensionsData.extensions.json) : [];
|
||||
const extensions = [];
|
||||
|
||||
const isSelected = path => path === `/${module}`;
|
||||
|
||||
|
@ -19,15 +19,15 @@ import modules from '../modules';
|
||||
import Layout from './Layout';
|
||||
import ConsoleContextProvider from './ConsoleContextProvider';
|
||||
|
||||
import Apps from './panels/apps/Apps';
|
||||
import Bots from './panels/bots/Bots';
|
||||
import Kubes from './panels/kubes/Kubes';
|
||||
import Config from './panels/Config';
|
||||
import IPFS from './panels/ipfs/IPFS';
|
||||
import Metadata from './panels/Metadata';
|
||||
import Signaling from './panels/signal/Signaling';
|
||||
import System from './panels/system/System';
|
||||
import Registry from './panels/registry/Registry';
|
||||
// import Apps from './panels/apps/Apps';
|
||||
// import Bots from './panels/bots/Bots';
|
||||
// import Kubes from './panels/kubes/Kubes';
|
||||
// import IPFS from './panels/ipfs/IPFS';
|
||||
// import Metadata from './panels/Metadata';
|
||||
// import Signaling from './panels/signal/Signaling';
|
||||
// import System from './panels/system/System';
|
||||
|
||||
// Global error handler.
|
||||
const errorHandler = new ErrorHandler();
|
||||
@ -47,18 +47,18 @@ const Main = ({ config }) => {
|
||||
<Switch>
|
||||
<Route path='/:module'>
|
||||
<Layout>
|
||||
<Route path='/kubes' component={Kubes} />
|
||||
<Route path='/apps' component={Apps} />
|
||||
<Route path='/bots' component={Bots} />
|
||||
<Route path='/config' component={Config} />
|
||||
<Route path='/registry' component={Registry} />
|
||||
{/* <Route path='/kubes' component={Kubes} />
|
||||
<Route path='/apps' component={Apps} />
|
||||
<Route path='/bots' component={Bots} />
|
||||
<Route path='/ipfs' component={IPFS} />
|
||||
<Route path='/metadata' component={Metadata} />
|
||||
<Route path='/signaling' component={Signaling} />
|
||||
<Route path='/system' component={System} />
|
||||
<Route path='/system' component={System} /> */}
|
||||
</Layout>
|
||||
</Route>
|
||||
<Redirect to='/system' />
|
||||
<Redirect to='/registry' />
|
||||
</Switch>
|
||||
</HashRouter>
|
||||
</ThemeProvider>
|
||||
|
@ -20,7 +20,7 @@ import { ConsoleContext, useStatusReducer } from '../hooks';
|
||||
|
||||
import Error from '../components/Error';
|
||||
|
||||
import VersionCheck from './VersionCheck';
|
||||
// import VersionCheck from './VersionCheck';
|
||||
|
||||
const useStyles = makeStyles((theme) => ({
|
||||
root: {
|
||||
@ -110,7 +110,7 @@ const StatusBar = () => {
|
||||
|
||||
<div className={classes.center}>
|
||||
<div>{name} [{version} {moment(buildDate).format('L')}]</div>
|
||||
<VersionCheck />
|
||||
{/* <VersionCheck /> */}
|
||||
</div>
|
||||
|
||||
<div className={classes.right}>
|
||||
|
@ -9,18 +9,19 @@ import Tab from '@material-ui/core/Tab';
|
||||
import Tabs from '@material-ui/core/Tabs';
|
||||
import TabContext from '@material-ui/lab/TabContext';
|
||||
|
||||
import LogPoller from '../../../components/LogPoller';
|
||||
import Panel from '../../../components/Panel';
|
||||
import Toolbar from '../../../components/Toolbar';
|
||||
// import LogPoller from '../../../components/LogPoller';
|
||||
|
||||
import RegistryRecords, { RecordType } from './RegistryRecords';
|
||||
import RegistryLookup, { LookupType } from './RegistryLookup';
|
||||
import RegistryStatus from './RegistryStatus';
|
||||
import RegistryRecords from './RegistryRecords';
|
||||
// import RegistryRecords, { RecordType } from './RegistryRecords';
|
||||
|
||||
const TAB_RECORDS = 'records';
|
||||
const TAB_STATUS = 'status';
|
||||
const TAB_LOG = 'log';
|
||||
const TAB_LOOKUP = 'lookup';
|
||||
// const TAB_LOG = 'log';
|
||||
|
||||
const useStyles = makeStyles(() => ({
|
||||
expand: {
|
||||
@ -43,8 +44,8 @@ const useStyles = makeStyles(() => ({
|
||||
const Registry = () => {
|
||||
const classes = useStyles();
|
||||
const [tab, setTab] = useState(TAB_RECORDS);
|
||||
const [type, setType] = useState();
|
||||
const [scope, setScope] = useState(LookupType.default);
|
||||
// const [type, setType] = useState();
|
||||
|
||||
return (
|
||||
<Panel
|
||||
@ -54,12 +55,12 @@ const Registry = () => {
|
||||
<Tab value={TAB_RECORDS} label='Records' />
|
||||
<Tab value={TAB_LOOKUP} label='Lookup' />
|
||||
<Tab value={TAB_STATUS} label='Status' />
|
||||
<Tab value={TAB_LOG} label='Log' />
|
||||
{/* <Tab value={TAB_LOG} label='Log' /> */}
|
||||
</Tabs>
|
||||
|
||||
{tab === TAB_RECORDS && (
|
||||
{/* {tab === TAB_RECORDS && (
|
||||
<RecordType type={type} onChange={setType} />
|
||||
)}
|
||||
)} */}
|
||||
{tab === TAB_LOOKUP && (
|
||||
<LookupType scope={scope} onChange={setScope} />
|
||||
)}
|
||||
@ -69,7 +70,8 @@ const Registry = () => {
|
||||
<TabContext value={tab}>
|
||||
{tab === TAB_RECORDS && (
|
||||
<div className={classes.panel}>
|
||||
<RegistryRecords type={type} />
|
||||
{/* <RegistryRecords type={type} /> */}
|
||||
<RegistryRecords />
|
||||
</div>
|
||||
)}
|
||||
|
||||
@ -87,11 +89,11 @@ const Registry = () => {
|
||||
</div>
|
||||
)}
|
||||
|
||||
{tab === TAB_LOG && (
|
||||
{/* {tab === TAB_LOG && (
|
||||
<div className={classes.panel}>
|
||||
<LogPoller service='wns-lite' />
|
||||
</div>
|
||||
)}
|
||||
)} */}
|
||||
</TabContext>
|
||||
</Panel>
|
||||
);
|
||||
|
@ -2,55 +2,55 @@
|
||||
// Copyright 2020 DXOS.org
|
||||
//
|
||||
|
||||
import AppsIcon from '@material-ui/icons/Apps';
|
||||
import BotsIcon from '@material-ui/icons/Android';
|
||||
import StatsIcon from '@material-ui/icons/Equalizer';
|
||||
import RegistryIcon from '@material-ui/icons/Language';
|
||||
import IPFSIcon from '@material-ui/icons/GraphicEq';
|
||||
import ConfigIcon from '@material-ui/icons/Settings';
|
||||
import SignalIcon from '@material-ui/icons/Traffic';
|
||||
import KubeIcon from '@material-ui/icons/Dns';
|
||||
// import AppsIcon from '@material-ui/icons/Apps';
|
||||
// import BotsIcon from '@material-ui/icons/Android';
|
||||
// import StatsIcon from '@material-ui/icons/Equalizer';
|
||||
// import IPFSIcon from '@material-ui/icons/GraphicEq';
|
||||
// import SignalIcon from '@material-ui/icons/Traffic';
|
||||
// import KubeIcon from '@material-ui/icons/Dns';
|
||||
|
||||
/**
|
||||
* Paths should match Main routes.
|
||||
*/
|
||||
export default {
|
||||
services: [
|
||||
{
|
||||
path: '/system',
|
||||
title: 'System',
|
||||
icon: StatsIcon
|
||||
},
|
||||
{
|
||||
path: '/registry',
|
||||
title: 'Registry',
|
||||
icon: RegistryIcon
|
||||
},
|
||||
{
|
||||
path: '/kubes',
|
||||
title: 'KUBE Nodes',
|
||||
icon: KubeIcon
|
||||
},
|
||||
{
|
||||
path: '/apps',
|
||||
title: 'Apps',
|
||||
icon: AppsIcon
|
||||
},
|
||||
{
|
||||
path: '/bots',
|
||||
title: 'Bots',
|
||||
icon: BotsIcon
|
||||
},
|
||||
{
|
||||
path: '/signaling',
|
||||
title: 'Signaling',
|
||||
icon: SignalIcon
|
||||
},
|
||||
{
|
||||
path: '/ipfs',
|
||||
title: 'IPFS',
|
||||
icon: IPFSIcon
|
||||
}
|
||||
// {
|
||||
// path: '/system',
|
||||
// title: 'System',
|
||||
// icon: StatsIcon
|
||||
// },
|
||||
// {
|
||||
// path: '/kubes',
|
||||
// title: 'KUBE Nodes',
|
||||
// icon: KubeIcon
|
||||
// },
|
||||
// {
|
||||
// path: '/apps',
|
||||
// title: 'Apps',
|
||||
// icon: AppsIcon
|
||||
// },
|
||||
// {
|
||||
// path: '/bots',
|
||||
// title: 'Bots',
|
||||
// icon: BotsIcon
|
||||
// },
|
||||
// {
|
||||
// path: '/signaling',
|
||||
// title: 'Signaling',
|
||||
// icon: SignalIcon
|
||||
// },
|
||||
// {
|
||||
// path: '/ipfs',
|
||||
// title: 'IPFS',
|
||||
// icon: IPFSIcon
|
||||
// }
|
||||
],
|
||||
|
||||
settings: [
|
||||
|
Loading…
Reference in New Issue
Block a user