diff --git a/common/css/main.css b/common/css/main.css
index 4676ad6542e..5234275bd81 100644
--- a/common/css/main.css
+++ b/common/css/main.css
@@ -12,4 +12,15 @@
[ng\:cloak], [ng-cloak], .ng-cloak {
display: none !important;
+}
+
+.panel-error {
+ opacity: 0.9;
+ position:absolute;
+ top:10px;
+ z-index: 99999;
+}
+
+.pointer {
+ cursor: pointer;
}
\ No newline at end of file
diff --git a/config.js b/config.js
index f92de346496..a41f985cb62 100644
--- a/config.js
+++ b/config.js
@@ -24,13 +24,13 @@ json.
var config = new Settings(
{
timespan: '15m',
- refresh: 10000,
+ refresh: 30000,
elasticsearch: 'http://localhost:9200',
timeformat: 'mm/dd HH:MM:ss',
timefield: '@timestamp',
//indexpattern: '"logstash-"yyyy.mm.dd',
indexpattern: '"shakespeare"',
- modules: ['histogram','map','pie','table','stringquery'],
+ modules: ['histogram','map','pie','table','stringquery','sort'],
defaultfields: ['line_text'],
perpage: 50,
diff --git a/dashboards.js b/dashboards.js
index e08e647ccbf..fbe6b617d48 100644
--- a/dashboards.js
+++ b/dashboards.js
@@ -3,12 +3,17 @@ var dashboards =
title: "Infinite Monkey Dashboard",
rows: [
{
- height: "30px",
+ height: "20px",
panels: [
{
type : "stringquery",
- span : 12,
- group : "mainsearch"
+ span : 9,
+ group : "main"
+ },
+ {
+ type : "sort",
+ span : 3,
+ group : "main"
}
]
},
@@ -22,17 +27,17 @@ var dashboards =
show : ['lines','stack'],
fill : 1,
query : [{ label : "lines", query : "*", color: '#86B32D' } ],
- group : "mainsearch"
+ group : "main"
},
{
- title : "World Monkeys",
+ title : "Monkey Typists Worldwide",
type : "map",
map : 'world',
field : "country",
span : 6,
size : 500,
query : "*",
- group : "mainsearch"
+ group : "main"
}
]
@@ -50,7 +55,7 @@ var dashboards =
field : 'country',
//query : { query: "*", field: "country"}
query : { field : "play_name", query : "*" },
- group : "mainsearch"
+ group : "main"
},
{
title : "Newest Lines",
@@ -58,7 +63,7 @@ var dashboards =
span : 8,
query : "*",
fields : ['@timestamp','speaker','text_entry'],
- group : "mainsearch"
+ group : "main"
}
]
}
diff --git a/panels/stringquery/module.html b/panels/stringquery/module.html
index a728eb352ab..5b2b40e4e10 100644
--- a/panels/stringquery/module.html
+++ b/panels/stringquery/module.html
@@ -1,7 +1,7 @@
{{panel.title}}
-
+
\ No newline at end of file
diff --git a/panels/table/module.html b/panels/table/module.html
index fe6de48a441..b5931887f8d 100644
--- a/panels/table/module.html
+++ b/panels/table/module.html
@@ -3,7 +3,10 @@
- | {{field}} |
+
+ {{field}}
+
+ |
| {{row['_source'][field]}} |
diff --git a/panels/table/module.js b/panels/table/module.js
index 66ddcefd5d1..9fd6a982fcf 100644
--- a/panels/table/module.js
+++ b/panels/table/module.js
@@ -1,5 +1,5 @@
angular.module('kibana.table', [])
-.controller('table', function($scope, $location) {
+.controller('table', function($scope, $rootScope, $location) {
// Set and populate defaults
var _d = {
@@ -12,13 +12,19 @@ angular.module('kibana.table', [])
? _d[k] : $scope.panel[k];
});
+ // Events which this panel receives and sends
if (!(_.isUndefined($scope.panel.group))) {
+ // Receives these events
$scope.$on($scope.panel.group+"-query", function(event, query) {
$scope.panel.query = query;
$scope.get_data();
});
}
+ $scope.toggle_sort = function() {
+ $scope.panel.sort[1] = $scope.panel.sort[1] == 'asc' ? 'desc' : 'asc';
+ }
+
$scope.get_data = function() {
var request = $scope.ejs.Request().indices($scope.index);
@@ -37,26 +43,28 @@ angular.module('kibana.table', [])
// Populate scope when we have results
results.then(function(results) {
+ if(_.isUndefined(results)) {
+ $scope.panel.error = 'Your query was unsuccessful';
+ return;
+ }
+ $scope.panel.error = false;
$scope.hits = results.hits.total;
$scope.data = results.hits.hits;
- /*
- _.each(results.facets.pie.terms, function(v) {
- var slice = { label : v.term, data : v.count };
- $scope.data.push();
- if(!(_.isUndefined($scope.panel.colors))
- && _.isArray($scope.panel.colors)
- && $scope.panel.colors.length > 0) {
- slice.color = $scope.panel.colors[k%$scope.panel.colors.length];
- }
- $scope.data.push(slice)
- k = k + 1;
- });
-*/
+
+ // Broadcast a list of all fields. Note that receivers of field array
+ // events should be able to receive from multiple sources, merge, dedupe
+ // and sort on the fly.
+ if (!(_.isUndefined($scope.panel.group)))
+ $rootScope.$broadcast(
+ $scope.panel.group+"-fields", {
+ all : get_all_fields(results),
+ sort : $scope.panel.sort
+ });
});
}
$scope.$watch(function() {
- return angular.toJson([$scope.from, $scope.to])
+ return angular.toJson([$scope.from, $scope.to, $scope.panel.sort])
}, function(){
$scope.get_data();
});
diff --git a/partials/dashboard.html b/partials/dashboard.html
index 24d1ab84dc9..482b1ff412d 100644
--- a/partials/dashboard.html
+++ b/partials/dashboard.html
@@ -6,7 +6,13 @@
-
+
+
+
×
+
Oops! {{panel.error}}
+
+
+