config-monitor
Advanced tools
Comparing version 0.1.0 to 0.1.1
{ | ||
"hello": "in", | ||
"a": "c" | ||
"hello": "init", | ||
"a": "callforit" | ||
} |
@@ -0,1 +1,7 @@ | ||
0.1.1 / 10-21-2012 | ||
================== | ||
* Separate basic view from view with sources | ||
* A better README.md | ||
0.1.0 / 10-20-2012 | ||
@@ -2,0 +8,0 @@ ================== |
@@ -10,4 +10,3 @@ // Config.js (c) 2013 Derrick West | ||
UI = Monitor.UI, | ||
Backbone = Monitor.Backbone, | ||
_ = Monitor._; | ||
Backbone = Monitor.Backbone; | ||
@@ -25,12 +24,9 @@ // Define the app on first load | ||
*/ | ||
var Config= UI.app.config.Config= Backbone.View.extend({ | ||
var Config = UI.app.config.Config = Backbone.View.extend({ | ||
// Define the view | ||
name: 'Config Monitor', | ||
name: 'Current Configuration', | ||
icon: 'image/configicon.png', | ||
description: 'Monitor your application configurations', | ||
defaultOptions: { | ||
title: 'Configurations', | ||
background: true | ||
}, | ||
tags: ['Configuration', 'Utility'], | ||
description: 'A view of the current configuration', | ||
@@ -42,4 +38,4 @@ initialize: function(options) { | ||
options.component.setDefaultSize({ | ||
width: 600, | ||
height: 600 | ||
width: 400, | ||
height: 300 | ||
}); | ||
@@ -54,2 +50,3 @@ | ||
// Update the view on monitor change | ||
if (t.monitor != null) { | ||
@@ -60,39 +57,6 @@ t.monitor.on('change', t.onchange, t); | ||
events: { | ||
}, | ||
render: function() { | ||
var t = this; | ||
}, | ||
onchange: function() { | ||
var t = this; | ||
t.$el.html(''); | ||
t.renderSection('Computed Config', 'Active configuration', t.monitor.get('config')); | ||
var sources = t.monitor.get('sources'); | ||
for (var i = sources.length - 1; i >= 0; i--) { | ||
var source = sources[i], | ||
parts = source.name.split(/[\/\\]/), | ||
heading = parts[parts.length - 1], | ||
title = source.name; | ||
// Put File: in front of files | ||
if (heading.length < source.name.length) { | ||
heading = 'File: ' + heading; | ||
} | ||
// Better tooltips | ||
if (heading === 'Module Defaults') { | ||
title = 'From calling setModuleDefaults()'; | ||
} | ||
if (heading === '$NODE_CONFIG') { | ||
title = 'From the $NODE_CONFIG environment variable'; | ||
} | ||
t.renderSection(heading, title, source.parsed); | ||
} | ||
// Add tool tips | ||
UI.tooltip(t.$('*[title]')); | ||
t.renderSection('', '', t.monitor.get('config')); | ||
}, | ||
@@ -103,7 +67,12 @@ | ||
// Create the process info view, deferring render until we get real data | ||
var viewTarget = t.$el.append( | ||
'<div class="nm-app-config-heading" title="' + title + '">' + heading + '</div>' + | ||
'<div class="nm-app-config-configs"></div>' | ||
).find('.nm-app-config-configs').last(); | ||
// Create the heading if specified | ||
var viewTarget = t.$el; | ||
if (heading) { | ||
viewTarget = t.$el.append( | ||
'<div class="nm-app-config-heading" title="' + title + '">' + heading + '</div>' + | ||
'<div class="nm-app-config-configs"></div>' | ||
).find('.nm-app-config-configs').last(); | ||
} | ||
// Append the JSON data viewer | ||
t.jsonView = new UI.JsonView({ | ||
@@ -114,3 +83,2 @@ model: data | ||
viewTarget.append(t.jsonView.$el); | ||
} | ||
@@ -123,12 +91,4 @@ | ||
initialize: function(options) { | ||
var t = this; | ||
}, | ||
events: { | ||
}, | ||
render: function() { | ||
var t = this; | ||
t.monitor = t.options.monitor; | ||
@@ -139,3 +99,3 @@ // Append a monitor picker | ||
hideProbe: true, | ||
model: t.monitor | ||
model: t.options.monitor | ||
}); | ||
@@ -147,2 +107,2 @@ t.monitorPicker.render(); | ||
}(this)); | ||
}(this)); |
{ | ||
"name": "config-monitor", | ||
"description": "Monitoring for the config module", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"main": "lib/index.js", | ||
@@ -6,0 +6,0 @@ "author": "Derrick West <open_source@derrickwest.com>", |
config-monitor | ||
============== | ||
Monitoring for the node-config module. | ||
Node-Monitor add-on for the npm config module. | ||
Adding To Your App | ||
------------------- | ||
Probes are added to your application by specifying monitor-min and config-monitor as dependencies within your package.json file | ||
"dependencies": { | ||
... | ||
"config": ">=0.4.31 <0.5.0", | ||
... | ||
"monitor-min": ">=0.5.8 <0.6.0", | ||
"config-monitor": ">=0.1.1 <0.2.0", | ||
... | ||
Then including them in your application startup phase | ||
// Start monitoring, and load monitor probes | ||
var Monitor = require('monitor-min').start(); | ||
var configMonitor = require('config-monitor'); | ||
Adding to Node Monitor | ||
---------------------- | ||
To add these monitors to your node monitor UI, install config-monitor in your node path (or globally) | ||
npm install -g config-monitor | ||
Then start node monitor | ||
npm start monitor | ||
When adding components into your dashboard, the config-monitor components will be avilable. | ||
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
28261
19
360
38
1