From 2a31b513f9badff4d5d81dece637c582e1a4098e Mon Sep 17 00:00:00 2001 From: Yonik Seeley Date: Sat, 22 Sep 2012 16:21:19 +0000 Subject: [PATCH] SOLR-3867: fix admin gui due to clusterstate.json format changes git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1388830 13f79535-47bb-0310-9956-ffa450edef68 --- solr/webapp/web/js/scripts/cloud.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/solr/webapp/web/js/scripts/cloud.js b/solr/webapp/web/js/scripts/cloud.js index 9662b57b83a..70705e308fd 100644 --- a/solr/webapp/web/js/scripts/cloud.js +++ b/solr/webapp/web/js/scripts/cloud.js @@ -372,11 +372,12 @@ var prepare_graph = function( graph_element, callback ) for( var s in state[c] ) { var nodes = []; - for( var n in state[c][s] ) + for( var n in state[c][s].replicas ) { leaf_count++; + var replica = state[c][s].replicas[n] - var uri = state[c][s][n].base_url; + var uri = replica.base_url; var parts = uri.match( /^(\w+:)\/\/(([\w\d\.-]+)(:(\d+))?)(.+)$/ ); var uri_parts = { protocol: parts[1], @@ -392,9 +393,9 @@ var prepare_graph = function( graph_element, callback ) helper_data.port.push( uri_parts.port ); helper_data.pathname.push( uri_parts.pathname ); - var status = state[c][s][n].state; + var status = replica.state; - if( !live_nodes[state[c][s][n].node_name] ) + if( !live_nodes[replica.node_name] ) { status = 'gone'; } @@ -404,7 +405,7 @@ var prepare_graph = function( graph_element, callback ) data: { type : 'node', state : status, - leader : 'true' === state[c][s][n].leader, + leader : 'true' === replica.leader, uri : uri_parts } }; @@ -715,4 +716,4 @@ sammy.get } ); } -); \ No newline at end of file +);