edit_config_raw.html 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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. #reboot_button {
  20. float: none;
  21. background-color: #f44336;
  22. color: white;
  23. padding: 5px;
  24. border-radius:
  25. 5px; font-weight: bold;
  26. text-align: center;
  27. text-decoration: none;
  28. display: inline-block;
  29. }
  30. </style>
  31. <link href="firework.css?v=$COMMIT_HASH" rel="stylesheet">
  32. <script type="text/javascript" src="common.js?v=$COMMIT_HASH"></script>
  33. <script type="text/javascript" src="jquery-3.6.0.min.js?v=$COMMIT_HASH"></script>
  34. <script type="text/javascript" src="firework.js?v=$COMMIT_HASH"></script>
  35. <script type="text/javascript" src="readconfigparam.js?v=$COMMIT_HASH"></script>
  36. <script type="text/javascript" src="readconfigcommon.js?v=$COMMIT_HASH"></script>
  37. <script type="text/javascript">var domainname = getDomainname();</script>
  38. </head>
  39. <body style="font-family: arial; padding: 0px 10px;">
  40. <table style="width:660px">
  41. <h2>Configuration - "Config.ini" Editor</h2>
  42. <td>
  43. <textarea id="inputTextToSave" rows="30" style="width:100%"></textarea>
  44. </td>
  45. </table>
  46. <hr>
  47. <button class="button" onclick="saveTextAsFile()">Save Config</button>
  48. <script type="text/javascript">
  49. var canvas = document.getElementById('canvas'),
  50. param,
  51. category;
  52. function LoadConfigNeu() {
  53. param = getConfigParameters();
  54. category = getConfigCategory();
  55. document.getElementById("inputTextToSave").value = getConfig();
  56. }
  57. function saveTextAsFile()
  58. {
  59. FileDeleteOnServer("/config/config.ini", domainname);
  60. var textToSave = document.getElementById("inputTextToSave").value;
  61. FileSendContent(textToSave, "/config/config.ini", domainname);
  62. firework.launch('Configuration saved. It will get applied after the next reboot!<br><br>\n<a id="reboot_button" onclick="doReboot()">reboot now</a>', 'success', 5000);
  63. }
  64. function doReboot() {
  65. var stringota = "/reboot";
  66. window.location = stringota;
  67. window.location.href = stringota;
  68. window.location.assign(stringota);
  69. window.location.replace(stringota);
  70. }
  71. LoadConfigNeu();
  72. </script>
  73. </body>
  74. </html>