index.html 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280
  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. <label class = "input-with-icons">
  47. <svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24"><path fill="currentColor" d="m19.6 21l-6.3-6.3q-.75.6-1.725.95T9.5 16q-2.725 0-4.612-1.888T3 9.5t1.888-4.612T9.5 3t4.613 1.888T16 9.5q0 1.1-.35 2.075T14.7 13.3l6.3 6.3zM9.5 14q1.875 0 3.188-1.312T14 9.5t-1.312-3.187T9.5 5T6.313 6.313T5 9.5t1.313 3.188T9.5 14"/></svg>
  48. <input placeholder = "Search for action name" id = "logSearchBox" />
  49. <button id = "searchLogsClear" title = "Clear search filter" disabled>
  50. <svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24"><path fill="currentColor" d="M19 6.41L17.59 5L12 10.59L6.41 5L5 6.41L10.59 12L5 17.59L6.41 19L12 13.41L17.59 19L19 17.59L13.41 12z"/></svg>
  51. </button>
  52. </label>
  53. </div>
  54. <table id = "logsTable" title = "Logs" hidden>
  55. <thead>
  56. <tr title = "untitled">
  57. <th>Timestamp</th>
  58. <th>Action</th>
  59. <th>Metadata</th>
  60. <th>Status</th>
  61. </tr>
  62. </thead>
  63. <tbody id = "logTableBody" />
  64. </table>
  65. <p id = "logsTableEmpty">There are no logs to display. <a href = "/">Return to index</a></p>
  66. <p><strong>Note:</strong> The server is configured to only send <strong id = "logs-server-page-size">?</strong> log entries at a time. The search box at the top of this page only searches this current page of logs.</p>
  67. </section>
  68. <section id = "contentDiagnostics" title = "Diagnostics" class = "box-shadow" hidden>
  69. <div id = "diagnostics" class = "ta-left">
  70. <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>
  71. <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>
  72. <table>
  73. <tbody>
  74. <th colspan = "99">SSH</th>
  75. <tr>
  76. <td width = "10%">Found Key</td>
  77. <td id = "diagnostics-sshfoundkey">?</td>
  78. </tr>
  79. <tr>
  80. <td>Found Config</td>
  81. <td id = "diagnostics-sshfoundconfig">?</td>
  82. </tbody>
  83. </table>
  84. </div>
  85. </section>
  86. <section id = "contentActions" title = "Actions" hidden >
  87. <fieldset id = "root-group" title = "Actions">
  88. <legend hidden>Actions</legend>
  89. </fieldset>
  90. </section>
  91. <noscript>
  92. <div class = "error">Sorry, JavaScript is required to use OliveTin.</div>
  93. </noscript>
  94. </main>
  95. <footer title = "footer">
  96. <p><img title = "application icon" src = "OliveTinLogo.png" alt = "OliveTin logo" height = "1em" class = "logo" /> OliveTin</p>
  97. <p>
  98. <a href = "https://docs.olivetin.app" target = "_new">Documentation</a> |
  99. <a href = "https://github.com/OliveTin/OliveTin/issues/new/choose" target = "_new">Raise an issue on GitHub</a> |
  100. <span>Version: <span id = "currentVersion">?</span></span> |
  101. <span>Server connection:
  102. <span id = "serverConnectionRest">REST</span>,
  103. <span id = "serverConnectionWebSocket">WebSocket</span>
  104. </span>
  105. </p>
  106. <p>
  107. <a id = "available-version" href = "http://olivetin.app" target = "_blank" hidden>?</a>
  108. </p>
  109. </footer>
  110. <dialog title = "Big Error Message" id = "big-error" class = "error padded-content">
  111. </dialog>
  112. <dialog title = "Execution Results" id = "execution-results-popup">
  113. <div class = "action-header padded-content">
  114. <span id = "execution-dialog-icon" class = "icon" role = "img"></span>
  115. <h2>
  116. <span id = "execution-dialog-title">?</span>
  117. </h2>
  118. <button id = "execution-dialog-toggle-size" title = "Toggle dialog size">
  119. <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>
  120. </button>
  121. </div>
  122. <div id = "execution-dialog-basics" class = "padded-content-sides">
  123. <strong>Duration: </strong><span id = "execution-dialog-duration">unknown</span>
  124. </div>
  125. <div id = "execution-dialog-details" class = "padded-content-sides">
  126. <p>
  127. <strong>Status: </strong><span id = "execution-dialog-status">unknown</span>
  128. </p>
  129. </div>
  130. <div id = "execution-dialog-xterm"></div>
  131. <div id = "execution-dialog-output-html" class = "padded-content"></div>
  132. <div class = "buttons padded-content">
  133. <button name = "rerun" title = "Rerun" id = "execution-dialog-rerun-action">Rerun</button>
  134. <button name = "kill" title = "Kill" id = "execution-dialog-kill-action">Kill</button>
  135. <form method = "dialog">
  136. <button name = "Cancel" title = "Close">Close</button>
  137. </form>
  138. </div>
  139. </dialog>
  140. <template id = "tplLoginForm">
  141. <section id = "content-login" title = "Login" hidden>
  142. <div class = "flex-col">
  143. <form class = "box-shadow padded-content border-radius" id = "local-user-login">
  144. <p class = "login-disabled">This server is not configured with either OAuth, or local users, so you cannot login.</p>
  145. <div class = "login-oauth2" hidden>
  146. <h2>OAuth Login</h2>
  147. </div>
  148. <br />
  149. <div class = "login-local" hidden>
  150. <h2>Local Login</h2>
  151. <div class = "error"></div>
  152. <div class = "arguments">
  153. <label for = "username">
  154. <span>Username:</span>
  155. </label>
  156. <input type = "text" name = "username" class = "username" />
  157. <span></span>
  158. <label for = "password">
  159. <span>Password:</span>
  160. </label>
  161. <input type = "password" name = "password" class = "password" />
  162. <span></span>
  163. <button type = "submit">Login</button>
  164. </div>
  165. </div>
  166. </form>
  167. </div>
  168. </section>
  169. </template>
  170. <template id = "tplArgumentForm">
  171. <dialog title = "Arguments" id = "argument-popup">
  172. <form class = "action-arguments padded-content">
  173. <div class = "wrapper">
  174. <div class = "action-header">
  175. <span class = "icon" role = "img"></span>
  176. <h2>Argument form</h2>
  177. </div>
  178. <div class = "arguments"></div>
  179. <div class = "buttons">
  180. <input name = "start" type = "submit" value = "Start">
  181. <button name = "cancel" title = "Cancel">Cancel</button>
  182. </div>
  183. </div>
  184. </form>
  185. </dialog>
  186. </template>
  187. <template id = "tplActionButton">
  188. <button>
  189. <span title = "action button icon" class = "icon">&#x1f4a9;</span>
  190. <span class = "title" aria-live = "polite">Untitled Button</span>
  191. </button>
  192. <div class = "action-button-footer" hidden></div>
  193. </template>
  194. <template id = "tplLogRow">
  195. <tr class = "log-row">
  196. <td class = "timestamp">?</td>
  197. <td>
  198. <span role = "img" class = "icon"></span>
  199. <a href = "javascript:void(0)" class = "content">?</a>
  200. </td>
  201. <td class = "tags"></td>
  202. <td class = "exit-code">?</td>
  203. </tr>
  204. </template>
  205. <script type = "text/javascript">
  206. const bigErrorDialog = document.getElementById('big-error')
  207. /**
  208. This is the bootstrap code, which relies on very simple, old javascript
  209. to at least display a helpful error message if we can't use OliveTin.
  210. */
  211. window.showBigError = function (type, friendlyType, message, isFatal) {
  212. 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>"
  213. if (isFatal) {
  214. bigErrorDialog.innerHTML += '<p>You will need to refresh your browser to clear this message.</p>'
  215. } else {
  216. bigErrorDialog.innerHTML += '<p>This error message will go away automatically if the problem is solved.</p>'
  217. }
  218. bigErrorDialog.showModal()
  219. console.error('Error ' + type + ': ', message)
  220. }
  221. window.clearBigErrors = function () {
  222. bigErrorDialog.close()
  223. }
  224. </script>
  225. <script type = "text/javascript" nomodule>
  226. showBigError("js-modules-not-supported", "Sorry, your browser does not support JavaScript modules.", null)
  227. </script>
  228. <script type = "module" src = "main.js"></script>
  229. <script src = "lib/iconify-icon-2.0.0.min.js"></script>
  230. </body>
  231. </html>