forked from cerc-io/laconic-console
Fix
This commit is contained in:
parent
9ea39b6088
commit
425fd757a0
@ -6,13 +6,14 @@
|
|||||||
app:
|
app:
|
||||||
title: 'Console'
|
title: 'Console'
|
||||||
org': 'DxOS'
|
org': 'DxOS'
|
||||||
theme: 'light'
|
theme: 'dark'
|
||||||
website: 'https://dxos.org'
|
website: 'https://dxos.org'
|
||||||
publicUrl: '/console'
|
publicUrl: '/console'
|
||||||
|
|
||||||
api:
|
api:
|
||||||
path: '/api'
|
path: '/api'
|
||||||
port: 4000
|
port: 4000
|
||||||
|
intervalLog: 5000
|
||||||
pollInterval: 10000
|
pollInterval: 10000
|
||||||
|
|
||||||
system:
|
system:
|
||||||
|
@ -11,11 +11,14 @@ const useStyles = makeStyles(theme => ({
|
|||||||
root: {
|
root: {
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
flex: 1,
|
flex: 1,
|
||||||
flexDirection: 'column'
|
flexDirection: 'column',
|
||||||
|
overflow: 'hidden'
|
||||||
},
|
},
|
||||||
|
|
||||||
container: {
|
container: {
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
|
// Pin to bottom (render in time order).
|
||||||
|
flexDirection: 'column-reverse',
|
||||||
flex: 1,
|
flex: 1,
|
||||||
overflowX: 'scroll',
|
overflowX: 'scroll',
|
||||||
overflowY: 'scroll'
|
overflowY: 'scroll'
|
||||||
@ -24,13 +27,13 @@ const useStyles = makeStyles(theme => ({
|
|||||||
log: {
|
log: {
|
||||||
padding: theme.spacing(1),
|
padding: theme.spacing(1),
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
// fontFamily: 'monospace',
|
fontFamily: 'monospace',
|
||||||
whiteSpace: 'nowrap'
|
whiteSpace: 'nowrap'
|
||||||
},
|
},
|
||||||
|
|
||||||
level: {
|
level: {
|
||||||
display: 'inline-block',
|
display: 'inline-block',
|
||||||
width: 48,
|
width: 60,
|
||||||
marginRight: 8,
|
marginRight: 8,
|
||||||
color: theme.palette.grey[500]
|
color: theme.palette.grey[500]
|
||||||
},
|
},
|
||||||
|
@ -16,7 +16,7 @@ import Toolbar from '../../components/Toolbar';
|
|||||||
|
|
||||||
const Status = () => {
|
const Status = () => {
|
||||||
const { config } = useContext(ConsoleContext);
|
const { config } = useContext(ConsoleContext);
|
||||||
const data = useQueryStatusReducer(useQuery(SYSTEM_STATUS, { pollInterval: config.api.pollInterval }));
|
const data = useQueryStatusReducer(useQuery(SYSTEM_STATUS, { pollInterval: config.api.intervalQuery }));
|
||||||
if (!data) {
|
if (!data) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,7 @@ const AppRecords = () => {
|
|||||||
const { config } = useContext(ConsoleContext);
|
const { config } = useContext(ConsoleContext);
|
||||||
const [sorter, sortBy] = useSorter('createTime', false);
|
const [sorter, sortBy] = useSorter('createTime', false);
|
||||||
const data = useQueryStatusReducer(useQuery(WNS_RECORDS, {
|
const data = useQueryStatusReducer(useQuery(WNS_RECORDS, {
|
||||||
pollInterval: config.api.pollInterval,
|
pollInterval: config.api.intervalQuery,
|
||||||
variables: { type: 'wrn:app' }
|
variables: { type: 'wrn:app' }
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@ const AppRecords = () => {
|
|||||||
const { config } = useContext(ConsoleContext);
|
const { config } = useContext(ConsoleContext);
|
||||||
const [sorter, sortBy] = useSorter('createTime', false);
|
const [sorter, sortBy] = useSorter('createTime', false);
|
||||||
const data = useQueryStatusReducer(useQuery(WNS_RECORDS, {
|
const data = useQueryStatusReducer(useQuery(WNS_RECORDS, {
|
||||||
pollInterval: config.api.pollInterval,
|
pollInterval: config.api.intervalQuery,
|
||||||
variables: { type: 'wrn:bot' }
|
variables: { type: 'wrn:bot' }
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@ import Log from '../../../components/Log';
|
|||||||
|
|
||||||
const WNSLog = () => {
|
const WNSLog = () => {
|
||||||
const { config } = useContext(ConsoleContext);
|
const { config } = useContext(ConsoleContext);
|
||||||
const data = useQueryStatusReducer(useQuery(WNS_LOG, { pollInterval: config.api.pollInterval }));
|
const data = useQueryStatusReducer(useQuery(WNS_LOG, { pollInterval: config.api.intervalLog }));
|
||||||
if (!data) {
|
if (!data) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -66,7 +66,7 @@ const WNSRecords = ({ type }) => {
|
|||||||
const { config } = useContext(ConsoleContext);
|
const { config } = useContext(ConsoleContext);
|
||||||
const [sorter, sortBy] = useSorter('createTime', false);
|
const [sorter, sortBy] = useSorter('createTime', false);
|
||||||
const data = useQueryStatusReducer(useQuery(WNS_RECORDS, {
|
const data = useQueryStatusReducer(useQuery(WNS_RECORDS, {
|
||||||
pollInterval: config.api.pollInterval,
|
pollInterval: config.api.intervalQuery,
|
||||||
variables: { type }
|
variables: { type }
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@ import Json from '../../../components/Json';
|
|||||||
|
|
||||||
const WNSStatus = () => {
|
const WNSStatus = () => {
|
||||||
const { config } = useContext(ConsoleContext);
|
const { config } = useContext(ConsoleContext);
|
||||||
const data = useQueryStatusReducer(useQuery(WNS_STATUS, { pollInterval: config.api.pollInterval }));
|
const data = useQueryStatusReducer(useQuery(WNS_STATUS, { pollInterval: config.api.intervalQuery }));
|
||||||
if (!data) {
|
if (!data) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -52,6 +52,7 @@ export const createResolvers = config => {
|
|||||||
wns_log: async () => {
|
wns_log: async () => {
|
||||||
log('WNS log...');
|
log('WNS log...');
|
||||||
|
|
||||||
|
// TODO(burdon): Cache and merge previous state.
|
||||||
const data = await registry.getLogs();
|
const data = await registry.getLogs();
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"build": {
|
"build": {
|
||||||
"name": "@dxos/console-client",
|
"name": "@dxos/console-client",
|
||||||
"buildDate": "2020-05-26T12:54:32.629Z",
|
"buildDate": "2020-05-26T17:38:45.688Z",
|
||||||
"version": "1.0.0-beta.0"
|
"version": "1.0.0-beta.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -47,6 +47,7 @@ const app = express();
|
|||||||
|
|
||||||
const { app: { publicUrl } } = config;
|
const { app: { publicUrl } } = config;
|
||||||
|
|
||||||
|
// TODO(burdon): Load via WNS.
|
||||||
app.get(`${publicUrl}(/:filePath)?`, (req, res) => {
|
app.get(`${publicUrl}(/:filePath)?`, (req, res) => {
|
||||||
const { filePath = 'index.html' } = req.params;
|
const { filePath = 'index.html' } = req.params;
|
||||||
const file = path.join(__dirname, '../../../node_modules/@dxos/console-client/dist/production', filePath);
|
const file = path.join(__dirname, '../../../node_modules/@dxos/console-client/dist/production', filePath);
|
||||||
|
Loading…
Reference in New Issue
Block a user