mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-14 09:51:22 -06:00
Fixes #17895: Ensure GraphiQL UI resources are served locally
This commit is contained in:
parent
58bc388457
commit
81f00fd03a
@ -14,7 +14,6 @@ class NetBoxGraphQLView(GraphQLView):
|
|||||||
"""
|
"""
|
||||||
Extends strawberry's GraphQLView to support DRF's token-based authentication.
|
Extends strawberry's GraphQLView to support DRF's token-based authentication.
|
||||||
"""
|
"""
|
||||||
graphiql_template = 'graphiql.html'
|
|
||||||
|
|
||||||
@csrf_exempt
|
@csrf_exempt
|
||||||
def dispatch(self, request, *args, **kwargs):
|
def dispatch(self, request, *args, **kwargs):
|
||||||
|
@ -1,15 +1,8 @@
|
|||||||
|
{% load static %}
|
||||||
{% comment %}
|
{% comment %}
|
||||||
This template derives from the strawberry-graphql project:
|
This template derives from the strawberry-graphql project:
|
||||||
https://github.com/strawberry-graphql/strawberry/blob/main/strawberry/static/graphiql.html
|
https://github.com/strawberry-graphql/strawberry/blob/main/strawberry/static/graphiql.html
|
||||||
{% endcomment %}
|
{% endcomment %}
|
||||||
<!--
|
|
||||||
The request to this GraphQL server provided the header "Accept: text/html"
|
|
||||||
and as a result has been presented GraphiQL - an in-browser IDE for
|
|
||||||
exploring GraphQL.
|
|
||||||
If you wish to receive JSON, provide the header "Accept: application/json" or
|
|
||||||
add "&raw" to the end of the URL within a browser.
|
|
||||||
-->
|
|
||||||
{% load static %}
|
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
@ -112,10 +105,7 @@ add "&raw" to the end of the URL within a browser.
|
|||||||
headers["x-csrftoken"] = csrfToken;
|
headers["x-csrftoken"] = csrfToken;
|
||||||
}
|
}
|
||||||
|
|
||||||
const subscriptionsEnabled = JSON.parse("{{ SUBSCRIPTION_ENABLED }}");
|
const subscriptionUrl = httpUrlToWebSockeUrl(fetchURL);
|
||||||
const subscriptionUrl = subscriptionsEnabled
|
|
||||||
? httpUrlToWebSockeUrl(fetchURL)
|
|
||||||
: null;
|
|
||||||
|
|
||||||
const fetcher = GraphiQL.createFetcher({
|
const fetcher = GraphiQL.createFetcher({
|
||||||
url: fetchURL,
|
url: fetchURL,
|
Loading…
Reference in New Issue
Block a user