Skip to content

Commit 26aa22f

Browse files
committed
(bluefox) update all packets.
1 parent 1a7eb7a commit 26aa22f

File tree

3 files changed

+61
-10
lines changed

3 files changed

+61
-10
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,9 @@ You can inspire yourself [here](https://iobroker.net:8080). This is a Live-Versi
124124

125125
Change log
126126
--------
127+
### v 0.3.0 (2015-11-02)
128+
* (bluefox) support of latest version of iobroker.vis
129+
127130

128131
### v 0.2.2 (2015-08-14)
129132
* (bluefox) enable to send "vis.control.command" to vis, like

package.json

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,22 @@
11
{
22
"name" : "node-red-vis",
3-
"version" : "0.2.2",
3+
"version" : "0.3.0",
44
"description" : "Visualisation for node-red. Based on ioBroker.vis",
55
"dependencies": {
6-
"iobroker.vis": "^0.6.10",
7-
"iobroker.vis-metro": "^0.1.5",
8-
"iobroker.vis-colorpicker": "^0.1.0",
9-
"iobroker.vis-hqwidgets": "^0.1.0",
10-
"iobroker.vis-plumb": "^0.1.5",
11-
"iobroker.vis-lcars": "^0.1.6",
12-
"iobroker.vis-bars": "^0.0.3",
13-
"socket.io": "^1.3.6"
6+
"iobroker.vis": "^0.7.4",
7+
"iobroker.vis-metro": "*",
8+
"iobroker.vis-keyboard": "*",
9+
"iobroker.vis-colorpicker": "*",
10+
"iobroker.vis-hqwidgets": "*",
11+
"iobroker.vis-plumb": "*",
12+
"iobroker.vis-lcars": "*",
13+
"iobroker.vis-bars": "*",
14+
"iobroker.vis-fancyswitch": "*",
15+
"iobroker.vis-jqui-mfd": "*",
16+
"iobroker.vis-rgraph": "*",
17+
"iobroker.vis-timeandweather": "*",
18+
"iobroker.web": "*",
19+
"socket.io": "^1.3.7"
1420
},
1521
"contributors": [
1622
"bluefox <bluefox@ccu.io>",

vis.js

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ module.exports = function(RED) {
2929

3030
function getMime(filename) {
3131
var ext = filename.match(/\.[^.]+$/);
32+
if (typeof ext == 'object') ext = ext[0];
3233
var isBinary = false;
3334
var _mimeType;
3435

@@ -430,6 +431,43 @@ module.exports = function(RED) {
430431
res.send('var socketUrl = ""; var socketSession = "' + '' + '"; var socketNamespace = "vis";');
431432
});
432433

434+
// user css files
435+
RED.httpNode.get('/vis.0/*', function(req, res, next) {
436+
var file;
437+
var f = req.url.split('?');
438+
439+
f[0] = f[0].substring(7);
440+
441+
file = base + 'vis/' + f[0];
442+
var info = getMime(file);
443+
if (fs.existsSync(file)) {
444+
res.contentType(info.mimeType || 'text/javascript');
445+
var buffer = fs.readFileSync(file);
446+
res.send(buffer);
447+
} else {
448+
if (info.ext == '.css') {
449+
res.contentType('text/css');
450+
res.send('');
451+
} else {
452+
res.status(404).send('404 Not found. File ' + req.url + ' not found');
453+
}
454+
}
455+
});
456+
457+
// web libraries
458+
RED.httpNode.get('/lib/*', function(req, res, next){
459+
var f = req.url.split('?');
460+
var file = __dirname + '/node_modules/iobroker.web/www' + f[0];
461+
var info = getMime(file);
462+
if (fs.existsSync(file)) {
463+
res.contentType(info.mimeType || 'text/javascript');
464+
var buffer = fs.readFileSync(file);
465+
res.send(buffer);
466+
} else {
467+
res.status(404).send('404 Not found. File ' + req.url + ' not found');
468+
}
469+
});
470+
433471
RED.httpNode.get('/vis/*', function(req, res, next){
434472
var file;
435473
var f = req.url.split('?');
@@ -439,7 +477,11 @@ module.exports = function(RED) {
439477
} else {
440478
f[0] = f[0].substring(5);
441479
}
442-
file = __dirname + '/node_modules/iobroker.vis/www/' + f[0];
480+
if (f[0].match(/^lib\/css\/themes\//)) {
481+
file = __dirname + '/node_modules/iobroker.web/www/' + f[0];
482+
} else {
483+
file = __dirname + '/node_modules/iobroker.vis/www/' + f[0];
484+
}
443485

444486
var info = getMime(file);
445487
if (fs.existsSync(file)) {

0 commit comments

Comments
 (0)