go_admin.go 727 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. package apis
  2. import (
  3. "github.com/gin-gonic/gin"
  4. )
  5. const INDEX = `
  6. <!DOCTYPE html>
  7. <html>
  8. <head>
  9. <meta charset="utf-8">
  10. <title>GO-ADMIN欢迎您</title>
  11. <style>
  12. body{
  13. margin:0;
  14. padding:0;
  15. overflow-y:hidden
  16. }
  17. </style>
  18. <script src="http://libs.baidu.com/jquery/1.9.0/jquery.js"></script>
  19. <script type="text/javascript">
  20. window.onerror=function(){return true;}
  21. $(function(){
  22. headerH = 0;
  23. var h=$(window).height();
  24. $("#iframe").height((h-headerH)+"px");
  25. });
  26. </script>
  27. </head>
  28. <body>
  29. <iframe id="iframe" frameborder="0" src="https://doc.go-admin.dev" style="width:100%;"></iframe>
  30. </body>
  31. </html>
  32. `
  33. func GoAdmin(c *gin.Context) {
  34. c.Header("Content-Type", "text/html; charset=utf-8")
  35. c.String(200, INDEX)
  36. }