forked from cerc-io/laconic-console
lint
This commit is contained in:
parent
7f5f993758
commit
d3772602c6
@ -22,7 +22,6 @@ export const graphqlApi = config => {
|
||||
* @returns {ApolloClient}
|
||||
*/
|
||||
export const clientFactory = config => {
|
||||
|
||||
// https://www.apollographql.com/docs/link/
|
||||
const link = createHttpLink({
|
||||
uri: graphqlApi(config),
|
||||
|
@ -44,23 +44,23 @@ const AppBar = ({ config }) => {
|
||||
|
||||
return (
|
||||
<>
|
||||
<MuiAppBar position="fixed">
|
||||
<MuiAppBar position='fixed'>
|
||||
<Toolbar>
|
||||
<Link href="/">
|
||||
<Link href='/'>
|
||||
<div className={classes.logo}>
|
||||
<DxOSIcon />
|
||||
</div>
|
||||
</Link>
|
||||
<div className={classes.title}>
|
||||
<Typography variant="h6">{config.app.title}</Typography>
|
||||
<Typography variant='h6'>{config.app.title}</Typography>
|
||||
</div>
|
||||
<div>
|
||||
<Link
|
||||
className={classes.link}
|
||||
href={graphqlApi(config)}
|
||||
rel="noreferrer"
|
||||
target="_blank"
|
||||
title="Console GraphQL"
|
||||
rel='noreferrer'
|
||||
target='_blank'
|
||||
title='Console GraphQL'
|
||||
>
|
||||
<GraphQLIcon />
|
||||
</Link>
|
||||
|
@ -12,19 +12,19 @@ const ControlButtons = ({ onStart, onStop, onOpen }) => {
|
||||
return (
|
||||
<div>
|
||||
{onStart && (
|
||||
<IconButton onClick={onStart} title="Restart">
|
||||
<IconButton onClick={onStart} title='Restart'>
|
||||
<StartIcon />
|
||||
</IconButton>
|
||||
)}
|
||||
|
||||
{onStop && (
|
||||
<IconButton onClick={onStop} title="Stop">
|
||||
<IconButton onClick={onStop} title='Stop'>
|
||||
<StopIcon />
|
||||
</IconButton>
|
||||
)}
|
||||
|
||||
{onOpen && (
|
||||
<IconButton onClick={onOpen} title="Open console">
|
||||
<IconButton onClick={onOpen} title='Open console'>
|
||||
<OpenIcon />
|
||||
</IconButton>
|
||||
)}
|
||||
|
@ -38,7 +38,7 @@ const Error = ({ error, ...rest }) => {
|
||||
TransitionProps={{ exit: false }}
|
||||
autoHideDuration={1000}
|
||||
>
|
||||
<Alert classes={{ root: classes.alert }} severity="error" {...rest} onClose={handleClose}>
|
||||
<Alert classes={{ root: classes.alert }} severity='error' {...rest} onClose={handleClose}>
|
||||
<AlertTitle>Error</AlertTitle>
|
||||
<div>{message}</div>
|
||||
</Alert>
|
||||
|
@ -51,9 +51,9 @@ const Log = ({ log = [] }) => {
|
||||
const classes = useStyles();
|
||||
|
||||
const levels = {
|
||||
'I': { label: 'INFO', className: classes.level_info },
|
||||
'W': { label: 'WARN', className: classes.level_warn },
|
||||
'E': { label: 'ERROR', className: classes.level_error }
|
||||
I: { label: 'INFO', className: classes.level_info },
|
||||
W: { label: 'WARN', className: classes.level_warn },
|
||||
E: { label: 'ERROR', className: classes.level_error }
|
||||
};
|
||||
|
||||
// TODO(burdon): Parse in backend and normalize numbers.
|
||||
@ -84,7 +84,7 @@ const Log = ({ log = [] }) => {
|
||||
const datetime = transform(rest).format('YYYY-MM-DD HH:mm:ss');
|
||||
const text = match[match.length - 1];
|
||||
|
||||
const { label, className } = levels[level] || levels['I'];
|
||||
const { label, className } = levels[level] || levels.I;
|
||||
const pkg = levels[level] ? '' : `[${level}]: `;
|
||||
|
||||
message = (
|
||||
|
@ -17,7 +17,7 @@ const PackageLink = ({ config, type, pkg }) => {
|
||||
// TODO(burdon): Pass in expected arg types.
|
||||
if (typeof pkg === 'string') {
|
||||
const ipfsUrl = getServiceUrl(config, 'ipfs.gateway', { path: `${pkg}` });
|
||||
return <Link href={ipfsUrl} target="ipfs">{pkg}</Link>;
|
||||
return <Link href={ipfsUrl} target='ipfs'>{pkg}</Link>;
|
||||
}
|
||||
|
||||
// eslint-disable-next-line default-case
|
||||
@ -34,7 +34,7 @@ const PackageLink = ({ config, type, pkg }) => {
|
||||
key={`${cid}`}
|
||||
href={ipfsUrl}
|
||||
title={cid}
|
||||
target="ipfs"
|
||||
target='ipfs'
|
||||
>
|
||||
{platform}/{arch}: {cid}
|
||||
</Link>
|
||||
|
@ -16,7 +16,7 @@ const useStyles = makeStyles(theme => ({
|
||||
display: 'flex',
|
||||
flex: 1,
|
||||
flexDirection: 'column',
|
||||
justifyContent: 'space-between',
|
||||
justifyContent: 'space-between'
|
||||
// backgroundColor: theme.palette.grey[100]
|
||||
},
|
||||
|
||||
@ -42,7 +42,7 @@ const Sidebar = ({ modules: { services, settings } }) => {
|
||||
const isSelected = path => path === `/${module}`;
|
||||
|
||||
const Modules = ({ modules }) => (
|
||||
<List aria-label="items" className={classes.list}>
|
||||
<List aria-label='items' className={classes.list}>
|
||||
{modules.map(({ path, title, icon: Icon }) => (
|
||||
<ListItem button selected={isSelected(path)} key={path} onClick={() => history.push(path)}>
|
||||
<ListItemIcon classes={{ root: classes.icon }}>
|
||||
|
@ -31,7 +31,7 @@ const Table = ({ children }) => {
|
||||
|
||||
return (
|
||||
<TableContainer className={classes.root}>
|
||||
<MuiTable stickyHeader size="small" className={classes.table}>
|
||||
<MuiTable stickyHeader size='small' className={classes.table}>
|
||||
{children}
|
||||
</MuiTable>
|
||||
</TableContainer>
|
||||
|
@ -44,19 +44,19 @@ const Main = ({ config }) => {
|
||||
<CssBaseline />
|
||||
<HashRouter>
|
||||
<Switch>
|
||||
<Route path="/:module">
|
||||
<Route path='/:module'>
|
||||
<Layout>
|
||||
<Route path="/apps" component={AppRecords} />
|
||||
<Route path="/bots" component={Bots} />
|
||||
<Route path="/config" component={Config} />
|
||||
<Route path="/ipfs" component={IPFS} />
|
||||
<Route path="/metadata" component={Metadata} />
|
||||
<Route path="/signaling" component={Signaling} />
|
||||
<Route path="/status" component={Status} />
|
||||
<Route path="/wns" component={WNS} />
|
||||
<Route path='/apps' component={AppRecords} />
|
||||
<Route path='/bots' component={Bots} />
|
||||
<Route path='/config' component={Config} />
|
||||
<Route path='/ipfs' component={IPFS} />
|
||||
<Route path='/metadata' component={Metadata} />
|
||||
<Route path='/signaling' component={Signaling} />
|
||||
<Route path='/status' component={Status} />
|
||||
<Route path='/wns' component={WNS} />
|
||||
</Layout>
|
||||
</Route>
|
||||
<Redirect to="/status" />
|
||||
<Redirect to='/status' />
|
||||
</Switch>
|
||||
</HashRouter>
|
||||
</ThemeProvider>
|
||||
|
@ -103,7 +103,7 @@ const StatusBar = () => {
|
||||
<>
|
||||
<Toolbar className={classes.root}>
|
||||
<div className={classes.left}>
|
||||
<Link className={classes.link} href={config.app.website} rel="noreferrer" target="_blank">
|
||||
<Link className={classes.link} href={config.app.website} rel='noreferrer' target='_blank'>
|
||||
<PublicIcon />
|
||||
</Link>
|
||||
</div>
|
||||
|
@ -13,8 +13,7 @@ const Signal = () => {
|
||||
const classes = useStyles();
|
||||
|
||||
return (
|
||||
<div className={classes.root}>
|
||||
</div>
|
||||
<div className={classes.root} />
|
||||
);
|
||||
};
|
||||
|
||||
|
@ -13,8 +13,7 @@ const Signaling = () => {
|
||||
const classes = useStyles();
|
||||
|
||||
return (
|
||||
<div className={classes.root}>
|
||||
</div>
|
||||
<div className={classes.root} />
|
||||
);
|
||||
};
|
||||
|
||||
|
@ -56,8 +56,8 @@ const AppRecords = () => {
|
||||
<TableHead>
|
||||
<TableRow>
|
||||
<TableCell onClick={sortBy('name')}>Identifier</TableCell>
|
||||
<TableCell onClick={sortBy('version')} size="small">Version</TableCell>
|
||||
<TableCell onClick={sortBy('createTime')} size="small">Created</TableCell>
|
||||
<TableCell onClick={sortBy('version')} size='small'>Version</TableCell>
|
||||
<TableCell onClick={sortBy('createTime')} size='small'>Created</TableCell>
|
||||
<TableCell onClick={sortBy('attributes.displayName')}>Name</TableCell>
|
||||
<TableCell>Link</TableCell>
|
||||
</TableRow>
|
||||
@ -67,7 +67,7 @@ const AppRecords = () => {
|
||||
const link = getAppUrl({ id, name, version, publicUrl });
|
||||
|
||||
return (
|
||||
<TableRow key={id} size="small">
|
||||
<TableRow key={id} size='small'>
|
||||
<TableCell monospace>{name}</TableCell>
|
||||
<TableCell monospace>{version}</TableCell>
|
||||
<TableCell>{moment.utc(createTime).fromNow()}</TableCell>
|
||||
|
@ -19,6 +19,7 @@ const useStyles = makeStyles(theme => ({
|
||||
}));
|
||||
|
||||
const Apps = () => {
|
||||
// eslint-disable-next-line
|
||||
const classes = useStyles();
|
||||
const [tab, setTab] = useState(TAB_RECORDS);
|
||||
|
||||
@ -27,7 +28,7 @@ const Apps = () => {
|
||||
toolbar={
|
||||
<Toolbar>
|
||||
<Tabs value={tab} onChange={(_, value) => setTab(value)}>
|
||||
<Tab value={TAB_RECORDS} label="Records" />
|
||||
<Tab value={TAB_RECORDS} label='Records' />
|
||||
</Tabs>
|
||||
</Toolbar>
|
||||
}
|
||||
|
@ -36,8 +36,8 @@ const AppRecords = () => {
|
||||
<TableHead>
|
||||
<TableRow>
|
||||
<TableCell onClick={sortBy('name')}>Identifier</TableCell>
|
||||
<TableCell onClick={sortBy('version')} size="small">Version</TableCell>
|
||||
<TableCell onClick={sortBy('createTime')} size="small">Created</TableCell>
|
||||
<TableCell onClick={sortBy('version')} size='small'>Version</TableCell>
|
||||
<TableCell onClick={sortBy('createTime')} size='small'>Created</TableCell>
|
||||
<TableCell onClick={sortBy('attributes.displayName')}>Name</TableCell>
|
||||
<TableCell />
|
||||
</TableRow>
|
||||
@ -45,7 +45,7 @@ const AppRecords = () => {
|
||||
<TableBody>
|
||||
{records.sort(sorter).map(({ id, name, version, createTime, attributes: { displayName } }) => {
|
||||
return (
|
||||
<TableRow key={id} size="small">
|
||||
<TableRow key={id} size='small'>
|
||||
<TableCell monospace>{name}</TableCell>
|
||||
<TableCell monospace>{version}</TableCell>
|
||||
<TableCell>{moment.utc(createTime).fromNow()}</TableCell>
|
||||
|
@ -19,6 +19,7 @@ const useStyles = makeStyles(theme => ({
|
||||
}));
|
||||
|
||||
const Apps = () => {
|
||||
// eslint-disable-next-line
|
||||
const classes = useStyles();
|
||||
const [tab, setTab] = useState(TAB_RECORDS);
|
||||
|
||||
@ -27,7 +28,7 @@ const Apps = () => {
|
||||
toolbar={
|
||||
<Toolbar>
|
||||
<Tabs value={tab} onChange={(_, value) => setTab(value)}>
|
||||
<Tab value={TAB_RECORDS} label="Records" />
|
||||
<Tab value={TAB_RECORDS} label='Records' />
|
||||
</Tabs>
|
||||
</Toolbar>
|
||||
}
|
||||
|
@ -48,9 +48,9 @@ const WNS = () => {
|
||||
toolbar={
|
||||
<Toolbar>
|
||||
<Tabs value={tab} onChange={(_, value) => setTab(value)}>
|
||||
<Tab value={TAB_RECORDS} label="Records" />
|
||||
<Tab value={TAB_STATUS} label="Status" />
|
||||
<Tab value={TAB_LOG} label="Log" />
|
||||
<Tab value={TAB_RECORDS} label='Records' />
|
||||
<Tab value={TAB_STATUS} label='Status' />
|
||||
<Tab value={TAB_LOG} label='Log' />
|
||||
</Tabs>
|
||||
|
||||
{tab === TAB_RECORDS && (
|
||||
|
@ -2,9 +2,8 @@
|
||||
// Copyright 2020 DxOS.org
|
||||
//
|
||||
|
||||
import get from 'lodash.get';
|
||||
import moment from 'moment';
|
||||
import React, { useContext, useState } from 'react';
|
||||
import React, { useContext } from 'react';
|
||||
import { useQuery } from '@apollo/react-hooks';
|
||||
import { makeStyles } from '@material-ui/core';
|
||||
import ButtonGroup from '@material-ui/core/ButtonGroup';
|
||||
@ -45,10 +44,10 @@ export const WNSRecordType = ({ type = types[0].key, onChanged }) => {
|
||||
<ButtonGroup
|
||||
disableRipple
|
||||
disableFocusRipple
|
||||
variant="outlined"
|
||||
color="primary"
|
||||
size="small"
|
||||
aria-label="text primary button group"
|
||||
variant='outlined'
|
||||
color='primary'
|
||||
size='small'
|
||||
aria-label='text primary button group'
|
||||
>
|
||||
{types.map(t => (
|
||||
<Button
|
||||
@ -81,10 +80,10 @@ const WNSRecords = ({ type }) => {
|
||||
<Table>
|
||||
<TableHead>
|
||||
<TableRow>
|
||||
<TableCell onClick={sortBy('type')} size="small">Type</TableCell>
|
||||
<TableCell onClick={sortBy('type')} size='small'>Type</TableCell>
|
||||
<TableCell onClick={sortBy('name')}>Identifier</TableCell>
|
||||
<TableCell onClick={sortBy('version')} size="small">Version</TableCell>
|
||||
<TableCell onClick={sortBy('createTime')} size="small">Created</TableCell>
|
||||
<TableCell onClick={sortBy('version')} size='small'>Version</TableCell>
|
||||
<TableCell onClick={sortBy('createTime')} size='small'>Created</TableCell>
|
||||
<TableCell onClick={sortBy('attributes.displayName')}>Name</TableCell>
|
||||
<TableCell onClick={sortBy('attributes.package')}>Package Hash</TableCell>
|
||||
</TableRow>
|
||||
@ -92,7 +91,7 @@ const WNSRecords = ({ type }) => {
|
||||
<TableBody>
|
||||
{records.sort(sorter)
|
||||
.map(({ id, type, name, version, createTime, attributes: { displayName, package: pkg } }) => (
|
||||
<TableRow key={id} size="small">
|
||||
<TableRow key={id} size='small'>
|
||||
<TableCell monospace>{type}</TableCell>
|
||||
<TableCell monospace>{name}</TableCell>
|
||||
<TableCell monospace>{version}</TableCell>
|
||||
|
@ -6,31 +6,31 @@ import React from 'react';
|
||||
import SvgIcon from '@material-ui/core/SvgIcon';
|
||||
|
||||
const Icon = (props) => (
|
||||
<SvgIcon {...props} viewBox="0 0 512 256">
|
||||
<g transform="matrix(1,0,0,1,-187.374,-7.5)">
|
||||
<g transform="matrix(0.936373,0,0,0.906495,295.947,135.5)">
|
||||
<SvgIcon {...props} viewBox='0 0 512 256'>
|
||||
<g transform='matrix(1,0,0,1,-187.374,-7.5)'>
|
||||
<g transform='matrix(0.936373,0,0,0.906495,295.947,135.5)'>
|
||||
<path
|
||||
d="M0,-0.233C0,-27.435 -16.74,-48.591 -48.359,-48.591L-76.722,-48.591L-76.722,48.358L-48.59,48.358C-17.902,48.358 0,26.271 0,-0.233M-109.736,77.419L-109.736,-77.652L-48.59,-77.652C0,-77.652 33.711,-46.731 33.711,-0.233C33.711,46.73 0,77.419 -48.359,77.419L-109.736,77.419Z"
|
||||
d='M0,-0.233C0,-27.435 -16.74,-48.591 -48.359,-48.591L-76.722,-48.591L-76.722,48.358L-48.59,48.358C-17.902,48.358 0,26.271 0,-0.233M-109.736,77.419L-109.736,-77.652L-48.59,-77.652C0,-77.652 33.711,-46.731 33.711,-0.233C33.711,46.73 0,77.419 -48.359,77.419L-109.736,77.419Z'
|
||||
/>
|
||||
</g>
|
||||
<g transform="matrix(0.936373,0,0,0.906495,530.058,135.499)">
|
||||
<g transform='matrix(0.936373,0,0,0.906495,530.058,135.499)'>
|
||||
<path
|
||||
d="M0,0.002C0,-29.06 -18.367,-50.914 -46.964,-50.914C-75.793,-50.914 -94.16,-29.06 -94.16,0.002C-94.16,28.83 -75.793,50.917 -46.964,50.917C-18.367,50.917 0,28.83 0,0.002M-128.104,0.002C-128.104,-46.729 -93.927,-80.208 -46.964,-80.208C-0.233,-80.208 33.942,-46.729 33.942,0.002C33.942,46.731 -0.233,80.21 -46.964,80.21C-93.927,80.21 -128.104,46.731 -128.104,0.002"
|
||||
d='M0,0.002C0,-29.06 -18.367,-50.914 -46.964,-50.914C-75.793,-50.914 -94.16,-29.06 -94.16,0.002C-94.16,28.83 -75.793,50.917 -46.964,50.917C-18.367,50.917 0,28.83 0,0.002M-128.104,0.002C-128.104,-46.729 -93.927,-80.208 -46.964,-80.208C-0.233,-80.208 33.942,-46.729 33.942,0.002C33.942,46.731 -0.233,80.21 -46.964,80.21C-93.927,80.21 -128.104,46.731 -128.104,0.002'
|
||||
/>
|
||||
</g>
|
||||
<g transform="matrix(0.936373,0,0,0.906495,573.603,85.3412)">
|
||||
<g transform='matrix(0.936373,0,0,0.906495,573.603,85.3412)'>
|
||||
<path
|
||||
d="M0,110.898L18.134,85.092C29.062,96.484 46.034,106.249 67.422,106.249C85.789,106.249 94.392,98.111 94.392,89.044C94.392,62.075 5.115,80.907 5.115,22.551C5.115,-3.255 27.434,-24.644 63.935,-24.644C88.579,-24.644 109.039,-17.204 124.383,-3.022L106.017,21.622C93.462,9.997 76.723,4.65 60.913,4.65C46.964,4.65 39.059,10.695 39.059,19.994C39.059,44.406 128.103,27.898 128.103,85.789C128.103,114.153 107.644,135.542 66.028,135.542C36.036,135.542 14.648,125.544 0,110.898"
|
||||
d='M0,110.898L18.134,85.092C29.062,96.484 46.034,106.249 67.422,106.249C85.789,106.249 94.392,98.111 94.392,89.044C94.392,62.075 5.115,80.907 5.115,22.551C5.115,-3.255 27.434,-24.644 63.935,-24.644C88.579,-24.644 109.039,-17.204 124.383,-3.022L106.017,21.622C93.462,9.997 76.723,4.65 60.913,4.65C46.964,4.65 39.059,10.695 39.059,19.994C39.059,44.406 128.103,27.898 128.103,85.789C128.103,114.153 107.644,135.542 66.028,135.542C36.036,135.542 14.648,125.544 0,110.898'
|
||||
/>
|
||||
</g>
|
||||
<g transform="matrix(0.936373,0,0,0.906495,368.158,65.109)">
|
||||
<g transform='matrix(0.936373,0,0,0.906495,368.158,65.109)'>
|
||||
<path
|
||||
d="M0,56.844L-36.496,0L36.496,0L0,56.844Z"
|
||||
d='M0,56.844L-36.496,0L36.496,0L0,56.844Z'
|
||||
/>
|
||||
</g>
|
||||
<g transform="matrix(0.936373,0,0,0.906495,368.158,205.681)">
|
||||
<g transform='matrix(0.936373,0,0,0.906495,368.158,205.681)'>
|
||||
<path
|
||||
d="M0,-56.845L-36.496,0L36.496,0L0,-56.845Z"
|
||||
d='M0,-56.845L-36.496,0L36.496,0L0,-56.845Z'
|
||||
/>
|
||||
</g>
|
||||
</g>
|
||||
|
@ -8,26 +8,26 @@ import SvgIcon from '@material-ui/core/SvgIcon';
|
||||
// TODO(burdon): Fixed color?
|
||||
|
||||
const Icon = (props) => (
|
||||
<SvgIcon {...props} viewBox="0 0 256 256">
|
||||
<g transform="matrix(1,0,0,1,-160,-124)">
|
||||
<SvgIcon {...props} viewBox='0 0 256 256'>
|
||||
<g transform='matrix(1,0,0,1,-160,-124)'>
|
||||
<path
|
||||
d="M282.254,147.134L195.254,194.589C191.399,196.692 189,200.732 189,205.124L189,298.876C189,303.268 191.399,307.308 195.254,309.411L282.254,356.866C285.836,358.819 290.164,358.819 293.746,356.866L380.746,309.411C384.601,307.308 387,303.268 387,298.876L387,205.124C387,200.732 384.601,196.692 380.746,194.589L293.746,147.134C290.164,145.181 285.836,145.181 282.254,147.134Z"
|
||||
d='M282.254,147.134L195.254,194.589C191.399,196.692 189,200.732 189,205.124L189,298.876C189,303.268 191.399,307.308 195.254,309.411L282.254,356.866C285.836,358.819 290.164,358.819 293.746,356.866L380.746,309.411C384.601,307.308 387,303.268 387,298.876L387,205.124C387,200.732 384.601,196.692 380.746,194.589L293.746,147.134C290.164,145.181 285.836,145.181 282.254,147.134Z'
|
||||
style={{ fill: 'none', fillRule: 'nonzero', stroke: 'rgb(0,68,121)', strokeWidth: '12px' }}
|
||||
/>
|
||||
<path
|
||||
d="M288,252L216,216"
|
||||
d='M288,252L216,216'
|
||||
style={{ fill: 'none', fillRule: 'nonzero', stroke: 'rgb(0,68,121)', strokeWidth: '8px', strokeLinejoin: 'round' }}
|
||||
/>
|
||||
<path
|
||||
d="M216,288L288,252"
|
||||
d='M216,288L288,252'
|
||||
style={{ fill: 'none', fillRule: 'nonzero', stroke: 'rgb(0,68,121)', strokeWidth: '8px', strokeLinejoin: 'round' }}
|
||||
/>
|
||||
<path
|
||||
d="M360,288L288,252"
|
||||
d='M360,288L288,252'
|
||||
style={{ fill: 'none', fillRule: 'nonzero', stroke: 'rgb(0,68,121)', strokeWidth: '8px', strokeLinejoin: 'round' }}
|
||||
/>
|
||||
<path
|
||||
d="M360,216L288,252"
|
||||
d='M360,216L288,252'
|
||||
style={{ fill: 'none', fillRule: 'nonzero', stroke: 'rgb(0,68,121)', strokeWidth: '8px', strokeLinejoin: 'round' }}
|
||||
/>
|
||||
</g>
|
||||
|
@ -13,7 +13,7 @@ export const omitDeep = (value, key) => {
|
||||
}
|
||||
|
||||
return Object.assign({
|
||||
[k]: omitDeep(value[k], key),
|
||||
[k]: omitDeep(value[k], key)
|
||||
}, newObject);
|
||||
}, {});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user