mirror of https://github.com/grafana/grafana
parent
bf75a42b88
commit
e54982d42d
@ -0,0 +1,7 @@ |
|||||||
|
<div ng-controller='stringquery'> |
||||||
|
<h4 ng-hide="_.isUndefined(panel.title)">{{panel.title}}</h4> |
||||||
|
<form class="form-search"> |
||||||
|
<input type="text" class="input-medium search-query" ng-model="query" style="width:90%"> |
||||||
|
<button type="submit" class="btn" ng-click="send_query(query)">Search</button> |
||||||
|
</form> |
||||||
|
</div> |
@ -0,0 +1,20 @@ |
|||||||
|
angular.module('kibana.stringquery', []) |
||||||
|
.controller('stringquery', function($scope, $rootScope) { |
||||||
|
|
||||||
|
// Set and populate defaults
|
||||||
|
var _d = { |
||||||
|
query : "*", |
||||||
|
size : 100, |
||||||
|
sort : [config.timefield,'desc'], |
||||||
|
} |
||||||
|
_.each(_d, function(v, k) { |
||||||
|
$scope.panel[k] = _.isUndefined($scope.panel[k])
|
||||||
|
? _d[k] : $scope.panel[k]; |
||||||
|
}); |
||||||
|
|
||||||
|
if (!(_.isUndefined($scope.panel.group))) { |
||||||
|
$scope.send_query = function(query) { |
||||||
|
$rootScope.$broadcast($scope.panel.group+"-query", query)
|
||||||
|
} |
||||||
|
} |
||||||
|
}) |
Loading…
Reference in new issue