templates.go 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. package auth
  2. import "html/template"
  3. type ssoCallbackTemplateConfig struct {
  4. User string
  5. Verb string
  6. }
  7. var ssoCallbackTemplate = template.Must(
  8. template.New("ssocallback").Parse(`<!DOCTYPE html>
  9. <html lang="en">
  10. <head>
  11. <meta charset="UTF-8">
  12. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  13. <meta http-equiv="X-UA-Compatible" content="ie=edge">
  14. <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css"
  15. integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
  16. <title>Netmaker</title>
  17. </head>
  18. <style>
  19. .text-responsive {
  20. font-size: calc(100% + 1vw + 1vh);
  21. }
  22. </style>
  23. <body>
  24. <div class="container">
  25. <div class="row justify-content-center mt-5 p-5 align-items-center text-center">
  26. <a href="https://netmaker.io">
  27. <img src="https://raw.githubusercontent.com/gravitl/netmaker/master/img/netmaker-teal.png" alt="Netmaker"
  28. width="75%" height="25%" class="img-fluid">
  29. </a>
  30. </div>
  31. <div class="row justify-content-center mt-5 p-3 text-center">
  32. <div class="col">
  33. <h2 class="text-responsive">{{.User}} has been successfully {{.Verb}}</h2>
  34. <br />
  35. <h2 class="text-responsive">You may now close this window.</h2>
  36. </div>
  37. </div>
  38. </div>
  39. </body>
  40. </html>`),
  41. )
  42. var ssoErrCallbackTemplate = template.Must(
  43. template.New("ssocallback").Parse(`<!DOCTYPE html>
  44. <html lang="en">
  45. <head>
  46. <meta charset="UTF-8">
  47. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  48. <meta http-equiv="X-UA-Compatible" content="ie=edge">
  49. <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css"
  50. integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
  51. <title>Netmaker</title>
  52. </head>
  53. <style>
  54. .text-responsive {
  55. font-size: calc(100% + 1vw + 1vh);
  56. color: red;
  57. }
  58. </style>
  59. <body>
  60. <div class="container">
  61. <div class="row justify-content-center mt-5 p-5 align-items-center text-center">
  62. <a href="https://netmaker.io">
  63. <img src="https://raw.githubusercontent.com/gravitl/netmaker/master/img/netmaker-teal.png" alt="Netmaker"
  64. width="75%" height="25%" class="img-fluid">
  65. </a>
  66. </div>
  67. <div class="row justify-content-center mt-5 p-3 text-center">
  68. <div class="col">
  69. <h2 class="text-responsive">{{.User}} unable to join network: {{.Verb}}</h2>
  70. <br />
  71. <h2 class="text-responsive">If you feel this is a mistake, please contact your network administrator.</h2>
  72. </div>
  73. </div>
  74. </div>
  75. </body>
  76. </html>`),
  77. )