index.html 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  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. <slot id = "app" />
  19. <main title = "main content">
  20. <section id = "contentActions" title = "Actions" class = "transparent" hidden >
  21. <fieldset id = "root-group" title = "Actions">
  22. <legend hidden>Actions</legend>
  23. </fieldset>
  24. </section>
  25. <noscript>
  26. <div class = "error">Sorry, JavaScript is required to use OliveTin.</div>
  27. </noscript>
  28. </main>
  29. <dialog title = "Big Error Message" id = "big-error" class = "error padded-content">
  30. </dialog>
  31. <dialog title = "Execution Results" id = "execution-results-popup">
  32. <div class = "action-header padded-content">
  33. <span id = "execution-dialog-icon" class = "icon" role = "img"></span>
  34. <h2>
  35. <span id = "execution-dialog-title">?</span>
  36. </h2>
  37. <button id = "execution-dialog-toggle-size" title = "Toggle dialog size">
  38. <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>
  39. </button>
  40. </div>
  41. <div id = "execution-dialog-basics" class = "padded-content-sides">
  42. <strong>Duration: </strong><span id = "execution-dialog-duration">unknown</span>
  43. </div>
  44. <div id = "execution-dialog-details" class = "padded-content-sides">
  45. <p>
  46. <strong>Status: </strong><span id = "execution-dialog-status">unknown</span>
  47. </p>
  48. </div>
  49. <div id = "execution-dialog-xterm"></div>
  50. <div id = "execution-dialog-output-html" class = "padded-content"></div>
  51. <div class = "buttons padded-content">
  52. <button name = "rerun" title = "Rerun" id = "execution-dialog-rerun-action">Rerun</button>
  53. <button name = "kill" title = "Kill" id = "execution-dialog-kill-action">Kill</button>
  54. <form method = "dialog">
  55. <button name = "Cancel" title = "Close">Close</button>
  56. </form>
  57. </div>
  58. </dialog>
  59. <template id = "tplLoginForm">
  60. <section id = "content-login" title = "Login" hidden>
  61. <div class = "flex-col">
  62. <form class = "box-shadow padded-content border-radius" id = "local-user-login">
  63. <p class = "login-disabled">This server is not configured with either OAuth, or local users, so you cannot login.</p>
  64. <div class = "login-oauth2" hidden>
  65. <h2>OAuth Login</h2>
  66. </div>
  67. <br />
  68. <div class = "login-local" hidden>
  69. <h2>Local Login</h2>
  70. <div class = "error"></div>
  71. <div class = "arguments">
  72. <label for = "in-username">
  73. <span>Username:</span>
  74. </label>
  75. <input type = "text" name = "username" id = "in-username" class = "username" autocomplete = "username"/>
  76. <span></span>
  77. <label for = "in-password">
  78. <span>Password:</span>
  79. </label>
  80. <input type = "password" name = "password" id = "in-password" class = "password" />
  81. <span></span>
  82. <button type = "submit">Login</button>
  83. </div>
  84. </div>
  85. </form>
  86. </div>
  87. </section>
  88. </template>
  89. <template id = "tplArgumentForm">
  90. <dialog title = "Arguments" id = "argument-popup">
  91. <form class = "action-arguments padded-content">
  92. <div class = "wrapper">
  93. <div class = "action-header">
  94. <span class = "icon" role = "img"></span>
  95. <h2>Argument form</h2>
  96. </div>
  97. <div class = "arguments"></div>
  98. <div class = "buttons">
  99. <button name = "start" type = "submit">Start</button>
  100. <button name = "cancel" title = "Cancel" type = "button">Cancel</button>
  101. </div>
  102. </div>
  103. </form>
  104. </dialog>
  105. </template>
  106. <template id = "tplActionButton">
  107. <button>
  108. <span title = "action button icon" class = "icon">&#x1f4a9;</span>
  109. <span class = "title" aria-live = "polite">Untitled Button</span>
  110. </button>
  111. <div class = "action-button-footer" hidden></div>
  112. </template>
  113. <template id = "tplLogRow">
  114. <tr class = "log-row">
  115. <td class = "timestamp">?</td>
  116. <td>
  117. <span role = "img" class = "icon"></span>
  118. <a href = "javascript:void(0)" class = "content">?</a>
  119. </td>
  120. <td class = "tags"></td>
  121. <td class = "exit-code">?</td>
  122. </tr>
  123. </template>
  124. <script type = "text/javascript">
  125. const bigErrorDialog = document.getElementById('big-error')
  126. /**
  127. This is the bootstrap code, which relies on very simple, old javascript
  128. to at least display a helpful error message if we can't use OliveTin.
  129. */
  130. window.showBigError = function (type, friendlyType, message, isFatal) {
  131. console.error('Error ' + type + ': ', message)
  132. return;
  133. 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>"
  134. if (isFatal) {
  135. bigErrorDialog.innerHTML += '<p>You will need to refresh your browser to clear this message.</p>'
  136. } else {
  137. bigErrorDialog.innerHTML += '<p>This error message will go away automatically if the problem is solved.</p>'
  138. }
  139. bigErrorDialog.showModal()
  140. console.error('Error ' + type + ': ', message)
  141. }
  142. window.clearBigErrors = function () {
  143. bigErrorDialog.close()
  144. }
  145. </script>
  146. <script type = "text/javascript" nomodule>
  147. showBigError("js-modules-not-supported", "Sorry, your browser does not support JavaScript modules.", null)
  148. </script>
  149. <script type = "module" src = "main.js"></script>
  150. <script src = "lib/iconify-icon-2.0.0.min.js"></script>
  151. </body>
  152. </html>