edit_config.html 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>Edit Config</title>
  5. <meta charset="utf-8">
  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 20px;
  13. width: 211px;
  14. font-size: 16px;
  15. }
  16. textarea {
  17. font-size: 14px;
  18. }
  19. </style>
  20. </head>
  21. <body style="font-family: arial; padding: 0px 10px;">
  22. <table>
  23. <tr><td><h2>Config.ini:</h2></td></tr>
  24. <tr>
  25. <td colspan="3">
  26. <textarea id="inputTextToSave" cols="117" rows="38"></textarea>
  27. </td>
  28. </tr>
  29. <tr>
  30. <td><button class="button" onclick="saveTextAsFile()">Update Config.ini</button></td>
  31. </tr>
  32. </table>
  33. <script type="text/javascript" src="./gethost.js"></script>
  34. <script type="text/javascript" src="./readconfig.js"></script>
  35. <script type="text/javascript">
  36. var canvas = document.getElementById('canvas'),
  37. basepath = "http://192.168.178.26";
  38. function LoadConfigNeu() {
  39. basepath = getbasepath();
  40. loadConfig(basepath);
  41. document.getElementById("inputTextToSave").value = getConfig();
  42. }
  43. function saveTextAsFile()
  44. {
  45. if (confirm("Are you sure you want to update \"config.ini\"?")) {
  46. FileDeleteOnServer("/config/config.ini", basepath);
  47. var textToSave = document.getElementById("inputTextToSave").value;
  48. FileSendContent(textToSave, "/config/config.ini", basepath);
  49. }
  50. }
  51. LoadConfigNeu();
  52. </script>
  53. </body>
  54. </html>