How to use getCommand method in storybook-root

Best JavaScript code snippet using storybook-root

command.js

Source:command.js Github

copy

Full Screen

1 2function SetCommandItem(sub,purpose) {3 var Title = ""+GetCommand(sub, "CommTitle")+":";4 var CommandTitltName = GetCommand(sub, "CommTitle");5 var AllDevicesID = "";6 switch (sub) {7 case 1:8 var MsgBody = 'Do you want to get all your devices?';9 SetAlertMsgInnerHTML(Title, MsgBody);10 document.getElementById("AlertMsgBtn").style.display = "";11 document.getElementById("AlertMsgBtn").onclick = function(e) {12 var items = GetDeviceTag();13 14 for (var i = 0; i < items.length; i++) {15 AllDevicesID += items[i] +"/"; 16 } 17 if(purpose === "device-management"){18 19 if(noTagSelect(items.length))20 SendByGolang(AllDevicesID, GetCommand(sub, "Comm"), GetCommand(sub, "Comm"), "", "user");21 22 23 }else if(purpose === "schedule"){24 CommandSelected.push([sub, CommandTitltName, AllDevicesID, GetCommand(sub, "Comm"), GetCommand(sub, "Comm"), "", "user", true]);25 SetCommandAction(GetCommand(sub, "CommTitle"));26 }27 };28 break;29 case 2:30 var MsgBody = 'Please Set Volume :<br>'+'<input id="ex1" data-slider-id="ex1Slider" type="text" data-slider-min="0" data-slider-max="255" data-slider-step="1" data-slider-value="0" style="display:none"/>';31 SetAlertMsgInnerHTML(Title, MsgBody);32 SliderShow();33 34 document.getElementById("ex1Slider").style.display = "";35 document.getElementById("AlertMsgBtn").style.display = "";36 document.getElementById("AlertMsgBtn").onclick = function(e) {37 var items = GetDeviceTag();38 39 var value = document.getElementById("ex1").value;40 for (var i = 0; i < items.length; i++) {41 AllDevicesID += items[i]+"/"; 42 } 43 if(purpose === "device-management"){44 if(noTagSelect(items.length))45 SendByGolang(AllDevicesID, GetCommand(sub, "Comm")+";;;"+value, GetCommand(sub, "Comm"), value, "user");46 //NewSendByGolang(AllDevicesID, GetCommand(sub, "Comm"), "", value, GetCommand(sub, "Comm"), value, "user");47 }else if(purpose === "schedule"){48 CommandSelected.push([sub, CommandTitltName, AllDevicesID, GetCommand(sub, "Comm")+";;;"+value, GetCommand(sub, "Comm"), value, "user", true]);49 SetCommandAction(GetCommand(sub, "CommTitle"));50 }51 52 };53 break;54 case 3:55 56 var MsgBody= "Do you want to set volume to minimum? \r\n"; 57 SetAlertMsgInnerHTML(Title, MsgBody);58 document.getElementById("AlertMsgBtn").style.display = "";59 document.getElementById("AlertMsgBtn").onclick = function(e) {60 var items = GetDeviceTag();61 for (var i = 0; i < items.length; i++) {62 AllDevicesID += items[i] +"/"; 63 }64 if(purpose === "device-management"){65 if(noTagSelect(items.length))66 SendByGolang(AllDevicesID, GetCommand(sub, "Comm")+";;;0", GetCommand(sub, "Comm"), "0", "user");67 }else if(purpose === "schedule"){68 CommandSelected.push([sub, CommandTitltName, AllDevicesID, GetCommand(sub, "Comm")+";;;0", GetCommand(sub, "Comm"), "0", "user", true]);69 SetCommandAction(GetCommand(sub, "CommTitle"));70 }71 72 }73 break;74 case 4:75 var MsgBody= "Do you want to get coordinates? "; 76 SetAlertMsgInnerHTML(Title, MsgBody);77 document.getElementById("AlertMsgBtn").style.display = "";78 document.getElementById("AlertMsgBtn").onclick = function(e) {79 document.getElementById("AlertMsgFooter").innerHTML = '<i id="SignUpLoading" class="fa fa-spinner fa-pulse fa-2x fa-fw"></i>';80 var items = GetDeviceTag();81 var device = "";82 for (var i = 0; i < items.length; i++) {83 AllDevicesID += items[i] +"/"; 84 }85 if(purpose === "device-management"){86 if(noTagSelect(items.length)){87 for (var i = 0; i < items.length; i++) {88 device += items[i] + "###";89 }90 window.location.href = "googlemap3.html?devices%"+device+"&";91 }92 93 }else if(purpose === "schedule"){94 CommandSelected.push([sub, CommandTitltName, AllDevicesID, GetCommand(sub, "Comm"), GetCommand(sub, "Comm"), "", "user", true]);95 SetCommandAction(GetCommand(sub, "CommTitle"));96 }97 }98 break;99 case 5:100 var MsgBody= "";101 SetAlertMsgInnerHTML(Title, MsgBody);102 103 document.getElementById("AlertMsgTools").style.display = "";104 document.getElementById("EnterPassword").style.display = "";105 document.getElementById("AlertMsgBtn").style.display = "";106 document.getElementById("AlertMsgBtn").onclick = function(e) {107 var value = document.getElementById("password").value;108 var items = GetDeviceTag();109 for (var i = 0; i < items.length; i++) {110 AllDevicesID += items[i] +"/"; 111 }112 if(purpose === "device-management"){113 if(noTagSelect(items.length))114 SendByGolang(AllDevicesID, GetCommand(sub, "Comm")+";;;"+value, GetCommand(sub, "Comm"), value, "user"); 115 }else if(purpose === "schedule"){116 CommandSelected.push([sub, CommandTitltName, AllDevicesID, GetCommand(sub, "Comm")+";;;"+value, GetCommand(sub, "Comm"), value, "user", true]);117 SetCommandAction(GetCommand(sub, "CommTitle"));118 }119 120 }121 break;122 case 6:123 var MsgBody= "Do you want to reset your device?"; 124 SetAlertMsgInnerHTML(Title, MsgBody);125 document.getElementById("AlertMsgBtn").style.display = "";126 document.getElementById("AlertMsgBtn").onclick = function(e) {127 var items = GetDeviceTag();128 129 for (var i = 0; i < items.length; i++) {130 AllDevicesID += items[i] +"/"; 131 }132 if(purpose === "device-management"){133 if(noTagSelect(items.length))134 SendByGolang(AllDevicesID, GetCommand(sub, "Comm"), GetCommand(sub, "CommTitle"), "factory reset", "user"); 135 }else if(purpose === "schedule"){136 CommandSelected.push([sub, CommandTitltName, AllDevicesID, GetCommand(sub, "Comm"), GetCommand(sub, "CommTitle"), "reset", "user", true]);137 SetCommandAction(GetCommand(sub, "CommTitle"));138 }139 140 };141 break;142 case 7:143 var MsgBody= '<form id="DownloadType"><label style="margin-right:5px;"><input onclick="selectDownloadType()" name="platform" type="radio" value="GoogleDrive" checked>GoogleDrive</label><label><input onclick="selectDownloadType()" name="platform" type="radio" value="URL">URL</label></form>Select file from Google drive, and download to your cellphone. <div class="fatooltip" style="color:red;">*<span class="falargetooltiptext">In order to make sure file can be downloaded, please click <i class="fa fa-link" aria-hidden="true"></i> when uploading or downloading.</span></div><br>'; 144 MsgBody += '<div class="btn-group"><button class="btn btn-black" onclick="initPicker();" data-dismiss="modal"><img style="padding-right:3px;"height="20" weight="20" src="https://avatars3.githubusercontent.com/u/3708359?v=4&s=200">Google Drive</button></button><button type="button" class="btn btn-black dropdown-toggle" data-toggle="dropdown"><span class="caret"></span></button><ul id="GoogledriveSelect" class="dropdown-menu"></ul></div><br>'; 145 SetAlertMsgInnerHTML(Title, MsgBody);146 147 148 document.getElementById("AlertMsgBtn").style.display = "";149 document.getElementById("AlertMsgBtn").onclick = function(e) {150 var items = GetDeviceTag();151 152 //var value = document.getElementById("DownloadURL").value;153 for (var i = 0; i < items.length; i++) {154 AllDevicesID += items[i] +"/"; 155 } 156 var form = document.getElementById("DownloadType");157 //取得radio的值158 for (var i=0; i<form.platform.length; i++)159 {160 if (form.platform[i].checked)161 {162 var platform = form.platform[i].value;163 if(platform === "GoogleDrive"){164 165 }else if(platform === "URL"){166 console.log("url");167 var url = document.getElementById("download_url").value;168 var filename = document.getElementById("download_filename").value;169 if(purpose === "device-management"){170 SendByGolang(AllDevicesID, GetCommand(sub, "Comm")+";;;"+url+";;;"+filename, "", "", "user"); 171 }else if(purpose === "schedule"){172 CommandSelected.push([sub, CommandTitltName, AllDevicesID, GetCommand(sub, "Comm")+";;;"+url+";;;"+filename, GetCommand(sub, "Comm"), "url:"+url+"<br>File name:"+filename, "user", true]);173 SetCommandAction(GetCommand(sub, "CommTitle"));174 }175 176 }177 }178 }179 180 }181 break;182 case 8:183 var MsgBody= ' Please enter Apk information<br>Dowload path: <input id="DownloadPath" class="form-control" type="text" placeholder="e.g. https://inventeccorp-my.sharepoint.com/personal/chen_jimmyhy_inventec_com/Documents/evie-launcher-2-7-7-10.apk?csf=1&e=14dd76806f2348709ed78e4f8ac84896">'+184 '<br>Download file name: <input id="DownloadFileName" class="form-control" type="text" placeholder="e.g. example.apk">';185 SetAlertMsgInnerHTML(Title, MsgBody);186 document.getElementById("ShowInfoBtn").style.display = "";187 document.getElementById("ShowInfoBtn").onclick = function(e) {188 var items = GetDeviceTag();189 var DownloadPath = $('#DownloadPath').val();190 var DownloadFileName = $('#DownloadFileName').val();191 if(DownloadPath === "" || DownloadFileName === ""){192 document.getElementById("AlertMsgBody").innerHTML+='<div class="alert alert-danger">'+193 '<strong>Warning:</strong> Please enter apk information.'+194 ' </div>';195 }else{196 for (var i = 0; i < items.length; i++) {197 AllDevicesID += items[i] +"/"; 198 }199 if(purpose === "device-management"){200 if(noTagSelect(items.length))201 SendByGolang(AllDevicesID, GetCommand(sub, "Comm")+"@%@"+DownloadPath+";;;"+DownloadFileName, GetCommand(sub, "CommTitle"), DownloadFileName, "user"); 202 }else if(purpose === "schedule"){203 CommandSelected.push([sub, CommandTitltName, AllDevicesID, GetCommand(sub, "Comm")+"@%@"+GetCommand(sub, "Path")+"@%@;;;"+'add;;2:'+PackageName+':0', GetCommand(sub, "CommTitle"), "Deny", "user", true]);204 SetCommandAction(GetCommand(sub, "CommTitle"));205 }206 $('#myModal').modal('hide');207 }208 }209 break;210 case 9:211 var MsgBody= ' Please enter app package name<br>Package name: <input id="PackageName" class="form-control" type="text">';212 SetAlertMsgInnerHTML(Title, MsgBody);213 document.getElementById("ShowInfoBtn").style.display = "";214 document.getElementById("ShowInfoBtn").onclick = function(e) {215 var items = GetDeviceTag();216 var PackageName = $('#PackageName').val();217 if(PackageName === "" ){218 document.getElementById("AlertMsgBody").innerHTML+='<div class="alert alert-danger">'+219 '<strong>Warning:</strong> Please enter package name.'+220 ' </div>';221 }else{222 for (var i = 0; i < items.length; i++) {223 AllDevicesID += items[i] +"/"; 224 }225 if(purpose === "device-management"){226 if(noTagSelect(items.length))227 SendByGolang(AllDevicesID, GetCommand(sub, "Comm")+"@%@;;;"+PackageName, GetCommand(sub, "CommTitle"), PackageName, "user"); 228 }else if(purpose === "schedule"){229 CommandSelected.push([sub, CommandTitltName, AllDevicesID, GetCommand(sub, "Comm")+"@%@;;;"+PackageName, GetCommand(sub, "CommTitle"), "Deny", "user", true]);230 SetCommandAction(GetCommand(sub, "CommTitle"));231 }232 $('#myModal').modal('hide');233 }234 }235 break;236 case 11:237 var MsgBody= 'Please change APN by setting following value.<span style="color:red;">*</span>=required field';238 239 MsgBody += '<form role="form" id="APN-form" method="post">'+240 '<div class="form-group" >'+241 '<label>APN name<font color="red">*</font></label>'+242 '<input class="form-control" type="text" id="APNName" required=""/>'+243 244 '</div>'+245 '<div class="form-group">'+246 '<label>setapn<font color="red">*</font></label>'+247 '<input class="form-control" type="text" id="SetAPN" required=""/>'+248 249 '</div>'+250 '<div class="form-group">'+251 '<label>APN Proxy</label>'+252 '<input class="form-control" type="text" id="APNProxy"/>'+253 '</div>'+254 '<div class="form-group">'+255 '<label>APN Port</label>'+256 '<input class="form-control" type="text" id="APNPort"/>'+257 '</div>'+258 '<div class="form-group">'+259 '<label>APN user</label>'+260 '<input class="form-control" type="text" id="APNUser"/>'+261 '</div>'+262 '<div class="form-group">'+263 '<label>APN Password</label>'+264 '<input class="form-control" type="text" id="APNPassword"/>'+265 '</div>'+266 '<div class="form-group">'+267 '<label>APN MCC<font color="red">*</font></label>'+268 '<input class="form-control" type="text" id="APNMCC" required=""/>'+269 '</div>'+270 '<div class="form-group">'+271 '<label>APN MNC<font color="red">*</font></label>'+272 '<input class="form-control" type="text" id="APNMNC" required=""/>'+273 '</div>'+274 '<div class="text-right">'+275 '<button type="submit" class="btn btn-info">Send</button>'+276 '</div>'+277 '</form>';278 SetAlertMsgInnerHTML(Title, MsgBody);279 //document.getElementById('AlertMsgFooter').style.display = "none";280 document.getElementById("APN-form").onsubmit = function() {281 var items = GetDeviceTag();282 283 for (var i = 0; i < items.length; i++) {284 AllDevicesID += items[i] +"/"; 285 }286 var APNName = document.getElementById("APNName").value;287 var SetAPN = document.getElementById("SetAPN").value;288 var APNProxy=" ", APNPort=" ", APNUser=" ", APNPassword=" ", APNMCC=" ", APNMNC=" ";289 var APNMCC = document.getElementById("APNMCC").value;290 var APNMNC = document.getElementById("APNMNC").value;291 if(document.getElementById('APNProxy').value !== "")292 APNProxy = document.getElementById("APNProxy").value;293 if(document.getElementById('APNPort').value !== "")294 APNPort = document.getElementById("APNPort").value;295 if(document.getElementById('APNUser').value !== "")296 APNUser = document.getElementById("APNUser").value;297 if(document.getElementById('APNPassword').value !== "")298 APNPassword = document.getElementById("APNPassword").value;299 if(purpose === "device-management"){300 if(noTagSelect(items.length))301 SendByGolang(AllDevicesID, GetCommand(sub, "Comm")+"@%@"+GetCommand(sub, "Path")+"@%@;;;setting;;"+APNName+";;"+SetAPN+";;"+APNProxy+";;"+APNPort+";;"+APNUser+";;"+APNPassword+";;"+APNMCC+";;"+APNMNC, APNMNC, APNMNC, "user"); 302 }else if(purpose === "schedule"){303 CommandSelected.push([sub, CommandTitltName, GetCommand(sub, "Comm")+"@%@"+GetCommand(sub, "Path")+"@%@;;;"+GetCommand(sub, "Param"), GetCommand(sub, "CommTitle"), PropertyName, "user", true]);304 SetCommandAction(GetCommand(sub, "CommTitle"));305 }306 };307 308 break;309 case 12:310 var MsgBody= 'Do you want to get APN? <br><div id="GetAPN"></div>'; 311 SetAlertMsgInnerHTML(Title, MsgBody);312 document.getElementById("ShowInfoBtn").style.display = "";313 document.getElementById("ShowInfoBtn").onclick = function(e) {314 var items = GetDeviceTag();315 316 for (var i = 0; i < items.length; i++) {317 AllDevicesID += items[i] +"/"; 318 }319 if(purpose === "device-management"){320 if(noTagSelect(items.length))321 SendByGolang(AllDevicesID, GetCommand(sub, "Comm")+"@%@"+GetCommand(sub, "Path")+"@%@;;;"+GetCommand(sub, "Param"), GetCommand(sub, "CommTitle"), "", "user");322 }else if(purpose === "schedule"){323 CommandSelected.push([sub, CommandTitltName, AllDevicesID, GetCommand(sub, "Comm")+"@%@"+GetCommand(sub, "Path")+"@%@;;;"+GetCommand(sub, "Param"), GetCommand(sub, "CommTitle"), "", "user", true]);324 SetCommandAction(GetCommand(sub, "CommTitle"));325 }326 327 }328 329 break;330 case 13:331 var MsgBody= 'Do you want to get system version? <br><div id="GetDeviceVersion" value=0></div>'; 332 SetAlertMsgInnerHTML(Title, MsgBody);333 document.getElementById("ShowInfoBtn").style.display = "";334 document.getElementById("AlertMsgBtn").style.display = "none";335 document.getElementById("ShowInfoBtn").onclick = function(e){336 var items = GetDeviceTag();337 338 for (var i = 0; i < items.length; i++) {339 AllDevicesID += items[i] +"/"; 340 }341 if(purpose === "device-management"){342 if(noTagSelect(items.length))343 SendByGolang(AllDevicesID, GetCommand(sub, "Comm")+"@%@"+GetCommand(sub, "Path"), GetCommand(sub, "Comm"), "0", "user");344 }else if(purpose === "schedule"){345 CommandSelected.push([sub, CommandTitltName, AllDevicesID, GetCommand(sub, "Comm")+"@%@"+GetCommand(sub, "Path"), GetCommand(sub, "Comm"), "0", "user", true]);346 SetCommandAction(GetCommand(sub, "CommTitle"));347 }348 349 document.getElementById("ShowInfoBtn").style.display = "none";350 }351 352 break;353 case 14:354 var MsgBody= "Do you want to Enable location Monitor? "; 355 SetAlertMsgInnerHTML(Title, MsgBody);356 document.getElementById("AlertMsgBtn").style.display = "";357 document.getElementById("AlertMsgBtn").onclick = function(e) {358 document.getElementById("AlertMsgFooter").innerHTML = '<i id="SignUpLoading" class="fa fa-spinner fa-pulse fa-2x fa-fw"></i>';359 360 var items = GetDeviceTag();361 362 for (var i = 0; i < items.length; i++) {363 AllDevicesID += items[i] +"/"; 364 }365 if(purpose === "device-management"){366 if(noTagSelect(items.length))367 SendByGolang(AllDevicesID, GetCommand(sub, "Comm")+"@%@"+GetCommand(sub, "Path")+"@%@;;;"+GetCommand(sub, "Param"), GetCommand(sub, "Comm"), "", "user");368 }else if(purpose === "schedule"){369 CommandSelected.push([sub, CommandTitltName, AllDevicesID, GetCommand(sub, "Path")+"@%@;;;"+GetCommand(sub, "Param"), GetCommand(sub, "Comm"), "", "user", true]);370 SetCommandAction(GetCommand(sub, "CommTitle"));371 }372 373 }374 break;375 case 15:376 var MsgBody= 'Please add Restrict Area? <br> <label for="inputAddress2">Restrict area</label>'+377 '<input type="text" class="form-control" id="inputAddress2" placeholder="Country, city, or floor">'; 378 SetAlertMsgInnerHTML(Title, MsgBody);379 document.getElementById("AlertMsgBtn").style.display = "";380 document.getElementById("AlertMsgBtn").onclick = function(e) {381 382 var items = GetDeviceTag();383 var address = $('#inputAddress2').val();384 for (var i = 0; i < items.length; i++) {385 AllDevicesID += items[i] +"/"; 386 }387 if(purpose === "device-management"){388 if(noTagSelect(items.length))389 SendByGolang(AllDevicesID, GetCommand(sub, "Comm")+"@%@"+GetCommand(sub, "Path")+"@%@;;;"+"addLimitArray:"+address, GetCommand(sub, "CommTitle"), address, "user");390 }else if(purpose === "schedule"){391 CommandSelected.push([sub, CommandTitltName, AllDevicesID, GetCommand(sub, "Comm")+"@%@"+GetCommand(sub, "Path")+"@%@;;;"+"addLimitArray:"+address, GetCommand(sub, "CommTitle"), address, "user", true]);392 SetCommandAction(GetCommand(sub, "CommTitle"));393 }394 395 }396 break;397 case 16:398 var MsgBody= 'Please delete Restrict Area? <br> <label for="inputAddress2">Restrict area</label>'+399 '<input type="text" class="form-control" id="inputAddress2" placeholder="Country, city, or floor">'; 400 SetAlertMsgInnerHTML(Title, MsgBody);401 document.getElementById("AlertMsgBtn").style.display = "";402 document.getElementById("AlertMsgBtn").onclick = function(e) {403 404 var items = GetDeviceTag();405 var address = $('#inputAddress2').val();406 for (var i = 0; i < items.length; i++) {407 AllDevicesID += items[i] +"/"; 408 }409 if(purpose === "device-management"){410 if(noTagSelect(items.length))411 SendByGolang(AllDevicesID, GetCommand(sub, "Comm")+"@%@"+GetCommand(sub, "Path")+"@%@;;;"+"delLimitArray:"+address, GetCommand(sub, "CommTitle"), address, "user");412 }else if(purpose === "schedule"){413 CommandSelected.push([sub, CommandTitltName, AllDevicesID, GetCommand(sub, "Comm")+"@%@"+GetCommand(sub, "Path")+"@%@;;;"+"delLimitArray:"+address, GetCommand(sub, "CommTitle"), address, "user", true]);414 SetCommandAction(GetCommand(sub, "CommTitle"));415 }416 417 }418 break;419 case 17:420 var MsgBody= "Do you want to Disable location Monitor? "; 421 SetAlertMsgInnerHTML(Title, MsgBody);422 document.getElementById("AlertMsgBtn").style.display = "";423 document.getElementById("AlertMsgBtn").onclick = function(e) {424 var items = GetDeviceTag();425 for (var i = 0; i < items.length; i++) {426 AllDevicesID += items[i] +"/"; 427 }428 if(purpose === "device-management"){429 if(noTagSelect(items.length))430 SendByGolang(AllDevicesID, GetCommand(sub, "Comm")+"@%@"+GetCommand(sub, "Path")+"@%@;;;"+GetCommand(sub, "Param"), GetCommand(sub, "Comm"), "", "user");431 }else if(purpose === "schedule"){432 CommandSelected.push([sub, CommandTitltName, AllDevicesID, GetCommand(sub, "Path")+"@%@;;;"+GetCommand(sub, "Param"), GetCommand(sub, "Comm"), "", "user", true]);433 SetCommandAction(GetCommand(sub, "CommTitle"));434 }435 }436 break;437 case 18:438 var MsgBody= "Do you want to get restrict area? <br><div id='GetLimitList'></div>"; 439 SetAlertMsgInnerHTML(Title, MsgBody);440 document.getElementById("ShowInfoBtn").style.display = "";441 document.getElementById("ShowInfoBtn").onclick = function(e){442 var items = GetDeviceTag();443 for (var i = 0; i < items.length; i++) {444 AllDevicesID += items[i] +"/"; 445 }446 if(purpose === "device-management"){447 if(noTagSelect(items.length))448 SendByGolang(AllDevicesID, GetCommand(sub, "Comm")+"@%@"+GetCommand(sub, "Path")+"@%@;;;"+GetCommand(sub, "Param"), GetCommand(sub, "CommTitle"), "get", "user");449 }else if(purpose === "schedule"){450 CommandSelected.push([sub, CommandTitltName, AllDevicesID, GetCommand(sub, "Path")+"@%@;;;"+GetCommand(sub, "Param"), GetCommand(sub, "CommTitle"), "get", "user", true]);451 SetCommandAction(GetCommand(sub, "CommTitle"));452 }453 }454 break;455 case 19:456 var MsgBody= "Please select Time Zone? <br>"; 457 MsgBody+= '<select id="TimeZone" class="form-control"></select>';458 459 SetAlertMsgInnerHTML(Title, MsgBody);460 var buildings = [];461 buildings = ['Pacific/Midway', 'Pacific/Honolulu', 'America/Anchorage', 'America/Los_Angeles', 'America/Tijuana', 'America/Phoenix', 'America/Chihuahua', 'America/Denver', 'America/Costa_Rica', 'America/Chicago', 'America/Mexico_City', 'America/Regina', 'America/Bogota', 'America/New_York', 'America/Caracas', 'America/Barbados', 'America/Halifax', 'America/Manaus', 'America/Santiago', 'America/St_Johns', 'America/Recife', 'America/Sao_Paulo', 'America/Buenos_Aires', 'America/Godthab', 'America/Montevideo', 'Atlantic/South_Georgia', 'Atlantic/Azores', 'Atlantic/Cape_Verde', 'Africa/Casablanca', 'Europe/London', 'Europe/Amsterdam', 'Europe/Belgrade', 'Europe/Brussels', 'Europe/Madrid', 'Europe/Sarajevo', 'Africa/Windhoek', 'Africa/Brazzaville', 'Asia/Amman', 'Europe/Athens', 'Europe/Istanbul', 'Asia/Beirut', 'Africa/Cairo', 'Europe/Helsinki', 'Asia/Jerusalem', 'Europe/Minsk', 'Africa/Harare', 'Asia/Baghdad', 'Europe/Moscow', 'Asia/Kuwait', 'Africa/Nairobi', 'Asia/Tehran', 'Asia/Baku', 'Asia/Tbilisi', 'Asia/Yerevan', 'Asia/Dubai', 'Asia/Kabul', 'Asia/Karachi', 'Asia/Oral', 'Asia/Yekaterinburg', 'Asia/Calcutta', 'Asia/Colombo', 'Asia/Katmandu', 'Asia/Almaty', 'Asia/Rangoon', 'Asia/Krasnoyarsk', 'Asia/Bangkok', 'Asia/Jakarta', 'Asia/Shanghai', 'Asia/Hong_Kong', 'Asia/Irkutsk', 'Asia/Kuala_Lumpur', 'Australia/Perth', 'Asia/Taipei', 'Asia/Seoul', 'Asia/Tokyo', 'Asia/Yakutsk', 'Australia/Adelaide', 'Australia/Darwin', 'Australia/Brisbane', 'Australia/Hobart', 'Australia/Sydney', 'Asia/Vladivostok', 'Pacific/Guam', 'Asia/Magadan', 'Pacific/Noumea', 'Pacific/Majuro', 'Pacific/Auckland', 'Pacific/Fiji', 'Pacific/Tongatapu'];462 $.each(buildings, function (index, value) {463 $('#TimeZone').append($('<option/>', { 464 value: value,465 text : value 466 }));467 }); 468 469 document.getElementById("AlertMsgBtn").style.display = "";470 document.getElementById("AlertMsgBtn").onclick = function(e) {471 var timezone = $( "#TimeZone" ).val();472 var items = GetDeviceTag();473 474 for (var i = 0; i < items.length; i++) {475 AllDevicesID += items[i] +"/"; 476 }477 if(purpose === "device-management"){478 if(noTagSelect(items.length))479 SendByGolang(AllDevicesID, GetCommand(sub, "Comm")+"@%@"+GetCommand(sub, "Path")+"@%@;;;SetZone;;"+timezone, GetCommand(sub, "Comm"), timezone, "user");480 }else if(purpose === "schedule"){481 CommandSelected.push([sub, CommandTitltName, AllDevicesID, GetCommand(sub, "Comm")+"@%@"+GetCommand(sub, "Path")+"@%@;;;SetZone;;"+timezone, GetCommand(sub, "Comm"), timezone, "user", true]);482 SetCommandAction(GetCommand(sub, "CommTitle"));483 }484 485 }486 break;487 case 20:488 var MsgBody= "Please select Time? <br>"; 489 490 SetAlertMsgInnerHTML(Title, MsgBody);491 document.getElementById("AlertMsgTools").style.display = "";492 document.getElementById("timepicker").style.display = "";493 494 495 496 document.getElementById("AlertMsgBtn").style.display = "";497 document.getElementById("AlertMsgBtn").onclick = function(e) {498 angular.module('ui.bootstrap.demo', ['ngAnimate', 'ui.bootstrap']);499 angular.module('ui.bootstrap.demo').controller('TimepickerDemoCtrl', function ($scope, $log) {500 console.log($scope.dt);501 console.log($scope.mytime);502 });503 var dt = angular.element('[ng-controller=TimepickerDemoCtrl]').scope().dt;504 var mytime = angular.element('[ng-controller=TimepickerDemoCtrl]').scope().mytime;505 var year = dt.getFullYear();506 var month = dt.getMonth()+1;507 var day = dt.getDate();508 var hour = mytime.getHours();509 var minute = mytime.getMinutes();510 var second = mytime.getSeconds();511 //SetData;;2017/1/10;;SetTime;;12:59:33512 var SetData = "SetData;;"+year+"/"+month+"/"+day+";;SetTime;;"+hour+":"+minute+":"+second;513 var time = year+"/"+month+"/"+day+" "+hour+":"+minute+":"+second;514 var items = GetDeviceTag();515 516 for (var i = 0; i < items.length; i++) {517 AllDevicesID += items[i] +"/"; 518 }519 if(purpose === "device-management"){520 if(noTagSelect(items.length))521 SendByGolang(AllDevicesID, GetCommand(sub, "Comm")+"@%@"+GetCommand(sub, "Path")+"@%@;;;"+SetData, GetCommand(sub, "Comm"), time, "user");522 }else if(purpose === "schedule"){523 CommandSelected.push([sub, CommandTitltName, AllDevicesID, GetCommand(sub, "Comm")+"@%@"+GetCommand(sub, "Path")+"@%@;;;"+SetData, GetCommand(sub, "Comm"), time, "user", true]);524 SetCommandAction(GetCommand(sub, "CommTitle"));525 }526 document.getElementById("AlertMsgTools").style.display = "none";527 document.getElementById("timepicker").style.display = "none";528 }529 break;530 case 22:531 var MsgBody = 'Please Set brightness :<br>'+'<input id="ex1" data-slider-id="ex1Slider" type="text" data-slider-min="0" data-slider-max="255" data-slider-step="1" data-slider-value="0" style="display:none"/>';532 SetAlertMsgInnerHTML(Title, MsgBody);533 SliderShow();534 document.getElementById("ex1Slider").style.display = "";535 document.getElementById("AlertMsgBtn").style.display = "";536 document.getElementById("AlertMsgBtn").onclick = function(e) {537 var items = GetDeviceTag();538 539 var value = document.getElementById("ex1").value;540 for (var i = 0; i < items.length; i++) {541 AllDevicesID += items[i] +"/"; 542 }543 if(purpose === "device-management"){544 if(noTagSelect(items.length))545 SendByGolang(AllDevicesID, GetCommand(sub, "Comm")+";;;"+value, GetCommand(sub, "Comm"), value, "user"); 546 }else if(purpose === "schedule"){547 CommandSelected.push([sub, CommandTitltName, AllDevicesID, GetCommand(sub, "Comm")+";;;"+value, GetCommand(sub, "Comm"), value, "user", true]);548 SetCommandAction(GetCommand(sub, "CommTitle"));549 }550 551 };552 break;553 case 21:554 var MsgBody= "Do you want to unlock the device?";555 SetAlertMsgInnerHTML(Title, MsgBody);556 document.getElementById("AlertMsgBtn").style.display = "";557 document.getElementById("AlertMsgBtn").onclick = function(e) {558 var items = GetDeviceTag();559 560 for (var i = 0; i < items.length; i++) {561 AllDevicesID += items[i] +"/"; 562 }563 if(purpose === "device-management"){564 if(noTagSelect(items.length))565 SendByGolang(AllDevicesID, GetCommand(sub, "Comm")+";;;reset", GetCommand(sub, "Comm"), "reset", "user"); 566 }else if(purpose === "schedule"){567 CommandSelected.push([sub, CommandTitltName, AllDevicesID, GetCommand(sub, "Comm")+";;;reset", GetCommand(sub, "Comm"), "reset", "user", true]);568 SetCommandAction(GetCommand(sub, "CommTitle"));569 }570 571 }572 break;573 case 24:574 var MsgBody= "Do you want to unlock the device?";575 SetAlertMsgInnerHTML(Title, MsgBody);576 document.getElementById("AlertMsgBtn").style.display = "";577 document.getElementById("AlertMsgBtn").onclick = function(e) {578 var items = GetDeviceTag();579 580 for (var i = 0; i < items.length; i++) {581 AllDevicesID += items[i] +"/"; 582 }583 if(purpose === "device-management"){584 if(noTagSelect(items.length))585 SendByGolang(AllDevicesID, GetCommand(sub, "Comm")+"@%@"+GetCommand(sub, "Path"), GetCommand(sub, "CommTitle"), "test", "user"); 586 }else if(purpose === "schedule"){587 CommandSelected.push([sub, CommandTitltName, AllDevicesID, GetCommand(sub, "Comm")+";;;reset", GetCommand(sub, "Comm"), "reset", "user", true]);588 SetCommandAction(GetCommand(sub, "CommTitle"));589 }590 591 }592 break;593 case 27:594 var MsgBody= "Do you want to view device information? \r\n"; 595 SetAlertMsgInnerHTML(Title, MsgBody);596 document.getElementById("AlertMsgBtn").style.display = "";597 document.getElementById("AlertMsgBtn").onclick = function(e) {598 var items = GetDeviceTag();599 600 for (var i = 0; i < items.length; i++) {601 AllDevicesID += items[i] +"/"; 602 }603 if(purpose === "device-management"){604 if(noTagSelect(items.length))605 SendByGolang(AllDevicesID, GetCommand(sub, "Comm")+"@%@"+GetCommand(sub, "Path")+"@%@;;;"+GetCommand(sub, "Param"), GetCommand(sub, "Comm"), "0", "user"); 606 }else if(purpose === "schedule"){607 CommandSelected.push([sub, CommandTitltName, AllDevicesID, GetCommand(sub, "Comm")+"@%@"+GetCommand(sub, "Path")+"@%@;;;"+GetCommand(sub, "Param"), GetCommand(sub, "Comm"), "0", "user", true]);608 SetCommandAction(GetCommand(sub, "CommTitle"));609 }610 611 }612 break;613 case 28:614 var MsgBody= "Do you want to disable system status monitor? \r\n"; 615 SetAlertMsgInnerHTML(Title, MsgBody);616 document.getElementById("AlertMsgBtn").style.display = "";617 document.getElementById("AlertMsgBtn").onclick = function(e) {618 var items = GetDeviceTag();619 620 for (var i = 0; i < items.length; i++) {621 AllDevicesID += items[i] +"/"; 622 }623 if(purpose === "device-management"){624 if(noTagSelect(items.length))625 SendByGolang(AllDevicesID, GetCommand(sub, "Comm")+"@%@"+GetCommand(sub, "Path")+"@%@;;;"+GetCommand(sub, "Param"), GetCommand(sub, "Comm"), "0", "user"); 626 }else if(purpose === "schedule"){627 CommandSelected.push([sub, CommandTitltName, AllDevicesID, GetCommand(sub, "Comm")+"@%@"+GetCommand(sub, "Path")+"@%@;;;"+GetCommand(sub, "Param"), GetCommand(sub, "Comm"), "0", "user", true]);628 SetCommandAction(GetCommand(sub, "CommTitle"));629 }630 631 }632 break;633 case 29:634 var MsgBody= 'Please input Wifi SSID.<br>SSID: <input id="SSIDName" class="form-control" type="text">'; 635 SetAlertMsgInnerHTML(Title, MsgBody);636 document.getElementById("ShowInfoBtn").style.display = "";637 document.getElementById("ShowInfoBtn").onclick = function(e) {638 var items = GetDeviceTag();639 var SSIDName = $('#SSIDName').val();640 if(SSIDName === ""){641 document.getElementById("AlertMsgBody").innerHTML+='<div class="alert alert-danger">'+642 '<strong>Warning:</strong> Please enter wifi ssid.'+643 ' </div>';644 }else{645 for (var i = 0; i < items.length; i++) {646 AllDevicesID += items[i] +"/"; 647 }648 if(purpose === "device-management"){649 if(noTagSelect(items.length))650 SendByGolang(AllDevicesID, GetCommand(sub, "Comm")+"@%@"+GetCommand(sub, "Path")+"@%@;;;"+'add;;4:'+SSIDName+':1', GetCommand(sub, "CommTitle"), "Allow", "user"); 651 }else if(purpose === "schedule"){652 CommandSelected.push([sub, CommandTitltName, AllDevicesID, GetCommand(sub, "Comm")+"@%@"+GetCommand(sub, "Path")+"@%@;;;"+'add;;4:'+SSIDName+':1', GetCommand(sub, "CommTitle"), "Allow", "user", true]);653 SetCommandAction(GetCommand(sub, "CommTitle"));654 }655 $('#myModal').modal('hide');656 }657 }658 break;659 case 30:660 var MsgBody= 'Please input Wifi SSID.<br>SSID: <input id="SSIDName" class="form-control" type="text">'; 661 SetAlertMsgInnerHTML(Title, MsgBody);662 document.getElementById("ShowInfoBtn").style.display = "";663 document.getElementById("ShowInfoBtn").onclick = function(e) {664 var items = GetDeviceTag();665 var SSIDName = $('#SSIDName').val();666 if(SSIDName === ""){667 document.getElementById("AlertMsgBody").innerHTML+='<div class="alert alert-danger">'+668 '<strong>Warning:</strong> Please enter wifi ssid.'+669 ' </div>';670 }else{671 for (var i = 0; i < items.length; i++) {672 AllDevicesID += items[i] +"/"; 673 }674 if(purpose === "device-management"){675 if(noTagSelect(items.length))676 SendByGolang(AllDevicesID, GetCommand(sub, "Comm")+"@%@"+GetCommand(sub, "Path")+"@%@;;;"+'add;;4:'+SSIDName+':0', GetCommand(sub, "CommTitle"), "Deny", "user"); 677 }else if(purpose === "schedule"){678 CommandSelected.push([sub, CommandTitltName, AllDevicesID, GetCommand(sub, "Comm")+"@%@"+GetCommand(sub, "Path")+"@%@;;;"+'add;;4:'+SSIDName+':0', GetCommand(sub, "CommTitle"), "Deny", "user", true]);679 SetCommandAction(GetCommand(sub, "CommTitle"));680 }681 $('#myModal').modal('hide');682 }683 }684 break;685 case 31:686 var MsgBody= 'Please input Bluetooth MAC Address.<br>MAC Address: <input id="MACName" class="form-control" type="text">'; 687 SetAlertMsgInnerHTML(Title, MsgBody);688 document.getElementById("ShowInfoBtn").style.display = "";689 document.getElementById("ShowInfoBtn").onclick = function(e) {690 var items = GetDeviceTag();691 var MACName = $('#MACName').val();692 if(MACName === ""){693 document.getElementById("AlertMsgBody").innerHTML+='<div class="alert alert-danger">'+694 '<strong>Warning:</strong> Please enter MAC address.'+695 ' </div>';696 }else{697 for (var i = 0; i < items.length; i++) {698 AllDevicesID += items[i] +"/"; 699 }700 if(purpose === "device-management"){701 if(noTagSelect(items.length))702 SendByGolang(AllDevicesID, GetCommand(sub, "Comm")+"@%@"+GetCommand(sub, "Path")+"@%@;;;"+'add;;5:'+MACName+':1', GetCommand(sub, "CommTitle"), "Allow", "user"); 703 }else if(purpose === "schedule"){704 CommandSelected.push([sub, CommandTitltName, AllDevicesID, GetCommand(sub, "Comm")+"@%@"+GetCommand(sub, "Path")+"@%@;;;"+'add;;5:'+MACName+':1', GetCommand(sub, "CommTitle"), "Allow", "user", true]);705 SetCommandAction(GetCommand(sub, "CommTitle"));706 }707 $('#myModal').modal('hide');708 }709 }710 break;711 case 32:712 var MsgBody= 'Please input Bluetooth MAC Address.<br>MAC Address: <input id="MACName" class="form-control" type="text">'; 713 SetAlertMsgInnerHTML(Title, MsgBody);714 document.getElementById("ShowInfoBtn").style.display = "";715 document.getElementById("ShowInfoBtn").onclick = function(e) {716 var items = GetDeviceTag();717 var MACName = $('#MACName').val();718 if(MACName === ""){719 document.getElementById("AlertMsgBody").innerHTML+='<div class="alert alert-danger">'+720 '<strong>Warning:</strong> Please enter MAC address.'+721 ' </div>';722 }else{723 for (var i = 0; i < items.length; i++) {724 AllDevicesID += items[i] +"/"; 725 }726 if(purpose === "device-management"){727 if(noTagSelect(items.length))728 SendByGolang(AllDevicesID, GetCommand(sub, "Comm")+"@%@"+GetCommand(sub, "Path")+"@%@;;;"+'add;;5:'+MACName+':0', GetCommand(sub, "CommTitle"), "Deny", "user"); 729 }else if(purpose === "schedule"){730 CommandSelected.push([sub, CommandTitltName, AllDevicesID, GetCommand(sub, "Comm")+"@%@"+GetCommand(sub, "Path")+"@%@;;;"+'add;;5:'+MACName+':0', GetCommand(sub, "CommTitle"), "Deny", "user", true]);731 SetCommandAction(GetCommand(sub, "CommTitle"));732 }733 $('#myModal').modal('hide');734 }735 }736 break;737 case 37:738 var MsgBody= ' Please enter app package name.<br>Package name: <input id="PackageName" class="form-control" type="text">'; 739 SetAlertMsgInnerHTML(Title, MsgBody);740 document.getElementById("ShowInfoBtn").style.display = "";741 document.getElementById("ShowInfoBtn").onclick = function(e) {742 var items = GetDeviceTag();743 var PackageName = $('#PackageName').val();744 if(PackageName === ""){745 document.getElementById("AlertMsgBody").innerHTML+='<div class="alert alert-danger">'+746 '<strong>Warning:</strong> Please enter package name.'+747 ' </div>';748 }else{749 for (var i = 0; i < items.length; i++) {750 AllDevicesID += items[i] +"/"; 751 }752 if(purpose === "device-management"){753 if(noTagSelect(items.length))754 SendByGolang(AllDevicesID, GetCommand(sub, "Comm")+"@%@"+GetCommand(sub, "Path")+"@%@;;;"+'add;;2:'+PackageName+':1', GetCommand(sub, "CommTitle"), "Allow", "user"); 755 }else if(purpose === "schedule"){756 CommandSelected.push([sub, CommandTitltName, AllDevicesID, GetCommand(sub, "Comm")+"@%@"+GetCommand(sub, "Path")+"@%@;;;"+'add;;2:'+PackageName+':1', GetCommand(sub, "CommTitle"), "Allow", "user", true]);757 SetCommandAction(GetCommand(sub, "CommTitle"));758 }759 $('#myModal').modal('hide');760 }761 }762 break;763 case 38:764 var MsgBody= ' Please enter app package name.<br>Package name: <input id="PackageName" class="form-control" type="text">'; 765 SetAlertMsgInnerHTML(Title, MsgBody);766 document.getElementById("ShowInfoBtn").style.display = "";767 document.getElementById("ShowInfoBtn").onclick = function(e) {768 var items = GetDeviceTag();769 var PackageName = $('#PackageName').val();770 if(PackageName === ""){771 document.getElementById("AlertMsgBody").innerHTML+='<div class="alert alert-danger">'+772 '<strong>Warning:</strong> Please enter package name.'+773 ' </div>';774 }else{775 for (var i = 0; i < items.length; i++) {776 AllDevicesID += items[i] +"/"; 777 }778 if(purpose === "device-management"){779 if(noTagSelect(items.length))780 SendByGolang(AllDevicesID, GetCommand(sub, "Comm")+"@%@"+GetCommand(sub, "Path")+"@%@;;;"+'add;;2:'+PackageName+':0', GetCommand(sub, "CommTitle"), "Deny", "user"); 781 }else if(purpose === "schedule"){782 CommandSelected.push([sub, CommandTitltName, AllDevicesID, GetCommand(sub, "Comm")+"@%@"+GetCommand(sub, "Path")+"@%@;;;"+'add;;2:'+PackageName+':0', GetCommand(sub, "CommTitle"), "Deny", "user", true]);783 SetCommandAction(GetCommand(sub, "CommTitle"));784 }785 $('#myModal').modal('hide');786 }787 }788 break;789 case 39:790 var MsgBody= ' Please enter app package name.<br>Package name: <input id="PackageName" class="form-control" type="text">'; 791 SetAlertMsgInnerHTML(Title, MsgBody);792 document.getElementById("ShowInfoBtn").style.display = "";793 document.getElementById("ShowInfoBtn").onclick = function(e) {794 var items = GetDeviceTag();795 var PackageName = $('#PackageName').val();796 if(PackageName === ""){797 document.getElementById("AlertMsgBody").innerHTML+='<div class="alert alert-danger">'+798 '<strong>Warning:</strong> Please enter package name.'+799 ' </div>';800 }else{801 for (var i = 0; i < items.length; i++) {802 AllDevicesID += items[i] +"/"; 803 }804 if(purpose === "device-management"){805 if(noTagSelect(items.length))806 SendByGolang(AllDevicesID, GetCommand(sub, "Comm")+"@%@"+GetCommand(sub, "Path")+"@%@;;;"+'add;;1:'+PackageName+':1', GetCommand(sub, "CommTitle"), "Allow", "user"); 807 }else if(purpose === "schedule"){808 CommandSelected.push([sub, CommandTitltName, AllDevicesID, GetCommand(sub, "Comm")+"@%@"+GetCommand(sub, "Path")+"@%@;;;"+'add;;1:'+PackageName+':1', GetCommand(sub, "CommTitle"), "Allow", "user", true]);809 SetCommandAction(GetCommand(sub, "CommTitle"));810 }811 $('#myModal').modal('hide');812 }813 }814 break;815 case 40:816 var MsgBody= ' Please enter app package name.<br>Package name: <input id="PackageName" class="form-control" type="text">'; 817 SetAlertMsgInnerHTML(Title, MsgBody);818 document.getElementById("ShowInfoBtn").style.display = "";819 document.getElementById("ShowInfoBtn").onclick = function(e) {820 var items = GetDeviceTag();821 var PackageName = $('#PackageName').val();822 if(PackageName === ""){823 document.getElementById("AlertMsgBody").innerHTML+='<div class="alert alert-danger">'+824 '<strong>Warning:</strong> Please enter package name.'+825 ' </div>';826 }else{827 for (var i = 0; i < items.length; i++) {828 AllDevicesID += items[i] +"/"; 829 }830 if(purpose === "device-management"){831 if(noTagSelect(items.length))832 SendByGolang(AllDevicesID, GetCommand(sub, "Comm")+"@%@"+GetCommand(sub, "Path")+"@%@;;;"+'add;;1:'+PackageName+':0', GetCommand(sub, "CommTitle"), "Deny", "user"); 833 }else if(purpose === "schedule"){834 CommandSelected.push([sub, CommandTitltName, AllDevicesID, GetCommand(sub, "Comm")+"@%@"+GetCommand(sub, "Path")+"@%@;;;"+'add;;1:'+PackageName+':0', GetCommand(sub, "CommTitle"), "Deny", "user", true]);835 SetCommandAction(GetCommand(sub, "CommTitle"));836 }837 $('#myModal').modal('hide');838 }839 }840 break;841 case 41:842 var MsgBody= "Do you want to hide widget page? \r\n"; 843 SetAlertMsgInnerHTML(Title, MsgBody);844 document.getElementById("AlertMsgBtn").style.display = "";845 document.getElementById("AlertMsgBtn").onclick = function(e) {846 var items = GetDeviceTag();847 848 for (var i = 0; i < items.length; i++) {849 AllDevicesID += items[i] +"/"; 850 }851 if(purpose === "device-management"){852 if(noTagSelect(items.length))853 SendByGolang(AllDevicesID, GetCommand(sub, "Comm")+";;;"+GetCommand(sub, "Param"), GetCommand(sub, "Comm"), "0", "user"); 854 }else if(purpose === "schedule"){855 CommandSelected.push([sub, CommandTitltName, AllDevicesID, GetCommand(sub, "Comm")+";;;"+GetCommand(sub, "Param"), GetCommand(sub, "Comm"), "0", "user", true]);856 SetCommandAction(GetCommand(sub, "CommTitle"));857 }858 859 }860 break;861 case 42:862 var MsgBody= "Do you want to shutdown device? \r\n"; 863 SetAlertMsgInnerHTML(Title, MsgBody);864 document.getElementById("AlertMsgBtn").style.display = "";865 document.getElementById("AlertMsgBtn").onclick = function(e) {866 var items = GetDeviceTag();867 868 for (var i = 0; i < items.length; i++) {869 AllDevicesID += items[i] +"/"; 870 }871 if(purpose === "device-management"){872 if(noTagSelect(items.length))873 SendByGolang(AllDevicesID, GetCommand(sub, "Comm")+"@%@"+GetCommand(sub, "Path")+"@%@;;;"+GetCommand(sub, "Param"), GetCommand(sub, "CommTitle"), "true", "user"); 874 }else if(purpose === "schedule"){875 CommandSelected.push([sub, CommandTitltName, GetCommand(sub, "Comm")+"@%@"+GetCommand(sub, "Path")+"@%@;;;"+GetCommand(sub, "Param"), GetCommand(sub, "CommTitle"), "true", "user", true]);876 SetCommandAction(GetCommand(sub, "CommTitle"));877 }878 879 }880 break;881 case 43:882 var MsgBody= "Do you want to reboot device? \r\n"; 883 SetAlertMsgInnerHTML(Title, MsgBody);884 document.getElementById("AlertMsgBtn").style.display = "";885 document.getElementById("AlertMsgBtn").onclick = function(e) {886 var items = GetDeviceTag();887 888 for (var i = 0; i < items.length; i++) {889 AllDevicesID += items[i] +"/"; 890 }891 if(purpose === "device-management"){892 if(noTagSelect(items.length))893 SendByGolang(AllDevicesID, GetCommand(sub, "Comm")+"@%@"+GetCommand(sub, "Path")+"@%@;;;"+GetCommand(sub, "Param"), "reboot", "true", "user"); 894 }else if(purpose === "schedule"){895 CommandSelected.push([sub, CommandTitltName, GetCommand(sub, "Comm")+"@%@"+GetCommand(sub, "Path")+"@%@;;;"+GetCommand(sub, "Param"), "reboot", "true", "user", true]);896 SetCommandAction(GetCommand(sub, "CommTitle"));897 }898 899 }900 break;901 case 44:902 var MsgBody= "Do you want to enable flight mode? \r\n"; 903 SetAlertMsgInnerHTML(Title, MsgBody);904 document.getElementById("AlertMsgBtn").style.display = "";905 document.getElementById("AlertMsgBtn").onclick = function(e) {906 var items = GetDeviceTag();907 908 for (var i = 0; i < items.length; i++) {909 AllDevicesID += items[i] +"/"; 910 }911 if(purpose === "device-management"){912 if(noTagSelect(items.length))913 SendByGolang(AllDevicesID, GetCommand(sub, "Comm")+"@%@"+GetCommand(sub, "Path")+"@%@;;;"+GetCommand(sub, "Param"), GetCommand(sub, "CommTitle"), "true", "user"); 914 }else if(purpose === "schedule"){915 CommandSelected.push([sub, CommandTitltName, GetCommand(sub, "Comm")+"@%@"+GetCommand(sub, "Path")+"@%@;;;"+GetCommand(sub, "Param"), GetCommand(sub, "CommTitle"), "true", "user", true]);916 SetCommandAction(GetCommand(sub, "CommTitle"));917 }918 919 }920 break;921 case 45:922 var MsgBody= "Do you want to disable flight mode? \r\n"; 923 SetAlertMsgInnerHTML(Title, MsgBody);924 document.getElementById("AlertMsgBtn").style.display = "";925 document.getElementById("AlertMsgBtn").onclick = function(e) {926 var items = GetDeviceTag();927 928 for (var i = 0; i < items.length; i++) {929 AllDevicesID += items[i] +"/"; 930 }931 if(purpose === "device-management"){932 if(noTagSelect(items.length))933 SendByGolang(AllDevicesID, GetCommand(sub, "Comm")+"@%@"+GetCommand(sub, "Path")+"@%@;;;"+GetCommand(sub, "Param"), GetCommand(sub, "CommTitle"), "true", "user"); 934 }else if(purpose === "schedule"){935 CommandSelected.push([sub, CommandTitltName, GetCommand(sub, "Comm")+"@%@"+GetCommand(sub, "Path")+"@%@;;;"+GetCommand(sub, "Param"), GetCommand(sub, "CommTitle"), "true", "user", true]);936 SetCommandAction(GetCommand(sub, "CommTitle"));937 }938 939 }940 break;941 case 46:942 var MsgBody= "Do you enable device admin? \r\n"; 943 SetAlertMsgInnerHTML(Title, MsgBody);944 document.getElementById("AlertMsgBtn").style.display = "";945 document.getElementById("AlertMsgBtn").onclick = function(e) {946 var items = GetDeviceTag();947 948 for (var i = 0; i < items.length; i++) {949 AllDevicesID += items[i] +"/"; 950 }951 if(purpose === "device-management"){952 if(noTagSelect(items.length))953 SendByGolang(AllDevicesID, GetCommand(sub, "Comm")+"@%@"+GetCommand(sub, "Path")+"@%@;;;"+GetCommand(sub, "Param"), GetCommand(sub, "CommTitle"), "true", "user"); 954 }else if(purpose === "schedule"){955 CommandSelected.push([sub, CommandTitltName, GetCommand(sub, "Comm")+"@%@"+GetCommand(sub, "Path")+"@%@;;;"+GetCommand(sub, "Param"), GetCommand(sub, "CommTitle"), "true", "user", true]);956 SetCommandAction(GetCommand(sub, "CommTitle"));957 }958 959 }960 break;961 case 47:962 var MsgBody= "Do you disable device admin? \r\n"; 963 SetAlertMsgInnerHTML(Title, MsgBody);964 document.getElementById("AlertMsgBtn").style.display = "";965 document.getElementById("AlertMsgBtn").onclick = function(e) {966 var items = GetDeviceTag();967 968 for (var i = 0; i < items.length; i++) {969 AllDevicesID += items[i] +"/"; 970 }971 if(purpose === "device-management"){972 if(noTagSelect(items.length))973 SendByGolang(AllDevicesID, GetCommand(sub, "Comm")+"@%@"+GetCommand(sub, "Path")+"@%@;;;"+GetCommand(sub, "Param"), GetCommand(sub, "CommTitle"), "true", "user"); 974 }else if(purpose === "schedule"){975 CommandSelected.push([sub, CommandTitltName, GetCommand(sub, "Comm")+"@%@"+GetCommand(sub, "Path")+"@%@;;;"+GetCommand(sub, "Param"), GetCommand(sub, "CommTitle"), "true", "user", true]);976 SetCommandAction(GetCommand(sub, "CommTitle"));977 }978 979 }980 break;981 case 48:982 var MsgBody= "Do you enable adb? \r\n"; 983 SetAlertMsgInnerHTML(Title, MsgBody);984 document.getElementById("AlertMsgBtn").style.display = "";985 document.getElementById("AlertMsgBtn").onclick = function(e) {986 var items = GetDeviceTag();987 988 for (var i = 0; i < items.length; i++) {989 AllDevicesID += items[i] +"/"; 990 }991 if(purpose === "device-management"){992 if(noTagSelect(items.length))993 SendByGolang(AllDevicesID, GetCommand(sub, "Comm")+"@%@"+GetCommand(sub, "Path")+"@%@;;;"+GetCommand(sub, "Param"), GetCommand(sub, "CommTitle"), "true", "user"); 994 }else if(purpose === "schedule"){995 CommandSelected.push([sub, CommandTitltName, GetCommand(sub, "Comm")+"@%@"+GetCommand(sub, "Path")+"@%@;;;"+GetCommand(sub, "Param"), GetCommand(sub, "CommTitle"), "true", "user", true]);996 SetCommandAction(GetCommand(sub, "CommTitle"));997 }998 999 }1000 break;1001 case 49:1002 var MsgBody= "Do you disable adb? \r\n"; 1003 SetAlertMsgInnerHTML(Title, MsgBody);1004 document.getElementById("AlertMsgBtn").style.display = "";1005 document.getElementById("AlertMsgBtn").onclick = function(e) {1006 var items = GetDeviceTag();1007 1008 for (var i = 0; i < items.length; i++) {1009 AllDevicesID += items[i] +"/"; 1010 }1011 if(purpose === "device-management"){1012 if(noTagSelect(items.length))1013 SendByGolang(AllDevicesID, GetCommand(sub, "Comm")+"@%@"+GetCommand(sub, "Path")+"@%@;;;"+GetCommand(sub, "Param"), GetCommand(sub, "CommTitle"), "true", "user"); 1014 }else if(purpose === "schedule"){1015 CommandSelected.push([sub, CommandTitltName, GetCommand(sub, "Comm")+"@%@"+GetCommand(sub, "Path")+"@%@;;;"+GetCommand(sub, "Param"), GetCommand(sub, "CommTitle"), "true", "user", true]);1016 SetCommandAction(GetCommand(sub, "CommTitle"));1017 }1018 1019 }1020 break;1021 case 50:1022 var MsgBody= "Do you want to hide widget page? \r\n"; 1023 SetAlertMsgInnerHTML(Title, MsgBody);1024 document.getElementById("AlertMsgBtn").style.display = "";1025 document.getElementById("AlertMsgBtn").onclick = function(e) {1026 var items = GetDeviceTag();1027 1028 for (var i = 0; i < items.length; i++) {1029 AllDevicesID += items[i] +"/"; 1030 }1031 if(purpose === "device-management"){1032 if(noTagSelect(items.length)){1033 SendByGolang(AllDevicesID, GetCommand(sub, "Comm")+";;;"+GetCommand(sub, "Param"), GetCommand(sub, "Comm"), "0", "user"); 1034 SendByGolang(AllDevicesID, GetCommand(43, "Comm")+"@%@"+GetCommand(43, "Path")+"@%@;;;"+GetCommand(43, "Param"), "reboot", "true", "system");1035 }1036 }else if(purpose === "schedule"){1037 CommandSelected.push([sub, CommandTitltName, AllDevicesID, GetCommand(sub, "Comm")+";;;"+GetCommand(sub, "Param"), GetCommand(sub, "Comm"), "0", "user", true]);1038 SetCommandAction(GetCommand(sub, "CommTitle"));1039 }1040 1041 }1042 break;1043 case 51:1044 var MsgBody= "Do you want to display widget page? \r\n"; 1045 SetAlertMsgInnerHTML(Title, MsgBody);1046 document.getElementById("AlertMsgBtn").style.display = "";1047 document.getElementById("AlertMsgBtn").onclick = function(e) {1048 var items = GetDeviceTag();1049 1050 for (var i = 0; i < items.length; i++) {1051 AllDevicesID += items[i] +"/"; 1052 }1053 if(purpose === "device-management"){1054 if(noTagSelect(items.length)){1055 SendByGolang(AllDevicesID, GetCommand(sub, "Comm")+";;;"+GetCommand(sub, "Param"), GetCommand(sub, "Comm"), "0", "user"); 1056 SendByGolang(AllDevicesID, GetCommand(43, "Comm")+"@%@"+GetCommand(43, "Path")+"@%@;;;"+GetCommand(43, "Param"), "reboot", "true", "system");1057 }1058 }else if(purpose === "schedule"){1059 CommandSelected.push([sub, CommandTitltName, AllDevicesID, GetCommand(sub, "Comm")+";;;"+GetCommand(sub, "Param"), GetCommand(sub, "Comm"), "0", "user", true]);1060 SetCommandAction(GetCommand(sub, "CommTitle"));1061 }1062 1063 }1064 break;1065 case 52:1066 document.getElementById("AlertMsgEvent").style.display = "none";1067 var MsgBody = 'Please Set Device name :<br>'; 1068 var DeviceID=[];var strDevice = "";1069 var table = $('#dataTables-example').DataTable();1070 document.getElementById("AlertMsgBtn").style.display = "";1071 for (var i = 0; i < table.rows('.selected').data().length; i++) {1072 DeviceID.push( table.rows('.selected').data()[i][1]);1073 MsgBody += '<p>'+DeviceID[i]+' : <input type="text" class="pull-right"style="margin-right: 100px;" id="DeviceName'+i+'"></p>';1074 strDevice+=DeviceID[i]+"/";1075 }1076 SetAlertMsgInnerHTML(Title, MsgBody);1077 document.getElementById("AlertMsgBtn").style.display = "";1078 document.getElementById("AlertMsgBtn").onclick = function(e) {1079 for (var i = 0; i < table.rows('.selected').data().length; i++) {1080 var device = "DeviceName"+i;1081 var devicenvalue = document.getElementById(device).value1082 if(localStorage.getItem("Company") === "Guest"){1083 SetDeviceName(DeviceID[i], devicenvalue);1084 }else{1085 SendByGolang(DeviceID[i]+"/", GetCommand(sub, "Comm")+"@%@"+GetCommand(sub, "Path")+"@%@;;;"+GetCommand(sub, "Param")+devicenvalue, GetCommand(sub, "Comm"), devicenvalue, "user"); 1086 SetDeviceName(DeviceID[i], devicenvalue);1087 1088 1089 }1090 }1091 1092 }1093 break;1094 case 53:1095 var MsgBody = 'Send Message :<br>'; 1096 var DeviceID=[];1097 MsgBody += '<p><input type="text"style="margin-right: 5px;" id="txtMsg"><button class="btn btn-primary" id="btnSendMessage"><i class="fa fa-paper-plane" aria-hidden="true"></i></button></p>';1098 document.getElementById("AlertMsgBtn").style.display = "none";1099 SetAlertMsgInnerHTML(Title, MsgBody);1100 document.getElementById("btnSendMessage").onclick = function(e){1101 var value = document.getElementById("txtMsg").value;1102 var items = GetDeviceTag();1103 1104 for (var i = 0; i < items.length; i++) {1105 AllDevicesID += items[i] +"/"; 1106 }1107 if(purpose === "device-management"){1108 if(noTagSelect(items.length))1109 SendByGolang(AllDevicesID, GetCommand(sub, "Comm")+";;;"+value, GetCommand(sub, "Comm"), value, "user"); 1110 }else if(purpose === "schedule"){1111 CommandSelected.push([sub, CommandTitltName, AllDevicesID, GetCommand(sub, "Comm")+";;;"+value, GetCommand(sub, "Comm"), value, "user", true]);1112 SetCommandAction(GetCommand(sub, "CommTitle"));1113 }1114 1115 1116 document.getElementById("txtMsg").value = "";1117 }1118 break;1119 case 54:1120 var MsgBody= "Do you want to Enable Bluetooth? \r\n"; 1121 SetAlertMsgInnerHTML(Title, MsgBody);1122 document.getElementById("AlertMsgBtn").style.display = "";1123 document.getElementById("AlertMsgBtn").onclick = function(e) {1124 var items = GetDeviceTag();1125 1126 for (var i = 0; i < items.length; i++) {1127 AllDevicesID += items[i] +"/"; 1128 }1129 if(purpose === "device-management"){1130 if(noTagSelect(items.length))1131 SendByGolang(AllDevicesID, GetCommand(sub, "Comm")+";;;"+GetCommand(sub, "Param"), GetCommand(sub, "Comm"), "enable", "user"); 1132 }else if(purpose === "schedule"){1133 CommandSelected.push([sub, CommandTitltName, AllDevicesID, GetCommand(sub, "Comm")+";;;"+GetCommand(sub, "Param"), GetCommand(sub, "Comm"), "enable", "user", true]);1134 SetCommandAction(GetCommand(sub, "CommTitle"));1135 }1136 1137 }1138 break;1139 case 55:1140 var MsgBody= "Do you want to Disable Bluetooth? \r\n"; 1141 SetAlertMsgInnerHTML(Title, MsgBody);1142 document.getElementById("AlertMsgBtn").style.display = "";1143 document.getElementById("AlertMsgBtn").onclick = function(e) {1144 var items = GetDeviceTag();1145 1146 for (var i = 0; i < items.length; i++) {1147 AllDevicesID += items[i] +"/"; 1148 }1149 if(purpose === "device-management"){1150 if(noTagSelect(items.length))1151 SendByGolang(AllDevicesID, GetCommand(sub, "Comm")+";;;"+GetCommand(sub, "Param"), GetCommand(sub, "Comm"), "disable", "user"); 1152 }else if(purpose === "schedule"){1153 CommandSelected.push([sub, CommandTitltName, AllDevicesID, GetCommand(sub, "Comm")+";;;"+GetCommand(sub, "Param"), GetCommand(sub, "Comm"), "disable", "user", true]);1154 SetCommandAction(GetCommand(sub, "CommTitle"));1155 }1156 1157 }1158 break;1159 case 56:1160 var MsgBody= "Do you want to Enable wifi? \r\n"; 1161 SetAlertMsgInnerHTML(Title, MsgBody);1162 document.getElementById("AlertMsgBtn").style.display = "";1163 document.getElementById("AlertMsgBtn").onclick = function(e) {1164 var items = GetDeviceTag();1165 1166 for (var i = 0; i < items.length; i++) {1167 AllDevicesID += items[i] +"/"; 1168 }1169 if(purpose === "device-management"){1170 if(noTagSelect(items.length))1171 SendByGolang(AllDevicesID, GetCommand(sub, "Comm")+";;;"+GetCommand(sub, "Param"), GetCommand(sub, "Comm"), "enable", "user"); 1172 }else if(purpose === "schedule"){1173 CommandSelected.push([sub, CommandTitltName, AllDevicesID, GetCommand(sub, "Comm")+";;;"+GetCommand(sub, "Param"), GetCommand(sub, "Comm"), "enable", "user", true]);1174 SetCommandAction(GetCommand(sub, "CommTitle"));1175 }1176 1177 }1178 break;1179 case 57:1180 var MsgBody= "Do you want to Disable wifi? \r\n"; 1181 SetAlertMsgInnerHTML(Title, MsgBody);1182 document.getElementById("AlertMsgBtn").style.display = "";1183 document.getElementById("AlertMsgBtn").onclick = function(e) {1184 var items = GetDeviceTag();1185 1186 for (var i = 0; i < items.length; i++) {1187 AllDevicesID += items[i] +"/"; 1188 }1189 if(purpose === "device-management"){1190 if(noTagSelect(items.length))1191 SendByGolang(AllDevicesID, GetCommand(sub, "Comm")+";;;"+GetCommand(sub, "Param"), GetCommand(sub, "Comm"), "disable", "user");1192 }else if(purpose === "schedule"){1193 CommandSelected.push([sub, CommandTitltName, AllDevicesID, GetCommand(sub, "Comm")+";;;"+GetCommand(sub, "Param"), GetCommand(sub, "Comm"), "disable", "user", true]);1194 SetCommandAction(GetCommand(sub, "CommTitle"));1195 }1196 1197 }1198 break;1199 case 58:1200 var MsgBody= 'Do you want to get root status? <br><div id="GetRoot"></div>'; 1201 SetAlertMsgInnerHTML(Title, MsgBody);1202 document.getElementById("ShowInfoBtn").style.display = "";1203 document.getElementById("AlertMsgBtn").style.display = "none";1204 document.getElementById("ShowInfoBtn").onclick = function(e){1205 var items = GetDeviceTag();1206 1207 for (var i = 0; i < items.length; i++) {1208 AllDevicesID += items[i] +"/"; 1209 }1210 if(purpose === "device-management"){1211 if(noTagSelect(items.length))1212 SendByGolang(AllDevicesID, GetCommand(sub, "Comm")+";;;"+GetCommand(sub, "Param"), GetCommand(sub, "Comm"), "0", "user");1213 }else if(purpose === "schedule"){1214 CommandSelected.push([sub, CommandTitltName, AllDevicesID, GetCommand(sub, "Comm")+";;;"+GetCommand(sub, "Param"), GetCommand(sub, "Comm"), "0", "user", true]);1215 SetCommandAction(GetCommand(sub, "CommTitle"));1216 }1217 1218 document.getElementById("ShowInfoBtn").style.display = "none";1219 }1220 1221 break;1222 case 59:1223 var MsgBody= 'Do you want to get top activity? <br> <div id="GetTopActivity"></div>'; 1224 SetAlertMsgInnerHTML(Title, MsgBody);1225 document.getElementById("AlertMsgBtn").style.display = "none";1226 document.getElementById("ShowInfoBtn").style.display = "";1227 document.getElementById("ShowInfoBtn").onclick = function(e){1228 var items = GetDeviceTag();1229 1230 for (var i = 0; i < items.length; i++) {1231 AllDevicesID += items[i] +"/"; 1232 }1233 if(purpose === "device-management"){1234 if(noTagSelect(items.length))1235 SendByGolang(AllDevicesID, GetCommand(sub, "Comm")+";;;"+GetCommand(sub, "Param"), GetCommand(sub, "Comm"), "0", "user");1236 }else if(purpose === "schedule"){1237 CommandSelected.push([sub, CommandTitltName, AllDevicesID, GetCommand(sub, "Comm")+";;;"+GetCommand(sub, "Param"), GetCommand(sub, "Comm"), "0", "user", true]);1238 SetCommandAction(GetCommand(sub, "CommTitle"));1239 }1240 1241 document.getElementById("ShowInfoBtn").style.display = "none";1242 }1243 1244 break;1245 case 60:1246 var MsgBody= 'Do you want to get running service? <br> <div id="GetRunningService"></div>'; 1247 SetAlertMsgInnerHTML(Title, MsgBody);1248 document.getElementById("AlertMsgBtn").style.display = "none";1249 document.getElementById("ShowInfoBtn").style.display = "";1250 document.getElementById("ShowInfoBtn").onclick = function(e){1251 var items = GetDeviceTag();1252 1253 for (var i = 0; i < items.length; i++) {1254 AllDevicesID += items[i] +"/"; 1255 }1256 if(purpose === "device-management"){1257 if(noTagSelect(items.length))1258 SendByGolang(AllDevicesID, GetCommand(sub, "Comm")+";;;"+GetCommand(sub, "Param"), GetCommand(sub, "Comm"), "0", "user");1259 }else if(purpose === "schedule"){1260 CommandSelected.push([sub, CommandTitltName, AllDevicesID, GetCommand(sub, "Comm")+";;;"+GetCommand(sub, "Param"), GetCommand(sub, "Comm"), "0", "user", true]);1261 SetCommandAction(GetCommand(sub, "CommTitle"));1262 }1263 document.getElementById("ShowInfoBtn").style.display = "none";1264 }1265 1266 break;1267 case 61:1268 var MsgBody= 'Do you want to terminate process? <br>'; 1269 SetAlertMsgInnerHTML(Title, MsgBody);1270 document.getElementById("AlertMsgBtn").style.display = "";1271 document.getElementById("AlertMsgBtn").onclick = function(e) {1272 var items = GetDeviceTag();1273 1274 for (var i = 0; i < items.length; i++) {1275 AllDevicesID += items[i] +"/"; 1276 }1277 if(purpose === "device-management"){1278 if(noTagSelect(items.length))1279 SendByGolang(AllDevicesID, GetCommand(sub, "Comm")+";;;"+GetCommand(sub, "Param"), GetCommand(sub, "Comm"), "terminate top activity", "user");1280 }else if(purpose === "schedule"){1281 CommandSelected.push([sub, CommandTitltName, AllDevicesID, GetCommand(sub, "Comm")+";;;"+GetCommand(sub, "Param"), GetCommand(sub, "Comm"), "terminate top activity", "user", true]);1282 SetCommandAction(GetCommand(sub, "CommTitle"));1283 }1284 1285 };1286 break;1287 case 62:1288 var MsgBody= 'Do you want to restart agent? <br>'; 1289 SetAlertMsgInnerHTML(Title, MsgBody);1290 document.getElementById("AlertMsgBtn").style.display = "";1291 document.getElementById("AlertMsgBtn").onclick = function(e) {1292 var items = GetDeviceTag();1293 1294 for (var i = 0; i < items.length; i++) {1295 AllDevicesID += items[i] +"/"; 1296 }1297 if(purpose === "device-management"){1298 if(noTagSelect(items.length))1299 SendByGolang(AllDevicesID, GetCommand(sub, "Comm")+";;;"+GetCommand(sub, "Param"), GetCommand(sub, "Comm"), "restart agent", "user"); 1300 }else if(purpose === "schedule"){1301 CommandSelected.push([sub, CommandTitltName, AllDevicesID, GetCommand(sub, "Comm")+";;;"+GetCommand(sub, "Param"), GetCommand(sub, "Comm"), "restart agent", "user", true]);1302 SetCommandAction(GetCommand(sub, "CommTitle"));1303 }1304 1305 };1306 break;1307 case 63:1308 var MsgBody= 'Do you want to Enable camera? <br>'; 1309 SetAlertMsgInnerHTML(Title, MsgBody);1310 document.getElementById("AlertMsgBtn").style.display = "";1311 document.getElementById("AlertMsgBtn").onclick = function(e) {1312 var items = GetDeviceTag();1313 1314 for (var i = 0; i < items.length; i++) {1315 AllDevicesID += items[i] +"/"; 1316 }1317 if(purpose === "device-management"){1318 if(noTagSelect(items.length))1319 SendByGolang(AllDevicesID, GetCommand(sub, "Comm")+";;;1", GetCommand(sub, "Comm"), "enable", "user"); 1320 }else if(purpose === "schedule"){1321 CommandSelected.push([sub, CommandTitltName, AllDevicesID, GetCommand(sub, "Comm")+";;;1", GetCommand(sub, "Comm"), "enable", "user", true]);1322 SetCommandAction(GetCommand(sub, "CommTitle"));1323 }1324 1325 };1326 break;1327 case 64:1328 var MsgBody= 'Do you want to disable camera? <br>'; 1329 SetAlertMsgInnerHTML(Title, MsgBody);1330 document.getElementById("AlertMsgBtn").style.display = "";1331 document.getElementById("AlertMsgBtn").onclick = function(e) {1332 var items = GetDeviceTag();1333 1334 for (var i = 0; i < items.length; i++) {1335 AllDevicesID += items[i] +"/"; 1336 }1337 if(purpose === "device-management"){1338 if(noTagSelect(items.length))1339 SendByGolang(AllDevicesID, GetCommand(sub, "Comm")+";;;888", GetCommand(sub, "Comm"), "disable", "user"); 1340 }else if(purpose === "schedule"){1341 CommandSelected.push([sub, CommandTitltName, AllDevicesID, GetCommand(sub, "Comm")+";;;888", GetCommand(sub, "Comm"), "disable", "user", true]);1342 SetCommandAction(GetCommand(sub, "CommTitle"));1343 }1344 1345 };1346 break;1347 case 65:1348 var MsgBody= ' Please enter ftp information<br>Ftp account: <input id="FtpAccount" class="form-control" type="text">'+1349 '<br>Ftp password: <input id="FtpPassword" class="form-control" type="text">'+1350 '<br>Ftp host: <input id="FtpHost" class="form-control" type="text">'+1351 '<br>File name: <input id="FileName" class="form-control" type="text">';1352 SetAlertMsgInnerHTML(Title, MsgBody);1353 document.getElementById("ShowInfoBtn").style.display = "";1354 document.getElementById("ShowInfoBtn").onclick = function(e) {1355 var items = GetDeviceTag();1356 var FtpAccount = $('#FtpAccount').val();1357 var FtpPassword = $('#FtpPassword').val();1358 var FtpHost = $('#FtpHost').val();1359 var FileName = $('#FileName').val();1360 if(FtpAccount === "" || FtpPassword === "" || FtpHost === "" || FileName === ""){1361 document.getElementById("AlertMsgBody").innerHTML+='<div class="alert alert-danger">'+1362 '<strong>Warning:</strong> Please enter ftp information.'+1363 ' </div>';1364 }else{1365 for (var i = 0; i < items.length; i++) {1366 AllDevicesID += items[i] +"/"; 1367 }1368 if(purpose === "device-management"){1369 if(noTagSelect(items.length))1370 SendByGolang(AllDevicesID, GetCommand(sub, "Comm")+";;;"+FtpAccount+';;'+FtpPassword+';;'+FtpHost+';;'+FileName, GetCommand(sub, "CommTitle"), "Deny", "user"); 1371 }else if(purpose === "schedule"){1372 CommandSelected.push([sub, CommandTitltName, AllDevicesID, GetCommand(sub, "Comm")+"@%@"+GetCommand(sub, "Path")+"@%@;;;"+'add;;2:'+PackageName+':0', GetCommand(sub, "CommTitle"), "Deny", "user", true]);1373 SetCommandAction(GetCommand(sub, "CommTitle"));1374 }1375 $('#myModal').modal('hide');1376 }1377 }1378 break;1379 case 66:1380 var MsgBody= 'Do you want to get coordinates continuously ? <br>'; 1381 SetAlertMsgInnerHTML(Title, MsgBody);1382 document.getElementById("AlertMsgBtn").style.display = "";1383 document.getElementById("AlertMsgBtn").onclick = function(e) {1384 var items = GetDeviceTag();1385 1386 for (var i = 0; i < items.length; i++) {1387 AllDevicesID += items[i] +"/"; 1388 }1389 if(purpose === "device-management"){1390 if(noTagSelect(items.length))1391 SendByGolang(AllDevicesID, GetCommand(sub, "Comm")+";;;"+GetCommand(sub, "Param"), GetCommand(sub, "Comm"), "enable", "user"); 1392 }else if(purpose === "schedule"){1393 CommandSelected.push([sub, CommandTitltName, AllDevicesID, GetCommand(sub, "Comm")+";;;"+GetCommand(sub, "Param"), GetCommand(sub, "Comm"), "enable", "user", true]);1394 SetCommandAction(GetCommand(sub, "CommTitle"));1395 }1396 1397 };1398 break;1399 case 67:1400 var MsgBody= 'Do you want to stop getting coordinates? <br>'; 1401 SetAlertMsgInnerHTML(Title, MsgBody);1402 document.getElementById("AlertMsgBtn").style.display = "";1403 document.getElementById("AlertMsgBtn").onclick = function(e) {1404 var items = GetDeviceTag();1405 1406 for (var i = 0; i < items.length; i++) {1407 AllDevicesID += items[i] +"/"; 1408 }1409 if(purpose === "device-management"){1410 if(noTagSelect(items.length))1411 SendByGolang(AllDevicesID, GetCommand(sub, "Comm")+";;;"+GetCommand(sub, "Param"), GetCommand(sub, "Comm"), "disable", "user"); 1412 }else if(purpose === "schedule"){1413 CommandSelected.push([sub, CommandTitltName, AllDevicesID, GetCommand(sub, "Comm")+";;;"+GetCommand(sub, "Param"), GetCommand(sub, "Comm"), "disable", "user", true]);1414 SetCommandAction(GetCommand(sub, "CommTitle"));1415 }1416 1417 };1418 break;1419 case 69:1420 var MsgBody= 'Do you want to enable gps? <br>'; 1421 SetAlertMsgInnerHTML(Title, MsgBody);1422 document.getElementById("AlertMsgBtn").style.display = "";1423 document.getElementById("AlertMsgBtn").onclick = function(e) {1424 var items = GetDeviceTag();1425 1426 for (var i = 0; i < items.length; i++) {1427 AllDevicesID += items[i] +"/"; 1428 }1429 if(purpose === "device-management"){1430 if(noTagSelect(items.length))1431 SendByGolang(AllDevicesID, GetCommand(sub, "Comm")+"@%@"+GetCommand(sub, "Path")+"@%@;;;"+GetCommand(sub, "Param"), GetCommand(sub, "CommTitle"), "enable", "user"); 1432 }else if(purpose === "schedule"){1433 CommandSelected.push([sub, CommandTitltName, GetCommand(sub, "Comm")+"@%@"+GetCommand(sub, "Path")+"@%@;;;"+GetCommand(sub, "Param"), GetCommand(sub, "CommTitle"), "enable", "user", true]);1434 SetCommandAction(GetCommand(sub, "CommTitle"));1435 }1436 1437 };1438 break;1439 case 70:1440 var MsgBody= 'Do you want to disable gps? <br>'; 1441 SetAlertMsgInnerHTML(Title, MsgBody);1442 document.getElementById("AlertMsgBtn").style.display = "";1443 document.getElementById("AlertMsgBtn").onclick = function(e) {1444 var items = GetDeviceTag();1445 1446 for (var i = 0; i < items.length; i++) {1447 AllDevicesID += items[i] +"/"; 1448 }1449 if(purpose === "device-management"){1450 if(noTagSelect(items.length))1451 SendByGolang(AllDevicesID, GetCommand(sub, "Comm")+"@%@"+GetCommand(sub, "Path")+"@%@;;;"+GetCommand(sub, "Param"), GetCommand(sub, "CommTitle"), "disable", "user"); 1452 }else if(purpose === "schedule"){1453 CommandSelected.push([sub, CommandTitltName, GetCommand(sub, "Comm")+"@%@"+GetCommand(sub, "Path")+"@%@;;;"+GetCommand(sub, "Param"), GetCommand(sub, "CommTitle"), "disable", "user", true]);1454 SetCommandAction(GetCommand(sub, "CommTitle"));1455 }1456 1457 };1458 break;1459 case 71:1460 var MsgBody= 'Do you want to enable unknown sources? <br>'; 1461 SetAlertMsgInnerHTML(Title, MsgBody);1462 document.getElementById("AlertMsgBtn").style.display = "";1463 document.getElementById("AlertMsgBtn").onclick = function(e) {1464 var items = GetDeviceTag();1465 1466 for (var i = 0; i < items.length; i++) {1467 AllDevicesID += items[i] +"/"; 1468 }1469 if(purpose === "device-management"){1470 if(noTagSelect(items.length))1471 SendByGolang(AllDevicesID, GetCommand(sub, "Comm")+"@%@"+GetCommand(sub, "Path")+"@%@;;;"+GetCommand(sub, "Param"), GetCommand(sub, "CommTitle"), "enable", "user"); 1472 }else if(purpose === "schedule"){1473 CommandSelected.push([sub, CommandTitltName, GetCommand(sub, "Comm")+"@%@"+GetCommand(sub, "Path")+"@%@;;;"+GetCommand(sub, "Param"), GetCommand(sub, "CommTitle"), "enable", "user", true]);1474 SetCommandAction(GetCommand(sub, "CommTitle"));1475 }1476 1477 };1478 break;1479 case 72:1480 var MsgBody= 'Do you want to disable unknown sources? <br>'; 1481 SetAlertMsgInnerHTML(Title, MsgBody);1482 document.getElementById("AlertMsgBtn").style.display = "";1483 document.getElementById("AlertMsgBtn").onclick = function(e) {1484 var items = GetDeviceTag();1485 1486 for (var i = 0; i < items.length; i++) {1487 AllDevicesID += items[i] +"/"; 1488 }1489 if(purpose === "device-management"){1490 if(noTagSelect(items.length))1491 SendByGolang(AllDevicesID, GetCommand(sub, "Comm")+"@%@"+GetCommand(sub, "Path")+"@%@;;;"+GetCommand(sub, "Param"), GetCommand(sub, "CommTitle"), "disable", "user"); 1492 }else if(purpose === "schedule"){1493 CommandSelected.push([sub, CommandTitltName, GetCommand(sub, "Comm")+"@%@"+GetCommand(sub, "Path")+"@%@;;;"+GetCommand(sub, "Param"), GetCommand(sub, "CommTitle"), "disable", "user", true]);1494 SetCommandAction(GetCommand(sub, "CommTitle"));1495 }1496 1497 };1498 break;1499 case 73:1500 var MsgBody= 'Do you want to enable developer option? <br>'; 1501 SetAlertMsgInnerHTML(Title, MsgBody);1502 document.getElementById("AlertMsgBtn").style.display = "";1503 document.getElementById("AlertMsgBtn").onclick = function(e) {1504 var items = GetDeviceTag();1505 1506 for (var i = 0; i < items.length; i++) {1507 AllDevicesID += items[i] +"/"; 1508 }1509 if(purpose === "device-management"){1510 if(noTagSelect(items.length))1511 SendByGolang(AllDevicesID, GetCommand(sub, "Comm")+"@%@"+GetCommand(sub, "Path")+"@%@;;;"+GetCommand(sub, "Param"), GetCommand(sub, "CommTitle"), "enable", "user"); 1512 }else if(purpose === "schedule"){1513 CommandSelected.push([sub, CommandTitltName, GetCommand(sub, "Comm")+"@%@"+GetCommand(sub, "Path")+"@%@;;;"+GetCommand(sub, "Param"), GetCommand(sub, "CommTitle"), "enable", "user", true]);1514 SetCommandAction(GetCommand(sub, "CommTitle"));1515 }1516 1517 };1518 break;1519 case 74:1520 var MsgBody= 'Do you want to disable DeveloperOption? <br>'; 1521 SetAlertMsgInnerHTML(Title, MsgBody);1522 document.getElementById("AlertMsgBtn").style.display = "";1523 document.getElementById("AlertMsgBtn").onclick = function(e) {1524 var items = GetDeviceTag();1525 1526 for (var i = 0; i < items.length; i++) {1527 AllDevicesID += items[i] +"/"; 1528 }1529 if(purpose === "device-management"){1530 if(noTagSelect(items.length))1531 SendByGolang(AllDevicesID, GetCommand(sub, "Comm")+"@%@"+GetCommand(sub, "Path")+"@%@;;;"+GetCommand(sub, "Param"), GetCommand(sub, "CommTitle"), "disable", "user"); 1532 }else if(purpose === "schedule"){1533 CommandSelected.push([sub, CommandTitltName, GetCommand(sub, "Comm")+"@%@"+GetCommand(sub, "Path")+"@%@;;;"+GetCommand(sub, "Param"), GetCommand(sub, "CommTitle"), "disable", "user", true]);1534 SetCommandAction(GetCommand(sub, "CommTitle"));1535 }1536 1537 };1538 break;1539 case 77:1540 var MsgBody= 'Do you want to enable auto time? <br>'; 1541 SetAlertMsgInnerHTML(Title, MsgBody);1542 document.getElementById("AlertMsgBtn").style.display = "";1543 document.getElementById("AlertMsgBtn").onclick = function(e) {1544 var items = GetDeviceTag();1545 1546 for (var i = 0; i < items.length; i++) {1547 AllDevicesID += items[i] +"/"; 1548 }1549 if(purpose === "device-management"){1550 if(noTagSelect(items.length))1551 SendByGolang(AllDevicesID, GetCommand(sub, "Comm")+"@%@"+GetCommand(sub, "Path")+"@%@;;;"+GetCommand(sub, "Param"), GetCommand(sub, "CommTitle"), "enable", "user"); 1552 }else if(purpose === "schedule"){1553 CommandSelected.push([sub, CommandTitltName, GetCommand(sub, "Comm")+"@%@"+GetCommand(sub, "Path")+"@%@;;;"+GetCommand(sub, "Param"), GetCommand(sub, "CommTitle"), "enable", "user", true]);1554 SetCommandAction(GetCommand(sub, "CommTitle"));1555 }1556 1557 };1558 break;1559 case 78:1560 var MsgBody= 'Do you want to disable auto time? <br>'; 1561 SetAlertMsgInnerHTML(Title, MsgBody);1562 document.getElementById("AlertMsgBtn").style.display = "";1563 document.getElementById("AlertMsgBtn").onclick = function(e) {1564 var items = GetDeviceTag();1565 1566 for (var i = 0; i < items.length; i++) {1567 AllDevicesID += items[i] +"/"; 1568 }1569 if(purpose === "device-management"){1570 if(noTagSelect(items.length))1571 SendByGolang(AllDevicesID, GetCommand(sub, "Comm")+"@%@"+GetCommand(sub, "Path")+"@%@;;;"+GetCommand(sub, "Param"), GetCommand(sub, "CommTitle"), "disable", "user"); 1572 }else if(purpose === "schedule"){1573 CommandSelected.push([sub, CommandTitltName, GetCommand(sub, "Comm")+"@%@"+GetCommand(sub, "Path")+"@%@;;;"+GetCommand(sub, "Param"), GetCommand(sub, "CommTitle"), "disable", "user", true]);1574 SetCommandAction(GetCommand(sub, "CommTitle"));1575 }1576 1577 };1578 break;1579 case 79:1580 var MsgBody= 'Do you want to enable auto time zone? <br>'; 1581 SetAlertMsgInnerHTML(Title, MsgBody);1582 document.getElementById("AlertMsgBtn").style.display = "";1583 document.getElementById("AlertMsgBtn").onclick = function(e) {1584 var items = GetDeviceTag();1585 1586 for (var i = 0; i < items.length; i++) {1587 AllDevicesID += items[i] +"/"; 1588 }1589 if(purpose === "device-management"){1590 if(noTagSelect(items.length))1591 SendByGolang(AllDevicesID, GetCommand(sub, "Comm")+"@%@"+GetCommand(sub, "Path")+"@%@;;;"+GetCommand(sub, "Param"), GetCommand(sub, "CommTitle"), "enable", "user"); 1592 }else if(purpose === "schedule"){1593 CommandSelected.push([sub, CommandTitltName, GetCommand(sub, "Comm")+"@%@"+GetCommand(sub, "Path")+"@%@;;;"+GetCommand(sub, "Param"), GetCommand(sub, "CommTitle"), "enable", "user", true]);1594 SetCommandAction(GetCommand(sub, "CommTitle"));1595 }1596 1597 };1598 break;1599 case 80:1600 var MsgBody= 'Do you want to disable auto time zone? <br>'; 1601 SetAlertMsgInnerHTML(Title, MsgBody);1602 document.getElementById("AlertMsgBtn").style.display = "";1603 document.getElementById("AlertMsgBtn").onclick = function(e) {1604 var items = GetDeviceTag();1605 1606 for (var i = 0; i < items.length; i++) {1607 AllDevicesID += items[i] +"/"; 1608 }1609 if(purpose === "device-management"){1610 if(noTagSelect(items.length))1611 SendByGolang(AllDevicesID, GetCommand(sub, "Comm")+"@%@"+GetCommand(sub, "Path")+"@%@;;;"+GetCommand(sub, "Param"), GetCommand(sub, "CommTitle"), "disable", "user"); 1612 }else if(purpose === "schedule"){1613 CommandSelected.push([sub, CommandTitltName, GetCommand(sub, "Comm")+"@%@"+GetCommand(sub, "Path")+"@%@;;;"+GetCommand(sub, "Param"), GetCommand(sub, "CommTitle"), "disable", "user", true]);1614 SetCommandAction(GetCommand(sub, "CommTitle"));1615 }1616 1617 };1618 break;1619 case 81:1620 var MsgBody= 'Do you want to enable home button? <br>'; 1621 SetAlertMsgInnerHTML(Title, MsgBody);1622 document.getElementById("AlertMsgBtn").style.display = "";1623 document.getElementById("AlertMsgBtn").onclick = function(e) {1624 var items = GetDeviceTag();1625 1626 for (var i = 0; i < items.length; i++) {1627 AllDevicesID += items[i] +"/"; 1628 }1629 if(purpose === "device-management"){1630 if(noTagSelect(items.length)){1631 SendByGolang(AllDevicesID, GetCommand(sub, "Comm")+"@%@"+GetCommand(sub, "Path")+"@%@;;;"+GetCommand(sub, "Param"), GetCommand(sub, "CommTitle"), "enable", "user"); 1632 SendByGolang(AllDevicesID, GetCommand(43, "Comm")+"@%@"+GetCommand(43, "Path")+"@%@;;;"+GetCommand(43, "Param"), "reboot", "true", "system");1633 }1634 }else if(purpose === "schedule"){1635 CommandSelected.push([sub, CommandTitltName, GetCommand(sub, "Comm")+"@%@"+GetCommand(sub, "Path")+"@%@;;;"+GetCommand(sub, "Param"), GetCommand(sub, "CommTitle"), "enable", "user", true]);1636 SetCommandAction(GetCommand(sub, "CommTitle"));1637 }1638 1639 };1640 break;1641 case 82:1642 var MsgBody= 'Do you want to disable home button? <br>'; 1643 SetAlertMsgInnerHTML(Title, MsgBody);1644 document.getElementById("AlertMsgBtn").style.display = "";1645 document.getElementById("AlertMsgBtn").onclick = function(e) {1646 var items = GetDeviceTag();1647 1648 for (var i = 0; i < items.length; i++) {1649 AllDevicesID += items[i] +"/"; 1650 }1651 if(purpose === "device-management"){1652 if(noTagSelect(items.length)){1653 SendByGolang(AllDevicesID, GetCommand(sub, "Comm")+"@%@"+GetCommand(sub, "Path")+"@%@;;;"+GetCommand(sub, "Param"), GetCommand(sub, "CommTitle"), "disable", "user"); 1654 SendByGolang(AllDevicesID, GetCommand(43, "Comm")+"@%@"+GetCommand(43, "Path")+"@%@;;;"+GetCommand(43, "Param"), "reboot", "true", "system");1655 }1656 }else if(purpose === "schedule"){1657 CommandSelected.push([sub, CommandTitltName, GetCommand(sub, "Comm")+"@%@"+GetCommand(sub, "Path")+"@%@;;;"+GetCommand(sub, "Param"), GetCommand(sub, "CommTitle"), "disable", "user", true]);1658 SetCommandAction(GetCommand(sub, "CommTitle"));1659 }1660 1661 };1662 break;1663 case 83:1664 var MsgBody= 'Do you want to enable NFC? <br>'; 1665 SetAlertMsgInnerHTML(Title, MsgBody);1666 document.getElementById("AlertMsgBtn").style.display = "";1667 document.getElementById("AlertMsgBtn").onclick = function(e) {1668 var items = GetDeviceTag();1669 1670 for (var i = 0; i < items.length; i++) {1671 AllDevicesID += items[i] +"/"; 1672 }1673 if(purpose === "device-management"){1674 if(noTagSelect(items.length))1675 SendByGolang(AllDevicesID, GetCommand(sub, "Comm")+"@%@"+GetCommand(sub, "Path")+"@%@;;;"+GetCommand(sub, "Param"), GetCommand(sub, "CommTitle"), "enable", "user"); 1676 }else if(purpose === "schedule"){1677 CommandSelected.push([sub, CommandTitltName, GetCommand(sub, "Comm")+"@%@"+GetCommand(sub, "Path")+"@%@;;;"+GetCommand(sub, "Param"), GetCommand(sub, "CommTitle"), "enable", "user", true]);1678 SetCommandAction(GetCommand(sub, "CommTitle"));1679 }1680 1681 };1682 break;1683 case 84:1684 var MsgBody= 'Do you want to disable NFC? <br>'; 1685 SetAlertMsgInnerHTML(Title, MsgBody);1686 document.getElementById("AlertMsgBtn").style.display = "";1687 document.getElementById("AlertMsgBtn").onclick = function(e) {1688 var items = GetDeviceTag();1689 1690 for (var i = 0; i < items.length; i++) {1691 AllDevicesID += items[i] +"/"; 1692 }1693 if(purpose === "device-management"){1694 if(noTagSelect(items.length))1695 SendByGolang(AllDevicesID, GetCommand(sub, "Comm")+"@%@"+GetCommand(sub, "Path")+"@%@;;;"+GetCommand(sub, "Param"), GetCommand(sub, "CommTitle"), "disable", "user"); 1696 }else if(purpose === "schedule"){1697 CommandSelected.push([sub, CommandTitltName, GetCommand(sub, "Comm")+"@%@"+GetCommand(sub, "Path")+"@%@;;;"+GetCommand(sub, "Param"), GetCommand(sub, "CommTitle"), "disable", "user", true]);1698 SetCommandAction(GetCommand(sub, "CommTitle"));1699 }1700 1701 };1702 break;1703 case 87:1704 var MsgBody= 'Do you want to enable mobile data? <br>'; 1705 SetAlertMsgInnerHTML(Title, MsgBody);1706 document.getElementById("AlertMsgBtn").style.display = "";1707 document.getElementById("AlertMsgBtn").onclick = function(e) {1708 var items = GetDeviceTag();1709 1710 for (var i = 0; i < items.length; i++) {1711 AllDevicesID += items[i] +"/"; 1712 }1713 if(purpose === "device-management"){1714 if(noTagSelect(items.length))1715 SendByGolang(AllDevicesID, GetCommand(sub, "Comm")+"@%@"+GetCommand(sub, "Path")+"@%@;;;"+GetCommand(sub, "Param"), GetCommand(sub, "CommTitle"), "enable", "user"); 1716 }else if(purpose === "schedule"){1717 CommandSelected.push([sub, CommandTitltName, GetCommand(sub, "Comm")+"@%@"+GetCommand(sub, "Path")+"@%@;;;"+GetCommand(sub, "Param"), GetCommand(sub, "CommTitle"), "enable", "user", true]);1718 SetCommandAction(GetCommand(sub, "CommTitle"));1719 }1720 1721 };1722 break;1723 case 88:1724 var MsgBody= 'Do you want to disable mobile data? <br>'; 1725 SetAlertMsgInnerHTML(Title, MsgBody);1726 document.getElementById("AlertMsgBtn").style.display = "";1727 document.getElementById("AlertMsgBtn").onclick = function(e) {1728 var items = GetDeviceTag();1729 1730 for (var i = 0; i < items.length; i++) {1731 AllDevicesID += items[i] +"/"; 1732 }1733 if(purpose === "device-management"){1734 if(noTagSelect(items.length))1735 SendByGolang(AllDevicesID, GetCommand(sub, "Comm")+"@%@"+GetCommand(sub, "Path")+"@%@;;;"+GetCommand(sub, "Param"), GetCommand(sub, "CommTitle"), "disable", "user"); 1736 }else if(purpose === "schedule"){1737 CommandSelected.push([sub, CommandTitltName, GetCommand(sub, "Comm")+"@%@"+GetCommand(sub, "Path")+"@%@;;;"+GetCommand(sub, "Param"), GetCommand(sub, "CommTitle"), "disable", "user", true]);1738 SetCommandAction(GetCommand(sub, "CommTitle"));1739 }1740 1741 };1742 break;1743 case 89:1744 var MsgBody= 'Do you want to enable data roaming? <br>'; 1745 SetAlertMsgInnerHTML(Title, MsgBody);1746 document.getElementById("AlertMsgBtn").style.display = "";1747 document.getElementById("AlertMsgBtn").onclick = function(e) {1748 var items = GetDeviceTag();1749 1750 for (var i = 0; i < items.length; i++) {1751 AllDevicesID += items[i] +"/"; 1752 }1753 if(purpose === "device-management"){1754 if(noTagSelect(items.length))1755 SendByGolang(AllDevicesID, GetCommand(sub, "Comm")+"@%@"+GetCommand(sub, "Path")+"@%@;;;"+GetCommand(sub, "Param"), GetCommand(sub, "CommTitle"), "enable", "user"); 1756 }else if(purpose === "schedule"){1757 CommandSelected.push([sub, CommandTitltName, GetCommand(sub, "Comm")+"@%@"+GetCommand(sub, "Path")+"@%@;;;"+GetCommand(sub, "Param"), GetCommand(sub, "CommTitle"), "enable", "user", true]);1758 SetCommandAction(GetCommand(sub, "CommTitle"));1759 }1760 1761 };1762 break;1763 case 90:1764 var MsgBody= 'Do you want to disable data roaming? <br>'; 1765 SetAlertMsgInnerHTML(Title, MsgBody);1766 document.getElementById("AlertMsgBtn").style.display = "";1767 document.getElementById("AlertMsgBtn").onclick = function(e) {1768 var items = GetDeviceTag();1769 1770 for (var i = 0; i < items.length; i++) {1771 AllDevicesID += items[i] +"/"; 1772 }1773 if(purpose === "device-management"){1774 if(noTagSelect(items.length))1775 SendByGolang(AllDevicesID, GetCommand(sub, "Comm")+"@%@"+GetCommand(sub, "Path")+"@%@;;;"+GetCommand(sub, "Param"), GetCommand(sub, "CommTitle"), "disable", "user"); 1776 }else if(purpose === "schedule"){1777 CommandSelected.push([sub, CommandTitltName, GetCommand(sub, "Comm")+"@%@"+GetCommand(sub, "Path")+"@%@;;;"+GetCommand(sub, "Param"), GetCommand(sub, "CommTitle"), "disable", "user", true]);1778 SetCommandAction(GetCommand(sub, "CommTitle"));1779 }1780 1781 };1782 break;1783 case 91:1784 var MsgBody= 'Do you want to get prohibit install app list? <br>'; 1785 SetAlertMsgInnerHTML(Title, MsgBody);1786 document.getElementById("AlertMsgBtn").style.display = "";1787 document.getElementById("AlertMsgBtn").onclick = function(e) {1788 var items = GetDeviceTag();1789 1790 for (var i = 0; i < items.length; i++) {1791 AllDevicesID += items[i] +"/"; 1792 }1793 if(purpose === "device-management"){1794 if(noTagSelect(items.length))1795 SendByGolang(AllDevicesID, GetCommand(sub, "Comm")+"@%@"+GetCommand(sub, "Path")+"@%@;;;"+GetCommand(sub, "Param"), GetCommand(sub, "CommTitle"), "prohibit", "user"); 1796 }else if(purpose === "schedule"){1797 CommandSelected.push([sub, CommandTitltName, GetCommand(sub, "Comm")+"@%@"+GetCommand(sub, "Path")+"@%@;;;"+GetCommand(sub, "Param"), GetCommand(sub, "CommTitle"), "prohibit", "user", true]);1798 SetCommandAction(GetCommand(sub, "CommTitle"));1799 }1800 1801 };1802 break;1803 case 92:1804 var MsgBody= 'Do you want to get allow install app list? <br>'; 1805 SetAlertMsgInnerHTML(Title, MsgBody);1806 document.getElementById("AlertMsgBtn").style.display = "";1807 document.getElementById("AlertMsgBtn").onclick = function(e) {1808 var items = GetDeviceTag();1809 1810 for (var i = 0; i < items.length; i++) {1811 AllDevicesID += items[i] +"/"; 1812 }1813 if(purpose === "device-management"){1814 if(noTagSelect(items.length))1815 SendByGolang(AllDevicesID, GetCommand(sub, "Comm")+"@%@"+GetCommand(sub, "Path")+"@%@;;;"+GetCommand(sub, "Param"), GetCommand(sub, "CommTitle"), "allow", "user"); 1816 }else if(purpose === "schedule"){1817 CommandSelected.push([sub, CommandTitltName, GetCommand(sub, "Comm")+"@%@"+GetCommand(sub, "Path")+"@%@;;;"+GetCommand(sub, "Param"), GetCommand(sub, "CommTitle"), "allow", "user", true]);1818 SetCommandAction(GetCommand(sub, "CommTitle"));1819 }1820 1821 };1822 break;1823 case 93:1824 var MsgBody= 'Do you want to get prohibit launch app list? <br>'; 1825 SetAlertMsgInnerHTML(Title, MsgBody);1826 document.getElementById("AlertMsgBtn").style.display = "";1827 document.getElementById("AlertMsgBtn").onclick = function(e) {1828 var items = GetDeviceTag();1829 1830 for (var i = 0; i < items.length; i++) {1831 AllDevicesID += items[i] +"/"; 1832 }1833 if(purpose === "device-management"){1834 if(noTagSelect(items.length))1835 SendByGolang(AllDevicesID, GetCommand(sub, "Comm")+"@%@"+GetCommand(sub, "Path")+"@%@;;;"+GetCommand(sub, "Param"), GetCommand(sub, "CommTitle"), "prohibit", "user"); 1836 }else if(purpose === "schedule"){1837 CommandSelected.push([sub, CommandTitltName, GetCommand(sub, "Comm")+"@%@"+GetCommand(sub, "Path")+"@%@;;;"+GetCommand(sub, "Param"), GetCommand(sub, "CommTitle"), "prohibit", "user", true]);1838 SetCommandAction(GetCommand(sub, "CommTitle"));1839 }1840 1841 };1842 break;1843 case 94:1844 var MsgBody= 'Do you want to get allow launch app list? <br>'; 1845 SetAlertMsgInnerHTML(Title, MsgBody);1846 document.getElementById("AlertMsgBtn").style.display = "";1847 document.getElementById("AlertMsgBtn").onclick = function(e) {1848 var items = GetDeviceTag();1849 1850 for (var i = 0; i < items.length; i++) {1851 AllDevicesID += items[i] +"/"; 1852 }1853 if(purpose === "device-management"){1854 if(noTagSelect(items.length))1855 SendByGolang(AllDevicesID, GetCommand(sub, "Comm")+"@%@"+GetCommand(sub, "Path")+"@%@;;;"+GetCommand(sub, "Param"), GetCommand(sub, "CommTitle"), "allow", "user"); 1856 }else if(purpose === "schedule"){1857 CommandSelected.push([sub, CommandTitltName, GetCommand(sub, "Comm")+"@%@"+GetCommand(sub, "Path")+"@%@;;;"+GetCommand(sub, "Param"), GetCommand(sub, "CommTitle"), "allow", "user", true]);1858 SetCommandAction(GetCommand(sub, "CommTitle"));1859 }1860 1861 };1862 break;1863 case 95:1864 var MsgBody= 'Please set property name and value. <br>Property: <input id="PropertyName" class="form-control" type="text"><br>value: <input id="Value" class="form-control" type="text">'; 1865 SetAlertMsgInnerHTML(Title, MsgBody);1866 document.getElementById("AlertMsgBtn").style.display = "";1867 document.getElementById("AlertMsgBtn").onclick = function(e) {1868 var items = GetDeviceTag();1869 1870 for (var i = 0; i < items.length; i++) {1871 AllDevicesID += items[i] +"/"; 1872 }1873 var PropertyName = document.getElementById("PropertyName").value;1874 var PropertyValue = document.getElementById("Value").value;1875 if(purpose === "device-management"){1876 if(noTagSelect(items.length))1877 SendByGolang(AllDevicesID, GetCommand(sub, "Comm")+"@%@"+GetCommand(sub, "Path")+"@%@;;;SetProperty;;"+PropertyName+";;"+PropertyValue, PropertyName, PropertyValue, "user"); 1878 }else if(purpose === "schedule"){1879 CommandSelected.push([sub, CommandTitltName, GetCommand(sub, "Comm")+"@%@"+GetCommand(sub, "Path")+"@%@;;;"+GetCommand(sub, "Param"), GetCommand(sub, "CommTitle"), PropertyName, "user", true]);1880 SetCommandAction(GetCommand(sub, "CommTitle"));1881 }1882 1883 };1884 break;1885 case 96:1886 var MsgBody= 'Please enter property name. <br>Property: <input id="PropertyName" class="form-control" type="text"><br>result: <div id="PropertyResult"></div>'; 1887 SetAlertMsgInnerHTML(Title, MsgBody);1888 1889 document.getElementById("ShowInfoBtn").style.display = "";1890 document.getElementById("ShowInfoBtn").onclick = function(e) {1891 var items = GetDeviceTag();1892 1893 for (var i = 0; i < items.length; i++) {1894 AllDevicesID += items[i] +"/"; 1895 }1896 var PropertyName = document.getElementById("PropertyName").value;1897 if(purpose === "device-management"){1898 if(noTagSelect(items.length))1899 SendByGolang(AllDevicesID, GetCommand(sub, "Comm")+"@%@"+GetCommand(sub, "Path")+"@%@;;;"+GetCommand(sub, "Param")+PropertyName, GetCommand(sub, "CommTitle"), "", "user"); 1900 }else if(purpose === "schedule"){1901 CommandSelected.push([sub, CommandTitltName, GetCommand(sub, "Comm")+"@%@"+GetCommand(sub, "Path")+"@%@;;;"+GetCommand(sub, "Param")+PropertyName, GetCommand(sub, "CommTitle"), "", "user", true]);1902 SetCommandAction(GetCommand(sub, "CommTitle"));1903 }1904 1905 };1906 break;1907 case 97:1908 var MsgBody= 'Do you want to get all package name? <br>'; 1909 SetAlertMsgInnerHTML(Title, MsgBody);1910 document.getElementById("AlertMsgBtn").style.display = "";1911 document.getElementById("AlertMsgBtn").onclick = function(e) {1912 var items = GetDeviceTag();1913 1914 for (var i = 0; i < items.length; i++) {1915 AllDevicesID += items[i] +"/"; 1916 }1917 if(purpose === "device-management"){1918 if(noTagSelect(items.length))1919 SendByGolang(AllDevicesID, GetCommand(sub, "Comm")+"@%@"+GetCommand(sub, "Path")+"@%@;;;"+GetCommand(sub, "Param"), GetCommand(sub, "CommTitle"), "true", "user"); 1920 }else if(purpose === "schedule"){1921 CommandSelected.push([sub, CommandTitltName, GetCommand(sub, "Comm")+"@%@"+GetCommand(sub, "Path")+"@%@;;;"+GetCommand(sub, "Param"), GetCommand(sub, "CommTitle"), "allow", "user", true]);1922 SetCommandAction(GetCommand(sub, "CommTitle"));1923 }1924 1925 };1926 break;1927 case 98:1928 var MsgBody= 'Do you want to Hide back button? <br>'; 1929 SetAlertMsgInnerHTML(Title, MsgBody);1930 document.getElementById("AlertMsgBtn").style.display = "";1931 document.getElementById("AlertMsgBtn").onclick = function(e) {1932 var items = GetDeviceTag();1933 1934 for (var i = 0; i < items.length; i++) {1935 AllDevicesID += items[i] +"/"; 1936 }1937 if(purpose === "device-management"){1938 if(noTagSelect(items.length)){1939 SendByGolang(AllDevicesID, GetCommand(sub, "Comm")+"@%@"+GetCommand(sub, "Path")+"@%@;;;"+GetCommand(sub, "Param"), GetCommand(sub, "CommTitle"), "hide", "user"); 1940 setTimeout(function(){ 1941 SendByGolang(AllDevicesID, GetCommand(43, "Comm")+"@%@"+GetCommand(43, "Path")+"@%@;;;"+GetCommand(43, "Param"), "reboot", "true", "system");1942 }, 1500);1943 }1944 }else if(purpose === "schedule"){1945 CommandSelected.push([sub, CommandTitltName, GetCommand(sub, "Comm")+"@%@"+GetCommand(sub, "Path")+"@%@;;;"+GetCommand(sub, "Param"), GetCommand(sub, "CommTitle"), "allow", "user", true]);1946 SetCommandAction(GetCommand(sub, "CommTitle"));1947 }1948 1949 };1950 break;1951 case 99:1952 var MsgBody= 'Do you want to Show back button? <br>'; 1953 SetAlertMsgInnerHTML(Title, MsgBody);1954 document.getElementById("AlertMsgBtn").style.display = "";1955 document.getElementById("AlertMsgBtn").onclick = function(e) {1956 var items = GetDeviceTag();1957 1958 for (var i = 0; i < items.length; i++) {1959 AllDevicesID += items[i] +"/"; 1960 }1961 if(purpose === "device-management"){1962 if(noTagSelect(items.length)){1963 SendByGolang(AllDevicesID, GetCommand(sub, "Comm")+"@%@"+GetCommand(sub, "Path")+"@%@;;;"+GetCommand(sub, "Param"), GetCommand(sub, "CommTitle"), "show", "user"); 1964 setTimeout(function(){ 1965 SendByGolang(AllDevicesID, GetCommand(43, "Comm")+"@%@"+GetCommand(43, "Path")+"@%@;;;"+GetCommand(43, "Param"), "reboot", "true", "system");1966 }, 1500);1967 }1968 }else if(purpose === "schedule"){1969 CommandSelected.push([sub, CommandTitltName, GetCommand(sub, "Comm")+"@%@"+GetCommand(sub, "Path")+"@%@;;;"+GetCommand(sub, "Param"), GetCommand(sub, "CommTitle"), "allow", "user", true]);1970 SetCommandAction(GetCommand(sub, "CommTitle"));1971 }1972 1973 };1974 break;1975 case 101:1976 var MsgBody= ' Please enter Broker information<br>Broker address: <input id="BrokerAddress" class="form-control" type="text">'+1977 '<br>Broker port: <input id="BrokerPort" class="form-control" type="text">'+1978 '<br>Svr topic: <input id="SvrTopic" class="form-control" type="text">'+1979 '<br>Cln topic: <input id="ClnTopic" class="form-control" type="text">';1980 SetAlertMsgInnerHTML(Title, MsgBody);1981 document.getElementById("ShowInfoBtn").style.display = "";1982 document.getElementById("ShowInfoBtn").onclick = function(e) {1983 var items = GetDeviceTag();1984 var BrokerAddress = $('#BrokerAddress').val();1985 var BrokerPort = $('#BrokerPort').val();1986 var SvrTopic = $('#SvrTopic').val();1987 var ClnTopic = $('#ClnTopic').val();1988 if(BrokerAddress === "" || BrokerPort === "" || SvrTopic === "" || ClnTopic === ""){1989 document.getElementById("AlertMsgBody").innerHTML+='<div class="alert alert-danger">'+1990 '<strong>Warning:</strong> Please enter broker information.'+1991 ' </div>';1992 }else{1993 for (var i = 0; i < items.length; i++) {1994 AllDevicesID += items[i] +"/"; 1995 }1996 if(purpose === "device-management"){1997 if(noTagSelect(items.length))1998 SendByGolang(AllDevicesID, GetCommand(sub, "Comm")+"@%@"+GetCommand(sub, "Path")+"@%@;;;ChangeBroker;;"+BrokerAddress+';;'+BrokerPort+';;'+SvrTopic+';;'+ClnTopic, GetCommand(sub, "CommTitle"), BrokerAddress, "user"); 1999 }else if(purpose === "schedule"){2000 CommandSelected.push([sub, CommandTitltName, AllDevicesID, GetCommand(sub, "Comm")+"@%@"+GetCommand(sub, "Path")+"@%@;;;ChangeBroker;;"+BrokerAddress+';;'+BrokerPort+';;'+SvrTopic+';;'+ClnTopic, GetCommand(sub, "CommTitle"), BrokerAddress, "user", true]);2001 SetCommandAction(GetCommand(sub, "CommTitle"));2002 }2003 $('#myModal').modal('hide');2004 }2005 }2006 break;2007 }...

Full Screen

Full Screen

Using AI Code Generation

copy

Full Screen

1const storybookRoot = require('storybook-root');2const command = storybookRoot.getCommand();3const storybookRoot = require('storybook-root');4const command = storybookRoot.getCommand();5const storybookRoot = require('storybook-root');6const command = storybookRoot.getCommand();7const storybookRoot = require('storybook-root');8const command = storybookRoot.getCommand();9const storybookRoot = require('storybook-root');10const command = storybookRoot.getCommand();11const storybookRoot = require('storybook-root');12const command = storybookRoot.getCommand();13const storybookRoot = require('storybook-root');14const command = storybookRoot.getCommand();15const storybookRoot = require('storybook-root');16const command = storybookRoot.getCommand();17const storybookRoot = require('storybook-root');18const command = storybookRoot.getCommand();19const storybookRoot = require('storybook-root');20const command = storybookRoot.getCommand();21const storybookRoot = require('storybook-root');22const command = storybookRoot.getCommand();23const storybookRoot = require('storybook-root');24const command = storybookRoot.getCommand();25const storybookRoot = require('storybook-root');26const command = storybookRoot.getCommand();27const storybookRoot = require('storybook-root');28const command = storybookRoot.getCommand();29const storybookRoot = require('storybook-root');30const command = storybookRoot.getCommand();

Full Screen

Using AI Code Generation

copy

Full Screen

1const { getCommand } = require('@storybook/core/server');2const { buildDevStandalone } = require('@storybook/core/dist/server/build-dev-standalone');3const { buildDevStandalone } = require('@storybook/core/dist/server/build-dev-standalone');4const { buildDevStandalone } = require('@storybook/core/dist/server/build-dev-standalone');5const { buildDevStandalone } = require('@storybook/core/dist/server/build-dev-standalone');6const { buildDevStandalone } = require('@storybook/core/dist/server/build-dev-standalone');7const { buildDevStandalone } = require('@storybook/core/dist/server/build-dev-standalone');8const { buildDevStandalone } = require('@storybook/core/dist/server/build-dev-standalone');9const { buildDevStandalone } = require('@storybook/core/dist/server/build-dev-standalone');10const { buildDevStandalone } = require('@storybook/core/dist/server/build-dev-standalone');11const { buildDevStandalone } = require('@storybook/core/dist/server/build-dev-standalone');12const { buildDevStandalone } = require('@storybook/core/dist/server/build-dev-standalone');13const { buildDevStandalone } = require('@storybook/core/dist/server/build-dev-standalone');14const { buildDevStandalone } = require('@storybook/core/dist/server/build-dev-standalone');15const { buildDevStandalone } = require('@storybook/core/dist/server/build-dev-standalone');16const { buildDevStandalone } = require('@storybook

Full Screen

Using AI Code Generation

copy

Full Screen

1import {getCommand} from 'storybook-root';2getCommand();3const getCommand = () => {4 return 'getCommand()';5};6export {getCommand};7"scripts": {8 },9 "devDependencies": {10 }11import {getCommand} from 'storybook-root';12getCommand();13const getCommand = () => {14 return 'getCommand()';15};16export {getCommand};17"scripts": {18 },19 "devDependencies": {20 }21import {getCommand} from 'storybook-root';22getCommand();23const getCommand = () => {24 return 'getCommand()';25};26export {getCommand};27"scripts": {28 },29 "devDependencies": {30 }31import {getCommand} from 'storybook-root';32getCommand();33const getCommand = () => {34 return 'getCommand()';35};36export {getCommand};37"scripts": {

Full Screen

Using AI Code Generation

copy

Full Screen

1import { getCommand } from 'storybook-root';2const command = getCommand();3module.exports = {4 stories: ['../src/**/*.stories.@(js|jsx|ts|tsx|mdx)'],5};6import { getCommand } from 'storybook-root';7const command = getCommand();8import { getCommand } from 'storybook-root';9const command = getCommand();10import { getCommand } from 'storybook-root';11const command = getCommand();12import { getCommand } from 'storybook-root';13const command = getCommand();14 import { getCommand } from 'storybook-root';15 const command = getCommand();16 import { getCommand } from 'storybook-root';17 const command = getCommand();18 import { getCommand } from 'storybook-root';19 const command = getCommand();20 import { getCommand } from 'storybook-root';21 const command = getCommand();

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run storybook-root automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful