index.html 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <!-- HTML for static distribution bundle build -->
  2. <!DOCTYPE html>
  3. <html lang="en">
  4. <head>
  5. <meta charset="UTF-8">
  6. <title>Swagger UI</title>
  7. <link rel="stylesheet" type="text/css" href="/q/swagger-ui/swagger-ui.css"/>
  8. <link rel="icon" type="image/png" href="/q/swagger-ui/favicon-32x32.png" sizes="32x32"/>
  9. <link rel="icon" type="image/png" href="/q/swagger-ui/favicon-16x16.png" sizes="16x16"/>
  10. <style>
  11. html {
  12. box-sizing: border-box;
  13. overflow: -moz-scrollbars-vertical;
  14. overflow-y: scroll;
  15. }
  16. *,
  17. *:before,
  18. *:after {
  19. box-sizing: inherit;
  20. }
  21. body {
  22. margin: 0;
  23. background: #fafafa;
  24. }
  25. </style>
  26. </head>
  27. <body>
  28. <div id="swagger-ui"></div>
  29. <script src="/q/swagger-ui/swagger-ui-bundle.js" charset="UTF-8"></script>
  30. <script src="/q/swagger-ui/swagger-ui-standalone-preset.js" charset="UTF-8"></script>
  31. <script>
  32. window.onload = function () {
  33. const servicesUrl = new URL("/q/services", window.location.href);
  34. fetch(servicesUrl.toString())
  35. .then(response => response.json())
  36. .then(data => {
  37. const urls = data.services.filter((x) => [
  38. "grpc.health.v1.Health",
  39. "kratos.api.Metadata",
  40. "grpc.reflection.v1alpha.ServerReflection",
  41. ].indexOf(x) === -1).map((x) => {
  42. const url = new URL("/q/service/" + x, window.location.href);
  43. return {url: url.toString(), name: x}
  44. });
  45. // Begin Swagger UI call region
  46. const ui = SwaggerUIBundle({
  47. urls: urls,
  48. dom_id: '#swagger-ui',
  49. deepLinking: true,
  50. presets: [
  51. SwaggerUIBundle.presets.apis,
  52. SwaggerUIStandalonePreset,
  53. ],
  54. plugins: [
  55. SwaggerUIBundle.plugins.Topbar,
  56. SwaggerUIBundle.plugins.DownloadUrl,
  57. ],
  58. layout: "StandaloneLayout"
  59. });
  60. // End Swagger UI call region
  61. window.ui = ui;
  62. });
  63. };
  64. </script>
  65. </body>
  66. </html>