edit_config_raw.html 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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. </head>
  36. <body style="font-family: arial; padding: 0px 10px;">
  37. <table style="width:660px">
  38. <h2>Configuration - "Config.ini" Editor</h2>
  39. <td>
  40. <textarea id="inputTextToSave" rows="30" style="width:100%"></textarea>
  41. </td>
  42. </table>
  43. <hr>
  44. <button class="button" onclick="saveTextAsFile()">Save Config</button>
  45. <script type="text/javascript" src="readconfigparam.js?v=$COMMIT_HASH"></script>
  46. <script type="text/javascript" src="readconfigcommon.js?v=$COMMIT_HASH"></script>
  47. <script type="text/javascript">
  48. var canvas = document.getElementById('canvas'),
  49. domainname = getDomainname();
  50. function LoadConfigNeu() {
  51. domainname = getDomainname();
  52. loadConfig(domainname);
  53. document.getElementById("inputTextToSave").value = getConfig();
  54. }
  55. function saveTextAsFile()
  56. {
  57. FileDeleteOnServer("/config/config.ini", domainname);
  58. var textToSave = document.getElementById("inputTextToSave").value;
  59. FileSendContent(textToSave, "/config/config.ini", domainname);
  60. 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);
  61. }
  62. function doReboot() {
  63. var stringota = "/reboot";
  64. window.location = stringota;
  65. window.location.href = stringota;
  66. window.location.assign(stringota);
  67. window.location.replace(stringota);
  68. }
  69. LoadConfigNeu();
  70. </script>
  71. </body>
  72. </html>