Use hidden input for end.
Instead of appending to url manually.
This commit is contained in:
parent
8e55ff0a8d
commit
f170720f61
|
@ -45,6 +45,7 @@
|
||||||
<input type="button" value="<<" name="dec_end">
|
<input type="button" value="<<" name="dec_end">
|
||||||
<input type="text" name="end_input" id="end{{id}}" value="{{end}}">
|
<input type="text" name="end_input" id="end{{id}}" value="{{end}}">
|
||||||
<input type="button" value=">>" name="inc_end">
|
<input type="button" value=">>" name="inc_end">
|
||||||
|
<input type="hidden" name="end">
|
||||||
|
|
||||||
<label for="step_input{{id}}">Resolution (s):</label>
|
<label for="step_input{{id}}">Resolution (s):</label>
|
||||||
<input type="text" name="step_input" id="step_input{{id}}" value="{{step_input}}" size="4">
|
<input type="text" name="step_input" id="step_input{{id}}" value="{{step_input}}" size="4">
|
||||||
|
|
|
@ -243,17 +243,14 @@ Prometheus.Graph.prototype.submitQuery = function() {
|
||||||
self.queryForm.find("input[name=range]").val(rangeSeconds);
|
self.queryForm.find("input[name=range]").val(rangeSeconds);
|
||||||
var resolution = self.queryForm.find("input[name=step_input]").val() || Math.max(Math.floor(rangeSeconds / 250), 1);
|
var resolution = self.queryForm.find("input[name=step_input]").val() || Math.max(Math.floor(rangeSeconds / 250), 1);
|
||||||
self.queryForm.find("input[name=step]").val(resolution);
|
self.queryForm.find("input[name=step]").val(resolution);
|
||||||
|
var endDate = self.getEndDate() / 1000;
|
||||||
|
self.queryForm.find("input[name=end]").val(endDate);
|
||||||
|
|
||||||
var data = self.queryForm.serialize();
|
|
||||||
var endDate = self.getEndDate()
|
|
||||||
if (endDate) {
|
|
||||||
data = data + "&end=" + endDate/1000
|
|
||||||
}
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
method: self.queryForm.attr("method"),
|
method: self.queryForm.attr("method"),
|
||||||
url: self.queryForm.attr("action"),
|
url: self.queryForm.attr("action"),
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
data: data,
|
data: self.queryForm.serialize(),
|
||||||
success: function(json, textStatus) {
|
success: function(json, textStatus) {
|
||||||
if (json.Type == "error") {
|
if (json.Type == "error") {
|
||||||
alert(json.Value);
|
alert(json.Value);
|
||||||
|
|
Loading…
Reference in New Issue