From 65a9cc36431d6ae07cb71177e28b550cea02d637 Mon Sep 17 00:00:00 2001 From: Stefan Matheis Date: Sat, 5 Jan 2013 10:53:39 +0000 Subject: [PATCH] SOLR-4261: Percentage Infos on Dashboard have a fixed width git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1429256 13f79535-47bb-0310-9956-ffa450edef68 --- solr/CHANGES.txt | 2 ++ solr/webapp/web/js/scripts/index.js | 6 ++---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt index b22ac3cdeae..0a6f891a075 100644 --- a/solr/CHANGES.txt +++ b/solr/CHANGES.txt @@ -220,6 +220,8 @@ Optimizations * SOLR-4264: Missing Error-Screen on UI's Cloud-Page (steffkes) +* SOLR-4261: Percentage Infos on Dashboard have a fixed width (steffkes) + Bug Fixes ---------------------- diff --git a/solr/webapp/web/js/scripts/index.js b/solr/webapp/web/js/scripts/index.js index c58c24c0f90..2c22f5ec71e 100644 --- a/solr/webapp/web/js/scripts/index.js +++ b/solr/webapp/web/js/scripts/index.js @@ -36,15 +36,13 @@ var generate_bar = function( bar_container, bar_data, convert_label_values ) $( '.bar-max.val', bar_holder ).text( bar_data['max'] ); bar_level++; - var total_width = Math.round( ( bar_data['total'] * max_width ) / bar_data['max'] ); - $( '.bar-total.bar', bar_holder ).width( Math.max( total_width, 1 ) ); + $( '.bar-total.bar', bar_holder ).width( new String( (bar_data['total']/bar_data['max'])*100 ) + '%' ); $( '.bar-total.val', bar_holder ).text( bar_data['total'] ); if( bar_data['used'] ) { bar_level++; - var used_width = Math.round( ( bar_data['used'] * max_width ) / bar_data['max'] ); - $( '.bar-used.bar', bar_holder ).width( Math.min( used_width, total_width - 1 ) ); + $( '.bar-used.bar', bar_holder ).width( new String( (bar_data['used']/bar_data['max'])*100 ) + '%' ); $( '.bar-used.val', bar_holder ).text( bar_data['used'] ); }