mirror of https://github.com/apache/lucene.git
SOLR-4526: Admin UI depends on optional system info
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1452835 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
a5e5c904c8
commit
e2ce3914e2
|
@ -239,6 +239,9 @@ Optimizations
|
|||
* SOLR-4529: Improve Admin UI Dashboard legibility (Felix Buenemann via
|
||||
steffkes)
|
||||
|
||||
* SOLR-4526: Admin UI depends on optional system info (Felix Buenemann via
|
||||
steffkes)
|
||||
|
||||
Other Changes
|
||||
----------------------
|
||||
|
||||
|
|
|
@ -97,8 +97,8 @@ var system_info = function( element, system_data )
|
|||
{
|
||||
// -- usage
|
||||
|
||||
var load_average = ( system_data['system']['uptime'] || '' ).match( /load average: (.+)/ );
|
||||
if( load_average && load_average[1] )
|
||||
var load_average = ( system_data['system']['uptime'] || '' ).match( /load averages?: (\d+[.,]\d\d),? (\d+[.,]\d\d),? (\d+[.,]\d\d)/ );
|
||||
if( load_average )
|
||||
{
|
||||
var hl = $( '#system h2', element );
|
||||
|
||||
|
@ -106,13 +106,13 @@ var system_info = function( element, system_data )
|
|||
.remove();
|
||||
|
||||
hl
|
||||
.append( ' <small class="bar-desc">' + load_average[1].split( ', ' ).join( ' ' ).esc() + '</small>' );
|
||||
.append( ' <small class="bar-desc">' + load_average.slice( 1 ).join( ' ' ).replace( /,/g, '.' ).esc() + '</small>' );
|
||||
}
|
||||
|
||||
// -- physical-memory-bar
|
||||
|
||||
var bar_holder = $( '#physical-memory-bar', element );
|
||||
if( !system_data['system']['totalPhysicalMemorySize'] )
|
||||
if( system_data['system']['totalPhysicalMemorySize'] === undefined || system_data['system']['freePhysicalMemorySize'] === undefined )
|
||||
{
|
||||
bar_holder.hide();
|
||||
}
|
||||
|
@ -131,7 +131,7 @@ var system_info = function( element, system_data )
|
|||
// -- swap-space-bar
|
||||
|
||||
var bar_holder = $( '#swap-space-bar', element );
|
||||
if( !system_data['system']['totalSwapSpaceSize'] )
|
||||
if( system_data['system']['totalSwapSpaceSize'] === undefined || system_data['system']['freeSwapSpaceSize'] === undefined )
|
||||
{
|
||||
bar_holder.hide();
|
||||
}
|
||||
|
@ -147,10 +147,10 @@ var system_info = function( element, system_data )
|
|||
generate_bar( bar_holder, bar_data, true );
|
||||
}
|
||||
|
||||
// -- swap-space-bar
|
||||
// -- file-descriptor-bar
|
||||
|
||||
var bar_holder = $( '#file-descriptor-bar', element );
|
||||
if( !system_data['system']['maxFileDescriptorCount'] )
|
||||
if( system_data['system']['maxFileDescriptorCount'] === undefined || system_data['system']['openFileDescriptorCount'] === undefined )
|
||||
{
|
||||
bar_holder.hide();
|
||||
}
|
||||
|
@ -172,6 +172,15 @@ var system_info = function( element, system_data )
|
|||
|
||||
// -- memory-bar
|
||||
|
||||
var bar_holder = $( '#jvm-memory-bar', element );
|
||||
if( system_data['jvm']['memory'] === undefined )
|
||||
{
|
||||
bar_holder.hide();
|
||||
}
|
||||
else
|
||||
{
|
||||
bar_holder.show();
|
||||
|
||||
var jvm_memory = $.extend
|
||||
(
|
||||
{
|
||||
|
@ -190,7 +199,6 @@ var system_info = function( element, system_data )
|
|||
system_data['jvm']['memory']
|
||||
);
|
||||
|
||||
var bar_holder = $( '#jvm-memory-bar', element );
|
||||
var bar_data = {
|
||||
'max' : parse_memory_value( jvm_memory['raw']['max'] || jvm_memory['max'] ),
|
||||
'total' : parse_memory_value( jvm_memory['raw']['total'] || jvm_memory['total'] ),
|
||||
|
@ -198,6 +206,8 @@ var system_info = function( element, system_data )
|
|||
};
|
||||
|
||||
generate_bar( bar_holder, bar_data, true );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// #/
|
||||
|
|
Loading…
Reference in New Issue