diff --git a/webui/assets/main.js b/webui/assets/main.js index 6a4415a5c..d38da454c 100644 --- a/webui/assets/main.js +++ b/webui/assets/main.js @@ -254,12 +254,12 @@ function populate_version() { xhr.onload = function() { var version = JSON.parse(xhr.responseText)['version'] - var version_major_minor = /(v\d+\.\d+)/.exec(version)[0] + var version_major_minor = /v?(\d+\.\d+).*/.exec(version)[1] var doc_link = document.getElementById('nav-documentation') doc_link.onclick = function() { - window.open('https://www.pilosa.com/docs/' + version_major_minor + '/introduction/') + window.open('https://www.pilosa.com/docs/v' + version_major_minor + '/introduction/') } - node.innerHTML = version + node.innerHTML = "Pilosa v" + version } xhr.send(null) } @@ -295,12 +295,19 @@ function set_active_pane_by_name(name) { function update_cluster_status() { var xhr = new XMLHttpRequest(); xhr.open('GET', '/status') - status_node = document.getElementById('status') xhr.onload = function() { var status = JSON.parse(xhr.responseText) render_status(status) } xhr.send(null) + + var xhrSchema = new XMLHttpRequest(); + xhrSchema.open('GET', '/schema') + xhrSchema.onload = function() { + var schema = JSON.parse(xhrSchema.responseText) + render_schema(schema) + } + xhrSchema.send(null) } function render_status(status) { @@ -310,7 +317,7 @@ function render_status(status) { nodes_div.removeChild(nodes_div.firstChild); } - var nodes = status["status"]["Nodes"] + var nodes = status["nodes"] table = document.createElement("table") tbody = document.createElement("tbody") table.appendChild(tbody) @@ -320,31 +327,35 @@ function render_status(status) { var header = document.createElement('tr') markup = `