Skip to content

Commit

Permalink
bumped the swagger-ui
Browse files Browse the repository at this point in the history
  • Loading branch information
CommanderStorm committed Sep 12, 2023
1 parent 6a77f12 commit 0839502
Show file tree
Hide file tree
Showing 11 changed files with 37 additions and 45 deletions.
Binary file added server/swagger/fav.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed server/swagger/favicon-16x16.png
Binary file not shown.
Binary file removed server/swagger/favicon-32x32.png
Binary file not shown.
37 changes: 4 additions & 33 deletions server/swagger/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,55 +5,26 @@
<meta charset="UTF-8">
<title>Swagger UI</title>
<link rel="stylesheet" type="text/css" href="./swagger-ui.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;
}
<link rel="icon" href="fav.png">

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

body
{
margin:0;
background: #fafafa;
}
</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>
window.onload = function() {
// Begin Swagger UI call region
const ui = SwaggerUIBundle({
window.ui = SwaggerUIBundle({
url: "./swagger.json",
dom_id: '#swagger-ui',
deepLinking: true,
presets: [
SwaggerUIBundle.presets.apis,
SwaggerUIStandalonePreset
SwaggerUIBundle.presets.apis
],
plugins: [
SwaggerUIBundle.plugins.DownloadUrl
],
layout: "StandaloneLayout"
layout: "BaseLayout"
});
// End Swagger UI call region

window.ui = ui;
};
</script>
</body>
Expand Down
16 changes: 10 additions & 6 deletions server/swagger/oauth2-redirect.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
var isValid, qp, arr;

if (/code|token|error/.test(window.location.hash)) {
qp = window.location.hash.substring(1);
qp = window.location.hash.substring(1).replace('?', '&');
} else {
qp = location.search.substring(1);
}
Expand All @@ -38,7 +38,7 @@
authId: oauth2.auth.name,
source: "auth",
level: "warning",
message: "Authorization may be unsafe, passed state was changed in server Passed state wasn't returned from auth server"
message: "Authorization may be unsafe, passed state was changed in server. The passed state wasn't returned from auth server."
});
}

Expand All @@ -58,7 +58,7 @@
authId: oauth2.auth.name,
source: "auth",
level: "error",
message: oauthErrorMsg || "[Authorization failed]: no accessCode received from the server"
message: oauthErrorMsg || "[Authorization failed]: no accessCode received from the server."
});
}
} else {
Expand All @@ -67,9 +67,13 @@
window.close();
}

window.addEventListener('DOMContentLoaded', function () {
run();
});
if (document.readyState !== 'loading') {
run();
} else {
document.addEventListener('DOMContentLoaded', function () {
run();
});
}
</script>
</body>
</html>
2 changes: 1 addition & 1 deletion server/swagger/swagger-ui-bundle.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion server/swagger/swagger-ui-bundle.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion server/swagger/swagger-ui-standalone-preset.js

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions server/swagger/swagger-ui.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion server/swagger/swagger-ui.css.map

Large diffs are not rendered by default.

18 changes: 18 additions & 0 deletions server/swagger/update_swagger-ui.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/sh

echo updating the swagger-ui
pnpm i swagger-ui

rsync node_modules/swagger-ui/dist/oauth2-redirect.html .
rsync node_modules/swagger-ui/dist/swagger-ui-bundle.js .
rsync node_modules/swagger-ui/dist/swagger-ui-bundle.js.map .
rsync node_modules/swagger-ui/dist/swagger-ui.css .
rsync node_modules/swagger-ui/dist/swagger-ui.css.map .

echo cleaning up temporary files
rm -fr node_modules
rm -fr package*.json

echo updating the favicon
curl https://www.tum.app/assets/img/fav.png --output fav.png

0 comments on commit 0839502

Please sign in to comment.