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

Commit

Permalink
Adding correct source field for radios when showing messages from input.
Browse files Browse the repository at this point in the history
Fixes #856
  • Loading branch information
dennisoelkers committed Aug 25, 2014
1 parent 5e3cff5 commit ca3e229
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
16 changes: 16 additions & 0 deletions app/views/helpers/InputHelper.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package views.helpers;

import org.graylog2.restclient.models.ClusterEntity;
import org.graylog2.restclient.models.Radio;

/**
* @author Dennis Oelkers <[email protected]>
*/
public class InputHelper {
public static String sourceFieldForNode(ClusterEntity clusterEntity) {
if (clusterEntity instanceof Radio)
return "gl2_source_radio_input";
else
return "gl2_source_input";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
@import views.helpers.Permissions._
@import lib.security.RestPermissions._
@import org.graylog2.restclient.models.Radio
@import views.helpers.InputHelper.sourceFieldForNode

<div class="btn-group">
<a class="btn btn-mini dropdown-toggle" data-toggle="dropdown" href="#">
Expand All @@ -24,7 +25,7 @@
}

@if(isPermitted(SEARCHES_RELATIVE)) {
<li><a href="@routes.SearchController.index("gl2_source_input:" + input.getId, "relative", 28800)">Messages from this input</a></li>
<li><a href="@routes.SearchController.index(sourceFieldForNode(targetNode) + ":" + input.getId, "relative", 28800)">Messages from this input</a></li>
}
</ul>
</div>

0 comments on commit ca3e229

Please sign in to comment.