index.html 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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" href = "node_modules/@xterm/xterm/css/xterm.css" />
  9. <link rel = "shortcut icon" type = "image/png" href = "OliveTinLogo.png" />
  10. <link rel = "apple-touch-icon" sizes="57x57" href="OliveTinLogo-57px.png" />
  11. <link rel = "apple-touch-icon" sizes="120x120" href="OliveTinLogo-120px.png" />
  12. <link rel = "apple-touch-icon" sizes="180x180" href="OliveTinLogo-180px.png" />
  13. <base href = "/" />
  14. </head>
  15. <body>
  16. <slot id = "app" />
  17. <noscript>
  18. <div class = "error">Sorry, JavaScript is required to use OliveTin.</div>
  19. </noscript>
  20. <dialog title = "Big Error Message" id = "big-error" class = "error padded-content">
  21. </dialog>
  22. <script type = "text/javascript">
  23. const bigErrorDialog = document.getElementById('big-error')
  24. /**
  25. This is the bootstrap code, which relies on very simple, old javascript
  26. to at least display a helpful error message if we can't use OliveTin.
  27. */
  28. window.showBigError = function (type, friendlyType, message, isFatal) {
  29. console.error('Error ' + type + ': ', message)
  30. return;
  31. 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>"
  32. if (isFatal) {
  33. bigErrorDialog.innerHTML += '<p>You will need to refresh your browser to clear this message.</p>'
  34. } else {
  35. bigErrorDialog.innerHTML += '<p>This error message will go away automatically if the problem is solved.</p>'
  36. }
  37. bigErrorDialog.showModal()
  38. console.error('Error ' + type + ': ', message)
  39. }
  40. window.clearBigErrors = function () {
  41. bigErrorDialog.close()
  42. }
  43. </script>
  44. <script type = "text/javascript" nomodule>
  45. showBigError("js-modules-not-supported", "Sorry, your browser does not support JavaScript modules.", null)
  46. </script>
  47. <script type = "module" src = "main.js"></script>
  48. </body>
  49. </html>