From 425fd757a03bf8807aadaf41583ef83266b79341 Mon Sep 17 00:00:00 2001 From: richburdon Date: Tue, 26 May 2020 17:31:07 -0400 Subject: [PATCH] Fix --- packages/console-client/config.yml | 3 ++- packages/console-client/src/components/Log.js | 9 ++++++--- packages/console-client/src/containers/panels/Status.js | 2 +- .../src/containers/panels/apps/AppRecords.js | 2 +- .../src/containers/panels/bots/BotRecords.js | 2 +- .../console-client/src/containers/panels/wns/WNSLog.js | 2 +- .../src/containers/panels/wns/WNSRecords.js | 2 +- .../src/containers/panels/wns/WNSStatus.js | 2 +- packages/console-client/src/resolvers.js | 1 + packages/console-client/version.json | 2 +- packages/console-server/src/main.js | 1 + 11 files changed, 17 insertions(+), 11 deletions(-) diff --git a/packages/console-client/config.yml b/packages/console-client/config.yml index 0542f06..9f1c389 100644 --- a/packages/console-client/config.yml +++ b/packages/console-client/config.yml @@ -6,13 +6,14 @@ app: title: 'Console' org': 'DxOS' - theme: 'light' + theme: 'dark' website: 'https://dxos.org' publicUrl: '/console' api: path: '/api' port: 4000 + intervalLog: 5000 pollInterval: 10000 system: diff --git a/packages/console-client/src/components/Log.js b/packages/console-client/src/components/Log.js index 4c41453..b25c6f4 100644 --- a/packages/console-client/src/components/Log.js +++ b/packages/console-client/src/components/Log.js @@ -11,11 +11,14 @@ const useStyles = makeStyles(theme => ({ root: { display: 'flex', flex: 1, - flexDirection: 'column' + flexDirection: 'column', + overflow: 'hidden' }, container: { display: 'flex', + // Pin to bottom (render in time order). + flexDirection: 'column-reverse', flex: 1, overflowX: 'scroll', overflowY: 'scroll' @@ -24,13 +27,13 @@ const useStyles = makeStyles(theme => ({ log: { padding: theme.spacing(1), fontSize: 16, - // fontFamily: 'monospace', + fontFamily: 'monospace', whiteSpace: 'nowrap' }, level: { display: 'inline-block', - width: 48, + width: 60, marginRight: 8, color: theme.palette.grey[500] }, diff --git a/packages/console-client/src/containers/panels/Status.js b/packages/console-client/src/containers/panels/Status.js index 89aca56..905db83 100644 --- a/packages/console-client/src/containers/panels/Status.js +++ b/packages/console-client/src/containers/panels/Status.js @@ -16,7 +16,7 @@ import Toolbar from '../../components/Toolbar'; const Status = () => { 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) { return null; } diff --git a/packages/console-client/src/containers/panels/apps/AppRecords.js b/packages/console-client/src/containers/panels/apps/AppRecords.js index d0b43fa..ef524d7 100644 --- a/packages/console-client/src/containers/panels/apps/AppRecords.js +++ b/packages/console-client/src/containers/panels/apps/AppRecords.js @@ -24,7 +24,7 @@ const AppRecords = () => { const { config } = useContext(ConsoleContext); const [sorter, sortBy] = useSorter('createTime', false); const data = useQueryStatusReducer(useQuery(WNS_RECORDS, { - pollInterval: config.api.pollInterval, + pollInterval: config.api.intervalQuery, variables: { type: 'wrn:app' } })); diff --git a/packages/console-client/src/containers/panels/bots/BotRecords.js b/packages/console-client/src/containers/panels/bots/BotRecords.js index 3c501ea..5e60b6c 100644 --- a/packages/console-client/src/containers/panels/bots/BotRecords.js +++ b/packages/console-client/src/containers/panels/bots/BotRecords.js @@ -21,7 +21,7 @@ const AppRecords = () => { const { config } = useContext(ConsoleContext); const [sorter, sortBy] = useSorter('createTime', false); const data = useQueryStatusReducer(useQuery(WNS_RECORDS, { - pollInterval: config.api.pollInterval, + pollInterval: config.api.intervalQuery, variables: { type: 'wrn:bot' } })); diff --git a/packages/console-client/src/containers/panels/wns/WNSLog.js b/packages/console-client/src/containers/panels/wns/WNSLog.js index af4fac2..8150a2a 100644 --- a/packages/console-client/src/containers/panels/wns/WNSLog.js +++ b/packages/console-client/src/containers/panels/wns/WNSLog.js @@ -13,7 +13,7 @@ import Log from '../../../components/Log'; const WNSLog = () => { 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) { return null; } diff --git a/packages/console-client/src/containers/panels/wns/WNSRecords.js b/packages/console-client/src/containers/panels/wns/WNSRecords.js index adda768..4a37d02 100644 --- a/packages/console-client/src/containers/panels/wns/WNSRecords.js +++ b/packages/console-client/src/containers/panels/wns/WNSRecords.js @@ -66,7 +66,7 @@ const WNSRecords = ({ type }) => { const { config } = useContext(ConsoleContext); const [sorter, sortBy] = useSorter('createTime', false); const data = useQueryStatusReducer(useQuery(WNS_RECORDS, { - pollInterval: config.api.pollInterval, + pollInterval: config.api.intervalQuery, variables: { type } })); diff --git a/packages/console-client/src/containers/panels/wns/WNSStatus.js b/packages/console-client/src/containers/panels/wns/WNSStatus.js index 7efac28..28d0804 100644 --- a/packages/console-client/src/containers/panels/wns/WNSStatus.js +++ b/packages/console-client/src/containers/panels/wns/WNSStatus.js @@ -13,7 +13,7 @@ import Json from '../../../components/Json'; const WNSStatus = () => { 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) { return null; } diff --git a/packages/console-client/src/resolvers.js b/packages/console-client/src/resolvers.js index 8b6efe3..2447af4 100644 --- a/packages/console-client/src/resolvers.js +++ b/packages/console-client/src/resolvers.js @@ -52,6 +52,7 @@ export const createResolvers = config => { wns_log: async () => { log('WNS log...'); + // TODO(burdon): Cache and merge previous state. const data = await registry.getLogs(); return { diff --git a/packages/console-client/version.json b/packages/console-client/version.json index 474e144..9e9a3ed 100644 --- a/packages/console-client/version.json +++ b/packages/console-client/version.json @@ -1,7 +1,7 @@ { "build": { "name": "@dxos/console-client", - "buildDate": "2020-05-26T12:54:32.629Z", + "buildDate": "2020-05-26T17:38:45.688Z", "version": "1.0.0-beta.0" } } diff --git a/packages/console-server/src/main.js b/packages/console-server/src/main.js index b156427..b4bc6dc 100644 --- a/packages/console-server/src/main.js +++ b/packages/console-server/src/main.js @@ -47,6 +47,7 @@ const app = express(); const { app: { publicUrl } } = config; +// TODO(burdon): Load via WNS. app.get(`${publicUrl}(/:filePath)?`, (req, res) => { const { filePath = 'index.html' } = req.params; const file = path.join(__dirname, '../../../node_modules/@dxos/console-client/dist/production', filePath);