express-status-monitor
Advanced tools
Comparing version 1.0.1 to 1.1.0
@@ -107,3 +107,3 @@ { | ||
"no-catch-shadow": "error", | ||
"no-confusing-arrow": "error", | ||
"no-confusing-arrow": "off", | ||
"no-continue": "error", | ||
@@ -110,0 +110,0 @@ "no-div-regex": "error", |
{ | ||
"name": "express-status-monitor", | ||
"version": "1.0.1", | ||
"version": "1.1.0", | ||
"description": "Realtime Monitoring for Express-based Node applications", | ||
@@ -24,2 +24,7 @@ "main": "index.js", | ||
{ | ||
"name": "Colin Cummings", | ||
"email": "colinrcummings@gmail.com", | ||
"url": "https://github.com/colinrcummings/" | ||
}, | ||
{ | ||
"name": "Ferdinand Mütsch", | ||
@@ -46,3 +51,3 @@ "email": "mail@ferdinand-muetsch.de", | ||
"dependencies": { | ||
"debug": "^2.6.9", | ||
"debug": "^2.6.8", | ||
"on-headers": "^1.0.1", | ||
@@ -73,2 +78,2 @@ "pidusage": "^1.1.6", | ||
"snyk": true | ||
} | ||
} |
@@ -8,2 +8,3 @@ # express-status-monitor | ||
[![CircleCI](https://img.shields.io/circleci/project/github/RafalWilinski/express-status-monitor/master.svg)](https://circleci.com/gh/RafalWilinski/express-status-monitor) | ||
[![Open Source Helpers](https://www.codetriage.com/rafalwilinski/express-status-monitor/badges/users.svg)](https://www.codetriage.com/rafalwilinski/express-status-monitor) | ||
@@ -30,2 +31,4 @@ Simple, self-hosted module based on Socket.io and Chart.js to report realtime server metrics for Express-based node servers. | ||
Note: This plugin works on Node versions > 4.x | ||
## Run examples | ||
@@ -56,3 +59,11 @@ | ||
retention: 60 | ||
}] | ||
}], | ||
chartVisibility: { | ||
cpu: true, | ||
mem: true, | ||
load: true, | ||
responseTime: true, | ||
rps: true, | ||
statusCodes: true | ||
} | ||
@@ -59,0 +70,0 @@ ``` |
@@ -21,2 +21,10 @@ module.exports = { | ||
iframe: false, | ||
chartVisibility: { | ||
cpu: true, | ||
mem: true, | ||
load: true, | ||
responseTime: true, | ||
rps: true, | ||
statusCodes: true | ||
} | ||
}; |
@@ -8,2 +8,11 @@ const defaultConfig = require('./default-config'); | ||
const mungeChartVisibility = configChartVisibility => { | ||
Object.keys(defaultConfig.chartVisibility).forEach(key => { | ||
if (configChartVisibility[key] === false) { | ||
defaultConfig.chartVisibility[key] = false; | ||
} | ||
}); | ||
return defaultConfig.chartVisibility; | ||
}; | ||
config.title = (typeof config.title === 'string') ? config.title : defaultConfig.title; | ||
@@ -15,4 +24,5 @@ config.path = (typeof config.path === 'string') ? config.path : defaultConfig.path; | ||
config.iframe = (typeof config.iframe === 'boolean') ? config.iframe : defaultConfig.iframe; | ||
config.chartVisibility = (typeof config.chartVisibility === 'object') ? mungeChartVisibility(config.chartVisibility) : defaultConfig.chartVisibility; | ||
return config; | ||
}; |
@@ -11,2 +11,9 @@ const fs = require('fs'); | ||
const bodyClasses = Object.keys(validatedConfig.chartVisibility).reduce((accumulator, key) => { | ||
if (config.chartVisibility[key] === false) { | ||
accumulator.push(`hide-${key}`); | ||
} | ||
return accumulator; | ||
}, []).join(' '); | ||
const renderedHtml = | ||
@@ -17,2 +24,3 @@ fs.readFileSync(path.join(__dirname, '/public/index.html')) | ||
.replace(/{{port}}/g, validatedConfig.port) | ||
.replace(/{{bodyClasses}}/g, bodyClasses) | ||
.replace(/{{script}}/g, fs.readFileSync(path.join(__dirname, '/public/javascripts/app.js'))) | ||
@@ -19,0 +27,0 @@ .replace(/{{style}}/g, fs.readFileSync(path.join(__dirname, '/public/stylesheets/style.css'))); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
114
36191
20
827
Updateddebug@^2.6.8