edit_config_raw.html 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. <!DOCTYPE html>
  2. <html lang="en" xml:lang="en">
  3. <head>
  4. <meta charset="UTF-8" />
  5. <title>Edit Config</title>
  6. <style>
  7. h1 {font-size: 2em;}
  8. h2 {font-size: 1.5em; margin-block-start: 0.0em; margin-block-end: 0.2em;}
  9. h3 {font-size: 1.2em;}
  10. p {font-size: 1em;}
  11. .button {
  12. padding: 5px 10px;
  13. width: 220px;
  14. font-size: 16px;
  15. }
  16. textarea {
  17. font-size: 15px;
  18. }
  19. </style>
  20. <link href="firework.css?v=$COMMIT_HASH" rel="stylesheet">
  21. <script type="text/javascript" src="common.js?v=$COMMIT_HASH"></script>
  22. <script type="text/javascript" src="jquery-3.6.0.min.js?v=$COMMIT_HASH"></script>
  23. <script type="text/javascript" src="firework.js?v=$COMMIT_HASH"></script>
  24. </head>
  25. <body style="font-family: arial; padding: 0px 10px;">
  26. <table style="width:660px">
  27. <h2>Configuration - "Config.ini" Editor</h2>
  28. <td>
  29. <textarea id="inputTextToSave" rows="30" style="width:100%"></textarea>
  30. </td>
  31. </table>
  32. <table>
  33. <td>
  34. <button class="button" onclick="saveTextAsFile()">Save Config</button>
  35. </td>
  36. <td>
  37. <button class="button" id="reboot" type="button" onclick="doReboot()">Reboot to activate changes</button>
  38. </td>
  39. </table>
  40. <script type="text/javascript" src="readconfigparam.js?v=$COMMIT_HASH"></script>
  41. <script type="text/javascript" src="readconfigcommon.js?v=$COMMIT_HASH"></script>
  42. <script type="text/javascript">
  43. var canvas = document.getElementById('canvas'),
  44. domainname = getDomainname();
  45. function LoadConfigNeu() {
  46. domainname = getDomainname();
  47. loadConfig(domainname);
  48. document.getElementById("inputTextToSave").value = getConfig();
  49. }
  50. function saveTextAsFile()
  51. {
  52. if (confirm("Are you sure you want to save the configuration?")) {
  53. FileDeleteOnServer("/config/config.ini", domainname);
  54. var textToSave = document.getElementById("inputTextToSave").value;
  55. FileSendContent(textToSave, "/config/config.ini", domainname);
  56. firework.launch('Configuration saved. It will get applied after next reboot', 'success', 5000);
  57. }
  58. }
  59. function doReboot() {
  60. if (confirm("Are you sure you want to reboot?")) {
  61. var stringota = "/reboot";
  62. window.location = stringota;
  63. window.location.href = stringota;
  64. window.location.assign(stringota);
  65. window.location.replace(stringota);
  66. }
  67. }
  68. LoadConfigNeu();
  69. </script>
  70. </body>
  71. </html>