Skip to content

Commit

Permalink
optimize: swagger-ui
Browse files Browse the repository at this point in the history
Signed-off-by: 孙林耀 <[email protected]>
  • Loading branch information
MicroOps-cn committed Feb 8, 2024
1 parent d3b753a commit 0664655
Show file tree
Hide file tree
Showing 19 changed files with 53 additions and 141 deletions.
12 changes: 12 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -154,3 +154,15 @@ ui:
cd public && yarn install && yarn run build --basePath='$(BASE_PATH)/admin/' --apiPath='$(BASE_PATH)/'
rm -rf pkg/transport/static && cp -r public/dist pkg/transport/static

.PHONY: swagger
swagger:
@echo ">> generate swagger ui"
@mkdir -p dist/swagger-ui/;
@if [ -d "public/node_modules/swagger-ui-dist/" ] && [ -f "public/node_modules/swagger-ui-dist/swagger-ui-bundle.js" ];then \
cp public/node_modules/swagger-ui-dist/swagger-ui-bundle.js dist/swagger-ui/ ;\
cp public/node_modules/swagger-ui-dist/swagger-ui-standalone-preset.js dist/swagger-ui/ ;\
cp public/node_modules/swagger-ui-dist/favicon-32x32.png dist/swagger-ui/ ;\
cp public/node_modules/swagger-ui-dist/favicon-16x16.png dist/swagger-ui/ ;\
cp public/node_modules/swagger-ui-dist/swagger-ui.css dist/swagger-ui/ ;\
cp swagger-ui/index.html dist/swagger-ui/ ;\
fi
Binary file removed swagger-ui/favicon-16x16.png
Binary file not shown.
Binary file removed swagger-ui/favicon-32x32.png
Binary file not shown.
16 changes: 0 additions & 16 deletions swagger-ui/index.css

This file was deleted.

43 changes: 41 additions & 2 deletions swagger-ui/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,54 @@
<meta charset="UTF-8">
<title>Swagger UI</title>
<link rel="stylesheet" type="text/css" href="./swagger-ui.css" />
<link rel="stylesheet" type="text/css" href="index.css" />
<link rel="icon" type="image/png" href="./favicon-32x32.png" sizes="32x32" />
<link rel="icon" type="image/png" href="./favicon-16x16.png" sizes="16x16" />
<style>
html {
box-sizing: border-box;
overflow: -moz-scrollbars-vertical;
overflow-y: scroll;
}

*,
*:before,
*:after {
box-sizing: inherit;
}

body {
margin: 0;
background: #fafafa;
}
.topbar{
display: none;
}
.swagger-ui .info{
margin-top: 10px;
}
</style>
</head>

<body>
<div id="swagger-ui"></div>
<script src="./swagger-ui-bundle.js" charset="UTF-8"> </script>
<script src="./swagger-ui-standalone-preset.js" charset="UTF-8"> </script>
<script src="./swagger-initializer.js" charset="UTF-8"> </script>
<script charset="UTF-8">
window.onload = function() {
window.ui = SwaggerUIBundle({
url: "/apidocs.json",
dom_id: '#swagger-ui',
deepLinking: true,
presets: [
SwaggerUIBundle.presets.apis,
SwaggerUIStandalonePreset
],
plugins: [
SwaggerUIBundle.plugins.DownloadUrl
],
layout: "StandaloneLayout"
});
};
</script>
</body>
</html>
79 changes: 0 additions & 79 deletions swagger-ui/oauth2-redirect.html

This file was deleted.

20 changes: 0 additions & 20 deletions swagger-ui/swagger-initializer.js

This file was deleted.

3 changes: 0 additions & 3 deletions swagger-ui/swagger-ui-bundle.js

This file was deleted.

1 change: 0 additions & 1 deletion swagger-ui/swagger-ui-bundle.js.map

This file was deleted.

3 changes: 0 additions & 3 deletions swagger-ui/swagger-ui-es-bundle-core.js

This file was deleted.

1 change: 0 additions & 1 deletion swagger-ui/swagger-ui-es-bundle-core.js.map

This file was deleted.

3 changes: 0 additions & 3 deletions swagger-ui/swagger-ui-es-bundle.js

This file was deleted.

1 change: 0 additions & 1 deletion swagger-ui/swagger-ui-es-bundle.js.map

This file was deleted.

3 changes: 0 additions & 3 deletions swagger-ui/swagger-ui-standalone-preset.js

This file was deleted.

1 change: 0 additions & 1 deletion swagger-ui/swagger-ui-standalone-preset.js.map

This file was deleted.

4 changes: 0 additions & 4 deletions swagger-ui/swagger-ui.css

This file was deleted.

1 change: 0 additions & 1 deletion swagger-ui/swagger-ui.css.map

This file was deleted.

2 changes: 0 additions & 2 deletions swagger-ui/swagger-ui.js

This file was deleted.

1 change: 0 additions & 1 deletion swagger-ui/swagger-ui.js.map

This file was deleted.

0 comments on commit 0664655

Please sign in to comment.