index.html 2.2 KB

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