Skip to content

Commit 56bfbbe

Browse files
committed
Color of output in mup proxy status depends on the status
1 parent e236f00 commit 56bfbbe

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/plugins/proxy/command-handlers.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ export async function status(api) {
267267
const servers = Object.keys(config.app.servers)
268268
.map(key => config.servers[key]);
269269
const lines = [];
270-
const overallColor = 'green';
270+
let overallColor = 'green';
271271

272272
const collectorConfig = {
273273
nginxDocker: {
@@ -304,6 +304,10 @@ export async function status(api) {
304304
lines.push(' - NGINX:');
305305
lines.push(` - Status: ${nginxDocker ? nginxDocker.State.Status : 'Stopped'}`);
306306

307+
if (nginxDocker && nginxDocker.State.Status !== 'running') {
308+
overallColor = 'red';
309+
}
310+
307311
if (nginxDocker) {
308312
lines.push(' - Ports:');
309313
Object.keys(nginxDocker.NetworkSettings.Ports || {}).forEach(key => {
@@ -318,6 +322,10 @@ export async function status(api) {
318322
lines.push(' - Let\'s Encrypt');
319323
lines.push(` - Status: ${letsEncryptDocker ? letsEncryptDocker.State.Status : 'Stopped'}`);
320324

325+
if (letsEncryptDocker && letsEncryptDocker.State.Status !== 'running') {
326+
overallColor = 'red';
327+
}
328+
321329
if (certificateExpire && certificateExpire.length > 0) {
322330
lines.push(' - Certificates');
323331
Object.keys(certificateExpire).forEach(key => {

0 commit comments

Comments
 (0)