Remove log from UI. Just use console and write directly to system log.
This commit is contained in:
parent
bfb9bcbbe4
commit
94942d86f9
|
@ -674,11 +674,6 @@ button:focus {
|
||||||
background: black;
|
background: black;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
}
|
}
|
||||||
#log {
|
|
||||||
position: fixed;
|
|
||||||
width: 100%;
|
|
||||||
height: 160px;
|
|
||||||
}
|
|
||||||
#screens {
|
#screens {
|
||||||
overflow-x: hidden;
|
overflow-x: hidden;
|
||||||
}
|
}
|
||||||
|
|
|
@ -150,9 +150,6 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<footer>
|
|
||||||
<div id="log"></div>
|
|
||||||
</footer>
|
|
||||||
</div>
|
</div>
|
||||||
<div id="light" class="screen">
|
<div id="light" class="screen">
|
||||||
<div id="colors-tabs"></div>
|
<div id="colors-tabs"></div>
|
||||||
|
|
|
@ -2472,11 +2472,9 @@ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
},k.push(["lab",J])}).call(this);
|
},k.push(["lab",J])}).call(this);
|
||||||
//fgnass.github.com/spin.js#v2.0.1
|
//fgnass.github.com/spin.js#v2.0.1
|
||||||
!function(a,b){"object"==typeof exports?module.exports=b():"function"==typeof define&&define.amd?define(b):a.Spinner=b()}(this,function(){"use strict";function a(a,b){var c,d=document.createElement(a||"div");for(c in b)d[c]=b[c];return d}function b(a){for(var b=1,c=arguments.length;c>b;b++)a.appendChild(arguments[b]);return a}function c(a,b,c,d){var e=["opacity",b,~~(100*a),c,d].join("-"),f=.01+c/d*100,g=Math.max(1-(1-a)/b*(100-f),a),h=j.substring(0,j.indexOf("Animation")).toLowerCase(),i=h&&"-"+h+"-"||"";return l[e]||(m.insertRule("@"+i+"keyframes "+e+"{0%{opacity:"+g+"}"+f+"%{opacity:"+a+"}"+(f+.01)+"%{opacity:1}"+(f+b)%100+"%{opacity:"+a+"}100%{opacity:"+g+"}}",m.cssRules.length),l[e]=1),e}function d(a,b){var c,d,e=a.style;for(b=b.charAt(0).toUpperCase()+b.slice(1),d=0;d<k.length;d++)if(c=k[d]+b,void 0!==e[c])return c;return void 0!==e[b]?b:void 0}function e(a,b){for(var c in b)a.style[d(a,c)||c]=b[c];return a}function f(a){for(var b=1;b<arguments.length;b++){var c=arguments[b];for(var d in c)void 0===a[d]&&(a[d]=c[d])}return a}function g(a,b){return"string"==typeof a?a:a[b%a.length]}function h(a){this.opts=f(a||{},h.defaults,n)}function i(){function c(b,c){return a("<"+b+' xmlns="urn:schemas-microsoft.com:vml" class="spin-vml">',c)}m.addRule(".spin-vml","behavior:url(#default#VML)"),h.prototype.lines=function(a,d){function f(){return e(c("group",{coordsize:k+" "+k,coordorigin:-j+" "+-j}),{width:k,height:k})}function h(a,h,i){b(m,b(e(f(),{rotation:360/d.lines*a+"deg",left:~~h}),b(e(c("roundrect",{arcsize:d.corners}),{width:j,height:d.width,left:d.radius,top:-d.width>>1,filter:i}),c("fill",{color:g(d.color,a),opacity:d.opacity}),c("stroke",{opacity:0}))))}var i,j=d.length+d.width,k=2*j,l=2*-(d.width+d.length)+"px",m=e(f(),{position:"absolute",top:l,left:l});if(d.shadow)for(i=1;i<=d.lines;i++)h(i,-2,"progid:DXImageTransform.Microsoft.Blur(pixelradius=2,makeshadow=1,shadowopacity=.3)");for(i=1;i<=d.lines;i++)h(i);return b(a,m)},h.prototype.opacity=function(a,b,c,d){var e=a.firstChild;d=d.shadow&&d.lines||0,e&&b+d<e.childNodes.length&&(e=e.childNodes[b+d],e=e&&e.firstChild,e=e&&e.firstChild,e&&(e.opacity=c))}}var j,k=["webkit","Moz","ms","O"],l={},m=function(){var c=a("style",{type:"text/css"});return b(document.getElementsByTagName("head")[0],c),c.sheet||c.styleSheet}(),n={lines:12,length:7,width:5,radius:10,rotate:0,corners:1,color:"#000",direction:1,speed:1,trail:100,opacity:.25,fps:20,zIndex:2e9,className:"spinner",top:"50%",left:"50%",position:"absolute"};h.defaults={},f(h.prototype,{spin:function(b){this.stop();{var c=this,d=c.opts,f=c.el=e(a(0,{className:d.className}),{position:d.position,width:0,zIndex:d.zIndex});d.radius+d.length+d.width}if(e(f,{left:d.left,top:d.top}),b&&b.insertBefore(f,b.firstChild||null),f.setAttribute("role","progressbar"),c.lines(f,c.opts),!j){var g,h=0,i=(d.lines-1)*(1-d.direction)/2,k=d.fps,l=k/d.speed,m=(1-d.opacity)/(l*d.trail/100),n=l/d.lines;!function o(){h++;for(var a=0;a<d.lines;a++)g=Math.max(1-(h+(d.lines-a)*n)%l*m,d.opacity),c.opacity(f,a*d.direction+i,g,d);c.timeout=c.el&&setTimeout(o,~~(1e3/k))}()}return c},stop:function(){var a=this.el;return a&&(clearTimeout(this.timeout),a.parentNode&&a.parentNode.removeChild(a),this.el=void 0),this},lines:function(d,f){function h(b,c){return e(a(),{position:"absolute",width:f.length+f.width+"px",height:f.width+"px",background:b,boxShadow:c,transformOrigin:"left",transform:"rotate("+~~(360/f.lines*k+f.rotate)+"deg) translate("+f.radius+"px,0)",borderRadius:(f.corners*f.width>>1)+"px"})}for(var i,k=0,l=(f.lines-1)*(1-f.direction)/2;k<f.lines;k++)i=e(a(),{position:"absolute",top:1+~(f.width/2)+"px",transform:f.hwaccel?"translate3d(0,0,0)":"",opacity:f.opacity,animation:j&&c(f.opacity,f.trail,l+k*f.direction,f.lines)+" "+1/f.speed+"s linear infinite"}),f.shadow&&b(i,e(h("#000","0 0 4px #000"),{top:"2px"})),b(d,b(i,h(g(f.color,k),"0 0 1px rgba(0,0,0,.1)")));return d},opacity:function(a,b,c){b<a.childNodes.length&&(a.childNodes[b].style.opacity=c)}});var o=e(a("group"),{behavior:"url(#default#VML)"});return!d(o,"transform")&&o.adj?i():j=d(o,"animation"),h});
|
!function(a,b){"object"==typeof exports?module.exports=b():"function"==typeof define&&define.amd?define(b):a.Spinner=b()}(this,function(){"use strict";function a(a,b){var c,d=document.createElement(a||"div");for(c in b)d[c]=b[c];return d}function b(a){for(var b=1,c=arguments.length;c>b;b++)a.appendChild(arguments[b]);return a}function c(a,b,c,d){var e=["opacity",b,~~(100*a),c,d].join("-"),f=.01+c/d*100,g=Math.max(1-(1-a)/b*(100-f),a),h=j.substring(0,j.indexOf("Animation")).toLowerCase(),i=h&&"-"+h+"-"||"";return l[e]||(m.insertRule("@"+i+"keyframes "+e+"{0%{opacity:"+g+"}"+f+"%{opacity:"+a+"}"+(f+.01)+"%{opacity:1}"+(f+b)%100+"%{opacity:"+a+"}100%{opacity:"+g+"}}",m.cssRules.length),l[e]=1),e}function d(a,b){var c,d,e=a.style;for(b=b.charAt(0).toUpperCase()+b.slice(1),d=0;d<k.length;d++)if(c=k[d]+b,void 0!==e[c])return c;return void 0!==e[b]?b:void 0}function e(a,b){for(var c in b)a.style[d(a,c)||c]=b[c];return a}function f(a){for(var b=1;b<arguments.length;b++){var c=arguments[b];for(var d in c)void 0===a[d]&&(a[d]=c[d])}return a}function g(a,b){return"string"==typeof a?a:a[b%a.length]}function h(a){this.opts=f(a||{},h.defaults,n)}function i(){function c(b,c){return a("<"+b+' xmlns="urn:schemas-microsoft.com:vml" class="spin-vml">',c)}m.addRule(".spin-vml","behavior:url(#default#VML)"),h.prototype.lines=function(a,d){function f(){return e(c("group",{coordsize:k+" "+k,coordorigin:-j+" "+-j}),{width:k,height:k})}function h(a,h,i){b(m,b(e(f(),{rotation:360/d.lines*a+"deg",left:~~h}),b(e(c("roundrect",{arcsize:d.corners}),{width:j,height:d.width,left:d.radius,top:-d.width>>1,filter:i}),c("fill",{color:g(d.color,a),opacity:d.opacity}),c("stroke",{opacity:0}))))}var i,j=d.length+d.width,k=2*j,l=2*-(d.width+d.length)+"px",m=e(f(),{position:"absolute",top:l,left:l});if(d.shadow)for(i=1;i<=d.lines;i++)h(i,-2,"progid:DXImageTransform.Microsoft.Blur(pixelradius=2,makeshadow=1,shadowopacity=.3)");for(i=1;i<=d.lines;i++)h(i);return b(a,m)},h.prototype.opacity=function(a,b,c,d){var e=a.firstChild;d=d.shadow&&d.lines||0,e&&b+d<e.childNodes.length&&(e=e.childNodes[b+d],e=e&&e.firstChild,e=e&&e.firstChild,e&&(e.opacity=c))}}var j,k=["webkit","Moz","ms","O"],l={},m=function(){var c=a("style",{type:"text/css"});return b(document.getElementsByTagName("head")[0],c),c.sheet||c.styleSheet}(),n={lines:12,length:7,width:5,radius:10,rotate:0,corners:1,color:"#000",direction:1,speed:1,trail:100,opacity:.25,fps:20,zIndex:2e9,className:"spinner",top:"50%",left:"50%",position:"absolute"};h.defaults={},f(h.prototype,{spin:function(b){this.stop();{var c=this,d=c.opts,f=c.el=e(a(0,{className:d.className}),{position:d.position,width:0,zIndex:d.zIndex});d.radius+d.length+d.width}if(e(f,{left:d.left,top:d.top}),b&&b.insertBefore(f,b.firstChild||null),f.setAttribute("role","progressbar"),c.lines(f,c.opts),!j){var g,h=0,i=(d.lines-1)*(1-d.direction)/2,k=d.fps,l=k/d.speed,m=(1-d.opacity)/(l*d.trail/100),n=l/d.lines;!function o(){h++;for(var a=0;a<d.lines;a++)g=Math.max(1-(h+(d.lines-a)*n)%l*m,d.opacity),c.opacity(f,a*d.direction+i,g,d);c.timeout=c.el&&setTimeout(o,~~(1e3/k))}()}return c},stop:function(){var a=this.el;return a&&(clearTimeout(this.timeout),a.parentNode&&a.parentNode.removeChild(a),this.el=void 0),this},lines:function(d,f){function h(b,c){return e(a(),{position:"absolute",width:f.length+f.width+"px",height:f.width+"px",background:b,boxShadow:c,transformOrigin:"left",transform:"rotate("+~~(360/f.lines*k+f.rotate)+"deg) translate("+f.radius+"px,0)",borderRadius:(f.corners*f.width>>1)+"px"})}for(var i,k=0,l=(f.lines-1)*(1-f.direction)/2;k<f.lines;k++)i=e(a(),{position:"absolute",top:1+~(f.width/2)+"px",transform:f.hwaccel?"translate3d(0,0,0)":"",opacity:f.opacity,animation:j&&c(f.opacity,f.trail,l+k*f.direction,f.lines)+" "+1/f.speed+"s linear infinite"}),f.shadow&&b(i,e(h("#000","0 0 4px #000"),{top:"2px"})),b(d,b(i,h(g(f.color,k),"0 0 1px rgba(0,0,0,.1)")));return d},opacity:function(a,b,c){b<a.childNodes.length&&(a.childNodes[b].style.opacity=c)}});var o=e(a("group"),{behavior:"url(#default#VML)"});return!d(o,"transform")&&o.adj?i():j=d(o,"animation"),h});
|
||||||
|
|
||||||
const mcopy = {};
|
const mcopy = {};
|
||||||
mcopy.cfg = require('./data/cfg.json');
|
mcopy.cfg = require('./data/cfg.json');
|
||||||
|
|
||||||
|
|
||||||
const { remote, ipcRenderer } = require('electron');
|
const { remote, ipcRenderer } = require('electron');
|
||||||
const dialog = require('electron').remote.dialog;
|
const dialog = require('electron').remote.dialog;
|
||||||
const notifier = require('node-notifier');
|
const notifier = require('node-notifier');
|
||||||
|
@ -2484,6 +2482,7 @@ const fs = require('fs');
|
||||||
const uuid = require('uuid');
|
const uuid = require('uuid');
|
||||||
const moment = require('moment');
|
const moment = require('moment');
|
||||||
const humanizeDuration = require('humanize-duration');
|
const humanizeDuration = require('humanize-duration');
|
||||||
|
const cfg = require('./data/cfg.json');
|
||||||
const gui = require('./lib/ui');
|
const gui = require('./lib/ui');
|
||||||
const light = require('./lib/ui/light.js');
|
const light = require('./lib/ui/light.js');
|
||||||
const proj = require('./lib/ui/proj.js');
|
const proj = require('./lib/ui/proj.js');
|
||||||
|
@ -2491,10 +2490,10 @@ const cam = require('./lib/ui/cam.js');
|
||||||
const nav = require('./lib/ui/nav.js');
|
const nav = require('./lib/ui/nav.js');
|
||||||
const seq = require('./lib/ui/seq.js');
|
const seq = require('./lib/ui/seq.js');
|
||||||
const cmd = require('./lib/ui/cmd.js');
|
const cmd = require('./lib/ui/cmd.js');
|
||||||
const log = require('./lib/ui/log.js');
|
|
||||||
const devices = require('./lib/ui/devices.js');
|
const devices = require('./lib/ui/devices.js');
|
||||||
const mse = require('./lib/ui/mscript.js');
|
const mse = require('./lib/ui/mscript.js');
|
||||||
const Mscript = require('./lib/mscript');
|
const Mscript = require('./lib/mscript');
|
||||||
|
let log;
|
||||||
|
|
||||||
|
|
||||||
/******
|
/******
|
||||||
|
@ -2531,18 +2530,43 @@ mcopy.state = {
|
||||||
proj_backward : 'PB',
|
proj_backward : 'PB',
|
||||||
black_backward : 'BB',
|
black_backward : 'BB',
|
||||||
|
|
||||||
light_set : 'L'
|
light_set : 'L'//,
|
||||||
|
/*
|
||||||
|
|
||||||
|
cam2_forward : 'C2F',
|
||||||
|
cam2_backward : 'C2B',
|
||||||
|
|
||||||
|
cams_forward : 'CCF',
|
||||||
|
cams_forward : 'CCB',
|
||||||
|
|
||||||
|
cam_forward_cam2_backward : 'CFCB',
|
||||||
|
cam_backward_cam2_forward : 'CBCF',
|
||||||
|
|
||||||
|
proj2_forward : 'P2F',
|
||||||
|
proj2_backward : 'P2B',
|
||||||
|
|
||||||
|
projs_forward : 'PPF',
|
||||||
|
projs_backward : 'PPB',
|
||||||
|
|
||||||
|
proj_forward_proj2_backward : 'PFPB',
|
||||||
|
proj_backward_proj2_forward : 'PBPF'
|
||||||
|
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
//
|
||||||
|
|
||||||
function init () {
|
async function init () {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
log = await require('log')({})
|
||||||
|
|
||||||
nav.init();
|
nav.init();
|
||||||
gui.grid.init();
|
gui.grid.init();
|
||||||
mse.mscript.init();
|
mse.mscript.init();
|
||||||
mse.console.init();
|
mse.console.init();
|
||||||
log.init();
|
|
||||||
devices.init();
|
devices.init();
|
||||||
light.init();
|
light.init();
|
||||||
proj.init();
|
proj.init();
|
||||||
|
|
|
@ -9,11 +9,6 @@
|
||||||
@import "./settings.less";
|
@import "./settings.less";
|
||||||
@import "./mscript.less";
|
@import "./mscript.less";
|
||||||
|
|
||||||
#log{
|
|
||||||
position: fixed;
|
|
||||||
width: 100%;
|
|
||||||
height: @FOOTER_H;
|
|
||||||
}
|
|
||||||
|
|
||||||
#screens{
|
#screens{
|
||||||
overflow-x: hidden;
|
overflow-x: hidden;
|
||||||
|
|
|
@ -1,60 +0,0 @@
|
||||||
const log = {};
|
|
||||||
|
|
||||||
log.time = 'MM/DD/YY-HH:mm:ss';
|
|
||||||
log.count = 0;
|
|
||||||
log.init = function () {
|
|
||||||
'use strict';
|
|
||||||
$('#log').w2grid({
|
|
||||||
name : 'log',
|
|
||||||
columns: [
|
|
||||||
{ field: 'time', caption: 'Time', size: '22%' },
|
|
||||||
{ field: 'action', caption: 'Action', size: '58%' },
|
|
||||||
{ field: 'service', caption: 'Service', size: '20%' },
|
|
||||||
{ field: 'status', caption: 'Status', size: '10%' },
|
|
||||||
],
|
|
||||||
records: []
|
|
||||||
});
|
|
||||||
//{ recid: 1, time: moment().format(log.time), action: 'Started app', service: 'MAIN', status: true }
|
|
||||||
log.info('Started app', 'MAIN', true);
|
|
||||||
log.listen();
|
|
||||||
};
|
|
||||||
log.listen = function () {
|
|
||||||
'use strict';
|
|
||||||
ipcRenderer.on('log', function (event, arg) {
|
|
||||||
log.display(arg.action, arg.service, arg.status, arg.time);
|
|
||||||
return event.returnValue = true;
|
|
||||||
});
|
|
||||||
};
|
|
||||||
log.display = function (action, service, status, time) {
|
|
||||||
'use strict';
|
|
||||||
var obj = {
|
|
||||||
recid : log.count++,
|
|
||||||
time : time,
|
|
||||||
action : action,
|
|
||||||
service : service,
|
|
||||||
status : status
|
|
||||||
}
|
|
||||||
if (typeof time === 'undefined') {
|
|
||||||
obj.time = moment().format(log.time);
|
|
||||||
}
|
|
||||||
w2ui['log'].add(obj);
|
|
||||||
if (nav.active === 'controls') {
|
|
||||||
w2ui['log'].scrollIntoView(log.count - 1);
|
|
||||||
w2ui['log'].selectNone();
|
|
||||||
w2ui['log'].select(log.count - 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
return obj;
|
|
||||||
};
|
|
||||||
log.report = function (obj) {
|
|
||||||
'use strict';
|
|
||||||
ipcRenderer.sendSync('log', obj);
|
|
||||||
};
|
|
||||||
log.info = function (action, service, status, time) {
|
|
||||||
'use strict';
|
|
||||||
var obj = log.display(action, service, status, time);
|
|
||||||
log.report(obj);
|
|
||||||
//console.log(obj);
|
|
||||||
};
|
|
||||||
|
|
||||||
module.exports = log;
|
|
|
@ -1,8 +1,6 @@
|
||||||
|
|
||||||
const mcopy = {};
|
const mcopy = {};
|
||||||
mcopy.cfg = require('./data/cfg.json');
|
mcopy.cfg = require('./data/cfg.json');
|
||||||
|
|
||||||
|
|
||||||
const { remote, ipcRenderer } = require('electron');
|
const { remote, ipcRenderer } = require('electron');
|
||||||
const dialog = require('electron').remote.dialog;
|
const dialog = require('electron').remote.dialog;
|
||||||
const notifier = require('node-notifier');
|
const notifier = require('node-notifier');
|
||||||
|
@ -10,6 +8,7 @@ const fs = require('fs');
|
||||||
const uuid = require('uuid');
|
const uuid = require('uuid');
|
||||||
const moment = require('moment');
|
const moment = require('moment');
|
||||||
const humanizeDuration = require('humanize-duration');
|
const humanizeDuration = require('humanize-duration');
|
||||||
|
const cfg = require('./data/cfg.json');
|
||||||
const gui = require('./lib/ui');
|
const gui = require('./lib/ui');
|
||||||
const light = require('./lib/ui/light.js');
|
const light = require('./lib/ui/light.js');
|
||||||
const proj = require('./lib/ui/proj.js');
|
const proj = require('./lib/ui/proj.js');
|
||||||
|
@ -17,10 +16,10 @@ const cam = require('./lib/ui/cam.js');
|
||||||
const nav = require('./lib/ui/nav.js');
|
const nav = require('./lib/ui/nav.js');
|
||||||
const seq = require('./lib/ui/seq.js');
|
const seq = require('./lib/ui/seq.js');
|
||||||
const cmd = require('./lib/ui/cmd.js');
|
const cmd = require('./lib/ui/cmd.js');
|
||||||
const log = require('./lib/ui/log.js');
|
|
||||||
const devices = require('./lib/ui/devices.js');
|
const devices = require('./lib/ui/devices.js');
|
||||||
const mse = require('./lib/ui/mscript.js');
|
const mse = require('./lib/ui/mscript.js');
|
||||||
const Mscript = require('./lib/mscript');
|
const Mscript = require('./lib/mscript');
|
||||||
|
let log;
|
||||||
|
|
||||||
|
|
||||||
/******
|
/******
|
||||||
|
@ -57,18 +56,43 @@ mcopy.state = {
|
||||||
proj_backward : 'PB',
|
proj_backward : 'PB',
|
||||||
black_backward : 'BB',
|
black_backward : 'BB',
|
||||||
|
|
||||||
light_set : 'L'
|
light_set : 'L'//,
|
||||||
|
/*
|
||||||
|
|
||||||
|
cam2_forward : 'C2F',
|
||||||
|
cam2_backward : 'C2B',
|
||||||
|
|
||||||
|
cams_forward : 'CCF',
|
||||||
|
cams_forward : 'CCB',
|
||||||
|
|
||||||
|
cam_forward_cam2_backward : 'CFCB',
|
||||||
|
cam_backward_cam2_forward : 'CBCF',
|
||||||
|
|
||||||
|
proj2_forward : 'P2F',
|
||||||
|
proj2_backward : 'P2B',
|
||||||
|
|
||||||
|
projs_forward : 'PPF',
|
||||||
|
projs_backward : 'PPB',
|
||||||
|
|
||||||
|
proj_forward_proj2_backward : 'PFPB',
|
||||||
|
proj_backward_proj2_forward : 'PBPF'
|
||||||
|
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
//
|
||||||
|
|
||||||
function init () {
|
async function init () {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
log = await require('log')({})
|
||||||
|
|
||||||
nav.init();
|
nav.init();
|
||||||
gui.grid.init();
|
gui.grid.init();
|
||||||
mse.mscript.init();
|
mse.mscript.init();
|
||||||
mse.console.init();
|
mse.console.init();
|
||||||
log.init();
|
|
||||||
devices.init();
|
devices.init();
|
||||||
light.init();
|
light.init();
|
||||||
proj.init();
|
proj.init();
|
||||||
|
|
Loading…
Reference in New Issue