index.html 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  1. <!DOCTYPE html>
  2. <html lang = "en">
  3. <head>
  4. <meta name = "viewport" content = "width=device-width, initial-scale=1.0">
  5. <meta name = "description" content = "Give safe and simple access to predefined shell commands from a web interface." />
  6. <title>OliveTin</title>
  7. <link rel = "stylesheet" type = "text/css" href = "style.css" />
  8. <link rel = "shortcut icon" type = "image/png" href = "OliveTinLogo.png" />
  9. <link rel = "apple-touch-icon" sizes="57x57" href="OliveTinLogo-57px.png" />
  10. <link rel = "apple-touch-icon" sizes="120x120" href="OliveTinLogo-120px.png" />
  11. <link rel = "apple-touch-icon" sizes="180x180" href="OliveTinLogo-180px.png" />
  12. </head>
  13. <body>
  14. <main title = "main content">
  15. <div id = "perma-widget">
  16. <div id = "sidebar-toggle-wrapper">
  17. <label for = "hide-sidebar-checkbox" id = "sidebar-toggler-button" title = "Toggle sidebar" tabindex = "0">&#9776;</label>
  18. </div>
  19. <h1 id = "page-title">OliveTin</h1>
  20. </div>
  21. <input type = "checkbox" id = "hide-sidebar-checkbox" hidden checked />
  22. <nav hidden>
  23. <ul id = "navigation-links">
  24. <li><a id = "showActions">Actions</a></li>
  25. </ul>
  26. <ul id = "supplemental-links">
  27. <li><a id = "showLogs">Logs</a></li>
  28. </ul>
  29. </nav>
  30. <section id = "contentLogs" title = "Logs" hidden>
  31. <div class = "toolbar">
  32. <input placeholder = "Search for action name" id = "logSearchBox" />
  33. <button id = "searchLogsClear" title = "Clear search filter" disabled>X</button>
  34. </div>
  35. <table title = "Logs">
  36. <thead>
  37. <tr title = "untitled">
  38. <th>Timestamp</th>
  39. <th>Log</th>
  40. <th>Exit Code</th>
  41. </tr>
  42. </thead>
  43. <tbody id = "logTableBody" />
  44. </table>
  45. </section>
  46. <section id = "contentActions" title = "Actions" hidden >
  47. <fieldset id = "root-group" title = "Actions">
  48. <legend hidden>Actions</legend>
  49. </fieldset>
  50. </section>
  51. <noscript>
  52. <div class = "error">Sorry, JavaScript is required to use OliveTin.</div>
  53. </noscript>
  54. </main>
  55. <footer title = "footer">
  56. <p><img title = "application icon" src = "OliveTinLogo.png" alt = "OliveTin logo" height = "1em" class = "logo" /> OliveTin</p>
  57. <p>
  58. <a href = "https://docs.olivetin.app" target = "_new">Documentation</a> |
  59. <a href = "https://github.com/OliveTin/OliveTin/issues/new/choose" target = "_new">Raise an issue on GitHub</a> |
  60. <span>Version: <span id = "currentVersion">?</span></span> |
  61. <span>Server connection:
  62. <span id = "serverConnectionRest">REST</span>,
  63. <span id = "serverConnectionWebSocket">WebSocket</span>
  64. </span>
  65. </p>
  66. <p>
  67. <a id = "available-version" href = "http://olivetin.app" target = "_blank" hidden>?</a>
  68. </p>
  69. </footer>
  70. <dialog title = "Execution Results" id = "execution-results-popup">
  71. <div class = "action-header">
  72. <span id = "execution-dialog-icon" class = "icon" role = "img"></span>
  73. <h2>
  74. <span id = "execution-dialog-title">?</span>
  75. </h2>
  76. <button id = "execution-dialog-toggle-size">&#128470;</button>
  77. </div>
  78. <div id = "execution-dialog-basics">
  79. <strong>Started: </strong><span id = "execution-dialog-datetime-started">unknown</span>
  80. </div>
  81. <div id = "execution-dialog-details">
  82. <p>
  83. <strong>Finished: </strong><span id = "execution-dialog-datetime-finished">unknown</span>
  84. </p>
  85. <p>
  86. <strong>Exit Code: </strong><span id = "execution-dialog-exit-code">unknown</span>
  87. </p>
  88. <p>
  89. <strong>Status: </strong><span id = "execution-dialog-status">unknown</span>
  90. </p>
  91. </div>
  92. <div id = "execution-dialog-output">
  93. <details>
  94. <summary>Standard Output</summary>
  95. <pre id = "execution-dialog-stdout">
  96. ?
  97. </pre>
  98. </details>
  99. <details>
  100. <summary>Standard Error</summary>
  101. <pre id = "execution-dialog-stderr">
  102. ?
  103. </pre>
  104. </details>
  105. </div>
  106. <form method = "dialog">
  107. <div class = "buttons">
  108. <button name = "Cancel">Close</button>
  109. </div>
  110. </form>
  111. </dialog>
  112. <template id = "tplArgumentForm">
  113. <dialog title = "Arguments" id = "argument-popup">
  114. <form class = "action-arguments">
  115. <div class = "wrapper">
  116. <div class = "action-header">
  117. <span class = "icon" role = "img"></span>
  118. <h2>Argument form</h2>
  119. </div>
  120. <div class = "arguments"></div>
  121. <div class = "buttons">
  122. <input name = "start" type = "submit" value = "Start">
  123. <button name = "cancel">Cancel</button>
  124. </div>
  125. </div>
  126. </form>
  127. </dialog>
  128. </template>
  129. <template id = "tplActionButton">
  130. <button>
  131. <span title = "action button icon" class = "icon">&#x1f4a9;</span>
  132. <span class = "title">Untitled Button</span>
  133. </button>
  134. <div class = "action-button-footer">
  135. </div>
  136. </template>
  137. <template id = "tplLogRow">
  138. <tr class = "log-row">
  139. <td class = "timestamp">?</td>
  140. <td>
  141. <span role = "img" class = "icon"></span>
  142. <span class = "content">?</span>
  143. <details>
  144. <summary>stdout</summary>
  145. <pre class = "stdout">
  146. ?
  147. </pre>
  148. </details>
  149. <details>
  150. <summary>stderr</summary>
  151. <pre class = "stderr">
  152. ?
  153. </pre>
  154. </details>
  155. <div class = "tags"></div>
  156. </td>
  157. <td class = "exit-code">?</td>
  158. </tr>
  159. </template>
  160. <script type = "text/javascript">
  161. /**
  162. This is the bootstrap code, which relies on very simple, old javascript
  163. to at least display a helpful error message if we can't use OliveTin.
  164. */
  165. window.showBigError = function (type, friendlyType, message) {
  166. clearBigErrors(type)
  167. console.error('Error ' + type + ': ', message)
  168. const domErr = document.createElement('div')
  169. domErr.classList.add('error')
  170. domErr.classList.add(type)
  171. domErr.innerHTML = '<h1>Error ' + friendlyType + '</h1><p>' + message + "</p><p><a href = 'http://docs.olivetin.app/err-" + type + ".html' target = 'blank'/>" + type + " error in OliveTin Documentation</a></p>"
  172. document.body.prepend(domErr)
  173. }
  174. window.clearBigErrors = function (additionalClass) {
  175. let selector = 'div.error'
  176. if (additionalClass != null) {
  177. selector += '.' + additionalClass
  178. }
  179. for (const oldError of document.querySelectorAll(selector).values()) {
  180. window.old = oldError;
  181. oldError.remove();
  182. }
  183. }
  184. </script>
  185. <script type = "text/javascript" nomodule>
  186. showBigError("js-modules-not-supported", "Sorry, your browser does not support JavaScript modules.", null)
  187. </script>
  188. <script type = "module" src = "main.js"></script>
  189. </body>
  190. </html>