Skip to content

Commit 3aa3b47

Browse files
committed
Merge pull request #212 from ebuildy/master
#211 Fix overview page ES 2 support
2 parents 7db19b1 + 91a5255 commit 3aa3b47

File tree

5 files changed

+18
-18
lines changed

5 files changed

+18
-18
lines changed

_site/app.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1318,7 +1318,7 @@
13181318
clusterState = data;
13191319
updateModel.call( self );
13201320
});
1321-
this.cluster.get("_status", function( data ) {
1321+
this.cluster.get("_stats", function( data ) {
13221322
status = data;
13231323
updateModel.call( self );
13241324
});
@@ -3209,8 +3209,8 @@
32093209
); },
32103210
_indexHeader_template: function( index ) {
32113211
var closed = index.state === "close";
3212-
var line1 = closed ? "index: close" : ( "size: " + (index.status && index.status.index ? ut.byteSize_template( index.status.index.primary_size_in_bytes ) + " (" + ut.byteSize_template( index.status.index.size_in_bytes ) + ")" : "unknown" ) );
3213-
var line2 = closed ? "\u00A0" : ( "docs: " + (index.status && index.status.docs ? index.status.docs.num_docs.toLocaleString() + " (" + index.status.docs.max_doc.toLocaleString() + ")" : "unknown" ) );
3212+
var line1 = closed ? "index: close" : ( "size: " + (index.status && index.status.total ? ut.byteSize_template( index.status.total.store.size_in_bytes ) + " (" + ut.byteSize_template( index.status.total.store.size_in_bytes ) + ")" : "unknown" ) );
3213+
var line2 = closed ? "\u00A0" : ( "docs: " + (index.status && index.status.total && index.status.total.docs ? index.status.total.docs.count.toLocaleString() + " (" + (index.status.total.docs.count + index.status.total.docs.deleted).toLocaleString() + ")" : "unknown" ) );
32143214
return index.name ? { tag: "TH", cls: (closed ? "close" : ""), children: [
32153215
{ tag: "H3", text: index.name },
32163216
{ tag: "DIV", text: line1 },
@@ -3444,8 +3444,8 @@
34443444
indexNames.push(name);
34453445
});
34463446
indexNames.sort().filter( indexFilter ).forEach(function(name) {
3447-
var index = clusterState.routing_table.indices[name];
3448-
$.each(index.shards, function(name, shard) {
3447+
var indexObject = clusterState.routing_table.indices[name];
3448+
$.each(indexObject.shards, function(name, shard) {
34493449
shard.forEach(function(replica){
34503450
var node = replica.node;
34513451
if(node === null) { node = "Unassigned"; }
@@ -3454,13 +3454,13 @@
34543454
var routings = nodes[getIndexForNode(node)].routings;
34553455
var indexIndex = getIndexForIndex(routings, index);
34563456
var replicas = routings[indexIndex].replicas;
3457-
if(node === "Unassigned" || !status.indices[index].shards[shard]) {
3457+
if(node === "Unassigned" || !indexObject.shards[shard]) {
34583458
replicas.push({ replica: replica });
34593459
} else {
34603460
replicas[shard] = {
34613461
replica: replica,
3462-
status: status.indices[index].shards[shard].filter(function(replica) {
3463-
return replica.routing.node === node;
3462+
status: indexObject.shards[shard].filter(function(replica) {
3463+
return replica.node === node;
34643464
})[0]
34653465
};
34663466
}
@@ -4065,7 +4065,7 @@
40654065
});
40664066
var quicks = [
40674067
{ text: i18n.text("Nav.Info"), path: "" },
4068-
{ text: i18n.text("Nav.Status"), path: "_status" },
4068+
{ text: i18n.text("Nav.Status"), path: "_stats" },
40694069
{ text: i18n.text("Nav.NodeStats"), path: "_cluster/nodes/stats" },
40704070
{ text: i18n.text("Nav.ClusterNodes"), path: "_cluster/nodes" },
40714071
{ text: i18n.text("Nav.Plugins"), path: "_nodes/plugin" },

src/app/services/clusterState/clusterState.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
clusterState = data;
3232
updateModel.call( self );
3333
});
34-
this.cluster.get("_status", function( data ) {
34+
this.cluster.get("_stats", function( data ) {
3535
status = data;
3636
updateModel.call( self );
3737
});

src/app/ui/clusterOverview/clusterOverview.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -174,8 +174,8 @@
174174
indexNames.push(name);
175175
});
176176
indexNames.sort().filter( indexFilter ).forEach(function(name) {
177-
var index = clusterState.routing_table.indices[name];
178-
$.each(index.shards, function(name, shard) {
177+
var indexObject = clusterState.routing_table.indices[name];
178+
$.each(indexObject.shards, function(name, shard) {
179179
shard.forEach(function(replica){
180180
var node = replica.node;
181181
if(node === null) { node = "Unassigned"; }
@@ -184,13 +184,13 @@
184184
var routings = nodes[getIndexForNode(node)].routings;
185185
var indexIndex = getIndexForIndex(routings, index);
186186
var replicas = routings[indexIndex].replicas;
187-
if(node === "Unassigned" || !status.indices[index].shards[shard]) {
187+
if(node === "Unassigned" || !indexObject.shards[shard]) {
188188
replicas.push({ replica: replica });
189189
} else {
190190
replicas[shard] = {
191191
replica: replica,
192-
status: status.indices[index].shards[shard].filter(function(replica) {
193-
return replica.routing.node === node;
192+
status: indexObject.shards[shard].filter(function(replica) {
193+
return replica.node === node;
194194
})[0]
195195
};
196196
}

src/app/ui/header/header.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
});
1515
var quicks = [
1616
{ text: i18n.text("Nav.Info"), path: "" },
17-
{ text: i18n.text("Nav.Status"), path: "_status" },
17+
{ text: i18n.text("Nav.Status"), path: "_stats" },
1818
{ text: i18n.text("Nav.NodeStats"), path: "_cluster/nodes/stats" },
1919
{ text: i18n.text("Nav.ClusterNodes"), path: "_cluster/nodes" },
2020
{ text: i18n.text("Nav.Plugins"), path: "_nodes/plugin" },

src/app/ui/nodesView/nodesView.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,8 +217,8 @@
217217
); },
218218
_indexHeader_template: function( index ) {
219219
var closed = index.state === "close";
220-
var line1 = closed ? "index: close" : ( "size: " + (index.status && index.status.index ? ut.byteSize_template( index.status.index.primary_size_in_bytes ) + " (" + ut.byteSize_template( index.status.index.size_in_bytes ) + ")" : "unknown" ) );
221-
var line2 = closed ? "\u00A0" : ( "docs: " + (index.status && index.status.docs ? index.status.docs.num_docs.toLocaleString() + " (" + index.status.docs.max_doc.toLocaleString() + ")" : "unknown" ) );
220+
var line1 = closed ? "index: close" : ( "size: " + (index.status && index.status.total ? ut.byteSize_template( index.status.total.store.size_in_bytes ) + " (" + ut.byteSize_template( index.status.total.store.size_in_bytes ) + ")" : "unknown" ) );
221+
var line2 = closed ? "\u00A0" : ( "docs: " + (index.status && index.status.total && index.status.total.docs ? index.status.total.docs.count.toLocaleString() + " (" + (index.status.total.docs.count + index.status.total.docs.deleted).toLocaleString() + ")" : "unknown" ) );
222222
return index.name ? { tag: "TH", cls: (closed ? "close" : ""), children: [
223223
{ tag: "H3", text: index.name },
224224
{ tag: "DIV", text: line1 },

0 commit comments

Comments
 (0)