index.html 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>PPGO 接口平台</title>
  6. <meta name="renderer" content="webkit">
  7. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  8. <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  9. <meta name="apple-mobile-web-app-status-bar-style" content="black">
  10. <meta name="apple-mobile-web-app-capable" content="yes">
  11. <meta name="format-detection" content="telephone=no">
  12. <link rel="stylesheet" href="/static/layui/css/layui.css">
  13. <link rel="stylesheet" href="/static/css/apidoc.css?t={{.ts}}" media="all">
  14. <link rel="stylesheet" href="/static/font-awesome/css/font-awesome.min.css" media="all">
  15. </head>
  16. <body style="overflow-x:hidden">
  17. <div class="layui-header">
  18. <div style="float: left;background: #393D49;width:20%;height: 60px;line-height: 60px;">
  19. <a class="" href="/" style="margin-left: 20px;">
  20. <img src="/static/img/logo.png" alt="ppgo_admin" style="width: 100px;">
  21. </a>
  22. </div>
  23. <div style="float: right;width: 80%;">
  24. <ul class="layui-nav" >
  25. <li class="layui-nav-item layui-this">
  26. <a href="###">文档</a>
  27. </li>
  28. <li class="layui-nav-item ">
  29. <a href="/home">后台<!-- <span class="layui-badge-dot"></span> --></a>
  30. </li>
  31. </ul>
  32. </div>
  33. </div>
  34. <!-- 让IE8/9支持媒体查询,从而兼容栅格 -->
  35. <!--[if lt IE 9]>
  36. <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
  37. <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
  38. <![endif]-->
  39. <div class="layui-main layui-row" style="width: 100%;">
  40. <div class="site-tree layui-col-md2 layui-hide-xs">
  41. <div class="layui-form" style="height: 38px; margin: 10px 13px 0 0;padding-left: 10px;margin-bottom: 20px;">
  42. <select lay-filter="groups" lay-search>
  43. {{range $index,$elem := .grouplists}}
  44. <option value="{{$elem.Id}}" {{if eq $elem.Id $.groupId}} selected {{end}}>{{$elem.GroupName}}</option>
  45. {{end}}
  46. </select>
  47. </div>
  48. <ul class="layui-tree">
  49. <li><h2>基础说明</h2></li>
  50. <ul>
  51. {{range $pi, $pe := .apiPublic}}
  52. <li class="site-tree-noicon">
  53. <a href="###" data-type="public" data-id="{{$pe.Id}}">
  54. <cite>{{$pe.ApiPublicName}}</cite>
  55. </a>
  56. </li>
  57. {{end}}
  58. <li class="site-tree-noicon">
  59. <a href="###" data-type="env" data-id="{{.groupId}}">
  60. <cite>环境说明</cite>
  61. </a>
  62. </li>
  63. <li class="site-tree-noicon">
  64. <a href="###" data-type="code" data-id="{{.groupId}}">
  65. <cite>状态码说明</cite>
  66. </a>
  67. </li>
  68. </ul>
  69. {{range $index, $elem := .apiMenu}}
  70. {{if $elem}}
  71. <li><h2>{{$elem.SourceName}}</h2></li>
  72. {{range $i, $e := $elem.ApiLists}}
  73. <li class="site-tree-noicon">
  74. <a href="###" data-type="apidetail" data-id="{{$e.Id}}">
  75. <cite>{{$e.ApiName}}</cite>
  76. <em></em>
  77. </a>
  78. </li>
  79. {{end}}
  80. {{end}}
  81. {{end}}
  82. </ul>
  83. <div style="clear:both"></div>
  84. <div class="copyrights">power by ppgo_admin</div>
  85. </div>
  86. <div class="site-content layui-col-md10">
  87. <div class="site-content-header"><i class="fa fa-bars" aria-hidden="true" id="taggle"></i>&nbsp;&nbsp;<span id="content-title">欢迎使用PPGo-ApiAdmin</span> </div>
  88. <div id="api-main">
  89. <div style="width: 200px;height: 50px;margin: 200px auto;">
  90. <img src="/static/img/logo_white.png" alt="">
  91. </div>
  92. </div>
  93. </div>
  94. </div>
  95. <!-- <div class="layui-footer">
  96. <div class="layui-main">
  97. <p>&copy; 2018 <a href="/">PPGo_ApiAdmin</a> MIT license</p>
  98. </div>
  99. </div> -->
  100. <script src="/static/layui/layui.js?s=36"></script>
  101. <script>
  102. layui.use(['element', 'layer','form','jquery'], function(){
  103. var element = layui.element
  104. ,layer = layui.layer;
  105. var form = layui.form;
  106. var $ = layui.jquery;
  107. var windowWidth = $(document.body).outerWidth(true);
  108. var windowHeight = $(window).height();
  109. var contentHeight = windowHeight-$('.layui-header').outerHeight(true);
  110. $("#api-main").height(contentHeight-$('.site-content-header').outerHeight(true));
  111. $(".site-tree").height(contentHeight);
  112. $(".layui-tree").find("li a").on("click",function(){
  113. var hs = $(this)
  114. if (hs) {
  115. $(".layui-tree").find("a").removeClass("active");
  116. hs.addClass("active");
  117. var title = hs.find("cite").text();
  118. $("#content-title").html(title);
  119. $("#api-main").load("/apidoc/"+hs.attr("data-type")+"?id="+hs.attr("data-id"));
  120. }else{
  121. //taggle
  122. }
  123. })
  124. $("#taggle").on("click",function(){
  125. var dis = $(".site-tree").css('display');
  126. if (dis=="none") {
  127. var treeWidth = $('.site-tree').outerWidth(true)
  128. $(".site-content").width(windowWidth-treeWidth);
  129. $(".site-tree").show();
  130. }else{
  131. $(".site-tree").hide();
  132. $(".site-content").width(windowWidth);
  133. }
  134. })
  135. form.on('select(groups)', function(data){
  136. window.location.href="/apidoc/index?id="+data.value;
  137. });
  138. form.render();
  139. });
  140. </script>
  141. </body>
  142. </html>