Skip to content

Commit 0ec9450

Browse files
committed
update
1 parent 86691c6 commit 0ec9450

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

dashboard/src/components/controls/MonitorControls.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ const fetchMetric = async (state: AppState, metric: string, setProp: SetPropFunc
3232
const type: AppState['monitorData']['type'] = Array.isArray(newHistory[0][1]) ? 'array' : 'number';
3333
setProp('type', type);
3434

35-
let minValue;
35+
let minValue = '';
3636
let maxValue;
3737

3838
if (type === 'number') {
@@ -53,7 +53,7 @@ const fetchMetric = async (state: AppState, metric: string, setProp: SetPropFunc
5353
);
5454
} else if (type === 'array') {
5555
// Just show the data in the maxValue label
56-
[, maxValue] = newHistory.slice(-1);
56+
maxValue = newHistory.slice(-1)[1].join(', ');
5757
}
5858

5959
const minTime = shortDateTime(newHistory[0][0]);

tools/cli/src/commands/apps.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable no-continue */
12
const { existsSync } = require('fs');
23
const { spawn } = require('child_process');
34
const fetch = require('node-fetch').default;
@@ -58,14 +59,15 @@ const start = async (appName) => {
5859

5960
// Check it worked
6061
console.log('Verifying launch...');
62+
// eslint-disable-next-line no-constant-condition
6163
while (true) {
6264
await wait(500);
6365

6466
try {
6567
const apps = await fetchRunningApps();
6668
const found = apps.find((p) => p.app === appName);
6769
if (found && found.status === 'OK') {
68-
console.log(`App ${appName} is running`);
70+
console.log(`App ${appName} is running`.green);
6971
clearTimeout(handle);
7072
return;
7173
}
@@ -86,6 +88,12 @@ const stop = async (appName) => {
8688
const found = apps.find((p) => p.app === appName);
8789
if (!found) throw new Error(`App ${appName} is not running`);
8890

91+
const othersRunning = apps.filter((p) => p.app !== 'conduit' && p.status === 'OK');
92+
if (appName === 'conduit' && othersRunning) {
93+
console.log('Other apps are running - stop them first'.yellow);
94+
return;
95+
}
96+
8997
const finalHost = switches.HOST || 'localhost';
9098
const { port } = found;
9199

0 commit comments

Comments
 (0)