blob: 74e60cf27b33ce621287f9c80c8014fae8191a84 [file] [log] [blame]
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
{{> www/common-header.tmpl }}
{{> www/query_detail_tabs.tmpl }}
<div>
<label>
<input type="checkbox" checked="true" id="toggle" onClick="toggleRefresh()"/>
<span id="refresh_on">Auto-refresh on</span>
</label> Last updated: <span id="last-updated"></span>
</div>
<h3>Timeline</h3>
<pre id="timeline">{{timeline}}</pre>
<h3>Exec Summary</h3>
<pre id="summary">{{summary}}</pre>
<script>
$("#summary-tab").addClass("active");
// Periodically refreshes the summary details
function refresh() {
var xhr = new XMLHttpRequest();
xhr.responseType = 'text';
xhr.timeout = 60000;
xhr.onload = function(ignored_arg) {
if (xhr.status != 200) {
return;
}
var blob = xhr.response;
json = JSON.parse(blob);
if (json.error) {
clearInterval(intervalId);
document.getElementById("toggle").checked = false;
return;
}
refresh_record(json.record_json);
document.getElementById("timeline").textContent = json["timeline"].trim();
document.getElementById("summary").textContent = json["summary"].trim();
document.getElementById("status").textContent = json["status"];
document.getElementById("last-updated").textContent = new Date();
}
xhr.ontimeout = function(){ }
xhr.open('GET', make_url("/query_summary?query_id={{query_id}}&json"), true);
xhr.send();
}
document.getElementById("last-updated").textContent = new Date();
var intervalId = setInterval(refresh, 1000);
function toggleRefresh() {
if (document.getElementById("toggle").checked === true) {
intervalId = setInterval(refresh, 1000);
document.getElementById("refresh_on").textContent = "Auto-refresh on";
} else {
clearInterval(intervalId);
document.getElementById("refresh_on").textContent = "Auto-refresh off";
}
}
</script>
{{> www/common-footer.tmpl}}