"use strict";Array.prototype.remove=function(){for(var e,t,n=arguments,i=n.length;i&&this.length;)for(e=n[--i];-1!==(t=this.indexOf(e));)this.splice(t,1);return this},console.debug||(console.debug=console.log),"undefined"==typeof Number&&(console.log("define Number"),Number=function(e){return parseFloat(e)}),Object.assign||(Object.assign=$.extend);var $iframeDialog=null,configNotSaved=null,showConfig=null,defaults={},customPostInits={},FORBIDDEN_CHARS=/[\]\[*,;'"`<>\\\s?]/g,adapterRedirect=function(e,t){e&&setTimeout(function(){e+=document.location.pathname,e+=document.location.hash,document.location.href=e},t||5e3)},gMain=null;function detectIE(){var e=window.navigator.userAgent,t=e.indexOf("MSIE ");if(0td"),a=H.data[n.key];function s(e){return'
'+e+"
"}if(a){i.eq(0).css({overflow:"hidden","white-space":"nowrap"});var o=a.desc.indexOf("div>div").css("height: 22px !important"),u(2,a.keywords).attr("title",a.keywords),i.eq(3).html(a.installed),i.eq(4).html(a.version),u(5,a.license),u(6,a.install),H.initButtons(n.key),H.isCollapsed[a.group]&&(H.isCollapsed[a.group]=!1,H.main.saveConfig("adaptersIsCollapsed",JSON.stringify(H.isCollapsed)))}else{i.eq(0).css({"font-weight":"bold"}),i.eq(0).find("img").remove(),i.eq(0).find("span.fancytree-title").attr("style","padding-left: 0px !important");for(var c=0;c'+l+' / '+H.tree[c].children.length+"]",i.eq(1).html(s(''+l+" "+_("of")+' '+H.tree[c].children.length+" "+_("Adapters from this Group installed")));break}}function u(e,t){return i.eq(e).html(s(t))}},gridnav:{autofocusInput:!1,handleCursorKeys:!0},filter:{mode:"hide",autoApply:!0},collapse:function(e,t){H.isCollapsed[t.node.key]||(H.isCollapsed[t.node.key]=!0,H.main.saveConfig("adaptersIsCollapsed",JSON.stringify(H.isCollapsed)))}}),H.$tab.find("#btn_collapse_adapters").show().off("click").on("click",function(){H.$tab.find(".process-adapters").show(),setTimeout(function(){H.$grid.fancytree("getRootNode").visit(function(e){(!H.filterVals.length||e.match||e.subMatch)&&e.setExpanded(!1)}),H.$tab.find(".process-adapters").hide()},100)}),H.$tab.find("#btn_expand_adapters").show().off("click").on("click",function(){H.$tab.find(".process-adapters").show(),setTimeout(function(){H.$grid.fancytree("getRootNode").visit(function(e){(!H.filterVals.length||e.match||e.subMatch)&&e.setExpanded(!0)}),H.$tab.find(".process-adapters").hide()},100)}),H.$tab.find("#btn_list_adapters").show().off("click").on("click",function(){var e=H.$tab.find(".process-adapters");e.show(),H.isList=!H.isList,H.isList?(H.$tab.find("#btn_list_adapters").addClass("red lighten-3"),H.$tab.find("#btn_expand_adapters").hide(),H.$tab.find("#btn_collapse_adapters").hide(),$(this).attr("title",_("list"))):(H.$tab.find("#btn_list_adapters").removeClass("red lighten-3"),H.$tab.find("#btn_expand_adapters").show(),H.$tab.find("#btn_collapse_adapters").show(),$(this).attr("title",_("tree"))),H.main.saveConfig("adaptersIsList",H.isList),e.show(),setTimeout(function(){H._postInit(!0),e.hide()},200)})),H.isList?(H.$tab.find("#btn_list_adapters").addClass("red lighten-3").attr("title",_("tree")),H.$tab.find("#btn_expand_adapters").hide(),H.$tab.find("#btn_collapse_adapters").hide()):(H.$tab.find("#btn_list_adapters").removeClass("red lighten-3").attr("title",_("list")),H.$tab.find("#btn_expand_adapters").show(),H.$tab.find("#btn_collapse_adapters").show()),H.$tab.find(".filter-input").trigger("change")}function n(){H.$grid.hide(),H.$tiles.show(),H.$tab.find("#main-toolbar-table-types-btn").show(),H.$tab.find("#btn_list_adapters").hide(),H.$tab.find("#btn_collapse_adapters").hide(),H.$tab.find("#btn_expand_adapters").hide(),H.$tab.find(".filter-input").trigger("change")}function i(){H.onlyUpdatable?(H.$tab.find("#btn_filter_updates").addClass("red lighten-3"),H.$tab.find("#btn_upgrade_all").show()):(H.$tab.find("#btn_upgrade_all").hide(),H.$tab.find("#btn_filter_updates").removeClass("red lighten-3"))}function a(){H.main.config.expertMode?(H.$tab.find("#btn_adapters_expert_mode").addClass("red lighten-3"),H.$tab.find("#btn_upgrade_all").show()):(H.$tab.find("#btn_adapters_expert_mode").removeClass("red lighten-3"),i())}function B(){var t=!1;H.currentFilter?H.$tiles.find(".tile").each(function(){var e=$(this);(!H.currentType||e.hasClass("class-"+H.currentType))&&G({key:e.data("id")})?(t=!0,e.show()):e.hide()}):H.currentType?(H.$tiles.find(".tile").hide(),H.$tiles.find(".class-"+H.currentType).show(),H.$tiles.find(".tile").each(function(){if($(this).is(":visible"))return!(t=!0)})):H.$tiles.find(".tile").show().each(function(){if($(this).is(":visible"))return!(t=!0)}),t?H.$tiles.find(".filtered-out").hide():H.$tiles.find(".filtered-out").show()}function G(e){if(H.currentFilter){if(!H.data[e.key])return!1;var t=H.data[e.key].title;t&&"object"==typeof t&&(t=t[systemLang]||t.en);var n=H.data[e.key].desc;return n&&"object"==typeof n&&(n=n[systemLang]||n.en),!!(H.data[e.key].name&&-1!==H.data[e.key].name.toLowerCase().indexOf(H.currentFilter)||t&&-1!==t.toLowerCase().indexOf(H.currentFilter)||H.data[e.key].keywords&&-1!==H.data[e.key].keywords.toLowerCase().indexOf(H.currentFilter)||n&&-1!==n.toLowerCase().indexOf(H.currentFilter))}return!0}function F(e,t){var n="";if(t.news)for(var i in t.news)if(t.news.hasOwnProperty(i)){if(systemLang===i&&(n+=(n?"\n":"")+t.news[i]),"en"===i||"cn"===i)continue;if(i===e)break;n+=(n?"\n":"")+(t.news[i][systemLang]||t.news[i].en)}return n}function Z(e){if(!e)return"";var t;if(e instanceof Array){t={};for(var n=0;n'),i}this.curRepository=null,this.curRepoLastUpdate=null,this.curInstalled=null,this.curRepoLastHost=null,this.list=[],this.$tab=$("#tab-adapters"),this.$grid=this.$tab.find("#grid-adapters"),this.$tiles=this.$tab.find("#grid-adapters-tiles"),this.$installDialog=$("#dialog-install-url"),this.main=e,this.tree=[],this.data={},this.urls={},this.groupImages={"common adapters_group":"img/common.png",general_group:"img/common.png",hardware_group:"img/hardware.png",lighting_group:"img/hardware.png",energy_group:"img/hardware.png",household_group:"img/hardware.png","iot-systems_group":"img/hardware.png","climate-control_group":"img/hardware.png",infrastructure_group:"img/hardware.png",garden_group:"img/hardware.png",alarm_group:"img/hardware.png",script_group:"img/script.png",logic_group:"img/script.png",media_group:"img/media.png",multimedia_group:"img/media.png",communication_group:"img/communication.png",protocols_group:"img/communication.png",network_group:"img/communication.png",messaging_group:"img/communication.png",visualisation_group:"img/visualisation.png",visualization_group:"img/visualisation.png","visualization-icons_group":"img/visualisation.png","visualization-widgets_group":"img/visualisation.png",storage_group:"img/storage.png",weather_group:"img/weather.png",schedule_group:"img/schedule.png",vis_group:"img/vis.png","date-and-time_group":"img/service.png",geoposition_group:"img/service.png",utility_group:"img/service.png","misc-data_group":"img/service.png",service_group:"img/service.png","third-party_group":"img/service.png"},this.inited=!1,this.isList=!1,this.filterVals={length:0},this.onlyInstalled=!1,this.onlyUpdatable=!1,this.currentFilter="",this.currentType="",this.isCollapsed={},this.isTiles=!0,this.types={occ:"schedule"},this.prepare=function(){this.$tab.find("#btn_switch_adapters").off("click").on("click",function(){H.$tab.find(".process-adapters").show(),H.isTiles=!H.isTiles,H.isTiles?(H.$tab.removeClass("view-table").addClass("view-tiles"),$(this).find("i").text("view_list")):($(this).find("i").text("view_module"),H.$tab.removeClass("view-tiles").addClass("view-table")),H.main.saveConfig("adaptersIsTiles",H.isTiles),setTimeout(function(){H.isTiles?n():t(),H._postInit(!0),H.$tab.find(".process-adapters").hide()},50)}),this.$tab.find("#btn_filter_adapters").off("click").on("click",function(){H.$tab.find(".process-adapters").show(),H.onlyInstalled=!H.onlyInstalled,H.onlyInstalled?H.$tab.find("#btn_filter_adapters").addClass("red lighten-3"):H.$tab.find("#btn_filter_adapters").removeClass("red lighten-3"),H.main.saveConfig("adaptersOnlyInstalled",H.onlyInstalled),setTimeout(function(){H._postInit(!0),H.$tab.find(".process-adapters").hide()},50)}),this.$tab.find("#btn_filter_updates").off("click").on("click",function(){H.$tab.find(".process-adapters").show(),H.onlyUpdatable=!H.onlyUpdatable,i(),H.main.saveConfig("adaptersOnlyUpdatable",H.onlyUpdatable),setTimeout(function(){H._postInit(!0),H.$tab.find(".process-adapters").hide()},200)}),this.$tab.find("#btn_filter_custom_url").off("click").on("click",function(){var e,t='",n=[];for(e in H.urls)H.urls.hasOwnProperty(e)&&n.push(e);n.sort();for(var i=0;i'+n[i]+"")}H.$installDialog.find("#install-github-link").html(t).val(H.main.config.adaptersGithub||""),H.$installDialog.modal(),H.$installDialog.find(".btn-install").off("click").on("click",function(){var e,t,n,i,a;if(!H.$installDialog.find('a[href="#tabs-install-github"]').hasClass("active"))e=H.$installDialog.find("#install-url-link").val(),i=H.$installDialog.find("#install-url-link-username").val(),a=H.$installDialog.find("#install-url-link-password").val(),i&&(e=e.replace("https://","https://"+i+":"+a+"@")),e.startsWith("http")&&e.endsWith(".git")&&(e="git+"+e),t=H.$installDialog.find("#install-url-debug").prop("checked")?" --debug":"",n="";else{var s=H.$installDialog.find("#install-github-link").val().split(" ");e=s[0],t=H.$installDialog.find("#install-github-debug").prop("checked")?" --debug":"",n=" "+s[1]}e?H.main.cmdExec(null,'url "'+e+'" --production'+n+t,function(e){e||H.init(!0,!0)}):H.main.showError(_("Invalid link"))}),H.$installDialog.find("#install-github-link").select(),H.$installDialog.find('input[type="checkbox"]+span').off("click").on("click",function(){var e=$(this).prev();e.prop("disabled")||e.prop("checked",!e.prop("checked")).trigger("change")}),H.$installDialog.modal("open"),H.$installDialog.find(".tabs").mtabs({nShow:function(e){e&&H.main.saveConfig("adaptersInstallTab",$(e).attr("id"))}}),H.main.config.adaptersInstallTab&&!H.main.noSelect&&H.$installDialog.find(".tabs").mtabs("select",H.main.config.adaptersInstallTab)}),this.$tab.find("#btn_upgrade_all").off("click").on("click",function(){H.main.confirmMessage(_("Do you want to upgrade all adapters?"),_("Please confirm"),"help",function(e){e&&H.main.cmdExec(null,"upgrade",function(e){e||H._postInit(!0)})})}),this.$tab.find("#btn_adapters_expert_mode").on("click",function(){H.main.config.expertMode=!H.main.config.expertMode,H.main.saveConfig("expertMode",H.main.config.expertMode),H.updateExpertMode(),H.main.tabs.instances.updateExpertMode()}),H.main.config.expertMode&&H.$tab.find("#btn_adapters_expert_mode").addClass("red lighten-3"),this.$installDialog.find("#install-github-link").on("change",function(){H.main.saveConfig("adaptersGithub",$(this).val())}),this.$installDialog.find("#install-url-link").on("keyup",function(e){13===e.which&&H.$installDialog.find("#dialog-install-url-button").trigger("click")}),this.isTiles=void 0===this.main.config.adaptersIsTiles||null===this.main.config.adaptersIsTiles||this.main.config.adaptersIsTiles,this.isList=this.main.config.adaptersIsList||!1,this.onlyInstalled=this.main.config.adaptersOnlyInstalled||!1,this.onlyUpdatable=this.main.config.adaptersOnlyUpdatable||!1,this.currentFilter=this.main.config.adaptersCurrentFilter||"",this.currentType=this.main.config.adaptersCurrentType||"",this.currentOrder=this.main.config.adaptersCurrentOrder||"a-z",this.isCollapsed=this.main.config.adaptersIsCollapsed?JSON.parse(this.main.config.adaptersIsCollapsed):{},this.currentFilter?(this.$tab.find(".filter-input").addClass("input-not-empty").val(H.currentFilter),this.$tab.find(".filter-clear").show()):this.$tab.find(".filter-clear").hide(),this.onlyInstalled?this.$tab.find("#btn_filter_adapters").addClass("red lighten-3"):this.$tab.find("#btn_filter_adapters").removeClass("red lighten-3"),this.onlyUpdatable?this.$tab.find("#btn_filter_updates").addClass("red lighten-3"):this.$tab.find("#btn_filter_updates").removeClass("red lighten-3"),"ie"===this.main.browser&&this.main.browserVersion<=10&&(this.isTiles=!1,this.$tab.find("#btn_switch_adapters").hide()),a(),this.$tab.find("#btn_refresh_adapters").on("click",function(){H.init(!0,!0)}),this.$tab.find(".filter-input").on("keyup",function(){$(this).trigger("change")}).on("change",function(e){H.filterTimer&&clearTimeout(H.filterTimer),H.filterTimer=setTimeout(function(){H.filterTimer=null,H.currentFilter=H.$tab.find(".filter-input").val().toLowerCase(),e&&e.target&&$(e.target)[H.currentFilter?"addClass":"removeClass"]("input-not-empty"),H.currentFilter?H.$tab.find(".filter-clear").show():H.$tab.find(".filter-clear").hide(),H.main.saveConfig("adaptersCurrentFilter",H.currentFilter),H.isTiles?B():H.$grid.fancytree("getTree").filterNodes(G,!1)},400)}),this.$tab.find(".filter-clear").on("click",function(){H.$tab.find(".filter-input").val("").trigger("change")}),this.isTiles?(this.$tab.find("#btn_switch_adapters").find("i").text("view_list"),H.$tab.removeClass("view-table").addClass("view-tiles"),n()):(H.$tab.removeClass("view-tiles").addClass("view-table"),t())},this.updateExpertMode=function(){this.init(!0),a()},this.getAdaptersInfo=function(e,t,n,i){if(e){if(!i)throw"Callback cannot be null or undefined";t&&(!this.curRepoLastUpdate||1e3<(new Date).getTime()-this.curRepoLastUpdate)&&(this.curRepository=null,this.curInstalled=null),this.curRunning?this.curRunning.push(i):(this.curRepository&&this.curRepoLastHost===e||(this.curRepository=null,this.main.socket.emit("sendToHost",e,"getRepository",{repo:this.main.systemConfig.common.activeRepo,update:n},function(e){"permissionError"===e&&(console.error('May not read "getRepository"'),e={}),H.curRepository=e||{},H.curRepository&&H.curInstalled&&H.curRunning&&(H.curRepoLastUpdate=(new Date).getTime(),setTimeout(function(){for(var e=0;e'+e+'',t&&(e+=''),e+=""}c.sort(),H.tree=[],H.data={};for(var m=0;m';for(var w=0;w',b!==p&&(g+=''+p+"",b&&(g+=" ~ ")),b&&(g+=''+b+""),g+=""):g+='',g+=''+n.version+"",h=''+n.version+"",g+="",!y&&H.onlyUpdatable)continue}i=u(a=i,y,M,v);var j=(n.type||H.types[o]||"common adapters")+"_group";C=(C="object"==typeof n.desc?n.desc[systemLang]||n.desc.en:n.desc)||"",C+=W(j,o,H.main.states["system.adapter."+o+".upload"]?H.main.states["system.adapter."+o+".upload"].val:0);var L=n.titleLang||n.title;if(L="object"==typeof L?L[systemLang]||L.en:L,H.data[o]={image:f?'':"",icon:f||"",stat:e[o]?e[o].stat:0,name:o,title:(L||"").replace("yunkong2 Visualisation - ",""),desc:C,news:M,updatableError:v,keywords:n.keywords?n.keywords.join(" "):"",version:i,installed:g,rawVersion:a,instances:p,rawInstalled:h,versionDate:n.versionDate,updatable:y,bold:n.highlight||!1,install:''+(H.main.config.expertMode?'':"")+"'+(H.main.config.expertMode?'':""),group:j,license:n.license||"",licenseUrl:n.licenseUrl||""},n.type||console.log('"'+o+'": "common adapters",'),n.type&&H.types[o]&&console.log('Adapter "'+o+'" has own type. Remove from admin.'),H.isList)H.tree.push({icon:f,title:H.data[o].title||o,key:o});else{for(var N=-1,T=0;T':"",icon:n.extIcon,stat:n.stat,name:o,title:(L||"").replace("yunkong2 Visualisation - ",""),desc:C,keywords:n.keywords?n.keywords.join(" "):"",rawVersion:a,version:i,bold:n.highlight,installed:"",versionDate:n.versionDate,install:''+(H.main.config.expertMode?'':""),license:n.license||"",licenseUrl:n.licenseUrl||"",group:j},n.type||console.log('"'+o+'": "common adapters",'),n.type&&H.types[o]&&console.log('Adapter "'+o+'" has own type. Remove from admin.'),H.isList)H.tree.push({icon:n.extIcon,title:H.data[o].title||o,key:o});else{for(var D=-1,I=0;IH.data[t].stat?-1:H.data[e].statH.data[t].versionDate?-1:H.data[e].versionDate',O+='
',O+='
',O+='
',O+=' ',O+=' '+S.title+"",O+=' more_vert',O+='
    ',O+="
  • "+d["Available version:"]+' "+S.rawVersion+""+(S.updatable?'':"")+"
  • ",S.installed&&(O+="
  • "+d["Installed version"]+': '+S.rawInstalled+"
  • "),S.instances&&(O+="
  • "+_("Installed instances")+': '+S.instances+"
  • "),O+="
",O+="
",O+=' ',O+='
',O+=' close',O+="

"+S.desc+"

",O+='
',O+=S.install,O+="
",O+="
","popular"===H.currentOrder&&S.stat?O+='
'+S.stat+"
":"updated"===H.currentOrder&&S.versionDate&&(O+='
'+J(S.versionDate,d.today,d.yesterday,d["1 %d days ago"],d["2 %d days ago"],d["5 %d days ago"],l)+"
"),O+="
",O+=""}for(var Y in O+='
',O+='
',O+='
',O+='
',O+=' '+_("Filtered out")+"",O+="
",O+=' ',O+="
",O+="
",H.$tiles.html(O),H.data)H.data.hasOwnProperty(Y)&&H.initButtons(Y);for(var Q='
  • '+d.all+"
  • \n",P=0;P'+_(A[P])+"\n";var U=H.$tab.find("#main-toolbar-table-types");U.html(Q),U.find(".main-toolbar-table-types-item").show().off("click").on("click",function(){H.currentType=$(this).data("type")||"",B(),H.$tab.find("#main-toolbar-table-types-btn").html(_(H.currentType||"all")),H.main.saveConfig("adaptersCurrentType",H.currentType)}),H.currentType&&!d[H.currentType]&&(d[H.currentType]=_(H.currentType)),H.$tab.find("#main-toolbar-table-types-btn").html(d[H.currentType||"all"]).dropdown({constrainWidth:!1,gutter:0}),(U=H.$tab.find("#main-toolbar-table-order")).find(".main-toolbar-table-order-item").off("click").on("click",function(){H.currentOrder=$(this).data("type")||"",H.$tab.find("#main-toolbar-table-order-btn").html(_(H.currentOrder||"a-z")),H.main.saveConfig("adaptersCurrentOrder",H.currentOrder),H._postInit()}),H.currentOrder&&!d[H.currentOrder]&&(d[H.currentOrder]=_(H.currentOrder)),H.$tab.find("#main-toolbar-table-order-btn").show().html(d[H.currentOrder||"a-z"]).dropdown({constrainWidth:!1,gutter:0}),B()}else{H.$tab.find("#main-toolbar-table-types-btn").hide(),H.$tab.find("#main-toolbar-table-order-btn").hide(),H.$grid.fancytree("getTree").reload(H.tree),H.$grid.find(".fancytree-icon").each(function(){$(this).attr("src")&&$(this).css({width:18,height:18}),$(this).on("hover",function(){var e='
    ',t=$(e);t.insertAfter($(this)),$(this).data("big",t[0]);var n=parseFloat(t.height()),i=Math.round($(this).position().top-(n-parseFloat($(this).height()))/2);n+i>(window.innerHeight||document.documentElement.clientHeight)&&(i=(window.innerHeight||document.documentElement.clientHeight)-n),t.css({top:i})},function(){var e=$(this).data("big");$(e).remove(),$(this).data("big",void 0)})}),H.currentFilter&&H.$grid.fancytree("getTree").filterNodes(G,!1),H.sortTree(),H.enableColResize();var R=["tab-adapters-table-name","tab-adapters-table-description","tab-adapters-table-keywords","tab-adapters-table-installed","tab-adapters-table-available","tab-adapters-table-license","tab-adapters-table-install"];H.$grid.find("tbody tr").each(function(){var e=0;$(this).find("td").each(function(){$(this).addClass(R[e]),e++})})}H.$tab.find(".grid-main-div").removeClass("order-a-z order-popular order-updated").addClass(H.currentOrder?"order-"+H.currentOrder:""),H.$tab.find(".process-adapters").hide(),H.updateCounter(s)})):this.enableColResize(),this.restoreScroll()},this.saveScroll=function(){this.scrollTop=this.$tab.find(".grid-main-div").scrollTop()},this.restoreScroll=function(){this.scrollTop&&this.$tab.find(".grid-main-div").scrollTop(this.scrollTop)},this.updateCounter=function(e){if(void 0===e)this.getAdaptersInfo(this.main.currentHost,!1,!1,function(e,t){var n=0;for(var i in t)if(t.hasOwnProperty(i)){var a=t?t[i]:null;if(a&&!a.controller&&"hosts"!==i){var s="";e[i]&&e[i].version&&(s=e[i].version),a.version&&!H.main.upToDate(s,a.version)&&n++}}H.updateCounter(n)});else if(e){var t=$("#updates-for-adapters");t.length?t.text(e):$(''+e+"").appendTo('.admin-sidemenu-items[data-tab="tab-adapters"] a')}else $("#updates-for-adapters").remove()},this.init=function(e,t){this.inited&&!e||(this.main.objectsLoaded?(this.inited||(this.inited=!0,this.main.subscribeObjects("system.host.*"),this.main.subscribeStates("system.host.*")),this.main.tabs.hosts.getHosts(function(){H._postInit(e,t)})):setTimeout(function(){H.init(e,t)},250))},this.destroy=function(){this.inited&&(this.saveScroll(),this.inited=!1,this.main.unsubscribeObjects("system.host.*"),this.main.unsubscribeStates("system.host.*"))},this.initButtons=function(r){this.$tab.find('.adapter-install-submit[data-adapter-name="'+r+'"]').off("click").on("click",function(){var s=$(this).attr("data-adapter-name"),e=$(this).attr("data-adapter-desc");!function(e,t,n){if(H.main.tabs.hosts.list.length<=1&&!H.main.config.expertMode)return n(!0,H.main.currentHost,"");var i=$("#dialog-add-instance");i.find(".dialog-add-instance-name").html(e),i.find(".dialog-add-description").html(t);for(var a="",s=0;s'+o.name+""}H.main.tabs.hosts.list.length<=1?i.find(".dialog-add-instance-host").addClass("disabled").prop("disabled",!0):i.find(".dialog-add-instance-host").removeClass("disabled").prop("disabled",!1),i.find(".dialog-add-instance-host").html(a).select();for(var r=-1,c=[],l=0;l'+_("auto")+"";for(var m=0;m'+m+"");i.find(".dialog-add-instance-number").html(a).select(),i.find(".dialog-add-install-btn").off("click").on("click",function(e){n&&(n(!0,i.find(".dialog-add-instance-host").val(),i.find(".dialog-add-instance-number").val()),n=null),i.find(".dialog-add-cancel-btn").off("click"),i.find(".dialog-add-instance-number").off("click")}),i.find(".dialog-add-cancel-btn").off("click").on("click",function(e){n&&(n(!1),n=null),i.find(".dialog-add-cancel-btn").off("click"),i.find(".dialog-add-instance-number").off("click")}),i.modal({dismissible:!1,complete:function(){i.find(".dialog-add-instance-name").html("")}}).modal("open")}(s,e,function(e,i,a){e&&H.getAdaptersInfo(i,!1,!1,function(e,t){var n=e[s];n||(n=t[s]),n&&(n.license&&"MIT"!==n.license?function(i,a){var s=$("#dialog-license");if(!H.data[i].installed&&H.data[i].licenseUrl){var o=setTimeout(function(){a(!(o=null))},1e4);"object"==typeof H.data[i].licenseUrl&&(H.data[i].licenseUrl=H.data[i].licenseUrl[systemLang]||H.data[i].licenseUrl.en),H.main.socket.emit("httpGet",H.data[i].licenseUrl,function(e,t,n){o&&(clearTimeout(o),o=null,!e&&n?(s.css({"z-index":200}),n=(n=n.toString().replace(/\r\n/g,"
    ")).replace(/\n/g,"
    "),s.find(".license_text").html(n),s.find(".license_agreement_name").text(_(" for %s",i)),s.modal({dismissible:!1,complete:function(){s.find(".license_text").html("")}}).modal("open"),s.find(".license_agree").off("click").on("click",function(e){a&&(a(!0),a=null),s.find(".license_agree").off("click"),s.find(".license_non_agree").off("click")}),s.find(".license_non_agree").off("click").on("click",function(e){a&&(a(!1),a=null),s.find(".license_agree").off("click"),s.find(".license_non_agree").off("click")})):(a&&a(!0),a=null))})}else a(!0)}(s,function(e){e&&H.main.cmdExec(null,"add "+s+" "+a+" --host "+i,function(e){e||H._postInit(!0)})}):H.main.cmdExec(null,"add "+s+" "+a+" --host "+i,function(e){e||H._postInit(!0)}))})})}),this.$tab.find('.adapter-delete-submit[data-adapter-name="'+r+'"]').off("click").on("click",function(){var t=$(this).attr("data-adapter-name");H.main.confirmMessage(_("Are you sure you want to delete adapter %s?",t),_("Please confirm"),"help",function(e){e&&H.main.cmdExec(null,"del "+t,function(e){e||H._postInit(!0)})})}),this.$tab.find('.adapter-readme-submit[data-adapter-name="'+r+'"]').off("click").on("click",function(){H.main.navigate({tab:"adapters",dialog:"readme",params:$(this).data("adapter-name")})}),this.$tab.find('.adapter-update-submit[data-adapter-name="'+r+'"]').off("click").on("click",function(){var e=$(this).attr("data-adapter-name");"admin"===e&&(H.main.waitForRestart=!0),H.main.cmdExec(null,"upgrade "+e,function(e){e||H._postInit(!0)})}),this.$tab.find('.adapter-upload-submit[data-adapter-name="'+r+'"]').off("click").on("click",function(){var e=$(this).attr("data-adapter-name");H.main.cmdExec(null,"upload "+e,function(e){e||H._postInit(!0)})});var e=this.$tab.find('.adapter-update-custom-submit[data-adapter-name="'+r+'"]');e.off("click").on("click",function(){var e=[];if(H.main.objects["system.adapter."+r].common.news){var t=H.main.objects["system.adapter."+r].common.news;for(var n in t)t.hasOwnProperty(n)&&e.push(n)}else e.push(H.main.objects["system.adapter."+r].common.version);for(var i='
    ',a=0;a'+e[a]+' - "}i+="
    ";var o=$("#adapters-menu");o.length||((o=$('")).appendTo($(".materialize-dialogs").first()),o.modal()),o.data("trigger",this),o.find("p").html(i),o.find("h4").html(_("Versions of %s",r)),o.find(".adapters-versions-link").off("click").on("click",function(){o.modal("close");var e=$(this).data("adapter-name"),t=$(this).data("version");t&&e&&H.main.cmdExec(null,"upgrade "+e+"@"+t,function(e){e||H._postInit(!0)})}),o.modal("open")}),H.main.objects["system.adapter."+r]||e.hide()},this.objectChange=function(e,t){if(e.match(/^system\.adapter\.[a-zA-Z0-9-_]+$/)){if(t)-1===this.list.indexOf(e)&&this.list.push(e);else{var n=this.list.indexOf(e);-1!==n&&this.list.splice(n,1)}void 0!==this.$grid&&this.$grid[0]._isInited&&this.init(!0)}},this.stateChange=function(e,t){if(e&&t){var n=e.match(/^system\.adapter\.([\w\d-]+)\.upload$/);if(n){var i=this.$tab.find('.adapter-upload-progress[data-adapter-name="'+n[1]+'"]'),a=W(t.val);i.html(a).css({opacity:t.val?.7:0}),this.$tab.find('.group-upload-progress[data-adapter-group="'+i.data("adapter-group")+'"]').html(a).css({opacity:t.val?.7:0})}}}}function Config(e){var t=this;this.$dialog=$("#dialog-config"),this.$configFrame=this.$dialog.find("#config-iframe"),this.main=e,this.prepare=function(){$iframeDialog=this},this.init=function(){if(!this.inited){this.inited=!0;var e=this.main.navigateGetParams(),t=e.split(".");this.main.objects[e]&&this.main.objects[e].common&&this.main.objects[e].common.materialize?this.$configFrame.attr("src","adapter/"+t[2]+"/index_m.html?"+t[3]):this.$configFrame.attr("src","adapter/"+t[2]+"/?"+t[3]);var n=e.replace(/^system\.adapter\./,"");this.$dialog.data("name",n),this.$dialog.find(".title").html(_("Adapter configuration")+": "+n)}},this.allStored=function(){return!window.frames["config-iframe"].changed},this.close=function(){t.main.navigate()},this.destroy=function(){if(this.inited&&(this.inited=!1,this.$configFrame.attr("src",""),void 0!==showConfig&&showConfig&&showConfig.length)){var e=showConfig.shift();setTimeout(function(){t.main.navigate({tab:"instances",dialog:"config",params:e})},1e3)}}}function Customs(C){var m,g,h,f,T,D,I,k,z,x,O,A,E="__different__",S=this;function Y(e){if(e)S.historyTimeout&&clearTimeout(S.historyTimeout);else if(S.historyTimeout)return;S.historyTimeout=setTimeout(function(){S.historyTimeout=null,O&&S.loadHistoryTable(O.data("id"),!0)},e||5e3)}function Q(t,n){$.ajax({headers:{Accept:"text/html"},cache:!0,url:"/adapter/"+t+"/custom_m.html",success:function(e){n(null,e)},error:function(e){$.ajax({headers:{Accept:"text/html"},cache:!0,url:"/adapter/"+t+"/custom.html",success:function(e){n(null,e)},error:function(e){n(e.responseText)}})}})}function P(e){e.stopPropagation(),e.preventDefault();var t=S.$dialog.find("#customs-tabs"),c=t.data("ids");S.currentCustoms=null;var l=_(E);if(t.find("input, select").each(function(){var e=$(this).data("instance"),t=$(this).data("field");if(t){var n;if("checkbox"===$(this).attr("type")){if(this.indeterminate)return;n=$(this).prop("checked")}else n=$(this).val();if(n!==l){null===n&&(n=""),void 0===n&&(n=""),"false"===n&&(n=!1),"true"===n&&(n=!0);var i=parseFloat(n);n.toString().replace(/^\+/,"").replace(/([0-9]+(\.[0-9]+[1-9])?)(\.?0+$)/,"$1")===i.toString()&&(n=i);for(var a=0;a
    '+_("Settings for %s",j)+' '+_("active")+'
    '+$('script[data-template-name="'+v+'"]').html()+"
    ",T=$(N);this.defaults[v]={},T.find("input, select").each(function(){var e=$(this);e.attr("data-instance",v+"."+w);var t=e.attr("data-field"),n=e.attr("data-default");"true"===n&&(n=!0),"false"===n&&(n=!1),void 0!==n&&n.toString().replace(/\+/,"")===parseFloat(n).toString()&&(n=parseFloat(n)),S.defaults[v][t]=n,"enabled"===t&&e.on("click",function(e){e.stopPropagation(),$(this).prop("checked")})}),s.append(T),customPostInits.hasOwnProperty(v)&&"function"==typeof customPostInits[v]&&customPostInits[v](T,r[v+"."+w],S.main.objects["system.adapter."+v+"."+w],i,a)}s.find("input, select").each(function(){var e,n=$(this),t=n.data("instance"),i=t.split(".")[0],a=n.data("field");void 0!==r[t][a]?"checkbox"===n.attr("type")?r[t][a]===E?n[0].indeterminate=!0:n.prop("checked",r[t][a]):r[t][a]===E?("number"===n.attr("type")&&n.attr("type","text"),"SELECT"===n.prop("tagName").toUpperCase()?(n.prepend('"),n.val(o)):n.val("").attr("placeholder",o)):n.val(r[t][a]):(S.defaults[i]&&void 0!==S.defaults[i][a]&&(e=S.defaults[i][a]),void 0!==e&&("checkbox"===n.attr("type")?n.prop("checked",e):n.val(e)));"checkbox"===n.attr("type")?n.on("change",function(){if(S.$dialog.find(".dialog-system-buttons .btn-save").removeClass("disabled"),"enabled"===$(this).data("field")){var e=n.data("instance"),t=s.find('.activated[data-adapter="'+e+'"]');$(this).prop("checked")?t.css("opacity",1):t.css("opacity",0)}}):n.on("change",function(){S.$dialog.find(".dialog-system-buttons .btn-save").removeClass("disabled")}).on("keyup",function(){$(this).trigger("change")})}),this.showCustomsData(1'+_("Loading...")+"");var n={aggregate:"none",instance:O.val(),from:!0,ack:!0,q:!0};T||(T=this.$dialog.find("#tab-customs-table .datepicker.date-from"),D=this.$dialog.find("#tab-customs-table .datepicker.date-to"),I=this.$dialog.find("#tab-customs-table .timepicker.time-from"),k=this.$dialog.find("#tab-customs-table .timepicker.time-to"));var d,i=T.val()?M.Datepicker.getInstance(T).toString("yyyy.mm.dd"):"",a=I.val(),s=D.val()?M.Datepicker.getInstance(D).toString("yyyy.mm.dd"):"",o=k.val(),r=!0;if(s?(r=!1,(s=new Date(s)).setHours(23),s.setMinutes(59),s.setSeconds(59),s.setMilliseconds(999)):s=new Date,o){var c=o.split(":");s.setHours(c[0]),s.setMinutes(c[1]),s.setSeconds(59),s.setMilliseconds(999),r=!1}if(s=s.getTime(),r&&(s+=1e4),n.end=s,i||a){if(i=new Date(i||s),a){var u=a.split(":");i.setHours(u[0]),i.setMinutes(u[1])}else i.setHours(0),i.setMinutes(0);i.setSeconds(0),i.setMilliseconds(0),n.start=i.getTime()}else n.count=50;l&&(d=new Date(s).toISOString()+"_"+(n.start?new Date(n.start):n.count+"points")+"_"+e+"__"+n.instance+".csv"),C.socket.emit("getHistory",e,n,function(r,c){setTimeout(function(){var e,t,n,i="value;acknowledged;from;timestamp;lastchanged;\n";if(r)console.error(r),m.html(''+r+"");else{var a="";if(c&&c.length){for(var s=c.length-1;0<=s;s--){var o=(c[s].from||"").replace("system.adapter.","").replace("system.","");a+=' '+c[s].val+" "+c[s].ack+" "+o+" "+C.formatDate(c[s].ts)+" "+C.formatDate(c[s].lc)+"\n",l&&(i+=c[s].val+";"+c[s].ack+";"+(o||"")+";"+(c[s].ts?new Date(c[s].ts).toISOString():"")+";"+(c[s].lc?new Date(c[s].lc).toISOString():"")+";\n")}f=c[c.length-1].ts}else a=''+_("No data")+"";m.html(a)}!function e(){$.fn.colResizable&&(g.is(":visible")?(g.data("inited")||((h=new IobListHeader("grid-history-header",{list:g,colWidthOffset:1,prefix:"log-filter"})).add("text","val"),h.add("text","ack"),h.add("text","from"),h.add("text","ts"),h.add("text","lc")),g.colResizable({liveDrag:!0,partialRefresh:!0,marginLeft:5,postbackSafe:!0,onResize:function(e){return h.syncHeader()}}),h.syncHeader()):setTimeout(function(){e()},200))}(),l&&(e=d,t=i,(n=document.createElement("a")).setAttribute("href","data:text/plain;charset=utf-8,"+encodeURIComponent(t)),n.setAttribute("download",e),n.style.display="none",document.body.appendChild(n),n.click(),document.body.removeChild(n))},0)})},this.loadHistoryChart=function(e){if(z||(z=this.$dialog.find("#tab-customs-chart .datepicker.date-from"),x=this.$dialog.find("#tab-customs-chart .datepicker.date-to")),e){for(var t=0,n=!1,i=!1,a=0;a"+u[v]+"\n")}if(y){O.data("id",n[0]).html(y).show().off("change").on("change",function(){S.main.saveConfig("object-history-table",O.val()),S.loadHistoryTable($(this).data("id"))}).select(),A.data("id",n[0]).html(y).show().off("change").on("change",function(){S.main.saveConfig("object-history-chart",A.val()),S.loadHistoryChart($(this).data("id"))}).select(),void 0!==this.main.config["object-history-table"]&&O.val(this.main.config["object-history-table"]),void 0!==this.main.config["object-history-chart"]&&A.val(this.main.config["object-history-chart"]),p.data("id",n[0]).show().off("click").on("click",function(){S.$dialog.find("#grid-history-body").html(""),S.loadHistoryTable($(this).data("id"))}),M.data("id",n[0]).show().off("click").on("click",function(){S.loadHistoryChart($(this).data("id"))}),b.data("id",n[0]).show().off("click").on("click",function(){S.loadHistoryTable($(this).data("id"),!1,!0)});var j=new Date;j.setDate(j.getDate()-1);for(var L={today:_("Today"),clear:_("Clear"),done:_("Ok"),months:[_("January"),_("February"),_("March"),_("April"),_("May"),_("June"),_("July"),_("August"),_("September"),_("October"),_("November"),_("December")],monthsShort:[_("Jan"),_("Feb"),_("Mar"),_("Apr"),_("May"),_("Jun"),_("Jul"),_("Aug"),_("Sep"),_("Oct"),_("Nov"),_("Dec")],weekdaysShort:[_("Sun"),_("Mon"),_("Tue"),_("Wed"),_("Thu"),_("Fri"),_("Sat")],weekdays:[_("Sunday"),_("Monday"),_("Tuesday"),_("Wednesday"),_("Thursday"),_("Friday"),_("Saturday")],weekdaysAbbrev:["S","M","T","W","T","F","S"]},N=0;N\n
    \n',"state"===i&&"common"===n&&"type"===s?a+='":"string"==typeof t[s]?a+='\n':"number"==typeof t[s]?a+='\n':"boolean"==typeof t[s]?a+='\n":a+='\n";var o=s;"common"===n&&systemDictionary["common_"+s]&&systemDictionary["common_"+s][systemLang]&&(o=_("common_"+s)),"boolean"==typeof t[s]?a+=""+o+"\n":a+="\n",a+='
    \n\n',a+="\n"}c.$dialog.find(e).html(a)}function n(e,t){var n=c.$dialog.find(e);n.find(".object-tab-edit-string").each(function(){t[$(this).data("attr")]=$(this).val()}),n.find(".object-tab-edit-number").each(function(){t[$(this).data("attr")]=parseFloat($(this).val())}),n.find(".object-tab-edit-boolean").each(function(){t[$(this).data("attr")]=$(this).prop("checked")});var i=null;if(n.find(".object-tab-edit-object").each(function(){try{t[$(this).data("attr")]=JSON.parse($(this).val())}catch(e){return i=$(this).data("attr"),!1}}),void 0!==t.write&&("false"!==t.write&&"0"!==t.write&&0!==t.write||(t.write=!1),"true"!==t.write&&"1"!==t.write&&1!==t.write||(t.write=!0)),void 0!==t.read&&("false"!==t.read&&"0"!==t.read&&0!==t.read||(t.read=!1),"true"!==t.read&&"1"!==t.read&&1!==t.read||(t.read=!0)),null===t.min&&delete t.min,void 0!==t.min){var a=parseFloat(t.min);a.toString()===t.min.toString()&&(t.min=a),"false"===t.min&&(t.min=!1),"true"===t.min&&(t.min=!0)}if(null===t.max&&delete t.max,void 0!==t.max){var s=parseFloat(t.max);s.toString()===t.max.toString()&&(t.max=s),"false"===t.max&&(t.max=!1),"true"===t.max&&(t.max=!0)}if(null===t.def&&delete t.def,void 0!==t.def){var o=parseFloat(t.def);o.toString()===t.def.toString()&&(t.def=o),"false"===t.def&&(t.def=!1),"true"===t.def&&(t.def=!0)}if(-1!==e.indexOf("common"))for(var r in t)t.hasOwnProperty(r)&&("true"===t[r]&&(t[r]=!0),"false"===t[r]&&(t[r]=!1),parseFloat(t[r]).toString()===t[r]&&(t[r]=parseFloat(t[r])));return i}function s(e,t,n){"boolean"==typeof t&&(n=t,t=3e3),c.main.showToast(c.$dialog,e,null,t,n)}this.$dialog=$("#dialog-editobject"),this.$dialogNewField=$("#dialog-new-field"),this.main=e,this.prepared=!1,this.inited=!1,this.$dialogSave=this.$dialog.find(".dialog-editobject-buttons .btn-save"),this.iconVal=null,this._prepare=function(){this.prepared||(this.prepared=!0,this.$dialogSave.on("click",function(){c.save()}),this.$dialog.find(".dialog-editobject-buttons .btn-cancel").on("click",function(){c.editor.setValue(""),c.$dialogSave.addClass("disabled"),c.main.navigate()}),this.$dialog.find(".btn-add-common").on("click",function(){c.$dialogNewField.find(".object-tab-new-icon").show(),c.$dialogNewField.modal("open");var e=c.$dialogNewField.find(".object-tab-new-name");e.data("type","common").focus(),e.hasClass("autocomplete")||(e.addClass("autocomplete"),e.mautocomplete({data:{type:null,desc:null,min:null,max:null,def:null,role:null,unit:null,read:null,write:null,states:null},minLength:0})),e.focus()}),this.$dialog.find(".btn-add-native").on("click",function(){c.$dialogNewField.find(".object-tab-new-icon").hide(),c.$dialogNewField.modal("open");var e=c.$dialogNewField.find(".object-tab-new-name");e.hasClass("autocomplete")&&(e.mautocomplete("destroy"),e.removeClass("autocomplete")),M.updateTextFields("#dialog-new-field"),e.data("type","native").focus()}),this.$dialogNewField.find(".object-tab-new-name").keypress(function(e){13===e.which&&c.$dialogNewField.find(".btn-add").trigger("click")}),this.editor||(this.editor=ace.edit("view-object-raw"),this.editor.getSession().setMode("ace/mode/json"),this.editor.$blockScrolling=!0,this.editor.getSession().on("change",function(){c.$dialogSave.removeClass("disabled")})),this.$dialogNewField.modal(),this.$dialog.find(".tabs").mtabs({onShow:function(e){if(e){var t=$(e).attr("id");if("object-tab-common"===t)s(_("Drop the icons here"));else if("object-tab-raw"===t){var n=c.saveFromTabs();if(!n)return!1;c.editor.setValue(JSON.stringify(n,null,2))}else if("object-tab-raw"===t){var i;try{i=JSON.parse(c.editor.getValue())}catch(e){return c.main.showMessage(e,_("Parse error"),"error_outline"),c.main.noSelect||c.$dialog.find(".tabs").mtabs("select","object-tab-raw"),!1}c.load(i)}return c.main.saveConfig("object-edit-active",t),!0}}}),this.$dialogNewField.find(".btn-add").on("click",function(e){e.preventDefault(),e.stopPropagation();var t=c.$dialogNewField.find(".object-tab-new-name"),n=t.data("type")||"common",i=t.val().trim(),a=c.saveFromTabs();i&&-1===i.indexOf(" ")?void 0===a[n][i]?(a[n][i]="",c.load(a),c.$dialogNewField.find(".object-tab-new-name").val(""),c.$dialogNewField.modal("close"),c.$dialogSave.removeClass("disabled")):c.main.showError(_("Field %s yet exists!",i)):c.main.showError(_("Invalid field name: %s",i))}),this.$dialogNewField.find(".btn-cancel").on("click",function(e){c.$dialogNewField.find(".object-tab-new-name").val("")}),this.$dialog.find(".edit-object-name").on("change",function(){c.$dialogSave.removeClass("disabled")}).on("keyup",function(){$(this).trigger("change")}),this.$dialog.find(".edit-object-type").on("change",function(){c.$dialogSave.removeClass("disabled")}),this.$dialog.find(".object-tab-rights input").on("change",function(){c.$dialogSave.removeClass("disabled")}),installFileUpload(this.$dialog.find("#object-tab-common"),5e4,function(e,t){if(e)s(e,!0);else{if(!t.match(/^data:image\//))return void s(_("Unsupported image format"),!0);c.$dialogSave.removeClass("disabled"),c.iconVal=t;var n=c.$dialog.find(".icon-editor");n.find(".icon").show().html(''),n.find(".icon .treetable-icon").attr("src",t)}}),this.$dialog.find(".icon-editor .icon-upload").off("click").on("click",function(){c.$dialog.find(".drop-file").trigger("click")}),this.$dialog.find(".icon-editor .icon-clear").off("click").on("click",function(){c.iconVal&&(c.iconVal=null,c.$dialog.find(".icon-editor").hide().appendTo(c.$dialog),c.$dialogSave.removeClass("disabled"))}))},this.init=function(){if(this._prepare(),!this.inited){this.inited=!0;var e=c.main.navigateGetParams(),t=!!(e||"").match(/,def$/);e=e.replace(/,def$/,"");var n=this.main.objects[e];if(n){void 0===this.main.config["object-edit-active"]||c.main.noSelect||this.$dialog.find(".tabs").mtabs("select",this.main.config["object-edit-active"]);for(var i,a="",s=0;s'+(i||this.main.tabs.users.list[s])+"";for(this.$dialog.find(".object-tab-acl-owner").html(a),a="",s=0;s'+(i||this.main.tabs.users.groups[s])+"";this.$dialog.find(".object-tab-acl-group").html(a),this.load(n),t?this.$dialog.data("cb",function(n){"state"===n.type&&c.main.socket.emit("getState",n._id,function(e,t){t&&null!==t.val&&void 0!==t.val||c.main.socket.emit("setState",n._id,void 0===n.common.def?null:n.common.def,!0)})}):this.$dialog.data("cb",null),c.$dialogSave.addClass("disabled")}}},this.destroy=function(){this.inited&&(this.inited=!1)},this.load=function(e){if(e){e.common=e.common||{},e.native=e.native||{},e.acl=e.acl||{},this.$dialog.find(".title-id").text(e._id),this.$dialog.find(".edit-object-name").val(e.common?translateName(e.common.name):e._id),this.$dialog.find(".edit-object-type").val(e.type),this.$dialog.find(".object-tab-acl-owner").val(e.acl.owner||"system.user.admin"),this.$dialog.find(".object-tab-acl-group").val(e.acl.ownerGroup||"system.group.administrator"),this.$dialog.find(".icon-editor").hide().appendTo(this.$dialog),a(".object-tab-common-table",e.common||{},"common",e.type),a(".object-tab-native-table",e.native||{},"native",e.type),void 0!==e.common.icon?(this.iconVal=e.common.icon,this.$dialog.find(".object-tab-common-table").prepend(this.$dialog.find(".icon-editor").show()),this.$dialog.find(".icon-editor .icon").html(c.main.getIconFromObj(e))):this.iconVal=null,this.$dialog.find(".object-tab-field-delete").on("click",function(){var n=$(this).data("part"),i=$(this).data("attr");c.main.confirmMessage(_("Delete attribute"),_("Please confirm"),"error_outline",function(e){if(e){var t=c.saveFromTabs();delete t[n][i],c.load(t)}})}),e.acl=e.acl||{},void 0===e.acl.object&&(e.acl.object=1638),this.$dialog.find("#object-tab-acl-obj-owner-read").prop("checked",1024&e.acl.object),this.$dialog.find("#object-tab-acl-obj-owner-write").prop("checked",512&e.acl.object),this.$dialog.find("#object-tab-acl-obj-group-read").prop("checked",64&e.acl.object),this.$dialog.find("#object-tab-acl-obj-group-write").prop("checked",32&e.acl.object),this.$dialog.find("#object-tab-acl-obj-every-read").prop("checked",4&e.acl.object),this.$dialog.find("#object-tab-acl-obj-every-write").prop("checked",2&e.acl.object),"state"!==e.type?this.$dialog.find(".object-tab-acl-state").hide():(this.$dialog.find(".object-tab-acl-state").show(),void 0===e.acl.state&&(e.acl.state=1638),this.$dialog.find("#object-tab-acl-state-owner-read").prop("checked",1024&e.acl.state),this.$dialog.find("#object-tab-acl-state-owner-write").prop("checked",512&e.acl.state),this.$dialog.find("#object-tab-acl-state-group-read").prop("checked",64&e.acl.state),this.$dialog.find("#object-tab-acl-state-group-write").prop("checked",32&e.acl.state),this.$dialog.find("#object-tab-acl-state-every-read").prop("checked",4&e.acl.state),this.$dialog.find("#object-tab-acl-state-every-write").prop("checked",2&e.acl.state));var t=JSON.parse(JSON.stringify(e));if(this.editor.setValue(JSON.stringify(t,null,2)),t._id&&delete t._id,t.common&&delete t.common,t.type&&delete t.type,t.native&&delete t.native,t.acl&&delete t.acl,this.$dialog.find("#view-object-rest").val(JSON.stringify(t,null," ")),this.$dialog.find("select").select(),this.$dialog.find('input[type="checkbox"]+span').off("click").on("click",function(){var e=$(this).prev();e.prop("disabled")||e.prop("checked",!e.prop("checked")).trigger("change")}),this.$dialog.find("input").on("change",function(){c.$dialogSave.removeClass("disabled")}).on("keyup",function(){$(this).trigger("change")}),this.$dialog.find("select").on("change",function(){c.$dialogSave.removeClass("disabled")}),this.$dialog.find("textarea").on("change",function(){c.$dialogSave.removeClass("disabled")}).on("keyup",function(){$(this).trigger("change")}),void 0!==e.common.color){var n=Date.now(),i=this.$dialog.find('.object-tab-edit-string[data-attr="color"]').parent();i.prepend('color_lens'+_("Color")+""),i.colorpicker({component:".btn",color:i,container:!0}).colorpicker("setValue",e.common.color||"#fff").on("showPicker.colorpicker",function(){}).on("changeColor.colorpicker",function(e){100'+g.main.getIconFromObj(s[e][t])+p(s[e][t])+"");n&&(n+='
  • '),n+='
  • control_point'+_("custom group")+"
  • ",g.$gridEnum.find("#btn-new-group-"+i).html(n),g.$gridEnum.find('.btn-new-group-btn[data-target="btn-new-group-'+i+'"]').dropdown({constrainWidth:!1}),g.$gridEnum.find("#btn-new-group-"+i).find(".new-group-item").off("click").on("click",function(){var e=$(this).data("id"),t=$(this).data("enum");if(e){var n=t.replace(/[.#\\\/&?]+/g,"-");g.main.saveConfig("enums-active","enum-"+n),g.main.socket.emit("setObject",e,s[t][e],function(e){e&&g.main.showError(e)})}else v(null,t)})}else{for(t in a)a.hasOwnProperty(t)&&-1===g.list.indexOf(t)&&(n+='
  • '+g.main.getIconFromObj(a[t])+p(a[t])+"
  • ");n&&(n+='
  • '),n+='
  • control_point'+_("custom enum")+"
  • ",g.$gridEnum.find("#btn-new-enum").html(n),g.$gridEnum.find(".btn-new-enum-btn").dropdown({constrainWidth:!1}),g.$gridEnum.find(".new-enum-item").off("click").on("click",function(){var e=$(this).data("id");if(e){var t=e.replace(/[.#\\\/&?]+/g,"-");g.main.saveConfig("enums-active","enum-"+t),g.main.socket.emit("setObject",e,a[e],function(e){e&&g.main.showError(e)})}else v(null)})}}function p(e,t){var n;(n=t?e[t]:e)&&n.common&&n.common.name?n=translateName(n.common.name):n=(n=t.split(".").pop())[0].toUpperCase()+n.substring(1).toLowerCase();return n}function r(e,t,n){var i,a,s,o=g.main.objects[e],r=e.replace(/[.#\\\/&?]+/g,"-"),c='';c+='
      ';for(var l=0;l'+g.main.getIcon(g.list[l],null,null,"icon")+''+p(g.main.objects,g.list[l])+"

      "+g.list[l]+"


      ",d&&d.common&&d.common.members&&d.common.members.length)for(var m=0;m'+g.main.getIcon(i)+''+p(g.main.objects,i)+'close
    ');c+='edit',c+='delete',c+=""}c+="
    ",t.html(c),f(e),n&&t.find(".enum-collection").scrollTop(n),function(n){for(var e=g.$gridList.find('.enum-buttons[data-id="'+n+'"] .filter-input'),t={},i=0;i\n view_list\n note_add\n \n \n queue_play_next\n \n ');var t='
    ';t+='",t+="
    ";for(var a=0;a',t+="");var s={};e.find(".enum-collection").each(function(){s[$(this).data("id")]=$(this).scrollTop()});try{var o=g.$gridEnum.find(".tree-table-body .collection").find(".collection-item");try{o.droppable("instance")&&o.droppable("destroy")}catch(n){console.error(n)}}catch(n){}e.html(t),0tr.treetable-enum");e.droppable("instance")&&e.droppable("destroy")}catch(e){console.log(e)}g.$gridList.html("").removeClass("tree-table-tiles").addClass("tree-table-list"),g.$gridList.treeTable({objects:g.main.objects,root:"enum",columns:["title","name"],members:!0,colors:!0,icons:!0,widths:["calc(100% - 250px)","250px"],name:"enums",buttonsWidth:"40px",buttons:[{text:!1,icons:{primary:"ui-icon-trash"},click:function(t,e,n){g.main.objects[t]?"enum"===g.main.objects[t].type?e?g.main.confirmMessage(_("All sub-enums of %s will be deleted too?",t),null,"help",function(e){e&&g.main._delObjects(t,!0,function(e){e?b(_("Error: %s",e),!0):b(_("Deleted"))})}):g.main.confirmMessage(_("Are you sure to delete %s?",t),null,"help",function(e){e&&g.main._delObjects(t,!0,function(e){e?b(_("Error: %s",e),!0):b(_("Deleted"))})}):u(t,n):g.main.objects[n]&&"enum"===g.main.objects[n].type?u(t,n):b(_('Object "%s" does not exists. Update the page.',t))},width:26,height:20},{text:!1,icons:{primary:"ui-icon-pencil"},match:function(e){return g.main.objects[e]&&"enum"===g.main.objects[e].type},click:function(e,t,n){v(e)},width:26,height:20}],panelButtons:[{id:"tab-enums-btn-switch-tiles",title:_("change view mode"),icon:"view_module",click:function(){g.isTiles=!0,g.main.saveConfig("enumIsTiles",g.isTiles),setTimeout(function(){n()},50)}},{id:"tab-enums-list-new-enum",title:_("New enum"),icon:"note_add",click:function(){v(null)}},{id:"tab-enums-list-new-category",title:_("New category"),icon:"library_add",click:function(){v(null,g.enumEdit)}},{id:"tab-enums-list-edit",title:_("Edit"),icon:"edit",click:function(){w(!g.editMode)}}],onChange:function(e,t){if(e!==t){g.enumEdit=e;var n=g.main.objects[e];if(n&&"enum"===n.type)$("#tab-enums-list-new-enum").removeClass("disabled").attr("title",_("Create new enum, like %s","enum.newCategory")),2===e.split(".").length?g.$gridList.find("#tab-enums-list-new-category").removeClass("disabled").attr("title",_("Create new category, like %s",e+".newEnum")):g.$gridList.find("#tab-enums-list-new-category").addClass("disabled");else g.$gridList.find("#tab-enums-list-new-enum").addClass("disabled"),g.$gridList.find("#tab-enums-list-new-category").addClass("disabled")}},onReady:m}),g.$gridList.find(".tree-table-buttons a").addClass("btn-small"),g.$gridList.find("#tab-enums-list-new-enum").addClass("disabled"),g.$gridList.find("#tab-enums-list-new-category").addClass("disabled")}function l(t){if("enum"===g.main.objects[t].type){var e=function(e){for(var t=e.split("."),n=[],i=new RegExp("^"+e.replace(/\./g,"\\.")+"\\."),a=0;atr.treetable-enum").droppable({accept:".fancytree-type-draggable",over:function(e,t){if($(this).addClass("tab-accept-item"),$(this).hasClass("not-empty")&&!$(this).hasClass("expanded")){var n;$(this).data("tt-id");(n=$(this).data("timer"))&&clearTimeout(n),$(this).data("timer",setTimeout(function(){g.$gridList.treeTable("expand",$(this).data("tt-id"))},1e3))}},out:function(e,t){var n;$(this).removeClass("tab-accept-item"),(n=$(this).data("timer"))&&(clearTimeout(n),$(this).data("timer",null))},tolerance:"pointer",drop:function(e,t){$(this).removeClass("tab-accept-item"),i(t.draggable.data("id"),$(this).data("tt-id"))}}))}function y(e){if(g.editMode){var t=(e=e||g.$gridEnum.find(".tree-table-body .collection")).find(".collection-item");try{t.droppable("instance")&&t.droppable("destroy")}catch(e){console.error(e)}t.droppable({accept:".fancytree-type-draggable",over:function(e,t){$(this).addClass("tab-accept-item")},out:function(e,t){$(this).removeClass("tab-accept-item")},tolerance:"pointer",drop:function(e,t){$(this).removeClass("tab-accept-item"),i(t.draggable.data("id"),$(this).data("id"))}})}}function v(e,a){var i=!1,s=g.$gridEnum.find("#tab-enums-dialog-new"),o="",t="",n="",r="",c="",l="",d=!0;if(installFileUpload(s,5e4,function(e,t){if(e)b(e,!0);else{if(!t.match(/^data:image\//))return void b(_("Unsupported image format"),!0);s.find(".tab-enums-dialog-create").removeClass("disabled"),c=t,s.find(".tab-enums-dialog-new-icon").show().html(''),s.find(".tab-enums-dialog-new-icon img").attr("src",t),s.find(".tab-enums-dialog-new-icon-clear").show()}}),d=e?(g.main.objects[e]&&g.main.objects[e].common&&(t=translateName(g.main.objects[e].common.name),c=g.main.objects[e].common.icon,l=g.main.objects[e].common.color),n=o=e,s.find("#tab-enums-dialog-preserve-id").prop("checked",!0),!1):(s.find("#tab-enums-dialog-preserve-id").prop("checked",!1),!0),s.find(".tab-enums-dialog-new-title").text(_(a?"Create new category":n?"Rename":"Create new enum")),n){var u=n.split(".");u.length<=2&&(e=!0),n=u.pop(),a=u.join("."),r=n}s.find("#tab-enums-dialog-new-name").val(t).off("change").on("change",function(){var e=s.find("#tab-enums-dialog-new-id"),t=e.val(),n=$(this).val();n=n.replace(FORBIDDEN_CHARS,"_").replace(/\./g,"_").trim().toLowerCase(),!d||t&&i||(e.val(n),s.find("#tab-enums-dialog-new-preview").val((a||"enum")+"."+(n||"#")),M.updateTextFields("#tab-enums-dialog-new")),e.val()&&!e.val().match(/[.\s]/)?(s.find(".tab-enums-dialog-create").removeClass("disabled"),e.removeClass("wrong")):(s.find(".tab-enums-dialog-create").addClass("disabled"),e.addClass("wrong"))}).off("keyup").on("keyup",function(){$(this).trigger("change")}),s.find("#tab-enums-dialog-new-id").val(n).off("change").on("change",function(){if(!s.find("#tab-enums-dialog-preserve-id").prop("checked")){i=!0;var e=$(this).val();s.find("#tab-enums-dialog-new-preview").val((a||"enum")+"."+($(this).val()||"#")),M.updateTextFields("#tab-enums-dialog-new"),e&&!e.match(/[.\s]/)?(s.find(".tab-enums-dialog-create").removeClass("disabled"),$(this).removeClass("wrong")):(s.find(".tab-enums-dialog-create").addClass("disabled"),$(this).addClass("wrong"))}}).off("keyup").on("keyup",function(){$(this).trigger("change")}),s.find("#tab-enums-dialog-new-id").prop("disabled",!d),s.find(".tab-enums-dialog-create").addClass("disabled").off("click").text(_(o?"Change":"Create")).on("click",function(){var e,t,n,i;o?(s.find("#tab-enums-dialog-preserve-id").prop("checked")?(e="object"==typeof g.main.objects[o].common.name?g.main.objects[o].common.name:{en:o.split(".").pop()})[systemLang]=s.find("#tab-enums-dialog-new-name").val():e=s.find("#tab-enums-dialog-new-name").val(),h(o,a+"."+s.find("#tab-enums-dialog-new-id").val(),{name:e,icon:c,color:l},function(e){e?b(_("Error: %s",e),!0):b(_("Updated"))})):(t=(a||"enum")+"."+s.find("#tab-enums-dialog-new-id").val(),n={name:s.find("#tab-enums-dialog-new-name").val(),icon:c,color:l},i=function(e){e?b(_("Error: %s",e),!0,5e3):b(_("Updated"))},g.main.objects[t]?b(_("Name yet exists!"),!0):g.main.socket.emit("setObject",t,{_id:t,common:{name:n.name,members:[],icon:n.icon,color:n.color},type:"enum"},i))}),s.find("#tab-enums-dialog-new-preview").val((a||"enum")+"."+(n||"#")),c?(s.find(".tab-enums-dialog-new-icon").show().html(g.main.getIcon(o)),s.find(".tab-enums-dialog-new-icon-clear").show()):(s.find(".tab-enums-dialog-new-icon").hide(),s.find(".tab-enums-dialog-new-icon-clear").hide()),(l=l||!1)?s.find(".tab-enums-dialog-new-color").val(l):s.find(".tab-enums-dialog-new-color").val(),M.updateTextFields("#tab-enums-dialog-new"),g.main.showToast(s,_("Drop the icons here")),s.find(".tab-enums-dialog-new-upload").off("click").on("click",function(){s.find(".drop-file").trigger("click")}),s.find(".tab-enums-dialog-new-icon-clear").off("click").on("click",function(){c&&(c="",s.find(".tab-enums-dialog-new-icon").hide(),s.find(".tab-enums-dialog-create").removeClass("disabled"),s.find(".tab-enums-dialog-new-icon-clear").hide())}),s.find(".tab-enums-dialog-new-color-clear").off("click").on("click",function(){l&&(s.find(".tab-enums-dialog-create").removeClass("disabled"),s.find(".tab-enums-dialog-new-color-clear").hide(),s.find(".tab-enums-dialog-new-colorpicker").colorpicker({component:".btn",color:l,container:s.find(".tab-enums-dialog-new-colorpicker")}).colorpicker("setValue",""),l="")});var m=Date.now();try{s.find(".tab-enums-dialog-new-colorpicker").colorpicker("destroy")}catch(e){}s.find(".tab-enums-dialog-new-colorpicker").colorpicker({component:".btn",color:l,container:s.find(".tab-enums-dialog-new-colorpicker")}).colorpicker("setValue",l).on("showPicker.colorpicker",function(){var e=s.find(".modal-content");e[0].scrollTop=e[0].scrollHeight}).on("changeColor.colorpicker",function(e){100tr.treetable-enum");i.droppable("instance")&&i.droppable("destroy")}catch(e){console.error(e)}t.removeClass("red").addClass("blue"),g.$gridEnum.removeClass("tab-enums-edit")}}this.prepare=function(){this.isTiles=void 0===this.main.config.enumIsTiles||null===this.main.config.enumIsTiles||this.main.config.enumIsTiles},this._initObjectTree=function(){var e={objects:t.objects,noDialog:!0,draggable:["device","channel","state"],name:"enum-objects",expertModeRegEx:/^system\.|^yunkong2\.|^_|^[\w-]+$|^enum\.|^[\w-]+\.admin|^script\./,texts:{select:_("Select"),cancel:_("Cancel"),all:_("All"),id:_("ID"),ID:_("ID"),name:_("Name"),role:_("Role"),room:_("Room"),function:_("Function"),value:_("Value"),type:_("Type"),selectid:_("Select ID"),from:_("From"),lc:_("Last changed"),ts:_("Time stamp"),wait:_("Processing..."),ack:_("Acknowledged"),edit:_("Edit"),push:_("Trigger event"),ok:_("Ok"),with:_("With"),without:_("Without"),copyToClipboard:_("Copy to clipboard"),expertMode:_("Toggle expert mode"),refresh:_("Update"),sort:_("Sort alphabetically"),button:_("Settings"),noData:_("No data")},filter:{type:"state"},columns:["ID","name","type","role"]};o("init",e).selectId("show"),function(){var e=g.$gridEnum.find(".fancytree-container>tbody");try{e.sortable("instance")&&e.sortable("destroy")}catch(e){console.error(e)}g.$gridEnum.find(".fancytree-container>tbody").sortable({connectWith:"#tab-enums .tab-enums-list .tree-table-main.treetable",items:".fancytree-type-draggable",appendTo:g.$gridEnum,refreshPositions:!0,helper:function(e,t){return $('
    '+t.find(".fancytree-title").text()+"
    ")},zIndex:999990,revert:!1,scroll:!1,start:function(e,t){var n=t.item.prev();t.item.data("prev",n),g.$gridEnum.addClass("dragging")},stop:function(e,t){g.$gridEnum.removeClass("dragging")},update:function(e,t){var n=t.item.data("prev");n&&n.length?$(n).after(t.item):$(this).prepend(t.item)}}).disableSelection()}()},this._postInit=function(){void 0!==this.$gridList&&(this.main.objects["enum.rooms"]||(this.main.objects["enum.rooms"]={_id:"enum.rooms",common:{icon:"home",name:{en:"Rooms",cn:"场景"},desc:{en:"List of the rooms"},members:[],dontDelete:!0},type:"enum",acl:{owner:"system.user.admin",ownerGroup:"system.group.administrator",permissions:1911}},g.main.socket.emit("setObject","enum.rooms",this.main.objects["enum.rooms"]),this.list.unshift("enum.rooms")),this.main.objects["enum.functions"]||(this.main.objects["enum.functions"]={_id:"enum.functions",common:{icon:"lightbulb_outline",name:{en:"Functions",cn:"功能"},desc:{en:"List of the functions"},members:[],dontDelete:!0},type:"enum",acl:{owner:"system.user.admin",ownerGroup:"system.group.administrator",permissions:1911}},this.list.unshift("enum.functions"),g.main.socket.emit("setObject","enum.functions",this.main.objects["enum.functions"])),this.isTiles?n():c(),this.editMode?this._initObjectTree():o("destroy"))},this.init=function(e){this.inited&&!e||(this.main&&this.main.objectsLoaded?(this._postInit(),this.inited||(this.inited=!0,this.main.subscribeObjects("enum.*"))):setTimeout(function(){g.init(e)},250))},this.destroy=function(){this.inited&&(this.inited=!1,this.main.unsubscribeObjects("enum.*")),w(!1),this.$gridList.treeTable("destroy")},this.objectChange=function(e,t,n){if(e.match(/^enum\./)){if(t)-1===this.list.indexOf(e)&&this.list.push(e);else{var i=this.list.indexOf(e);-1!==i&&this.list.splice(i,1)}this.updateTimers&&clearTimeout(this.updateTimers),this.updateTimers=setTimeout(function(){g.updateTimers=null,g._postInit()},200)}this.$grid&&o("object",e,t,n)}}function Events(g){var h=this;this.main=g,this.$tab=$("#tab-events");var e,f,p,t,b,M="yunkong2.net"===location.hostname||"yunkong2.pro"===location.hostname,y={count:0,start:0,limit:500},n=null,v={list:[],mode:!1,counter:0,overflow:!1,$counterSpan:null},w={done:!1,timer:null};this.prepare=function(){t=this.$tab.find("#event-outer"),p=this.$tab.find("#event-table"),b=this.$tab.find("#event-pause"),e=this.$tab.find("#events-table-tr"),(f=new IobListHeader(e,{list:t,colWidthOffset:1,prefix:"event-filter"})).doFilter=i,f.add("combobox","type"),f.add("edit","id","ID"),f.add("edit","val","value"),f.add("combobox","ack","ack",[{val:"",name:"all"},{val:"true",name:"ack"},{val:"false",name:"not ack"}]),f.add("combobox","from","from"),f.add("text","ts"),f.add("text","lc"),Object.defineProperty(f,"getValues",{value:function(){f.ID.selectedVal=f.ID.selectedVal.toLocaleLowerCase(),"true"===f.ack.selectedVal&&(f.ack.selectedVal=!0),"false"===f.ack.selectedVal&&(f.ack.selectedVal=!1)},enumerateble:!1}),b.on("click",function(){h.pause()}),this.$tab.find("#event-clear").off("click").on("click",function(){y.count=0,y.start=0,h.$tab.find("#event-table").html("")})},this.init=function(){M?h.$tab.find("#grid-events").html(_("You can't see events via cloud")+'
    cloud_off').addClass("no-cloud-events"):f&&(this.inited||(!function e(){if(!$.fn.colResizable)return;t.is(":visible")?(t.colResizable({liveDrag:!0,partialRefresh:!0,marginLeft:5,postbackSafe:!0,onResize:function(e){return f.syncHeader()}}),f.syncHeader()):setTimeout(function(){e()},200)}(),this.inited=!0,this.main.subscribeObjects("*"),this.main.subscribeStates("*")))};var j=!(this.destroy=function(){this.inited&&(this.inited=!1,this.main.unsubscribeObjects("*"),this.main.unsubscribeStates("*"))});function L(){w.timer=null,$(window).trigger("resize.JColResizer")}function i(){n&&(clearTimeout(n),n=null),f.getValues&&f.getValues(),p&&p.find(".event-line").each(function(e){var t=!0,n=$(this);f.type.selectedVal&&!n.hasClass("event-type-"+f.type.selectedVal)?t=!1:f.from.selectedVal&&!n.hasClass("event-from-"+f.from.selectedVal)?t=!1:""===f.ack.selectedVal||n.hasClass("event-ack-"+f.ack.selectedVal)?f.ID.selectedVal&&-1===$(this).find("td.event-column-id").text().toLocaleLowerCase().indexOf(f.ID.selectedVal)?t=!1:""!==f.value.selectedVal&&-1===$(this).find("td.event-column-value").text().indexOf(f.value.selectedVal)&&(t=!1):t=!1,t?n.show():n.hide()})}this.add=function(e,t,n,i){if(!M){var a,s,o,r,c=i?"stateChange":n?"message":"objChange",l="";if(f&&(f.getValues&&f.getValues(),f.type.checkAddOption(c)),w.done||(w.timer||(w.timer=setTimeout(L,1e3)),20=h.limit){y.start++;var d=document.getElementById("event_"+y.start);d&&(d.outerHTML="")}else y.count++;n||i?i&&(t?(t.from=t.from||"",t.from=t.from.replace("system.adapter.",""),t.from=t.from.replace("system.",""),f&&f.from.checkAddOption(t.from,function(e){return{val:e.replace(/\./g,"-"),name:e}}),l=t.from,void 0!==(a=JSON.stringify(t.val))&&30'+a.substring(0,30)+"..."),s=t.ack?"true":"false",o=g.formatDate(t.ts),r=g.formatDate(t.lc)):(a="deleted",o=g.formatDate(new Date))):o=t?(void 0!==(a=JSON.stringify(t,"\n",2))&&30'+a.substring(0,30)+"..."),g.formatDate(t.ts)):(a="deleted",g.formatDate(new Date));var u=!0;f&&(f.type.selectedVal&&f.type.selectedVal!==c?u=!1:f.ID.selectedVal&&-1===e.toLocaleLowerCase().indexOf(f.ID.selectedVal)?u=!1:""!==f.value.selectedVal&&null!=a&&-1===a.indexOf(f.value.selectedVal)?u=!1:""!==f.ack.selectedVal&&f.ack.selectedVal!==s?u=!1:f.from.selectedVal&&f.from.selectedVal!==l&&(u=!1));var m='';m+=""+c+"",m+=''+e+"",isNaN(a)?m+=''+(a||"")+"":m+=''+(a||"")+"",m+=""+(s||"")+"",m+=""+(l||"")+"",m+=""+(o||"")+"",m+=""+(r||"")+"",m+="",v.mode?(v.list.push(m),v.counter++,v.counter>y.limit&&(v.overflow||(b.addClass("red lighten3").attr("title",_("Message buffer overflow. Losing oldest")),v.overflow=!0),v.list.shift()),v.$counterSpan.html(v.counter)):p&&(p.prepend(m),j||"#tab-events"!==window.location.hash&&"#events"!==window.location.hash||(f&&f.syncHeader(),j=!0))}},this.pause=function(){if(v.mode){v.mode=!1;for(var e=0;epause')}else b.addClass("yellow btn-pause-button-active"),v.$counterSpan=b,v.$counterSpan.html("0"),v.counter=0,v.mode=!0}}function fileHandler(e){e.preventDefault();var t=e.dataTransfer?e.dataTransfer.files[0]:e.target.files[0],n=$(this).find(".drop-zone"),i=$(this).data("drop-zone-cb"),a=$(this).data("limit");if(t.size>(a||1e4))return i&&i(_("File is too big!")),n.hide(),!1;n.show();var s=new FileReader;s.onload=function(e){n.hide(),i&&i(null,e.target.result)},s.readAsDataURL(t)}function installFileUpload(e,t,n){if(void 0!==window.FileReader&&!e.data("installed")){e.data("installed",!0),e.prepend('');var i=e.find(".drop-zone");e[0].ondragover=function(){return i.off("click"),i.show(),!1},i[0].ondragleave=function(){return i.hide(),!1},i[0].ondrop=fileHandler.bind(e[0])}e.data("drop-zone-cb",n),e.data("limit",t),e.find(".drop-file").on("change",fileHandler.bind(e[0]))}function Hosts(s){var r=this;function n(e){var t=$("#dialog-host-update");if(e){var n=e.path,i=(n=n.replace(/\\/g,"/")).split("/");i.pop(),i.pop(),"linux"===e.platform||"darwin"===e.platform||"freebsd"===e.platform||"lin"===e.platform?t.find("#dialog-host-update-instructions").val("cd "+i.join("/")+"\nsudo yunkong2 stop\nsudo yunkong2 update\nsudo yunkong2 upgrade self\nsudo yunkong2 start"):t.find("#dialog-host-update-instructions").val("cd "+i.join("\\")+"\nyunkong2 stop\nyunkong2 update\nyunkong2 upgrade self\nyunkong2 start")}else t.find("#dialog-host-update-instructions").val("cd /opt/yunkong2\nsudo yunkong2 stop\nsudo yunkong2 update\nsudo yunkong2 upgrade self\nsudo yunkong2 start");t.data("inited")||(t.data("inited",!0),t.modal()),t.modal("open")}function i(e){if(e=(e||"").toLowerCase().trim()){var t=!1;r.$tab.find(".hosts-host").each(function(){-1!==$(this).data("host-filter").toLowerCase().indexOf(e)?($(this).show(),t=!0):$(this).hide()}),t?r.$tab.find(".hosts-host-filtered-out").hide():r.$tab.find(".hosts-host-filtered-out").show()}else r.$tab.find(".hosts-host").show(),r.$tab.find(".hosts-host-filtered-out").hide()}function a(e){var t=r.main.objects[r.list[e].id],n=r.main.states[t._id+".alive"]&&r.main.states[t._id+".alive"].val&&"null"!==r.main.states[t._id+".alive"].val;t.common=t.common||{},t.native=t.native||{};var i='';i+='
    ',i+=''+r.main.getHostIcon(t)+"",i+=''+t.common.hostname+"",i+=''+t.common.type+"";var a=t.common.titleLang||t.common.title;return"object"==typeof a&&(a=a[systemLang]||a.en),i+=''+a+"",i+=''+(t.native.os?t.native.os.platform:_("unknown"))+"",i+='',i+=''+t.common.installedVersion+"",r.main.states[t._id+".inputCount"]?i+='⇥'+r.main.states[t._id+".inputCount"].val+' / ↦'+r.main.states[t._id+".outputCount"].val+"":i+=' / ',i+='',i+=""}function o(e){var t,n=r.main.objects[r.list[e].id],i=r.main.states[n._id+".alive"]&&r.main.states[n._id+".alive"].val&&"null"!==r.main.states[n._id+".alive"].val;n.common=n.common||{},n.native=n.native||{},n.common.color&&(t=r.main.invertColor(n.common.color));var a='
    '+r.main.getHostIcon(n," ")+'
    '+n.common.hostname+'
    • '+r.words.Type+': '+n.common.type+'
    • '+r.words.Title+': '+n.common.title+'
    • '+r.words.OS+': '+(n.native.os?n.native.os.platform:_("unknown"))+'
    • '+r.words.Available+':
    • '+r.words.Installed+': '+n.common.installedVersion+"
    • ";return r.main.states[n._id+".inputCount"]?a+='
    • '+r.words.Events+': ⇥'+r.main.states[n._id+".inputCount"].val+' / ↦'+r.main.states[n._id+".outputCount"].val+"
    • ":a+='
    • '+r.words.Events+': /
    • ',a+='
    edit autorenew',n.common.hostname!==r.main.currentHost&&(a+=' delete'),a+='
    '}this.main=s,this.list=[],this.$tab=$("#tab-hosts"),this.$grid=this.$tab.find("#hosts"),this.$table=this.$tab.find("#grid-hosts"),this.inited=!1,this.isTiles=!0,this.words={},this.prepare=function(){this.isTiles=void 0===this.main.config.hostsIsTiles||null===this.main.config.hostsIsTiles||this.main.config.hostsIsTiles,"ie"===this.main.browser&&this.main.browserVersion<=10&&(this.isTiles=!1,this.$tab.find(".btn-switch-tiles").hide()),this.$tab.find(".btn-reload").attr("title",_("Update")).on("click",function(){r.init(!0)}),this.$tab.find(".btn-switch-tiles").off("click").on("click",function(){r.isTiles=!r.isTiles,r.isTiles?$(this).find("i").text("view_list"):$(this).find("i").text("view_module"),r.main.saveConfig("hostsIsTiles",r.isTiles),setTimeout(function(){r._postInit()},50)}),this.isTiles?this.$tab.find(".btn-switch-tiles").find("i").text("view_list"):this.$tab.find(".btn-switch-tiles").find("i").text("view_module"),this.$tab.find(".filter-clear").on("click",function(){r.$tab.find(".filter-input").val("").trigger("change")});var e=this.$tab.find(".filter-input");e.on("change",function(){var e=$(this).val();e?($(this).addClass("input-not-empty"),r.$tab.find(".filter-clear").show()):(r.$tab.find(".filter-clear").hide(),$(this).removeClass("input-not-empty")),r.main.saveConfig("hostsFilter",e),i(e)}).on("keyup",function(){r.filterTimeout&&clearTimeout(r.filterTimeout),r.filterTimeout=setTimeout(function(){r.$tab.find(".filter-input").trigger("change")},300)}),this.main.config.hostsFilter&&"{"!==this.main.config.hostsFilter[0]?(e.val(r.main.config.hostsFilter).addClass("input-not-empty"),this.$tab.find(".filter-clear").show()):this.$tab.find(".filter-clear").hide(),this.words.Title=_("Title"),this.words.OS=_("OS"),this.words.Available=_("Available"),this.words.Installed=_("Installed"),this.words.Events=_("Events"),this.words.Title=_("Title"),r.words.Type=_("Type")},this.initButtons=function(e){var t=e?'[data-host-id="'+e+'"]':"";this.$tab.find(".host-update-submit"+t).off("click").on("click",function(){r.main.cmdExec($(this).attr("data-host-name"),"upgrade self",function(e){e||r.init(!0)})}),this.$tab.find(".host-restart-submit"+t).off("click").on("click",function(){r.main.waitForRestart=!0,r.main.cmdExec($(this).attr("data-host-name"),"_restart")}),this.$tab.find(".host-delete"+t).off("click").on("click",function(){r.main.cmdExec(r.main.currentHost,"host remove "+$(this).attr("data-host-name"))}),this.$tab.find(".host-edit"+t).off("click").on("click",function(){!function(t){var n=$("#tab-host-dialog-edit"),e="",i="",a="";installFileUpload(n,5e4,function(e,t){if(e)r.main.showToast(n,e);else{if(!t.match(/^data:image\//))return void r.main.showToast(n,_("Unsupported image format"));n.find(".tab-host-dialog-ok").removeClass("disabled"),i=t,n.find(".tab-host-dialog-edit-icon").show().html(''),n.find(".tab-host-dialog-edit-icon img").attr("src",t),n.find(".tab-host-dialog-edit-icon-clear").show()}}),r.main.objects[t]&&r.main.objects[t].common&&("object"==typeof(e=r.main.objects[t].common.title)&&(e=e[systemLang]||e.en),i=r.main.objects[t].common.icon,a=r.main.objects[t].common.color);n.find("#tab-host-dialog-edit-title").val(e).off("change").on("change",function(){n.find(".tab-host-dialog-ok").removeClass("disabled")}).off("keyup").on("keyup",function(){$(this).trigger("change")}),n.find(".tab-host-dialog-ok").addClass("disabled").off("click").on("click",function(){var e=JSON.parse(JSON.stringify(r.main.objects[t]));e.common.title=n.find("#tab-host-dialog-edit-title").val(),e.common.icon=i,e.common.color=a,JSON.stringify(e)!==JSON.stringify(r.main.objects[t])?r.main.socket.emit("setObject",e._id,e,function(e){r.main.showToast(n,_("Updated"))}):r.main.showToast(n,_("Nothing changed"))}),i?(n.find(".tab-host-dialog-edit-icon").show().html(r.main.getIcon(t)),n.find(".tab-host-dialog-edit-icon-clear").show()):(n.find(".tab-host-dialog-edit-icon").hide(),n.find(".tab-host-dialog-edit-icon-clear").hide());(a=a||!1)?n.find(".tab-host-dialog-edit-color").val(a):n.find(".tab-host-dialog-edit-color").val();M.updateTextFields("#tab-host-dialog-edit"),r.main.showToast(n,_("Drop the icons here")),n.find(".tab-host-dialog-edit-upload").off("click").on("click",function(){n.find(".drop-file").trigger("click")}),n.find(".tab-host-dialog-edit-icon-clear").off("click").on("click",function(){i&&(i="",n.find(".tab-host-dialog-edit-icon").hide(),n.find(".tab-host-dialog-ok").removeClass("disabled"),n.find(".tab-host-dialog-edit-icon-clear").hide())}),n.find(".tab-host-dialog-edit-color-clear").off("click").on("click",function(){a&&(n.find(".tab-host-dialog-ok").removeClass("disabled"),n.find(".tab-host-dialog-edit-color-clear").hide(),n.find(".tab-host-dialog-edit-colorpicker").colorpicker({component:".btn",color:a,container:n.find(".tab-host-dialog-edit-colorpicker")}).colorpicker("setValue",""),a="")});var s=Date.now();try{n.find(".tab-host-dialog-edit-colorpicker").colorpicker("destroy")}catch(e){}n.find(".tab-host-dialog-edit-colorpicker").colorpicker({component:".btn",color:a,container:n.find(".tab-host-dialog-edit-colorpicker")}).colorpicker("setValue",a).on("showPicker.colorpicker",function(){var e=n.find(".modal-content");e[0].scrollTop=e[0].scrollHeight}).on("changeColor.colorpicker",function(e){100'+e+"").appendTo('.admin-sidemenu-items[data-tab="tab-hosts"] a')}else $("#updates-for-hosts").remove()},this._postInit=function(){if(void 0!==r.$grid){this.isTiles?function(){for(var e="",t=0;t
    '+_("Filtered out")+"
    ")}():function(){for(var e="",t=0;t'+_("Filtered out")+"")}(),i(this.$tab.find(".filter-input").val());var s=setTimeout(function(){console.warn("Timeout for repository"),s=null,r.initButtons()},2e3),e=r.main.currentHost;if(!e)for(var t=0;t↦'+t.val+"")):e.match(/^system\.host\..+\.inputCount$/)&&(e=e.substring(0,e.length-11),this.$tab.find('.host-in[data-host-id="'+e+'"]').html('↦'+t.val+""))}}function Instances(i){var p=this;function b(e,t,n,i,a){if("protocol"===n&&(n="secure"),"ip"===e)i=i.replace("%"+e+"%",location.hostname);else if("instance"===e)i=i.replace("%"+e+"%",a);else if(t){n.match(/^native_/)&&(n=n.substring(7));var s=t.native[n];"bind"!==e||s&&"0.0.0.0"!==s||(s=location.hostname),i="secure"===n?i.replace("%"+e+"%",s?"https":"http"):-1===i.indexOf("%"+e+"%")?i.replace("%native_"+e+"%",s):i.replace("%"+e+"%",s)}else i="secure"===n?i.replace("%"+e+"%","http"):-1===i.indexOf("%"+e+"%")?i.replace("%native_"+e+"%",""):i.replace("%"+e+"%","");return i}function o(e,t,n){var i,a,s,o=e.match(/%(\w+)%/g);if(o){for(a=o.length-1;0<=a;a--)s=(i=(i=o[a]).replace(/%/g,"")).split("_"),i.match(/^native_/)?(e=b(i,p.main.objects["system.adapter."+t+"."+n],i,e,n),o.splice(a,1)):1===s.length?(e=b(i,p.main.objects["system.adapter."+t+"."+n],s[0],e,n),o.splice(a,1)):s[0].match(/\.[0-9]+$/)&&(e=b(i,p.main.objects["system.adapter."+s[0]],s[1],e,n),o.splice(a,1));var r,c,l={},d=s[0];for(a=0;a',r+=''+_("Connected to host: ")+'',p.main.states[e+".connected"]&&p.main.states[e+".connected"].val?r+=''+_("true")+"":r+=_("false"),r+='',r+=''+_("Heartbeat: ")+'',p.main.states[e+".alive"]&&p.main.states[e+".alive"].val?r+=''+_("true")+"":r+=_("false"),r+="",p.main.states[n+"."+i+".info.connection"]||p.main.objects[n+"."+i+".info.connection"])r+=''+_("Connected to %s: ",n)+"",r+=(c=!!p.main.states[n+"."+i+".info.connection"]&&p.main.states[n+"."+i+".info.connection"].val)?!0===c?''+_("true")+"":''+c+"":_("false"),r+="";r+=""}else{var c;if(r='',r+='",p.main.states[n+"."+i+".info.connection"]||p.main.objects[n+"."+i+".info.connection"])r+='";r+="
    '+_("Connected to host: ")+'',p.main.states[e+".connected"]&&p.main.states[e+".connected"].val?r+=''+_("true")+"":(r+="daemon"===s.mode?''+_("false")+"":_("false"),o="daemon"===s.mode?"red":"blue"),r+='
    '+_("Heartbeat: ")+'',p.main.states[e+".alive"]&&p.main.states[e+".alive"].val?r+=''+_("true")+"":(r+="daemon"===s.mode?''+_("false")+"":_("false"),o="daemon"===s.mode?"red":"blue"),r+="
    '+_("Connected to %s: ",n)+"",(c=!!p.main.states[n+"."+i+".info.connection"]&&p.main.states[n+"."+i+".info.connection"].val)?r+=!0===c?''+_("true")+"":''+c+"":(o="red"===o?"red":"orange",r+=''+_("false")+""),r+="
    "}o="blue"===o?"":o,a.removeClass("led-red led-green led-orange led-blue").addClass("led-"+o).data("title",r),a.data("inited")||"gray"===o||(a.data("inited",!0),a.hover(function(){var e='
    '+$(this).data("title")+"
    ",t=$(e);t.insertAfter($(this)),$(this).data("big",t[0]);var n=parseFloat(t.height()),i=Math.round($(this).position().top-(n-parseFloat($(this).height()))/2);n+i>(window.innerHeight||document.documentElement.clientHeight)&&(i=(window.innerHeight||document.documentElement.clientHeight)-n),i<0&&(i=0),t.css({top:i}).on("click",function(){var e=$(this).data("big");$(e).remove(),$(this).data("big",void 0)})},function(){var e=$(this).data("big");$(e).remove(),$(this).data("big",void 0)}).on("click",function(){$(this).trigger("hover")}))}function r(){for(var e=p.main.states["system.host."+p.main.currentHost+".memRss"],t=1,n=e?e.val:0,i=0;i'+n+"");var r=_("%s processes",t),c=p.$tab.find("#running_processes");r!==c.text()&&c.html(''+r+"")}function c(){p.main.states["system.host."+p.main.currentHost+".memAvailable"]?p.memState="memAvailable":p.main.states["system.host."+p.main.currentHost+".freemem"]&&(p.memState="freemem");var e=p.main.states["system.host."+p.main.currentHost+"."+p.memState];if(e){p.totalmem=p.totalmem||p.main.objects["system.host."+p.main.currentHost].native.hardware.totalmem/1048576;var t=Math.round(e.val/p.totalmem*100),n=p.$tab.find("#freeMem"),i=tdp(e.val);i!==n.text()&&(n.html(''+i+""),p.$tab.find("#freeMemPercent").html(''+t+"%"))}else p.$tab.find(".free-mem-label").hide()}function l(){var e=p.main.states["system.host."+p.main.currentHost+".diskSize"],t=p.main.states["system.host."+p.main.currentHost+".diskFree"],n=p.main.states["system.host."+p.main.currentHost+".diskWarning"];if(t&&t.val&&e&&e.val){n=n?parseFloat(n.val):5;var i=p.$tab.find("#diskFree"),a=Math.round(t.val/e.val*1e3)/10;i.html(''+a+""),i.parent().attr("title",_("Size: %s, Free: %s",p.main.formatBytes(1024*e.val*1024),p.main.formatBytes(1024*t.val*1024)))}else p.$tab.find(".tab-instances-info-disk").hide()}function M(e){var t,n=p.main.objects[e]&&p.main.objects[e].common||{};return t=n.enabled&&"daemon"===n.mode&&p.main.states[e+".memRss"]?(t=p.main.states[e+".memRss"].val,t=parseFloat(t)||0,n.memoryLimitMB&&n.memoryLimitMB<=t?''+t.toFixed(1)+" MB":t.toFixed(1)+" MB"):""}function d(e,t,n,i){var a,s=p.main.objects[t]&&p.main.objects[t].common||{},o=t.split("."),r=o[2],c=o[3];if("tile"===n)a=i?"":'
    ',a+=i?"":"
    ";else{a=i?"":'';var l=s.localLinks||s.localLink||"",d=l?p.replaceInLink(l,r,c):"";l&&(l="object"==typeof d?'':''),a+='
    ',a+=""+(s.icon?l+'':"")+(l?"
    ":"")+"",a+=''+r+"."+c+"";var u=s.onlyWWW||s.enabled;a+='',a+=''+(d?'':"")+"";var m=s.titleLang||s.title;if("object"==typeof m&&(m=m[systemLang]||m.en),a+=''+(m||"")+"",1'+(s.host||"")+""}a+=''+("schedule"===s.mode&&s.schedule||"")+"",p.main.config.expertMode&&(a+=''+(s.restartSchedule||"")+"",a+=''+(s.loglevel||"")+"",a+=''+(s.memoryLimitMB||"")+"",u&&p.main.states[t+".inputCount"]&&p.main.states[t+".outputCount"]?a+='⇥'+p.main.states[t+".inputCount"].val+' / ↦'+p.main.states[t+".outputCount"].val+"":a+=' / '),a+=''+M(t)+"",a+=i?"":""}i?p.$tab.find('.instance-adapter[data-instance-id="'+t+'"]').html(a):e.append(a),p.initButtons(t,d),f(t),p.$tab.find('.instance-editable[data-instance-id="'+t+'"]').on("click",y).addClass("select-id-quick-edit"),p.$tab.find('.instance-schedule[data-instance-id="'+t+'"]').each(function(){$(this).find("button").length||($(this).append(''),$(this).find("button").on("click",function(){var n=$(this).data("name"),i=$(this).data("instance-id");!function(e,t){e=(e||"").replace(/"/g,"").replace(/'/g,"");try{setupCron(e,t)}catch(e){alert(_("Cannot parse value as cron"))}}(p.main.objects[i].common[n]||"",function(e){if(null!==e){var t={common:{}};t.common[n]=e,p.main.socket.emit("extendObject",i,t,function(e){e&&p.main.showError(e)})}})}))}),p.$tab.find('.instance-name[data-instance-id="'+t+'"]').on("click",function(){var e=p.$tab.find('.instance-settings[data-instance-id="'+$(this).data("instance-id")+'"]');e.hasClass("small-button-empty")||e.trigger("click")}).css("cursor","pointer")}function u(e){void 0===e&&(e=p.$tab.find(".instances-filter").val());var t=[];if(e)for(var n=new RegExp(e),i=0;i';for(var u=0;u'+(m[1]||m[0])+""}c+=""}c=c||'';var g=null;t.html(c+'
    ');var h=n?t.find("select"):t.find("input");t.find(".select-id-quick-edit-cancel").off("click").on("click",function(e){g&&clearTimeout(g),g=null,e.preventDefault(),e.stopPropagation(),t.html(o).off("click").on("click",y).addClass("select-id-quick-edit").css("text-align",r)}),t.find(".select-id-quick-edit-ok").off("click").on("click",function(){t.trigger("blur")}),h.val(s),h.blur(function(){g&&clearTimeout(g),g=setTimeout(function(){g=null;var n=$(this).val();s=JSON.stringify(n)!==JSON.stringify(s)?(p.main.socket.emit("getObject",i,function(e,t){t?(t.common=t.common||{},t.common[a]=n,"title"===a&&t.common.titleLang&&delete t.common.titleLang,p.main.socket.emit("setObject",t._id,t,function(e){e&&p.main.showError(e)})):console.log("Object "+i+" does not exist: "+e)}),''+s+""):o,t.html(s).off("click").on("click",y).addClass("select-id-quick-edit").css("text-align",r)}.bind(this),100)}).on("keyup",function(e){13===e.which&&$(this).trigger("blur"),27===e.which&&(void 0===s&&(s=""),t.html(s).off("click").on("click",y).addClass("select-id-quick-edit").css("text-align",r))}),"object"==typeof e&&(e.preventDefault(),e.stopPropagation()),setTimeout(function(){h.focus()},100)}this.$tab=$("#tab-instances"),this.$grid=$("#grid-instances"),this.$gridHead=$("#grid-instances-head"),this.inited=!1,this.main=i,this.list=[],this.hostsText=null,this.filterHost=!1,this.memState="memAvailable",window.tdp||(window.tdp=function(e,t){return isNaN(e)?"":e.toFixed(t||0).replace(".",",").replace(/\B(?=(\d{3})+(?!\d))/g,".")}),this.replaceInLink=function(e,t,n){if("object"!=typeof e)return o(e,t,n);var i,a=JSON.parse(JSON.stringify(e));for(var s in a)a.hasOwnProperty(s)&&(a[s]=o(a[s],t,n),i||(i=a[s]));return a.__first=i,a},this.prepare=function(){var e=p.$tab.find(".instances-filter"),t=p.$tab.find(".instances-filter-clear");e.on("change",function(){var e=$(this).val();e?($(this).addClass("input-not-empty"),t.show()):($(this).removeClass("input-not-empty"),t.hide()),p.main.saveConfig("instancesFilter",e),u(e)}).on("keyup",function(){p.filterTimeout&&clearTimeout(p.filterTimeout),p.filterTimeout=setTimeout(function(){e.trigger("change")},300)}),p.main.config.instancesFilter&&"{"!==p.main.config.instancesFilter[0]?(e.addClass("input-not-empty").val(p.main.config.instancesFilter),t.show()):t.hide(),p.$tab.find(".btn-instances-expert-mode").on("click",function(){p.main.config.expertMode=!p.main.config.expertMode,p.main.saveConfig("expertMode",p.main.config.expertMode),p.updateExpertMode(),p.main.tabs.adapters.updateExpertMode()}),p.main.config.expertMode&&p.$tab.find(".btn-instances-expert-mode").addClass("red lighten-3"),p.$tab.find(".btn-instances-reload").on("click",function(){p.init(!0,!0)}),t.on("click",function(){e.val("").trigger("change")}),this.$tab.find(".btn-instances-host").off("click").on("click",function(){p.filterHost=!p.filterHost,p.filterHost?p.$tab.find(".btn-instances-host").addClass("red lighten-3"):p.$tab.find(".btn-instances-host").removeClass("red lighten-3"),p.main.saveConfig("instancesFilterHost",p.filterHost),setTimeout(function(){u()},50)}),this.filterHost=this.main.config.instancesFilterHost||!1,this.filterHost?this.$tab.find(".btn-instances-host").addClass("red lighten-3"):this.$tab.find(".btn-instances-host").removeClass("red lighten-3")},this.updateExpertMode=function(){p.init(!0),p.main.config.expertMode?p.$tab.find(".btn-instances-expert-mode").addClass("red lighten-3"):p.$tab.find(".btn-instances-expert-mode").removeClass("red lighten-3")},this.replaceLink=function(n,i,a,s){var o;(n=n.replace(/%/g,"")).match(/^native_/)&&(n=n.substring(7)),-1===n.indexOf("_")?o=[i+"."+a,n]:(o=n.split("_"))[0].match(/\.[0-9]+$/)||(o[0]+=".0"),"protocol"===o[1]&&(o[1]="secure"),"instance"!==n?this.main.socket.emit("getObject","system.adapter."+o[0],function(e,t){t&&setTimeout(function(){var e;(e=s?p.$tab.find("#"+s).data("src"):p.$tab.find("#a_"+i+"_"+a).attr("href"))&&(e="secure"===o[1]?e.replace("%"+n+"%",t.native[o[1]]?"https":"http"):-1===e.indexOf("%"+n+"%")?e.replace("%native_"+n+"%",t.native[o[1]]):e.replace("%"+n+"%",t.native[o[1]]),s?p.$tab.find("#"+s).data("src",e):p.$tab.find("#a_"+i+"_"+a).attr("href",e))},0)}):setTimeout(function(){var e;e=(e=s?p.$tab.find("#"+s).data("src"):p.$tab.find("#a_"+i+"_"+a).attr("href")).replace("%instance%",a),s?p.$tab.find("#"+s).data("src",e):p.$tab.find("#a_"+i+"_"+a).attr("href",e)},0)},this._replaceLink=function(n,i,a,s,o){var r;(i=i.replace(/%/g,"")).match(/^native_/)&&(i=i.substring(7)),-1===i.indexOf("_")?r=[a+"."+s,i]:(r=i.split("_"))[0].match(/\.[0-9]+$/)||(r[0]+=".0"),"protocol"===r[1]&&(r[1]="secure"),this.main.socket.emit("getObject","system.adapter."+r[0],function(e,t){n=t&&n?"secure"===r[1]?n.replace("%"+i+"%",t.native[r[1]]?"https":"http"):-1===n.indexOf("%"+i+"%")?n.replace("%native_"+i+"%",t.native[r[1]]):n.replace("%"+i+"%",t.native[r[1]]):(console.log("Cannot get link "+r[1]),n.replace("%"+i+"%","")),setTimeout(function(){o(n,a,s)},0)})},this._replaceLinks=function(e,t,n,i,a){if(!e)return a(e,t,n,i);var s=e.match(/%(\w+)%/g);return s?"%ip%"===s[0]?(e=e.replace("%ip%",location.hostname),void this._replaceLinks(e,t,n,i,a)):"%instance%"===s[0]?(e=e.replace("%instance%",n),void this._replaceLinks(e,t,n,i,a)):void this._replaceLink(e,s[0],t,n,function(e,t,n){this._replaceLinks(e,t,n,i,a)}.bind(this)):a(e,t,n,i)},this._postInit=function(e,t){if(this.main.currentHost&&void 0!==this.$grid&&(!this.$grid.data("inited")||e)){this.$grid.data("inited",!0),this.list.sort();for(var n=[],i=this.list.length-1;0<=i;i--)this.main.objects[this.list[i]]&&this.main.objects[this.list[i]].common&&!this.main.objects[this.list[i]].common.localLink&&!this.main.objects[this.list[i]].common.localLinks&&this.main.objects[this.list[i]].common.noConfig&&(n.push(this.list[i]),this.list.splice(i,1));for(this.list.sort(),n.sort(),i=0;i",o+=''+_("instance")+"",o+='',o+='',o+=''+_("actions")+"",o+=''+_("title")+"",1'+_("host")+""),o+=''+_("schedule_group")+"",p.main.config.expertMode&&(o+=''+_("restart")+"",o+=''+_("loglevel")+"",o+=''+_("memlimit")+"",o+=''+_("events")+""),o+=''+_("RAM usage")+"",p.$gridHead.html(o),this.$grid.html("");for(var a=Date.now(),s=0;s'+_("Filtered out")+""),p.$tab.find("#currentHost").html(this.main.currentHost),1'+s+"")}else"outputCount"===i?p.$tab.find('.instance-out[data-instance-id="'+e+'"]').html('↦'+t.val+""):"inputCount"===i&&p.$tab.find('.instance-in[data-instance-id="'+e+'"]').html('⇥'+t.val+"");if(-1!==this.list.indexOf(e))return void("alive"!==i&&"connected"!==i||f(e));e="system.adapter."+n[0]+"."+n[1],-1!==this.list.indexOf(e)&&"connection"===i&&f(e)}}},this.objectChange=function(e,t,n){if(e.match(/^system\.adapter\.[-\w]+\.[0-9]+$/))if(t)-1===this.list.indexOf(e)?(this.list.push(e),this.updateTimer&&clearTimeout(this.updateTimer),this.updateTimer=setTimeout(function(){p.updateTimer=null,p.init(!0)},200),t.common.noConfig||setTimeout(function(){-1===window.location.hash.indexOf("/config/")&&p.main.navigate({tab:"instances",dialog:"config",params:e})},2e3)):-1!==e.indexOf(".web.")?(this.updateTimer&&clearTimeout(this.updateTimer),this.updateTimer=setTimeout(function(){p.updateTimer=null,p.init(!0)},200)):this.$grid.find('.instance-adapter[data-instance-id="'+e+'"]').html(d(this.$grid,e,this.main.config.instanceForm,!0));else{var i=this.list.indexOf(e);-1!==i&&(this.list.splice(i,1),this.$grid.find('.instance-adapter[data-instance-id="'+e+'"]').remove())}else e.match(/^system\.host\.[-\w]+$/)&&(this.updateTimer&&clearTimeout(this.updateTimer),this.updateTimer=setTimeout(function(){p.updateTimer=null,p.init(!0)},200))},this.initButtons=function(e,t){e=e?'[data-instance-id="'+e+'"]':"";var n=p.$grid.find(".instance-edit"+e).off("click").on("click",function(){p.onEdit($(this).attr("data-instance-id"))});n.find(".ui-button-icon-primary").length||n.attr("title",_("edit")),(n=p.$grid.find(".instance-settings"+e).off("click").on("click",function(){p.main.navigate({tab:"instances",dialog:"config",params:$(this).data("instance-id")})})).each(function(){var e=$(this).attr("data-instance-id");i.objects[e]&&i.objects[e].common&&i.objects[e].common.noConfig&&$(this).addClass("disabled")}),n=p.$grid.find(".instance-reload"+e).off("click").on("click",function(){p.main.socket.emit("extendObject",$(this).attr("data-instance-id"),{},function(e){e&&p.main.showError(e)})}),n=p.$grid.find(".instance-del"+e).off("click").on("click",function(){var t=$(this).attr("data-instance-id");if(p.main.objects[t]&&p.main.objects[t].common&&p.main.objects[t].common.host){var e=t.replace(/^system\.adapter\./,"");p.main.confirmMessage(_("Are you sure you want to delete the instance %s?",e),null,"help",function(e){e&&p.main.cmdExec(p.main.objects[t].common.host,"del "+t.replace("system.adapter.",""),function(e){e||p.main.tabs.adapters.init(!0)})})}}),n=p.$grid.find(".instance-issue"+e).off("click").on("click",function(){p.main.navigate({tab:"instances",dialog:"issue",params:$(this).data("instance-id")})}),p.$grid.find(".instance-image"+e).each(function(){$(this).data("installed")||($(this).data("installed",!0),$(this).hover(function(){var e='
    ',t=$(e);t.insertAfter($(this)),$(this).data("big",t[0]);var n=parseFloat(t.height()),i=Math.round($(this).position().top-(n-parseFloat($(this).height()))/2);n+i>(window.innerHeight||document.documentElement.clientHeight)&&(i=(window.innerHeight||document.documentElement.clientHeight)-n),i<0&&(i=0),t.css({top:i})},function(){var e=$(this).data("big");$(e).remove(),$(this).data("big",void 0)}))}),(n=p.$grid.find(".instance-stop-run"+e).off("click").on("click",function(){var e=$(this).attr("data-instance-id");$(this).addClass("disabled"),p.main.socket.emit("extendObject",e,{common:{enabled:!p.main.objects[e].common.enabled}},function(e){e&&p.main.showError(e)})})).find(".ui-button-icon-primary").length||n.each(function(){var e=$(this).attr("data-instance-id");p.main.objects[e].common.enabled?n.addClass("instance-running").attr("title",_("Activated. Click to stop.")).find("i").html("pause"):n.removeClass("instance-running").attr("title",_("Deactivated. Click to start.")).find("i").html("play_arrow")}),n=p.$grid.find(".instance-web"+e).off("click").on("click",function(){var e=$(this).data("link");if("object"==typeof e){var t="";for(var n in e)if(e.hasOwnProperty(n)&&"__first"!==n){var i=e[n].match(/^https?:\/\/[-.\w]+:(\d+)\/?/),a=e[n].match(/^https:\/\//);t+='"}t+='";var s=$("#instances-menu");s.data("inited")&&s.menu("destroy");var o=$(this).position();s.html(t),s.data("inited")||(s.data("inited",!0),s.mouseleave(function(){$(this).hide()})),s.menu().css({left:o.left,top:o.top}).show(),s.find(".instances-menu-link").off("click").on("click",function(){$(this).data("link")&&window.open($(this).data("link"),$(this).data("instance-id")),$("#instances-menu").hide()})}else window.open($(this).data("link"),$(this).data("instance-id"))}),"object"==typeof t&&n.data("link",t)},this.resize=function(e,t){}}function Intro(e){var T=this;function t(e){var t=Math.floor(e/86400);e%=86400;var n=Math.floor(e/3600);n<10&&(n="0"+n),e%=3600;var i=Math.floor(e/60);i<10&&(i="0"+i),e%=60,(e=Math.floor(e))<10&&(e="0"+e);var a="";return t&&(a+=t+" "+_("daysShortText")+" "),a+=n+":"+i+":"+e}this.$tab=$("#tab-intro"),this.$tiles=this.$tab.find(".tab-intro-cards"),this.main=e,this.inited=!1,this.$template=$("#intro-template");var d={Uptime:t,"System uptime":t,RAM:function(e){var t=Math.floor(e/1073741824*10)/10;e%=1073741824;var n=Math.floor(e/1048576*10)/10,i="";return i+=1");$(this).append(t),t.val($(this).data("clippy")),t.trigger("select"),document.execCommand("copy"),t.remove(),e.preventDefault(),e.stopPropagation(),T.main.showToast(T.$tiles,_("copied"))}function C(e){var t,c=T.$template.clone();if(c.removeAttr("id"),c.addClass("card-system-info"),c.find(".btn-small").addClass("disabled"),c.find(".card-titles").text(e.name),c.find(".btn-card-enabled").data("host",e.id),!1===T.main.systemConfig.common.intro[e.id]){if(!T.$tab.hasClass("edit-active"))return null;c.addClass("card-disabled").find(".btn-card-enabled").removeClass("blue").addClass("gray").find("i").text("close")}T.main.objects[e.id]&&T.main.objects[e.id].common&&(t=T.main.objects[e.id].common.icon),c.find(".card-image-img").attr("src",t||"img/no-image.png"),c.find(".card-content-text").html('
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    ');var l=setTimeout(function(){l&&(l=null,c.find(".btn-small").addClass("disabled"),c.find(".card-content-text").html(_("offline")))},6e3);return d["Disk size"]=d["Disk size"]||T.main.formatBytes,d["Disk free"]=d["Disk size"]||T.main.formatBytes,T.main.socket.emit("sendToHost",e.id,"getHostInfo",null,function(e){clearTimeout(l),l=null,"permissionError"===e?console.error('May not read "getHostInfo"'):e?c.find(".btn-small").removeClass("disabled"):console.error('Cannot read "getHostInfo"');var t=T.main.states["system.host."+T.main.currentHost+".diskWarning"];t=t?parseFloat(t.val):5;var n=0"+_(a)+": ",i+=''+(d[a]?d[a](e[a]):e[a]||" --")+"");n&&(i+="
  • "+_("Disk free")+": ",i+=''+(d["Disk free"]?d["Disk free"](e["Disk free"]):e["Disk free"]||" --")+"
  • ",i+="
  • "+_("Disk size")+": ",i+=''+(d["Disk size"]?d["Disk size"](e["Disk size"]):e["Disk size"]||" --")+"
  • "),i+=""}i+="",c.find(".card-content-text").replaceWith($(i)),i='
    '+_("Info")+'
    content_copyclose';var s=[];if(e){for(var o in i+="
      ",e)if(e.hasOwnProperty(o)){i+="
    • "+_(o)+": ";var r=d[o]?d[o](e[o]):e[o];s.push(o+": "+r),i+="Disk free"===o&&n?''+r+"
    • ":''+r+""}i+="
    "}i+="
    ",c.find(".card-reveal").replaceWith($(i)),T.$tab.hasClass("edit-active")?c.find(".btn-small").hide():c.find(".btn-info").data("clippy",s.join("\r\n")).on("click",u)}),c}function D(e,t,n,i,a,s,o){var r=T.$template.clone();r.removeAttr("id");var c=a.replace(/^https?:\/\//,""),l=c.indexOf("/");if(-1!==l&&(c=c.substring(0,l)),"admin"===e&&c===location.host)return null;if("web"===e)return null;if("vis-web-admin"!==e&&e.match(/^vis-/))return null;if(e.match(/^icons-/))return null;if(i&&i.noIntro)return null;r.find(".btn-card-enabled").data("instance",e+"."+t+(n&&n.name?"."+n.name:"")).data("web",s),o?r.on("click",function(){T.$tab.hasClass("edit-active")||window.open($(this).find(".url").attr("href"))}):r.addClass("card-disabled").find(".btn-card-enabled").removeClass("blue").addClass("gray").find("i").text("close"),r.find(".url").attr("href","object"==typeof a?a._first:a||"").text(c+(s?" ("+s+")":"")),r.find(".card-image-img").attr("src",i.icon?"adapter/"+e+"/"+i.icon:"img/no-image.png"),n&&n.color&&r.find(".card-image").css("background",n.color);var d=n&&n.name||i.titleLang||i.title;"object"==typeof d&&(d=d[systemLang]||d.en),r.find(".card-titles").text(d||e);var u=i.desc;return"object"==typeof u&&(u=u[systemLang]||u.en),r.find(".card-content-text").text(u||""),r}function n(e,i){!function(e,t){var n,i,a,s=JSON.parse(JSON.stringify(e)),o=[];s.sort(function(e,t){return e=T.main.objects[e]&&T.main.objects[e].common,t=(t=T.main.objects[t]&&T.main.objects[t].common)||{},void 0===(e=e||{}).order&&void 0===t.order?e.name.toLowerCase()>t.name.toLowerCase()?1:e.name.toLowerCase()t.order?1:e.ordert.name.toLowerCase()?1:e.name.toLowerCase()\n \n');$.getJSON("https://api.github.com/repos/"+i[3]+"/"+i[4]+"/issues",function(e){var t=!1;for(var n in r.empty(),e)if(e.hasOwnProperty(n)){if("remove"===n)break;var i=e[n];if(!i.hasOwnProperty("pull_request")){t=!0;var a=$("#issueTable").children().clone(!0,!0);a.find(".collapsible-header-title").text(i.title),a.find(".goto").attr("href",i.html_url),a.find(".user").text(i.user.login),a.find(".form-row").html((new showdown.Converter).makeHtml(i.body).replace(/src="/g,'class="responsive-img" src="'));var s=new Date(new Date(i.created_at));if(a.find(".created").text(s.toLocaleDateString(systemLang,{weekday:"short",year:"numeric",month:"long",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})),0'+i.labels[o].name+"")}r.append(a),0}}t||r.append($('
  • '+_("No bug")+"

  • "))}).done(a.$dialogIssue.find(".collapsible").collapsible())}a.$dialogIssue.data("name",t),a.$dialogIssue.find(".title").html(_("Known bugs for")+": "+t),a.$dialogIssue.find(".dialog-system-buttons .btn-add").attr("href","https://github.com/"+i[3]+"/"+i[4]+"/issues/new"),a.$dialogIssue.find(".dialog-system-buttons .btn-cancel").off("click").on("click",function(e){e.stopPropagation(),e.preventDefault(),a.main.navigate()})}},this.destroy=function(){this.inited&&(this.$dialogIssue.find(".collapsible").collapsible("destroy"),this.inited=!1)}}function Logs(t){var c=this;this.main=t,this.$tab=$("#tab-logs");var s,l,o,d,r={count:0,start:0,limit:2e3},u={host:"",severity:"",message:""},m={list:[],mode:!1,counter:0,overflow:!1,$counterSpan:null};this.prepare=function(){l=this.$tab.find("#log-outer"),s=this.$tab.find("#log-table"),o=this.$tab.find("#log-pause"),(d=new IobListHeader("log-outer-header",{list:l,colWidthOffset:1,prefix:"log-filter"})).doFilter=c.filter,d.add("combobox","from","host"),d.add("text","Time"),d.add("combobox","","severity",[{val:"",name:"debug"},{val:"silly",name:"silly"},{val:"info",name:"info"},{val:"warn",name:"warn"},{val:"error",name:"error"}]).$filter.attr("title",_("severity")),d.add("edit","Message","message"),this.$tab.find("#log-clear-on-disk").on("click",function(){c.main.confirmMessage(_("Log file will be deleted. Are you sure?"),null,null,function(e){e&&c.main.socket.emit("sendToHost",t.currentHost,"delLogs",null,function(e){e?c.main.showError(e):c.clear()})})}).addClass("ui-state-error"),this.$tab.find("#log-refresh").on("click",function(){c.clear()}),o.attr("title",_("Pause output")).on("click",function(){c.pause()}),m.$counterSpan=o.find("ui-button-text"),this.$tab.find("#log-clear").on("click",function(){c.clear(!1)}),$("#log-copy-text").on("click",function(){$(this).hide().html("")}),this.$tab.find("#log-copy").on("click",function(){var e=''+_("copy note")+"";$("#log-copy-text").show().html(e+'
    '+s.html()+"
    ");for(var t=c.$tab.find("#log-copy-table").find(".log-column-4"),n=0;n'+a+"")}t.sort();for(var s=0;s'+o+"")}c.$tab.find("#log-files-btn").show().dropdown(),c.$tab.find("#log-files").html(n).find("a").on("click",function(){var e=$(this).data("value");e&&($(this).val(""),window.open(e,"_blank").focus())})}else c.$tab.find("#log-files").hide(),c.$tab.find("#log-files-btn").hide()})},0)})}else setTimeout(function(){c.init(e)},100)},this.destroy=function(){this.inited&&(this.inited=!1,this.main.subscribeLogs(!1))},this.add=function(e){if(s){if(e.message.substring(0,e.from.length)===e.from&&(e.message=e.message.substring(e.from.length+1)),m.mode)return m.list.push(e),m.counter++,m.counter>r.limit&&(m.overflow||(o.addClass("ui-state-error").attr("title",_("Message buffer overflow. Losing oldest")),m.overflow=!0),m.list.shift()),void m.$counterSpan.html(tdp(m.counter));if(r.count>=r.limit){var t=document.getElementById("log-line-"+(r.start+1));t&&(t.outerHTML=""),r.start++}else r.count++;e.from&&d&&d.host.checkAddOption(e.from,function(e){return{val:e.replace(/\./g,"-"),name:e}});var n="",i=e.from?e.from.replace(/\./g,"-"):"";u.host&&u.host!==i&&(n="display: none"),!n&&u.severity&&("debug"===u.severity&&"silly"===e.severity?n="display: none":"info"!==u.severity||"debug"!==e.severity&&"silly"!==e.severity?"warn"===u.severity&&"warn"!==e.severity&&"error"!==e.severity?n="display: none":"error"===u.severity&&"error"!==e.severity&&(n="display: none"):n="display: none"),!n&&u.message&&-1===e.message.indexOf(u.message)&&(n="display: none"),"error"===e.severity&&(c.$tabLogs=c.$tabLogs||$('a[href="#tab-logs"]'),c.$tabLogs.addClass("errorLog"));var a='';a+=''+(e.from||"")+"",a+=''+this.main.formatDate(e.ts)+"",a+=''+e.severity+"",a+=''+e.message.substring(0,200).replace(/&/g,"&").replace(//g,">")+"",s.prepend(a)}},this.filter=function(){u.host=d.host.val(),u.message=d.message.val(),u.severity=d.severity.val(),"error"===u.severity?(l.find(".log-severity-silly").hide(),l.find(".log-severity-debug").hide(),l.find(".log-severity-info").hide(),l.find(".log-severity-warn").hide()):("warn"===u.severity?(l.find(".log-severity-silly").hide(),l.find(".log-severity-debug").hide(),l.find(".log-severity-info").hide()):("info"===u.severity?(l.find(".log-severity-silly").hide(),l.find(".log-severity-debug").hide()):("silly"===u.severity?l.find(".log-severity-silly").show():l.find(".log-severity-silly").hide(),l.find(".log-severity-debug").show()),l.find(".log-severity-info").show()),l.find(".log-severity-warn").show()),l.find(".log-severity-error").show(),(u.host||u.message)&&l.find(".log-line").each(function(){u.host&&!$(this).hasClass("log-from-"+u.host)?$(this).hide():u.message&&-1===$(this).html().indexOf(u.message)&&$(this).hide()})},this.clear=function(e){void 0===e&&(e=!0),s.html(""),r.count=0,r.start=0,c.$tabLogs=c.$tabLogs||$('a[href="#tab-logs"]'),c.$tabLogs.removeClass("errorLog"),e&&setTimeout(function(){c.init(e)},0)},this.pause=function(){if(m.mode){m.mode=!1;for(var e=0;epause')}else o.addClass("yellow btn-pause-button-active"),m.$counterSpan=o,m.$counterSpan.html("0"),m.counter=0,m.mode=!0}}function Issue(e){var a=this;this.$dialog=$("#dialog-issue"),this.main=e,this.prepare=function(){},this.init=function(){if(!this.inited){this.inited=!0,showdown.setFlavor("github");var e=this.main.navigateGetParams(),t=e.replace(/^system\.adapter\./,""),n=this.main.objects[e];if(n&&n.common&&n.common.extIcon){var i=n.common.extIcon.split("/"),r=$("#result-issue");r.html('
    \n \n
    ');$.getJSON("https://api.github.com/repos/"+i[3]+"/"+i[4]+"/issues",function(e){var t=!1;for(var n in r.empty(),e)if(e.hasOwnProperty(n)){if("remove"===n)break;var i=e[n];if(!i.hasOwnProperty("pull_request")){t=!0;var a=$("#issueTable").children().clone(!0,!0);a.find(".collapsible-header-title").text(i.title),a.find(".goto").attr("href",i.html_url),a.find(".user").text(i.user.login),a.find(".form-row").html((new showdown.Converter).makeHtml(i.body).replace(/src="/g,'class="responsive-img" src="'));var s=new Date(new Date(i.created_at));if(a.find(".created").text(s.toLocaleDateString(systemLang,{weekday:"short",year:"numeric",month:"long",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})),0'+i.labels[o].name+"")}r.append(a),0}}t||r.append($('
  • '+_("No bug")+"

  • "))}).done(a.$dialog.find(".collapsible").collapsible())}a.$dialog.data("name",t),a.$dialog.find(".title").html(_("Known bugs for")+": "+t),a.$dialog.find(".dialog-system-buttons .btn-add").attr("href","https://github.com/"+i[3]+"/"+i[4]+"/issues/new"),a.$dialog.find(".dialog-system-buttons .btn-cancel").off("click").on("click",function(e){e.stopPropagation(),e.preventDefault(),a.main.navigate()})}},this.destroy=function(){this.inited&&(this.$dialog.find(".collapsible").collapsible("destroy"),this.inited=!1)}}function Objects(e){var c=this;this.$grid=$("#grid-objects"),this.subscribes={},this.main=e;var o=function(){if(c.$grid&&c.$grid.selectId)return o=c.$grid.selectId.bind(c.$grid),c.$grid.selectId.apply(c.$grid,arguments)};function r(t,e,n){for(var i=c.main.tabs.enums.list,a=[],s=0;s').show():o.$divLogo.html("").hide(),c(n.readme),c(n.changeLog),c(n.license),n.readme.length?n.readme=r(n.readme.join("\n"),t):n.readme="",n.changeLog.length?n.changeLog=r(n.changeLog.join("\n"),t):delete n.changeLog,n.license.length?(n.license[0]="## "+n.license[0],n.license=r(n.license.join("\n"),t)):delete n.license,n}(e,i.substring(0,i.lastIndexOf("/")+1));o.$divReadme.html(n.readme),n.changeLog?(o.$divChangeLog.html(n.changeLog),o.$tabs.find(".tab-changelog").show()):(o.$divChangeLog.html(""),o.$tabs.find(".tab-changelog").hide()),n.license?(o.$divLicense.html(n.license),o.$tabs.find(".tab-license").show()):(o.$divLicense.html(""),o.$tabs.find(".tab-license").hide())}).done(function(){o.$divReadme.on("click",".md-link",function(e){e.stopPropagation(),e.preventDefault(),o.fillDiv($(this).data("url"))}),o.$divReadme.on("click",".goto-link",function(e){e.stopPropagation(),e.preventDefault();var t=$($(this).data("goto"));t.length&&o.$divReadme.animate({scrollTop:o.$divReadme.scrollTop()-o.$divReadme.offset().top+t.offset().top},2e3)})})},this.destroy=function(){this.inited&&(localStorage.removeItem("original-md-url"),this.inited=!1)}}function initMap(){gMain.dialogs.system.mapLoaded=!0,gMain.dialogs.system.updateMap(!0)}function System(s){var a,o,r,c,l=this;this.$dialog=$("#dialog-system"),this.main=s,this.systemRepos=null,this.systemCerts=null;var d=!(this.mapLoaded=!1);function u(e,t){if(t.length<700&&(-1!==t.indexOf("/")||-1!==t.indexOf("\\")))return t;if(t.length<"-----BEGIN CERTIFICATE-----==-----END CERTIFICATE-----".length)return h(_('Invalid certificate "%s". To short.',e),!0),"";var n=[];if("-----BEGIN RSA PRIVATE KEY-----"===t.substring(0,"-----BEGIN RSA PRIVATE KEY-----".length)){if("-----END RSA PRIVATE KEY-----"!==t.substring(t.length-"-----END RSA PRIVATE KEY-----".length))return h(_('Certificate "%s" must end with "-----END RSA PRIVATE KEY-----".',e),!0),"";for(t=(t=(t=t.substring("-----BEGIN RSA PRIVATE KEY-----".length)).substring(0,t.length-"-----END RSA PRIVATE KEY-----".length)).replace(/\s/g,"");t.length;)n.push(t.substring(0,64)),t=t.substring(64);return"-----BEGIN RSA PRIVATE KEY-----\r\n"+n.join("\r\n")+"\r\n-----END RSA PRIVATE KEY-----\r\n"}if("-----BEGIN PRIVATE KEY-----"===t.substring(0,"-----BEGIN PRIVATE KEY-----".length)){if("-----END PRIVATE KEY-----"!==t.substring(t.length-"-----END PRIVATE KEY-----".length))return h(_('Certificate "%s" must end with "-----BEGIN PRIVATE KEY-----".',e),!0),"";for(t=(t=(t=t.substring("-----BEGIN PRIVATE KEY-----".length)).substring(0,t.length-"-----END PRIVATE KEY-----".length)).replace(/\s/g,"");t.length;)n.push(t.substring(0,64)),t=t.substring(64);return"-----BEGIN PRIVATE KEY-----\r\n"+n.join("\r\n")+"\r\n-----END PRIVATE KEY-----\r\n"}if("-----BEGIN CERTIFICATE-----"!==t.substring(0,"-----BEGIN CERTIFICATE-----".length))return h(_('Certificate "%s" must start with "-----BEGIN CERTIFICATE-----".',e),!0),"";if("-----END CERTIFICATE-----"!==t.substring(t.length-"-----END CERTIFICATE-----".length))return h(_('Certificate "%s" must end with "-----END CERTIFICATE-----".',e),!0),"";for(var i=t.split("-----END CERTIFICATE-----"),a=i.length-1;0<=a;a--)if(i[a].replace(/[\r\n|\r|\n]+/,"").trim()){for(t=(t=(t=i[a]).substring("-----BEGIN CERTIFICATE-----".length)).replace(/\s/g,""),n=[];t.length;)n.push(t.substring(0,64)),t=t.substring(64);i[a]="-----BEGIN CERTIFICATE-----\r\n"+n.join("\r\n")+"\r\n-----END CERTIFICATE-----\r\n"}else i.splice(a,1);return i.join("")}function m(e,t){for(var n,i=table2values("tab-system-certs"),a=[],s=0;s'+i[a].name+""),t===i[a].name&&(n=!0);n&&e.val(t);e.select()}()}}),l.systemRepos.nonEdit&&l.systemRepos.nonEdit.native&&l.systemRepos.nonEdit.native.repositories){var i=l.$dialog.find("#grid-repos");i.find("input").each(function(){$(this).prop("disabled",!0).addClass("disabled")}),i.find("select").each(function(){$(this).prop("disabled",!0).addClass("disabled")}),i.find(".btn-floating").each(function(){$(this).addClass("disabled")}),l.$dialog.find("#tab-system-repo .table-button-add").addClass("disabled")}}else l.$dialog.find("#tab-system-repo").html(_("permissionError"))}function h(e,t,n){l.main.showToast(l.$dialog.find("#tab-system-certs"),e,null,n,t)}function f(){var n=l.main.systemConfig.common,i=!1,a=!1;!function(){l.main.systemConfig.common.defaultNewAcl=l.main.systemConfig.common.defaultNewAcl||{};var e=l.main.systemConfig.common.defaultNewAcl,t=JSON.stringify(e);e.object=0,e.object|=l.$dialog.find("#tab-system-acl-obj-owner-read").prop("checked")?1024:0,e.object|=l.$dialog.find("#tab-system-acl-obj-owner-write").prop("checked")?512:0,e.object|=l.$dialog.find("#tab-system-acl-obj-group-read").prop("checked")?64:0,e.object|=l.$dialog.find("#tab-system-acl-obj-group-write").prop("checked")?32:0,e.object|=l.$dialog.find("#tab-system-acl-obj-every-read").prop("checked")?4:0,e.object|=l.$dialog.find("#tab-system-acl-obj-every-write").prop("checked")?2:0,e.owner=l.$dialog.find("#tab-system-acl-owner").val(),e.ownerGroup=l.$dialog.find("#tab-system-acl-group").val(),e.state=0,e.state|=l.$dialog.find("#tab-system-acl-state-owner-read").prop("checked")?1024:0,e.state|=l.$dialog.find("#tab-system-acl-state-owner-write").prop("checked")?512:0,e.state|=l.$dialog.find("#tab-system-acl-state-group-read").prop("checked")?64:0,e.state|=l.$dialog.find("#tab-system-acl-state-group-write").prop("checked")?32:0,e.state|=l.$dialog.find("#tab-system-acl-state-every-read").prop("checked")?4:0,e.state|=l.$dialog.find("#tab-system-acl-state-every-write").prop("checked")?2:0,e.file=0,e.file|=l.$dialog.find("#tab-system-acl-file-owner-read").prop("checked")?1024:0,e.file|=l.$dialog.find("#tab-system-acl-file-owner-write").prop("checked")?512:0,e.file|=l.$dialog.find("#tab-system-acl-file-group-read").prop("checked")?64:0,e.file|=l.$dialog.find("#tab-system-acl-file-group-write").prop("checked")?32:0,e.file|=l.$dialog.find("#tab-system-acl-file-every-read").prop("checked")?4:0,e.file|=l.$dialog.find("#tab-system-acl-file-every-write").prop("checked")?2:0,JSON.stringify(e)}(),l.$dialog.find(".system-settings.value").each(function(){var e=$(this),t=e.attr("id");t&&(t=t.substring("system_".length),"checkbox"===e.attr("type")?n[t]=e.prop("checked"):("language"===t&&n.language!==e.val()&&(i=!0),"activeRepo"===t&&n.activeRepo!==e.val()&&(a=!0),n[t]=e.val(),"isFloatComma"===t&&(n[t]="true"===n[t]||!0===n[t])))});var e={};if(l.systemRepos){for(var t in l.systemRepos.native.repositories)l.systemRepos.native.repositories.hasOwnProperty(t)&&"object"==typeof l.systemRepos.native.repositories[t]&&l.systemRepos.native.repositories[t].json&&(e[l.systemRepos.native.repositories[t].link]=l.systemRepos.native.repositories[t].json);l.systemRepos.native.repositories={}}var s=table2values("tab-system-repo");if(l.systemRepos){for(var o=null,r=0;r'+n+"");else l.$dialog.find("#tab-system-repo").html(_("permissionError"));l.$dialog.find("#diagMode").val(l.main.systemConfig.common.diag).on("change",function(){l.main.socket.emit("sendToHost",l.main.currentHost,"getDiagData",$(this).val(),function(e){l.$dialog.find("#diagSample").html(JSON.stringify(e,null,2))})}).trigger("change");var i=l.$dialog.find("#system_defaultHistory");i.html('');for(var a=0;a'+s.instances[a].substring("system.adapter.".length)+"");r=l.main.systemConfig.common.longitude,c=l.main.systemConfig.common.latitude,o||(o=!0,d?(l.mapLoaded=!0,$.ajax({url:"lib/js/ol.js",dataType:"script",cache:!0}).done(function(){setTimeout(l.updateMap,500)}),$.ajax({url:"lib/css/ol.css",success:function(e){$("head").append("")}})):$.ajax({url:"https://maps.googleapis.com/maps/api/js?key=AIzaSyCIrBRZfZAE_0C1OplAUy7OXhiWLoZc3eY&signed_in=true&callback=initMap",dataType:"script",cache:!0})),l.$dialog.find(".system-settings.value").each(function(){var e=$(this),t=e.attr("id");t&&(t=t.substring("system_".length),"checkbox"===e.attr("type")?e.prop("checked",l.main.systemConfig.common[t]):"isFloatComma"===t?e.val(l.main.systemConfig.common[t]?"true":"false"):e.val(l.main.systemConfig.common[t]),l.main.systemConfig.nonEdit&&l.main.systemConfig.nonEdit.common&&void 0!==l.main.systemConfig.nonEdit.common[t]&&(e.addClass("disabled"),e.prop("disabled",!0)))}),l.$dialog.find("#system_latitude").off("change").on("change",function(){c=$(this).val(),l.updateMap()}).off("keyup").on("keyup",function(){$(this).trigger("change")}),l.$dialog.find("#system_longitude").off("change").on("change",function(){r=$(this).val(),l.updateMap()}).off("keyup").on("keyup",function(){$(this).trigger("change")}),l.systemCerts.native.letsEncrypt||(l.systemCerts.native.letsEncrypt={path:"letsencrypt"}),l.$dialog.find(".system-le-settings.value").each(function(){var e=$(this),t=e.data("name");l.systemCerts&&l.systemCerts.native.letsEncrypt&&("checkbox"===e.attr("type")?e.prop("checked",l.systemCerts.native.letsEncrypt[t]):e.val(l.systemCerts.native.letsEncrypt[t])),l.systemCerts.nonEdit&&l.systemCerts.nonEdit.native&&l.systemCerts.nonEdit.native.letsEncrypt&&void 0!==l.systemCerts.nonEdit.native.letsEncrypt[t]&&(e.addClass("disabled"),e.prop("disabled",!0))}),l.$dialog.find("#tabs-system").find(".tabs").mtabs({onShow:function(e){e&&p($(e).attr("id"))}}),l.$dialog.find(".dialog-system-buttons .btn-save").off("click").on("click",f),l.$dialog.find(".dialog-system-buttons .btn-cancel").off("click").on("click",function(){l.main.navigate()}),g(),function(){l.main.systemConfig.common.defaultNewAcl=l.main.systemConfig.common.defaultNewAcl||{};for(var e,t=l.main.systemConfig.common.defaultNewAcl,n="",i=0;i'+(e||l.main.tabs.users.list[i])+"";for(l.$dialog.find("#tab-system-acl-owner").html(n).val(t.owner||"system.user.admin"),n="",i=0;i'+(e||l.main.tabs.users.groups[i])+"";l.$dialog.find("#tab-system-acl-group").html(n).val(t.ownerGroup||"system.group.administrator"),void 0===t.object&&(t.object=1636),l.$dialog.find("#tab-system-acl-obj-owner-read").prop("checked",1024&t.object),l.$dialog.find("#tab-system-acl-obj-owner-write").prop("checked",512&t.object),l.$dialog.find("#tab-system-acl-obj-group-read").prop("checked",64&t.object),l.$dialog.find("#tab-system-acl-obj-group-write").prop("checked",32&t.object),l.$dialog.find("#tab-system-acl-obj-every-read").prop("checked",4&t.object),l.$dialog.find("#tab-system-acl-obj-every-write").prop("checked",2&t.object),void 0===t.state&&(t.state=1636),l.$dialog.find("#tab-system-acl-state-owner-read").prop("checked",1024&t.state),l.$dialog.find("#tab-system-acl-state-owner-write").prop("checked",512&t.state),l.$dialog.find("#tab-system-acl-state-group-read").prop("checked",64&t.state),l.$dialog.find("#tab-system-acl-state-group-write").prop("checked",32&t.state),l.$dialog.find("#tab-system-acl-state-every-read").prop("checked",4&t.state),l.$dialog.find("#tab-system-acl-state-every-write").prop("checked",2&t.state),void 0===t.file&&(t.file=1636),l.$dialog.find("#tab-system-acl-file-owner-read").prop("checked",1024&t.file),l.$dialog.find("#tab-system-acl-file-owner-write").prop("checked",512&t.file),l.$dialog.find("#tab-system-acl-file-group-read").prop("checked",64&t.file),l.$dialog.find("#tab-system-acl-file-group-write").prop("checked",32&t.file),l.$dialog.find("#tab-system-acl-file-every-read").prop("checked",4&t.file),l.$dialog.find("#tab-system-acl-file-every-write").prop("checked",2&t.file),l.$dialog.find('input[type="checkbox"]+span').off("click").on("click",function(){var e=$(this).prev();e.prop("disabled")||e.prop("checked",!e.prop("checked")).trigger("change")})}(),function(){var e,t=l.$dialog.find("#tab-system-certs");if(l.systemCerts&&l.systemCerts.native.certificates){var n=[];for(var i in l.systemCerts.native.certificates)l.systemCerts.native.certificates.hasOwnProperty(i)&&n.push({name:i,certificate:(e=l.systemCerts.native.certificates[i],e.replace(/(?:\\[rn]|[\r\n]+)+/g,""))});if(values2table("tab-system-certs",n,{onChange:function(e){l.$dialog.find(".btn-save").removeClass("disabled")}}),l.systemCerts.nonEdit&&l.systemCerts.nonEdit.native&&l.systemCerts.nonEdit.native.certificates){var a=l.$dialog.find("#grid-certs");a.find("input").each(function(){$(this).prop("disabled",!0).addClass("disabled")}),a.find("select").each(function(){$(this).prop("disabled",!0).addClass("disabled")}),a.find(".btn-floating").each(function(){$(this).addClass("disabled")})}}else t.html(_("permissionError"));installFileUpload(t,1e4,function(e,t){if(e)h(e,!0);else{try{t=atob(t.split(",")[1])}catch(e){return void h(_("Cannot read file!"),!0)}if(-1!==(t=t.replace(/(\r\n|\n|\r)/gm,"")).indexOf("BEGIN RSA PRIVATE KEY"))m("private",t);else if(-1!==t.indexOf("BEGIN PRIVATE KEY"))m("private",t);else if(-1!==t.indexOf("BEGIN CERTIFICATE")){for(var n=t.split("-----END CERTIFICATE-----"),i=0,a=0;a'),c.find(".tab-dialog-new-icon .treetable-icon").attr("src",t),c.find(".tab-dialog-new-icon-clear").show()}}),"string"==typeof e&&(g.main.objects[e]&&g.main.objects[e].common&&(l.name=g.main.objects[e].common.name,l.icon=g.main.objects[e].common.icon,l.color=g.main.objects[e].common.color,l.desc=g.main.objects[e].common.desc,(o="group"===g.main.objects[e].type)&&(l.acl=g.main.objects[e].common.acl)),d=e,l.id=e),c.find(".tab-dialog-new-title").text(!0===e?_("Create new group"):l.id?_("Change"):_("Create new user")),l.id){var t=l.id.split(".");l.id=t.pop(),s=t.join(".")}c.find("#tab-users-dialog-new-name").val(translateName(l.name)).off("change").on("change",function(){var e=g.$grid.find("#tab-users-dialog-new-id"),t=e.val(),n=$(this).val();n=n.trim().replace(FORBIDDEN_CHARS,"_").replace(/\./g,"_").toLowerCase(),t&&a||!(o&&"administrator"!==t&&"user"!==t||!o&&"admin"!==t)||(e.val(n),i=n,c.find("#tab-users-dialog-new-preview").val(s+"."+(n||"#")),M.updateTextFields("#tab-users-dialog-new")),b(c)}).off("keyup").on("keyup",function(){$(this).trigger("change")}),c.find("#tab-users-dialog-new-desc").val(l.desc).off("change").on("change",function(){b(c)}).off("keyup").on("keyup",function(){$(this).trigger("change")}),i=l.id,c.find("#tab-users-dialog-new-id").val(l.id).off("change").on("change",function(){var e=$(this).val();i!==e&&(a=!0,i=e,c.find("#tab-users-dialog-new-preview").val(s+"."+(e||"#")),M.updateTextFields("#tab-users-dialog-new"),b(c))}).off("keyup").on("keyup",function(){$(this).trigger("change")}),c.find(".tab-dialog-create").addClass("disabled").off("click").text(_(d?"Change":"Create")).on("click",function(e){var n;l.name=c.find("#tab-users-dialog-new-name").val(),l.id=c.find("#tab-users-dialog-new-id").val(),l.desc=c.find("#tab-users-dialog-new-desc").val(),o?(n=l.acl,g.$grid.find(".edit-group-permissions").each(function(){var e=$(this).data("type"),t=$(this).data("operation");n[e]=n[e]||{},n[e][t]=$(this).prop("checked")}),function(i,a,s){if("system.group.administrator"===a&&"administrator"!==s.id)return i.stopPropagation(),u(_('Cannot change name of "%s"',"administrator"),!0);if("system.group.user"===a&&"user"!==s.id)return i.stopPropagation(),u(_('Cannot change name of "%s"',"user"),!0);if(!s.id)return i.stopPropagation(),u(_("ID may not be empty"),!0);if(a)if("system.group."+s.id!==a){if(g.main.objects["system.group."+s.id])return i.stopPropagation(),u(_("ID yet exists"),!0);g.main.socket.emit("getObject",a,function(e,t){if(e)h(_("Cannot change group: ")+e,!0);else{var n=s.id;t.common.name=s.name,t.common.color=s.color,t.common.icon=s.icon,t.common.desc=s.desc,delete s.id,g.main.socket.emit("delObject",a,function(e){e?(h(_("Cannot rename group: ")+e,!0),i.stopPropagation()):g.main.socket.emit("setObject",n,t,function(e){e?h(_("Cannot change group: ")+e,!0):h(_("Updated"))})})}})}else delete s.id,g.main.socket.emit("extendObject",a,{common:s},function(e,t){e?h(_("Cannot change group: ")+e,!0):h(_("Updated"))});else{if(!s.id)return i.stopPropagation(),u(_("ID may not be empty"),!0);g.main.socket.emit("addGroup",s.id,s.desc,null,function(e,t){e?h(_("Cannot create group: ")+e,!0):g.main.socket.emit("extendObject",t._id,{common:s},function(e){e?h(_("Cannot add group: ")+e,!0):h(_("Created"))})})}}(e,d,l)):(delete l.acl,r(e,d,l))}),c.find("#tab-users-dialog-new-preview").val(s+"."+(l.id||"#")),l.icon?(c.find(".tab-dialog-new-icon").show().html(g.main.getIcon(d)),c.find(".tab-dialog-new-icon-clear").show()):(c.find(".tab-dialog-new-icon").hide(),c.find(".tab-dialog-new-icon-clear").hide()),l.color=l.color||!1,l.color?c.find(".tab-dialog-new-color").val(l.color):c.find(".tab-dialog-new-color").val(),u(_("Drop the icons here")),c.find(".tab-dialog-new-upload").off("click").on("click",function(){c.find(".drop-file").trigger("click")}),c.find(".tab-dialog-new-icon-clear").off("click").on("click",function(){l.icon&&(l.icon="",c.find(".tab-dialog-new-icon").hide(),c.find(".tab-dialog-new-icon-clear").hide(),b(c))}),c.find(".tab-dialog-new-color-clear").off("click").on("click",function(){l.color&&(b(c),c.find(".tab-dialog-new-color-clear").hide(),c.find(".tab-dialog-new-colorpicker").colorpicker({component:".btn",color:l.color,container:c.find(".tab-dialog-new-colorpicker")}).colorpicker("setValue",""),l.color="")});var n=Date.now();try{c.find(".tab-dialog-new-colorpicker").colorpicker("destroy")}catch(e){}c.find(".tab-dialog-new-colorpicker").colorpicker({component:".btn",color:l.color,container:c.find(".tab-dialog-new-colorpicker")}).colorpicker("setValue",l.color).on("showPicker.colorpicker",function(){var e=c.find(".modal-content");e[0].scrollTop=e[0].scrollHeight}).on("changeColor.colorpicker",function(e){100'+_(a+" permissions")+"",i+='';for(var s=0;s"+t[s]+"":i+="";i+="",i+="";for(var o=0;o'}else i+="";i+=""}i+="",c.find("#tab-users-dialog-new-rights").html(i),c.find('input[type="checkbox"]+span').off("click").on("click",function(){var e=$(this).prev();e.prop("disabled")||e.prop("checked",!e.prop("checked")).trigger("change")}),c.find('input[type="checkbox"]').off("change").on("change",function(){b(c)}),m(d,l.acl),M.updateTextFields("#tab-users-dialog-new")}),c.find("ul.tabs .tab-dialog-new-tabs").show()):(c.find("ul.tabs .tab-dialog-new-tabs").each(function(){$(this).find('a[href="#tab-users-dialog-new-rights"]').length&&$(this).hide()}),M.updateTextFields("#tab-users-dialog-new")),c.find("ul.tabs").mtabs(),g.main.noSelect||c.find("ul.tabs").mtabs("select","tab-users-dialog-new-main"),c.modal().modal("open")}function t(){g.list.sort(),g.groups.sort();var e="";e+='
      ';for(var t=function(e,t){for(var n={},i=0;i'+g.main.getIcon(c)+l+'close'}var d="",u=!1;a.color&&(d="background: "+a.color+"; ",g.main.invertColor(a.color)&&(u=!0,d+="color: white;"));var m=a.desc;"object"==typeof m&&(m=m[systemLang]||m.en),e+='
    • ',e+=" "+(g.main.getIcon(g.list[n],null,null,"icon")||''),e+=''+i+"",e+="

      "+g.list[n]+((m?" ("+m+")":"")||"")+"

      ",e+=' '+(a.enabled?"check_box":"check_box_outline_blank")+"",e+=' edit',e+=' delete
      ',e+=s||"",e+="
    • "}e+="
    ",g.$gridUsers.html(e),g.$grid.find("#tab-users-btn-new-user").on("click",function(){y(!1)}),g.$gridUsers.find(".tab-users-enabled-user").on("click",function(){var e=$(this).data("user");if("system.user.admin"===e)return h(_("Cannot disable admin!"),!0),!1;var t=$(this),n=g.main.objects[e]&&g.main.objects[e].common&&g.main.objects[e].common.enabled;n=!n,g.main.socket.emit("extendObject",e,{common:{enabled:n}},function(e){e?h(_("Cannot modify user!")+e,!0):(h(_("Updated")),t.find("i").text(n?"check_box":"check_box_outline_blank"))})}),g.$gridUsers.find(".delete-content").off("click").on("click",function(){var t=$(this).data("user");$(this).hasClass("disabled")||(g.main.objects[t]&&"user"===g.main.objects[t].type?g.main.confirmMessage(_("Are you sure to delete %s?",t),null,"help",function(e){e&&p(t)}):h(_('Object "%s" does not exists. Update the page.',t),!0))}),g.$gridUsers.find(".edit-content").on("click",function(){y($(this).data("user"))}),g.$gridUsers.find(".tab-users-remove-group").on("click",function(){var i=$(this).data("user"),e=$(this).data("group");g.main.socket.emit("getObject",e,function(e,t){if(t&&t.common&&t.common.members){var n=t.common.members.indexOf(i);-1!==n?(t.common.members.splice(n,1),g.main.socket.emit("setObject",t._id,t,function(e){e?h(_("Error: %s",e),!0):h(_("Removed"))})):h(_("%s is not in the list"),!0)}})})}function n(){var e="";e+='
      ';for(var t=0;t'+g.main.getIcon(c)+r+'close'}var l="",d=!1;i.color&&(l="background: "+i.color+"; ",g.main.invertColor(i.color)&&(d=!0,l+="color: white;"));var u=i.desc;"object"==typeof u&&(u=u[systemLang]||u.en),e+='
    • ',e+=" "+(g.main.getIcon(g.groups[t],null,null,"icon")||''),e+=' '+n+"",e+="

      "+g.groups[t]+((u?" ("+u+")":"")||"")+"

      ",e+=' edit',e+=' delete
      ',e+=a||"",e+="
    • "}e+="
    ",g.$gridGroups.html(e),g.$grid.find("#tab-users-btn-new-group").on("click",function(){y(!0)}),g.$gridGroups.find(".delete-content").on("click",function(){var n=$(this).data("group");$(this).hasClass("disabled")||(g.main.objects[n]&&"group"===g.main.objects[n].type?g.main.confirmMessage(_("Are you sure to delete %s?",n),null,"help",function(e){var t;e&&(t=n,g.main.objects[t]&&"group"===g.main.objects[t].type?g.main.objects[t].common&&g.main.objects[t].common.dontDelete?h(_("Object may not be deleted"),!0):g.main.socket.emit("delObject",t,function(e){e?h(_("Group may not be deleted: %s",e),!0):h(_("Group deleted"))}):h(_("Invalid object: %s",t),!0))}):h(_('Object "%s" does not exists. Update the page.',n),!0))}),g.$gridGroups.find(".edit-content").on("click",function(){y($(this).data("group"))}),g.$gridGroups.find(".tab-users-remove-user").on("click",function(){var i=$(this).data("user"),e=$(this).data("group");g.main.socket.emit("getObject",e,function(e,t){if(t&&t.common&&t.common.members){var n=t.common.members.indexOf(i);if(-1!==n){if(t.common.members.splice(n,1),!t._id)return void console.error("INVLAID ID");g.main.socket.emit("setObject",t._id,t,function(e){e?h(_("Error: %s",e),!0):h(_("Removed"))})}else h(_("%s is not in the list"),!0)}})})}this.groups=[],this.list=[],this.$grid=$("#tab-users"),this.$gridUsers=this.$grid.find(".tab-users-list-users .tab-users-body"),this.$gridGroups=this.$grid.find(".tab-users-list-groups .tab-users-body"),this.main=e,this.aclGroups=null,this.prepare=function(){},this._postInit=function(){var e;t(),g.$gridUsers.find("ul").sortable({connectWith:"#tab-users .tab-users-list-groups .treetable",items:".users-type-draggable",appendTo:g.$gridUsers,refreshPositions:!0,helper:function(e,t){return $('
    '+t.find(".treetable-icon-empty+span").text()+"
    ")},zIndex:999990,revert:!1,scroll:!1,start:function(e,t){var n=t.item.prev();t.item.data("prev",n),g.$grid.addClass("dragging")},stop:function(e,t){g.$grid.removeClass("dragging")},update:function(e,t){var n=t.item.data("prev");n&&n.length?$(n).after(t.item):$(this).prepend(t.item)}}).disableSelection(),n(),(e=g.$gridGroups.find("ul>li")).droppable("instance")&&e.droppable("destroy"),e.droppable({accept:".users-type-draggable",over:function(e,t){if($(this).addClass("tab-accept-item"),$(this).hasClass("not-empty")&&!$(this).hasClass("expanded")){var n,i=$(this).data("tt-id");(n=$(this).data("timer"))&&clearTimeout(n),$(this).data("timer",setTimeout(function(){g.$gridGroups.treeTable("expand",i)},1e3))}},out:function(e,t){var n;$(this).removeClass("tab-accept-item"),(n=$(this).data("timer"))&&(clearTimeout(n),$(this).data("timer",null))},tolerance:"pointer",drop:function(e,t){$(this).removeClass("tab-accept-item");var n=t.draggable.data("tt-id"),i=$(this).data("tt-id");g.main.socket.emit("getObject",i,function(e,t){t&&t.common&&(t.common.members=t.common.members||[],-1===t.common.members.indexOf(n)?(t.common.members.push(n),t.common.members.sort(),g.main.socket.emit("setObject",t._id,t,function(e){e?h(_("Error: %s",e),!0):h(_("%s added to %s",n,t._id))})):h(_("Is yet in the list")))})}})},this.init=function(e){this.inited&&!e||(void 0!==this.$gridUsers&&this._postInit(),this.inited||(h(_("You can drag&drop users to groups"),5e3),this.inited=!0,this.main.subscribeObjects("system.user.*"),this.main.subscribeObjects("system.group.*")))},this.destroy=function(){this.inited&&(this.inited=!1,this.main.unsubscribeObjects("system.user.*"),this.main.unsubscribeObjects("system.group.*"))},this.objectChange=function(e,t,n){if(e.match(/^system\.user\./)){if(t)-1===this.list.indexOf(e)&&this.list.push(e);else{var i=this.list.indexOf(e);-1!==i&&this.list.splice(i,1)}this.timer&&clearTimeout(this.timer),this.timer=setTimeout(function(){g.timer=null,g._postInit()},200)}else if(e.match(/^system\.group\./)){if(t)-1===this.groups.indexOf(e)&&this.groups.push(e);else{var a=this.groups.indexOf(e);-1!==a&&this.groups.splice(a,1)}this.timer&&clearTimeout(this.timer),this.timer=setTimeout(function(){g.timer=null,g._postInit()},200)}}}!function(C){C(document).ready(function(){var e=location.pathname+"socket.io";location.pathname.match(/^\/admin\//)&&(e="/socket.io");var s,y={},v={objects:{},states:{},currentHost:"",currentTab:null,currentDialog:null,currentUser:"",subscribesStates:{},subscribesObjects:{},subscribesLogs:0,socket:io.connect("/",{path:e}),systemConfig:null,instances:null,objectsLoaded:!1,waitForRestart:!1,tabs:null,dialogs:{},selectId:null,config:{},ignoreJSupdate:!1,addEventMessage:function(e,t,n,i){g.events.add(e,t,n,i)},saveConfig:function(e,t){e&&(v.config[e]=t),"undefined"!=typeof storage&&storage.set("adminConfig",JSON.stringify(v.config))},saveTabs:function(){this.socket.emit("setObject","system.config",this.systemConfig,function(e){e&&this.showError(e)})},upToDate:function(e,t){return e=e.split("."),t=t.split("."),e[0]=parseInt(e[0],10),t[0]=parseInt(t[0],10),!(e[0]>t[0])&&(e[0]!==t[0]||(e[1]=parseInt(e[1],10),t[1]=parseInt(t[1],10),!(e[1]>t[1])&&(e[1]!==t[1]||(e[2]=parseInt(e[2],10),t[2]=parseInt(t[2],10),e[2]<=t[2]))))},cmdExec:function(e,t,n){e=e||v.currentHost,c.val(""),l.modal("open"),s="$ ./yunkong2 "+t,l.data("finished",!1).find(".btn").html(_("In background")),l.find(".command").html(s),l.find(".progress-dont-close").removeClass("disabled"),p.find(".button-command").removeClass("error").addClass("in-progress"),l.data("max",null),l.data("error",""),h.addClass("indeterminate").removeClass("determinate"),t.match(/^upload /)?l.find(".progress-text").html(_("Upload started...")).removeClass("error"):t.match(/^del [-_\w\d]+\.[\d]+$/)?l.find(".progress-text").html(_("Removing of instance...")).removeClass("error"):t.match(/^del /)?l.find(".progress-text").html(_("Removing of adapter...")).removeClass("error"):t.match(/^url /)?l.find(".progress-text").html(_("Install or update from URL...")).removeClass("error"):t.match(/^add /)?l.find(".progress-text").html(_("Add instance...")).removeClass("error"):l.find(".progress-text").html(_("Started...")).removeClass("error"),c.val(s),r=Math.floor(268435454*Math.random())+1,o=n,v.socket.emit("cmdExec",e,r,t,function(e){e?(s+="\n"+_(e),c.val(s),o=null,n(e)):n&&n()})},confirmMessage:function(e,t,n,i,a){if("function"==typeof i)a=i,m.find(".modal-footer").html(''+_("Ok")+''+_("Cancel")+""),m.find(".modal-footer .modal-action").on("click",function(){var e=m.data("callback");e&&e(C(this).data("result"))});else if("object"==typeof i){for(var s="",o=i.length-1;0<=o;o--)s+=''+i[o]+"";m.find(".modal-footer").html(s),m.find(".modal-footer .modal-action").on("click",function(){var e=m.data("callback");e&&e(C(this).data("id"))})}m.find(".dialog-title").text(t||_("Please confirm")),n?m.find(".dialog-icon").show().html(n):m.find(".dialog-icon").hide(),m.find(".dialog-text").html(e),m.data("callback",a),m.modal("open")},showMessage:function(e,t,n){u.find(".dialog-title").text(t||_("Message")),n?u.find(".dialog-icon").show().html(n):u.find(".dialog-icon").hide(),u.find(".dialog-text").html(e),u.modal("open")},showError:function(e){v.showMessage(_(e),_("Error"),"error_outline")},showToast:function(e,t,n,i,a,s){e&&e instanceof jQuery&&(e=e[0]),"string"==typeof(s=s||[])&&(s=[s]),a&&s.push("dropZone-error"),M.toast({parentSelector:e||C("body")[0],html:t+(n?''+n+"":""),displayLength:i||3e3,classes:s})},formatDate:function(e,t){if(!e)return"";var n,i=typeof e;return"string"===i?t?e.substring(8):e:("object"!==i&&(e=e<9466812e5?new Date(1e3*e):new Date(e)),t?i=(n=e.getDate())<10?"0"+n:n:(i=e.getFullYear(),i+=(n=e.getMonth()+1)<10?"-0"+n:"-"+n,i+=(n=e.getDate())<10?"-0"+n:"-"+n),i+=(n=e.getHours())<10?" 0"+n:" "+n,i+=(n=e.getMinutes())<10?":0"+n:":"+n,i+=(n=e.getSeconds())<10?":0"+n:":"+n,i+=(n=e.getMilliseconds())<10?".00"+n:n<100?".0"+n:"."+n)},updateWizard:function(){var e=C("#button-wizard");v.objects["system.adapter.discovery.0"]?(e.data("inited")||(e.data("inited",!0),e.on("click",function(){v.navigate({tab:"instances",dialog:"config",params:"system.adapter.discovery.0"})}).attr("title",_("Device discovery"))),e.show(),!v.systemConfig.common.wizard&&v.systemConfig.common.licenseConfirmed&&e.trigger("click")):e.hide()},getUser:function(){if(v.currentUser){if(v.objects[v.currentUser]){var e=v.objects[v.currentUser],t="";if(t=e&&e.common&&e.common.name?translateName(e.common.name):(t=v.currentUser.replace(/^system\.user\./))[0].toUpperCase()+t.substring(1).toLowerCase(),e&&e.common&&e.common.icon){var n={};n[v.currentUser]=e,C("#current-user-icon").html(v.getIcon(v.currentUser,null,n))}else C("#current-user-icon").html('account_circle');C("#current-user").html(t);for(var i=[],a=0;aone object or all children of %s too?',t),null,"help_outline",[_("_All"),_("Only one"),_("Cancel")],function(e){0===e?v._delObjects(t,!0,n):1===e&&v._delObjects(t,!1,n)}):v.confirmMessage(_("Are you sure to delete %s?",t),null,"help_outline",function(e){e&&v._delObjects(t,!0,n)}):i&&i.children?v.confirmMessage(_("Are you sure to delete all children of %s?",t),null,"help_outline",function(e){e&&v._delObjects(t,!0,n)}):v.showMessage(_('Object "%s" does not exists. Update the page.',t),_("Error"),"help_outline",function(e){e&&v._delObjects(t,!0,n)})}},g={hosts:new Hosts(gMain=v),objects:new Objects(v),adapters:new Adapters(v),instances:new Instances(v),users:new Users(v),enums:new Enums(v),events:new Events(v),logs:new Logs(v),states:null,intro:new Intro(v)};"undefined"!=typeof States&&(g.states=new States(v)),v.instances=g.instances.list,v.tabs=g,v.dialogs={system:new System(v),customs:new Customs(v),config:new Config(v),editobject:new EditObject(v),issue:new Issue(v),readme:new Readme(v)};var o=null,r=null,c=C("#stdout"),l=C("#dialog-command"),d=C("#dialog-license-main"),u=C("#dialog-message"),m=C("#dialog-confirm"),h=l.find(".progress div"),f=C("#admin_sidemenu_menu"),p=C("#admin_sidemenu_main"),t=!0;if("ontouchstart"in window||navigator.maxTouchPoints||C("body").addClass("desktop-screen"),-1!==navigator.userAgent.indexOf("Safari")&&-1===navigator.userAgent.indexOf("Chrome")&&-1===navigator.userAgent.indexOf("Android")?(C("body").addClass("safari"),v.browser="safari",v.noSelect=!0):detectIE()&&(C("body").addClass("ie"),v.browser="ie",v.browserVersion=detectIE(),v.noSelect=!0,C("#host-adapters-btn").css("margin-top","10px")),"undefined"!=typeof storage)try{v.config=storage.get("adminConfig"),v.config?v.config=JSON.parse(v.config):v.config={}}catch(e){console.log("Cannot load edit config"),v.config={}}function b(e){C("#admin_sidemenu_dialog").html(""),C("html").off("click",b)}function w(){if(function(){var e="",i=[];C(".admin-tab").each(function(){var e=C(this).attr("id");v.systemConfig.common.tabs&&-1===v.systemConfig.common.tabs.indexOf(e)||i.push({line:'
  • '+(T[e]&&T[e].icon?''+T[e].icon+"":'live_help')+_(C(this).data("name"))+"
  • ",id:e})}),C(".tab-custom").each(function(){var e=C(this).attr("id");if(!v.systemConfig.common.tabs||-1!==v.systemConfig.common.tabs.indexOf(e)){var t;if(T[e]&&T[e].icon)t=T[e].icon;else{var n="system.adapter."+e.substring(4);v.objects[n]&&v.objects[n].adminTab&&v.objects[n]["fa-icon"]&&(t=v.objects[n]["fa-icon"])}i.push({line:'
  • '+(t?''+t+"":'live_help')+C(this).data("name")+"
  • ",id:e})}}),i.sort(function(e,t){return T[e.id]||T[t.id]?T[e.id]?T[t.id]?T[e.id].orderT[t.id].order?1:0:-1:1:0});for(var t=0;t
      ';for(var s in y){var o=y[s],r="chk-"+s;a+="
    • '+_(o)+""}a+="
    ",t.append(a),t.find(".chk-tab").off("change").on("change",function(e){var t=C(this).attr("id").substr(4);if(C(this).prop("checked"))v.systemConfig.common.tabs.push(t);else{var n=v.systemConfig.common.tabs.indexOf(t);-1!==t&&v.systemConfig.common.tabs.splice(n,1)}v.saveTabs(),j()}),t.find('input[type="checkbox"]+span').off("click").on("click",function(){var e=C(this).prev();e.prop("disabled")||e.prop("checked",!e.prop("checked")).trigger("change")})}),v.updateWizard(),C("#button-logout").on("click",function(){window.location.href="/logout/"}),window.onhashchange=function(){v.navigateDo()},v.navigateDo(),C("#events_threshold").on("click",function(){v.socket.emit("eventsThreshold",!1)})}function j(){var n=[],e=[];y={};for(var t=0;t'+m+"\n",C("#"+d).length)C("#"+d).hide().appendTo(C("body"));else{var f='
    ';C(f).hide().appendTo(C("body")),C("#"+d).find(".iframe-in-tab").on("load",function(){var e=C(this).contents().find("body>header");e&&e.length||(e=C(this).contents().find("head")),e&&e.length&&e.append('')})}}}if(C(".tab-custom").each(function(){-1===n.indexOf(C(this).attr("id"))&&C("#"+C(this).attr("id")).remove()}),v.systemConfig.common.tabs||(v.systemConfig.common.tabs=n),C(".link-replace").length){var p=0,b=setTimeout(function(){b=null,w()},100);C(".link-replace").each(function(){p++,v.tabs.instances._replaceLinks(C(this).data("src"),C(this).data("adapter"),C(this).data("instance"),C(this).attr("id"),function(e,t,n,i){C("#"+i).data("src",e).removeClass("link-replace"),--p||b&&(clearTimeout(b),b=null,w())})})}else w()}function L(a){v.socket.emit("getAllObjects",function(e,i){e?window.alert(_(e)):setTimeout(function(){var e;for(var t in v.objects=i,v.objects)v.objects.hasOwnProperty(t)&&"_design"!==t.slice(0,7)&&("instance"===(e=v.objects[t]).type&&v.instances.push(t),"enum"===e.type&&g.enums.list.push(t),"user"===e.type&&g.users.list.push(t),"group"===e.type&&g.users.groups.push(t),"adapter"===e.type&&g.adapters.list.push(t),"host"===e.type&&g.hosts.addHost(e),e.common&&e.common.history&&(e.common.custom=JSON.parse(JSON.stringify(e.common.history)),delete e.common.history));for(var n in v.objectsLoaded=!0,v.initHostsList(!0),j(),v.dialogs)v.dialogs.hasOwnProperty(n)&&"function"==typeof v.dialogs[n].prepare&&v.dialogs[n].prepare();!function n(i,a){a=a||0,i&&a'+a.icon+"";var s;n="instance"===e.type?"/adapter/"+e.common.name+"/"+e.common.icon:e._id.match(/^system\.adapter\./)?(s=e._id.split(".",3),"/"===a.icon[0]?s[2]+=a.icon:s[2]+="/"+a.icon,"/adapter/"+s[2]):(s=e._id.split(".",2),"/"===a.icon[0]?s[0]+=a.icon:s[0]+="/"+a.icon,"/adapter/"+s[0])}i=e.type}return{icon:n,alt:i}}v.initHostsList=function(e){var t=C("#host-adapters");if(!e||!t.data("inited")){t.data("inited",!0),v.currentHost=v.currentHost||v.config.currentHost||"";for(var n,i=[],a=0;a'+v.getHostIcon(v.objects[v.tabs.hosts.list[a].id],"imgHost left")+v.tabs.hosts.list[a].name+""),v.currentHost||(v.currentHost=v.tabs.hosts.list[a].name),v.currentHost===v.tabs.hosts.list[a].name&&(n=v.tabs.hosts.list[a].id);t.html(i);var s=C("#host-adapters-btn").show();s.text(_("Host:")+" "+v.currentHost).dropdown(),v.objects[n]&&v.objects[n].common&&v.objects[n].common.color,s.append(C(v.getHostIcon(v.objects[n],"imgHost left"))),v.tabs.hosts.list.length<2?s.addClass("disabled"):s.removeClass("disabled"),t.find("a").on("click",function(){var e=C(this).data("value"),t="system.host."+e+".alive";v.states[t]&&v.states[t].val&&"null"!==v.states[t].val?(v.currentHost=e,C("#host-adapters-btn").text(_("Host:")+" "+v.currentHost).append(C(this).find(".imgHost").clone()),console.log(v.currentTab),T["tab-"+v.currentTab]&&T["tab-"+v.currentTab].host&&(v.tabs[v.currentTab]&&"function"==typeof v.tabs[v.currentTab].destroy&&v.tabs[v.currentTab].destroy(),v.tabs[v.currentTab]&&"function"==typeof v.tabs[v.currentTab].init&&v.tabs[v.currentTab].init()),v.saveConfig("currentHost",v.currentHost)):v.showMessage(_("Host %s is offline",C(this).val()))})}},v.resubscribeStates=function(){for(var e in v.subscribesStates)v.subscribesStates.hasOwnProperty(e)&&v.subscribesStates[e]&&(console.debug("Re-Subscribe: "+e),v.socket.emit("subscribe",e))},v.resubscribeObjects=function(){for(var e in v.subscribesObjects)v.subscribesObjects.hasOwnProperty(e)&&v.subscribesObjects[e]&&v.socket.emit("subscribeObjects",e)},v.resubscribeLogs=function(){v.subscribesLogs&&(console.debug("Subscribe LOG"),v.socket.emit("requireLog",!0))},v.subscribeStates=function(e){if(e)if("object"==typeof e)for(var t=0;tiframe");d.attr("src")&&(console.log("clear"),d.attr("src",""))}}if(v.currentTab=n,o.hide().appendTo("body"),i||(r.addClass("admin-sidemenu-body-content").show().appendTo(s),o=r),g[n]&&"function"==typeof g[n].init&&g[n].init(),r.length&&(c=r.data("src")))if(-1===c.indexOf("%")){var u=r.find(">iframe");u.length&&!u.attr("src")&&u.attr("src",c)}else f.data("problem-link","tab-"+n)}var m=f.find('.admin-sidemenu-items[data-tab="tab-'+n+'"]');f.find(".admin-sidemenu-items").not(m).removeClass("admin-sidemenu-active"),m.addClass("admin-sidemenu-active"),T["tab-"+n]&&T["tab-"+n].host?C("#host-adapters-btn").css("opacity",1):C("#host-adapters-btn").css("opacity",.3),document.title="云控2 - "+n,v.currentDialog!==i&&(v.dialogs[v.currentDialog]&&"function"==typeof v.dialogs[v.currentDialog].destroy&&v.dialogs[v.currentDialog].destroy(),(v.currentDialog=i)&&v.dialogs[i]?("function"==typeof v.dialogs[i].init&&v.dialogs[i].init(a?a.split(","):void 0),g[v.currentTab]&&g[v.currentTab].saveScroll&&g[v.currentTab].saveScroll(),o.hide().appendTo("body"),C("#dialog-"+i).addClass("admin-sidemenu-body-content").show().appendTo(s)):o.attr("id")!==r.attr("id")&&(o.hide().appendTo("body"),r.addClass("admin-sidemenu-body-content").show().appendTo(s),g[v.currentTab]&&g[v.currentTab].restoreScroll&&g[v.currentTab].restoreScroll()))}})},v.getIconFromObj=function(e,t,n){var i="",a="";if(e&&e.common)if(e.common.icon){var s=N(e);i=s.icon,a=s.alt}else t=t||"lib/css/fancytree/","device"===e.type?(i=t+"device.png",a="device"):"channel"===e.type?(i=t+"channel.png",a="channel"):"state"===e.type&&(i=t+"state.png",a="state");return i?''+(a||':""},v.getIcon=function(e,t,n,i){return v.getIconFromObj((n||v.objects)[e],t,i)},v.getHostIcon=function(e,t){var n="",i="";if(e&&e.common&&e.common.icon){var a=N(e);n=a.icon,i=a.alt}return''+(i=i||'},v.formatBytes=function(e){if(Math.abs(e)<1024)return e+" B";for(var t=["KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],n=-1;e/=1024,++n,1024<=Math.abs(e)&&n'+t.admin.styles+"")}}if(v.systemConfig&&v.systemConfig.common&&v.systemConfig.common.tabs){var i=v.systemConfig.common.tabs.indexOf("tab-log");-1!==i&&(v.systemConfig.common.tabs[i]="tab-logs")}v.socket.emit("getObject","system.repositories",function(e,t){v.dialogs.system.systemRepos=t,v.socket.emit("getObject","system.certificates",function(e,t){setTimeout(function(){if(v.dialogs.system.systemCerts=t,"permissionError"===a)v.systemConfig={common:{language:systemLang},error:"permissionError"};else if(!a&&v.systemConfig&&v.systemConfig.common){if(systemLang=v.systemConfig.common.language||systemLang,v.systemConfig.common.city=v.systemConfig.common.city||"",v.systemConfig.common.country=v.systemConfig.common.country||"",v.systemConfig.common.longitude=v.systemConfig.common.longitude||"",v.systemConfig.common.latitude=v.systemConfig.common.latitude||"",!v.systemConfig.common.licenseConfirmed){var n=(v.systemConfig.common.language||window.navigator.userLanguage||window.navigator.language||"").substring(0,2);"en"!==n&&(n="cn"),systemLang=n,d.find(".license_text").html(license[n]||license.en),d.find(".license_checkbox").prop("checked",!1),d.find(".license_language").data("licenseConfirmed",!1).val(n).on("change",function(){n=C(this).val(),d.find(".license_language_label").html(translateWord("Select language",n)),d.find(".license_text").html(license[n]||license.en),d.find(".license_checkbox").html(translateWord("license_checkbox",n)),d.find(".license_agree .translate").html(translateWord("agree",n)),d.find(".license_non_agree .translate").html(translateWord("not agree",n)),d.find(".license_terms").html(translateWord("License terms",n)),d.find(".license_agreement_label").html(translateWord("license agreement",n))}).select(),d.find(".license_diag").on("change",function(){C(this).prop("checked")?d.find(".license_agree").removeClass("disabled"):d.find(".license_agree").addClass("disabled")}),d.find('input[type="checkbox"]+span').off("click").on("click",function(){var e=C(this).prev();e.prop("disabled")||e.prop("checked",!e.prop("checked")).trigger("change")}),d.modal({dismissible:!1,complete:function(){d.find(".license_text").html(""),location.reload()}}).modal("open"),d.find(".license_agree").addClass("disabled").off("click").on("click",function(e){e.preventDefault(),e.stopPropagation(),v.socket.emit("getObject","system.config",function(e,t){!e&&t?(t.common=t.common||{},t.common.licenseConfirmed=!0,t.common.language=n,v.socket.emit("setObject","system.config",t,function(e){e&&v.showError(e),d.modal("close"),d.find(".license_agree").off("click"),d.find(".license_non_agree").off("click")})):v.showError(_("Cannot confirm: "+e))})}),d.find(".license_non_agree").off("click").on("click",function(e){location.reload()})}}else v.systemConfig={type:"config",common:{name:"system.config",city:"",country:"",longitude:"",latitude:"",language:"",tempUnit:"°C",currency:"",dateFormat:"DD.MM.YYYY",isFloatComma:!0,licenseConfirmed:!1,defaultHistory:"",tabs:["tab-intro","tab-adapters","tab-instances","tab-objects","tab-logs","tab-scenes","tab-javascript","tab-text2command-0"]}},v.systemConfig.common.language=window.navigator.userLanguage||window.navigator.language,"en"!==v.systemConfig.common.language&&(v.systemConfig.common.language="cn");for(var e in translateCron(),translateAll(),"function"==typeof initGridLanguage&&initGridLanguage(v.systemConfig.common.language),l.modal({dismissible:!1}),u.modal(),m.modal({dismissible:!1}),l.find(".progress-show-more").off("change").on("change",function(){var e=C(this).prop("checked");v.saveConfig("progressMore",e),e?l.find(".textarea").show():l.find(".textarea").hide()}),void 0===v.config.progressClose&&(v.config.progressClose=!0),l.find(".progress-dont-close input").on("change",function(){v.saveConfig("progressClose",C(this).prop("checked"))}),l.find('input[type="checkbox"]+span').off("click").on("click",function(){var e=C(this).prev();e.parent().parent().hasClass("switch")||e.prop("disabled")||e.prop("checked",!e.prop("checked")).trigger("change")}),l.find(".progress-dont-close input").prop("checked",v.config.progressClose),l.find(".progress-show-more").prop("checked",!!v.config.progressMore).trigger("change"),l.find(".btn").on("click",function(){l.data("finished")?p.find(".button-command").hide():p.find(".button-command").show()}),p.find(".button-command").on("click",function(){l.modal("open")}),g)g.hasOwnProperty(e)&&g[e]&&"function"==typeof g[e].prepare&&g[e].prepare();var i;i=L,g.states&&g.states.clear(),v.socket.emit("getStates",function(e,t){v.states=t,"function"==typeof i&&setTimeout(function(){i()},0)})},0)})})})})):(v.resubscribeStates(),v.resubscribeObjects(),v.resubscribeLogs()),v.waitForRestart&&location.reload()}),v.socket.on("disconnect",function(){C("#connecting").show()}),v.socket.on("reconnect",function(){C("#connecting").hide(),v.waitForRestart&&location.reload()}),v.socket.on("repoUpdated",function(){setTimeout(function(){g.adapters.init(!0)},0)}),v.socket.on("reauthenticate",function(){location.reload()})})}(jQuery);var license={en:'The MIT License (MIT)

    Copyright © 2014-2018 spacen

    Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
    The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
    ',cn:'The MIT License (MIT)

    Copyright © 2014-2018 spacen

    Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
    The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
    '},addAll2FilterCombobox=!1;function IobListHeader(e,h){if(!(this instanceof IobListHeader))return new IobListHeader(e,h);var f,a,p;void 0===h&&(h={}),void 0===h.colWidthOffset&&(h.colWidthOffset=0),"TABLE"===(p="object"==typeof e?$(e):$("#"+e))[0].tagName&&(p=p.find("tr:first")),e=p[0];var n,b=this;b.selectIdOffset=[],p.html(""),this.setList=function(e){var t;(t="string"==typeof e?("#"!==e[0]&&(e="#"+e),$(e)):e)&&t.length&&("TD"!==t[0].tagName&&"TH"!==t[0].tagName&&((t=t.find(">thead>tr:first>th,>thead>tr:first>td")).length||(t=e.find(">tbody>tr:first>th,>tr:first>th,>tbody>tr:first>td, >tr:first>td"))),a=t)},h.list&&this.setList(h.list),this.syncHeader=function(){if("object"==typeof a){var e=function(){a.each(function(e,t){if(!(e>=a.length-1)){var n=$(t).width(),i=b.selectIdOffset[e]||0;n+i&&$(f[e]).width(Math.round(n+i))}}),a.length&&!b.selectIdOffset.length&&(b.selectIdOffset[0]=0,a.each(function(e,t){var n=$(a[e]).offset().left;n&&(b.selectIdOffset[e]=n-$(f[e]).offset().left)}),e())};e()}},$(window).on("resize",function(e,t){n&&clearTimeout(n),n=setTimeout(b.syncHeader.bind(b),100)}),this.doFilter=function(){},b.ids=[],b.add=function(t,m,e,n){void 0===e&&(e=m);var i,a,s=!(i=e)||a&&"#"===i[0]?i:(h.prefix&&i.substr(0,h.prefix.length)!==h.prefix&&(i=h.prefix+"-"+i),(a?"#":"")+i);m=_(m);var o="";switch(t){case"combobox":o=' ';break;case"edit":o=' ';break;case"text":o=''+m+""}p.append(""+o+"");var r="#"+s,g=$(r),c=b[e]={$filter:g,val:g.val.bind(g),selectedVal:g.val()||""};if(b.ids.push(e),"combobox"===t&&(c.options=[],c.checkAddOption=function(e,t,n){if(-1===this.options.indexOf(e)){this.options.push(e),this.options.sort();for(var i,a,s=g.val(),o=n?"":(i=m,a=s,addAll2FilterCombobox&&(i=i?_(i)+" ("+_("all")+")":_("all")),'"),r=0,c=this.options.length;r"+t+""}},n))for(var l=0;lclose'),g.on("change",function(e){d&&clearTimeout(d),c.selectedVal=g.val(),d=setTimeout(b.doFilter,"combobox"!==t?400:0),c.selectedVal?g.parent().addClass("filter-active"):g.parent().removeClass("filter-active")}).on("keyup",function(e){13===e.which?b.doFilter():g.trigger("change")}),f=p.find(">th"),c}}function values2table(r,c,e){"object"==typeof r&&(e=c,c=r,r="");var l=e&&e.maxRaw||null,d=e&&e.onChange||null,u=e&&e.onReady||null;c=c||[];var o,s=[],m=(o=r?$("#"+r):$("body")).find(".table-button-add");if(m.data("raw",c.length),l&&m.data("maxRaw",l),m.data("inited")||(m.data("inited",!0),m.on("click",function(){if(!m.data("maxRaw")||m.data("raw")';for(var a=0;a';else if("select"===s[a].type.substring(0,6)){f+=("multiple"===s[a].type.substring(7,16)?'"}else f+='';if(g[a]){p="text-align: center; "+(g[a].style||"")+(g[a].tdstyle||"");for(var v=0;v':f+='';g[a].class&&(t+=' class="'+g[a].class+'" ')}p.length||b.length?t+=' style="'+p+b+'">'+f+"":t+=">"+f+""}t+=""}var w=h.find(".table-lines");w.length||(h.append(''),w=h.find(".table-lines")),w.html(t),w.find(".values-input").each(function(){var e=$(this),t=e.attr("type"),n=e.data("name"),i=e.data("index");e.data("old-value",c[i][n]),"checkbox"===t?e.prop("checked",c[i][n]):e.val(c[i][n])}),w.find("a[data-command]").each(function(){var e=$(this).data("command");"delete"===e?$(this).on("click",function(){var e=$(this).data("index"),t=c[e];c.splice(e,1),d&&d(),setTimeout(function(){"function"==typeof tableEvents&&tableEvents(e,t,"delete"),values2table(r,c,d,u,l)},100),m.data("maxRaw")&&m.data("raw",m.data("raw")-1)}).addClass("red").find(".material-icons").html("delete"):"up"===e?$(this).on("click",function(){var e=$(this).data("index"),t=c[e];c.splice(e,1),c.splice(e-1,0,t),d&&d(),setTimeout(function(){values2table(e,c,d,u,l)},100)}).find("i").html("arrow_upward"):"down"===e?$(this).on("click",function(){var e=$(this).data("index"),t=c[e];c.splice(e,1),c.splice(e+1,0,t),d&&d(),setTimeout(function(){values2table(e,c,d,u,l)},100)}).find("i").html("arrow_downward"):"pair"===e?$(this).on("click",function(){if("function"==typeof tableEvents){var e=$(this).data("index"),t=c[e];tableEvents(e,t,"pair")}}).attr("title",_("pair")).find("i").html("insert_link"):"unpair"===e&&$(this).on("click",function(){if("function"==typeof tableEvents){var e=$(this).data("index"),t=c[e];tableEvents(e,t,"unpair")}}).attr("title",_("unpair")).find("i").html("not_interested")}),w.find(".values-input").on("change.adaptersettings",function(){var e=$(this).data("index"),t=$(this).data("name");"checkbox"===$(this).attr("type")?($(this).prop("checked").toString()!==$(this).data("old-value")&&d&&d(t,e),c[e][t]=$(this).prop("checked")):($(this).val()!==$(this).data("old-value")&&d&&d(t,e),c[e][t]=$(this).val())}).on("keyup",function(){$(this).trigger("change.adaptersettings")})}"function"==typeof u&&u()}function table2values(e){var t;t=e?$("#"+e):$("body");var n=[];t.find(".table-values th").each(function(){var e=$(this).data("name");e?n.push(e):n.push("___ignore___")});var i=[],a=0;return t.find(".table-lines tr").each(function(){i[a]={},$(this).find("td").each(function(){var e=$(this).find("input");if(e.length){var t=e.data("name");"checkbox"===e.attr("type")?i[a][t]=e.prop("checked"):i[a][t]=e.val()}var n=$(this).find("select");if(n.length){t=n.data("name");i[a][t]=n.val()||""}}),a++}),i}var systemLang="en",systemDictionary={};function translateWord(e,t,n){if(!e)return"";if(t=t||systemLang,(n=n||systemDictionary)[e=e.toString()]){var i=n[e][t];if(i)return i;if("en"!==t&&(i=n[e].en))return i}else"string"!=typeof e||e.match(/_tooltip$/)?"string"!=typeof e&&console.warn("Trying to translate non-text:"+e):console.log('"'+e+'": {"en": "'+e+'", "cn": "'+e+'"},');return e}function translateAll(e,i,a){i=i||systemLang,a=a||systemDictionary,e||(e="body");var t=$(e);t.find(".translate").each(function(e){var t=$(this).attr("data-lang");t||(t=$(this).html(),$(this).attr("data-lang",t));var n=translateWord(t,i,a);n&&$(this).html(n)}),t.find(".translateV").each(function(e){var t=$(this).attr("data-lang-value");t||(t=$(this).attr("value"),$(this).attr("data-lang-value",t));var n=translateWord(t,i,a);n&&$(this).attr("value",n)}),t.find(".translateT").each(function(e){var t=$(this).attr("data-lang-title");t||(t=$(this).attr("title"),$(this).attr("data-lang-title",t));var n=translateWord(t,i,a);n&&$(this).attr("title",n)}),t.find(".translateP").each(function(e){var t=$(this).attr("data-lang-placeholder");t||(t=$(this).attr("placeholder"),$(this).attr("data-lang-placeholder",t));var n=translateWord(t,i,a);n&&$(this).attr("placeholder",n)})}function translateName(e){return e&&"object"==typeof e?e[systemLang]||e.en:e}var _=function(e,t,n,i){var a=(e=translateWord(e)).indexOf("%s");return-1===a||-1===(a=(e=e.replace("%s",t)).indexOf("%s"))||-1!==(a=(e=e.replace("%s",n)).indexOf("%s"))&&(e=e.replace("%s",i)),e};!function(X){if(!X.fn.treeTable){var t={init:function(e){e.imgPath=e.imgPath||"lib/css/fancytree/";for(var t=0;t';n+='
      ';for(var i=e.rows,a=0;a'+(d?"":'')+''+l+""}n+="
    ";var u=X(this),m=X(n);u.find(".treetablelist-buttons").remove(),u.find(".treetable-list").remove(),u.find(".tree-table-buttons").remove(),u.find(".tree-table-main").remove(),u.prepend(m);var g=X(m).find(".treetablelist-buttons"),h=X(m).find(".treetable-list");h.sortable({cancel:".treetable-list-folder",axis:"y"}).data("options",e);var f=this;g.find(".treetable-list-btn-ok").button({icons:{primary:"ui-icon-check"},text:!1}).css({width:24,height:24}).on("click",function(){var i="",a=[];h.find("li").each(function(){var e=X(this).data("id");if(X(this).hasClass("treetable-list-folder"))i=e;else{var t=e.split("."),n=t.pop();t.join(".")!==i&&a.push({oldId:e,newId:i+"."+n})}}),function t(n,i,a){if(i&&i.length){var e=i.shift();n.moveId&&n.moveId(e.oldId,e.newId,function(e){setTimeout(function(){t(n,i,a)},50)})}else a&&a()}(e,a,function(){p.call(f,e)})}),g.find(".treetable-list-btn-cancel").button({icons:{primary:"ui-icon-cancel"},text:!1}).css({width:24,height:24}).on("click",function(){p.call(f,e)})}function ne(e,t,n){var i="",a="",s=e&&e.common;if(s)if(s.icon){if(s.icon.match(/^data:image\//))i=s.icon;else{if(-1===s.icon.indexOf("."))return''+s.icon+"";var o;i="instance"===e.type?"/adapter/"+e.common.name+"/"+e.common.icon:e._id.match(/^system\.adapter\./)?(o=e._id.split(".",3),"/"===e.common.icon[0]?o[2]+=e.common.icon:o[2]+="/"+e.common.icon,"/adapter/"+o[2]):(o=e._id.split(".",2),"/"===e.common.icon[0]?o[0]+=e.common.icon:o[0]+="/"+e.common.icon,"/adapter/"+o[0])}a=e.type}else t=t||"lib/css/fancytree/","device"===e.type?(i=t+"device.png",a="device"):"channel"===e.type?(i=t+"channel.png",a="channel"):"state"===e.type&&(i=t+"state.png",a="state");return i?''+a+'':""}function p(i){var e="",t=window.M&&window.M.toast?"a":"button";if(i.panelButtons){e+='
    ';for(var n=0;n",window.M&&window.M.toast&&(e+=''+(i.panelButtons[n].icon||"")+""),e+="";i.moveId&&(e+="<"+t+' class="btn-floating waves-effect waves-light blue treetable-sort" title="'+_("reorder")+'">',window.M&&window.M.toast&&(e+='import_export'),e+=""),e+="
    "}e+='
    ',e+=" ",e+=' ';for(var a=0;a",e+=' ',e+=' ',e+=" "):e+=" "+_(i.columns[a])+"";i.buttons&&(e+=" "),e+=" ",e+="",e+="";var s=[],o=i.root?new RegExp("^"+i.root.replace(/\./g,"\\.")+"\\."):null,r=-1!==i.columns.indexOf("instance")?[]:null;for(var c in i.objects){var l;if(i.objects.hasOwnProperty(c))if(r&&"instance"===i.objects[c].type&&(l=c.match(/^system\.adapter\.javascript\.(\d+)$/))&&r.push(l[1]),!o||o.test(c)){var d=i.objects[c].common,u={id:c,parent:null,_class:"treetable-"+i.objects[c].type};"channel"===i.objects[c].type&&(u.folder=!0);for(var m=0;mt.id?1:e.id',s[z].children&&s[z].children.length&&(e+=''+s[z].children.length+"")):e+='"}if(i.buttons){e+='"}e+=""}e+="";var R=X(this),H=X(e);R.find("span:first-child").remove(),R.find(".treetablelist-buttons").remove(),R.find(".treetable-list").remove(),R.find(".tree-table-buttons").remove(),R.find(".tree-table-main").remove(),R.prepend(H),i.rows=s;var B=X(H[1]).find(">table"),G=X(H[0]);B.data("options",i),B.treetable({expandable:!0,clickableNodeNames:!0,expanderTemplate:"",indenterTemplate:'',onNodeExpand:q,onNodeCollapse:ee,stringCollapse:_("collapse"),stringExpand:_("expand")});var F=B.find("tbody");if(F.on("click","tr",function(){X(".selected").not(this).removeClass("selected"),X(this).addClass("selected");var e=X(this).parent().parent().data("options"),t=X(this).data("tt-id");e.onChange&&e.onChange(X(this).data("tt-id"),e.oldId),e.oldId=t}),i.buttons)for(var Z=0;Z"%s"?',en:'Are you sure to delete "%s"?'},'Are you sure to delete all children of %s?':{cn:'确定删除 %s 的全部子项?',en:'Are you sure to delete all children of %s?'},"Are you sure to delete all children of %s?":{cn:'你确定删除 "%s"全部的子项目?',en:'Are you sure to delete "%s" and all children?'},"Are you sure to delete script %s?":{cn:"你确定删除脚本 '%s'?",en:"Are you sure to delete script '%s'?"},"Are you sure you want to delete adapter %s?":{cn:"你确定删除适配器: %s?",en:"Are you sure you want to delete adapter %s?"},"Are you sure you want to delete the instance %s?":{cn:"你确定要删除这个实例: %s?",en:"Are you sure you want to delete the instance %s?"},"Are you sure?":{cn:"你确定吗?",en:"Are you sure?"},"Are you sure? Changes are not saved.":{cn:"数据没有保存,你确定啊吗?",en:"Are you sure? Changes are not saved."},Aug:{cn:"Aug",en:"Aug"},August:{cn:"August",en:"August"},Available:{cn:"可用的",en:"Available"},"Available version:":{cn:"最新版本",en:"Available version"},CPUs:{cn:"CPUs",en:"CPUs"},Calendar:{cn:"计划",en:"Calendar"},Cancel:{cn:"取消",en:"Cancel"},"Cannot create user: ":{cn:"不能创建用户: ",en:"Cannot create user: "},"Cannot delete user: ":{cn:"不能删除用户: ",en:"Cannot delete user: "},"Cannot disable admin!":{cn:"不能停用管理员!",en:"Cannot disable admin!"},"Cannot read file!":{cn:"无法读取文件!",en:"Cannot read file!"},"Cannot read version from NPM":{cn:"Could not read version from NPM",en:"Could not read version from NPM"},"Cannot set password: ":{cn:"不能设置密码: ",en:"Cannot set password: "},Certificates:{cn:"证书",en:"Certificates"},Change:{cn:"修改",en:"Change"},Changelog:{cn:"Change log",en:"Change log"},Channel:{cn:"Channel",en:"Channel"},Chart:{cn:"Chart",en:"Chart"},"Chart for %s":{cn:"Chart for %s",en:"Chart for %s"},"Check all":{cn:"检查所有",en:"Check all"},China:{cn:"中国",en:"China"},"City:":{cn:"城市",en:"City"},Clear:{cn:"清除",en:"Clear"},"Clear list":{cn:"清除",en:"Clear list"},"Clear log":{cn:"清除",en:"Clear log"},"Clear on disk permanent":{cn:"Clear on disk permanent",en:"Clear on disk permanent"},"Click do activate events again, or just wait one minute":{cn:"Click do activate events again, or just wait one minute",en:"Click do activate events again, or just wait one minute"},"Click on icon":{cn:"点击图标打开链接",en:"Click on icon to open a link"},Close:{cn:"关闭",en:"close"},"Collapse all nodes":{cn:"收起全部",en:"Collapse all nodes"},Color:{cn:"颜色",en:"Color"},"Configuration not saved.":{cn:"配置信息没有存储.",en:"Configuration not saved."},"Connected to %s: ":{cn:"Connected to %s: ",en:"Connected to %s: "},"Connected to host: ":{cn:"Connected to host: ",en:"Connected to host: "},"Copy log":{cn:"复制",en:"Copy log"},"Copy to clipboard":{cn:"拷贝",en:"Copy to clipboard"},"Country:":{cn:"国家/地区",en:"Country"},Create:{cn:"创建",en:"Create"},"Create new category":{cn:"新建分类",en:"Create new category"},"Create new category, like %s":{cn:"创建新的分类, like %s",en:"Create new category, like %s"},"Create new enum":{cn:"新建枚举",en:"Create new enum"},"Create new enum, like %s":{cn:"创建新的枚举, like %s",en:"Create new enum, like %s"},"Create new group":{cn:"新建群组",en:"Create new group"},"Create new user":{cn:"创建新用户",en:"Create new user"},Created:{cn:"Created",en:"Created"},Croatia:{cn:"Croatia",en:"Croatia"},"Cron expression":{cn:"Cron expression",en:"Cron expression"},"Currency:":{cn:"货币",en:"Currency"},Custom:{cn:"自定义",en:"Custom"},D$ecember:{cn:"D$ecember",en:"D$ecember"},"DD.MM.YY":{cn:"DD.MM.YY",en:"DD.MM.YY"},"DD.MM.YYYY":{cn:"DD.MM.YYYY",en:"DD.MM.YYYY"},"DD/MM/YYYY":{cn:"DD/MM/YYYY",en:"DD/MM/YYYY"},"Date From":{cn:"Date From",en:"Date From"},"Date To":{cn:"Date To",en:"Date To"},"Date format:":{cn:"时间格式",en:"Date format"},"Deactivated. Click to start.":{cn:"Deactivated. Click to start.",en:"Deactivated. Click to start."},"Debug outputs:":{cn:"调试输出",en:"Debug outputs"},Dec:{cn:"Dec",en:"Dec"},December:{cn:"December",en:"December"},"Default ACL":{cn:"缺省 ACL",en:"Default ACL"},"Default history instance:":{cn:"缺省的数据记录实例",en:"Default history instance"},"Delete attribute":{cn:"删除",en:"Delete attribute"},"Delete category":{cn:"删除",en:"Delete category"},"Delete enum":{cn:"删除",en:"Delete enum"},"Delete member":{cn:"删除",en:"Delete member"},"Delete object":{cn:"删除",en:"Delete object"},Denmark:{cn:"Denmark",en:"Denmark"},Description:{cn:"说明",en:"Description"},Device:{cn:"Device",en:"Device"},"Device discovery":{cn:"Device discovery",en:"Device discovery"},"Disk free":{cn:"磁盘空闲",en:"Disk free"},"Disk free:":{cn:"磁盘空闲:",en:"Disk free:"},"Disk size":{cn:"磁盘大小",en:"Disk size"},'Do you want to delete just one object or all children of %s too?':{cn:'Do you want to delete just one object or all children of %s too?',en:'Do you want to delete just one object or all children of %s too?'},"Do you want to upgrade all adapters?":{cn:"Do you want to upgrade all adapters?",en:"Do you want to upgrade all adapters?"},"Domains:":{cn:"Domains",en:"Domains"},Dominica:{cn:"Dominica",en:"Dominica"},"Done with error: %s":{cn:"Done with error: %s",en:"Done with error: %s"},"Download log":{cn:"下载",en:"Download log"},"Drop the files here":{cn:"拖放文件到这里",en:"Drop the files here"},"Drop the icons here":{cn:"拖放图标文件到这里",en:"Drop the icons here"},Ecuador:{cn:"Ecuador",en:"Ecuador"},Edit:{cn:"编辑",en:"Edit"},"Edit category":{cn:"编辑 category",en:"Edit category"},"Edit enum":{cn:"编辑 enum",en:"Edit enum"},"Edit in dialog":{cn:"编辑 in dialog",en:"Edit in dialog"},"Edit object":{cn:"编辑 object",en:"Edit object"},Egypt:{cn:"Egypt",en:"Egypt"},"El Salvador":{cn:"El Salvador",en:"El Salvador"},"Email for account:":{cn:"Email for account",en:"Email for account"},Enums:{cn:"枚举",en:"Enums"},Error:{cn:"错误",en:"Error"},Event:{cn:"类型",en:"Type"},Events:{cn:"事件",en:"Events"},Everyone:{cn:"Everyone",en:"Everyone"},"Expand all nodes":{cn:"Expand all nodes",en:"Expand all nodes"},"Failed to open JSON File":{cn:"Failed to open JSON file",en:"Failed to open JSON file"},"Falkland Islands (Malvinas)":{cn:"Falkland Islands (Malvinas)",en:"Falkland Islands (Malvinas)"},"Faroe Islands":{cn:"Faroe Islands",en:"Faroe Islands"},Feb:{cn:"Feb",en:"Feb"},February:{cn:"February",en:"February"},"File is too big!":{cn:"文件太大!",en:"File is too big!"},"File rights":{cn:"File rights",en:"File rights"},"Filter:":{cn:"查找",en:"Filter"},"Filtered out":{cn:"Everything is filtered out",en:"Everything is filtered out"},"Find coordinates...":{cn:"Find coordinates...",en:"Find coordinates..."},"Float divider:":{cn:"小数点",en:"Float divider"},"Free RAM:":{cn:"Free:",en:"Free:"},Fri:{cn:"Fri",en:"Fri"},From:{cn:"From: ",en:"From: "},"From github":{cn:"软件仓库",en:"From github"},Function:{cn:"Function",en:"Function"},"Generated ID:":{cn:"Generated ID",en:"Generated ID"},"Go to Github...":{cn:"Go to Github...",en:"Go to Github..."},Group:{cn:"用户组",en:"Group"},Groups:{cn:"用户组",en:"Groups"},"Has no permission to %s %s %s":{cn:"Has no permission to %s %s %s",en:"Has no permission to %s %s %s"},"Heard and Mc Donald Islands":{cn:"Heard and Mc Donald Islands",en:"Heard and Mc Donald Islands"},"Heartbeat: ":{cn:"心跳: ",en:"Heartbeat: "},"Hong Kong":{cn:"中国香港",en:"Hong Kong"},Host:{cn:"Host",en:"Host"},"Host %s is offline":{cn:"主机 %s 离线",en:"Host %s is offline"},"Host:":{cn:"Host",en:"Host"},Hosts:{cn:"Hosts",en:"Hosts"},ID:{cn:"ID",en:"ID"},"Icon upload":{cn:"上传图标",en:"Icon upload"},"In background":{cn:"后台运行",en:"In background"},Info:{cn:"信息",en:"Info"},Insert:{cn:"插入",en:"Insert"},Install:{cn:"操作",en:"Install"},"Install adapter from URL":{cn:"安装或升级",en:"Install or update the adapter from URL"},"Install adapter from github":{cn:"软件仓库安装或升级",en:"Install or update the adapter from Github"},"Install from custom URL":{cn:"自定义 URL 安装",en:"Install from custom URL"},"Install or update from URL...":{cn:"正在安装...",en:"Install or update from URL..."},"Installation counter":{cn:"Installations counter",en:"Installations counter"},"Installations counter":{cn:"Installations counter",en:"Installations counter"},Installed:{cn:"已安装",en:"Installed"},"Installed from group":{cn:"Installed from group",en:"Installed from group"},"Installed instances":{cn:"已安装的实例",en:"Installed instances"},"Installed version":{cn:"已安装版本",en:"Installed version"},Instances:{cn:"实例",en:"Instances"},Instructions:{cn:"指令",en:"Instructions"},Intro:{cn:"总览",en:"Overview"},"Invalid version of %s":{cn:"Invalid version of %s",en:"Invalid version of %s"},"Invalid version of %s. Required %s":{cn:"Invalid version of %s. Required %s",en:"Invalid version of %s. Required %s"},"Is yet in the list":{cn:"已经在列表中",en:"It's already in the list"},Jan:{cn:"Jan",en:"Jan"},January:{cn:"January",en:"January"},Jul:{cn:"七月",en:"Jul"},July:{cn:"July",en:"July"},Jun:{cn:"Jun",en:"Jun"},June:{cn:"June",en:"June"},"Known bugs for":{cn:"Known bugs for",en:"Known bugs for"},"Last changed":{cn:"上次修改",en:"Last changed"},"Last update":{cn:"上次更新",en:"Last update"},"Latitude:":{cn:"纬度",en:"Latitude"},"Let's Encrypt settings":{cn:"Let's Encrypt settings",en:"Let's Encrypt settings"},"Let's encrypt SSL":{cn:"Let's encrypt SSL",en:"Let's encrypt SSL"},License:{cn:"许可",en:"License"},"License terms":{cn:"许可条款",en:"License terms"},"Listen on all IPs":{cn:"Listen on all IPs",en:"Listen on all IPs"},"Loading...":{cn:"正在加载...",en:"Loading..."},Log:{cn:"日志",en:"Log"},"Log file will be deleted. Are you sure?":{cn:"日志文件将被删除,你确定吗?",en:"Log file will be deleted. Are you sure?"},"Log size:":{cn:"文件大小",en:"Log size"},"Login timeout(sec):":{cn:"登录超时 (秒)",en:"Login timeout (sec)"},Logout:{cn:"退出",en:"Logout"},"Longitude:":{cn:"经度",en:"Longitude"},MB:{cn:"Mb",en:"Mb"},Main:{cn:"Main",en:"Main"},"Main settings":{cn:"主设置",en:"Main settings"},"Manually created":{cn:"手工创建",en:"Manually created"},Mar:{cn:"三月",en:"Mar"},March:{cn:"三月",en:"March"},Members:{cn:"Members",en:"Members"},Message:{cn:"消息",en:"Message"},"Message buffer overflow. Losing oldest":{cn:"Message buffer overflow. Losing oldest.",en:"Message buffer overflow. Losing oldest."},Model:{cn:"型号",en:"Model"},Mon:{cn:"Mon",en:"Mon"},NPM:{cn:"NPM",en:"NPM"},Name:{cn:"名称",en:"Name"},"Name:":{cn:"名称",en:"Name"},New:{cn:"新建",en:"New"},"New category":{cn:"新类别",en:"New category"},"New enum":{cn:"新类别",en:"New enum"},"New group":{cn:"新群组",en:"New group"},"New object":{cn:"新对象",en:"New object"},"New objekt":{cn:"新对象",en:"New object"},"New user":{cn:"新用户",en:"New user"},"No data":{cn:"暂无数据",en:"No data"},"No states selected!":{cn:"No states selected!",en:"No states selected!"},"No version of %s":{cn:"No version of %s",en:"No version of %s"},"Node.js":{cn:"Node.js",en:"Node.js"},Norway:{cn:"Norway",en:"Norway"},"Not exists":{cn:"不存在",en:"Does not exist"},"Note:":{cn:"Note",en:"Note"},Nov:{cn:"十一月",en:"Nov"},November:{cn:"十一月",en:"November"},OS:{cn:"OS",en:"OS"},'Object "%s" does not exists. Update the page.':{cn:'Object "%s" 不存在,请刷新.',en:'Object "%s" does not exist. Update the page.'},"Object may not be deleted":{cn:"对象不能被删除",en:"Object may not be deleted"},"Object rights":{cn:"对象权限",en:"Object rights"},Objects:{cn:"对象",en:"Objects"},Oct:{cn:"十月",en:"Oct"},October:{cn:"十月",en:"October"},Ok:{cn:"确认",en:"Ok"},"Only one":{cn:"Only one",en:"Only one"},"Open original":{cn:"在新标签中打开",en:"Open on new tab"},Owner:{cn:"Owner",en:"Owner"},"Owner group":{cn:"Owner group",en:"Owner group"},"Owner user":{cn:"Owner user",en:"Owner user"},Parent:{cn:"父类",en:"Parent"},"Parse error":{cn:"Parse error",en:"Parse error"},Password:{cn:"密码",en:"Password"},"Password and confirmation are not equal!":{cn:"Password and confirmation are not equal!",en:"Password and confirmation are not equal!"},"Password cannot be empty!":{cn:"密码不能为空!",en:"Password cannot be empty!"},"Password repeat":{cn:"Password repeat",en:"Password repeat"},"Path to storage:":{cn:"存储路径",en:"Path to storage"},"Pause output":{cn:"暂停输出",en:"Pause output"},Platform:{cn:"平台",en:"Platform"},"Please confirm":{cn:"请确认",en:"Please confirm"},"Port to check the domain:":{cn:"Port to check the domain",en:"Port to check the domain"},"Preserve ID":{cn:"Preserve ID",en:"Preserve ID"},Preview:{cn:"Preview",en:"Preview"},"Processing...":{cn:"处理中...",en:"Processing..."},RAM:{cn:"内存",en:"RAM"},"RAM total usage:":{cn:"RAM总使用量:",en:"Total RAM usage:"},"RAM usage":{cn:"使用内存",en:"RAM usage"},"Rebuild tree":{cn:"重建树",en:"Rebuild tree"},"Recently updated":{cn:"Recently updated",en:"Recently updated"},"Refresh log":{cn:"刷新",en:"Refresh log"},Removed:{cn:"已删除",en:"Removed"},"Removing of adapter...":{cn:"Removing of adapter...",en:"Removing of adapter..."},"Removing of instance...":{cn:"Removing of instance...",en:"Removing of instance..."},Rename:{cn:"重命名",en:"Rename"},Repositories:{cn:"软件仓库",en:"Repositories"},Rights:{cn:"权限",en:"Access rights"},Role:{cn:"角色",en:"Role"},Room:{cn:"场景",en:"Room"},"Running: ":{cn:"Running: ",en:"Running: "},"Sao Tome and Principe":{cn:"Sao Tome and Principe",en:"Sao Tome and Principe"},Sat:{cn:"星期六",en:"Sat"},Save:{cn:"保存",en:"Save"},"Save Objecttree as JSON File":{cn:"将对象保存为 JSON 文件",en:"Save objects tree as JSON file"},"Save Objecttree is not possible":{cn:"Saving the objects tree is not possible",en:"Saving the objects tree is not possible"},"Save configuration":{cn:"保存配置",en:"Save configuration"},Script:{cn:"脚本",en:"Script"},Scripts:{cn:"脚本",en:"Scripts"},Select:{cn:"Select",en:"Select"},"Select ID":{cn:"Select ID",en:"Select ID"},"Select adapter:":{cn:"选择适配器",en:"Select adapter"},"Select language":{cn:"选择语言",en:"Select language"},"Select options":{cn:"选项",en:"Select options"},"Sent data:":{cn:"Sent data",en:"Sent data"},Sep:{cn:"九月",en:"Sep"},September:{cn:"九月",en:"September"},Set:{cn:"Set",en:"Set"},"Set CRON":{cn:"Set",en:"Set"},"Set CRON schedule for restarts":{cn:"Set CRON schedule for restarts",en:"Set CRON schedule for restarts"},Settings:{cn:"设置",en:"Settings"},"Settings for %s":{cn:"Settings for %s",en:"Settings for %s"},"Show instances only for current host":{cn:"Show instances only for current host",en:"Show instances only for current host"},"Show values of instance":{cn:"Show values of instance",en:"Show values of instance"},"Show...":{cn:"显示...",en:"Show..."},"Size: %s, Available: %s":{cn:"大小: %s, 可用: %s"},"Some data are not stored. Discard?":{cn:"有一些修改了的配置信息没有保存. 确认吗?",en:"Some data are not stored. Discard?"},"Sort alphabetically":{cn:"Sort alphabetically by name",en:"Sort alphabetically by name"},"Started...":{cn:"Started...",en:"Started..."},State:{cn:"Datapoint",en:"Datapoint"},"State type":{cn:"State type",en:"State type"},States:{cn:"状态",en:"States"},"States rights":{cn:"状态权限",en:"States rights"},Statistics:{cn:"统计",en:"Statistics"},"Statistics:":{cn:"统计",en:"Statistics"},"Storage of %s":{cn:'Storage of %s',en:'Storage of %s'},"Storage of %s states":{cn:'Storage of %s states',en:'Storage of %s states'},"Success!":{cn:"成功!",en:"Success!"},Suggestion:{cn:"推荐",en:"Recommendation"},Sun:{cn:"星期天",en:"Sun"},System:{cn:"系统",en:"System"},"System language:":{cn:"语言",en:"System language"},"System settings":{cn:"系统设置",en:"System settings"},"System uptime":{cn:"运行",en:"System uptime"},Table:{cn:"Table",en:"Table"},Taiwan:{cn:"中国台湾",en:"Taiwan"},"Temperature units:":{cn:"温度单位",en:"Temperature units"},'This version of node.js "%s" on "%s" is deprecated. Please install node.js 6, 8 or newer':{cn:'yunkong2 supports the LTS versions 6, 8, 10 or newer of node.js. Please update your version ("%s") on host "%s" to one of the supported versions. We recommend to use Node.js 6.',en:'yunkong2 supports the LTS versions 6, 8, 10 or newer of node.js. Please update your version ("%s") on host "%s" to one of the supported versions. We recommend to use Node.js 6.'},Thu:{cn:"Thu",en:"Thu"},Time:{cn:"Time",en:"Time"},"Time From":{cn:"Time From",en:"Time From"},"Time To":{cn:"Time To",en:"Time To"},"Time stamp":{cn:"Time stamp",en:"Time stamp"},Title:{cn:"标题",en:"Title"},To:{cn:"To",en:"To"},Today:{cn:"今日",en:"Today"},"Toggle expert mode":{cn:"切换模式",en:"Toggle expert mode"},"Toggle states view":{cn:"切换状态视图",en:"Toggle the states view"},"Too many events":{cn:"Too many events",en:"Too many events"},"Total count in group":{cn:"Total count in group",en:"Total count in group"},"Trigger event":{cn:"触发事件",en:"Trigger event"},Type:{cn:"Type",en:"Type"},"URL or file path:":{cn:"URL或安装包路径",en:"URL or file path"},"Unknown file format!":{cn:"文件格式无效!",en:"Unknown file format!"},"Unsupported image format":{cn:"不支持的格式",en:"Unsupported image format"},Update:{cn:"更新",en:"Update"},"Update objects":{cn:"更新",en:"Update objects"},"Update states":{cn:"更新",en:"Update states"},Updated:{cn:"已更新",en:"Updated"},"Upgrade all adapters":{cn:"升级所有适配器",en:"Upgrade all adapters"},Upload:{cn:"文件上传",en:"File upload"},"Upload admin started":{cn:"上传配置",en:"Upload of configuration is started"},"Upload started...":{cn:"上传开始...",en:"Upload started..."},Uptime:{cn:"Uptime",en:"Uptime"},Uruguay:{cn:"Uruguay",en:"Uruguay"},"Use Lets Encrypt certificates:":{cn:"Use Let's Encrypt certificates",en:"Use Let's Encrypt certificates"},"Use this instance for automatic update:":{cn:"Use this instance for automatic update",en:"Use this instance for automatic update"},User:{cn:"用户",en:"User"},"User deleted":{cn:"用户已删除",en:"User deleted"},"User does not exist":{cn:"这个用户不存在",en:"User does not exist"},"User yet exists":{cn:"这个用户已经存在",en:"User already exists"},Users:{cn:"用户",en:"Users"},Value:{cn:"Value",en:"Value"},"Values of %s":{cn:"Values of %s",en:"Values of %s"},"Vatican City State":{cn:"Vatican City State",en:"Vatican City State"},Wed:{cn:"Wed",en:"Wed"},With:{cn:"With",en:"With"},Without:{cn:"Without",en:"Without"},"You are going to add new instance: ":{cn:"添加新的实例: ",en:"You are going to add new instance: "},"You can check changelog here":{cn:'You can check the changelog here',en:'You can check the changelog here'},"You can drag&drop the devices, channels and states to enums":{cn:"可将 devices,channels,states 拖放到枚举区",en:"You can drag&drop the devices, channels and states to enums"},"You can drag&drop users to groups":{cn:"支持拖放用户",en:"You can drag&drop users to groups"},"You can't see events via cloud":{cn:"You can't see events via cloud",en:"You can't see events via cloud"},"Your home":{cn:"Your home",en:"Your home"},_All:{cn:"全部",en:"All"},"_Toggle expert mode":{cn:"切换模式",en:"Toggle expert mode"},__different__:{cn:"different",en:"different"},"a-z":{cn:"a-z",en:"a-z"},ack:{cn:"ack",en:"ack"},actions:{cn:"actions",en:"actions"},active:{cn:"active",en:"active"},"adapter with updates":{cn:"adapters with updates",en:"adapters with updates"},"adapters count":{cn:"适配器数",en:"adapters count"},add:{cn:"添加",en:"Add"},"add children":{cn:"添加子节点",en:"add children"},"add instance":{cn:"添加实例",en:"add instance"},"add repository":{cn:"添加仓库",en:"add repository"},agree:{cn:"同意",en:"agree"},alarm_group:{cn:"Alarm",en:"Alarm"},alive:{cn:"alive",en:"alive"},all:{cn:"all",en:"all"},alpha:{cn:"alpha",en:"alpha"},array:{cn:"array",en:"array"},auto:{cn:"auto",en:"auto"},available:{cn:"最新",en:"available"},beta:{cn:"beta",en:"beta"},boolean:{cn:"boolean",en:"boolean"},bug:{cn:"bugtracker",en:"bugtracker"},cancel:{cn:"取消",en:"Cancel"},cert_path_note:{cn:"例如 '/opt/certs/cert.pem', 也可以直接拖放文件",en:"You can use an absolute path to the certificate, like '/opt/certs/cert.pem', or just upload it per drag&drop"},certificate:{cn:"certificate",en:"certificate"},"change view mode":{cn:"模式",en:"change view mode"},channel:{cn:"channel",en:"channel"},clear:{cn:"清除",en:"clear"},"climate-control_group":{cn:"Climate Control",en:"Climate Control"},"close on ready":{cn:"完成后自动关闭",en:"close on ready"},collapse:{cn:"收起",en:"collapse"},"collapse all":{cn:"收起",en:"collapse all"},comma:{cn:"comma",en:"comma"},"command execution":{cn:"执行命令 ",en:"Command execution"},common:{cn:"公共",en:"common"},"common adapters_group":{cn:"公共",en:"Common"},common_color:{cn:"颜色",en:"color"},common_def:{cn:"缺省值",en:"default value"},common_desc:{cn:"说明",en:"description"},common_icon:{cn:"图标",en:"icon"},common_max:{cn:"最大值",en:"max value"},common_min:{cn:"最小值",en:"minimal value"},common_read:{cn:"允许读",en:"read allowed"},common_role:{cn:"角色",en:"role"},common_states:{cn:"预定义值",en:"predefined values"},common_type:{cn:"类型",en:"type"},common_unit:{cn:"量度单位",en:"measure unit"},common_write:{cn:"允许写",en:"write allowed"},communication_group:{cn:"通信",en:"Communication"},config:{cn:"设置",en:"Settings"},"config instance":{cn:"配置实例",en:"config instance"},"confirm password":{cn:"密码确认",en:"Confirm password"},connected:{cn:"已连接",en:"connected"},copy:{cn:"复制",en:"copy"},"copy note":{cn:"Press Ctrl+A and Ctrl+C to copy the log to the clipboard and click with the mouse anywhere to close.",en:"Press Ctrl+A and Ctrl+C to copy the log to the clipboard and click with the mouse anywhere to close."},"create operation":{cn:"创建",en:"create"},"custom enum":{cn:"自定义枚举",en:"?ustom enum"},"custom group":{cn:"自定义群组",en:"Custom group"},daemon:{cn:"daemon",en:"daemon"},"date-and-time_group":{cn:"日期和时间",en:"Date and Time"},daysShortText:{cn:"d.",en:"d."},debug:{cn:"debug",en:"debug"},delete:{cn:"删除",en:"delete"},"delete adapter":{cn:"删除",en:"delete adapter"},"delete group":{cn:"删除",en:"delete group"},"delete instance":{cn:"删除",en:"delete instance"},"delete operation":{cn:"删除",en:"delete"},"delete script":{cn:"删除",en:"delete script"},"delete user":{cn:"删除",en:"delete user"},desc:{cn:"desc",en:"desc"},description:{cn:"说明",en:"Description"},device:{cn:"device",en:"device"},"diag-note":{cn:"We worked hard to create this project. In return we expect from you some usage statistics.
    Every time the adapter list is updated, the anonymized statistics are sent. We respect your privacy, so no private information will be transmitted.
    Thank you!",en:"We worked hard to create this project. In return we expect from you some usage statistics.
    Every time the adapter list is updated, the anonymized statistics are sent. We respect your privacy, so no private information will be transmitted.
    Thank you!"},edit:{cn:"编辑",en:"edit"},"edit enum":{cn:"编辑",en:"edit enum"},"edit file":{cn:"编辑",en:"edit file"},"edit group":{cn:"编辑",en:"edit group"},"edit instance":{cn:"编辑",en:"edit instance"},"edit script":{cn:"编辑",en:"edit script"},"edit user":{cn:"修改",en:"edit user"},"edit value":{cn:"编辑",en:"Edit value"},enabled:{cn:"enabled",en:"enabled"},energy_group:{cn:"能源",en:"Energy"},engine:{cn:"engine",en:"engine"},"engine type":{cn:"engine type",en:"engine type"},error:{cn:"错误",en:"error"},events:{cn:"events",en:"events"},"execute operation":{cn:"Execute operation",en:"Execute operation"},expand:{cn:"展开",en:"expand"},"expand all":{cn:"展开所有",en:"expand all"},extended:{cn:"extended",en:"extended"},false:{cn:"false",en:"false"},"file permissions":{cn:"文件许可",en:"File permissions"},from:{cn:"来自",en:"from"},garden_group:{cn:"农业",en:"Garden"},general_group:{cn:"基本",en:"General"},geoposition_group:{cn:"地理位置",en:"Geo position"},groups:{cn:"groups",en:"groups"},hardware_group:{cn:"硬件",en:"Hardware"},history:{cn:"数据",en:"history"},"history data":{cn:"数据",en:"history data"},host:{cn:"主机",en:"host"},household_group:{cn:"Household",en:"Household"},"http operation":{cn:"http",en:"http"},id:{cn:"ID",en:"ID"},info:{cn:"信息",en:"info"},infrastructure_group:{cn:"环境",en:"Infrastructure"},install:{cn:"安装",en:"install"},"install specific version":{cn:"安装指定版本",en:"Install a specific version"},installed:{cn:"已安装",en:"installed"},"installed adapters":{cn:"Filter adapters with existing instances",en:"Filter adapters with existing instances"},instance:{cn:"实例",en:"instance"},"instance number":{cn:"Desired instance number",en:"Desired instance number"},"yunkong2 Enums":{cn:"yunkong2 enums",en:"yunkong2 enums"},"yunkong2 States":{cn:"yunkong2 states",en:"yunkong2 states"},"yunkong2 adapter instances":{cn:"yunkong2 adapter instances",en:"yunkong2 adapter instances"},"yunkong2 adapter scripts":{cn:"yunkong2 adapter scripts",en:"yunkong2 adapter scripts"},"yunkong2 adapters":{cn:"yunkong2 adapters",en:"yunkong2 adapters"},"yunkong2 certificates":{cn:"yunkong2 certificates",en:"yunkong2 certificates"},"yunkong2 groups":{cn:"yunkong2 groups",en:"yunkong2 groups"},"yunkong2 hosts":{cn:"yunkong2 hosts",en:"yunkong2 hosts"},"yunkong2 repositories":{cn:"yunkong2 repositories",en:"yunkong2 repositories"},"yunkong2 users":{cn:"yunkong2 users",en:"yunkong2 users"},"iot-system_group":{cn:"物联网",en:"IoT systems"},"iot-systems_group":{cn:"物联网系统",en:"IoT Systems"},keywords:{cn:"关键字",en:"keywords"},lc:{cn:"Last change",en:"Last change"},less:{cn:"精简",en:"less"},letsnecrypt_help:{cn:'This are settings for Let\'s Encrypt account. To get the free certificates for your domain. You can read more here.',en:'This are settings for Let\'s Encrypt account. To get the free certificates for your domain. You can read more here.'},letsnecrypt_help_domains:{cn:"E.g: 'example.com, www.example.com'",en:"E.g: 'example.com, www.example.com'"},letsnecrypt_help_email:{cn:"Please use your email address. It will be used for your account.",en:"Please use your email address. It will be used for your account."},letsnecrypt_help_path:{cn:"Directory name where the certificates will be stored. This is always relative to configuration directory",en:"Directory name where the certificates will be stored. This is always relative to configuration directory"},license:{cn:"许可",en:"license"},"license agreement":{cn:"许可协议",en:"license agreement"},"license not agree":{cn:"不同意!",en:"Do not agree with the license!"},license_checkbox:{cn:"同意全部的许可条款",en:"I agree with the collection of anonymous statistics.
    (This can be disabled in settings)"},lighting_group:{cn:"照明",en:"Lighting"},link:{cn:"link",en:"link"},list:{cn:"list",en:"list"},"list operation":{cn:"list elements",en:"list elements"},logic_group:{cn:"逻辑",en:"Logic"},loglevel:{cn:"loglevel",en:"loglevel"},media_group:{cn:"媒体",en:"Media"},members:{cn:"members",en:"members"},memlimit:{cn:"RAM limit",en:"RAM limit"},message:{cn:"消息",en:"message"},messaging_group:{cn:"信使",en:"Messaging"},"misc-data_group":{cn:"Misc. data",en:"Misc. data"},mixed:{cn:"mixed",en:"mixed"},mode:{cn:"mode",en:"mode"},more:{cn:"详细",en:"more"},multi:{cn:"multistate",en:"multistate"},multimedia_group:{cn:"多媒体",en:"Multimedia"},name:{cn:"名称",en:"name"},native:{cn:"native",en:"native"},network_group:{cn:"网络",en:"Network"},"new certificate":{cn:"new certificate",en:"new certificate"},"new group":{cn:"new group",en:"new group"},"new script":{cn:"new script",en:"new script"},"new user":{cn:"新建用户",en:"new user"},newObject:{cn:"New object",en:"New object"},"no-city":{cn:"no city",en:"no city"},"node-red":{cn:"node-red",en:"node-red"},none:{cn:"none",en:"none"},normal:{cn:"normal",en:"normal"},"not ack":{cn:"not ack",en:"not ack"},"not agree":{cn:"不同意",en:"not agree"},"npm error":{cn:"npm error",en:"npm error"},number:{cn:"number",en:"number"},object:{cn:"object",en:"object"},"object permissions":{cn:"Object permissions",en:"Object permissions"},of:{cn:"/",en:"of"},ok:{cn:"确定",en:"Ok"},"open web page":{cn:"Open web page of adapter",en:"Open web page of adapter"},os:{cn:"OS",en:"operating system"},"other permissions":{cn:"Other permissions",en:"Other permissions"},"parent name":{cn:"parent name",en:"parent name"},password:{cn:"密码",en:"Password"},permissionError:{cn:"Permission error",en:"Permission error"},planned:{cn:"planned",en:"planned"},platform:{cn:"平台",en:"platform"},point:{cn:"point",en:"point"},process:{cn:"process",en:"process"},protocols_group:{cn:"协议",en:"Protocols"},raw:{cn:"Raw (开发)",en:"Raw (experts only)"},read:{cn:"read",en:"read"},"read operation":{cn:"read",en:"read"},readme:{cn:"readme",en:"readme"},reload:{cn:"刷新",en:"reload"},"reload instance":{cn:"reload instance",en:"reload instance"},rest:{cn:"REST (read only)",en:"rest (read only)"},restart:{cn:"重启",en:"auto restart"},"restart script":{cn:"重启脚本",en:"restart script"},role:{cn:"角色",en:"role"},save:{cn:"保存",en:"save"},schedule_group:{cn:"计划",en:"Schedule"},script_group:{cn:"逻辑和脚本",en:"Scripts and Logic"},"select member by double click":{cn:"select member by double clicking",en:"select member by double clicking"},"sendto operation":{cn:"Send-to operation",en:"Send-to operation"},service_group:{cn:"Maintenance",en:"Maintenance"},severity:{cn:"安防",en:"severity"},stable:{cn:"stable",en:"stable"},state:{cn:"state",en:"state"},"state permissions":{cn:"状态许可",en:"State permissions"},storage_group:{cn:"存储",en:"Storage"},string:{cn:"string",en:"string"},subscribe:{cn:"subscribe",en:"subscribe"},switch:{cn:"switch",en:"switch"},terminal:{cn:"Terminal",en:"Terminal"},"third-party_group":{cn:"第三方",en:"Third party"},"this adapter does not allow multiple instances":{cn:"这个适配器不允许运行多个实例",en:"This adapter does not allow multiple instances"},title:{cn:"标题",en:"title"},today:{cn:"今日",en:"today"},true:{cn:"true",en:"true"},ts:{cn:"时间",en:"Timestamp"},type:{cn:"type",en:"type"},unit:{cn:"unit",en:"unit"},update:{cn:"更新",en:"update"},"update adapter information":{cn:"update adapter information",en:"update adapter information"},"update-part1":{cn:"Because yunkong2 runs on many very different platforms, only manual updating is possible at the moment. To start the manual update, please go to your controller via console and execute the following:",en:"Because yunkong2 runs on many very different platforms, only manual updating is possible at the moment. To start the manual update, please go to your controller via console and execute the following:"},updated:{cn:"已更新",en:"updated"},updates:{cn:"updates",en:"updates"},upload:{cn:"上传",en:"Upload"},"user permissions":{cn:"用户权限",en:"user permissions"},users:{cn:"用户",en:"users"},"users permissions":{cn:"用户权限",en:"User permissions"},utility_group:{cn:"公用",en:"Utility"},val:{cn:"val",en:"val"},value:{cn:"value",en:"value"},"value.from":{cn:"Changed from",en:"Changed from"},"value.lc":{cn:"Last change",en:"Last change"},"value.q":{cn:"Quality code",en:"Quality code"},"value.ts":{cn:"Timestamp",en:"Timestamp"},"value.val":{cn:"value",en:"value"},version:{cn:"版本",en:"version"},vis_group:{cn:"yunkong2.vis",en:"yunkong2.vis"},visualisation_group:{cn:"可视化",en:"Visualisation"},"visualization-icons_group":{cn:"可视化 图标",en:"Visualization Icons"},"visualization-widgets_group":{cn:"可视化 部件",en:"Visualization Widgets"},visualization_group:{cn:"可视化",en:"Visualisation"},warn:{cn:"warn",en:"warn"},weather_group:{cn:"天气",en:"Weather"},wetty:{cn:"Wetty",en:"Wetty"},write:{cn:"write",en:"write"},"write operation":{cn:"write",en:"write"},yesterday:{cn:"昨天",en:"yesterday"},Speed:{cn:"主频",en:"Speed"},"%s object(s) processed":{cn:"%s objects were processed",en:"%s objects were processed"},"%s was imported":{cn:"%s was imported",en:"%s was imported"},"Ignore warning":{cn:"Ignore warning",en:"Ignore warning"},Filter:{cn:"查找",en:"Filter"},Afghanistan:{cn:"Afghanistan",en:"Afghanistan"},Albania:{cn:"Albania",en:"Albania"},Algeria:{cn:"Algeria",en:"Algeria"},"American Samoa":{cn:"American Samoa",en:"American Samoa"},Andorra:{cn:"Andorra",en:"Andorra"},Angola:{cn:"Angola",en:"Angola"},Anguilla:{cn:"Anguilla",en:"Anguilla"},Antarctica:{cn:"Antarctica",en:"Antarctica"},"Antigua and Barbuda":{cn:"Antigua and Barbuda",en:"Antigua and Barbuda"},Argentina:{cn:"Argentina",en:"Argentina"},Armenia:{cn:"Armenia",en:"Armenia"},Aruba:{cn:"Aruba",en:"Aruba"},Australia:{cn:"Australia",en:"Australia"},Austria:{cn:"Austria",en:"Austria"},"Authentication was deactivated":{cn:"Authentication was deactivated",en:"Authentication was deactivated"},Azerbaijan:{cn:"Azerbaijan",en:"Azerbaijan"},Background:{cn:"Background",en:"Background"},"Background color of the login screen":{cn:"Background color of the login screen",en:"Background color of the login screen"},"Background image":{cn:"Background image",en:"Background image"},Bahamas:{cn:"Bahamas",en:"Bahamas"},Bahrain:{cn:"Bahrain",en:"Bahrain"},Bangladesh:{cn:"Bangladesh",en:"Bangladesh"},Barbados:{cn:"Barbados",en:"Barbados"},Belarus:{cn:"Belarus",en:"Belarus"},Belgium:{cn:"Belgium",en:"Belgium"},Belize:{cn:"Belize",en:"Belize"},Benin:{cn:"Benin",en:"Benin"},Bermuda:{cn:"Bermuda",en:"Bermuda"},Bhutan:{cn:"Bhutan",en:"Bhutan"},Bolivia:{cn:"Bolivia",en:"Bolivia"},"Bosnia and Herzegovina":{cn:"Bosnia and Herzegovina",en:"Bosnia and Herzegovina"},Botswana:{cn:"Botswana",en:"Botswana"},"Bouvet Island":{cn:"Bouvet Island",en:"Bouvet Island"},Brazil:{cn:"Brazil",en:"Brazil"},"British Indian Ocean Territory":{cn:"British Indian Ocean Territory",en:"British Indian Ocean Territory"},"Brunei Darussalam":{cn:"Brunei Darussalam",en:"Brunei Darussalam"},Bulgaria:{cn:"Bulgaria",en:"Bulgaria"},"Burkina Faso":{cn:"Burkina Faso",en:"Burkina Faso"},Burundi:{cn:"Burundi",en:"Burundi"},Cambodia:{cn:"Cambodia",en:"Cambodia"},Cameroon:{cn:"Cameroon",en:"Cameroon"},Canada:{cn:"Canada",en:"Canada"},"Cape Verde":{cn:"Cape Verde",en:"Cape Verde"},"Cayman Islands":{cn:"Cayman Islands",en:"Cayman Islands"},"Central African Republic":{cn:"Central African Republic",en:"Central African Republic"},Chad:{cn:"Chad",en:"Chad"},Chile:{cn:"Chile",en:"Chile"},"Christmas Island":{cn:"Christmas Island",en:"Christmas Island"},"Cocos Islands":{cn:"Cocos Islands",en:"Cocos Islands"},Colombia:{cn:"Colombia",en:"Colombia"},Comoros:{cn:"Comoros",en:"Comoros"},Congo:{cn:"Congo",en:"Congo"},"Cook Islands":{cn:"Cook Islands",en:"Cook Islands"},"Costa Rica":{cn:"Costa Rica",en:"Costa Rica"},Cuba:{cn:"Cuba",en:"Cuba"},Cyprus:{cn:"Cyprus",en:"Cyprus"},"Czech Republic":{cn:"Czech Republic",en:"Czech Republic"},"Disable authentication":{cn:"Disable authentication",en:"Disable authentication"},Djibouti:{cn:"Djibouti",en:"Djibouti"},"Dominican Republic":{cn:"Dominican Republic",en:"Dominican Republic"},"East Timor":{cn:"East Timor",en:"East Timor"},"Enabled:":{cn:"Enabled",en:"Enabled"},"Equatorial Guinea":{cn:"Equatorial Guinea",en:"Equatorial Guinea"},Eritrea:{cn:"Eritrea",en:"Eritrea"},Estonia:{cn:"Estonia",en:"Estonia"},Ethiopia:{cn:"Ethiopia",en:"Ethiopia"},Fiji:{cn:"Fiji",en:"Fiji"},Finland:{cn:"Finland",en:"Finland"},France:{cn:"France",en:"France"},"French Guiana":{cn:"French Guiana",en:"French Guiana"},"French Polynesia":{cn:"French Polynesia",en:"French Polynesia"},"French Southern Territories":{cn:"French Southern Territories",en:"French Southern Territories"},Gabon:{cn:"Gabon",en:"Gabon"},Gambia:{cn:"Gambia",en:"Gambia"},Georgia:{cn:"Georgia",en:"Georgia"},Germany:{cn:"Germany",en:"Germany"},Ghana:{cn:"Ghana",en:"Ghana"},Gibraltar:{cn:"Gibraltar",en:"Gibraltar"},Greece:{cn:"Greece",en:"Greece"},Greenland:{cn:"Greenland",en:"Greenland"},Grenada:{cn:"Grenada",en:"Grenada"},Guadeloupe:{cn:"Guadeloupe",en:"Guadeloupe"},Guam:{cn:"Guam",en:"Guam"},Guatemala:{cn:"Guatemala",en:"Guatemala"},Guernsey:{cn:"Guernsey",en:"Guernsey"},Guinea:{cn:"Guinea",en:"Guinea"},"Guinea-Bissau":{cn:"Guinea-Bissau",en:"Guinea-Bissau"},Guyana:{cn:"Guyana",en:"Guyana"},Haiti:{cn:"Haiti",en:"Haiti"},Honduras:{cn:"Honduras",en:"Honduras"},Hungary:{cn:"Hungary",en:"Hungary"},Iceland:{cn:"Iceland",en:"Iceland"},India:{cn:"India",en:"India"},Indonesia:{cn:"Indonesia",en:"Indonesia"},Iran:{cn:"Iran",en:"Iran"},Iraq:{cn:"Iraq",en:"Iraq"},Ireland:{cn:"Ireland",en:"Ireland"},"Isle of Man":{cn:"Isle of Man",en:"Isle of Man"},Israel:{cn:"Israel",en:"Israel"},Italy:{cn:"Italy",en:"Italy"},"Ivory Coast":{cn:"Ivory Coast",en:"Ivory Coast"},Jamaica:{cn:"Jamaica",en:"Jamaica"},Japan:{cn:"Japan",en:"Japan"},Jersey:{cn:"Jersey",en:"Jersey"},Jordan:{cn:"Jordan",en:"Jordan"},Kazakhstan:{cn:"Kazakhstan",en:"Kazakhstan"},Kenya:{cn:"Kenya",en:"Kenya"},Kiribati:{cn:"Kiribati",en:"Kiribati"},Korea:{cn:"Korea",en:"Korea"},Kosovo:{cn:"Kosovo",en:"Kosovo"},Kuwait:{cn:"Kuwait",en:"Kuwait"},Kyrgyzstan:{cn:"Kyrgyzstan",en:"Kyrgyzstan"},"Lao People's Democratic Republic":{cn:"Lao People's Democratic Republic",en:"Lao People's Democratic Republic"},Latvia:{cn:"Latvia",en:"Latvia"},Lebanon:{cn:"Lebanon",en:"Lebanon"},Lesotho:{cn:"Lesotho",en:"Lesotho"},Liberia:{cn:"Liberia",en:"Liberia"},"Libyan Arab Jamahiriya":{cn:"Libyan Arab Jamahiriya",en:"Libyan Arab Jamahiriya"},Liechtenstein:{cn:"Liechtenstein",en:"Liechtenstein"},Lithuania:{cn:"Lithuania",en:"Lithuania"},Luxembourg:{cn:"Luxembourg",en:"Luxembourg"},Macau:{cn:"Macau",en:"Macau"},Macedonia:{cn:"Macedonia",en:"Macedonia"},Madagascar:{cn:"Madagascar",en:"Madagascar"},Mai:{cn:"Mai",en:"Mai"},Malawi:{cn:"Malawi",en:"Malawi"},Malaysia:{cn:"Malaysia",en:"Malaysia"},Maldives:{cn:"Maldives",en:"Maldives"},Mali:{cn:"Mali",en:"Mali"},Malta:{cn:"Malta",en:"Malta"},"Marshall Islands":{cn:"Marshall Islands",en:"Marshall Islands"},Martinique:{cn:"Martinique",en:"Martinique"},Mauritania:{cn:"Mauritania",en:"Mauritania"},Mauritius:{cn:"Mauritius",en:"Mauritius"},Mayotte:{cn:"Mayotte",en:"Mayotte"},Mexico:{cn:"Mexico",en:"Mexico"},Micronesia:{cn:"Micronesia",en:"Micronesia"},Moldova:{cn:"Moldova",en:"Moldova"},Monaco:{cn:"Monaco",en:"Monaco"},Mongolia:{cn:"Mongolia",en:"Mongolia"},Montenegro:{cn:"Montenegro",en:"Montenegro"},Montserrat:{cn:"Montserrat",en:"Montserrat"},Morocco:{cn:"Morocco",en:"Morocco"},Mozambique:{cn:"Mozambique",en:"Mozambique"},Myanmar:{cn:"Myanmar",en:"Myanmar"},Namibia:{cn:"Namibia",en:"Namibia"},Nauru:{cn:"Nauru",en:"Nauru"},Nepal:{cn:"Nepal",en:"Nepal"},Netherlands:{cn:"Netherlands",en:"Netherlands"},"Netherlands Antilles":{cn:"Netherlands Antilles",en:"Netherlands Antilles"},"New Caledonia":{cn:"New Caledonia",en:"New Caledonia"},"New Zealand":{cn:"New Zealand",en:"New Zealand"},Nicaragua:{cn:"Nicaragua",en:"Nicaragua"},Niger:{cn:"Niger",en:"Niger"},Nigeria:{cn:"Nigeria",en:"Nigeria"},Niue:{cn:"Niue",en:"Niue"},"Norfolk Island":{cn:"Norfolk Island",en:"Norfolk Island"},"Northern Mariana Islands":{cn:"Northern Mariana Islands",en:"Northern Mariana Islands"},Oman:{cn:"Oman",en:"Oman"},Pakistan:{cn:"Pakistan",en:"Pakistan"},Palau:{cn:"Palau",en:"Palau"},Palestine:{cn:"Palestine",en:"Palestine"},Panama:{cn:"Panama",en:"Panama"},"Papua New Guinea":{cn:"Papua New Guinea",en:"Papua New Guinea"},Paraguay:{cn:"Paraguay",en:"Paraguay"},Peru:{cn:"Peru",en:"Peru"},Philippines:{cn:"Philippines",en:"Philippines"},Pitcairn:{cn:"Pitcairn",en:"Pitcairn"},Poland:{cn:"Poland",en:"Poland"},Popular:{cn:"Popular",en:"Popular"},"Popular first":{cn:"Popular first",en:"Popular first"},Portugal:{cn:"Portugal",en:"Portugal"},"Puerto Rico":{cn:"Puerto Rico",en:"Puerto Rico"},Qatar:{cn:"Qatar",en:"Qatar"},Reunion:{cn:"Reunion",en:"Reunion"},Romania:{cn:"Romania",en:"Romania"},"Russian Federation":{cn:"Russian Federation",en:"Russian Federation"},Rwanda:{cn:"Rwanda",en:"Rwanda"},"Saint Kitts and Nevis":{cn:"Saint Kitts and Nevis",en:"Saint Kitts and Nevis"},"Saint Lucia":{cn:"Saint Lucia",en:"Saint Lucia"},"Saint Vincent and the Grenadines":{cn:"Saint Vincent and the Grenadines",en:"Saint Vincent and the Grenadines"},Samoa:{cn:"Samoa",en:"Samoa"},"San Marino":{cn:"San Marino",en:"San Marino"},"Saudi Arabia":{cn:"Saudi Arabia",en:"Saudi Arabia"},Senegal:{cn:"Senegal",en:"Senegal"},Serbia:{cn:"Serbia",en:"Serbia"},Slovakia:{cn:"Slovakia",en:"Slovakia"},Slovenia:{cn:"Slovenia",en:"Slovenia"},"Solomon Islands":{cn:"Solomon Islands",en:"Solomon Islands"},Somalia:{cn:"Somalia",en:"Somalia"},"South Africa":{cn:"South Africa",en:"South Africa"},"South Georgia South Sandwich Islands":{cn:"South Georgia South Sandwich Islands",en:"South Georgia South Sandwich Islands"},Spain:{cn:"Spain",en:"Spain"},"Sri Lanka":{cn:"Sri Lanka",en:"Sri Lanka"},"St. Helena":{cn:"St. Helena",en:"St. Helena"},"St. Pierre and Miquelon":{cn:"St. Pierre and Miquelon",en:"St. Pierre and Miquelon"},Sudan:{cn:"Sudan",en:"Sudan"},Suriname:{cn:"Suriname",en:"Suriname"},"Svalbard and Jan Mayen Islands":{cn:"Svalbard and Jan Mayen Islands",en:"Svalbard and Jan Mayen Islands"},Swaziland:{cn:"Swaziland",en:"Swaziland"},Sweden:{cn:"Sweden",en:"Sweden"},Switzerland:{cn:"Switzerland",en:"Switzerland"},"Syrian Arab Republic":{cn:"Syrian Arab Republic",en:"Syrian Arab Republic"},Tajikistan:{cn:"Tajikistan",en:"Tajikistan"},Tanzania:{cn:"Tanzania",en:"Tanzania"},Thailand:{cn:"Thailand",en:"Thailand"},Togo:{cn:"Togo",en:"Togo"},Tokelau:{cn:"Tokelau",en:"Tokelau"},Tonga:{cn:"Tonga",en:"Tonga"},"Trinidad and Tobago":{cn:"Trinidad and Tobago",en:"Trinidad and Tobago"},Tue:{cn:"Tue",en:"Tue"},Tunisia:{cn:"Tunisia",en:"Tunisia"},Turkey:{cn:"Turkey",en:"Turkey"},Turkmenistan:{cn:"Turkmenistan",en:"Turkmenistan"},"Turks and Caicos Islands":{cn:"Turks and Caicos Islands",en:"Turks and Caicos Islands"},Tuvalu:{cn:"Tuvalu",en:"Tuvalu"},Uganda:{cn:"Uganda",en:"Uganda"},Ukraine:{cn:"Ukraine",en:"Ukraine"},"Uncheck All":{cn:"Uncheck All",en:"Uncheck All"},"United Arab Emirates":{cn:"United Arab Emirates",en:"United Arab Emirates"},"United Kingdom":{cn:"United Kingdom",en:"United Kingdom"},"United States":{cn:"United States",en:"United States"},"United States minor outlying islands":{cn:"United States minor outlying islands",en:"United States minor outlying islands"},Unsecure_Auth:{cn:"The password will be sent via unsecure connection. To protect your passwords enable the secure connection (HTTPS)!",en:"The password will be sent via unsecure connection. To protect your passwords enable the secure connection (HTTPS)!"},Uzbekistan:{cn:"Uzbekistan",en:"Uzbekistan"},Vanuatu:{cn:"Vanuatu",en:"Vanuatu"},Venezuela:{cn:"Venezuela",en:"Venezuela"},Vietnam:{cn:"Vietnam",en:"Vietnam"},"Virgin Islands (British)":{cn:"Virgin Islands (British)",en:"Virgin Islands (British)"},"Virgin Islands (U.S.)":{cn:"Virgin Islands (U.S.)",en:"Virgin Islands (U.S.)"},"Wallis and Futuna Islands":{cn:"Wallis and Futuna Islands",en:"Wallis and Futuna Islands"},"Warning!":{cn:"Warning!",en:"Warning!"},"Western Sahara":{cn:"Western Sahara",en:"Western Sahara"},Yemen:{cn:"Yemen",en:"Yemen"},Zaire:{cn:"Zaire",en:"Zaire"},Zambia:{cn:"Zambia",en:"Zambia"},Zimbabwe:{cn:"Zimbabwe",en:"Zimbabwe"},silly:{cn:"silly",en:"silly"},Seychelles:{en:"Seychelles"},"Sierra Leone":{en:"Sierra Leone"},Singapore:{en:"Singapore"},"Size: %s, Free: %s":{en:"Size: %s, Available: %s"},"edit enums":{en:"Edit enumerations for"},"place here":{en:"place the files here"},popular:{en:"popular"}}; //# sourceMappingURL=app.js.map
    ',!x&&i.colors&&s[z].color&&(e+='
    '),!x&&i.icons&&(e+=ne(i.objects[s[z].id],i.imgPath)||'
     
    '),"enabled"===O)e+='";else if("groups"===O)for(var E=0;E'+ne(i.objects[S],null,"")+s[z].groups[E].name+""}else if("instance"===O)if(void 0!==s[z].instance&&1';for(var Y=0;Y"+r[Y]+"";e+=k+=""}else e+=""+(void 0===s[z].instance?"":s[z].instance)+"";else if("icon"===O)e+=ne(i.objects[s[z].id],i.imgPath);else{var Q=s[z][O]||"";Q&&"object"==typeof Q&&Q.en&&(Q=Q[systemLang]||Q.en),e+=""+Q+""}e+="
    ';for(var P="",U=0;U ':(P+="<"+t+' data-id="'+s[z].id+'" class="select-button-'+U+' select-button-custom td-button" style="margin-right: 3px;" data-parent="'+s[z].parent+'" data-children="'+!!s[z].realChildren+'" title="'+(i.buttons[U].title||"")+'">',window.M&&window.M.toast&&(P+=''+(i.buttons[U].icon||"")+""),P+="");e+=P+"