浏览代码

populate UI dhcp name from config.json

Christian Herzog 5 年之前
父节点
当前提交
49d7e74c55
共有 2 个文件被更改,包括 8 次插入3 次删除
  1. 6 1
      components/wifi-manager/code.js
  2. 2 2
      components/wifi-manager/index.html

+ 6 - 1
components/wifi-manager/code.js

@@ -440,13 +440,15 @@ function performConnect(conntype){
     stopRefreshAPInterval();
 
     var pwd;
-    var dhcpname = $("#dhcp-name").val();;
+    var dhcpname;
     if (conntype == 'manual') {
         //Grab the manual SSID and PWD
         selectedSSID=$('#manual_ssid').val();
         pwd = $("#manual_pwd").val();
+        dhcpname= $("#dhcp-name2").val();;
     }else{
         pwd = $("#pwd").val();
+        dhcpname= $("#dhcp-name1").val();;
     }
     //reset connection 
     $( "#loading" ).show();
@@ -671,6 +673,9 @@ function getConfig() {
                     }
                 } else if (key == 'autoexec1') {
                     $("input#autoexec1").val(data["autoexec1"]);
+                } else if (key == 'host_name') {
+                    $("dhcp-name1").val(data["host_name"]);
+                    $("dhcp-name2").val(data["host_name"]);
                 }
 
                 $("tbody#nvsTable").append(

+ 2 - 2
components/wifi-manager/index.html

@@ -71,7 +71,7 @@
                         </header>
                         <h2>DHCP host name</h2>
                         <section id="wifi-list">
-                            <input id="dhcp-name" type="text" placeholder="" value="squeezeamp">
+                            <input id="dhcp-name2" type="text" placeholder="" value="squeezeamp">
                         </section>
                         <h2>Manual Connection</h2>
                         <section>
@@ -90,7 +90,7 @@
                         </header>
                         <h2>DHCP host name</h2>
                         <section id="wifi-list">
-                            <input id="dhcp-name" type="text" placeholder="" value="squeezeamp">
+                            <input id="dhcp-name1" type="text" placeholder="" value="squeezeamp">
                         </section>
                         <h2>Password for <span id="ssid-pwd"></span></h2>
                         <section>