index.ejs 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8" />
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
  6. <meta name="apple-mobile-web-app-capable" content="yes" />
  7. <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
  8. <link href="https://netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.css" rel="stylesheet">
  9. <title></title>
  10. </head>
  11. <body class="d-flex flex-column">
  12. <header class="navbar navbar-expand-sm navbar-dark bg-primary sticky-top border-bottom border-dark" id="mainnav">
  13. <a class="navbar-brand" id="navtitle" href="#"></a>
  14. <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent"
  15. aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
  16. <span class="navbar-toggler-icon"></span>
  17. </button>
  18. <div class="collapse navbar-collapse" id="navbarSupportedContent">
  19. <ul class="nav navbar-nav mr-auto" role="tablist">
  20. <li class="nav-item"><a class="nav-link active" data-bs-toggle="tab" aria-controls="profile" role="tab" href="#tab-wifi">WiFi</a></li>
  21. <li class="nav-item omsg"><a class="nav-link" data-bs-toggle="tab" aria-controls="profile" role="tab" href="#tab-syslog">Status<span
  22. class="badge badge-pill badge-success" id="msgcnt"></span></a></li>
  23. <li class="nav-item orec"><a class="nav-link" data-bs-toggle="tab" aria-controls="profile" role="tab" href="#tab-cfg-audio">Audio</a></li>
  24. <li class="nav-item orec"><a class="nav-link" data-bs-toggle="tab" aria-controls="profile" role="tab" href="#tab-cfg-syst">System</a></li>
  25. <li class="nav-item orec"><a class="nav-link" data-bs-toggle="tab" aria-controls="profile" role="tab" href="#tab-cfg-hw">Hardware</a></li>
  26. <li class="nav-item"><a class="nav-link" data-bs-toggle="tab" aria-controls="profile" role="tab" href="#tab-cfg-fw">Updates</a></li>
  27. <div class="dropdown-divider"></div>
  28. <li class="nav-item"><a class="nav-link" data-bs-toggle="tab" aria-controls="profile" role="tab" href="#tab-nvs">NVS Editor</a></li>
  29. <li class="nav-item"><a class="nav-link" data-bs-toggle="tab" aria-controls="profile" role="tab" href="#tab-commands">Advanced</a></li>
  30. <li class="nav-item"><a class="nav-link" data-bs-toggle="tab" aria-controls="profile" role="tab" href="#tab-credits">Credits</a></li>
  31. </ul>
  32. </div>
  33. <div class="info navbar-right" style="display: inline-flex;">
  34. <span class="recovery_element material-icons " style="color:orange; display: none" >system_update_alt</span>
  35. <span id="battery" class="material-icons" style="fill:white; display: none">battery_full</span>
  36. <span id="o_jack" class="material-icons" style="fill:white; display: none">headphones</span>
  37. <span id="s_airplay" class="material-icons" style="fill:white; display: none">airplay</span>
  38. <em id="s_cspot" class="fab fa-spotify" style="fill:white; display: inline"></em>
  39. <span data-bs-toggle="tooltip" id="o_type" data-bs-placement="top" title="">
  40. <span id="o_bt" class="material-icons" style="fill:white; display: none" >bluetooth</span>
  41. <span id="o_spdif" class="material-icons" style="fill:white; display: none" >graphic_eq</span>
  42. <span id="o_i2s" class="material-icons" style="fill:white; display: none" >speaker</span>
  43. </span>
  44. <span id="ethernet" class="material-icons if_eth" style="fill:white; display: none" >cable</span>
  45. <span id="wifiStsIcon" class="material-icons if_wifi" style="fill:white; display: none">signal_wifi_statusbar_4_bar</span>
  46. </div>
  47. </header>
  48. <main role="main" class="flex-grow mt-1 mb-12" style="margin-bottom: 7rem;" id="content">
  49. <!-- Button trigger modal -->
  50. <!-- Modal -->
  51. <div class="modal" id="otadiv" aria-hidden="true">
  52. <div class="modal-dialog" >
  53. <div class="modal-content">
  54. <div class="modal-header">
  55. <h5 class="modal-title" id="fwProgressLabel">Upgrade Progress</h5>
  56. <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
  57. </div>
  58. <div class="modal-body">
  59. <span id="flash-status"></span>
  60. <div class="progress" id="progress">
  61. <div class="progress-bar" role="progressbar" aria-valuemin="0" aria-valuemax="100" style="width:0%">
  62. 0%
  63. </div>
  64. </div>
  65. </div>
  66. <div class="modal-footer">
  67. <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
  68. </div>
  69. </div>
  70. </div>
  71. </div>
  72. <div id="myTabContent" class="tab-content">
  73. <div class="tab-pane fade" id="tab-cfg-hw"> </div>
  74. <div class="tab-pane fade" id="tab-cfg-syst"></div>
  75. <div class="tab-pane fade" id="tab-cfg-gen"></div>
  76. <div class="tab-pane fade" id="tab-cfg-fw">
  77. <div class="card text-white mb-3">
  78. <div class="card-header">Software Updates</div>
  79. <div class="card-body">
  80. <table class="table table-hover table-striped table-dark">
  81. <thead>
  82. <tr>
  83. <th class="border-bottom-0 pb-0" scope="col">Version</th>
  84. <th class="border-bottom-0 pb-0" scope="col">Date/Time</th>
  85. <th class="border-bottom-0 pb-0" scope="col">Platform</th>
  86. <th class="border-bottom-0 pb-0" scope="col">Branch</th>
  87. <th class="border-bottom-0 pb-0" scope="col">Bit Depth</th>
  88. </tr>
  89. <tr>
  90. <th class="border-top-0 pt-0" scope="col"><input class="form-control-sm upSrch"
  91. id="svrs" type="text" placeholder="search releases"></th>
  92. <th class="border-top-0 pt-0" scope="col"></th>
  93. <th class="border-top-0 pt-0" scope="col"><input class="form-control-sm upSrch"
  94. id="splf" type="text" placeholder="search platform"></th>
  95. <th class="border-top-0 pt-0" scope="col"><select class="form-control-sm upSrch"
  96. id="fwbranch">
  97. <option selected="">Choose FW branch</option>
  98. </select>
  99. <th class="border-top-0 pt-0" scope="col"><input class="form-control-sm upSrch"
  100. id="bits" type="text" placeholder="search bit depth"></th>
  101. </th>
  102. </tr>
  103. </thead>
  104. <tbody id="rTable"></tbody>
  105. </table>
  106. <div class="form-group row">
  107. <div class="col-auto">
  108. <button type="button" id="chkUpdates" class="btn btn-info btn-sm">Check for
  109. updates</button>
  110. </div>
  111. <label class="col-auto col-form-label" for="fw-url-input">Firmware URL</label>
  112. <div class="col">
  113. <input type="text" class="form-control"
  114. placeholder="select entry from list or enter known url" id="fw-url-input">
  115. </div>
  116. <div class="col-auto">
  117. <button type="button" id='start-flash' data-bs-toggle="modal" data-bs-target="#uCnfrm"
  118. class="btn btn-warning btn-sm flact" style="display: none;">Flash Firmware</button>
  119. </div>
  120. <div class="col-auto">
  121. <button id="btn_reboot_recovery" class="btn-warning ota_element" type="submit" >Recovery</button>
  122. </div>
  123. </div>
  124. </div>
  125. </div>
  126. <div class="modal" id="uCnfrm">
  127. <div class="modal-dialog modal-dialog-centered" role="document">
  128. <div class="modal-content">
  129. <div class="modal-header">
  130. <h5 class="modal-title">Firmware Flash</h5>
  131. <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
  132. </div>
  133. <div class="modal-body">
  134. <p>Flash URL <span id="selectedFWURL" class="text-break"></span> to device?</p>
  135. </div>
  136. <div class="modal-footer ">
  137. <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Cancel</button>
  138. <button id="btn_flash" type="button" class="btn btn-warning" data-bs-dismiss="modal" >Ok</button>
  139. </div>
  140. </div>
  141. </div>
  142. </div>
  143. <div class="card text-white mb-3" >
  144. <div class="card-header">Local Firmware Upload</div>
  145. <div class="card-body">
  146. <div id="uploaddiv" class="form-group row ">
  147. <label for="flashfilename" class="col-auto col-form-label">Local File</label>
  148. <div class="col">
  149. <input type="file" class="form-control-file" id="flashfilename" aria-describedby="fileHelp">
  150. </div>
  151. <div class="col-auto">
  152. <div class="buttons">
  153. <button type="button" class="btn btn-danger flact" id="fwUpload">Upload!</button>
  154. </div>
  155. </div>
  156. </div>
  157. </div>
  158. </div>
  159. </div>
  160. <div class="tab-pane fade" id="tab-nvs">
  161. <table class="table table-hover">
  162. <thead>
  163. <tr>
  164. <th scope="col">Key</th>
  165. <th scope="col">Value</th>
  166. </tr>
  167. </thead>
  168. <tbody id="nvsTable">
  169. </tbody>
  170. </table>
  171. <div class="buttons">
  172. <button button id="btn_reboot" class="btn btn-primary" style="float:right" type="submit" >Reboot</button>
  173. <input id="save-nvs" type="button" class="btn btn-success" value="Commit">
  174. <input id="save-as-nvs" type="button" class="btn btn-success" value="Download config">
  175. <input id="load-nvs" type="button" class="btn btn-success" value="Load File">
  176. <input aria-describedby="fileHelp" id="nvsfilename" type="file" style="display:none">
  177. </div>
  178. </div>
  179. <div class="tab-pane fade" id="tab-cfg-audio">
  180. <div class="card text-white mb-3">
  181. <div class="card-header">Usage Templates</div>
  182. <div class="card-body">
  183. <fieldset>
  184. <fieldset class="form-group" id="output-tmpl">
  185. <legend>Output</legend>
  186. <div class="form-check">
  187. <label class="form-check-label">
  188. <input type="radio" class="form-check-input" name="output-tmpl" id="i2s">
  189. I2S Dac
  190. </label>
  191. </div>
  192. <div class="form-check">
  193. <label class="form-check-label">
  194. <input type="radio" class="form-check-input" name="output-tmpl" id="spdif">
  195. SPDIF
  196. </label>
  197. </div>
  198. <div class="form-check">
  199. <label class="form-check-label">
  200. <input type="radio" class="form-check-input" name="output-tmpl" id="bt">
  201. Bluetooth
  202. </label>
  203. </div>
  204. </fieldset>
  205. <div class="form-group"><label for="player">Player Name</label><input type="text"
  206. class="form-control " placeholder="Squeezelite" id="player"></div>
  207. <div class="form-group"><label for="optional">Optional setting (e.g. for LMS IP
  208. address)</label><input type="text" class="form-control" id="optional"></div>
  209. <div class="form-group">
  210. <div class="form-check">
  211. <label class="form-check-label">
  212. <input class="form-check-input" type="checkbox" id="disable-squeezelite" value=""
  213. checked="">
  214. Disable Squeezelite
  215. </label>
  216. </div>
  217. </div>
  218. <div style="margin-top: 16px;">
  219. <div class="toast hide" role="alert" aria-live="assertive" aria-atomic="true" id="toast_cfg-audio-tmpl">
  220. <div class="toast-header"><strong class="mr-auto">Result</strong>
  221. <button type="button" class="btn-close" data-bs-dismiss="toast" aria-label="Close"></button></div>
  222. <div class="toast-body" id="msg_cfg-audio-tmpl"></div>
  223. </div>
  224. </div>
  225. <button id="save-autoexec1" type="submit" class="btn btn-info" cmdname="cfg-audio-tmpl">Save</button>
  226. <button id="commit-autoexec1" type="submit" class="btn btn-warning" cmdname="cfg-audio-tmpl">Apply</button>
  227. </fieldset>
  228. </div>
  229. </div>
  230. </div>
  231. <div class="tab-pane fade active show" id="tab-wifi">
  232. <div class="card text-white mb-3">
  233. <div class="card-header">WiFi Status</div>
  234. <div class="card-body if_eth" style="display: none">
  235. <h2>Connected to Ethernet</h2>
  236. <p>WiFi is inactive while connected to a wired network.
  237. </div>
  238. <div class="card-body if_wifi" style="display: none" >
  239. <table class="table table-hover">
  240. <thead>
  241. <tr>
  242. <th scope="col">Joined</th>
  243. <th scope="col">Name</th>
  244. <th scope="col">Signal</th>
  245. <th scope="col">Security</th>
  246. </tr>
  247. </thead>
  248. <tbody id="wifiTable"></tbody>
  249. </table>
  250. <button type="button" id="updateAP" class="btn btn-info btn-sm">Scan</button>
  251. </div>
  252. <div class="modal" id="WiFiDisconnectConfirm">
  253. <div class="modal-dialog modal-dialog-centered" role="document">
  254. <div class="modal-content">
  255. <div class="modal-header">
  256. <h5 class="modal-title">Disconnect</h5>
  257. <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
  258. </div>
  259. <div class="modal-body">
  260. <p>Disconnect from network? After disconnecting, the system won't be accessible from
  261. the current address and will expose itself as access point name <span
  262. id="apName"></span> with password <span id="apPass"></span> </p>
  263. </div>
  264. <div class="modal-footer connecting-success connecting-status">
  265. <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Cancel</button>
  266. <button id="btn_disconnect" type="button" class="btn btn-warning" data-bs-dismiss="modal">Ok</button>
  267. </div>
  268. </div>
  269. </div>
  270. </div>
  271. <div class="modal" id="WifiConnectDialog" aria-hidden="true">
  272. <div class="modal-dialog ">
  273. <div class="modal-content">
  274. <div class="modal-header">
  275. <h5 class="modal-title connecting connecting-init connecting-fail">Connect to WiFi</h5>
  276. <h5 class="modal-title connecting-status connecting-success">Status</h5>
  277. <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
  278. </div>
  279. <div class="modal-body">
  280. <fieldset class="connecting-init connecting-fail">
  281. <div class="form-group"><label for="manual_ssid">Wifi Name</label><input type="text"
  282. class="form-control" placeholder="Enter Name" id="manual_ssid"></div>
  283. <div class="form-group"><label for="manual_pwd">Password</label><input
  284. type="password" class="form-control" placeholder="Enter Name"
  285. id="manual_pwd"></div>
  286. </fieldset>
  287. <div id="connect-wait" class="connecting">
  288. <div>Connecting to <span id="ssid-wait"></span> </div>
  289. <div>
  290. You may lose wifi access while the esp32 recalibrates
  291. its radio. Please
  292. wait until your device automatically reconnects. This can take up to
  293. 30s.
  294. </div>
  295. </div>
  296. <div id="connect-success" class="connecting-success connecting-status">
  297. <div> Connected to Access Point : <span id="connectedToSSID"></span></div>
  298. <div> Device IP address : <span id="ipAddress"></span></div>
  299. <div>Subnet Mask:<span id="netmask"></span></div>
  300. <div>Default Gateway:<span id="gateway"></span></div>
  301. </div>
  302. <div id="connect-fail" class="connecting-fail">
  303. <h3 class="text-error">Connection failed</h3>
  304. <p>Please double-check wifi password if any and make sure the access point has
  305. good signal.</p>
  306. </div>
  307. </div>
  308. <div class="modal-footer ">
  309. <button type="button"
  310. class="btn btn-secondary connecting-init connecting-fail connecting"
  311. data-bs-dismiss="modal">Close</button>
  312. <button type="button" id="btnJoin"
  313. class="btn btn-primary connecting-init connecting-fail">Join</button>
  314. <button type="button" class="connecting btn btn-primary" disabled>
  315. <span class="spinner-border spinner-border-sm" role="status"
  316. aria-hidden="true"></span>
  317. <span class="sr-only">Connecting...</span></button>
  318. </div>
  319. <div class="modal-footer connecting-success connecting-status justify-content-between" style=""><button type="button"
  320. class="btn btn-primary" data-bs-dismiss="modal">Ok</button><button type="button" class="btn btn-danger"
  321. data-bs-toggle="modal" data-bs-dismiss="modal" data-bs-target="#WiFiDisconnectConfirm">Disconnect</button>
  322. </div>
  323. </div>
  324. </div>
  325. </div>
  326. </div>
  327. </div>
  328. <div class="tab-pane fade " id="tab-commands">
  329. <fieldset id="commands-list"></fieldset>
  330. </div>
  331. <!-- Status -->
  332. <div class="tab-pane fade " id="tab-syslog">
  333. <div class="card border-primary mb-3">
  334. <div class="card-header">Logs</div>
  335. <div class="card-body">
  336. <table class="table table-hover">
  337. <thead>
  338. <tr>
  339. <th scope="col">Timestamp</th>
  340. <th scope="col">Message</th>
  341. </tr>
  342. </thead>
  343. <tbody id="syslogTable">
  344. </tbody>
  345. </table>
  346. <div class="buttons">
  347. <input id="clear-syslog" type="button" class="btn btn-danger btn-sm" value="Clear" />
  348. </div>
  349. </div>
  350. </div>
  351. <div class="card border-primary mb-3" id="pins" style="display: none;">
  352. <div class="card-header">Pin Assignments</div>
  353. <div class="card-body">
  354. <table class="table table-hover">
  355. <thead>
  356. <tr>
  357. <th scope="col">Device</th>
  358. <th scope="col">Pin Name</th>
  359. <th scope="col">GPIO Number</th>
  360. <th scope="col">Type</th>
  361. </tr>
  362. </thead>
  363. <tbody id="gpiotable"></tbody>
  364. </table>
  365. </div>
  366. </div>
  367. <div class="card border-primary mb-3" style="visibility: collapse;" id="tasks_sect">
  368. <div class="card-header">Tasks</div>
  369. <div class="card-body">
  370. <table class="table table-hover">
  371. <!-- console.log(msg_time.toLocaleString() + '\tname' + '\tcpu' + '\tstate' + '\tminstk' + '\tbprio' + '\tcprio' + '\tnum'); -->
  372. <thead>
  373. <tr>
  374. <th scope="col">#</th>
  375. <th scope="col">Task Name</th>
  376. <th scope="col">CPU</th>
  377. <th scope="col">State</th>
  378. <th scope="col">Min Stack</th>
  379. <th scope="col">Base Priority</th>
  380. <th scope="col">Cur Priority</th>
  381. </tr>
  382. </thead>
  383. <tbody id="tasks"></tbody>
  384. </table>
  385. </div>
  386. </div>
  387. </div>
  388. <!-- syslog -->
  389. <div class="tab-pane fade " id="tab-credits">
  390. <div class="card text-white mb-3">
  391. <div class="card-header">Credits</div>
  392. <div class="card-body">
  393. <p><strong><a
  394. href="https://github.com/sle118/squeezelite-esp32">squeezelite-esp32</a><br></strong>&copy;
  395. 2020, philippe44, sle118, daduke<br /><a href="https://opensource.org/licenses/MIT">This
  396. software is released under the MIT License.</a></p>
  397. <p>
  398. This app would not be possible without the following libraries:
  399. </p>
  400. <ul>
  401. <li>squeezelite, &copy; 2012-2019, Adrian Smith and Ralph Irving. Licensed under the GPL
  402. License.</li>
  403. <li>esp32-wifi-manager, &copy; 2017-2019, Tony Pottier. Licensed under the MIT License.</li>
  404. <li>SpinKit, &copy; 2015, Tobias Ahlin. Licensed under the MIT License.</li>
  405. <li>jQuery, The jQuery Foundation. Licensed under the MIT License.</li>
  406. <li>cJSON, &copy; 2009-2017, Dave Gamble and cJSON contributors. Licensed under the MIT
  407. License.
  408. </li>
  409. <li>esp32-rotary-encoder, &copy; 2011-2019, David Antliff and Ben Buxton. Licensed under the
  410. GPL
  411. License.</li>
  412. <li>tarablessd1306, &copy; 2017-2018, Tara Keeling. Licensed under the MIT license.</li>
  413. <li>CSpot, &copy; 2020 feelfreelinux & alufers. Licensed under the GPL License</li>
  414. </ul>
  415. </div>
  416. </div>
  417. <div class="card text-white mb-3">
  418. <div class="card-header">Extras/Overrides</div>
  419. <div class="card-body">
  420. <fieldset>
  421. <div class="form-check">
  422. <label class="form-check-label"><input type="checkbox" id="show-nvs"
  423. class="form-check-input " value="">Show NVS Editor</label>
  424. </div>
  425. </fieldset>
  426. <fieldset>
  427. <div class="form-check">
  428. <label class="form-check-label"><input type="checkbox" id="show-commands"
  429. class="form-check-input " value="">Show Advanced Commands</label>
  430. </div>
  431. </fieldset>
  432. </div>
  433. </div>
  434. </div>
  435. <!-- credits -->
  436. </div>
  437. </div>
  438. </main>
  439. <footer>
  440. <div class="fixed-bottom d-flex justify-content-between border-top border-dark p-3 bg-primary">
  441. <span class="text-center" id="foot-fw"></span><button class="btn-warning ota_element " id="reboot_nav"
  442. type="submit" style="display: none;">Reboot</button>
  443. <button class="btn-warning recovery_element" id="reboot_ota_nav" type="submit"
  444. style="display: none;">Exit Recovery</button><span class="text-center" id="foot-if"></span>
  445. </div>
  446. </footer>
  447. </body>
  448. </html>