diff --git a/app/static/assets/js/helper.js b/app/static/assets/js/helper.js index 27327b8..dd49606 100644 --- a/app/static/assets/js/helper.js +++ b/app/static/assets/js/helper.js @@ -1,3 +1,14 @@ +async function fetchConfig(element) { + let xhr = new XMLHttpRequest(); + xhr.open("GET", '/-/config', true); + xhr.onreadystatechange = function () { + if (xhr.readyState === XMLHttpRequest.DONE && xhr.status === 200) { + element.innerHTML = JSON.stringify(JSON.parse(xhr.response),null,2); + } + }; + xhr.send(); +} + async function fetchOriginsWithLeases(element) { let xhr = new XMLHttpRequest(); xhr.open("GET", '/-/origins?leases=true', true); diff --git a/app/templates/views/dashboard.html b/app/templates/views/dashboard.html index 3557170..14a7378 100644 --- a/app/templates/views/dashboard.html +++ b/app/templates/views/dashboard.html @@ -28,6 +28,8 @@ + +

 
 {% endblock %}
 
@@ -37,5 +39,12 @@
     function downloadClientToken() {
         window.open('/-/client-token', "_blank")
     }
+
+    function load() {
+        const config = document.getElementById('config')
+        fetchConfig(config)
+    }
+
+    load()
 
 {% endblock %}