|
184 | 184 | <div class='card-header'>ESP32 update</div> |
185 | 185 | <div class='card-body'> |
186 | 186 | <form class="container" method='POST' action='#' enctype='multipart/form-data' id='upload_form'> |
187 | | - <input type='file' name='update' id='file' onchange='sub(this)' style=display:none accept='.bin'> |
| 187 | + <input type='file' name='update' id='file' onchange='sub()' style=display:none accept='.bin'> |
188 | 188 | <label id='file-input' for='file'> Choose file...</label> |
189 | 189 | <input id="updButton" type='submit' class='btn btn-outline-primary mb-2' value='ESP32 file update' disabled> |
190 | 190 | <br> |
|
217 | 217 | <form class="container" method='POST' action='#' enctype='multipart/form-data' id='upload_form_zb'> |
218 | 218 | <input type='file' name='update_zb' id='file_zb' onchange='sub_zb(this)' style=display:none |
219 | 219 | accept='.hex'> |
220 | | - <label id='file-input_zb' for='file_zb'> Choose file...</label> |
| 220 | + <label id='file-input_zb'> Choose file...</label> |
221 | 221 | <input id="updButton_zb" type='submit' class='btn btn-outline-primary mb-2' value='Zigbee file update' disabled> |
222 | 222 | <br> |
223 | 223 | <div class="container" style="max-width: 300px; margin-top: 30px;"> |
|
270 | 270 | modalConstructor("flashZB");// |
271 | 271 | //apiLink + api.actions.API_FLASH_ZB + "&fwurl=" + "https://raw.githubusercontent.com/Tarik2142/devHost/main/" + this.id + ".bin" |
272 | 272 | }); |
273 | | - function sub(obj) { |
274 | | - let fileName = obj.value.split('\\\\'); |
| 273 | + function sub() { |
| 274 | + let fileName = document.getElementById("file").files[0].name; |
275 | 275 | if (fileName != "") { |
276 | 276 | $("#updButton").removeAttr("disabled"); |
277 | 277 | localStorage.setItem('beta_feedback', 0); |
|
284 | 284 | else { |
285 | 285 | $("#updButton").prop(disbl, 1); |
286 | 286 | } |
287 | | - document.getElementById('file-input').innerHTML = ' ' + fileName[fileName.length - 1]; |
| 287 | + document.getElementById('file-input').innerHTML = ' ' + fileName |
288 | 288 | }; |
289 | 289 | function sub_zb(obj) { |
290 | 290 | let fileName = obj.value.split('\\\\'); |
291 | 291 | if (fileName != "") { |
292 | | - $("#updButton_zb").removeAttr("disabled"); |
| 292 | + // $("#updButton_zb").removeAttr("disabled"); |
293 | 293 | } |
294 | 294 | else { |
295 | 295 | $("#updButton_zb").prop(disbl, 1); |
|
0 commit comments