├── .gitignore
├── History.md
├── README.md
├── config
└── runtime.json
├── lib
├── css
│ ├── Core.css
│ ├── CoreSettings.css
│ ├── images
│ │ ├── add-a-component.jpg
│ │ ├── app.jpg
│ │ ├── dashboard.jpg
│ │ ├── header.jpg
│ │ ├── new_component.jpg
│ │ ├── sidebar.jpg
│ │ ├── tour.jpg
│ │ ├── tour_manage.jpg
│ │ └── tour_settings.jpg
│ └── wysihtml5.css
├── ext
│ ├── highcharts.js
│ ├── highcharts_more.js
│ └── wysihtml5-0.3.0.js
├── image
│ ├── AppViewer.png
│ ├── BarChart.png
│ ├── Button.png
│ ├── Clock.png
│ ├── Console.png
│ ├── Gauge.png
│ ├── HTMLView.png
│ ├── LineChart.png
│ ├── LogViewer.png
│ ├── ObjectInspector.png
│ ├── PieChart.png
│ ├── ProbeViewer.png
│ ├── Slider.png
│ ├── SparkLine.png
│ └── WebClip.png
├── index.js
├── template
│ ├── AppViewer.html
│ ├── Button.html
│ ├── Html.html
│ └── MacroEditor.html
└── view
│ ├── 1-Chart.js
│ ├── AppViewer.js
│ ├── BarChart.js
│ ├── Button.js
│ ├── Clock.js
│ ├── Gauge.js
│ ├── Html.js
│ ├── Inspector.js
│ ├── LineChart.js
│ ├── LogViewer.js
│ ├── Macro.js
│ ├── MacroEditor.js
│ ├── PieChart.js
│ ├── Probe.js
│ ├── Repl.js
│ ├── Slider.js
│ ├── SparkLine.js
│ └── WebView.js
├── monitor.js
├── package.json
└── site_db
├── Page
├── 404.json
├── AppOverview.json
├── Applications
│ └── index.json
├── Components
│ ├── AppViewer.json
│ ├── BarChart.json
│ ├── Button.json
│ ├── Clock.json
│ ├── Gauge.json
│ ├── HTMLTemplate.json
│ ├── LineChart.json
│ ├── LogViewer.json
│ ├── ObjectInspector.json
│ ├── PieChart.json
│ ├── ProbeViewer.json
│ ├── REPLConsole.json
│ ├── Slider.json
│ ├── SparkLine.json
│ └── WebSnippet.json
├── DashboardOverview.json
├── TourOverview.json
└── index.json
├── Site
└── default.json
└── Tour
├── 1.json
└── 2.json
/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | npm-debug.log
3 |
--------------------------------------------------------------------------------
/History.md:
--------------------------------------------------------------------------------
1 | 0.6.3 / 2013-11-25
2 | ==================
3 |
4 | * Fixed paths in app tours
5 |
6 | 0.6.2 / 2013-11-23
7 | ==================
8 |
9 | * Updated monitor dependencies
10 | * Moved default home & 404 pages into core-monitor
11 | * Moved documentation from monitor-dashboard into core-monitor
12 | * Updated icon images
13 | * Fixed REPL so it doesn't cause a dirty page on load
14 |
15 | 0.6.1 / 2013-11-07
16 | ==================
17 |
18 | * Removed unnecessary Page and Tour directories
19 | * Server shouldn't require probe directory
20 |
21 | 0.6.0 / 2013-11-06
22 | ==================
23 |
24 | * Made compatible with 6.0 monitor changes
25 | * Added a repository field in package.json
26 |
27 | 0.5.4 / 2013-10-17
28 | ==================
29 |
30 | * Better scroll bars in firefox
31 |
32 | 0.5.3 / 2013-08-28
33 | ==================
34 |
35 | * Pushed changes in prep for node monitor release
36 |
37 | 0.5.2 / 2013-05-16
38 | ==================
39 |
40 | * Name change for ordering
41 |
42 | 0.5.1 / 2013-05-16
43 | ==================
44 |
45 | * Initial checkin
46 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | Core Monitor Dashboard Components
2 | =================================
3 |
4 | This project contains online documentation, page tours, and the following components for the [node-monitor dashboard](http://lorenwest.github.io/node-monitor) project.
5 |
6 | Components
7 | ----------
8 |
9 |
10 |
11 |
12 | License
13 | -------
14 |
15 | May be freely distributed under the MIT license
16 |
17 | See [LICENSE](https://github.com/lorenwest/core-monitor/blob/master/LICENSE) file.
18 |
19 | Copyright (c) 2010-2013 Loren West, and other contributors
20 |
--------------------------------------------------------------------------------
/config/runtime.json:
--------------------------------------------------------------------------------
1 | {
2 | "MonitorMin": {
3 | "consoleLogListener": {
4 | "pattern": ""
5 | }
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/lib/css/Core.css:
--------------------------------------------------------------------------------
1 | #nm-core-html-textarea {
2 | height: 225px;
3 | }
4 |
5 | #nm-core-html-toolbar span {
6 | text-align: center;
7 | padding: 4px 0px;
8 | margin: 2px;
9 | font-size: 16px;
10 | font-weight: bold;
11 | display: block;
12 | float: left;
13 | height: 18px;
14 | width: 28px;
15 | border: 1px solid transparent;
16 | border-radius: 3px;
17 | }
18 |
19 | #nm-core-html-toolbar span:hover {
20 | border: 1px solid #ccc;
21 | cursor: default;
22 | }
23 |
24 | #nm-core-html-toolbar span.miniColors-triggerWrap {
25 | padding: 0;
26 | margin-top: 5px;
27 | border:none;
28 | }
29 | #nm-core-html-toolbar span.miniColors-triggerWrap:hover {
30 | border:none;
31 | }
32 | #nm-core-html-toolbar .miniColors-trigger {
33 | border: 1px solid #eee;
34 | }
35 | #nm-core-html-toolbar .miniColors-trigger:hover {
36 | cursor: default;
37 | border: 1px solid #bbb;
38 | }
39 |
40 | .nm-core-slider {
41 | width: 100%;
42 | }
43 |
44 | .nm-core-html-composer {
45 | box-sizing: border-box;
46 | width: 100%;
47 | background-color: white;
48 | background-image: none;
49 | margin-bottom: 5px;
50 | color: #555;
51 | }
52 | .wysihtml5-sandbox.nm-core-html-composer {
53 | border: 1px solid #ccc;
54 | height: 225px;
55 | }
56 |
57 | .wysihtml5-editor.nm-core-html-composer {
58 | padding: 4px;
59 | height: 223px;
60 | }
61 |
62 | .nm-core-html-dialog {
63 | clear: both;
64 | border: 1px solid #ccc;
65 | border-radius: 10px;
66 | padding: 10px;
67 | margin-bottom: 5px;
68 | background: white;
69 | }
70 |
71 | .nm-core-html-dialog label {
72 | display: inline;
73 | }
74 |
75 | .nm-core-html-dialog input {
76 | margin: 0px 10px 2px 5px;
77 | }
78 |
79 | .nm-core-html-dialog button {
80 | margin-left: 10px;
81 | }
82 |
83 | /* Log Viewer */
84 | .nm-core-lv {
85 | margin:0 0 10px 0;
86 | }
87 | .nm-core-lv li {
88 | margin:0;
89 | padding:0;
90 | line-height:14px;
91 | font-size:11px;
92 | font-family: Menlo, monospace !important;
93 | list-style: none;
94 | white-space: pre;
95 | cursor: default;
96 | }
97 | .nm-core-lv li i {
98 | color: rgba(200,183,155, .6);
99 | }
100 | .nm-core-lv li:hover i {
101 | color: rgba(200,183,155, 1);
102 | }
103 |
104 | .nm-core-lv-pattern {
105 | width: 508px;
106 | font-size: 12px !important;
107 | }
108 |
109 | /* REPL Console */
110 |
111 | .nm-core-rp {
112 | margin:0 0 10px 0;
113 | }
114 |
115 | .nm-core-rp li {
116 | margin:0;
117 | padding:0;
118 | height:14px;
119 | list-style: none;
120 | }
121 |
122 | .nm-core-rp * {
123 | font-size:11px;
124 | font-family: Menlo, monospace !important;
125 | }
126 |
127 | /* Remove the focus components */
128 | input[type="text"]:focus.nm-core-rp-input,
129 | .core-Repl {
130 | border: none;
131 | outline: none;
132 | background-color: transparent;
133 | box-shadow: none;
134 | -moz-box-shadow: none;
135 | -webkit-box-shadow: none;
136 | }
137 |
138 | input.nm-core-rp-input {
139 | padding: 0;
140 | font-size:11px;
141 | box-sizing: border-box;
142 | margin: 0 0px 1px 0px;
143 | background-color: transparent;
144 | border: 0;
145 | outline: none;
146 | color: rgba(200,183,155, 1);
147 | box-shadow: none;
148 | -moz-box-shadow: none;
149 | -webkit-box-shadow: none;
150 | }
151 |
152 | .nm-core-rp-out, .nm-core-rp-entered {
153 | white-space: pre;
154 | }
155 |
156 | .nm-core-rp-entered {
157 | }
158 |
159 | .nm-core-rp-suggest-line {
160 | margin-top:-14px !important;
161 | color: rgba(200,183,155, .4);
162 | }
163 |
164 | .nm-core-rp-lede {
165 | color: transparent;
166 | }
167 |
168 | input[type="text"].nm-core-me-desc {
169 | box-sizing: border-box;
170 | width: 100%;
171 | height: 2.4em;
172 | }
173 |
174 | .nm-core-me-lines {
175 | box-sizing: border-box;
176 | font-size: 13px;
177 | width: 100%;
178 | height: 180px;
179 | }
180 |
181 | .nm-core-wv {
182 | width: 100%;
183 | height: 100%;
184 | overflow: hidden;
185 | }
186 |
187 | .nm-core-wv.scroll-bars {
188 | overflow: auto;
189 | }
190 |
191 | .nm-core-wv-iframe {
192 | border:none;
193 | padding: 0;
194 | width: 960px;
195 | height: 10000px;
196 | overflow: hidden;
197 | }
198 |
199 | .nm-core-wv-input span {
200 | margin: 0 5px 0 34px;
201 | font-size: 13px;
202 | color: #555;
203 | }
204 |
205 | .nm-core-wv-example-group {
206 | position:relative;
207 | height: 200px;
208 | width: 100%;
209 | border: 1px solid #333;
210 | box-sizing: border-box;
211 | }
212 |
213 | .view-source .nm-core-wv-example-group {
214 | display:none;
215 | }
216 |
217 | .nm-core-wv-example {
218 | height: 100%;
219 | width: 100%;
220 | position:absolute;
221 | z-index: 1;
222 | top: 0;
223 | left: 0;
224 | }
225 |
226 | .nm-core-wv-example-mask {
227 | height: 100%;
228 | width: 100%;
229 | position:absolute;
230 | top: 0;
231 | left: 0;
232 | z-index: 2;
233 | cursor: move;
234 | }
235 |
236 | .nm-core-inspector-input {
237 | display:inline-block;
238 | width: 75%;
239 | }
240 | input.nm-core-inspector-expression {
241 | width: 100%;
242 | font-size: 12px;
243 | }
244 | .nm-core-inspector-depthblock {
245 | display: inline-block;
246 | margin-left: 40px;
247 | }
248 | .nm-core-inspector-depth {
249 | width: 20px;
250 | }
251 |
252 |
253 | .nm-core-av > div {
254 | margin-bottom: 10px;
255 | }
256 | .nm-core-av title {
257 | display:block;
258 | font-size: 16px;
259 | line-height: 20px;
260 | }
261 | .nm-core-av-cpu .cpu {
262 | float: left;
263 | }
264 | .nm-core-av-cpu .cpu-level {
265 | font-size: 14px;
266 | color: rgba(235,122,109,0.75);
267 | text-align: center;
268 | margin: -40px 0 20px 0;
269 | }
270 | .nm-core-av-cpu .cpu-title {
271 | text-align: center;
272 | margin-top: -6px;
273 | }
274 | .nm-core-av-cpu .cpu-gauge {
275 | padding: 10px;
276 | width: 130px;
277 | height: 80px;
278 | margin-top: -26px;
279 | }
280 | .nm-core-av-mem .mem {
281 | width: 300px;
282 | float: left;
283 | }
284 | .nm-core-av-mem .mem-stat {
285 | float:left;
286 | width: 164px;
287 | padding-top: 36px;
288 | text-align: right;
289 | }
290 | .nm-core-av-mem .mem-stat span {
291 | width: 16px;
292 | display: inline-block;
293 | border-radius: 2px;
294 | line-height: 100%;
295 | }
296 | .nm-core-av-mem .stat1 {
297 | background-color: rgb(200,183,155);
298 | }
299 | .nm-core-av-mem .stat2 {
300 | background-color: rgb(255,100,100);
301 | }
302 | .nm-core-av-mem .stat3 {
303 | background-color: rgb(100,100,255);
304 | }
305 |
306 | .nm-core-av-mem .mem-bar {
307 | float:left;
308 | height: 130px;
309 | width: 130px;
310 | }
311 | .nm-core-av-info {
312 | margin: 6px;
313 | }
314 | .nm-core-av-anim {
315 | margin-top:-30px;
316 | }
317 | .nm-core-av-anim-head {
318 | margin: 0 5px 0 34px;
319 | font-size: 13px;
320 | color: #555;
321 | }
322 |
323 |
--------------------------------------------------------------------------------
/lib/css/CoreSettings.css:
--------------------------------------------------------------------------------
1 | .core-chart-settings-view h4 {
2 | margin-left: 4px;
3 | }
4 |
5 | .core-gauge-label {
6 | width: 220px;
7 | float: left;
8 | }
9 |
10 | .core-gauge-label-right {
11 | width: 220px;
12 | float: left;
13 | margin-left: 34px;
14 | }
15 |
16 | .core-gauge-minmax {
17 | float: left;
18 | margin-left: 34px;
19 | }
20 |
21 | .core-gauge-minmax input {
22 | width: 50px;
23 | text-align: right;
24 | }
--------------------------------------------------------------------------------
/lib/css/images/add-a-component.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lorenwest/core-monitor/2bd0407a65a9a48457da3576fc1161ee6852bf94/lib/css/images/add-a-component.jpg
--------------------------------------------------------------------------------
/lib/css/images/app.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lorenwest/core-monitor/2bd0407a65a9a48457da3576fc1161ee6852bf94/lib/css/images/app.jpg
--------------------------------------------------------------------------------
/lib/css/images/dashboard.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lorenwest/core-monitor/2bd0407a65a9a48457da3576fc1161ee6852bf94/lib/css/images/dashboard.jpg
--------------------------------------------------------------------------------
/lib/css/images/header.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lorenwest/core-monitor/2bd0407a65a9a48457da3576fc1161ee6852bf94/lib/css/images/header.jpg
--------------------------------------------------------------------------------
/lib/css/images/new_component.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lorenwest/core-monitor/2bd0407a65a9a48457da3576fc1161ee6852bf94/lib/css/images/new_component.jpg
--------------------------------------------------------------------------------
/lib/css/images/sidebar.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lorenwest/core-monitor/2bd0407a65a9a48457da3576fc1161ee6852bf94/lib/css/images/sidebar.jpg
--------------------------------------------------------------------------------
/lib/css/images/tour.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lorenwest/core-monitor/2bd0407a65a9a48457da3576fc1161ee6852bf94/lib/css/images/tour.jpg
--------------------------------------------------------------------------------
/lib/css/images/tour_manage.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lorenwest/core-monitor/2bd0407a65a9a48457da3576fc1161ee6852bf94/lib/css/images/tour_manage.jpg
--------------------------------------------------------------------------------
/lib/css/images/tour_settings.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lorenwest/core-monitor/2bd0407a65a9a48457da3576fc1161ee6852bf94/lib/css/images/tour_settings.jpg
--------------------------------------------------------------------------------
/lib/css/wysihtml5.css:
--------------------------------------------------------------------------------
1 | .wysiwyg-font-size-smaller {
2 | font-size: smaller;
3 | }
4 |
5 | .wysiwyg-font-size-larger {
6 | font-size: larger;
7 | }
8 |
9 | .wysiwyg-font-size-xx-large {
10 | font-size: xx-large;
11 | }
12 |
13 | .wysiwyg-font-size-x-large {
14 | font-size: x-large;
15 | }
16 |
17 | .wysiwyg-font-size-large {
18 | font-size: large;
19 | }
20 |
21 | .wysiwyg-font-size-medium {
22 | font-size: medium;
23 | }
24 |
25 | .wysiwyg-font-size-small {
26 | font-size: small;
27 | }
28 |
29 | .wysiwyg-font-size-x-small {
30 | font-size: x-small;
31 | }
32 |
33 | .wysiwyg-font-size-xx-small {
34 | font-size: xx-small;
35 | }
36 |
37 | .wysiwyg-color-black {
38 | color: black;
39 | }
40 |
41 | .wysiwyg-color-silver {
42 | color: silver;
43 | }
44 |
45 | .wysiwyg-color-gray {
46 | color: gray;
47 | }
48 |
49 | .wysiwyg-color-white {
50 | color: white;
51 | }
52 |
53 | .wysiwyg-color-maroon {
54 | color: maroon;
55 | }
56 |
57 | .wysiwyg-color-red {
58 | color: red;
59 | }
60 |
61 | .wysiwyg-color-purple {
62 | color: purple;
63 | }
64 |
65 | .wysiwyg-color-fuchsia {
66 | color: fuchsia;
67 | }
68 |
69 | .wysiwyg-color-green {
70 | color: green;
71 | }
72 |
73 | .wysiwyg-color-lime {
74 | color: lime;
75 | }
76 |
77 | .wysiwyg-color-olive {
78 | color: olive;
79 | }
80 |
81 | .wysiwyg-color-yellow {
82 | color: yellow;
83 | }
84 |
85 | .wysiwyg-color-navy {
86 | color: navy;
87 | }
88 |
89 | .wysiwyg-color-blue {
90 | color: blue;
91 | }
92 |
93 | .wysiwyg-color-teal {
94 | color: teal;
95 | }
96 |
97 | .wysiwyg-color-aqua {
98 | color: aqua;
99 | }
100 |
101 | .wysiwyg-text-align-right {
102 | text-align: right;
103 | }
104 |
105 | .wysiwyg-text-align-center {
106 | text-align: center;
107 | }
108 |
109 | .wysiwyg-text-align-left {
110 | text-align: left;
111 | }
112 |
113 | .wysiwyg-text-align-justify {
114 | text-align: justify;
115 | }
116 |
117 | .wysiwyg-float-left {
118 | float: left;
119 | margin: 0 8px 8px 0;
120 | }
121 |
122 | .wysiwyg-float-right {
123 | float: right;
124 | margin: 0 0 8px 8px;
125 | }
126 |
127 | .wysiwyg-clear-right {
128 | clear: right;
129 | }
130 |
131 | .wysiwyg-clear-left {
132 | clear: left;
133 | }
134 |
--------------------------------------------------------------------------------
/lib/ext/highcharts_more.js:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lorenwest/core-monitor/2bd0407a65a9a48457da3576fc1161ee6852bf94/lib/ext/highcharts_more.js
--------------------------------------------------------------------------------
/lib/image/AppViewer.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lorenwest/core-monitor/2bd0407a65a9a48457da3576fc1161ee6852bf94/lib/image/AppViewer.png
--------------------------------------------------------------------------------
/lib/image/BarChart.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lorenwest/core-monitor/2bd0407a65a9a48457da3576fc1161ee6852bf94/lib/image/BarChart.png
--------------------------------------------------------------------------------
/lib/image/Button.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lorenwest/core-monitor/2bd0407a65a9a48457da3576fc1161ee6852bf94/lib/image/Button.png
--------------------------------------------------------------------------------
/lib/image/Clock.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lorenwest/core-monitor/2bd0407a65a9a48457da3576fc1161ee6852bf94/lib/image/Clock.png
--------------------------------------------------------------------------------
/lib/image/Console.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lorenwest/core-monitor/2bd0407a65a9a48457da3576fc1161ee6852bf94/lib/image/Console.png
--------------------------------------------------------------------------------
/lib/image/Gauge.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lorenwest/core-monitor/2bd0407a65a9a48457da3576fc1161ee6852bf94/lib/image/Gauge.png
--------------------------------------------------------------------------------
/lib/image/HTMLView.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lorenwest/core-monitor/2bd0407a65a9a48457da3576fc1161ee6852bf94/lib/image/HTMLView.png
--------------------------------------------------------------------------------
/lib/image/LineChart.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lorenwest/core-monitor/2bd0407a65a9a48457da3576fc1161ee6852bf94/lib/image/LineChart.png
--------------------------------------------------------------------------------
/lib/image/LogViewer.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lorenwest/core-monitor/2bd0407a65a9a48457da3576fc1161ee6852bf94/lib/image/LogViewer.png
--------------------------------------------------------------------------------
/lib/image/ObjectInspector.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lorenwest/core-monitor/2bd0407a65a9a48457da3576fc1161ee6852bf94/lib/image/ObjectInspector.png
--------------------------------------------------------------------------------
/lib/image/PieChart.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lorenwest/core-monitor/2bd0407a65a9a48457da3576fc1161ee6852bf94/lib/image/PieChart.png
--------------------------------------------------------------------------------
/lib/image/ProbeViewer.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lorenwest/core-monitor/2bd0407a65a9a48457da3576fc1161ee6852bf94/lib/image/ProbeViewer.png
--------------------------------------------------------------------------------
/lib/image/Slider.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lorenwest/core-monitor/2bd0407a65a9a48457da3576fc1161ee6852bf94/lib/image/Slider.png
--------------------------------------------------------------------------------
/lib/image/SparkLine.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lorenwest/core-monitor/2bd0407a65a9a48457da3576fc1161ee6852bf94/lib/image/SparkLine.png
--------------------------------------------------------------------------------
/lib/image/WebClip.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lorenwest/core-monitor/2bd0407a65a9a48457da3576fc1161ee6852bf94/lib/image/WebClip.png
--------------------------------------------------------------------------------
/lib/index.js:
--------------------------------------------------------------------------------
1 | // This is run when the app is loaded from node-monitor
2 | (function(root){
3 |
4 | // Create a server, and expose this directory
5 | var Connect = require('connect'),
6 | FS = require('fs'),
7 | Path = require('path'),
8 | Static = Connect['static'](__dirname);
9 |
10 | // Load all probes found in the ./probe directory
11 | // This is synchronous because require() is synchronous
12 | try {
13 | FS.readdirSync(Path.join(__dirname, 'probe')).forEach(function(fileName) {
14 | if (fileName.substr(-3) === '.js') {
15 | require('./probe/' + fileName);
16 | }
17 | });
18 | } catch (e) {}
19 |
20 | // Export a middleware component
21 | var app = module.exports = function(request, response, next) {
22 |
23 | // Process dynamic app endpoints here
24 | if (request.url === '/status') {
25 | response.writeHead(200, {'Content-Type': 'text/plan'});
26 | return response.end('ok');
27 | }
28 |
29 | // Forward to the static endpoint, then to the next step
30 | // if the file isn't there. The next step is a monitor page.
31 | return Static(request, response, next);
32 | }
33 |
34 | }(this));
35 |
--------------------------------------------------------------------------------
/lib/template/AppViewer.html:
--------------------------------------------------------------------------------
1 |
2 |
CPU & System Load
3 |
4 |
5 |
Memory Usage
6 |
7 |
8 |
9 |
Process Information
10 |
11 |
12 |
--------------------------------------------------------------------------------
/lib/template/Button.html:
--------------------------------------------------------------------------------
1 | Push Me
2 |
--------------------------------------------------------------------------------
/lib/template/Html.html:
--------------------------------------------------------------------------------
1 |
47 |
--------------------------------------------------------------------------------
/lib/template/MacroEditor.html:
--------------------------------------------------------------------------------
1 |
19 |
--------------------------------------------------------------------------------
/lib/view/1-Chart.js:
--------------------------------------------------------------------------------
1 | // Chart.js (c) 2010-2013 Loren West and other contributors
2 | // May be freely distributed under the MIT license.
3 | // For further details and documentation:
4 | // http://lorenwest.github.com/core-monitor
5 | (function(root){
6 |
7 | // Module loading
8 | var Monitor = root.Monitor || require('monitor-dashboard'),
9 | UI = Monitor.UI,
10 | core = UI.app.core = UI.app.core || {},
11 | Backbone = Monitor.Backbone,
12 | _ = Monitor._;
13 |
14 | var HIGHCHARTS_OPTS = {
15 | chart: {
16 | backgroundColor: 'transparent'
17 | },
18 | colors: [
19 | 'rgb(200,183,155)',
20 | 'rgb(255,100,100)',
21 | 'rgb(100,100,255)',
22 | 'rgb(0,200,0)',
23 | 'rgb(200,0,50,)',
24 | 'rgb(200,100,255)',
25 | 'rgb(255,255,0)',
26 | 'rgb(0,150,150)',
27 | 'rgb(175,175,175)',
28 | 'rgb(255,0,255)'
29 | ],
30 | title: {
31 | text: ''
32 | },
33 | pane: {
34 | background: {
35 | backgroundColor: 'transparent'
36 | }
37 | },
38 | legend: {
39 | title: {
40 | style: {
41 | color: 'rgba(235,122,109,0.75)'
42 | }
43 | }
44 | },
45 | credits:{
46 | enabled:false
47 | },
48 | xAxis: {
49 | title: {
50 | style: {
51 | color: 'rgba(235,122,109,0.75)'
52 | }
53 | },
54 | labels: {
55 | style: {
56 | color: 'rgba(200,183,155,1)'
57 | }
58 | }
59 | },
60 | yAxis: {
61 | title: {
62 | style: {
63 | color: 'rgba(235,122,109,0.75)'
64 | }
65 | },
66 | labels: {
67 | style: {
68 | color: 'rgba(200,183,155,1)'
69 | }
70 | }
71 | }
72 | };
73 |
74 | /**
75 | * Foundation for rendering a Highcharts chart
76 | *
77 | * This provides a common interface for views representing Highcharts charts.
78 | *
79 | * @class Chart
80 | * @extends Backbone.View
81 | * @constructor
82 | * @param options {Object} View initialization options (See others in Backbone.View)
83 | * @param options.label='Chart' {String} The component label
84 | * @param options.icon='icon-bar-chart' {String} The icon class name
85 | * @param options.highcharts = {} {Object} Highcharts chart configuration object
86 | */
87 | var Chart = core.Chart = Backbone.View.extend({
88 |
89 | // Define the view
90 | defaultOptions: {
91 | label: 'Chart',
92 | icon: 'icon-bar-chart',
93 | highcharts: {}
94 | },
95 |
96 | initialize: function(options) {
97 | var t = this;
98 |
99 | // Set the default highcharts options
100 | if (!Highcharts.monitorOptionsSet) {
101 | Highcharts.setOptions(HIGHCHARTS_OPTS);
102 | Highcharts.monitorOptionsSet = true;
103 | }
104 |
105 | t.viewOptions = t.options.viewOptions;
106 | t.hc = t.viewOptions.get('highcharts') || {};
107 | options.component.setDefaultSize({
108 | width: 300,
109 | height: 300
110 | });
111 | },
112 |
113 | events: {
114 | },
115 |
116 | render: function() {
117 | var t = this,
118 | hc = Monitor.deepCopy(t.hc, 10);
119 | hc.chart.renderTo = t.$el[0];
120 | t.chart = new Highcharts.Chart(hc);
121 |
122 | // Resize the chart on component resize`
123 | t.on('resize', function() {
124 | t.chart.setSize(t.$el.width(), t.$el.height(), false);
125 | });
126 | },
127 |
128 | // This method must be overridden by sub-views to return
129 | // the data series to use on initial chart construction
130 | getInitialSeries: function() {
131 | return [];
132 | }
133 |
134 | });
135 |
136 | // This settings form is inherited by all charts.
137 | Chart.SettingsView = Backbone.View.extend({
138 |
139 | // Extend for local events
140 | events: {
141 | "change .core-chart-data" : "onChartDataChange",
142 | "change" : "onInputChange"
143 | },
144 |
145 | render: function() {
146 | var t = this;
147 |
148 | t.hc = t.model.get('highcharts');
149 |
150 | // Place template HTML
151 | t.$el.html('' +
152 | '
' +
153 | '
' +
154 | 'Data series ' +
155 | ' '
156 | );
157 |
158 | // Attach the monitor picker
159 | t.monitorPicker = new UI.MonitorPicker({
160 | el: t.$('.nm-core-chart-monitor'),
161 | model: t.options.monitor
162 | });
163 | t.monitorPicker.render();
164 |
165 | // Fill the data series
166 | t.series = t.$('.core-chart-data').val(JSON.stringify(t.hc.series));
167 |
168 | // Re-render on view-source change (view-source is in parent container)
169 | // This removes prior bindings from earlier renders
170 | var editBox = $('.nm-cs-source-edit')
171 | editBox.off('change').on('change', function(e) {
172 | try {
173 | // Let container do error handling
174 | t.model.set('highcharts', JSON.parse(editBox.val()).viewOptions.highcharts);
175 | t.onInputChange();
176 | } catch (e) {}
177 | });
178 |
179 | // Attach all color pickers after the derived render occurs
180 | t.$('.colorPicker').miniColors({
181 | opacity: true
182 | });
183 |
184 | },
185 |
186 | onChartDataChange: function() {
187 | var t = this,
188 | val = t.series.val();
189 |
190 | // TODO: See if this is a function
191 |
192 | // Parse as JSON
193 | try {
194 | var data = JSON.parse(val);
195 | }
196 | catch (e) {
197 | alert('JSON parse error');
198 | return;
199 | }
200 | if (!_.isArray(data)) {
201 | alert('Does not parse as an array');
202 | return;
203 | };
204 |
205 | // Set the new series data
206 | t.hc.series = data;
207 | },
208 |
209 | onInputChange: function() {
210 | var t = this;
211 |
212 | // Give sub-views a chance to change their configs, then re-render
213 | setTimeout(function(){
214 | t.options.componentView.render();
215 | },0);
216 | }
217 |
218 | });
219 |
220 | }(this));
221 |
--------------------------------------------------------------------------------
/lib/view/AppViewer.js:
--------------------------------------------------------------------------------
1 | // AppViewer.js (c) 2010-2013 Loren West and other contributors
2 | // May be freely distributed under the MIT license.
3 | // For further details and documentation:
4 | // http://lorenwest.github.com/core-monitor
5 | (function(root){
6 |
7 | // Module loading
8 | var Monitor = root.Monitor || require('monitor-dashboard'),
9 | logger = Monitor.getLogger('AppViewer'),
10 | UI = Monitor.UI,
11 | Template = UI.Template,
12 | Backbone = Monitor.Backbone,
13 | core = UI.app.core = UI.app.core || {},
14 | Chart = core.Chart,
15 | template = null,
16 | _ = Monitor._;
17 |
18 | // Constants
19 | var INFO_MAP = {
20 | 'Process Title': 'title',
21 | 'Executable Path': 'execPath',
22 | 'Executable Args': 'argv',
23 | 'Working Directory': 'cwd',
24 | 'Process ENV': 'env',
25 | 'Process ID': 'pid',
26 | 'Process Uptime' : 'uptime',
27 | 'Heap Total': 'heapTotal',
28 | 'Heap Used ': 'heapUsed',
29 | 'RSS Space ': 'rss',
30 | 'Host Name' : 'hostname',
31 | 'OS Type' : 'type',
32 | 'OS Release' : 'release',
33 | 'Total Memory' : 'totalmem',
34 | 'Free Memory' : 'freemem',
35 | 'Load Averages 1/5/15' : 'loadavg',
36 | 'CPU Info' : 'cpus',
37 | 'Node Platform': 'platform',
38 | 'Node Versions': 'versions'
39 | };
40 |
41 | /**
42 | * A viewer for log statements
43 | *
44 | * @class AppViewer
45 | * @extends Backbone.View
46 | * @constructor
47 | * @param options {Object} View initialization options (See others in Backbone.View)
48 | */
49 | var AppViewer = core.AppViewer = Backbone.View.extend({
50 |
51 | // Define the view
52 | name: 'App Viewer',
53 | tags: ['Utility', 'Real Time'],
54 | icon: 'image/AppViewer.png',
55 | description: 'A Node.JS application process viewer',
56 | website: 'http://lorenwest.github.com/core-monitor',
57 | defaultOptions: {
58 | animation: true,
59 | background: true
60 | },
61 |
62 | // Constructor
63 | initialize: function(options) {
64 | var t = this;
65 | t.options = options;
66 | t.viewOptions = options.viewOptions;
67 | t.monitor = options.monitor;
68 | options.component.setDefaultSize({width: 616, height: 616});
69 | Chart.prototype.initialize.apply(t, arguments);
70 | t.lastIdleCpu = 0;
71 | t.lastWorkingCpu = 0;
72 | t.infoElems = {};
73 |
74 | // Build the templates
75 | if (!template) {
76 | template = Template.fromDOM('#nm-template-core-AppViewer');
77 | }
78 |
79 | // Set default monitor options
80 | if (!t.monitor.get('probeClass')) {
81 | t.monitor.set({
82 | probeClass: 'Process',
83 | });
84 | }
85 |
86 | // Set up logging
87 | t.logCtxt = t.monitor.get('initParams');
88 | logger.info('init', t.logCtxt);
89 | },
90 |
91 | render: function() {
92 | var t = this;
93 |
94 | // Create the monitor in the loading state
95 | t.$el.html(template.get('text'));
96 |
97 | // Render the CPU gauges
98 | t.cpu1 = t.renderCpuGauge("CPU Activity");
99 | t.cpu2 = t.renderCpuGauge("1 Min. Load");
100 | t.cpu3 = t.renderCpuGauge("5 Min. Load");
101 | t.cpu4 = t.renderCpuGauge("15 Min Load");
102 |
103 | // Render the memory bars
104 | t.mem1 = t.renderMemBar();
105 | t.mem2 = t.renderMemBar();
106 |
107 | // Create the process info view, deferring render until we get real data
108 | var infoView = t.$('.nm-core-av-info').html('
')
109 | .find('.json');
110 | t.jsonView = new UI.JsonView({
111 | model: {},
112 | closedOnInit: true
113 | });
114 | infoView.append(t.jsonView.$el);
115 |
116 | // Listen for monitor events
117 | t.monitor.on('change', t._onProcessChange, t);
118 | },
119 |
120 | events: {
121 | },
122 |
123 | // Render the specified CPU gauge and return the DOM element
124 | renderCpuGauge: function(title) {
125 | var t = this,
126 | el = $('' +
127 | '
' +
128 | '
' +
129 | '
' + title + '
' +
130 | '
')
131 | .appendTo(t.$('.nm-core-av-cpu'))
132 | .find('.cpu-gauge');
133 |
134 | // Render a highcharts gauge
135 | var opts = {
136 | chart: {
137 | type: 'gauge',
138 | animation: true,
139 | renderTo: el[0],
140 | margin: 0,
141 | plotBackgroundColor: 'transparent',
142 | plotBorderWidth: 0
143 | },
144 | pane: {
145 | startAngle: -55,
146 | endAngle: 55,
147 | center: ['50%', '125%'],
148 | size: '180%'
149 | },
150 | plotOptions: {
151 | gauge: {
152 | dial: {
153 | radius: '85%',
154 | backgroundColor: 'rgba(200,183,155,1)'
155 | }
156 | }
157 | },
158 | yAxis: {
159 | labels: {distance: 100},
160 | min: 0,
161 | max: 100,
162 | tickInterval: 20,
163 | lineWidth: 0,
164 | minorTickLength: 5,
165 | minorTickColor: 'rgba(200,183,155,1)',
166 | tickWidth: 2,
167 | tickLength: 8,
168 | tickColor: 'rgba(200,183,155,1)'
169 | },
170 | series: [{id: "value", data: [0]}]
171 | };
172 |
173 | // Return the chart object
174 | return new Highcharts.Chart(opts);
175 | },
176 |
177 |
178 | // Render the memory bar chart
179 | renderMemBar: function(title) {
180 | var t = this,
181 | el = $('' +
182 | '
' +
183 | '
' +
184 | '
')
185 | .appendTo(t.$('.nm-core-av-mem'));
186 |
187 | var opts = {
188 | chart: {
189 | type: 'column',
190 | renderTo: el.find('.mem-bar')[0],
191 | margin: 0,
192 | x_plotBackgroundColor: 'transparent',
193 | x_plotBorderWidth: 0
194 | },
195 | legend: {enabled:false},
196 | title: {
197 | text: ''
198 | },
199 | xAxis: {
200 | categories: [''],
201 | lineWidth: 0,
202 | },
203 | yAxis: {
204 | min: 0,
205 | gridLineWidth: 0,
206 | title: {
207 | text: ''
208 | }
209 | },
210 | tooltip: {
211 | enabled: false
212 | },
213 | plotOptions: {
214 | column: {
215 | stacking: 'percent'
216 | }
217 | },
218 | series: [{
219 | name: '',
220 | data: [1]
221 | }, {
222 | name: '',
223 | data: [1]
224 | }, {
225 | name: '',
226 | data: [0]
227 | }]
228 | };
229 |
230 | // Create the chart and return the dom selector
231 | var chart = new Highcharts.Chart(opts);
232 | el.data('chart', chart);
233 | return el;
234 | },
235 |
236 | // Process a change in the (main) process monitor
237 | _onProcessChange: function(monitorEvent){
238 | var t = this,
239 | process = t.monitor.toProbeJSON(),
240 | animate = t.viewOptions.get('animate') ? true : false;
241 |
242 | // Re-compute the CPU gauges
243 | var loadNow = function(chart) {
244 | var pct = 0, i = 0, cpus = process.cpus, idleCpu = 0, workingCpu = 0;
245 | for (;i < cpus.length; i++) {
246 | var times = cpus[i].times;
247 | idleCpu += times.idle;
248 | workingCpu += times.sys + times.user;
249 | }
250 |
251 | // Update if the last values were known
252 | if (t.lastIdleCpu !== 0) {
253 | var workDiff = workingCpu - t.lastWorkingCpu,
254 | idleDiff = idleCpu - t.lastIdleCpu,
255 | pctWork = workDiff / (workDiff + idleDiff);
256 | showPct(chart, pctWork);
257 | }
258 | t.lastIdleCpu = idleCpu;
259 | t.lastWorkingCpu = workingCpu;
260 | }
261 | var loadPct = function(chart, index) {
262 | var numCpus = process.cpus.length,
263 | load = process.loadavg[index];
264 | showPct(chart, load / numCpus);
265 | }
266 | var showPct = function(chart, pct) {
267 | // Zero gauges if not connected
268 | if (!t.monitor.isConnected()) {
269 | pct = 0;
270 | }
271 | pct = Math.max(0, Math.min(100, Math.floor(pct * 100)));
272 | chart.series[0].data[0].update(pct, true, animate);
273 | $(chart.container).parent().parent().find('.cpu-level').text(pct + ' %');
274 | }
275 |
276 | // Delay loading load percentages until idle cpu is known
277 | if (t.lastIdleCpu !== 0) {
278 | loadPct(t.cpu2, 0);
279 | loadPct(t.cpu3, 1);
280 | loadPct(t.cpu4, 2);
281 | }
282 | loadNow(t.cpu1);
283 |
284 | // Update the memory bars
285 | t.mem1.find('.mem-stat').html('This Server ' +
286 | ' Process RSS: ' + numeral(process.rss).format('0.0 b') + ' ' +
287 | ' Total Heap: ' + numeral(process.heapTotal).format('0.0 b') + ' ' +
288 | ' Total Used: ' + numeral(process.heapUsed).format('0.0 b') + ' ' +
289 | '');
290 | t.mem1.data('chart').series[0].data[0].update(process.rss - process.heapTotal, false);
291 | t.mem1.data('chart').series[1].data[0].update(process.heapTotal - process.heapUsed, false);
292 | t.mem1.data('chart').series[2].data[0].update(process.heapUsed, true, animate);
293 |
294 | t.mem2.find('.mem-stat').html('System Memory ' +
295 | ' Total Memory: ' + numeral(process.totalmem).format('0.0 b') + ' ' +
296 | ' Memory Used: ' + numeral(process.totalmem - process.freemem).format('0.0 b') + ' ' +
297 | ' This Server: ' + numeral(process.rss).format('0.0 b') + ' ' +
298 | '');
299 | t.mem2.data('chart').series[0].data[0].update(process.freemem, false);
300 | t.mem2.data('chart').series[1].data[0].update(process.totalmem - process.freemem - process.rss, false);
301 | t.mem2.data('chart').series[2].data[0].update(process.rss, true, animate);
302 |
303 | // Update process information
304 | for (var attrName in INFO_MAP) {
305 | t.infoElems[attrName] = t.monitor.get(INFO_MAP[attrName]);
306 | }
307 | t.jsonView.setData(t.infoElems);
308 |
309 | }
310 |
311 | });
312 |
313 | // Custom settings form for the Text view
314 | AppViewer.SettingsView = Backbone.View.extend({
315 |
316 | render: function() {
317 | var t = this,
318 | server = t.$el.html('
');
319 | t.monitor = t.options.monitor;
320 | t.model = t.options.model;
321 |
322 | // Append a server picker
323 | t.serverPicker = new UI.MonitorPicker({
324 | el: server,
325 | model: t.monitor,
326 | hideProbe: true,
327 | hideParams: true
328 | });
329 | t.serverPicker.render();
330 |
331 | // Animate the charts?
332 | var elem =
333 | $('Smooth Animation:
').appendTo(server);
334 | t.animate = t.$el.find('.nm-core-av-anim').attr('checked', t.model.get('animate') ? 'checked' : null);
335 | },
336 |
337 | events: {
338 | 'change .nm-core-av-anim': 'onSelect'
339 | },
340 |
341 | onSelect: function(e) {
342 | var t = this,
343 | checked = t.animate.attr('checked') === 'checked';
344 |
345 | // Set the monitor fields
346 | t.model.set({
347 | animate: checked
348 | });
349 | }
350 |
351 | });
352 |
353 | }(this));
354 |
--------------------------------------------------------------------------------
/lib/view/BarChart.js:
--------------------------------------------------------------------------------
1 | // BarChart.js (c) 2010-2013 Loren West and other contributors
2 | // May be freely distributed under the MIT license.
3 | // For further details and documentation:
4 | // http://lorenwest.github.com/core-monitor
5 | (function(root){
6 |
7 | // Module loading
8 | var Monitor = root.Monitor || require('monitor-dashboard'),
9 | UI = Monitor.UI,
10 | core = UI.app.core = UI.app.core || {},
11 | Chart = core.Chart,
12 | Backbone = Monitor.Backbone,
13 | _ = Monitor._;
14 |
15 | /**
16 | * A bar chart view
17 | *
18 | * @class BarChart
19 | * @extends Backbone.View
20 | * @constructor
21 | * @param options {Object} View initialization options (See others in Backbone.View)
22 | * @param options.label='Chart' {String} The component label
23 | * @param options.icon='icon-bar-chart' {String} The icon class name
24 | * @param options.highcharts= {} {Object} Highcharts chart configuration object
25 | */
26 | var BarChart = core.BarChart = Chart.extend({
27 |
28 | // Define the view
29 | name: 'BarChart',
30 | tags: ['Chart'],
31 | icon: 'image/BarChart.png',
32 | description: 'A bar chart',
33 | defaultOptions: {
34 | title: 'Bar Chart',
35 | highcharts: {
36 | chart: {
37 | type: 'column'
38 | },
39 | legend: {
40 | enabled: false
41 | },
42 | xAxis: {
43 | title: {
44 | text: 'Values'
45 | },
46 | labels: {
47 | enabled:true
48 | }
49 | },
50 | yAxis: {
51 | title: {
52 | text: ''
53 | },
54 | labels: {
55 | enabled:true
56 | }
57 | },
58 | plotOptions: {
59 | bar: {
60 | color: 'rgba(200,183,155,1)'
61 | },
62 | column: {
63 | color: 'rgba(200,183,155,1)'
64 | }
65 | },
66 | series: [{
67 | name: 'value',
68 | data: [1,0,4,10,3,8,7,7,3,0,5]
69 | }]
70 | }
71 | },
72 |
73 | initialize: function(options) {
74 | var t = this;
75 | Chart.prototype.initialize.apply(t, arguments);
76 | },
77 |
78 | });
79 |
80 | // This settings form is inherited by all charts.
81 | BarChart.SettingsView = Chart.SettingsView.extend({
82 |
83 | // Extend for local events
84 | events: _.extend({}, Chart.SettingsView.prototype.events, {
85 | "change *" : "onChange"
86 | }),
87 |
88 | render: function() {
89 | var t = this;
90 |
91 | // Call parent render to set up dom
92 | Chart.SettingsView.prototype.render.apply(t, arguments);
93 |
94 | // Set my title & HTML
95 | $('.core-chart-settings').append('' +
96 | '' +
97 | 'X Axis Label ' +
98 | ' ' +
99 | '
' +
100 | '' +
101 | 'Y Axis Label ' +
102 | ' ' +
103 | '
'
104 | );
105 |
106 | // Set initial field values
107 | t.xlabel = t.$('.xlabel').val(t.hc.xAxis.title.text);
108 | t.ylabel = t.$('.ylabel').val(t.hc.yAxis.title.text);
109 | },
110 |
111 | onChange: function() {
112 | var t = this;
113 | t.hc.xAxis.title.text = t.xlabel.val();
114 | t.hc.yAxis.title.text = t.ylabel.val();
115 | }
116 | });
117 |
118 | }(this));
119 |
--------------------------------------------------------------------------------
/lib/view/Button.js:
--------------------------------------------------------------------------------
1 | // Button.js (c) 2010-2013 Loren West and other contributors
2 | // May be freely distributed under the MIT license.
3 | // For further details and documentation:
4 | // http://lorenwest.github.com/core-monitor
5 | (function(root){
6 |
7 | // Module loading
8 | var Monitor = root.Monitor || require('monitor-dashboard'),
9 | UI = Monitor.UI,
10 | core = UI.app.core = UI.app.core || {},
11 | Backbone = Monitor.Backbone,
12 | _ = Monitor._;
13 |
14 | /**
15 | * A generic button for running javascript code
16 | *
17 | * When the button is pressed, it runs the code specified in the onPress element.
18 | *
19 | * @class Button
20 | * @extends Backbone.View
21 | * @constructor
22 | * @param options {Object} View initialization options (See others in Backbone.View)
23 | * @param options.label='buttonLabel' {String} The button label
24 | * @param options.icon='iconClass' {String} The icon class name
25 | * @param options.onPress='' {String} Javascript to run when the button is pressed
26 | */
27 | var Button = core.Button = Backbone.View.extend({
28 |
29 | // Define the view
30 | name: 'Button',
31 | tags: ['Control'],
32 | icon: 'image/Button.png',
33 | description: 'Displays a button, and fires an event when pressed',
34 | website: 'http://lorenwest.github.com/core-monitor',
35 | defaultOptions: {
36 | label: 'Button',
37 | icon: 'icon-star',
38 | onPress: ''
39 | },
40 |
41 | initialize: function(options) {
42 | var t = this;
43 | t.viewOptions = t.options.viewOptions;
44 | t.viewOptions.on('change', t.setLabel, t);
45 | },
46 |
47 | events: {
48 | 'click button': 'onClick'
49 | },
50 |
51 | render: function() {
52 | var t = this;
53 | t.$el
54 | .html(' ')
55 | .button();
56 | t.setLabel();
57 | },
58 |
59 | onClick: function() {
60 | var t = this,
61 | pageView = t.options.pageView,
62 | component = t.options.component,
63 | monitor = component.monitor,
64 | getMonitor = function(id) {return pageView.getMonitor(id);},
65 | onPress = t.viewOptions.get('onPress');
66 | if (onPress) {
67 | try {
68 | eval(onPress);
69 | } catch (e) {
70 | alert("Button press error: '" + e.message + "'");
71 | }
72 | }
73 | },
74 |
75 | setLabel: function() {
76 | var t = this;
77 | t.$('button i').attr('class', t.viewOptions.get('icon'));
78 | t.$('button span').text(t.viewOptions.get('label'));
79 | }
80 |
81 | });
82 |
83 |
84 | // Custom settings form for the Button view
85 | Button.SettingsView = Backbone.View.extend({
86 |
87 | initialize: function(options) {
88 | var t = this;
89 | $.styleSheet(Button.css, 'nm-core-bs-css');
90 | },
91 |
92 | render: function() {
93 | var t = this;
94 | t.$el.html(Button.template);
95 | new UI.IconChooser({el:t.$('select')});
96 | t.model.on('change:icon', t.changeIcon, t);
97 | t.changeIcon();
98 | },
99 |
100 | changeIcon: function() {
101 | var t = this;
102 | t.$('i').attr('class', t.model.get('icon'));
103 | },
104 |
105 | // Overridden to unbind form elements
106 | remove: function() {
107 | var t = this;
108 | t.model.off('change:icon', t.changeIcon, t);
109 | return Backbone.View.prototype.remove.apply(t, arguments);
110 | }
111 |
112 | });
113 |
114 | Button.css = {
115 | '.nm-core-bs i' : 'font-size: 18px; margin-left: 20px;'
116 | };
117 |
118 | Button.template =
119 | '' +
120 | 'Button Label ' +
121 | ' ' +
122 | 'Icon ' +
123 | '' +
124 | '(no icon) ' +
125 | ' ' +
126 | ' ' +
127 | 'On Button Press ' +
128 | ' ' +
129 | '
'
130 | ;
131 |
132 | }(this));
133 |
--------------------------------------------------------------------------------
/lib/view/Clock.js:
--------------------------------------------------------------------------------
1 | // Clock.js (c) 2010-2013 Loren West and other contributors
2 | // May be freely distributed under the MIT license.
3 | // For further details and documentation:
4 | // http://lorenwest.github.com/core-monitor
5 | (function(root){
6 |
7 | // Module loading
8 | var Monitor = root.Monitor || require('monitor-dashboard'),
9 | UI = Monitor.UI,
10 | core = UI.app.core = UI.app.core || {},
11 | Backbone = Monitor.Backbone,
12 | _ = Monitor._;
13 |
14 | // Constants
15 | var RE_RENDER_AFTER_MS = 60000;
16 |
17 | /**
18 | * A clock view
19 | *
20 | * @class Clock
21 | * @extends Backbone.View
22 | * @constructor
23 | * @param options {Object} View initialization options (See others in Backbone.View)
24 | * @param options.label='Chart' {String} The component label
25 | * @param options.icon='icon-bar-chart' {String} The icon class name
26 | * @param options.highcharts = {} {Object} Highcharts chart configuration object
27 | */
28 | var Clock = core.Clock = core.Chart.extend({
29 |
30 | // Define the view
31 | name: 'Clock',
32 | tags: ['Utility'],
33 | icon: 'image/Clock.png',
34 | description: 'A nice analog clock',
35 | defaultOptions: {
36 | title: 'Clock',
37 | highcharts: {
38 | chart: {
39 | type: 'gauge',
40 | margin: 0,
41 | plotBackgroundColor: 'transparent',
42 | plotBorderWidth: 0,
43 | plotShadow: false
44 | },
45 | plotOptions: {
46 | gauge: {
47 | dial: {
48 | backgroundColor: 'rgba(200,183,155,1)'
49 | },
50 | pivot: {
51 | backgroundColor: 'rgba(200,183,155,1)'
52 | }
53 | }
54 | },
55 |
56 | yAxis: {
57 | labels: {
58 | distance: -20
59 | },
60 | min: 0,
61 | max: 12,
62 | lineWidth: 0,
63 | showFirstLabel: false,
64 | minorTickInterval: 'auto',
65 | minorTickWidth: 1,
66 | minorTickLength: 5,
67 | minorTickPosition: 'inside',
68 | minorGridLineWidth: 0,
69 | minorTickColor: 'rgba(200,183,155,1)',
70 | tickInterval: 1,
71 | tickWidth: 2,
72 | tickPosition: 'inside',
73 | tickLength: 10,
74 | tickColor: 'rgba(200,183,155,1)',
75 | minPadding:0,
76 | maxPadding:0,
77 | title: {
78 | text: ''
79 | }
80 | },
81 | series: [{
82 | data: [{
83 | id: 'hour',
84 | y: 4,
85 | dial: {
86 | radius: '60%',
87 | baseWidth: 4,
88 | baseLength: '95%',
89 | rearLength: 0
90 | }
91 | }, {
92 | id: 'minute',
93 | y: 20,
94 | dial: {
95 | baseLength: '95%',
96 | rearLength: 0
97 | }
98 | }, {
99 | id: 'second',
100 | y: 0,
101 | dial: {
102 | radius: '100%',
103 | baseWidth: 1,
104 | rearLength: '20%'
105 | }
106 | }],
107 | animation: false,
108 | dataLabels: {
109 | enabled: false
110 | }
111 | }]
112 | }
113 | },
114 |
115 | initialize: function(options) {
116 | var t = this;
117 | options.component.setDefaultSize({
118 | width: 160,
119 | height: 160
120 | });
121 | core.Chart.prototype.initialize.apply(t, arguments);
122 | },
123 |
124 | render: function() {
125 | var t = this;
126 | core.Chart.prototype.render.apply(t, arguments);
127 |
128 | // Remember the last render time so we can refresh.
129 | // The clock needs complete refreshing or it'll peg the cpu
130 | t.lastRender = Date.now();
131 |
132 | // Add the toooltip formatter after the chart is known
133 | t.chart.options.tooltip.formatter = function(){return t.tooltipText;}
134 |
135 | // Kick off the timer
136 | t.onInterval();
137 | },
138 |
139 | onInterval: function() {
140 | var t = this,
141 | hour = t.chart.get('hour'),
142 | minute = t.chart.get('minute'),
143 | second = t.chart.get('second'),
144 | now = t.getNow(),
145 | // run animation unless we're wrapping around from 59 to 0
146 | // animation = now.seconds == 0 ? false : {easing: 'easeOutElastic'};
147 | animation = false;
148 |
149 | // Re-render now?
150 | if ((Date.now() - t.lastRender) > RE_RENDER_AFTER_MS) {
151 | t.$el.html('');
152 | t.render();
153 | return;
154 | }
155 |
156 | // Cache the tooltip text
157 | t.tooltipText =
158 | t.pad(Math.floor(now.hours), 2) + ':' +
159 | t.pad(Math.floor(now.minutes * 5), 2) + ':' +
160 | t.pad(now.seconds * 5, 2);
161 |
162 | hour.update(now.hours, true, animation);
163 | minute.update(now.minutes, true, animation);
164 | second.update(now.seconds, true, animation);
165 |
166 | // Set up for next iteration. This is done via setTimeout vs. setInterval
167 | // because setInterval caused performance problems over time.
168 | setTimeout(function(){t.onInterval();}, 1000);
169 | },
170 |
171 | pad: function(number, length) {
172 | // Create an array of the remaining length +1 and join it with 0's
173 | return new Array((length || 2) + 1 - String(number).length).join(0) + number;
174 | },
175 |
176 | // Get the current time
177 | getNow: function() {
178 | var now = new Date();
179 | return {
180 | hours: now.getHours() + now.getMinutes() / 60,
181 | minutes: now.getMinutes() * 12 / 60 + now.getSeconds() * 12 / 3600,
182 | seconds: now.getSeconds() * 12 / 60
183 | };
184 | }
185 |
186 | });
187 |
188 | // No settings for the clock
189 | Clock.SettingsView = Backbone.View.extend({});
190 |
191 | }(this));
192 |
193 | // Extend jQuery with some easing (copied from jQuery UI)
194 | $.extend($.easing, {
195 | easeOutElastic: function (x, t, b, c, d) {
196 | var s=1.70158;var p=0;var a=c;
197 | if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;
198 | if (a < Math.abs(c)) { a=c; var s=p/4; }
199 | else var s = p/(2*Math.PI) * Math.asin (c/a);
200 | return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;
201 | }
202 | });
203 |
--------------------------------------------------------------------------------
/lib/view/Gauge.js:
--------------------------------------------------------------------------------
1 | // Gauge.js (c) 2010-2013 Loren West and other contributors
2 | // May be freely distributed under the MIT license.
3 | // For further details and documentation:
4 | // http://lorenwest.github.com/core-monitor
5 | (function(root){
6 |
7 | // Module loading
8 | var Monitor = root.Monitor || require('monitor-dashboard'),
9 | UI = Monitor.UI,
10 | core = UI.app.core = UI.app.core || {},
11 | Chart = core.Chart,
12 | Backbone = Monitor.Backbone,
13 | _ = Monitor._;
14 |
15 | /**
16 | * A gague dial
17 | *
18 | * @class Gauge
19 | * @extends Backbone.View
20 | * @constructor
21 | * @param options {Object} View initialization options (See others in Backbone.View)
22 | * @param options.label='Chart' {String} The component label
23 | * @param options.icon='icon-bar-chart' {String} The icon class name
24 | * @param options.highcharts = {} {Object} Highcharts chart configuration object
25 | */
26 | var Gauge = core.Gauge = Chart.extend({
27 |
28 | // Define the view
29 | name: 'Gauge',
30 | tags: ['Chart', 'Real Time'],
31 | icon: 'image/Gauge.png',
32 | description: 'A gauge for displaying a single value change over time',
33 | defaultOptions: {
34 | title: 'Gauge',
35 | highcharts: {
36 | chart: {
37 | type: 'gauge',
38 | margin: 0,
39 | plotBackgroundColor: 'transparent',
40 | plotBorderWidth: 0,
41 | plotShadow: false
42 | },
43 |
44 | pane: {
45 | startAngle: -55,
46 | endAngle: 55,
47 | center: ['50%', '140%'],
48 | size: '250%'
49 | },
50 |
51 | plotOptions: {
52 | gauge: {
53 | dial: {
54 | radius: '100%',
55 | backgroundColor: 'rgba(200,183,155,1)'
56 | },
57 | pivot: {
58 | backgroundColor: 'rgba(200,183,155,1)'
59 | }
60 | }
61 | },
62 |
63 | yAxis: {
64 | labels: {
65 | distance: -22,
66 | style: {
67 | fontSize: '12px'
68 | },
69 | },
70 | min: 180,
71 | max: 230,
72 | tickInterval: 10,
73 |
74 | lineWidth: 0,
75 | showFirstLabel: true,
76 | showLastLabel: true,
77 | minorTickInterval: 'auto',
78 | minorTickWidth: 1,
79 | minorTickLength: 5,
80 | minorTickPosition: 'inside',
81 | minorGridLineWidth: 0,
82 | minorTickColor: 'rgba(200,183,155,1)',
83 | tickWidth: 2,
84 | tickPosition: 'inside',
85 | tickLength: 10,
86 | tickColor: 'rgba(200,183,155,1)',
87 | title: {
88 | text: 'Requests Per Second',
89 | }
90 | },
91 | series: [{
92 | name: "value",
93 | data: [214]
94 | }]
95 | }
96 | },
97 |
98 | initialize: function(options) {
99 | var t = this;
100 | options.component.setDefaultSize({
101 | width: 220,
102 | height: 100
103 | });
104 | core.Chart.prototype.initialize.apply(t, arguments);
105 |
106 | // See how to update realtime
107 | /*
108 | setInterval(function() {
109 | var num = (Math.random() * 50) + 180;
110 | console.log("Setting number to: " + num);
111 | var value = t.chart.get("value");
112 | value.update(num);
113 | }, 1000);
114 | */
115 | }
116 |
117 | });
118 |
119 | // This settings form is inherited by all charts.
120 | Gauge.SettingsView = Chart.SettingsView.extend({
121 |
122 | // Extend for local events
123 | events: _.extend({}, Chart.SettingsView.prototype.events, {
124 | "change *" : "onChange"
125 | }),
126 |
127 | render: function() {
128 | var t = this;
129 |
130 | // Call parent render to set up dom
131 | Chart.SettingsView.prototype.render.apply(t, arguments);
132 |
133 | // Set my title & HTML
134 | $('.core-chart-settings').append('' +
135 | '' +
136 | 'Gauge Label ' +
137 | ' ' +
138 | '
' +
139 | '' +
140 | 'Min Value ' +
141 | ' ' +
142 | '
' +
143 | '' +
144 | 'Max Value ' +
145 | ' ' +
146 | '
' +
147 | '' +
148 | 'Interval ' +
149 | ' ' +
150 | '
'
151 | );
152 |
153 | // Set initial field values
154 | t.label = t.$('.ylabel').val(t.hc.yAxis.title.text);
155 | t.min = t.$('.min-value').val(t.hc.yAxis.min);
156 | t.max = t.$('.max-value').val(t.hc.yAxis.max);
157 | t.tick = t.$('.tick-value').val(t.hc.yAxis.tickInterval);
158 |
159 | },
160 |
161 | onChange: function() {
162 | var t = this;
163 | t.hc.yAxis.title.text = t.label.val();
164 | t.hc.yAxis.min = parseInt(t.min.val());
165 | t.hc.yAxis.max = parseInt(t.max.val());
166 | t.hc.yAxis.tickInterval = parseInt(t.tick.val());
167 | }
168 | });
169 |
170 | }(this));
171 |
--------------------------------------------------------------------------------
/lib/view/Html.js:
--------------------------------------------------------------------------------
1 | // Html.js (c) 2012 Loren West and other contributors
2 | // May be freely distributed under the MIT license.
3 | // For further details and documentation:
4 | // http://lorenwest.github.com/core-monitor
5 | (function(root){
6 |
7 | // Module loading
8 | var Monitor = root.Monitor || require('monitor-dashboard'),
9 | UI = Monitor.UI,
10 | Backbone = Monitor.Backbone,
11 | Mustache = UI.Mustache,
12 | Template = UI.Template,
13 | core = UI.app.core = UI.app.core || {},
14 | _ = Monitor._,
15 | template = null;
16 |
17 | var FONT_SIZES = [
18 | 'x-small', 'small', 'medium',
19 | 'large', 'x-large', 'xx-large'];
20 |
21 | /**
22 | * A generic view for displaying HTML data.
23 | *
24 | * If a monitor is attached to this view, it applies the monitor data
25 | * to the HTML text as a template.
26 | *
27 | * @class Html
28 | * @extends Backbone.View
29 | * @constructor
30 | * @param options {Object} View initialization options (See others in Backbone.View)
31 | * @param options.htmlValue {String} HTML string to place
32 | */
33 | var Html = core.Html = Backbone.View.extend({
34 |
35 | // Define the view
36 | name: 'HTML Template',
37 | tags: ['Web'],
38 | icon: 'image/HTMLView.png',
39 | description: 'Send probe data through an HTML template',
40 | website: 'http://lorenwest.github.com/core-monitor',
41 | defaultOptions: {
42 | htmlValue: ''
43 | },
44 |
45 | // Constructor
46 | initialize: function(options) {
47 | var t = this;
48 | t.options = options;
49 | t.viewOptions = t.options.viewOptions;
50 | t.monitor = t.options.monitor;
51 | t.monitor.on('change', t.setValue, t);
52 | t.viewOptions.on('change', t.setValue, t);
53 | options.component.setDefaultSize({
54 | width: 300,
55 | height: 150
56 | });
57 | },
58 |
59 | render: function() {
60 | var t = this;
61 | t.setValue();
62 | },
63 |
64 | setValue: function() {
65 | var t = this,
66 | htmlValue = t.viewOptions.get('htmlValue'),
67 | monitor = t.monitor;
68 |
69 | // Run the monitor JSON through the template
70 | if (monitor) {
71 | // Send the non-templated value on template failure
72 | try {
73 | t.$el.html(Mustache.render(htmlValue, monitor.toJSON()));
74 | } catch(e) {
75 | t.$el.html(htmlValue);
76 | }
77 | } else {
78 | t.$el.html(htmlValue);
79 | }
80 | },
81 |
82 | // Overridden to unbind form elements
83 | remove: function() {
84 | var t = this;
85 | t.undelegateEvents();
86 | t.monitor.off('change', t.setValue, t);
87 | t.viewOptions.off('change', t.setValue, t);
88 | return Backbone.View.prototype.remove.apply(t, arguments);
89 | }
90 |
91 | });
92 |
93 | // Custom settings form for the Text view
94 | Html.SettingsView = Backbone.View.extend({
95 |
96 | initialize: function(options) {
97 | var t = this;
98 |
99 | // Build the template
100 | if (!template) {
101 | template = Template.fromDOM('#nm-template-core-Html');
102 | }
103 |
104 | // Clear this view when closing
105 | $('#nm-cv-settings').on('hide', function() {
106 | t.remove();
107 | });
108 | },
109 |
110 | events: {
111 | 'click .font-picker' : 'chooseFont'
112 | },
113 |
114 | render: function() {
115 | var t = this;
116 | t.monitor = t.monitor;
117 |
118 | // Render the HTML from the template
119 | t.$el.html(template.get('text'));
120 | t.textarea = t.$el.find('textarea');
121 |
122 | // Attach the monitor picker
123 | t.monitorPicker = new UI.MonitorPicker({
124 | el: t.$('.nm-core-html-monitor'),
125 | model: t.options.monitor
126 | });
127 | t.monitorPicker.render();
128 |
129 | // Attach the color picker
130 | t.$('.color-picker').miniColors({
131 | opacity:true,
132 | change: function(hex, rgba) {
133 | t.editor.composer.commands.exec("setStyles", "color: " + hex);
134 | }
135 | });
136 | t.$('.miniColors-trigger').attr('title', 'Font Color');
137 |
138 | // Create tooltips for all items that have a title
139 | UI.tooltip(t.$('#nm-core-html-toolbar [title]'));
140 |
141 | // Update the component when the textarea is being edited
142 | t.textarea
143 | .val(t.model.get('htmlValue'))
144 | .on('keydown change', function(){
145 | setTimeout(function(){
146 | t.onChange();
147 | },0);
148 | });
149 |
150 | // Attach an HTML editor
151 | t.editor = new wysihtml5.Editor("nm-core-html-textarea", {
152 | name: "nm-core-html-composer",
153 | toolbar: "nm-core-html-toolbar",
154 | style: false,
155 | stylesheets: [
156 | '/static/css/default/bootstrap.min.css',
157 | '/static/css/default/font-awesome.css',
158 | '/static/css/default/UI.css',
159 | '/static/css/default/PageView.css',
160 | '/static/css/default/ComponentView.css',
161 | '/app/core/css/Core.css',
162 | '/app/core/css/wysihtml5.css'],
163 | parser: function(str) {return str;} // Disable HTML sanitation
164 | });
165 |
166 | // Add the drop-down caret to dropdown toolbar items
167 | t.fontPicker = t.$el.find('.font-picker');
168 | UI.DropDownMenu.addCaret(t.fontPicker);
169 |
170 | // Intercept the setText method of the wysihtml5 TextArea
171 | // to update the component when the HTML editor is active.
172 | var oldSet = t.editor.textarea.setValue;
173 | t.editor.textarea.setValue = function() {
174 | oldSet.apply(t.editor.textarea, [arguments[0]]);
175 | t.onChange();
176 | }
177 |
178 | // Build a setStyle function to allow setting styles on a selected element
179 | wysihtml5.commands.setStyles = {
180 | exec: function(composer, command, styles) {
181 | // Make sure the element is wrapped in a span
182 | wysihtml5.commands.formatInline.exec(composer, command, "span");
183 | var selection = composer.selection.getSelectedNode();
184 | if (selection && selection.parentElement) {
185 | wysihtml5.dom.setStyles(styles).on(selection.parentElement);
186 | }
187 | }
188 | };
189 |
190 | },
191 |
192 | chooseFont: function() {
193 | var t = this,
194 | startPos = 26,
195 | model = [];
196 |
197 | // Add font sizes to the model
198 | FONT_SIZES.forEach(function(size){
199 | model.push(
200 | // Change startPos if this string changes!!
201 | '' + size + ' ');
204 | });
205 |
206 | // Add the dropdown menus to the toolbar
207 | var dropDown = new UI.DropDownMenu({
208 | contextEl: t.fontPicker,
209 | model: model
210 | });
211 | dropDown.on('select', function(item) {
212 | var size = item.substr(26).split('"')[0];
213 | t.editor.composer.commands.exec("fontSize", size);
214 | }).render();
215 | },
216 |
217 | onChange: function() {
218 | var t = this,
219 | htmlValue = t.textarea.val();
220 | t.model.set('htmlValue', htmlValue);
221 | },
222 |
223 | remove: function() {
224 | var t = this;
225 | t.monitorPicker.remove();
226 | t.$el.html('');
227 | return Backbone.View.prototype.remove.apply(t, arguments);
228 | }
229 |
230 | });
231 |
232 |
233 | }(this));
234 |
--------------------------------------------------------------------------------
/lib/view/Inspector.js:
--------------------------------------------------------------------------------
1 | // Inspector.js (c) 2010-2013 Loren West and other contributors
2 | // May be freely distributed under the MIT license.
3 | // For further details and documentation:
4 | // http://lorenwest.github.com/core-monitor
5 | (function(root){
6 |
7 | // Module loading
8 | var Monitor = root.Monitor || require('monitor-dashboard'),
9 | UI = Monitor.UI,
10 | Backbone = Monitor.Backbone,
11 | _ = Monitor._;
12 |
13 | /**
14 | * View the probe JSON
15 | *
16 | * @class Inspector
17 | * @extends Backbone.View
18 | * @constructor
19 | * @param options {Object} View initialization options (See others in Backbone.View)
20 | */
21 | var Inspector = UI.app.core.Inspector = Backbone.View.extend({
22 |
23 | // Define the view
24 | name: 'Object Inspector',
25 | tags: ['Utility'],
26 | icon: 'image/ObjectInspector.png',
27 | description: 'Inspects variables and expressions in the browser or Node.js process',
28 | defaultOptions: {
29 | title: 'Object Inspector',
30 | background: true
31 | },
32 |
33 | initialize: function(options) {
34 | var t = this;
35 | // Initialize a blank monitor
36 | t.monitor = options.monitor;
37 | t.component = options.component;
38 | if (!t.monitor.get('probeClass')) {
39 | t.monitor.set({
40 | probeClass: 'Inspect',
41 | initParams: {
42 | key: Monitor.commonJS ? 'global' : 'window',
43 | depth: Monitor.commonJS ? 2 : 1
44 | }
45 | });
46 | }
47 | options.component.setDefaultSize({
48 | width: 350,
49 | height: 400
50 | });
51 | },
52 |
53 | events: {
54 | },
55 |
56 | render: function() {
57 | var t = this;
58 |
59 | // Clear out any prior JSON
60 | if (t.jsonView) {
61 | t.jsonView.remove();
62 | t.jsonView = null;
63 | }
64 | t.outerView = t.$el.html('
')
65 | .find('.nm-core-inspector');
66 | t.jsonView = new UI.JsonView({
67 | heading: "INSPECTING: " + t.monitor.get('initParams').key,
68 | model: t.monitor.get('value'),
69 | closedOnInit: true
70 | });
71 | t.jsonView.render();
72 | t.outerView.append(t.jsonView.$el);
73 |
74 | // Re-render on change
75 | t.resetData = function(){
76 | t.jsonView.setData(t.monitor.get('value'));
77 | };
78 | t.monitor.on('change:value', t.resetData, t);
79 | },
80 |
81 | destroy: function() {
82 | var t = this;
83 | t.monitor.off('change:value', t.resetData, t);
84 | }
85 |
86 | });
87 |
88 | // Custom settings form
89 | Inspector.SettingsView = Backbone.View.extend({
90 |
91 | render: function() {
92 | var t = this;
93 | t.monitor = t.options.monitor;
94 | t.$el.html('' +
95 | '' +
101 | '' +
102 | 'JSON Depth ' +
103 | ' ' +
104 | '
');
105 |
106 | // Append a server picker
107 | t.serverPicker = new UI.MonitorPicker.ServerView({
108 | el: t.$el.find('.server'),
109 | model: t.monitor
110 | });
111 | t.serverPicker.render();
112 | }
113 |
114 | });
115 |
116 | }(this));
117 |
--------------------------------------------------------------------------------
/lib/view/LineChart.js:
--------------------------------------------------------------------------------
1 | // LineChart.js (c) 2010-2013 Loren West and other contributors
2 | // May be freely distributed under the MIT license.
3 | // For further details and documentation:
4 | // http://lorenwest.github.com/core-monitor
5 | (function(root){
6 |
7 | // Module loading
8 | var Monitor = root.Monitor || require('monitor-dashboard'),
9 | UI = Monitor.UI,
10 | core = UI.app.core = UI.app.core || {},
11 | Chart = core.Chart,
12 | Backbone = Monitor.Backbone,
13 | _ = Monitor._;
14 |
15 | /**
16 | * A line chart view
17 | *
18 | * @class LineChart
19 | * @extends Backbone.View
20 | * @constructor
21 | * @param options {Object} View initialization options (See others in Backbone.View)
22 | * @param options.label='Chart' {String} The component label
23 | * @param options.icon='icon-bar-chart' {String} The icon class name
24 | * @param options.highcharts = {} {Object} Highcharts chart configuration object
25 | */
26 | var LineChart = core.LineChart = Chart.extend({
27 |
28 | // Define the view
29 | name: 'LineChart',
30 | tags: ['Chart', 'Time Series', 'Real Time'],
31 | icon: 'image/LineChart.png',
32 | description: 'A line chart',
33 | defaultOptions: {
34 | title: 'Line Chart',
35 | highcharts: {
36 | chart: {
37 | type: 'line',
38 | margin: null
39 | },
40 | legend: {
41 | enabled: false
42 | },
43 | xAxis: {
44 | title: {
45 | text: 'Values'
46 | },
47 | labels: {
48 | enabled:true
49 | }
50 | },
51 | yAxis: {
52 | title: {
53 | text: ''
54 | },
55 | labels: {
56 | enabled:true
57 | }
58 | },
59 | plotOptions: {
60 | line: {
61 | }
62 | },
63 | series: [{
64 | name: 'value',
65 | data: [1,0,4,10,3,8,7,7,3,0,5]
66 | }]
67 | }
68 | },
69 |
70 | initialize: function(options) {
71 | var t = this;
72 | Chart.prototype.initialize.apply(t, arguments);
73 | }
74 |
75 | });
76 |
77 | // This settings form is inherited by all charts.
78 | LineChart.SettingsView = Chart.SettingsView.extend({
79 |
80 | // Extend for local events
81 | events: _.extend({}, Chart.SettingsView.prototype.events, {
82 | "change *" : "onChange"
83 | }),
84 |
85 | render: function() {
86 | var t = this;
87 |
88 | // Call parent render to set up dom
89 | Chart.SettingsView.prototype.render.apply(t, arguments);
90 |
91 | // Set my title & HTML
92 | $('.core-chart-settings').append('' +
93 | '' +
94 | 'X Axis Label ' +
95 | ' ' +
96 | '
' +
97 | '' +
98 | 'Y Axis Label ' +
99 | ' ' +
100 | '
'
101 | );
102 |
103 | // Set initial field values
104 | t.xlabel = t.$('.xlabel').val(t.hc.xAxis.title.text);
105 | t.ylabel = t.$('.ylabel').val(t.hc.yAxis.title.text);
106 | },
107 |
108 | onChange: function() {
109 | var t = this;
110 | t.hc.xAxis.title.text = t.xlabel.val();
111 | t.hc.yAxis.title.text = t.ylabel.val();
112 | }
113 | });
114 |
115 | }(this));
116 |
--------------------------------------------------------------------------------
/lib/view/LogViewer.js:
--------------------------------------------------------------------------------
1 | // LogViewer.js (c) 2010-2013 Loren West and other contributors
2 | // May be freely distributed under the MIT license.
3 | // For further details and documentation:
4 | // http://lorenwest.github.com/core-monitor
5 | (function(root){
6 |
7 | // Module loading
8 | var Monitor = root.Monitor || require('monitor-dashboard'),
9 | logger = Monitor.getLogger('LogViewer'),
10 | UI = Monitor.UI,
11 | Backbone = Monitor.Backbone,
12 | core = UI.app.core = UI.app.core || {},
13 | _ = Monitor._;
14 |
15 | /**
16 | * A viewer for log statements
17 | *
18 | * @class LogViewer
19 | * @extends Backbone.View
20 | * @constructor
21 | * @param options {Object} View initialization options (See others in Backbone.View)
22 | */
23 | var LogViewer = core.LogViewer = Backbone.View.extend({
24 |
25 | // Define the view
26 | name: 'Log Viewer',
27 | tags: ['Utility'],
28 | icon: 'image/LogViewer.png',
29 | description: 'A listener and viewer for application logs',
30 | website: 'http://lorenwest.github.com/core-monitor',
31 | defaultOptions: {
32 | title: 'Log Viewer',
33 | background: true
34 | },
35 |
36 | // Constructor
37 | initialize: function(options) {
38 | var t = this;
39 | t.options = options;
40 | t.monitor = options.monitor;
41 | options.component.setDefaultSize({
42 | width: 600,
43 | height: 400
44 | });
45 |
46 | // Set default monitor options
47 | if (!t.monitor.get('probeClass')) {
48 | t.monitor.set({
49 | probeClass: 'Log',
50 | initParams: {
51 | pattern: "{trace,debug,info,warn,error,fatal}.*"
52 | }
53 | });
54 | }
55 |
56 | // Set up logging
57 | t.logCtxt = t.monitor.get('initParams');
58 | logger.info('init', t.logCtxt);
59 | },
60 |
61 | // Process output from the backend
62 | _onChange: function(monitorEvent){
63 | var t = this,
64 | bundle = t.monitor.get('bundle');
65 |
66 | logger.info('onChange', t.logCtxt, bundle);
67 | if (bundle) {
68 | bundle.forEach(function(logItem) {
69 | t.lineOut(logItem);
70 | });
71 | }
72 | },
73 |
74 | render: function() {
75 | var t = this;
76 |
77 | // Create the monitor in the loading state
78 | t.body = $('').appendTo(t.$el);
79 |
80 | // Listen for monitor events
81 | t.monitor.on('change', t._onChange, t);
82 | },
83 |
84 | events: {
85 | "click .output_line": "onOpenClose"
86 | },
87 |
88 | onOpenClose: function(e) {
89 | var t = this,
90 | elem = $(e.currentTarget);
91 |
92 | elem.toggleClass('opened');
93 | t.displayLine(elem);
94 | },
95 |
96 | // Output a log line to the viewer
97 | lineOut: function(logItem){
98 | var t = this;
99 |
100 | // Generate a line to output to
101 | lastLine = $(' ')
102 | .data('item', logItem)
103 | .appendTo(t.body);
104 | t.displayLine(lastLine);
105 | t.viewLastLine();
106 | },
107 |
108 | // Display an existing line
109 | displayLine: function(elem){
110 | var t = this,
111 | logItem = elem.data('item'),
112 | isOpen = elem.hasClass('opened'),
113 | time = new Date(logItem[0]),
114 | log = {
115 | time: time,
116 | type: logItem[1],
117 | module: logItem[2],
118 | name: logItem[3],
119 | args: logItem.slice(4)
120 | },
121 | shortTime = t.digits(time.getHours(), 2) + ":" +
122 | t.digits(time.getMinutes(), 2) + ':' +
123 | t.digits(time.getSeconds(), 2) + '.' +
124 | t.digits(time.getMilliseconds(), 3);
125 |
126 | // Build the line to output
127 | var line = shortTime + ' [' + log.type + '] ' + log.module + '.' + log.name,
128 | argStr;
129 | if (isOpen) {
130 | line += '\n ' + logItem[0];
131 | log.args.forEach(function(arg) {
132 | if (!arg) {return;} // Sometimes last arg is undefined
133 | try {
134 | argStr = JSON.stringify(arg, null, 2);
135 | } catch(e) {
136 | argStr = Monitor.stringify(arg);
137 | }
138 | line += '\n ' + argStr.replace(/\n/g,'\n ');
139 | });
140 | }
141 | else {
142 | try {
143 | argStr = JSON.stringify(log.args);
144 | } catch(e) {
145 | argStr = Monitor.stringify(log.args);
146 | }
147 | line += ' ' + argStr.replace(/\r*\n\s*/g,' ');
148 | }
149 |
150 | // Display the open/close caret, and the output
151 | elem.find('i').attr('class', 'icon-caret-' + (isOpen ? 'down' : 'right'))
152 | elem.find('.nm-core-lv-out').text(line);
153 | },
154 |
155 | // Format an integer into a specified number of digits, with leading zeros
156 | digits: function(number, digits) {
157 | var ret = '' + number,
158 | len = ret.length;
159 | if (len == digits) {
160 | return ret;
161 | }
162 | else if (len < digits) {
163 | return '0000'.substr(0, digits - len) + ret;
164 | }
165 | return ret.substr(0, digits);
166 | },
167 |
168 | // Scroll the view to the last line
169 | //TODO: Stabilize output if they've manually scrolled (unless they're at the bottom)
170 | viewLastLine: function(){
171 | var t = this;
172 | t.$el.scrollTop(1000000).scrollLeft(0);
173 | }
174 |
175 | });
176 |
177 | // Custom settings form for the Text view
178 | LogViewer.SettingsView = Backbone.View.extend({
179 |
180 | render: function() {
181 | var t = this;
182 | t.monitor = t.options.monitor;
183 | t.initParams = t.monitor.get('initParams');
184 | t.$el.html('' +
185 | '');
191 |
192 | // Append a server picker
193 | t.serverPicker = new UI.MonitorPicker.ServerView({
194 | el: t.$el.find('.server'),
195 | model: t.monitor
196 | });
197 | t.serverPicker.render();
198 |
199 | // Place configuration elements
200 | t.$el.find('.nm-core-lv-pattern').val(t.initParams.pattern);
201 |
202 | },
203 |
204 | events: {
205 | "change *" : "onChange"
206 | },
207 |
208 | onChange: function() {
209 | var t = this;
210 | t.initParams.pattern = t.$('.nm-core-lv-pattern').val();
211 | }
212 |
213 | });
214 |
215 | }(this));
216 |
--------------------------------------------------------------------------------
/lib/view/Macro.js:
--------------------------------------------------------------------------------
1 | // Macro.js (c) 2010-2013 Loren West and other contributors
2 | // May be freely distributed under the MIT license.
3 | // For further details and documentation:
4 | // http://lorenwest.github.com/core-monitor
5 | (function(root){
6 |
7 | // Module loading
8 | var Monitor = root.Monitor || require('monitor-dashboard'),
9 | UI = Monitor.UI,
10 | core = UI.app.core = UI.app.core || {},
11 | Backbone = Monitor.Backbone, _ = Monitor._;
12 |
13 | /**
14 | * A REPL macro
15 | *
16 | * @class Macro
17 | * @extends Backbone.Model
18 | * @constructor
19 | * @param model - Initial data model. Can be a JS object or another Model.
20 | * @param model.id {String} The key to the macro
21 | * @param [model.description] {String} Description of the macro
22 | * @param [model.lines] {String} Macro command lines (separated by \n)
23 | */
24 | var Macro = core.Macro = Backbone.Model.extend({
25 |
26 | defaults: {
27 | id:'',
28 | description:'',
29 | lines:''
30 | },
31 |
32 | /**
33 | * Get the macro lines as an array of strings
34 | *
35 | * @method getLines
36 | * @returns [String] Macro lines
37 | */
38 | getLines: function() {
39 | var t = this;
40 | return t.get('lines').trim().split('\n');
41 | }
42 |
43 | });
44 |
45 | /**
46 | * Constructor for a list of Macro objects
47 | *
48 | * var myList = new Macro.List(initialElements);
49 | *
50 | * @static
51 | * @method List
52 | * @param [items] {Array} Initial list items. These can be raw JS objects or Macro data model objects.
53 | * @return {Backbone.Collection} Collection of Macro data model objects
54 | */
55 | Macro.List = Backbone.Collection.extend({model: Macro});
56 |
57 | }(this));
58 |
--------------------------------------------------------------------------------
/lib/view/MacroEditor.js:
--------------------------------------------------------------------------------
1 | // MacroEditor.js (c) 2010-2013 Loren West and other contributors
2 | // May be freely distributed under the MIT license.
3 | // For further details and documentation:
4 | // http://lorenwest.github.com/core-monitor
5 | (function(root){
6 |
7 | // Module loading
8 | var Monitor = root.Monitor || require('monitor-dashboard'),
9 | UI = Monitor.UI,
10 | Template = UI.Template,
11 | core = UI.app.core = UI.app.core || {},
12 | Backbone = Monitor.Backbone,
13 | template,
14 | _ = Monitor._;
15 |
16 | /**
17 | * The REPL macro editor dialog view
18 | *
19 | * @class MacroEditor
20 | * @extends Backbone.View
21 | * @constructor
22 | * @param options {Object} View initialization options (See others in Backbone.View)
23 | * @param options.model {Macro} - A Macro object
24 | */
25 | var MacroEditor = core.MacroEditor = Backbone.View.extend({
26 |
27 | initialize: function(options) {
28 | var t = this;
29 | t.model = t.options.model;
30 | t.modelBinder = new Backbone.ModelBinder();
31 | if (!template) {
32 | template = Template.fromDOM('#nm-template-core-MacroEditor');
33 | }
34 | },
35 |
36 | events: {
37 | "click .btn-primary" : "savePageChanges",
38 | "click .btn-cancel" : "cancelChanges",
39 | },
40 |
41 | render: function() {
42 | var t = this;
43 | t.$el.append(template.get('text'));
44 | t.editor = t.$('#nm-core-me');
45 | t.editor.centerBox().css({top:40}).modal('show');
46 | t.editor.on('shown', function() {
47 | t.$('.nm-core-me-desc').focus();
48 | });
49 | t.editor.on('hidden', function() {
50 | if (typeof t.options.onClose === 'function') {
51 | t.options.onClose();
52 | }
53 | });
54 | t.modelBinder.bind(t.model, t.$el);
55 | },
56 |
57 | savePageChanges: function() {
58 | var t = this;
59 | if (typeof t.options.onSave === 'function') {
60 | t.options.onSave();
61 | }
62 | },
63 |
64 | cancelChanges: function() {
65 | var t = this;
66 | if (typeof t.options.onCancel === 'function') {
67 | t.options.onCancel();
68 | }
69 | }
70 |
71 | });
72 |
73 |
74 | }(this));
75 |
--------------------------------------------------------------------------------
/lib/view/PieChart.js:
--------------------------------------------------------------------------------
1 | // PieChart.js (c) 2010-2013 Loren West and other contributors
2 | // May be freely distributed under the MIT license.
3 | // For further details and documentation:
4 | // http://lorenwest.github.com/core-monitor
5 | (function(root){
6 |
7 | // Module loading
8 | var Monitor = root.Monitor || require('monitor-dashboard'),
9 | UI = Monitor.UI,
10 | core = UI.app.core = UI.app.core || {},
11 | Backbone = Monitor.Backbone,
12 | _ = Monitor._;
13 |
14 | /**
15 | * A par chart view
16 | *
17 | * @class PieChart
18 | * @extends Backbone.View
19 | * @constructor
20 | * @param options {Object} View initialization options (See others in Backbone.View)
21 | * @param options.label='Chart' {String} The component label
22 | * @param options.icon='icon-bar-chart' {String} The icon class name
23 | * @param options.highcharts = {} {Object} Highcharts chart configuration object
24 | */
25 | var PieChart = core.PieChart = core.Chart.extend({
26 |
27 | // Define the view
28 | name: 'PieChart',
29 | tags: ['Chart'],
30 | icon: 'image/PieChart.png',
31 | description: 'A pie chart',
32 | defaultOptions: {
33 | title: 'Pie Chart',
34 | highcharts: {
35 | chart: {
36 | type: 'pie'
37 | },
38 | legend: {
39 | enabled: false
40 | },
41 | xAxis: {
42 | lineWidth: 0,
43 | gridLineWidth: 0,
44 | tickWidth: 0,
45 | labels: {
46 | enabled:false
47 | }
48 | },
49 | yAxis: {
50 | gridLineWidth: 0,
51 | tickWidth: 0,
52 | maxPadding:0,
53 | minPadding:0,
54 | endOnTick:true,
55 | title: '',
56 | labels: {
57 | enabled:false
58 | }
59 | },
60 | plotOptions: {
61 | pie: {
62 | color: 'rgba(200,183,155,1)',
63 | dataLabels: {
64 | color: 'rgba(200,183,155,1)'
65 | },
66 | marker: {
67 | enabled: false
68 | }
69 | }
70 | },
71 | series: [{
72 | name: 'value',
73 | data: [1,0,4,10,3,8,7,7,3,0,5]
74 | }]
75 | }
76 | },
77 |
78 | initialize: function(options) {
79 | var t = this;
80 | core.Chart.prototype.initialize.apply(t, arguments);
81 | }
82 |
83 | });
84 |
85 | }(this));
86 |
--------------------------------------------------------------------------------
/lib/view/Probe.js:
--------------------------------------------------------------------------------
1 | // Probe.js (c) 2010-2013 Loren West and other contributors
2 | // May be freely distributed under the MIT license.
3 | // For further details and documentation:
4 | // http://lorenwest.github.com/core-monitor
5 | (function(root){
6 |
7 | // Module loading
8 | var Monitor = root.Monitor || require('monitor-dashboard'),
9 | UI = Monitor.UI,
10 | Backbone = Monitor.Backbone,
11 | _ = Monitor._;
12 |
13 | /**
14 | * View the probe JSON
15 | *
16 | * @class Probe
17 | * @extends Backbone.View
18 | * @constructor
19 | * @param options {Object} View initialization options (See others in Backbone.View)
20 | */
21 | var Probe= UI.app.core.Probe= Backbone.View.extend({
22 |
23 | // Define the view
24 | name: 'Probe Viewer',
25 | icon: 'image/ProbeViewer.png',
26 | description: 'Displays the raw probe JSON',
27 | defaultOptions: {
28 | title: 'Probe Viewer',
29 | background: true
30 | },
31 |
32 | initialize: function(options) {
33 | var t = this;
34 | t.monitor = options.monitor;
35 | t.component = options.component;
36 | options.component.setDefaultSize({
37 | width: 300,
38 | height: 300
39 | });
40 | },
41 |
42 | events: {
43 | },
44 |
45 | render: function() {
46 | var t = this;
47 |
48 | // Clear out any prior JSON
49 | if (t.jsonView) {
50 | t.jsonView.remove();
51 | t.jsonView = null;
52 | }
53 | t.outerView = t.$el.html('
')
54 | .find('.nm-core-probe');
55 |
56 | t.jsonView = new UI.JsonView({model: t.monitor, closedOnInit:true});
57 | t.jsonView.render();
58 | t.outerView.append(t.jsonView.$el);
59 |
60 | }
61 |
62 | });
63 |
64 | // Custom settings form
65 | Probe.SettingsView = Backbone.View.extend({
66 |
67 | initialize: function(options) {
68 | var t = this;
69 | },
70 |
71 | events: {
72 | },
73 |
74 | render: function() {
75 | var t = this;
76 | t.monitor = t.options.monitor;
77 |
78 | // Append a monitor picker
79 | t.monitorPicker = new UI.MonitorPicker({
80 | el: t.$el,
81 | model: t.monitor
82 | });
83 | t.monitorPicker.render();
84 | },
85 |
86 | });
87 |
88 | }(this));
89 |
--------------------------------------------------------------------------------
/lib/view/Slider.js:
--------------------------------------------------------------------------------
1 | // Slider.js (c) 2010-2013 Loren West and other contributors
2 | // May be freely distributed under the MIT license.
3 | // For further details and documentation:
4 | // http://lorenwest.github.com/core-monitor
5 | (function(root){
6 |
7 | // Module loading
8 | var Monitor = root.Monitor || require('monitor-dashboard'),
9 | UI = Monitor.UI,
10 | core = UI.app.core = UI.app.core || {},
11 | Backbone = Monitor.Backbone,
12 | _ = Monitor._;
13 |
14 | /**
15 | * A generic slider
16 | *
17 | * The slider is initialized with a minimum, maximum, and current value, which
18 | * sets the initial position.
19 | *
20 | * As the slider is moved, the 'onSlide' event is emitted from the view.
21 | *
22 | *
23 | * @class Slider
24 | * @extends Backbone.View
25 | * @constructor
26 | * @param options {Object} View initialization options (See others in Backbone.View)
27 | * @param [options.min=0] {Numeric} The minimum value
28 | * @param [options.max=100] {Numeric} The maximum value
29 | * @param [options.step=1] {Numeric} The slider step amount
30 | * @param [options.initial=0] {Numeric} The initial slider value
31 | * @param options.onSlide {String} Javascript code to run when the slider is positioned.
32 | */
33 | var Slider = core.Slider = Backbone.View.extend({
34 |
35 | // Define the view
36 | name: 'Slider',
37 | tags: ['Control'],
38 | icon: 'image/Slider.png',
39 | description: 'Displays a slider control, firing onSlide events as the control is moved',
40 | website: 'http://lorenwest.github.com/core-monitor',
41 | defaultOptions: {
42 | min: 0,
43 | max: 100,
44 | step: 1,
45 | initial: 0,
46 | onSlide: ''
47 | },
48 |
49 | initialize: function(options) {
50 | var t = this;
51 | t.viewOptions = t.options.viewOptions;
52 | },
53 |
54 | events: {
55 | 'change .nm-core-slider': 'onSlide',
56 | 'keyup .nm-core-slider': 'onChange',
57 | 'mouseup .nm-core-slider': 'onChange',
58 | 'keydown .nm-core-slider': 'onDown',
59 | 'mousedown .nm-core-slider': 'onDown'
60 | },
61 |
62 | render: function() {
63 | var t = this,
64 | viewOpts = t.viewOptions.toJSON();
65 | t.slider = t.$el
66 | .html(' ')
67 | t.slider = t.$('.nm-core-slider');
68 | t.slider.attr({
69 | min: viewOpts.min,
70 | max: viewOpts.max,
71 | step: viewOpts.step,
72 | value: viewOpts.initial
73 | });
74 | t.slider.focus();
75 | },
76 |
77 | onSlide: function() {
78 | console.log("onSlide. Value: " + this.slider.val());
79 | },
80 | onChange: function() {
81 | console.log("onChange. Value: " + this.slider.val());
82 | },
83 | onDown: function() {
84 | console.log("onDown. Value: " + this.slider.val());
85 | },
86 | onResize: function() {
87 | var t = this,
88 | pageView = t.options.pageView,
89 | component = t.options.component,
90 | monitor = component.monitor,
91 | getMonitor = function(id) {return pageView.getMonitor(id);},
92 | onSlide = t.viewOptions.get('onPress');
93 | if (onSlide) {
94 | try {
95 | eval(onSlide);
96 | } catch (e) {
97 | alert("OnSlide error: '" + e.message + "'");
98 | }
99 | }
100 | }
101 |
102 | });
103 |
104 |
105 | // Custom settings form for the Slider view
106 | Slider.SettingsView = Backbone.View.extend({
107 |
108 | initialize: function(options) {
109 | var t = this;
110 | $.styleSheet(Slider.css, 'nm-core-ss-css');
111 | },
112 |
113 | render: function() {
114 | var t = this;
115 | t.$el.html(Slider.template);
116 | new UI.IconChooser({el:t.$('select')});
117 | t.model.on('change:icon', t.changeIcon, t);
118 | t.changeIcon();
119 | },
120 |
121 | changeIcon: function() {
122 | var t = this;
123 | t.$('i').attr('class', t.model.get('icon'));
124 | },
125 |
126 | // Overridden to unbind form elements
127 | remove: function() {
128 | var t = this;
129 | t.model.off('change:icon', t.changeIcon, t);
130 | return Backbone.View.prototype.remove.apply(t, arguments);
131 | }
132 |
133 | });
134 |
135 | Slider.css = {
136 | '.nm-core-ss i' : 'font-size: 18px; margin-left: 20px;'
137 | };
138 |
139 | Slider.template =
140 | '' +
141 | 'Slider Label ' +
142 | ' ' +
143 | 'Icon ' +
144 | '' +
145 | '(no icon) ' +
146 | ' ' +
147 | ' ' +
148 | 'On Slider Press ' +
149 | ' ' +
150 | '
'
151 | ;
152 |
153 | }(this));
154 |
--------------------------------------------------------------------------------
/lib/view/SparkLine.js:
--------------------------------------------------------------------------------
1 | // SparkLine.js (c) 2010-2013 Loren West and other contributors
2 | // May be freely distributed under the MIT license.
3 | // For further details and documentation:
4 | // http://lorenwest.github.com/core-monitor
5 | (function(root){
6 |
7 | // Module loading
8 | var Monitor = root.Monitor || require('monitor-dashboard'),
9 | UI = Monitor.UI,
10 | core = UI.app.core = UI.app.core || {},
11 | Chart = core.Chart,
12 | Backbone = Monitor.Backbone,
13 | _ = Monitor._;
14 |
15 | /**
16 | * A sparkline view
17 | *
18 | * @class SparkLine
19 | * @extends Backbone.View
20 | * @constructor
21 | * @param options {Object} View initialization options (See others in Backbone.View)
22 | * @param options.label='Chart' {String} The component label
23 | * @param options.icon='icon-bar-chart' {String} The icon class name
24 | * @param options.highcharts = {} {Object} Highcharts chart configuration object
25 | */
26 | var SparkLine = core.SparkLine = Chart.extend({
27 |
28 | // Define the view
29 | name: 'SparkLine',
30 | tags: ['Chart', 'Time Series', 'Real Time'],
31 | icon: 'image/SparkLine.png',
32 | description: 'Displays time-series data in a compact form',
33 | defaultOptions: {
34 | title: 'Spark Line',
35 | highcharts: {
36 | chart: {
37 | type: 'line',
38 | marginTop: 0,
39 | marginBottom: 0,
40 | marginRight: 5
41 | },
42 | legend: {
43 | enabled: false
44 | },
45 | xAxis: {
46 | lineWidth: 0,
47 | gridLineWidth: 0,
48 | tickWidth: 0,
49 | labels: {
50 | enabled:false
51 | }
52 | },
53 | yAxis: {
54 | gridLineWidth: 0,
55 | tickWidth: 0,
56 | maxPadding:0,
57 | minPadding:0,
58 | endOnTick:true,
59 | title: {
60 | text: ''
61 | },
62 | labels: {
63 | enabled:false
64 | }
65 | },
66 | plotOptions: {
67 | line: {
68 | color: 'rgba(200,183,155,1)',
69 | marker: {
70 | enabled: false
71 | }
72 | }
73 | },
74 | series: [{
75 | name: 'value',
76 | data: [1,0,4,10,3,8,7,7,3,0,5]
77 | }]
78 | }
79 | },
80 |
81 | initialize: function(options) {
82 | var t = this;
83 | options.component.setDefaultSize({
84 | width: 240,
85 | height: 80
86 | });
87 | Chart.prototype.initialize.apply(t, arguments);
88 | }
89 |
90 | });
91 |
92 | }(this));
93 |
--------------------------------------------------------------------------------
/lib/view/WebView.js:
--------------------------------------------------------------------------------
1 | // WebView.js (c) 2010-2013 Loren West and other contributors
2 | // May be freely distributed under the MIT license.
3 | // For further details and documentation:
4 | // http://lorenwest.github.com/core-monitor
5 | (function(root){
6 |
7 | // Module loading
8 | var Monitor = root.Monitor || require('monitor-dashboard'),
9 | UI = Monitor.UI,
10 | Backbone = Monitor.Backbone,
11 | _ = Monitor._;
12 |
13 | /**
14 | * Web page viewport
15 | *
16 | * @class WebView
17 | * @extends Backbone.View
18 | * @constructor
19 | * @param options {Object} View initialization options (See others in Backbone.View)
20 | */
21 | var WebView= UI.app.core.WebView= Backbone.View.extend({
22 |
23 | // Define the view
24 | name: 'Web Snippet',
25 | tags: ['Web'],
26 | icon: 'image/WebClip.png',
27 | description: 'Displays a snippet of a remote web page',
28 | defaultOptions: {
29 | title: 'Web Snippet',
30 | background: true,
31 | siteUrl: '',
32 | scrollBars: false,
33 | offsetTop: 0,
34 | offsetLeft: 0
35 | },
36 |
37 | initialize: function(options) {
38 | var t = this;
39 | t.component = options.component;
40 | t.viewOptions = options.viewOptions;
41 | if (t.component) {
42 | t.component.setDefaultSize({
43 | width: 300,
44 | height: 300
45 | });
46 | }
47 |
48 | // Change immediately on option changes
49 | t.viewOptions.on('change', function(){t.style(false);});
50 | },
51 |
52 | render: function() {
53 | var t = this;
54 |
55 | // Place the iframe & style it
56 | t.view =
57 | t.$el.html(
58 | '' +
59 | '' +
60 | '
')
61 | .find('.nm-core-wv');
62 | t.iFrame = t.view.find('.nm-core-wv-iframe');
63 | t.style(true);
64 | t.iFrame.on('load', function(){
65 | t.style();
66 | setTimeout(function(){
67 | t.style();
68 | }, 0);
69 | });
70 | },
71 |
72 | style: function(initial) {
73 | var t = this,
74 | css,
75 | opts = t.viewOptions.toJSON();
76 |
77 | // Style the iframe
78 | t.view.toggleClass('scroll-bars', opts.scrollBars);
79 |
80 | // On initial load, use margins for scrolling.
81 | // This prevents an initial flash while the iframe loads
82 | if (initial) {
83 | css = {
84 | marginTop: Math.min(opts.offsetTop, 0),
85 | marginLeft: Math.min(opts.offsetLeft, 0)
86 | };
87 | t.view.scrollTop(0);
88 | t.view.scrollLeft(0);
89 | } else {
90 | css = {
91 | marginTop: 0,
92 | marginLeft: 0
93 | };
94 | t.view.scrollTop(opts.offsetTop * -1);
95 | t.view.scrollLeft(opts.offsetLeft * -1);
96 | }
97 | t.iFrame.css(css);
98 |
99 | // Don't reload the page on re-style unless the url changed
100 | if (opts.siteUrl !== t.currentSiteUrl) {
101 | t.iFrame.attr('src', opts.siteUrl);
102 | t.currentSiteUrl = opts.siteUrl;
103 | }
104 |
105 | }
106 |
107 | });
108 |
109 | // Custom settings form
110 | WebView.SettingsView = Backbone.View.extend({
111 |
112 | initialize: function(options) {
113 | var t = this;
114 | t.options = options;
115 | t.viewOptions = t.options.component.get('viewOptions');
116 | },
117 |
118 | events: {
119 | // Don't be so aggressive on keydown
120 | 'keydown .nm-core-wv-url': function(e){e.stopPropagation()},
121 | 'mousedown .nm-core-wv-example-mask': 'startDrag'
122 | },
123 |
124 | render: function() {
125 | var t = this;
126 | t.monitor = t.options.monitor;
127 | t.$el.html('' +
128 | '' +
129 | 'Page URL ' +
130 | ' ' +
131 | 'Scrollbars: ' +
132 | '
' +
133 | 'Drag to position ' +
134 | '' +
135 | '
' +
136 | '
' +
137 | '
'
138 | );
139 |
140 | // Append another web view as an example
141 | var example = new WebView({
142 | model: t.options.model,
143 | component: t.options.component,
144 | viewOptions: t.viewOptions,
145 | el: t.$('.nm-core-wv-example')
146 | });
147 | example.render();
148 |
149 | },
150 |
151 | // Position the window
152 | startDrag: function(e) {
153 | var t = this,
154 | start = {
155 | top: e.pageY,
156 | left: e.pageX,
157 | offsetTop: t.viewOptions.get('offsetTop'),
158 | offsetLeft: t.viewOptions.get('offsetLeft')
159 | };
160 |
161 | function drag(e) {
162 | t.viewOptions.set({
163 | offsetTop: e.pageY - start.top + start.offsetTop,
164 | offsetLeft: e.pageX - start.left + start.offsetLeft
165 | });
166 | }
167 | function drop(e) {
168 | $(document).unbind("mousemove", drag).unbind("mouseup", drop);
169 | }
170 | $(document).bind("mousemove", drag).bind("mouseup", drop);
171 | e.preventDefault();
172 | }
173 |
174 | });
175 |
176 | }(this));
177 |
--------------------------------------------------------------------------------
/monitor.js:
--------------------------------------------------------------------------------
1 | // Bootstrap for standalone development
2 | require('monitor-dashboard');
3 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "core-monitor",
3 | "description": "Core Components",
4 | "version": "0.6.3",
5 | "main": "lib/index.js",
6 | "repository": {
7 | "type" : "git",
8 | "url" : "http://github.com/lorenwest/core-monitor.git"
9 | },
10 | "dependencies": {
11 | "connect": ">=2.8.1",
12 | "monitor": ">=0.6.3 <0.7.0",
13 | "monitor-dashboard": ">=0.6.2 <0.7.0"
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/site_db/Page/404.json:
--------------------------------------------------------------------------------
1 | {
2 | "id": "/404",
3 | "title": "New Page Template",
4 | "components": [
5 | {
6 | "id": "c1",
7 | "viewClass": "core.Html",
8 | "viewOptions": {
9 | "htmlValue": "Page not found. Create a monitor page at this location?"
10 | },
11 | "css": {
12 | ".nm-cv": "top:60px; left:0px; z-index:1;",
13 | ".nm-cv-viewport": "font-size:20px; line-height:34px; height:78px; width:367px;"
14 | },
15 | "monitor": {}
16 | },
17 | {
18 | "id": "c2",
19 | "viewClass": "core.Button",
20 | "viewOptions": {
21 | "label": "Create Page",
22 | "icon": "icon-magic",
23 | "onPress": "pageView.newPage();"
24 | },
25 | "css": {
26 | ".nm-cv": "top:170px; left:120px; z-index:2;"
27 | },
28 | "monitor": {}
29 | },
30 | {
31 | "id": "c3",
32 | "viewClass": "core.Button",
33 | "viewOptions": {
34 | "label": "Back",
35 | "icon": "icon-arrow-left",
36 | "onPress": "window.history.back();"
37 | },
38 | "css": {
39 | ".nm-cv": "top:170px; left:0px; z-index:3;"
40 | },
41 | "monitor": {}
42 | }
43 | ]
44 | }
--------------------------------------------------------------------------------
/site_db/Page/AppOverview.json:
--------------------------------------------------------------------------------
1 | {
2 | "id": "/app/core/AppOverview",
3 | "title": "Monitor Apps",
4 | "description": "Node monitor tour - Apps",
5 | "components": [
6 | {
7 | "id": "c1",
8 | "viewClass": "core.Html",
9 | "viewOptions": {
10 | "htmlValue": "\nMonitor Apps
",
11 | "background": true,
12 | "title": ""
13 | },
14 | "css": {
15 | ".nm-cv": "top:10px; z-index:5; left:0px;",
16 | ".nm-cv-viewport": "height:90px; width:860px;"
17 | },
18 | "monitor": {}
19 | },
20 | {
21 | "id": "c2",
22 | "viewClass": "core.Html",
23 | "viewOptions": {
24 | "htmlValue": " ",
25 | "background": true,
26 | "title": ""
27 | },
28 | "css": {
29 | ".nm-cv": "top:472px; z-index:23; left:482px;",
30 | ".nm-cv-viewport": "height:353px; width:380px;"
31 | },
32 | "monitor": {}
33 | },
34 | {
35 | "id": "c3",
36 | "viewClass": "core.Html",
37 | "viewOptions": {
38 | "htmlValue": "\n
Probes \n
\nProbes are JavaScript classes installed into (or close to) the systems being monitored. Similar in concept to JMX beans in the Java world, probes are simply data models describing the system being monitored.\n
\n
\nBuilt as Backbone.js data models, probes are easy to write. Just add data elements when initialized, and set them as they change. Probes are activated only while being monitored, and changes are forwarded to monitors in real time using socket.io push.\n
\n\n
",
39 | "background": false,
40 | "title": ""
41 | },
42 | "css": {
43 | ".nm-cv": "top:270px; z-index:10; left:0px;",
44 | ".nm-cv-viewport": "height:170px; width:880px; z-index:10;"
45 | },
46 | "monitor": {}
47 | },
48 | {
49 | "id": "c7",
50 | "viewClass": "core.Html",
51 | "viewOptions": {
52 | "htmlValue": " ",
53 | "background": true,
54 | "title": ""
55 | },
56 | "css": {
57 | ".nm-cv": "top:140px; z-index:18; left:20px;",
58 | ".nm-cv-viewport": "height:80px; width:150px;"
59 | },
60 | "monitor": {}
61 | },
62 | {
63 | "id": "c8",
64 | "viewClass": "core.Html",
65 | "viewOptions": {
66 | "htmlValue": "\n
Node.js developers can extend node-monitor, adding customized monitors and dashboard views for your application. Monitor apps can be included in your own Node.js application, or packaged separately for installation by npm.
\n
",
67 | "background": false,
68 | "title": ""
69 | },
70 | "css": {
71 | ".nm-cv": "top:150px; z-index:17; left:220px;",
72 | ".nm-cv-viewport": "height:80px; width:650px; z-index:19;"
73 | },
74 | "monitor": {}
75 | },
76 | {
77 | "id": "c9",
78 | "viewClass": "core.Html",
79 | "viewOptions": {
80 | "htmlValue": " ",
81 | "background": true,
82 | "title": ""
83 | },
84 | "css": {
85 | ".nm-cv": "top:860px; z-index:19; left:0px;",
86 | ".nm-cv-viewport": "height:250px; width:180px; z-index:24;"
87 | },
88 | "monitor": {}
89 | },
90 | {
91 | "id": "c10",
92 | "viewClass": "core.Html",
93 | "viewOptions": {
94 | "htmlValue": "\n
Views \n
\nViews are client-side components placed into the dashboard to visualize probes.\n
\nWhen installed, views appear in the New Component screen, and can be added to any dashboard. They come with a standard settings screen that is often extended to offer fine grained configuration.\n
\nViews can also pass user input on to probes having remote control functionality, turning your dashboards into control panels.\n
\nBuilt as Backbone.js view objects, creating custom views is straight forward with many exaples to copy from.\n
\n\n
",
95 | "background": false,
96 | "title": ""
97 | },
98 | "css": {
99 | ".nm-cv": "top:470px; z-index:20; left:0px;",
100 | ".nm-cv-viewport": "height:361px; width:438px; z-index:10;"
101 | },
102 | "monitor": {}
103 | },
104 | {
105 | "id": "c12",
106 | "viewClass": "core.Html",
107 | "viewOptions": {
108 | "htmlValue": "\n
Pages & Tours \n
\nMonitor apps can also contain pre-built dashboards (pages) and tours.\n
\nPages delivered with your application are shown in the sidebar under the \"App Pages\" menu, and tours delivered with your application are shown in the \"App Tours\" menu.\n
\nFor example, these documentation pages are pages contained in the core-monitor app.\n
\n\n
",
109 | "background": false,
110 | "title": ""
111 | },
112 | "css": {
113 | ".nm-cv": "top:890px; z-index:25; left:230px;",
114 | ".nm-cv-viewport": "height:200px; width:650px; z-index:10;"
115 | },
116 | "monitor": {}
117 | },
118 | {
119 | "id": "c13",
120 | "viewClass": "core.Html",
121 | "viewOptions": {
122 | "htmlValue": "\n
Getting Started \n
If you're still reading, you're probably thinking about building some sweet monitors for your own project.\n
\nThe Applications section has tools to get you started, technical documentation, and links to developer forums to answer your questions. \n
\n
",
123 | "background": false,
124 | "title": ""
125 | },
126 | "css": {
127 | ".nm-cv": "top:1150px; z-index:24; left:0px;",
128 | ".nm-cv-viewport": "height:130px; width:880px; z-index:10;"
129 | },
130 | "monitor": {}
131 | }
132 | ]
133 | }
--------------------------------------------------------------------------------
/site_db/Page/Applications/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "id": "/app/core/Applications/index",
3 | "title": "App Development - Home",
4 | "description": "Technical section for monitor app developers",
5 | "components": [
6 | {
7 | "id": "c1",
8 | "viewClass": "core.Html",
9 | "viewOptions": {
10 | "htmlValue": "\nMonitor App Development
",
11 | "background": true,
12 | "title": ""
13 | },
14 | "css": {
15 | ".nm-cv": "top:10px; z-index:5; left:0px;",
16 | ".nm-cv-viewport": "height:90px; width:860px;"
17 | },
18 | "monitor": {}
19 | },
20 | {
21 | "id": "c2",
22 | "viewClass": "core.Html",
23 | "viewOptions": {
24 | "htmlValue": " ",
25 | "background": true,
26 | "title": ""
27 | },
28 | "css": {
29 | ".nm-cv": "top:472px; z-index:23; left:482px;",
30 | ".nm-cv-viewport": "height:353px; width:380px;"
31 | },
32 | "monitor": {}
33 | },
34 | {
35 | "id": "c3",
36 | "viewClass": "core.Html",
37 | "viewOptions": {
38 | "htmlValue": "\n
Probes \n
\nProbes are JavaScript classes installed into (or close to) the systems being monitored. Similar in concept to JMX beans in the Java world, probes are simply data models describing the system being monitored.\n
\n
\nBuilt as Backbone.js data models, probes are easy to write. Just add data elements when initialized, and set them as they change. Probes are activated only while being monitored, and changes are forwarded to monitors in real time using socket.io push.\n
\n\n
",
39 | "background": false,
40 | "title": ""
41 | },
42 | "css": {
43 | ".nm-cv": "top:270px; z-index:10; left:0px;",
44 | ".nm-cv-viewport": "height:170px; width:880px; z-index:10;"
45 | },
46 | "monitor": {}
47 | },
48 | {
49 | "id": "c7",
50 | "viewClass": "core.Html",
51 | "viewOptions": {
52 | "htmlValue": " ",
53 | "background": true,
54 | "title": ""
55 | },
56 | "css": {
57 | ".nm-cv": "top:140px; z-index:18; left:20px;",
58 | ".nm-cv-viewport": "height:80px; width:150px;"
59 | },
60 | "monitor": {}
61 | },
62 | {
63 | "id": "c8",
64 | "viewClass": "core.Html",
65 | "viewOptions": {
66 | "htmlValue": "\n
Node.js developers can extend node-monitor, adding customized monitors and dashboard views for your application. Monitor apps can be included in your own Node.js application, or packaged separately for installation by npm.
\n
",
67 | "background": false,
68 | "title": ""
69 | },
70 | "css": {
71 | ".nm-cv": "top:150px; z-index:17; left:220px;",
72 | ".nm-cv-viewport": "height:80px; width:650px; z-index:19;"
73 | },
74 | "monitor": {}
75 | },
76 | {
77 | "id": "c9",
78 | "viewClass": "core.Html",
79 | "viewOptions": {
80 | "htmlValue": " ",
81 | "background": true,
82 | "title": ""
83 | },
84 | "css": {
85 | ".nm-cv": "top:860px; z-index:19; left:0px;",
86 | ".nm-cv-viewport": "height:250px; width:180px; z-index:24;"
87 | },
88 | "monitor": {}
89 | },
90 | {
91 | "id": "c10",
92 | "viewClass": "core.Html",
93 | "viewOptions": {
94 | "htmlValue": "\n
Views \n
\nViews are client-side components placed into the dashboard to visualize probes.\n
\nWhen installed, views appear in the New Component screen, and can be added to any dashboard. They come with a standard settings screen that is often extended to offer fine grained configuration.\n
\nViews can also pass user input on to probes having remote control functionality, turning your dashboards into control panels.\n
\nBuilt as Backbone.js view objects, creating custom views is straight forward with many exaples to copy from.\n
\n\n
",
95 | "background": false,
96 | "title": ""
97 | },
98 | "css": {
99 | ".nm-cv": "top:470px; z-index:20; left:0px;",
100 | ".nm-cv-viewport": "height:361px; width:438px; z-index:10;"
101 | },
102 | "monitor": {}
103 | },
104 | {
105 | "id": "c12",
106 | "viewClass": "core.Html",
107 | "viewOptions": {
108 | "htmlValue": "\n
Pages & Tours \n
\nMonitor apps can also contain pre-built dashboards (pages) and tours.\n
\nPages delivered with your application are shown in the sidebar under the \"App Pages\" menu, and tours delivered with your application are shown in the \"App Tours\" menu.\n
\nFor example, these documentation pages are pages contained in the core-monitor app.\n
\n\n
",
109 | "background": false,
110 | "title": ""
111 | },
112 | "css": {
113 | ".nm-cv": "top:890px; z-index:25; left:230px;",
114 | ".nm-cv-viewport": "height:200px; width:650px; z-index:10;"
115 | },
116 | "monitor": {}
117 | },
118 | {
119 | "id": "c13",
120 | "viewClass": "core.Html",
121 | "viewOptions": {
122 | "htmlValue": "\n
Getting Started \n
If you're still reading, you're probably thinking about building some sweet monitors for your own project.\n
\nThe Applications section has tools to get you started, technical documentation, and links to developer forums to answer your questions. \n
\n
",
123 | "background": false,
124 | "title": ""
125 | },
126 | "css": {
127 | ".nm-cv": "top:1150px; z-index:24; left:0px;",
128 | ".nm-cv-viewport": "height:130px; width:880px; z-index:10;"
129 | },
130 | "monitor": {}
131 | }
132 | ]
133 | }
--------------------------------------------------------------------------------
/site_db/Page/Components/AppViewer.json:
--------------------------------------------------------------------------------
1 | {
2 | "id": "/app/core/Components/AppViewer",
3 | "title": "App Viewer",
4 | "description": "Documentation page for the AppViewer component.",
5 | "components": [
6 | {
7 | "id": "c1",
8 | "viewClass": "core.Html",
9 | "viewOptions": {
10 | "htmlValue": "\n",
11 | "background": true,
12 | "title": ""
13 | },
14 | "css": {
15 | ".nm-cv": "top:10px; z-index:5; left:0px;",
16 | ".nm-cv-viewport": "height:90px; width:860px;"
17 | },
18 | "monitor": {}
19 | },
20 | {
21 | "id": "c3",
22 | "viewClass": "core.Html",
23 | "viewOptions": {
24 | "htmlValue": "\n
Component \n
\n The app viewer provides a quick overview of your application process.
Current CPU activity and load averages show how hard the CPU is working. Memory usage shows the memory footprint of this process, and a system wide memory view, showing how much memory this process is consuming. The bottom section is information provided by Node.js about this process.
\n
",
25 | "background": false,
26 | "title": ""
27 | },
28 | "css": {
29 | ".nm-cv": "top:150px; z-index:10; left:650px;",
30 | ".nm-cv-viewport": "height:440px; width:230px;"
31 | },
32 | "monitor": {}
33 | },
34 | {
35 | "id": "c4",
36 | "viewClass": "core.Html",
37 | "viewOptions": {
38 | "htmlValue": "\n
Questions\n
\n Tweet to #NodeMonitor or add/view issues on GitHub.\n\n
\n
",
39 | "background": false,
40 | "title": ""
41 | },
42 | "css": {
43 | ".nm-cv": "top:600px; z-index:8; left:0px;",
44 | ".nm-cv-viewport": "height:210px; width:560px;"
45 | },
46 | "monitor": {}
47 | },
48 | {
49 | "id": "c5",
50 | "viewClass": "core.AppViewer",
51 | "viewOptions": {
52 | "animation": true,
53 | "background": true,
54 | "title": "App Viewer"
55 | },
56 | "css": {
57 | ".nm-cv": "top:160px; z-index:9; left:0px;",
58 | ".nm-cv-viewport": "height:370px; width:610px;"
59 | },
60 | "monitor": {
61 | "probeClass": "Process"
62 | }
63 | }
64 | ]
65 | }
--------------------------------------------------------------------------------
/site_db/Page/Components/BarChart.json:
--------------------------------------------------------------------------------
1 | {
2 | "id": "/app/core/Components/BarChart",
3 | "title": "Bar Chart",
4 | "description": "Documentation page for the Bar Chart component.",
5 | "components": [
6 | {
7 | "id": "c1",
8 | "viewClass": "core.Html",
9 | "viewOptions": {
10 | "htmlValue": "\n",
11 | "background": true,
12 | "title": ""
13 | },
14 | "css": {
15 | ".nm-cv": "top:10px; z-index:5; left:0px;",
16 | ".nm-cv-viewport": "height:90px; width:860px;"
17 | },
18 | "monitor": {}
19 | },
20 | {
21 | "id": "c3",
22 | "viewClass": "core.Html",
23 | "viewOptions": {
24 | "htmlValue": "\n
Component \n
\n The Bar Chart displays numeric data vertically.
Data can be statically modified in the component's settings menu, or can be dynamically modified with probe data from your app servers.
\n
",
25 | "background": false,
26 | "title": ""
27 | },
28 | "css": {
29 | ".nm-cv": "top:150px; z-index:7; left:350px;",
30 | ".nm-cv-viewport": "height:230px; width:530px;"
31 | },
32 | "monitor": {}
33 | },
34 | {
35 | "id": "c4",
36 | "viewClass": "core.Html",
37 | "viewOptions": {
38 | "htmlValue": "\n
Questions\n
\n Tweet to #NodeMonitor or add/view issues on GitHub.\n\n
\n
",
39 | "background": false,
40 | "title": ""
41 | },
42 | "css": {
43 | ".nm-cv": "top:540px; z-index:8; left:0px;",
44 | ".nm-cv-viewport": "height:210px; width:560px;"
45 | },
46 | "monitor": {}
47 | },
48 | {
49 | "id": "c5",
50 | "viewClass": "core.BarChart",
51 | "viewOptions": {
52 | "title": "BarChart",
53 | "highcharts": {
54 | "chart": {
55 | "type": "column"
56 | },
57 | "legend": {
58 | "enabled": false
59 | },
60 | "xAxis": {
61 | "title": {
62 | "text": "Values"
63 | },
64 | "labels": {
65 | "enabled": true
66 | }
67 | },
68 | "yAxis": {
69 | "title": {
70 | "text": ""
71 | },
72 | "labels": {
73 | "enabled": true
74 | }
75 | },
76 | "plotOptions": {
77 | "bar": {
78 | "color": "rgba(200,183,155,1)"
79 | },
80 | "column": {
81 | "color": "rgba(200,183,155,1)"
82 | }
83 | },
84 | "series": [
85 | {
86 | "name": "value",
87 | "data": [
88 | 1,
89 | 0,
90 | 4,
91 | 10,
92 | 3,
93 | 8,
94 | 7,
95 | 7,
96 | 3,
97 | 0,
98 | 5
99 | ]
100 | }
101 | ]
102 | },
103 | "background": true
104 | },
105 | "css": {
106 | ".nm-cv": "top:160px; left:0px; z-index:9;",
107 | ".nm-cv-viewport": "height:300px; width:300px;"
108 | },
109 | "monitor": {}
110 | }
111 | ]
112 | }
--------------------------------------------------------------------------------
/site_db/Page/Components/Button.json:
--------------------------------------------------------------------------------
1 | {
2 | "id": "/app/core/Components/Button",
3 | "title": "Button",
4 | "description": "Documentation page for the Button component.",
5 | "components": [
6 | {
7 | "id": "c1",
8 | "viewClass": "core.Html",
9 | "viewOptions": {
10 | "htmlValue": "\n",
11 | "background": true,
12 | "title": ""
13 | },
14 | "css": {
15 | ".nm-cv": "top:10px; z-index:5; left:2px;",
16 | ".nm-cv-viewport": "height:90px; width:860px;"
17 | },
18 | "monitor": {}
19 | },
20 | {
21 | "id": "c3",
22 | "viewClass": "core.Html",
23 | "viewOptions": {
24 | "htmlValue": "\n
Component \n
\n The Button component allows you to write javascript code to run when the button is pressed.
\n
",
25 | "background": false,
26 | "title": ""
27 | },
28 | "css": {
29 | ".nm-cv": "top:150px; z-index:7; left:130px;",
30 | ".nm-cv-viewport": "height:230px; width:530px;"
31 | },
32 | "monitor": {}
33 | },
34 | {
35 | "id": "c4",
36 | "viewClass": "core.Html",
37 | "viewOptions": {
38 | "htmlValue": "\n
Questions\n
\n Tweet to #NodeMonitor or add/view issues on GitHub.\n\n
\n
",
39 | "background": false,
40 | "title": ""
41 | },
42 | "css": {
43 | ".nm-cv": "top:280px; z-index:8; left:0px;",
44 | ".nm-cv-viewport": "height:210px; width:560px;"
45 | },
46 | "monitor": {}
47 | },
48 | {
49 | "id": "c5",
50 | "viewClass": "core.Button",
51 | "viewOptions": {
52 | "label": "Button",
53 | "icon": "icon-star",
54 | "onPress": "",
55 | "background": true,
56 | "title": "Button"
57 | },
58 | "css": {
59 | ".nm-cv": "top:160px; z-index:9; left:0px;"
60 | },
61 | "monitor": {}
62 | }
63 | ]
64 | }
--------------------------------------------------------------------------------
/site_db/Page/Components/Clock.json:
--------------------------------------------------------------------------------
1 | {
2 | "id": "/app/core/Components/Clock",
3 | "title": "Clock",
4 | "description": "Documentation page for the Clock component.",
5 | "components": [
6 | {
7 | "id": "c1",
8 | "viewClass": "core.Html",
9 | "viewOptions": {
10 | "htmlValue": "\n",
11 | "background": true,
12 | "title": ""
13 | },
14 | "css": {
15 | ".nm-cv": "top:10px; z-index:5; left:0px;",
16 | ".nm-cv-viewport": "height:90px; width:860px;"
17 | },
18 | "monitor": {}
19 | },
20 | {
21 | "id": "c2",
22 | "viewClass": "core.Clock",
23 | "viewOptions": {
24 | "title": "Clock",
25 | "highcharts": {
26 | "chart": {
27 | "type": "gauge",
28 | "margin": 0,
29 | "plotBackgroundColor": "transparent",
30 | "plotBorderWidth": 0,
31 | "plotShadow": false
32 | },
33 | "plotOptions": {
34 | "gauge": {
35 | "dial": {
36 | "backgroundColor": "rgba(200,183,155,1)"
37 | },
38 | "pivot": {
39 | "backgroundColor": "rgba(200,183,155,1)"
40 | }
41 | }
42 | },
43 | "yAxis": {
44 | "labels": {
45 | "distance": -20
46 | },
47 | "min": 0,
48 | "max": 12,
49 | "lineWidth": 0,
50 | "showFirstLabel": false,
51 | "minorTickInterval": "auto",
52 | "minorTickWidth": 1,
53 | "minorTickLength": 5,
54 | "minorTickPosition": "inside",
55 | "minorGridLineWidth": 0,
56 | "minorTickColor": "rgba(200,183,155,1)",
57 | "tickInterval": 1,
58 | "tickWidth": 2,
59 | "tickPosition": "inside",
60 | "tickLength": 10,
61 | "tickColor": "rgba(200,183,155,1)",
62 | "minPadding": 0,
63 | "maxPadding": 0,
64 | "title": {
65 | "text": ""
66 | }
67 | },
68 | "series": [
69 | {
70 | "data": [
71 | {
72 | "id": "hour",
73 | "y": 4,
74 | "dial": {
75 | "radius": "60%",
76 | "baseWidth": 4,
77 | "baseLength": "95%",
78 | "rearLength": 0
79 | }
80 | },
81 | {
82 | "id": "minute",
83 | "y": 20,
84 | "dial": {
85 | "baseLength": "95%",
86 | "rearLength": 0
87 | }
88 | },
89 | {
90 | "id": "second",
91 | "y": 0,
92 | "dial": {
93 | "radius": "100%",
94 | "baseWidth": 1,
95 | "rearLength": "20%"
96 | }
97 | }
98 | ],
99 | "animation": false,
100 | "dataLabels": {
101 | "enabled": false
102 | }
103 | }
104 | ]
105 | },
106 | "background": true
107 | },
108 | "css": {
109 | ".nm-cv": "top:170px; z-index:6; left:0px;",
110 | ".nm-cv-viewport": "height:160px; width:160px;"
111 | },
112 | "monitor": {}
113 | },
114 | {
115 | "id": "c3",
116 | "viewClass": "core.Html",
117 | "viewOptions": {
118 | "htmlValue": "\n
Component \n
\n The clock is a handy component to drop onto your dashboard when it's important to show the local time.
\n
",
119 | "background": false,
120 | "title": ""
121 | },
122 | "css": {
123 | ".nm-cv": "top:160px; z-index:7; left:230px;",
124 | ".nm-cv-viewport": "height:210px; width:560px;"
125 | },
126 | "monitor": {}
127 | },
128 | {
129 | "id": "c4",
130 | "viewClass": "core.Html",
131 | "viewOptions": {
132 | "htmlValue": "\n
Questions\n
\n Tweet to #NodeMonitor or add/view issues on GitHub.\n\n
\n
",
133 | "background": false,
134 | "title": ""
135 | },
136 | "css": {
137 | ".nm-cv": "top:400px; z-index:8; left:6px;",
138 | ".nm-cv-viewport": "height:210px; width:560px;"
139 | },
140 | "monitor": {}
141 | }
142 | ]
143 | }
--------------------------------------------------------------------------------
/site_db/Page/Components/Gauge.json:
--------------------------------------------------------------------------------
1 | {
2 | "id": "/app/core/Components/Gauge",
3 | "title": "Gauge",
4 | "description": "Documentation page for the Gauge component.",
5 | "components": [
6 | {
7 | "id": "c1",
8 | "viewClass": "core.Html",
9 | "viewOptions": {
10 | "htmlValue": "\n",
11 | "background": true,
12 | "title": ""
13 | },
14 | "css": {
15 | ".nm-cv": "top:10px; z-index:5; left:0px;",
16 | ".nm-cv-viewport": "height:90px; width:860px;"
17 | },
18 | "monitor": {}
19 | },
20 | {
21 | "id": "c3",
22 | "viewClass": "core.Html",
23 | "viewOptions": {
24 | "htmlValue": "\n
Component The Gauge component is for measuring the magnitude, amount, or contents of something. The min/max values can be set in the component settings menu, and the gauge value can be set from a probe running in your app server.
\n
",
25 | "background": false,
26 | "title": ""
27 | },
28 | "css": {
29 | ".nm-cv": "top:160px; z-index:7; left:330px;",
30 | ".nm-cv-viewport": "height:150px; width:540px;"
31 | },
32 | "monitor": {}
33 | },
34 | {
35 | "id": "c4",
36 | "viewClass": "core.Html",
37 | "viewOptions": {
38 | "htmlValue": "\n
Questions\n
\n Tweet to #NodeMonitor or add/view issues on GitHub.\n\n
\n
",
39 | "background": false,
40 | "title": ""
41 | },
42 | "css": {
43 | ".nm-cv": "top:370px; z-index:8; left:0px;",
44 | ".nm-cv-viewport": "height:120px; width:580px;"
45 | },
46 | "monitor": {}
47 | },
48 | {
49 | "id": "c5",
50 | "viewClass": "core.Gauge",
51 | "viewOptions": {
52 | "title": "Gauge",
53 | "highcharts": {
54 | "chart": {
55 | "type": "gauge",
56 | "margin": 0,
57 | "plotBackgroundColor": "transparent",
58 | "plotBorderWidth": 0,
59 | "plotShadow": false
60 | },
61 | "pane": {
62 | "startAngle": -55,
63 | "endAngle": 55,
64 | "center": [
65 | "50%",
66 | "140%"
67 | ],
68 | "size": "250%"
69 | },
70 | "plotOptions": {
71 | "gauge": {
72 | "dial": {
73 | "radius": "100%",
74 | "backgroundColor": "rgba(200,183,155,1)"
75 | },
76 | "pivot": {
77 | "backgroundColor": "rgba(200,183,155,1)"
78 | }
79 | }
80 | },
81 | "yAxis": {
82 | "labels": {
83 | "distance": -22,
84 | "style": {
85 | "fontSize": "12px"
86 | }
87 | },
88 | "min": 180,
89 | "max": 230,
90 | "tickInterval": 10,
91 | "lineWidth": 0,
92 | "showFirstLabel": true,
93 | "showLastLabel": true,
94 | "minorTickInterval": "auto",
95 | "minorTickWidth": 1,
96 | "minorTickLength": 5,
97 | "minorTickPosition": "inside",
98 | "minorGridLineWidth": 0,
99 | "minorTickColor": "rgba(200,183,155,1)",
100 | "tickWidth": 2,
101 | "tickPosition": "inside",
102 | "tickLength": 10,
103 | "tickColor": "rgba(200,183,155,1)",
104 | "title": {
105 | "text": "Requests Per Second"
106 | }
107 | },
108 | "series": [
109 | {
110 | "name": "value",
111 | "data": [
112 | 214
113 | ]
114 | }
115 | ]
116 | },
117 | "background": true
118 | },
119 | "css": {
120 | ".nm-cv": "top:170px; z-index:9; left:30px;",
121 | ".nm-cv-viewport": "height:100px; width:220px;"
122 | },
123 | "monitor": {}
124 | }
125 | ]
126 | }
--------------------------------------------------------------------------------
/site_db/Page/Components/HTMLTemplate.json:
--------------------------------------------------------------------------------
1 | {
2 | "id": "/app/core/Components/HTMLTemplate",
3 | "title": "HTML Template",
4 | "description": "Documentation page for the HTML Template component.",
5 | "components": [
6 | {
7 | "id": "c1",
8 | "viewClass": "core.Html",
9 | "viewOptions": {
10 | "htmlValue": "\n",
11 | "background": true,
12 | "title": ""
13 | },
14 | "css": {
15 | ".nm-cv": "top:10px; z-index:5; left:2px;",
16 | ".nm-cv-viewport": "height:90px; width:860px;"
17 | },
18 | "monitor": {}
19 | },
20 | {
21 | "id": "c3",
22 | "viewClass": "core.Html",
23 | "viewOptions": {
24 | "htmlValue": "{{=<% %>=}}\n\n
Component \n
\n The HTML Template component allows you to write any HTML directly onto your dashboard.
You can switch from an HTML WYSIWYG view to the raw HTML, depending on the format you are most comfortable with.
It's called a template because it allows you to define mustache-style template parameters {{ and }}, and have those parameters filled in from a probe running in your app server.
Possibly the most widely used component, this gives you full control of your dashboard content and style.
\n
\n<%={{ }}=%>",
25 | "background": false,
26 | "title": ""
27 | },
28 | "css": {
29 | ".nm-cv": "top:150px; z-index:7; left:440px;",
30 | ".nm-cv-viewport": "height:340px; width:440px;"
31 | },
32 | "monitor": {}
33 | },
34 | {
35 | "id": "c4",
36 | "viewClass": "core.Html",
37 | "viewOptions": {
38 | "htmlValue": "\n
Questions\n
\n Tweet to #NodeMonitor or add/view issues on GitHub.\n\n
\n
",
39 | "background": false,
40 | "title": ""
41 | },
42 | "css": {
43 | ".nm-cv": "top:530px; z-index:8; left:0px;",
44 | ".nm-cv-viewport": "height:100px; width:570px;"
45 | },
46 | "monitor": {}
47 | },
48 | {
49 | "id": "c5",
50 | "viewClass": "core.Html",
51 | "viewOptions": {
52 | "htmlValue": "{{=<% %>=}}\n<h1>
My Heading </h1>
<p> My first paragraph. </p>
<p> Host name: {{hostname}} </p>
\n<%={{ }}=%>",
53 | "background": true,
54 | "title": "HTML Template"
55 | },
56 | "css": {
57 | ".nm-cv": "top:180px; z-index:9; left:10px;",
58 | ".nm-cv-viewport": "height:200px; width:250px;"
59 | },
60 | "monitor": {}
61 | },
62 | {
63 | "id": "c6",
64 | "viewClass": "core.Html",
65 | "viewOptions": {
66 | "htmlValue": "My Heading
My first paragraph.
Host name: {{hostname}}
",
67 | "background": true,
68 | "title": "HTML Template"
69 | },
70 | "css": {
71 | ".nm-cv": "top:220px; z-index:10; left:200px;",
72 | ".nm-cv-viewport": "height:210px; width:190px;"
73 | },
74 | "monitor": {
75 | "probeClass": "Process",
76 | "appInstance": "1"
77 | }
78 | }
79 | ]
80 | }
--------------------------------------------------------------------------------
/site_db/Page/Components/LineChart.json:
--------------------------------------------------------------------------------
1 | {
2 | "id": "/app/core/Components/LineChart",
3 | "title": "Line Chart",
4 | "description": "Documentation page for the Line Chart component.",
5 | "components": [
6 | {
7 | "id": "c1",
8 | "viewClass": "core.Html",
9 | "viewOptions": {
10 | "htmlValue": "\n",
11 | "background": true,
12 | "title": ""
13 | },
14 | "css": {
15 | ".nm-cv": "top:10px; z-index:5; left:0px;",
16 | ".nm-cv-viewport": "height:90px; width:860px;"
17 | },
18 | "monitor": {}
19 | },
20 | {
21 | "id": "c3",
22 | "viewClass": "core.Html",
23 | "viewOptions": {
24 | "htmlValue": "\n
Component \n
\n The Line Chart component, or line graph is a type of chart which displays information as a series of data points connected by straight line segments. Data can be statically modified in the component settings menu or can be dynamically modified with probe data.
\n
",
25 | "background": false,
26 | "title": ""
27 | },
28 | "css": {
29 | ".nm-cv": "top:150px; z-index:7; left:384px;",
30 | ".nm-cv-viewport": "height:340px; width:450px;"
31 | },
32 | "monitor": {}
33 | },
34 | {
35 | "id": "c4",
36 | "viewClass": "core.Html",
37 | "viewOptions": {
38 | "htmlValue": "\n
Questions\n
\n Tweet to #NodeMonitor or add/view issues on GitHub.\n\n
\n
",
39 | "background": false,
40 | "title": ""
41 | },
42 | "css": {
43 | ".nm-cv": "top:530px; z-index:8; left:4px;",
44 | ".nm-cv-viewport": "height:100px; width:570px;"
45 | },
46 | "monitor": {}
47 | },
48 | {
49 | "id": "c5",
50 | "viewClass": "core.LineChart",
51 | "viewOptions": {
52 | "title": "LineChart",
53 | "highcharts": {
54 | "chart": {
55 | "type": "line",
56 | "margin": null
57 | },
58 | "legend": {
59 | "enabled": false
60 | },
61 | "xAxis": {
62 | "title": {
63 | "text": "Values"
64 | },
65 | "labels": {
66 | "enabled": true
67 | }
68 | },
69 | "yAxis": {
70 | "title": {
71 | "text": ""
72 | },
73 | "labels": {
74 | "enabled": true
75 | }
76 | },
77 | "plotOptions": {
78 | "line": {}
79 | },
80 | "series": [
81 | {
82 | "name": "value",
83 | "data": [
84 | 1,
85 | 0,
86 | 4,
87 | 10,
88 | 3,
89 | 8,
90 | 7,
91 | 7,
92 | 3,
93 | 0,
94 | 5
95 | ]
96 | }
97 | ]
98 | },
99 | "background": true
100 | },
101 | "css": {
102 | ".nm-cv": "top:160px; z-index:9; left:4px;",
103 | ".nm-cv-viewport": "height:300px; width:300px;"
104 | },
105 | "monitor": {}
106 | }
107 | ]
108 | }
--------------------------------------------------------------------------------
/site_db/Page/Components/LogViewer.json:
--------------------------------------------------------------------------------
1 | {
2 | "id": "/app/core/Components/LogViewer",
3 | "title": "Log Viewer",
4 | "description": "Documentation page for the Log Viewer component.",
5 | "components": [
6 | {
7 | "id": "c1",
8 | "viewClass": "core.Html",
9 | "viewOptions": {
10 | "htmlValue": "\n",
11 | "background": true,
12 | "title": ""
13 | },
14 | "css": {
15 | ".nm-cv": "top:20px; z-index:5; left:0px;",
16 | ".nm-cv-viewport": "height:90px; width:860px;"
17 | },
18 | "monitor": {}
19 | },
20 | {
21 | "id": "c3",
22 | "viewClass": "core.Html",
23 | "viewOptions": {
24 | "htmlValue": "\n
Component \n
\n This isn't a normal log viewer. It shows log statements as they happen by listening to log events fired on your app server.
You can select which log statements to view, and if the logs consist of JSON objects, they can be expanded inline, offering a dense overview with drill-down capabilities.
\n
",
25 | "background": false,
26 | "title": ""
27 | },
28 | "css": {
29 | ".nm-cv": "top:140px; z-index:10; left:0px;",
30 | ".nm-cv-viewport": "height:110px; width:880px;"
31 | },
32 | "monitor": {}
33 | },
34 | {
35 | "id": "c4",
36 | "viewClass": "core.Html",
37 | "viewOptions": {
38 | "htmlValue": "\n
Questions\n
\n Tweet to #NodeMonitor or add/view issues on GitHub.\n\n
\n
",
39 | "background": false,
40 | "title": ""
41 | },
42 | "css": {
43 | ".nm-cv": "top:590px; z-index:8; left:0px;",
44 | ".nm-cv-viewport": "height:69px; width:877px;"
45 | },
46 | "monitor": {}
47 | },
48 | {
49 | "id": "c5",
50 | "viewClass": "core.LogViewer",
51 | "viewOptions": {
52 | "title": "Log Viewer",
53 | "background": true
54 | },
55 | "css": {
56 | ".nm-cv": "top:280px; z-index:9; left:0px;",
57 | ".nm-cv-viewport": "height:250px; width:860px;"
58 | },
59 | "monitor": {
60 | "probeClass": "Log",
61 | "initParams": {
62 | "pattern": "{trace,debug,info,warn,error,fatal}.*"
63 | }
64 | }
65 | }
66 | ]
67 | }
--------------------------------------------------------------------------------
/site_db/Page/Components/ObjectInspector.json:
--------------------------------------------------------------------------------
1 | {
2 | "id": "/app/core/Components/ObjectInspector",
3 | "title": "Object Inspector",
4 | "description": "Documentation page for the Object Inspector component.",
5 | "components": [
6 | {
7 | "id": "c1",
8 | "viewClass": "core.Html",
9 | "viewOptions": {
10 | "htmlValue": "\n",
11 | "background": true,
12 | "title": ""
13 | },
14 | "css": {
15 | ".nm-cv": "top:10px; z-index:5; left:4px;",
16 | ".nm-cv-viewport": "height:90px; width:860px;"
17 | },
18 | "monitor": {}
19 | },
20 | {
21 | "id": "c3",
22 | "viewClass": "core.Html",
23 | "viewOptions": {
24 | "htmlValue": "\n
Component \n
\n The Object Inspector component allows you to explore the properties of objects in your browser or app server.
\n
",
25 | "background": false,
26 | "title": ""
27 | },
28 | "css": {
29 | ".nm-cv": "top:150px; z-index:7; left:510px;",
30 | ".nm-cv-viewport": "height:340px; width:350px;"
31 | },
32 | "monitor": {}
33 | },
34 | {
35 | "id": "c4",
36 | "viewClass": "core.Html",
37 | "viewOptions": {
38 | "htmlValue": "\n
Questions\n
\n Tweet to #NodeMonitor or add/view issues on GitHub.\n\n
\n
",
39 | "background": false,
40 | "title": ""
41 | },
42 | "css": {
43 | ".nm-cv": "top:530px; z-index:8; left:0px;",
44 | ".nm-cv-viewport": "height:100px; width:570px;"
45 | },
46 | "monitor": {}
47 | },
48 | {
49 | "id": "c5",
50 | "viewClass": "core.Inspector",
51 | "viewOptions": {
52 | "title": "Object Inspector",
53 | "background": true
54 | },
55 | "css": {
56 | ".nm-cv": "top:160px; z-index:9; left:0px;",
57 | ".nm-cv-viewport": "height:290px; width:460px;"
58 | },
59 | "monitor": {
60 | "probeClass": "Inspect",
61 | "initParams": {
62 | "key": "window",
63 | "depth": "2"
64 | },
65 | "appInstance": "1"
66 | }
67 | }
68 | ]
69 | }
--------------------------------------------------------------------------------
/site_db/Page/Components/PieChart.json:
--------------------------------------------------------------------------------
1 | {
2 | "id": "/app/core/Components/PieChart",
3 | "title": "Pie Chart",
4 | "description": "Documentation page for the Pie Chart component.",
5 | "components": [
6 | {
7 | "id": "c1",
8 | "viewClass": "core.Html",
9 | "viewOptions": {
10 | "htmlValue": "\n",
11 | "background": true,
12 | "title": ""
13 | },
14 | "css": {
15 | ".nm-cv": "top:10px; z-index:5; left:2px;",
16 | ".nm-cv-viewport": "height:90px; width:860px;"
17 | },
18 | "monitor": {}
19 | },
20 | {
21 | "id": "c3",
22 | "viewClass": "core.Html",
23 | "viewOptions": {
24 | "htmlValue": "\n
Component \n
\n The Pie Chart component is a circular chart divided into sectors, illustrating relative magnitudes or frequencies. Values can be statically modified in the component's settings menu, or can be dynamically modified with probe data.
\n
",
25 | "background": false,
26 | "title": ""
27 | },
28 | "css": {
29 | ".nm-cv": "top:150px; z-index:7; left:380px;",
30 | ".nm-cv-viewport": "height:250px; width:450px;"
31 | },
32 | "monitor": {}
33 | },
34 | {
35 | "id": "c4",
36 | "viewClass": "core.Html",
37 | "viewOptions": {
38 | "htmlValue": "\n
Questions\n
\n Tweet to #NodeMonitor or add/view issues on GitHub.\n\n
\n
",
39 | "background": false,
40 | "title": ""
41 | },
42 | "css": {
43 | ".nm-cv": "top:530px; z-index:8; left:6px;",
44 | ".nm-cv-viewport": "height:100px; width:570px;"
45 | },
46 | "monitor": {}
47 | },
48 | {
49 | "id": "c5",
50 | "viewClass": "core.PieChart",
51 | "viewOptions": {
52 | "title": "PieChart",
53 | "highcharts": {
54 | "chart": {
55 | "type": "pie"
56 | },
57 | "legend": {
58 | "enabled": false
59 | },
60 | "xAxis": {
61 | "lineWidth": 0,
62 | "gridLineWidth": 0,
63 | "tickWidth": 0,
64 | "labels": {
65 | "enabled": false
66 | }
67 | },
68 | "yAxis": {
69 | "gridLineWidth": 0,
70 | "tickWidth": 0,
71 | "maxPadding": 0,
72 | "minPadding": 0,
73 | "endOnTick": true,
74 | "title": "",
75 | "labels": {
76 | "enabled": false
77 | }
78 | },
79 | "plotOptions": {
80 | "pie": {
81 | "color": "rgba(200,183,155,1)",
82 | "dataLabels": {
83 | "color": "rgba(200,183,155,1)"
84 | },
85 | "marker": {
86 | "enabled": false
87 | }
88 | }
89 | },
90 | "series": [
91 | {
92 | "name": "value",
93 | "data": [
94 | 1,
95 | 0,
96 | 4,
97 | 10,
98 | 3,
99 | 8,
100 | 7,
101 | 7,
102 | 3,
103 | 0,
104 | 5
105 | ]
106 | }
107 | ]
108 | },
109 | "background": true
110 | },
111 | "css": {
112 | ".nm-cv": "top:160px; z-index:9; left:0px;",
113 | ".nm-cv-viewport": "height:300px; width:300px;"
114 | },
115 | "monitor": {}
116 | }
117 | ]
118 | }
--------------------------------------------------------------------------------
/site_db/Page/Components/ProbeViewer.json:
--------------------------------------------------------------------------------
1 | {
2 | "id": "/app/core/Components/ProbeViewer",
3 | "title": "Probe Viewer",
4 | "description": "Documentation page for the Pie Chart component.",
5 | "components": [
6 | {
7 | "id": "c1",
8 | "viewClass": "core.Html",
9 | "viewOptions": {
10 | "htmlValue": "\n",
11 | "background": true,
12 | "title": ""
13 | },
14 | "css": {
15 | ".nm-cv": "top:10px; z-index:5; left:0px;",
16 | ".nm-cv-viewport": "height:90px; width:860px;"
17 | },
18 | "monitor": {}
19 | },
20 | {
21 | "id": "c3",
22 | "viewClass": "core.Html",
23 | "viewOptions": {
24 | "htmlValue": "\n
Component \n
\n The Probe Viewer component provides a view of the JSON value of any probe installed in your app server, updated in real-time.\n
\n
\n The example to the left is showing a process probe. Scroll down a bit to see some values changing in real time.\n
\n
\n Complex objects can be expanded and contracted by selecting the and icon to the left of the object.\n
\n
",
25 | "background": false,
26 | "title": ""
27 | },
28 | "css": {
29 | ".nm-cv": "top:150px; z-index:7; left:620px;",
30 | ".nm-cv-viewport": "height:340px; width:250px;"
31 | },
32 | "monitor": {}
33 | },
34 | {
35 | "id": "c4",
36 | "viewClass": "core.Html",
37 | "viewOptions": {
38 | "htmlValue": "\n
Questions\n
\n Tweet to #NodeMonitor or add/view issues on GitHub.\n\n
\n
",
39 | "background": false,
40 | "title": ""
41 | },
42 | "css": {
43 | ".nm-cv": "top:530px; z-index:8; left:6px;",
44 | ".nm-cv-viewport": "height:100px; width:570px;"
45 | },
46 | "monitor": {}
47 | },
48 | {
49 | "id": "c5",
50 | "viewClass": "core.Probe",
51 | "viewOptions": {
52 | "title": "Probe Viewer",
53 | "background": true
54 | },
55 | "css": {
56 | ".nm-cv": "top:150px; z-index:9; left:0px;",
57 | ".nm-cv-viewport": "height:310px; width:570px;"
58 | },
59 | "monitor": {
60 | "probeClass": "Process",
61 | "appInstance": "1"
62 | }
63 | }
64 | ]
65 | }
--------------------------------------------------------------------------------
/site_db/Page/Components/REPLConsole.json:
--------------------------------------------------------------------------------
1 | {
2 | "id": "/Components/REPLConsole",
3 | "title": "REPL Console",
4 | "description": "Documentation page for the REPL Console component.",
5 | "components": [
6 | {
7 | "id": "c1",
8 | "viewClass": "core.Html",
9 | "viewOptions": {
10 | "htmlValue": "\n",
11 | "background": true,
12 | "title": ""
13 | },
14 | "css": {
15 | ".nm-cv": "top:10px; z-index:5; left:0px;",
16 | ".nm-cv-viewport": "height:90px; width:860px;"
17 | },
18 | "monitor": {}
19 | },
20 | {
21 | "id": "c3",
22 | "viewClass": "core.Html",
23 | "viewOptions": {
24 | "htmlValue": "\n
Component \n
The REPL Console is a developer's component that facilitates exploratory debugging for your app servers.\n
\nIt's used mostly during development, and invaluable when your process isn't acting the way it should, and you need to poke around.\n
\nPlacing key top level objects onto the Node.js global namespace can make working in the REPL Console more enjoyable.\n
\nBe careful though. You're working in the same process as your app server.\n
\n
",
25 | "background": false,
26 | "title": ""
27 | },
28 | "css": {
29 | ".nm-cv": "top:150px; z-index:7; left:540px;",
30 | ".nm-cv-viewport": "height:340px; width:340px;"
31 | },
32 | "monitor": {}
33 | },
34 | {
35 | "id": "c4",
36 | "viewClass": "core.Html",
37 | "viewOptions": {
38 | "htmlValue": "\n
Questions\n
\n Tweet to #NodeMonitor or add/view issues on GitHub.\n\n
\n
",
39 | "background": false,
40 | "title": ""
41 | },
42 | "css": {
43 | ".nm-cv": "top:530px; z-index:8; left:0px;",
44 | ".nm-cv-viewport": "height:100px; width:570px;"
45 | },
46 | "monitor": {}
47 | },
48 | {
49 | "id": "c5",
50 | "viewClass": "core.Repl",
51 | "viewOptions": {
52 | "title": "REPL Console",
53 | "background": true
54 | },
55 | "css": {
56 | ".nm-cv": "top:150px; z-index:9; left:8px;",
57 | ".nm-cv-viewport": "height:300px; width:480px;"
58 | },
59 | "monitor": {
60 | "probeClass": "Repl",
61 | "initParams": {
62 | "uniqueInstance": 0.12763307010754943
63 | },
64 | "hostName": "localhost"
65 | }
66 | }
67 | ]
68 | }
--------------------------------------------------------------------------------
/site_db/Page/Components/Slider.json:
--------------------------------------------------------------------------------
1 | {
2 | "id": "/app/core/Components/Slider",
3 | "title": "Slider",
4 | "description": "Documentation page for the Slider component.",
5 | "components": [
6 | {
7 | "id": "c1",
8 | "viewClass": "core.Html",
9 | "viewOptions": {
10 | "htmlValue": "\n",
11 | "background": true,
12 | "title": ""
13 | },
14 | "css": {
15 | ".nm-cv": "top:10px; z-index:5; left:0px;",
16 | ".nm-cv-viewport": "height:90px; width:860px;"
17 | },
18 | "monitor": {}
19 | },
20 | {
21 | "id": "c3",
22 | "viewClass": "core.Html",
23 | "viewOptions": {
24 | "htmlValue": "\n
Component \n
\n The Slider component is a device that shows and allows you to change incremental values of an object. The value can be set from probe data, and user altered values can be forwarded to probes running in your app server.
\n
",
25 | "background": false,
26 | "title": ""
27 | },
28 | "css": {
29 | ".nm-cv": "top:150px; z-index:7; left:340px;",
30 | ".nm-cv-viewport": "height:110px; width:530px;"
31 | },
32 | "monitor": {}
33 | },
34 | {
35 | "id": "c4",
36 | "viewClass": "core.Html",
37 | "viewOptions": {
38 | "htmlValue": "\n
Questions\n
\n Tweet to #NodeMonitor or add/view issues on GitHub.\n\n
\n
",
39 | "background": false,
40 | "title": ""
41 | },
42 | "css": {
43 | ".nm-cv": "top:320px; z-index:8; left:0px;",
44 | ".nm-cv-viewport": "height:100px; width:570px;"
45 | },
46 | "monitor": {}
47 | },
48 | {
49 | "id": "c5",
50 | "viewClass": "core.Slider",
51 | "viewOptions": {
52 | "min": 0,
53 | "max": 100,
54 | "step": 1,
55 | "initial": 0,
56 | "onSlide": "",
57 | "background": true,
58 | "title": "Slider",
59 | "icon": "icon-off",
60 | "label": "daf"
61 | },
62 | "css": {
63 | ".nm-cv": "top:180px; z-index:9; left:10px;",
64 | ".nm-cv-viewport": "height:30px; width:270px;"
65 | },
66 | "monitor": {}
67 | }
68 | ]
69 | }
--------------------------------------------------------------------------------
/site_db/Page/Components/SparkLine.json:
--------------------------------------------------------------------------------
1 | {
2 | "id": "/app/core/Components/SparkLine",
3 | "title": "Spark Line",
4 | "description": "Documentation page for the Spark Line component.",
5 | "components": [
6 | {
7 | "id": "c1",
8 | "viewClass": "core.Html",
9 | "viewOptions": {
10 | "htmlValue": "\n",
11 | "background": true,
12 | "title": ""
13 | },
14 | "css": {
15 | ".nm-cv": "top:10px; z-index:5; left:2px;",
16 | ".nm-cv-viewport": "height:90px; width:860px;"
17 | },
18 | "monitor": {}
19 | },
20 | {
21 | "id": "c3",
22 | "viewClass": "core.Html",
23 | "viewOptions": {
24 | "htmlValue": "\n
Component \n
\n The Spark Line component enables you to create a Spark Line graph - a very small line chart, typically drawn without axes or coordinates.\n
\n
\n Values can be statically modified in the component's settings menu, or can be dynamically modified with probe data from your app servers.
\n
",
25 | "background": false,
26 | "title": ""
27 | },
28 | "css": {
29 | ".nm-cv": "top:150px; z-index:7; left:410px;",
30 | ".nm-cv-viewport": "height:250px; width:460px;"
31 | },
32 | "monitor": {}
33 | },
34 | {
35 | "id": "c4",
36 | "viewClass": "core.Html",
37 | "viewOptions": {
38 | "htmlValue": "\n
Questions\n
\n Tweet to #NodeMonitor or add/view issues on GitHub.\n\n
\n
",
39 | "background": false,
40 | "title": ""
41 | },
42 | "css": {
43 | ".nm-cv": "top:460px; z-index:8; left:0px;",
44 | ".nm-cv-viewport": "height:100px; width:570px;"
45 | },
46 | "monitor": {}
47 | },
48 | {
49 | "id": "c5",
50 | "viewClass": "core.SparkLine",
51 | "viewOptions": {
52 | "title": "SparkLine",
53 | "highcharts": {
54 | "chart": {
55 | "type": "line",
56 | "marginTop": 0,
57 | "marginBottom": 0,
58 | "marginRight": 5
59 | },
60 | "legend": {
61 | "enabled": false
62 | },
63 | "xAxis": {
64 | "lineWidth": 0,
65 | "gridLineWidth": 0,
66 | "tickWidth": 0,
67 | "labels": {
68 | "enabled": false
69 | }
70 | },
71 | "yAxis": {
72 | "gridLineWidth": 0,
73 | "tickWidth": 0,
74 | "maxPadding": 0,
75 | "minPadding": 0,
76 | "endOnTick": true,
77 | "title": {
78 | "text": ""
79 | },
80 | "labels": {
81 | "enabled": false
82 | }
83 | },
84 | "plotOptions": {
85 | "line": {
86 | "color": "rgba(200,183,155,1)",
87 | "marker": {
88 | "enabled": false
89 | }
90 | }
91 | },
92 | "series": [
93 | {
94 | "name": "value",
95 | "data": [
96 | 1,
97 | 0,
98 | 4,
99 | 10,
100 | 3,
101 | 8,
102 | 7,
103 | 7,
104 | 3,
105 | 0,
106 | 5
107 | ]
108 | }
109 | ]
110 | },
111 | "background": true
112 | },
113 | "css": {
114 | ".nm-cv": "top:160px; left:0px; z-index:9;",
115 | ".nm-cv-viewport": "height:210px; width:340px;"
116 | },
117 | "monitor": {}
118 | }
119 | ]
120 | }
--------------------------------------------------------------------------------
/site_db/Page/Components/WebSnippet.json:
--------------------------------------------------------------------------------
1 | {
2 | "id": "/Components/WebSnippet",
3 | "title": "Web Snippet",
4 | "description": "Documentation page for the Web Snippet component.",
5 | "components": [
6 | {
7 | "id": "c1",
8 | "viewClass": "core.Html",
9 | "viewOptions": {
10 | "htmlValue": "\n",
11 | "background": true,
12 | "title": ""
13 | },
14 | "css": {
15 | ".nm-cv": "top:10px; z-index:5; left:0px;",
16 | ".nm-cv-viewport": "height:90px; width:870px;"
17 | },
18 | "monitor": {}
19 | },
20 | {
21 | "id": "c3",
22 | "viewClass": "core.Html",
23 | "viewOptions": {
24 | "htmlValue": "\n
Component \n
\n The Web Snippet is a tool that displays a portion of an external web page right on your dashboard.\n
\n
\nSome examples would be to view video clips, stream an RSS feed, or keep an eye on your stock reports.\n
This can be used for sites that don't prevent <iframe> usage.
\n
",
25 | "background": false,
26 | "title": ""
27 | },
28 | "css": {
29 | ".nm-cv": "top:150px; z-index:10; left:690px;",
30 | ".nm-cv-viewport": "height:330px; width:200px;"
31 | },
32 | "monitor": {}
33 | },
34 | {
35 | "id": "c4",
36 | "viewClass": "core.Html",
37 | "viewOptions": {
38 | "htmlValue": "\n
Questions\n
\n Tweet to #NodeMonitor or add/view issues on GitHub.\n\n
\n
",
39 | "background": false,
40 | "title": ""
41 | },
42 | "css": {
43 | ".nm-cv": "top:530px; z-index:8; left:0px;",
44 | ".nm-cv-viewport": "height:100px; width:570px;"
45 | },
46 | "monitor": {}
47 | },
48 | {
49 | "id": "c5",
50 | "viewClass": "core.WebView",
51 | "viewOptions": {
52 | "title": "Web Snippet",
53 | "highcharts": {
54 | "chart": {
55 | "type": "line",
56 | "marginTop": 0,
57 | "marginBottom": 0,
58 | "marginRight": 5
59 | },
60 | "legend": {
61 | "enabled": false
62 | },
63 | "xAxis": {
64 | "lineWidth": 0,
65 | "gridLineWidth": 0,
66 | "tickWidth": 0,
67 | "labels": {
68 | "enabled": false
69 | }
70 | },
71 | "yAxis": {
72 | "gridLineWidth": 0,
73 | "tickWidth": 0,
74 | "maxPadding": 0,
75 | "minPadding": 0,
76 | "endOnTick": true,
77 | "title": {
78 | "text": ""
79 | },
80 | "labels": {
81 | "enabled": false
82 | }
83 | },
84 | "plotOptions": {
85 | "line": {
86 | "color": "rgba(200,183,155,1)",
87 | "marker": {
88 | "enabled": false
89 | }
90 | }
91 | },
92 | "series": [
93 | {
94 | "name": "value",
95 | "data": [
96 | 1,
97 | 0,
98 | 4,
99 | 10,
100 | 3,
101 | 8,
102 | 7,
103 | 7,
104 | 3,
105 | 0,
106 | 5
107 | ]
108 | }
109 | ]
110 | },
111 | "background": true,
112 | "siteUrl": "http://money.cnn.com/data/markets/",
113 | "scrollBars": true,
114 | "offsetTop": -157,
115 | "offsetLeft": 622
116 | },
117 | "css": {
118 | ".nm-cv": "top:160px; z-index:9; left:0px;",
119 | ".nm-cv-viewport": "height:290px; width:650px;"
120 | },
121 | "monitor": {}
122 | }
123 | ]
124 | }
--------------------------------------------------------------------------------
/site_db/Page/DashboardOverview.json:
--------------------------------------------------------------------------------
1 | {
2 | "id": "/app/core/DashboardOverview",
3 | "title": "Dashboard Overview",
4 | "description": "Node monitor tour - Dashboards",
5 | "components": [
6 | {
7 | "id": "c1",
8 | "viewClass": "core.Html",
9 | "viewOptions": {
10 | "htmlValue": "\nDashboards
",
11 | "background": true,
12 | "title": ""
13 | },
14 | "css": {
15 | ".nm-cv": "top:10px; z-index:5; left:0px;",
16 | ".nm-cv-viewport": "height:90px; width:860px;"
17 | },
18 | "monitor": {}
19 | },
20 | {
21 | "id": "c2",
22 | "viewClass": "core.Html",
23 | "viewOptions": {
24 | "htmlValue": " ",
25 | "background": true,
26 | "title": ""
27 | },
28 | "css": {
29 | ".nm-cv": "top:570px; z-index:24; left:700px;",
30 | ".nm-cv-viewport": "height:190px; width:160px;"
31 | },
32 | "monitor": {}
33 | },
34 | {
35 | "id": "c3",
36 | "viewClass": "core.Html",
37 | "viewOptions": {
38 | "htmlValue": "\n
Header \n
\n The header contains the page title and main menu. Most page elements show more information when you hover over them.
For example, clicking the Node Monitor logo to the right hides and shows the header bar.
\n
",
39 | "background": false,
40 | "title": ""
41 | },
42 | "css": {
43 | ".nm-cv": "top:210px; z-index:10; left:0px;",
44 | ".nm-cv-viewport": "height:110px; width:880px; z-index:10;"
45 | },
46 | "monitor": {}
47 | },
48 | {
49 | "id": "c4",
50 | "viewClass": "core.Html",
51 | "viewOptions": {
52 | "htmlValue": "\n
Sidebar \n
\n Pages in your site are shown in the sidebar for easy navigation, organized by the path to the page.\n
\n
\n Page tours are also shown in the sidebar, and can be run by selecting the tour. For more on tours, head over to the tour overview page.
\n
",
53 | "background": false,
54 | "title": ""
55 | },
56 | "css": {
57 | ".nm-cv": "top:360px; z-index:7; left:190px;",
58 | ".nm-cv-viewport": "height:140px; width:690px;"
59 | },
60 | "monitor": {}
61 | },
62 | {
63 | "id": "c5",
64 | "viewClass": "core.Html",
65 | "viewOptions": {
66 | "htmlValue": "\n
Components \n
\n Components are the items contained on a dashboard page. They are added by selecting \"Add a Component\" on the menu, and they can be sized and positioned anywhere on the dashboard. Move your mouse over this to see the components that make up this page.
\n
",
67 | "background": false,
68 | "title": ""
69 | },
70 | "css": {
71 | ".nm-cv": "top:570px; z-index:23; left:0px;",
72 | ".nm-cv-viewport": "height:116px; width:657px; z-index:27;"
73 | },
74 | "onInit": "$('#hoverOverThis').on('mouseover', function() {\npageView.editPage();\nsetTimeout(function(){\npageView.unlockPage();}\n,2000);\n});",
75 | "monitor": {}
76 | },
77 | {
78 | "id": "c6",
79 | "viewClass": "core.Html",
80 | "viewOptions": {
81 | "htmlValue": " ",
82 | "background": true,
83 | "title": ""
84 | },
85 | "css": {
86 | ".nm-cv": "top:200px; z-index:17; left:280px;",
87 | ".nm-cv-viewport": "height:24px; width:442px;"
88 | },
89 | "monitor": {}
90 | },
91 | {
92 | "id": "c7",
93 | "viewClass": "core.Html",
94 | "viewOptions": {
95 | "htmlValue": " ",
96 | "background": true,
97 | "title": ""
98 | },
99 | "css": {
100 | ".nm-cv": "top:350px; z-index:14; left:0px;",
101 | ".nm-cv-viewport": "height:180px; width:130px;"
102 | },
103 | "monitor": {}
104 | },
105 | {
106 | "id": "c8",
107 | "viewClass": "core.Clock",
108 | "viewOptions": {
109 | "title": "Clock",
110 | "highcharts": {
111 | "chart": {
112 | "type": "gauge",
113 | "margin": 0,
114 | "plotBackgroundColor": "transparent",
115 | "plotBorderWidth": 0,
116 | "plotShadow": false
117 | },
118 | "plotOptions": {
119 | "gauge": {
120 | "dial": {
121 | "backgroundColor": "rgba(200,183,155,1)"
122 | },
123 | "pivot": {
124 | "backgroundColor": "rgba(200,183,155,1)"
125 | }
126 | }
127 | },
128 | "yAxis": {
129 | "labels": {
130 | "distance": -20
131 | },
132 | "min": 0,
133 | "max": 12,
134 | "lineWidth": 0,
135 | "showFirstLabel": false,
136 | "minorTickInterval": "auto",
137 | "minorTickWidth": 1,
138 | "minorTickLength": 5,
139 | "minorTickPosition": "inside",
140 | "minorGridLineWidth": 0,
141 | "minorTickColor": "rgba(200,183,155,1)",
142 | "tickInterval": 1,
143 | "tickWidth": 2,
144 | "tickPosition": "inside",
145 | "tickLength": 10,
146 | "tickColor": "rgba(200,183,155,1)",
147 | "minPadding": 0,
148 | "maxPadding": 0,
149 | "title": {
150 | "text": ""
151 | }
152 | },
153 | "series": [
154 | {
155 | "data": [
156 | {
157 | "id": "hour",
158 | "y": 4,
159 | "dial": {
160 | "radius": "60%",
161 | "baseWidth": 4,
162 | "baseLength": "95%",
163 | "rearLength": 0
164 | }
165 | },
166 | {
167 | "id": "minute",
168 | "y": 20,
169 | "dial": {
170 | "baseLength": "95%",
171 | "rearLength": 0
172 | }
173 | },
174 | {
175 | "id": "second",
176 | "y": 0,
177 | "dial": {
178 | "radius": "100%",
179 | "baseWidth": 1,
180 | "rearLength": "20%"
181 | }
182 | }
183 | ],
184 | "animation": false,
185 | "dataLabels": {
186 | "enabled": false
187 | }
188 | }
189 | ]
190 | },
191 | "background": true
192 | },
193 | "css": {
194 | ".nm-cv": "top:730px; z-index:27; left:20px;",
195 | ".nm-cv-viewport": "height:140px; width:140px;"
196 | },
197 | "monitor": {}
198 | },
199 | {
200 | "id": "c10",
201 | "viewClass": "core.Html",
202 | "viewOptions": {
203 | "htmlValue": "\n\n
Core Components \n
\n The following components are installed by default from the core-monitor project. Click the icon for more information.
\n
\n\n \n \n \n App Viewer \n An application process viewer
\n \n \n\n \n \n \n Bar Chart \n A Highcharts bar chart
\n \n \n\n \n \n \n Button \n A button to place on a page that runs javascript when pressed
\n \n \n\n \n \n \n Clock \n A clock can put a finishing touch on a dashboard
\n \n \n\n \n \n \n Gauge \n A fuel gauge for expressing the current state
\n \n \n\n \n \n \n HTML Template \n Place any HTML on your dashboard, optionally merging backend data with text.
\n \n \n\n \n \n \n Line Chart \n A highcharts line chart
\n \n \n\n \n \n \n Log Viewer \n A highly configurable log viewer, with a filtering and JSON expansion.
\n \n \n\n \n \n \n Object Inspector \n Monitor any globally available object. If the object is a backbone model, monitor changes in real time.
\n \n \n\n \n \n \n Pie Chart \n A Highcharts pie chart
\n \n \n\n \n \n \n Probe Viewer \n Monitor any probe running in any of your Node.js processes.
\n \n \n\n \n \n \n REPL Console \n Yeah. In a browser.
\n \n \n\n \n \n \n Slider \n Show the state of a numeric variable, and allow user input.
\n \n \n\n \n \n \n Spark Line \n A Highcharts line chart, without the dressing.
\n \n \n\n \n \n \n Web Snippet \n Embed a snippet of another web page in your dashboard.
\n \n \n\n
\n
",
204 | "background": false,
205 | "title": ""
206 | },
207 | "css": {
208 | ".nm-cv": "top:960px; z-index:19; left:10px;",
209 | ".nm-cv-viewport": "height:1632px; width:872px; z-index:28;"
210 | },
211 | "monitor": {}
212 | },
213 | {
214 | "id": "c11",
215 | "viewClass": "core.Html",
216 | "viewOptions": {
217 | "htmlValue": "\n
\n This is a clock component to the left.\n
\n
\n It has a title bar on the top and the clock inside. You can position the clock on the page by dragging in the title bar, to the right of the title.\n
\n
",
218 | "background": false,
219 | "title": ""
220 | },
221 | "css": {
222 | ".nm-cv": "top:730px; z-index:20; left:220px;",
223 | ".nm-cv-viewport": "height:90px; width:443px; z-index:27;"
224 | },
225 | "monitor": {}
226 | },
227 | {
228 | "id": "c12",
229 | "viewClass": "core.Html",
230 | "viewOptions": {
231 | "htmlValue": "\n
\n After dragging the clock to a new position, you may notice an asterisk (*) to the left of the page title. That says the page is dirty and needs saving.\n
\n
\nRefreshing the page when it's dirty will restore it to the way it was before your changes.\n
\n
",
232 | "background": false,
233 | "title": ""
234 | },
235 | "css": {
236 | ".nm-cv": "top:826px; z-index:29; left:220px;",
237 | ".nm-cv-viewport": "height:80px; width:660px;"
238 | },
239 | "monitor": {}
240 | },
241 | {
242 | "id": "c13",
243 | "viewClass": "core.Html",
244 | "viewOptions": {
245 | "htmlValue": "\n
\n Each page on this site is a dashboard with the following elements:
\n
",
246 | "background": false,
247 | "title": ""
248 | },
249 | "css": {
250 | ".nm-cv": "top:140px; z-index:28; left:0px;",
251 | ".nm-cv-viewport": "height:25px; width:877px;"
252 | },
253 | "monitor": {}
254 | }
255 | ]
256 | }
--------------------------------------------------------------------------------
/site_db/Page/TourOverview.json:
--------------------------------------------------------------------------------
1 | {
2 | "id": "/TourOverview",
3 | "title": "Tour Overview",
4 | "description": "Node monitor tour - Tours",
5 | "components": [
6 | {
7 | "id": "c1",
8 | "viewClass": "core.Html",
9 | "viewOptions": {
10 | "htmlValue": "\nSite Tours
",
11 | "background": true,
12 | "title": ""
13 | },
14 | "css": {
15 | ".nm-cv": "top:10px; z-index:5; left:0px;",
16 | ".nm-cv-viewport": "height:90px; width:860px;"
17 | },
18 | "monitor": {}
19 | },
20 | {
21 | "id": "c2",
22 | "viewClass": "core.Html",
23 | "viewOptions": {
24 | "htmlValue": " ",
25 | "background": true,
26 | "title": ""
27 | },
28 | "css": {
29 | ".nm-cv": "top:250px; z-index:15; left:10px;",
30 | ".nm-cv-viewport": "height:90px; width:180px;"
31 | },
32 | "monitor": {}
33 | },
34 | {
35 | "id": "c3",
36 | "viewClass": "core.Html",
37 | "viewOptions": {
38 | "htmlValue": "\n
Finding Tours \n
Tours are located at the bottom of the left sidebar, and are organized by the monitor application containing the tour.
\n\n
",
39 | "background": false,
40 | "title": ""
41 | },
42 | "css": {
43 | ".nm-cv": "top:247px; z-index:10; left:268px;",
44 | ".nm-cv-viewport": "height:100px; width:610px; z-index:10;"
45 | },
46 | "monitor": {}
47 | },
48 | {
49 | "id": "c5",
50 | "viewClass": "core.Html",
51 | "viewOptions": {
52 | "htmlValue": "\n\n
Running Tours \n
When a tour is selected from the sidebar, the first page of the tour is loaded and a tour control is displayed at the bottom of the screen. The tour runs until it is paused or stopped from the control.\n
\n
\nMost tours cycle through pages at a specified interval.\n
\n
",
53 | "background": false,
54 | "title": ""
55 | },
56 | "css": {
57 | ".nm-cv": "top:390px; z-index:16; left:0px;",
58 | ".nm-cv-viewport": "height:130px; width:880px;"
59 | },
60 | "monitor": {}
61 | },
62 | {
63 | "id": "c7",
64 | "viewClass": "core.Html",
65 | "viewOptions": {
66 | "htmlValue": " ",
67 | "background": true,
68 | "title": ""
69 | },
70 | "css": {
71 | ".nm-cv": "top:137px; z-index:18; left:644px;",
72 | ".nm-cv-viewport": "height:73px; width:215px;"
73 | },
74 | "monitor": {}
75 | },
76 | {
77 | "id": "c8",
78 | "viewClass": "core.Html",
79 | "viewOptions": {
80 | "htmlValue": "\n
\n Tours guide you through a series of pages on your site.
\n
",
81 | "background": false,
82 | "title": ""
83 | },
84 | "css": {
85 | ".nm-cv": "top:160px; z-index:17; left:0px;",
86 | ".nm-cv-viewport": "height:40px; width:610px; z-index:19;"
87 | },
88 | "monitor": {}
89 | },
90 | {
91 | "id": "c9",
92 | "viewClass": "core.Html",
93 | "viewOptions": {
94 | "htmlValue": " ",
95 | "background": true,
96 | "title": ""
97 | },
98 | "css": {
99 | ".nm-cv": "top:578px; z-index:19; left:0px;",
100 | ".nm-cv-viewport": "height:70px; width:240px;"
101 | },
102 | "monitor": {}
103 | },
104 | {
105 | "id": "c10",
106 | "viewClass": "core.Html",
107 | "viewOptions": {
108 | "htmlValue": "\n
Managing Tours \n
Tours can be added and edited by selecting the tour settings icon, which appears when hovering over the tour heading bar.
\n\n
",
109 | "background": false,
110 | "title": ""
111 | },
112 | "css": {
113 | ".nm-cv": "top:570px; z-index:20; left:284px;",
114 | ".nm-cv-viewport": "height:90px; width:600px; z-index:10;"
115 | },
116 | "monitor": {}
117 | },
118 | {
119 | "id": "c11",
120 | "viewClass": "core.Html",
121 | "viewOptions": {
122 | "htmlValue": " ",
123 | "background": true,
124 | "title": ""
125 | },
126 | "css": {
127 | ".nm-cv": "top:710px; z-index:21; left:326px;",
128 | ".nm-cv-viewport": "height:450px; width:540px;"
129 | },
130 | "monitor": {}
131 | },
132 | {
133 | "id": "c12",
134 | "viewClass": "core.Html",
135 | "viewOptions": {
136 | "htmlValue": "\n
Settings \n
Pages can be re-arranged, added, and removed in the tour settings page.
To add a new tour, press the symbol above the list of tours.
\n\n
",
137 | "background": false,
138 | "title": ""
139 | },
140 | "css": {
141 | ".nm-cv": "top:714px; z-index:22; left:4px;",
142 | ".nm-cv-viewport": "height:450px; width:290px; z-index:10;"
143 | },
144 | "monitor": {}
145 | }
146 | ]
147 | }
--------------------------------------------------------------------------------
/site_db/Page/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "id": "/app/core/index",
3 | "title": "Home - Node Monitor",
4 | "description": "Remote Monitoring and Control Panels for Node.js",
5 | "components": [
6 | {
7 | "id": "c0",
8 | "viewClass": "core.Html",
9 | "viewOptions": {
10 | "title": "",
11 | "background": false,
12 | "htmlValue": ""
13 | },
14 | "css": {
15 | ".nm-cv": "top:648px; left:0px; z-index:3;",
16 | ".nm-cv-viewport": "height:20px; width:890px;"
17 | },
18 | "monitor": {}
19 | },
20 | {
21 | "id": "c2",
22 | "viewClass": "core.Html",
23 | "viewOptions": {
24 | "htmlValue": " ",
25 | "background": true,
26 | "title": ""
27 | },
28 | "css": {
29 | ".nm-cv": "top:200px; z-index:4; left:514px;",
30 | ".nm-cv-viewport": "height:400px; width:350px;"
31 | },
32 | "monitor": {}
33 | },
34 | {
35 | "id": "c3",
36 | "viewClass": "core.Html",
37 | "viewOptions": {
38 | "htmlValue": "\nWelcome to the Node Monitor Dashboard
",
39 | "background": true,
40 | "title": ""
41 | },
42 | "css": {
43 | ".nm-cv": "top:10px; z-index:5; left:4px;",
44 | ".nm-cv-viewport": "height:150px; width:860px;"
45 | },
46 | "monitor": {}
47 | },
48 | {
49 | "id": "c4",
50 | "viewClass": "core.Html",
51 | "viewOptions": {
52 | "htmlValue": "\n
Dashboards \n
\n Each page on this site is a dashboard. Create as many dashboards as you like, and organize them into groups.\n
\n
\n The Dashboard Overview page shows how to navigate this site and create your own dashboards.\n
\n
Tours \n
\n You can take a tour of selected dashboard pages by selecting a tour in the sidebar to the left. \n
\n
\n The Tour Overview page has more about running and writing tours.\n
\n
Apps \n
\n Monitor apps are specialized monitors and components you can install for your dashboards.\n
\n
\n Learn more about developing monitors for your own Node.js modules and apps at the Apps Overview page.\n
\n
",
53 | "background": false,
54 | "title": ""
55 | },
56 | "css": {
57 | ".nm-cv": "top:200px; z-index:6; left:4px;",
58 | ".nm-cv-viewport": "height:410px; width:480px;"
59 | },
60 | "monitor": {}
61 | }
62 | ]
63 | }
--------------------------------------------------------------------------------
/site_db/Site/default.json:
--------------------------------------------------------------------------------
1 | {
2 | "id": "default",
3 | "name": "Node Monitor",
4 | "logo": "/static/css/default/images/monitor.jpg",
5 | "favicon": "/static/css/default/images/favicon.ico",
6 | "css": "",
7 | "tours": []
8 | }
--------------------------------------------------------------------------------
/site_db/Tour/1.json:
--------------------------------------------------------------------------------
1 | {
2 | "id": "1",
3 | "title": "Dashboard Overview Tour",
4 | "description": "An overview of the Monitor Dashboard",
5 | "autoNextSec": "10",
6 | "pages": [
7 | {
8 | "url": "/app/core/index",
9 | "title": "Home - Node Monitor"
10 | },
11 | {
12 | "url": "/app/core/DashboardOverview",
13 | "title": "Dashboard Overview"
14 | },
15 | {
16 | "url": "/app/core/TourOverview",
17 | "title": "Tour Overview"
18 | },
19 | {
20 | "url": "/app/core/AppOverview",
21 | "title": "Monitor Applications"
22 | }
23 | ]
24 | }
25 |
--------------------------------------------------------------------------------
/site_db/Tour/2.json:
--------------------------------------------------------------------------------
1 | {
2 | "id": "2",
3 | "title": "Core Components Tour",
4 | "description": "A tour of the built-in core components",
5 | "autoNextSec": "5",
6 | "pages": [
7 | {
8 | "url": "/app/core/Components/AppViewer",
9 | "title": "App Viewer"
10 | },
11 | {
12 | "url": "/app/core/Components/BarChart",
13 | "title": "Bar Chart"
14 | },
15 | {
16 | "url": "/app/core/Components/Button",
17 | "title": "Button"
18 | },
19 | {
20 | "url": "/app/core/Components/Clock",
21 | "title": "Clock"
22 | },
23 | {
24 | "url": "/app/core/Components/Gauge",
25 | "title": "Gauge"
26 | },
27 | {
28 | "url": "/app/core/Components/HTMLTemplate",
29 | "title": "HTML Template"
30 | },
31 | {
32 | "url": "/app/core/Components/LineChart",
33 | "title": "Line Chart"
34 | },
35 | {
36 | "url": "/app/core/Components/LogViewer",
37 | "title": "Log Viewer"
38 | },
39 | {
40 | "url": "/app/core/Components/ObjectInspector",
41 | "title": "Object Inspector"
42 | },
43 | {
44 | "url": "/app/core/Components/PieChart",
45 | "title": "Pie Chart"
46 | },
47 | {
48 | "url": "/app/core/Components/ProbeViewer",
49 | "title": "Probe Viewer"
50 | },
51 | {
52 | "url": "/app/core/Components/REPLConsole",
53 | "title": "REPL Console"
54 | },
55 | {
56 | "url": "/app/core/Components/Slider",
57 | "title": "Slider"
58 | },
59 | {
60 | "url": "/app/core/Components/SparkLine",
61 | "title": "Spark Line"
62 | },
63 | {
64 | "url": "/app/core/Components/WebSnippet",
65 | "title": "Web Snippet"
66 | }
67 | ]
68 | }
69 |
--------------------------------------------------------------------------------