[LNT] r256294 - Fix AJAX 404 errors on servers that don't run LNT at /
Chris Matthews via llvm-commits
llvm-commits at lists.llvm.org
Tue Dec 22 15:13:20 PST 2015
Author: cmatthews
Date: Tue Dec 22 17:13:20 2015
New Revision: 256294
URL: http://llvm.org/viewvc/llvm-project?rev=256294&view=rev
Log:
Fix AJAX 404 errors on servers that don't run LNT at /
Modified:
lnt/trunk/lnt/server/ui/static/lnt_graph.js
lnt/trunk/lnt/server/ui/templates/layout.html
lnt/trunk/lnt/server/ui/templates/v4_regression_detail.html
Modified: lnt/trunk/lnt/server/ui/static/lnt_graph.js
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/ui/static/lnt_graph.js?rev=256294&r1=256293&r2=256294&view=diff
==============================================================================
--- lnt/trunk/lnt/server/ui/static/lnt_graph.js (original)
+++ lnt/trunk/lnt/server/ui/static/lnt_graph.js Tue Dec 22 17:13:20 2015
@@ -6,6 +6,8 @@
var data_cache = [];
var is_checked = []; // The current list of lines to plot.
var normalize = false;
+var prefix = "";
+
var MAX_TO_DRAW = 10;
var STATE_NAMES = {0: 'Detected',
@@ -141,19 +143,19 @@ function update_tooltip(event, pos, item
// Grab the graph API url for this line.
function get_api_url(kind, db, ts, mtf) {
"use strict";
- return ["/api", "db_" + db, "v4", ts, kind, mtf].join('/');
+ return [prefix, "api", "db_" + db, "v4", ts, kind, mtf].join('/');
}
// Grab the URL for a regression by id.
function get_regression_url(db, ts, regression) {
"use strict";
- return ["", "db_" + db, "v4", ts, "regressions", regression].join('/');
+ return [prefix, "db_" + db, "v4", ts, "regressions", regression].join('/');
}
// Grab the URL for a run by id.
function get_run_url(db, ts, runID) {
"use strict";
- return ["", "db_" + db, "v4", ts, runID].join('/');
+ return [prefix, "db_" + db, "v4", ts, runID].join('/');
}
// Normalize this data to the element in index
@@ -327,10 +329,12 @@ function add_data_to_graph(URL, index) {
is_checked[index] = true;
}
-function init_axis () {
+
+function init_axis (prefix_url) {
function onlyUnique(value, index, self) {
return self.indexOf(value) === index;
}
+ prefix = prefix_url;
var metrics = $('.metric').map( function() {
return $(this).text();
}).get();
Modified: lnt/trunk/lnt/server/ui/templates/layout.html
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/ui/templates/layout.html?rev=256294&r1=256293&r2=256294&view=diff
==============================================================================
--- lnt/trunk/lnt/server/ui/templates/layout.html (original)
+++ lnt/trunk/lnt/server/ui/templates/layout.html Tue Dec 22 17:13:20 2015
@@ -91,6 +91,8 @@
</script>
</head>
+{% set base_url=old_config.zorgURL %}
+
{% if self.onload is defined %}
<body onload="{{ self.onload() }}">
{% else %}
Modified: lnt/trunk/lnt/server/ui/templates/v4_regression_detail.html
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/ui/templates/v4_regression_detail.html?rev=256294&r1=256293&r2=256294&view=diff
==============================================================================
--- lnt/trunk/lnt/server/ui/templates/v4_regression_detail.html (original)
+++ lnt/trunk/lnt/server/ui/templates/v4_regression_detail.html Tue Dec 22 17:13:20 2015
@@ -298,7 +298,9 @@ $(document).ready( function () {
}
register_checkboxes();
- init_axis();
+
+ init_axis("{{base_url}}");
+
all_checks();
update_graph();
More information about the llvm-commits
mailing list