From 2d677298dbf8f21a215ba108a8ccd9b8d1dc090c Mon Sep 17 00:00:00 2001 From: Ylian Saint-Hilaire Date: Tue, 28 Jul 2020 15:27:28 -0700 Subject: [PATCH] Added staring a device feature. --- meshuser.js | 2 +- public/images/icon-star-notify-10.png | Bin 0 -> 364 bytes public/images/icon-star-notify-16.png | Bin 0 -> 542 bytes public/images/icon-star-notify-40.png | Bin 0 -> 989 bytes public/images/icon-star-notify.png | Bin 0 -> 384 bytes public/scripts/amt-wsman-0.2.0-min.js | 2 +- public/styles/style.css | 29 +++++++--- translate/translate.json | 8 ++- views/default-mobile.handlebars | 78 +++++++++++++++++++++++--- views/default.handlebars | 67 +++++++++++++++++++--- webserver.js | 3 +- 11 files changed, 159 insertions(+), 30 deletions(-) create mode 100644 public/images/icon-star-notify-10.png create mode 100644 public/images/icon-star-notify-16.png create mode 100644 public/images/icon-star-notify-40.png create mode 100644 public/images/icon-star-notify.png diff --git a/meshuser.js b/meshuser.js index ace06a63..3f36ea52 100644 --- a/meshuser.js +++ b/meshuser.js @@ -4219,7 +4219,7 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use case 'userWebState': { if (common.validateString(command.state, 1, 10000) == false) break; // Check state size, no more than 10k command.state = parent.filterUserWebState(command.state); // Filter the state to remove anything bad - if ((command.state == null) || (typeof command.state !== 'object')) break; // If state did not validate correctly, quit here. + if ((command.state == null) || (typeof command.state !== 'string')) { console.log('tt'); break; } // If state did not validate correctly, quit here. db.Set({ _id: 'ws' + user._id, state: command.state }); parent.parent.DispatchEvent([user._id], obj, { action: 'userWebState', nolog: 1, domain: domain.id, state: command.state }); break; diff --git a/public/images/icon-star-notify-10.png b/public/images/icon-star-notify-10.png new file mode 100644 index 0000000000000000000000000000000000000000..4dd727b5bd54b8ca76c184b6556aaa3b2c35b213 GIT binary patch literal 364 zcmV-y0h9iTP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!2kdb!2!6DYwZ940Rc%wK~yMHU5+tM z12GUq|Jdslf&ztxbkMMu2y`eNP(s5AC?bknA{_-MpddF0LUi0BG(=QX2#Ktg5PSIJ ztRlgeMjrqF>>2!5Jvr#sld9WZ*K+NdMaX$4CxyeQ^{t)t=i&t<8?!7wNQimNXC5 zekgF{1e>bZrFXT8a4UlMq^N(Ecs6ja@VF*;&S0Cs#)?D3ho1!Rmk~E&&f>A!B6#5( zMl^QJQ{W>d3<-|Q{&b#q3?6g7o-q}kUsgt%XPGe>{9d5o*dDXDm@u%ip59@@Yz>Bh zz#nFsaG8?cSy|5?UrWoVykmT-Y@|!7vFyK?WqX5r+ob4^r}_)a254D;3OD%x0000< KMNUMnLSTZyN0ylY literal 0 HcmV?d00001 diff --git a/public/images/icon-star-notify-16.png b/public/images/icon-star-notify-16.png new file mode 100644 index 0000000000000000000000000000000000000000..29deb62cb41408e5a3294e6902689293029d5751 GIT binary patch literal 542 zcmV+(0^$9MP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!TH88pTE{{~&&V5=4Bl zYuw!#&)uB_!Y1N@%bq#s&YgQ_68Z~nWm>wGytK=<=xCaoJbyMhEN_dB1-u{QC@Gdw zl9riUIf1|0%cT^pC`AS4v6Mu|0yw!Sh(rzm^^~o3-6@t1f{|2u`2A~bSp=kN_Q}4>L zLFsCuBdyIT5z{VPGdYgkeYwX#aCRz%3b;@D>In4TiXDn$=haAjVgE#BeY0{=gXerQ@ zrbRz62RLd28*Z`w;9$<0AJBd`a%_48ZmWs#I^Pp&6F5rLF{@Q$@E^(#DT6K?wNm}E gG6~b}%Kr_bUqyPiVJYJ@RsaA107*qoM6N<$g1+wItpET3 literal 0 HcmV?d00001 diff --git a/public/images/icon-star-notify-40.png b/public/images/icon-star-notify-40.png new file mode 100644 index 0000000000000000000000000000000000000000..81dc8d2eefd0a6645815c6b997263c534edf1088 GIT binary patch literal 989 zcmV<310wv1P)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D19C}3K~z{r?UzqT z6mb;Ce>1zTyY85JSfqnx5Oyd^g6dicLAMNxM(Uo2sEbg7v|!W<5%fp;bBiD$tV3Pu zklpLjKPrSs5DYbQ+Z|`soZqkacHWNC?zq3%8MA{Q7=G`)8Qy&N_kQz!zh&$EPoz>Q zrN6&lAvX{LOD0~nw2V#hD`+<*)C)@6$VmQ%PgEL%KnGz*@j}}U`6oz$12iJ{X!K2B z0>^)f>twR=X>pZI-vqJ-asACLh_}&*5$PQ#31|o1GEjE+s zP%2glz6D}=wQ6yUTnCKdJ#s51h#A!5F;yemfnvVP>|5Y;R%|4*h^Y)~B(q|C3B(dc z!r}zEMMSH3r{6OBok6`erq+>N1l{vhW~UF*FZGnnoM$_0su^x=uD~--;F*MN? z+yWb-&_8Exfjw%_)b{0DWYJzsYq9CqEFY|ks|h>0y1=_8;a&T|wEo_|T@MQ=G-HZ8 z8)}pT6j~MF9k1XWr`-+~E1qUhq{UfRNM+|J6ey7U8sxs~CJtFqAW~>QGluAB(3Bl^ z)E|)R1LS%PrqfQ`C@Zi43WY`77mcvv6sidP5FkfyIbj8)1tKVNkt-*|s_3PVC!nO4 zp``a^#UY-zI>WRop23XCJIIvAt3bV8Q@4@r8R&7Iw^L67Ev`zJ#tn-rqhv}UEzs_Z zi#_C4OxCozsWV97Wd?O9(TZ)x$ngwbz@;-8lnE%Zl)N9HqY#(@`jWN1i1mwCXTV~lAgs)fGO|}DU^50=d zR#&l0%X=Hz7y~nzHu$(5T>^5o!XQ;BDW}%Cu7VH$&^{9#Cly^ z*@p(4c2Q6=9AX19;tJriu*Ka3GYJQUFBpR|?}edknPpBh_|Gg2e}10ApPz0o!b*X& z2Dws@s~y|~)c4#`GcY^&< zijBk)Nfw8yM+!b{Y+@R`OkW+=FeN6j>N(^v9{N%1-VRbc0Zf7td{qvsggZ=0 zXfi2hFjNgTe~DWM4f3Ey{Q literal 0 HcmV?d00001 diff --git a/public/scripts/amt-wsman-0.2.0-min.js b/public/scripts/amt-wsman-0.2.0-min.js index 293387e7..389c6296 100644 --- a/public/scripts/amt-wsman-0.2.0-min.js +++ b/public/scripts/amt-wsman-0.2.0-min.js @@ -1 +1 @@ -var WsmanStackCreateService=function(e,s,r,a,o,t){var p={};function l(e){if(!e)return"";var s=" ";for(var r in e)e.hasOwnProperty(r)&&0===r.indexOf("@")&&(s+=r.substring(1)+'="'+e[r]+'" ');return s}function w(e){if(!e)return"";if("string"==typeof e)return e;if(e.InstanceID)return''+e.InstanceID+"";var s="";for(var r in e)if(e.hasOwnProperty(r)){if(s+='',e[r].ReferenceParameters){s+="",s+=""+e[r].Address+""+e[r].ReferenceParameters.ResourceURI+"";var a=e[r].ReferenceParameters.SelectorSet.Selector;if(Array.isArray(a))for(var o=0;o"+a[o].Value+"";else s+=""+a.Value+"";s+=""}else s+=e[r];s+=""}return s+=""}return p.NextMessageId=1,p.Address="/wsman",p.comm=CreateWsmanComm(e,s,r,a,o,t),p.PerformAjax=function(e,o,s,r,a){null==a&&(a=""),p.comm.PerformAjax('
"+e,function(e,s,r){if(200==s){var a=p.ParseWsman(e);a&&null!=a?o(p,a.Header.ResourceURI,a,200,r):o(p,null,{Header:{HttpError:s}},601,r)}else o(p,null,{Header:{HttpError:s}},s,r)},s,r)},p.CancelAllQueries=function(e){p.comm.CancelAllQueries(e)},p.GetNameFromUrl=function(e){var s=e.lastIndexOf("/");return-1==s?e:e.substring(s+1)},p.ExecSubscribe=function(e,s,r,a,o,t,n,l,d,c){var m="",i="";null!=d&&null!=c&&(m="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#UsernameToken"+d+''+c+"",i=''),l=null!=l&&null!=l?""+l+"":"";var u="http://schemas.xmlsoap.org/ws/2004/08/eventing/Subscribe"+p.Address+""+e+""+p.NextMessageId+++"http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous"+w(n)+m+'
'+r+""+i+"PT0.000000S";p.PerformAjax(u+"
",a,o,t,'xmlns:e="http://schemas.xmlsoap.org/ws/2004/08/eventing" xmlns:t="http://schemas.xmlsoap.org/ws/2005/02/trust" xmlns:se="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:m="http://x.com"')},p.ExecUnSubscribe=function(e,s,r,a,o){var t="http://schemas.xmlsoap.org/ws/2004/08/eventing/Unsubscribe"+p.Address+""+e+""+p.NextMessageId+++"http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous"+w(o)+"";p.PerformAjax(t+"",s,r,a,'xmlns:e="http://schemas.xmlsoap.org/ws/2004/08/eventing"')},p.ExecPut=function(e,s,r,a,o,t){var n="http://schemas.xmlsoap.org/ws/2004/09/transfer/Put"+p.Address+""+e+""+p.NextMessageId+++"http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymousPT60.000S"+w(t)+""+function(e,s){if(!e||null==s)return"";var r=p.GetNameFromUrl(e),a="';for(var o in s)if(s.hasOwnProperty(o)&&0!==o.indexOf("__")&&0!==o.indexOf("@")&&void 0!==s[o]&&null!==s[o]&&"function"!=typeof s[o])if("object"==typeof s[o]&&s[o].ReferenceParameters){a+=""+s[o].Address+""+s[o].ReferenceParameters.ResourceURI+"";var t=s[o].ReferenceParameters.SelectorSet.Selector;if(Array.isArray(t))for(var n=0;n"+t[n].Value+"";else a+=""+t.Value+"";a+=""}else if(Array.isArray(s[o]))for(n=0;n"+s[o][n].toString()+"";else a+=""+s[o].toString()+"";return a+=""}(e,s);p.PerformAjax(n+"",r,a,o)},p.ExecCreate=function(e,s,r,a,o,t){var n=p.GetNameFromUrl(e),l="http://schemas.xmlsoap.org/ws/2004/09/transfer/Create"+p.Address+""+e+""+p.NextMessageId+++"http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymousPT60S"+w(t)+"';for(var d in s)l+=""+s[d]+"";p.PerformAjax(l+"",r,a,o)},p.ExecCreateXml=function(e,s,r,a,o){var t=p.GetNameFromUrl(e);p.PerformAjax("http://schemas.xmlsoap.org/ws/2004/09/transfer/Create"+p.Address+""+e+""+p.NextMessageId+++"http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymousPT60.000S'+s+"",r,a,o)},p.ExecDelete=function(e,s,r,a,o){var t="http://schemas.xmlsoap.org/ws/2004/09/transfer/Delete"+p.Address+""+e+""+p.NextMessageId+++"http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymousPT60S"+w(s)+"";p.PerformAjax(t,r,a,o)},p.ExecGet=function(e,s,r,a){p.PerformAjax("http://schemas.xmlsoap.org/ws/2004/09/transfer/Get"+p.Address+""+e+""+p.NextMessageId+++"http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymousPT60S",s,r,a)},p.ExecMethod=function(e,s,r,a,o,t,n){var l="";for(var d in r)if(null!=r[d])if(Array.isArray(r[d]))for(var c in r[d])l+=""+r[d][c]+"";else l+=""+r[d]+"";p.ExecMethodXml(e,s,l,a,o,t,n)},p.ExecMethodXml=function(e,s,r,a,o,t,n){p.PerformAjax(e+"/"+s+""+p.Address+""+e+""+p.NextMessageId+++"http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymousPT60S"+w(n)+"'+r+"",a,o,t)},p.ExecEnum=function(e,s,r,a){p.PerformAjax("http://schemas.xmlsoap.org/ws/2004/09/enumeration/Enumerate"+p.Address+""+e+""+p.NextMessageId+++'http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymousPT60S',s,r,a)},p.ExecPull=function(e,s,r,a,o){p.PerformAjax("http://schemas.xmlsoap.org/ws/2004/09/enumeration/Pull"+p.Address+""+e+""+p.NextMessageId+++'http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymousPT60S'+s+"99999999",r,a,o)},p.ParseWsman=function(s){try{s.childNodes||(s=function(e){{if(window.DOMParser)return(new DOMParser).parseFromString(e,"text/xml");var s=new ActiveXObject("Microsoft.XMLDOM");return s.async=!1,s.loadXML(e),s}}(s));var e,r={Header:{}},a=s.getElementsByTagName("Header")[0];if(!(a=a||s.getElementsByTagName("a:Header")[0]))return null;for(var o=0;o'+e.InstanceID+"";var s="";for(var r in e)if(e.hasOwnProperty(r)){if(s+='',e[r].ReferenceParameters){s+="",s+=""+e[r].Address+""+e[r].ReferenceParameters.ResourceURI+"";var a=e[r].ReferenceParameters.SelectorSet.Selector;if(Array.isArray(a))for(var o=0;o"+a[o].Value+"";else s+=""+a.Value+"";s+=""}else s+=e[r];s+=""}return s+=""}return p.NextMessageId=1,p.Address="/wsman",p.comm=CreateWsmanComm(e,s,r,a,o,t),p.PerformAjax=function(e,o,s,r,a){null==a&&(a=""),p.comm.PerformAjax('
"+e,function(e,s,r){if(200==s){var a=p.ParseWsman(e);a&&null!=a?o(p,a.Header.ResourceURI,a,200,r):o(p,null,{Header:{HttpError:s}},601,r)}else o(p,null,{Header:{HttpError:s}},s,r)},s,r)},p.CancelAllQueries=function(e){p.comm.CancelAllQueries(e)},p.GetNameFromUrl=function(e){var s=e.lastIndexOf("/");return-1==s?e:e.substring(s+1)},p.ExecSubscribe=function(e,s,r,a,o,t,n,l,c,d){var m="",i="";null!=c&&null!=d&&(m="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#UsernameToken"+c+''+d+"",i=''),l=null!=l&&null!=l?""+l+"":"";var u="http://schemas.xmlsoap.org/ws/2004/08/eventing/Subscribe"+p.Address+""+e+""+p.NextMessageId+++"http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous"+w(n)+m+'
'+r+""+i+"PT0.000000S";p.PerformAjax(u+"
",a,o,t,'xmlns:e="http://schemas.xmlsoap.org/ws/2004/08/eventing" xmlns:t="http://schemas.xmlsoap.org/ws/2005/02/trust" xmlns:se="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:m="http://x.com"')},p.ExecUnSubscribe=function(e,s,r,a,o){var t="http://schemas.xmlsoap.org/ws/2004/08/eventing/Unsubscribe"+p.Address+""+e+""+p.NextMessageId+++"http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous"+w(o)+"";p.PerformAjax(t+"",s,r,a,'xmlns:e="http://schemas.xmlsoap.org/ws/2004/08/eventing"')},p.ExecPut=function(e,s,r,a,o,t){var n="http://schemas.xmlsoap.org/ws/2004/09/transfer/Put"+p.Address+""+e+""+p.NextMessageId+++"http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymousPT60.000S"+w(t)+""+function(e,s){if(!e||null==s)return"";var r=p.GetNameFromUrl(e),a="';for(var o in s)if(s.hasOwnProperty(o)&&0!==o.indexOf("__")&&0!==o.indexOf("@")&&void 0!==s[o]&&null!==s[o]&&"function"!=typeof s[o])if("object"==typeof s[o]&&s[o].ReferenceParameters){a+=""+s[o].Address+""+s[o].ReferenceParameters.ResourceURI+"";var t=s[o].ReferenceParameters.SelectorSet.Selector;if(Array.isArray(t))for(var n=0;n"+t[n].Value+"";else a+=""+t.Value+"";a+=""}else if(Array.isArray(s[o]))for(n=0;n"+s[o][n].toString()+"";else a+=""+s[o].toString()+"";return a+=""}(e,s);p.PerformAjax(n+"",r,a,o)},p.ExecCreate=function(e,s,r,a,o,t){var n=p.GetNameFromUrl(e),l="http://schemas.xmlsoap.org/ws/2004/09/transfer/Create"+p.Address+""+e+""+p.NextMessageId+++"http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymousPT60S"+w(t)+"';for(var c in s)l+=""+s[c]+"";p.PerformAjax(l+"",r,a,o)},p.ExecCreateXml=function(e,s,r,a,o){var t=p.GetNameFromUrl(e);p.PerformAjax("http://schemas.xmlsoap.org/ws/2004/09/transfer/Create"+p.Address+""+e+""+p.NextMessageId+++"http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymousPT60.000S'+s+"",r,a,o)},p.ExecDelete=function(e,s,r,a,o){var t="http://schemas.xmlsoap.org/ws/2004/09/transfer/Delete"+p.Address+""+e+""+p.NextMessageId+++"http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymousPT60S"+w(s)+"";p.PerformAjax(t,r,a,o)},p.ExecGet=function(e,s,r,a){p.PerformAjax("http://schemas.xmlsoap.org/ws/2004/09/transfer/Get"+p.Address+""+e+""+p.NextMessageId+++"http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymousPT60S",s,r,a)},p.ExecMethod=function(e,s,r,a,o,t,n){var l="";for(var c in r)if(null!=r[c])if(Array.isArray(r[c]))for(var d in r[c])l+=""+r[c][d]+"";else l+=""+r[c]+"";p.ExecMethodXml(e,s,l,a,o,t,n)},p.ExecMethodXml=function(e,s,r,a,o,t,n){p.PerformAjax(e+"/"+s+""+p.Address+""+e+""+p.NextMessageId+++"http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymousPT60S"+w(n)+"'+r+"",a,o,t)},p.ExecEnum=function(e,s,r,a){p.PerformAjax("http://schemas.xmlsoap.org/ws/2004/09/enumeration/Enumerate"+p.Address+""+e+""+p.NextMessageId+++'http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymousPT60S',s,r,a)},p.ExecPull=function(e,s,r,a,o){p.PerformAjax("http://schemas.xmlsoap.org/ws/2004/09/enumeration/Pull"+p.Address+""+e+""+p.NextMessageId+++'http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymousPT60S'+s+"99999999",r,a,o)},p.ParseWsman=function(s){try{s.childNodes||(s=function(e){{if(window.DOMParser)return(new DOMParser).parseFromString(e,"text/xml");var s=new ActiveXObject("Microsoft.XMLDOM");return s.async=!1,s.loadXML(e),s}}(s));var e,r={Header:{}},a=s.getElementsByTagName("Header")[0];if(!(a=a||s.getElementsByTagName("a:Header")[0]))return null;for(var o=0;ocontainer->column_l->p12->termTable->1->1->6->1->1->terminalSettingsButtons" ] }, + { + "en": "Toggle Star", + "xloc": [ + "default.handlebars->contextMenu->cxstar" + ] + }, { "cs": "Přepnout režim zobrazení", "de": "Ansichtsmodus umschalten", @@ -31769,4 +31775,4 @@ ] } ] -} +} \ No newline at end of file diff --git a/views/default-mobile.handlebars b/views/default-mobile.handlebars index 5ae3253b..c1f2b5d4 100644 --- a/views/default-mobile.handlebars +++ b/views/default-mobile.handlebars @@ -214,29 +214,60 @@ } .deviceNotifyDot { - text-align:center; position:absolute; right:10px; top:0px; - width:16px; height:16px; + } + + .deviceNotifyDotSub { + text-align:center; color:#FFF; + width:16px; background-color:#00F; padding:2px; border-radius:10px; box-shadow: 2px 2px 10px black; cursor:pointer; + margin-left:3px; } - .deviceNotifyDot:hover { + .deviceNotifyDotSub:hover { background-color:#44F; } - .deviceNotifyLargeDot { + .deviceNotifySmallDot { + position:absolute; + right:10px; + top:0px; + height:10px; + } + + .deviceNotifySmallDotSub { text-align:center; + color:#FFF; + width:10px; + padding:2px; + background-color:#00F; + border-radius:10px; + box-shadow: 2px 2px 10px black; + cursor:pointer; + margin-left:2px; + } + + .deviceNotifySmallDotSub:hover { + background-color:#44F; + } + + .deviceNotifyLargeDot { position:absolute; right:10px; top:10px; + height:40px; + } + + .deviceNotifyLargeDotSub { + text-align:center; width:40px; height:40px; color:#FFF; @@ -245,9 +276,10 @@ border-radius:20px; box-shadow: 2px 2px 10px black; cursor:pointer; + margin-left:4px; } - .deviceNotifyLargeDot:hover { + .deviceNotifyLargeDotSub:hover { background-color:#44F; } @@ -485,7 +517,10 @@
- +
+ + +
@@ -752,6 +787,7 @@ var meshserver = null; var xdr = null; var usergroups = null; + var stars = {}; // Devices that have been "stared" by the user. var serverinfo = null; var nodes = []; var meshes = {}; @@ -792,6 +828,9 @@ meshserver.onMessage = onMessage; meshserver.Start(); + // Setup stared devices + try { stars = JSON.parse(getstore('stars', '{}')); } catch (ex) { } + // Load desktop settings var t = localStorage.getItem('desktopsettings'); if (t != null) { desktopsettings = JSON.parse(t); } @@ -1070,11 +1109,17 @@ var webstate = JSON.parse(message.event.state); for (var i in webstate) { localStorage.setItem(i, webstate[i]); } + // Update stars + if (webstate.stars != null) { stars = JSON.parse(webstate.stars); } + // Update the web page if ((webstate.loctag != null) && (webstate.loctag != oldLoctag)) { if (webstate.loctag != null) { args.locale = webstate.loctag; } else { delete args.locale; } updateDevices(); updateMeshes(); + } else if (webstate.stars != null) { + updateDevices(); + if (Q('SearchInput').value == '*') { onSearchInputChanged(); } } } break; @@ -1953,6 +1998,9 @@ nodes[d].v = false; if (nodes[d].users && nodes[d].users.length > 0) { for (var i in nodes[d].users) { if (nodes[d].users[i].toLowerCase().indexOf(userSearch) >= 0) { nodes[d].v = true; } } } } + } else if (x == '*') { + // Star filter + for (var d in nodes) { nodes[d].v = (stars[nodes[d]._id] == 1); } } else { // Device name search try { @@ -2109,11 +2157,19 @@ if (showRealNames == true && nodes[i].rname != null) name = EscapeHtml(nodes[i].rname); if (name.length == 0) { name = '' + "None" + ''; } - // Setup device notification - var devNotify = ''; + // Add device notification icons + var devNotify = '', devNotifySub = ''; + + // This device is "starred" + if (stars[nodes[i]._id] == 1) { + devNotifySub += ''; + } + + // This device has session information if (nodes[i].sessions != null) { + // Sessions are active if ((nodes[i].sessions.kvm != null) || (nodes[i].sessions.terminal != null) || (nodes[i].sessions.files != null) || (nodes[i].sessions.tcp != null) || (nodes[i].sessions.udp != null)) { - devNotify = ''; + devNotifySub += ''; } // Battery state @@ -2137,6 +2193,9 @@ } } + // Add any device icons + if (devNotifySub != '') { devNotify += '
' + devNotifySub + '
'; } + // Node var icon = nodes[i].icon, nodestate = NodeStateStr(nodes[i]); if ((!nodes[i].conn) || (nodes[i].conn == 0)) { icon += ' gray'; } @@ -2310,6 +2369,7 @@ // Setup session notification QV('p10deviceNotify', (currentNode.sessions != null) && ((node.sessions.kvm != null) || (node.sessions.terminal != null) || (node.sessions.files != null) || (node.sessions.tcp != null) || (node.sessions.udp != null))); + QV('p10deviceStar', stars[currentNode._id] == 1); // Device Battery QV('p10deviceBattery', false); diff --git a/views/default.handlebars b/views/default.handlebars index 20939bbf..32d86154 100644 --- a/views/default.handlebars +++ b/views/default.handlebars @@ -48,6 +48,7 @@
Console

+