index.html 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269
  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. <div class = "userinfo">
  37. <span id = "link-login" hidden><a href = "/login">Login</a> |</span>
  38. <span id = "link-logout" hidden><a href = "/api/Logout">Logout</a> |</span>
  39. <span id = "username">&nbsp;</span>
  40. <svg xmlns="http://www.w3.org/2000/svg" width="1.5em" height="1.5em" viewBox="0 0 24 24"><g fill="none" fill-rule="evenodd"><path d="m12.594 23.258l-.012.002l-.071.035l-.02.004l-.014-.004l-.071-.036q-.016-.004-.024.006l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.016-.018m.264-.113l-.014.002l-.184.093l-.01.01l-.003.011l.018.43l.005.012l.008.008l.201.092q.019.005.029-.008l.004-.014l-.034-.614q-.005-.019-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.003-.011l.018-.43l-.003-.012l-.01-.01z"/><path fill="currentColor" d="M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10s10-4.477 10-10S17.523 2 12 2M8.5 9.5a3.5 3.5 0 1 1 7 0a3.5 3.5 0 0 1-7 0m9.758 7.484A7.99 7.99 0 0 1 12 20a7.99 7.99 0 0 1-6.258-3.016C7.363 15.821 9.575 15 12 15s4.637.821 6.258 1.984"/></g></svg>
  41. </div>
  42. </header>
  43. <main title = "main content">
  44. <section id = "contentLogs" title = "Logs" class = "box-shadow" hidden>
  45. <div class = "toolbar">
  46. <input placeholder = "Search for action name" id = "logSearchBox" />
  47. <button id = "searchLogsClear" title = "Clear search filter" disabled>X</button>
  48. </div>
  49. <table title = "Logs">
  50. <thead>
  51. <tr title = "untitled">
  52. <th>Timestamp</th>
  53. <th>Action</th>
  54. <th>Metadata</th>
  55. <th>Status</th>
  56. </tr>
  57. </thead>
  58. <tbody id = "logTableBody" />
  59. </table>
  60. </section>
  61. <section id = "contentDiagnostics" title = "Diagnostics" class = "box-shadow" hidden>
  62. <div id = "diagnostics" class = "ta-left">
  63. <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>
  64. <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>
  65. <table>
  66. <tbody>
  67. <th colspan = "99">SSH</th>
  68. <tr>
  69. <td width = "10%">Found Key</td>
  70. <td id = "diagnostics-sshfoundkey">?</td>
  71. </tr>
  72. <tr>
  73. <td>Found Config</td>
  74. <td id = "diagnostics-sshfoundconfig">?</td>
  75. </tbody>
  76. </table>
  77. </div>
  78. </section>
  79. <section id = "contentActions" title = "Actions" hidden >
  80. <fieldset id = "root-group" title = "Actions">
  81. <legend hidden>Actions</legend>
  82. </fieldset>
  83. </section>
  84. <noscript>
  85. <div class = "error">Sorry, JavaScript is required to use OliveTin.</div>
  86. </noscript>
  87. </main>
  88. <footer title = "footer">
  89. <p><img title = "application icon" src = "OliveTinLogo.png" alt = "OliveTin logo" height = "1em" class = "logo" /> OliveTin</p>
  90. <p>
  91. <a href = "https://docs.olivetin.app" target = "_new">Documentation</a> |
  92. <a href = "https://github.com/OliveTin/OliveTin/issues/new/choose" target = "_new">Raise an issue on GitHub</a> |
  93. <span>Version: <span id = "currentVersion">?</span></span> |
  94. <span>Server connection:
  95. <span id = "serverConnectionRest">REST</span>,
  96. <span id = "serverConnectionWebSocket">WebSocket</span>
  97. </span>
  98. </p>
  99. <p>
  100. <a id = "available-version" href = "http://olivetin.app" target = "_blank" hidden>?</a>
  101. </p>
  102. </footer>
  103. <dialog title = "Big Error Message" id = "big-error" class = "error padded-content">
  104. </dialog>
  105. <dialog title = "Execution Results" id = "execution-results-popup">
  106. <div class = "action-header padded-content">
  107. <span id = "execution-dialog-icon" class = "icon" role = "img"></span>
  108. <h2>
  109. <span id = "execution-dialog-title">?</span>
  110. </h2>
  111. <button id = "execution-dialog-toggle-size" title = "Toggle dialog size">
  112. <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>
  113. </button>
  114. </div>
  115. <div id = "execution-dialog-basics" class = "padded-content-sides">
  116. <strong>Duration: </strong><span id = "execution-dialog-duration">unknown</span>
  117. </div>
  118. <div id = "execution-dialog-details" class = "padded-content-sides">
  119. <p>
  120. <strong>Status: </strong><span id = "execution-dialog-status">unknown</span>
  121. </p>
  122. </div>
  123. <div id = "execution-dialog-xterm"></div>
  124. <div class = "buttons padded-content">
  125. <button name = "kill" title = "Kill" id = "execution-dialog-kill-action">Kill</button>
  126. <form method = "dialog">
  127. <button name = "Cancel" title = "Close">Close</button>
  128. </form>
  129. </div>
  130. </dialog>
  131. <template id = "tplLoginForm">
  132. <section id = "content-login" title = "Login" hidden>
  133. <div class = "flex-col">
  134. <form class = "box-shadow padded-content border-radius" id = "local-user-login">
  135. <p class = "login-disabled">Login with OAuth or Local users is not enabled on this server.</p>
  136. <div class = "login-oauth2" hidden>
  137. <h2>OAuth Login</h2>
  138. </div>
  139. <br />
  140. <div class = "login-local" hidden>
  141. <h2>Local Login</h2>
  142. <div class = "error"></div>
  143. <div class = "arguments">
  144. <label for = "username">
  145. <span>Username:</span>
  146. </label>
  147. <input type = "text" name = "username" class = "username" />
  148. <span></span>
  149. <label for = "password">
  150. <span>Password:</span>
  151. </label>
  152. <input type = "password" name = "password" class = "password" />
  153. <span></span>
  154. <button type = "submit">Login</button>
  155. </div>
  156. </div>
  157. </form>
  158. </div>
  159. </section>
  160. </template>
  161. <template id = "tplArgumentForm">
  162. <dialog title = "Arguments" id = "argument-popup">
  163. <form class = "action-arguments padded-content">
  164. <div class = "wrapper">
  165. <div class = "action-header">
  166. <span class = "icon" role = "img"></span>
  167. <h2>Argument form</h2>
  168. </div>
  169. <div class = "arguments"></div>
  170. <div class = "buttons">
  171. <input name = "start" type = "submit" value = "Start">
  172. <button name = "cancel" title = "Cancel">Cancel</button>
  173. </div>
  174. </div>
  175. </form>
  176. </dialog>
  177. </template>
  178. <template id = "tplActionButton">
  179. <button>
  180. <span title = "action button icon" class = "icon">&#x1f4a9;</span>
  181. <span class = "title" aria-live = "polite">Untitled Button</span>
  182. </button>
  183. <div class = "action-button-footer" hidden></div>
  184. </template>
  185. <template id = "tplLogRow">
  186. <tr class = "log-row">
  187. <td class = "timestamp">?</td>
  188. <td>
  189. <span role = "img" class = "icon"></span>
  190. <a href = "javascript:void(0)" class = "content">?</a>
  191. </td>
  192. <td class = "tags"></td>
  193. <td class = "exit-code">?</td>
  194. </tr>
  195. </template>
  196. <script type = "text/javascript">
  197. const bigErrorDialog = document.getElementById('big-error')
  198. /**
  199. This is the bootstrap code, which relies on very simple, old javascript
  200. to at least display a helpful error message if we can't use OliveTin.
  201. */
  202. window.showBigError = function (type, friendlyType, message, isFatal) {
  203. 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>"
  204. if (isFatal) {
  205. bigErrorDialog.innerHTML += '<p>You will need to refresh your browser to clear this message.</p>'
  206. } else {
  207. bigErrorDialog.innerHTML += '<p>This error message will go away automatically if the problem is solved.</p>'
  208. }
  209. bigErrorDialog.showModal()
  210. console.error('Error ' + type + ': ', message)
  211. }
  212. window.clearBigErrors = function () {
  213. bigErrorDialog.close()
  214. }
  215. </script>
  216. <script type = "text/javascript" nomodule>
  217. showBigError("js-modules-not-supported", "Sorry, your browser does not support JavaScript modules.", null)
  218. </script>
  219. <script type = "module" src = "main.js"></script>
  220. <script src = "lib/iconify-icon-2.0.0.min.js"></script>
  221. </body>
  222. </html>