Skip to content

Commit 4827875

Browse files
committed
chore: update swagger-ui bundle
1 parent 40cdebc commit 4827875

21 files changed

+94
-55020
lines changed

client/docs/statik/statik.go

Lines changed: 4 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
220 Bytes
Loading
-513 Bytes
Loading

client/docs/swagger-ui/index.css

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
html {
2+
box-sizing: border-box;
3+
overflow: -moz-scrollbars-vertical;
4+
overflow-y: scroll;
5+
}
6+
7+
*,
8+
*:before,
9+
*:after {
10+
box-sizing: inherit;
11+
}
12+
13+
body {
14+
margin: 0;
15+
background: #fafafa;
16+
}

client/docs/swagger-ui/index.html

Lines changed: 7 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -4,57 +4,16 @@
44
<head>
55
<meta charset="UTF-8">
66
<title>Swagger UI</title>
7-
<link rel="stylesheet" type="text/css" href="swagger-ui.css" >
8-
<link rel="icon" type="image/png" href="favicon-32x32.png" sizes="32x32" />
9-
<link rel="icon" type="image/png" href="favicon-16x16.png" sizes="16x16" />
10-
<style>
11-
html
12-
{
13-
box-sizing: border-box;
14-
overflow: -moz-scrollbars-vertical;
15-
overflow-y: scroll;
16-
}
17-
18-
*,
19-
*:before,
20-
*:after
21-
{
22-
box-sizing: inherit;
23-
}
24-
25-
body
26-
{
27-
margin:0;
28-
background: #fafafa;
29-
}
30-
</style>
7+
<link rel="stylesheet" type="text/css" href="./swagger-ui.css" />
8+
<link rel="stylesheet" type="text/css" href="index.css" />
9+
<link rel="icon" type="image/png" href="./favicon-32x32.png" sizes="32x32" />
10+
<link rel="icon" type="image/png" href="./favicon-16x16.png" sizes="16x16" />
3111
</head>
3212

3313
<body>
3414
<div id="swagger-ui"></div>
35-
36-
<script src="swagger-ui-bundle.js"> </script>
37-
<script src="swagger-ui-standalone-preset.js"> </script>
38-
<script>
39-
window.onload = function() {
40-
41-
// Build a system
42-
const ui = SwaggerUIBundle({
43-
url: "./swagger.json",
44-
dom_id: '#swagger-ui',
45-
deepLinking: true,
46-
presets: [
47-
SwaggerUIBundle.presets.apis,
48-
SwaggerUIStandalonePreset
49-
],
50-
plugins: [
51-
SwaggerUIBundle.plugins.DownloadUrl
52-
],
53-
layout: "StandaloneLayout"
54-
})
55-
56-
window.ui = ui
57-
}
58-
</script>
15+
<script src="./swagger-ui-bundle.js" charset="UTF-8"> </script>
16+
<script src="./swagger-ui-standalone-preset.js" charset="UTF-8"> </script>
17+
<script src="./swagger-initializer.js" charset="UTF-8"> </script>
5918
</body>
6019
</html>
Lines changed: 26 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
<!doctype html>
22
<html lang="en-US">
3-
<body onload="run()">
4-
</body>
5-
</html>
3+
<head>
4+
<title>Swagger UI: OAuth2 Redirect</title>
5+
</head>
6+
<body>
67
<script>
78
'use strict';
89
function run () {
@@ -12,31 +13,32 @@
1213
var isValid, qp, arr;
1314

1415
if (/code|token|error/.test(window.location.hash)) {
15-
qp = window.location.hash.substring(1);
16+
qp = window.location.hash.substring(1).replace('?', '&');
1617
} else {
1718
qp = location.search.substring(1);
1819
}
1920

20-
arr = qp.split("&")
21-
arr.forEach(function (v,i,_arr) { _arr[i] = '"' + v.replace('=', '":"') + '"';})
21+
arr = qp.split("&");
22+
arr.forEach(function (v,i,_arr) { _arr[i] = '"' + v.replace('=', '":"') + '"';});
2223
qp = qp ? JSON.parse('{' + arr.join() + '}',
2324
function (key, value) {
24-
return key === "" ? value : decodeURIComponent(value)
25+
return key === "" ? value : decodeURIComponent(value);
2526
}
26-
) : {}
27+
) : {};
2728

28-
isValid = qp.state === sentState
29+
isValid = qp.state === sentState;
2930

3031
if ((
31-
oauth2.auth.schema.get("flow") === "accessCode"||
32-
oauth2.auth.schema.get("flow") === "authorizationCode"
32+
oauth2.auth.schema.get("flow") === "accessCode" ||
33+
oauth2.auth.schema.get("flow") === "authorizationCode" ||
34+
oauth2.auth.schema.get("flow") === "authorization_code"
3335
) && !oauth2.auth.code) {
3436
if (!isValid) {
3537
oauth2.errCb({
3638
authId: oauth2.auth.name,
3739
source: "auth",
3840
level: "warning",
39-
message: "Authorization may be unsafe, passed state was changed in server Passed state wasn't returned from auth server"
41+
message: "Authorization may be unsafe, passed state was changed in server. The passed state wasn't returned from auth server."
4042
});
4143
}
4244

@@ -45,7 +47,7 @@
4547
oauth2.auth.code = qp.code;
4648
oauth2.callback({auth: oauth2.auth, redirectUrl: redirectUrl});
4749
} else {
48-
let oauthErrorMsg
50+
let oauthErrorMsg;
4951
if (qp.error) {
5052
oauthErrorMsg = "["+qp.error+"]: " +
5153
(qp.error_description ? qp.error_description+ ". " : "no accessCode received from the server. ") +
@@ -56,12 +58,22 @@
5658
authId: oauth2.auth.name,
5759
source: "auth",
5860
level: "error",
59-
message: oauthErrorMsg || "[Authorization failed]: no accessCode received from the server"
61+
message: oauthErrorMsg || "[Authorization failed]: no accessCode received from the server."
6062
});
6163
}
6264
} else {
6365
oauth2.callback({auth: oauth2.auth, token: qp, isValid: isValid, redirectUrl: redirectUrl});
6466
}
6567
window.close();
6668
}
69+
70+
if (document.readyState !== 'loading') {
71+
run();
72+
} else {
73+
document.addEventListener('DOMContentLoaded', function () {
74+
run();
75+
});
76+
}
6777
</script>
78+
</body>
79+
</html>
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
window.onload = function() {
2+
//<editor-fold desc="Changeable Configuration Block">
3+
4+
// the following lines will be replaced by docker/configurator, when it runs in a docker-container
5+
window.ui = SwaggerUIBundle({
6+
url: "./swagger.json",
7+
dom_id: '#swagger-ui',
8+
deepLinking: true,
9+
presets: [
10+
SwaggerUIBundle.presets.apis,
11+
SwaggerUIStandalonePreset
12+
],
13+
plugins: [
14+
SwaggerUIBundle.plugins.DownloadUrl
15+
],
16+
layout: "StandaloneLayout"
17+
});
18+
19+
//</editor-fold>
20+
};

0 commit comments

Comments
 (0)