| 1 |
<!DOCTYPE html> |
| 2 |
<html> |
| 3 |
<head> |
| 4 |
<link type="text/css" rel="stylesheet" href="https://cdn.jsdelivr.net/npm/swagger-ui-dist@5/swagger-ui.css"> |
| 5 |
<title>{{ api.title }}</title> |
| 6 |
</head> |
| 7 |
<body> |
| 8 |
<div id="swagger-ui"> |
| 9 |
</div> |
| 10 |
|
| 11 |
<script src="https://cdn.jsdelivr.net/npm/swagger-ui-dist@5/swagger-ui-bundle.js"></script> |
| 12 |
<script type="application/json" id="swagger-settings"> |
| 13 |
{{ swagger_settings | safe }} |
| 14 |
</script> |
| 15 |
<script> |
| 16 |
|
| 17 |
const configJson = document.getElementById("swagger-settings").textContent; |
| 18 |
const configObject = JSON.parse(configJson); |
| 19 |
|
| 20 |
configObject.dom_id = "#swagger-ui"; |
| 21 |
configObject.presets = [ |
| 22 |
SwaggerUIBundle.presets.apis, |
| 23 |
SwaggerUIBundle.SwaggerUIStandalonePreset |
| 24 |
]; |
| 25 |
{% if add_csrf %} |
| 26 |
configObject.requestInterceptor = (req) => { |
| 27 |
req.headers['X-CSRFToken'] = "{{csrf_token}}"; |
| 28 |
return req; |
| 29 |
}; |
| 30 |
{% endif %} |
| 31 |
|
| 32 |
const ui = SwaggerUIBundle(configObject); |
| 33 |
|
| 34 |
</script> |
| 35 |
</body> |
| 36 |
</html> |