Skip to content
This repository has been archived by the owner on Jan 15, 2025. It is now read-only.

Commit

Permalink
Fix apply link for custom timeranges. Fixes #180
Browse files Browse the repository at this point in the history
  • Loading branch information
Carsten Koebke committed Aug 23, 2018
1 parent a9a7af6 commit 516b827
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions library/Grafana/Helpers/Timeranges.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,15 +123,16 @@ private function buildTimerangeMenu($timerange = "", $timerangeto = "")
$timerangeto = $d->format("Y-m-d H:i:s");
}

unset($this->array['timerange']);
$form_link = $this->view->url($this->link, $this->array);
unset($this->urlparams['timerange']);
$form_link = $this->view->url($this->link, $this->urlparams);
$menu .= '<td>
<form method="get" class="grafana-module-tr-form" action="'.$form_link.'">
<input type="text" value="'.$timerange.'" placeholder="from" name="tr-from" />
<input type="text" value="'.$timerangeto.'" placeholder="to" name="tr-to" />
<a href="'.$form_link.'" data-base-target="_self" class="action-link grafana-module-tr-apply">Apply</a>
</form>
</td>';
$menu .= '</tr></table>';
$menu .= '<script type="text/javascript">
$( document ).ready(function() {
$("a.grafana-module-tr-apply").click(function() {
Expand All @@ -154,8 +155,6 @@ private function buildTimerangeMenu($timerange = "", $timerangeto = "")
});
});
</script>';
$menu .= '</tr></table>';

return $menu;
}

Expand Down
2 changes: 1 addition & 1 deletion module.info
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Name: Grafana
Version: 1.3.1
Version: master
Depends: monitoring
Description: Grafana - A perfdata visualisation module
Shows Grafana graphs for captured metrics.
Expand Down

0 comments on commit 516b827

Please sign in to comment.