add staticfile
This commit is contained in:
BIN
static/ninja/favicon.png
Normal file
BIN
static/ninja/favicon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 6.1 KiB |
1806
static/ninja/redoc.standalone.js
Normal file
1806
static/ninja/redoc.standalone.js
Normal file
File diff suppressed because one or more lines are too long
1
static/ninja/redoc.standalone.js.map
Normal file
1
static/ninja/redoc.standalone.js.map
Normal file
File diff suppressed because one or more lines are too long
3
static/ninja/swagger-ui-bundle.js
Normal file
3
static/ninja/swagger-ui-bundle.js
Normal file
File diff suppressed because one or more lines are too long
1
static/ninja/swagger-ui-bundle.js.map
Normal file
1
static/ninja/swagger-ui-bundle.js.map
Normal file
File diff suppressed because one or more lines are too long
46
static/ninja/swagger-ui-init.js
Normal file
46
static/ninja/swagger-ui-init.js
Normal file
@@ -0,0 +1,46 @@
|
||||
/**JS file for handling the SwaggerUIBundle and avoid inline script */
|
||||
const csrfSettings = document.querySelector("body").dataset
|
||||
const configJson = document.getElementById("swagger-settings").textContent;
|
||||
const configObject = JSON.parse(configJson);
|
||||
|
||||
configObject.dom_id = "#swagger-ui";
|
||||
configObject.presets = [
|
||||
SwaggerUIBundle.presets.apis,
|
||||
SwaggerUIBundle.SwaggerUIStandalonePreset
|
||||
];
|
||||
|
||||
if (csrfSettings.apiCsrf && csrfSettings.csrfToken) {
|
||||
configObject.requestInterceptor = (req) => {
|
||||
req.headers['X-CSRFToken'] = csrfSettings.csrfToken
|
||||
return req;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
// {% if add_csrf %}
|
||||
// configObject.requestInterceptor = (req) => {
|
||||
// req.headers['X-CSRFToken'] = "{{csrf_token}}";
|
||||
// return req;
|
||||
// };
|
||||
// {% endif %}
|
||||
|
||||
const ui = SwaggerUIBundle(configObject);
|
||||
|
||||
|
||||
|
||||
// SwaggerUIBundle({
|
||||
// url: swaggerUi.dataset.openapiUrl,
|
||||
// dom_id: '#swagger-ui',
|
||||
// presets: [
|
||||
// SwaggerUIBundle.presets.apis,
|
||||
// SwaggerUIBundle.SwaggerUIStandalonePreset
|
||||
// ],
|
||||
// layout: "BaseLayout",
|
||||
// requestInterceptor: (req) => {
|
||||
// if (swaggerUi.dataset.apiCsrf && swaggerUi.dataset.csrfToken) {
|
||||
// req.headers['X-CSRFToken'] = swaggerUi.dataset.csrfToken
|
||||
// }
|
||||
// return req;
|
||||
// },
|
||||
// deepLinking: true
|
||||
// })
|
||||
3
static/ninja/swagger-ui.css
Normal file
3
static/ninja/swagger-ui.css
Normal file
File diff suppressed because one or more lines are too long
1
static/ninja/swagger-ui.css.map
Normal file
1
static/ninja/swagger-ui.css.map
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user