Skip to content

Commit

Permalink
fix: swagger include js and css on static
Browse files Browse the repository at this point in the history
  • Loading branch information
dpgaspar committed Oct 11, 2023
1 parent dcf8684 commit 0a4db4b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
3 changes: 3 additions & 0 deletions flask_appbuilder/static/appbuilder/css/swagger/swagger-ui.css

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

13 changes: 8 additions & 5 deletions flask_appbuilder/templates/appbuilder/swagger/swagger.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,19 @@

{% block head_css %}
{{ super() }}
<link type="text/css" rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/swagger-ui-dist@5/swagger-ui.css"
nonce="{{ baselib.get_nonce() }}">
<link href="{{ url_for('appbuilder.static',filename='css/swagger/swagger-ui.css') }}"
rel="stylesheet">
{% endblock %}

{% block head_js %}
{{ super() }}
<script src="{{ url_for('appbuilder.static',filename='js/swagger-ui-bundle.js') }}"
nonce="{{ baselib.get_nonce() }}"></script>
{% endblock %}

{% block content %}
<div id="swagger-ui">
</div>
<script src="https://cdn.jsdelivr.net/npm/swagger-ui-dist@5/swagger-ui-bundle.js"
nonce="{{ baselib.get_nonce() }}"></script>
<!-- `SwaggerUIBundle` is now available on the page -->
<script nonce="{{ baselib.get_nonce() }}">
const ui = SwaggerUIBundle({
Expand Down

0 comments on commit 0a4db4b

Please sign in to comment.