index.ejs 21 KB

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