index.html 11 KB

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