index.html 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263
  1. <!DOCTYPE html>
  2. <html lang = "en">
  3. <head>
  4. <meta charset = "UTF-8" />
  5. <meta name = "viewport" content = "width=device-width, initial-scale=1.0" />
  6. <meta name = "description" content = "Give safe and simple access to predefined shell commands from a web interface." />
  7. <title>OliveTin</title>
  8. <link rel = "stylesheet" type = "text/css" href = "/style.css" />
  9. <link rel = "stylesheet" type = "text/css" href = "/theme.css" />
  10. <link rel = "stylesheet" href = "node_modules/@xterm/xterm/css/xterm.css" />
  11. <link rel = "shortcut icon" type = "image/png" href = "OliveTinLogo.png" />
  12. <link rel = "apple-touch-icon" sizes="57x57" href="OliveTinLogo-57px.png" />
  13. <link rel = "apple-touch-icon" sizes="120x120" href="OliveTinLogo-120px.png" />
  14. <link rel = "apple-touch-icon" sizes="180x180" href="OliveTinLogo-180px.png" />
  15. <base href = "/" />
  16. </head>
  17. <body>
  18. <header>
  19. <button id = "sidebar-toggler-button" aria-label = "Open sidebar navigation" aria-pressed = "false" aria-haspopup = "menu">&#9776;</button>
  20. <h1 id = "page-title">OliveTin</h1>
  21. <nav hidden>
  22. <ul id = "navigation-links">
  23. <li title = "Actions">
  24. <a id = "showActions">Actions</a>
  25. </li>
  26. </ul>
  27. <ul id = "supplemental-links">
  28. <li title = "Diagnostics">
  29. <a id = "showDiagnostics">Diagnostics</a>
  30. </li>
  31. <li title = "Logs">
  32. <a id = "showLogs">Logs</a>
  33. </li>
  34. </ul>
  35. </nav>
  36. <span id = "username">&nbsp;</span>
  37. </header>
  38. <main title = "main content">
  39. <section id = "contentLogs" title = "Logs" class = "box-shadow" hidden>
  40. <div class = "toolbar">
  41. <input placeholder = "Search for action name" id = "logSearchBox" />
  42. <button id = "searchLogsClear" title = "Clear search filter" disabled>X</button>
  43. </div>
  44. <table title = "Logs">
  45. <thead>
  46. <tr title = "untitled">
  47. <th>Timestamp</th>
  48. <th>Action</th>
  49. <th>Metadata</th>
  50. <th>Status</th>
  51. </tr>
  52. </thead>
  53. <tbody id = "logTableBody" />
  54. </table>
  55. </section>
  56. <section id = "contentDiagnostics" title = "Diagnostics" class = "box-shadow" hidden>
  57. <div id = "diagnostics" class = "ta-left">
  58. <p><strong>Note:</strong> Diagnostics are only generated on OliveTin startup - they are not updated in real-time or when you refresh this page. They are intended as a "quick reference" to help you.</p>
  59. <p>If you are having problems with OliveTin and want to raise a support request, please don't take a screenshot or copy text from this page, but instead it is highly recommended to include a <a href = "https://docs.olivetin.app/sosreport.html">sosreport</a> which is more detailed, and makes it easier to help you.</p>
  60. <table>
  61. <tbody>
  62. <th colspan = "99">SSH</th>
  63. <tr>
  64. <td width = "10%">Found Key</td>
  65. <td id = "diagnostics-sshfoundkey">?</td>
  66. </tr>
  67. <tr>
  68. <td>Found Config</td>
  69. <td id = "diagnostics-sshfoundconfig">?</td>
  70. </tbody>
  71. </table>
  72. </div>
  73. </section>
  74. <section id = "contentActions" title = "Actions" hidden >
  75. <fieldset id = "root-group" title = "Actions">
  76. <legend hidden>Actions</legend>
  77. </fieldset>
  78. </section>
  79. <noscript>
  80. <div class = "error">Sorry, JavaScript is required to use OliveTin.</div>
  81. </noscript>
  82. </main>
  83. <footer title = "footer">
  84. <p><img title = "application icon" src = "OliveTinLogo.png" alt = "OliveTin logo" height = "1em" class = "logo" /> OliveTin</p>
  85. <p>
  86. <a href = "https://docs.olivetin.app" target = "_new">Documentation</a> |
  87. <a href = "https://github.com/OliveTin/OliveTin/issues/new/choose" target = "_new">Raise an issue on GitHub</a> |
  88. <span>Version: <span id = "currentVersion">?</span></span> |
  89. <span>Server connection:
  90. <span id = "serverConnectionRest">REST</span>,
  91. <span id = "serverConnectionWebSocket">WebSocket</span>
  92. </span>
  93. </p>
  94. <p>
  95. <a id = "available-version" href = "http://olivetin.app" target = "_blank" hidden>?</a>
  96. </p>
  97. </footer>
  98. <dialog title = "Big Error Message" id = "big-error" class = "error padded-content">
  99. </dialog>
  100. <dialog title = "Execution Results" id = "execution-results-popup">
  101. <div class = "action-header padded-content">
  102. <span id = "execution-dialog-icon" class = "icon" role = "img"></span>
  103. <h2>
  104. <span id = "execution-dialog-title">?</span>
  105. </h2>
  106. <button id = "execution-dialog-toggle-size" title = "Toggle dialog size">
  107. <svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24"><path fill="currentColor" d="M3 3h6v2H6.462l4.843 4.843l-1.415 1.414L5 6.367V9H3zm0 18h6v-2H6.376l4.929-4.928l-1.415-1.414L5 17.548V15H3zm12 0h6v-6h-2v2.524l-4.867-4.866l-1.414 1.414L17.647 19H15zm6-18h-6v2h2.562l-4.843 4.843l1.414 1.414L19 6.39V9h2z"/></svg>
  108. </button>
  109. </div>
  110. <div id = "execution-dialog-basics" class = "padded-content-sides">
  111. <strong>Duration: </strong><span id = "execution-dialog-duration">unknown</span>
  112. </div>
  113. <div id = "execution-dialog-details" class = "padded-content-sides">
  114. <p>
  115. <strong>Status: </strong><span id = "execution-dialog-status">unknown</span>
  116. </p>
  117. </div>
  118. <div id = "execution-dialog-xterm"></div>
  119. <div class = "buttons padded-content">
  120. <button name = "kill" title = "Kill" id = "execution-dialog-kill-action">Kill</button>
  121. <form method = "dialog">
  122. <button name = "Cancel" title = "Close">Close</button>
  123. </form>
  124. </div>
  125. </dialog>
  126. <template id = "tplLoginForm">
  127. <section id = "content-login" title = "Login" hidden>
  128. <div class = "flex-col">
  129. <form class = "box-shadow padded-content border-radius">
  130. <p class = "login-disabled">Login with OAuth or Local users is not enabled on this server.</p>
  131. <div class = "login-oauth2" hidden>
  132. <h2>OAuth Login</h2>
  133. </div>
  134. <br />
  135. <div class = "login-local" hidden>
  136. <h2>Local Login</h2>
  137. <div class = "arguments">
  138. <label for = "username">
  139. <span>Username:</span>
  140. </label>
  141. <input type = "text" name = "username" />
  142. <span></span>
  143. <label for = "password">
  144. <span>Password:</span>
  145. </label>
  146. <input type = "password" name = "password" />
  147. <span></span>
  148. <button type = "submit">Login</button>
  149. </div>
  150. </div>
  151. </form>
  152. </div>
  153. </section>
  154. </template>
  155. <template id = "tplArgumentForm">
  156. <dialog title = "Arguments" id = "argument-popup">
  157. <form class = "action-arguments padded-content">
  158. <div class = "wrapper">
  159. <div class = "action-header">
  160. <span class = "icon" role = "img"></span>
  161. <h2>Argument form</h2>
  162. </div>
  163. <div class = "arguments"></div>
  164. <div class = "buttons">
  165. <input name = "start" type = "submit" value = "Start">
  166. <button name = "cancel" title = "Cancel">Cancel</button>
  167. </div>
  168. </div>
  169. </form>
  170. </dialog>
  171. </template>
  172. <template id = "tplActionButton">
  173. <button>
  174. <span title = "action button icon" class = "icon">&#x1f4a9;</span>
  175. <span class = "title" aria-live = "polite">Untitled Button</span>
  176. </button>
  177. <div class = "action-button-footer" hidden></div>
  178. </template>
  179. <template id = "tplLogRow">
  180. <tr class = "log-row">
  181. <td class = "timestamp">?</td>
  182. <td>
  183. <span role = "img" class = "icon"></span>
  184. <a href = "javascript:void(0)" class = "content">?</a>
  185. </td>
  186. <td class = "tags"></td>
  187. <td class = "exit-code">?</td>
  188. </tr>
  189. </template>
  190. <script type = "text/javascript">
  191. const bigErrorDialog = document.getElementById('big-error')
  192. /**
  193. This is the bootstrap code, which relies on very simple, old javascript
  194. to at least display a helpful error message if we can't use OliveTin.
  195. */
  196. window.showBigError = function (type, friendlyType, message, isFatal) {
  197. bigErrorDialog.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>"
  198. if (isFatal) {
  199. bigErrorDialog.innerHTML += '<p>You will need to refresh your browser to clear this message.</p>'
  200. } else {
  201. bigErrorDialog.innerHTML += '<p>This error message will go away automatically if the problem is solved.</p>'
  202. }
  203. bigErrorDialog.showModal()
  204. console.error('Error ' + type + ': ', message)
  205. }
  206. window.clearBigErrors = function () {
  207. bigErrorDialog.close()
  208. }
  209. </script>
  210. <script type = "text/javascript" nomodule>
  211. showBigError("js-modules-not-supported", "Sorry, your browser does not support JavaScript modules.", null)
  212. </script>
  213. <script type = "module" src = "main.js"></script>
  214. <script src = "lib/iconify-icon-2.0.0.min.js"></script>
  215. </body>
  216. </html>