浏览代码

Fix build issue - release

Sebastien 4 年之前
父节点
当前提交
5ff673ae7d
共有 2 个文件被更改,包括 16 次插入3 次删除
  1. 1 1
      components/services/CMakeLists.txt
  2. 15 2
      components/wifi-manager/code.js

+ 1 - 1
components/services/CMakeLists.txt

@@ -1,5 +1,5 @@
 idf_component_register(SRC_DIRS .
-						INCLUDE_DIRS . 
+						INCLUDE_DIRS .  ${IDF_PATH}/components/driver
 						REQUIRES json tools platform_config display
 
 )

+ 15 - 2
components/wifi-manager/code.js

@@ -65,7 +65,17 @@ var RefreshAPIIntervalActive = false;
 var LastRecoveryState=null;
 var LastCommandsState=null;
 var output = '';
+function delay_msg(t, v) {
+	   return new Promise(function(resolve) { 
+	       setTimeout(resolve.bind(null, v), t)
+	   });
+	}
 
+	Promise.prototype.delay = function(t) {
+	    return this.then(function(v) {
+	        return delay_msg(t, v);
+	    });
+	}
 function stopCheckStatusInterval(){
     if(checkStatusInterval != null){
         clearTimeout(checkStatusInterval);
@@ -1096,7 +1106,10 @@ function runCommand(button,reboot) {
 	                },
 	                complete: function(response) {
 	                	console.log('reboot call completed');
-	                	getCommands();
+	                	Promise.resolve().delay(5000).then(function(v) {
+	                		console.log('Getting updated commands');
+	                	    getCommands();
+	                	});
 	                }
 	            });
             }
@@ -1177,7 +1190,7 @@ function getCommands() {
 				}
 				else {
 					advancedtabhtml+='<br>'+innerhtml;
-					advancedtabhtml+='<div class="buttons"><input id="btn-'+ command.name + '" type="button" class="btn btn-danger btn-sm" cmdname="'+command.name+'" value="'+command.name+'" onclick="runCommand(this);"></div></div><td></tr>';
+					advancedtabhtml+='<div class="buttons"><input id="btn-'+ command.name + '" type="button" class="btn btn-danger btn-sm" cmdname="'+command.name+'" value="'+command.name+'" onclick="runCommand(this, false);"></div></div><td></tr>';
 				}
 			}		
         });