diff --git a/Netdisco/Changes b/Netdisco/Changes index 04fbef3a..1ded84c4 100644 --- a/Netdisco/Changes +++ b/Netdisco/Changes @@ -15,6 +15,7 @@ * Add a spinner to all waiting messages * Try to make the Job Queue page a little faster * Require the Net::LDAP module for all installs + * Move system information to the Netdisco "home" page [BUG FIXES] diff --git a/Netdisco/lib/App/Netdisco/Web.pm b/Netdisco/lib/App/Netdisco/Web.pm index e04aa6b7..c6721da2 100644 --- a/Netdisco/lib/App/Netdisco/Web.pm +++ b/Netdisco/lib/App/Netdisco/Web.pm @@ -20,7 +20,7 @@ use App::Netdisco::Web::Report; use App::Netdisco::Web::AdminTask; use App::Netdisco::Web::TypeAhead; use App::Netdisco::Web::PortControl; -use App::Netdisco::Web::About; +use App::Netdisco::Web::Statistics; sub _load_web_plugins { my $plugin_list = shift; diff --git a/Netdisco/lib/App/Netdisco/Web/About.pm b/Netdisco/lib/App/Netdisco/Web/Statistics.pm similarity index 84% rename from Netdisco/lib/App/Netdisco/Web/About.pm rename to Netdisco/lib/App/Netdisco/Web/Statistics.pm index 3d80825f..00781309 100644 --- a/Netdisco/lib/App/Netdisco/Web/About.pm +++ b/Netdisco/lib/App/Netdisco/Web/Statistics.pm @@ -1,14 +1,17 @@ -package App::Netdisco::Web::About; +package App::Netdisco::Web::Statistics; use Dancer ':syntax'; use Dancer::Plugin::DBIC; use Dancer::Plugin::Auth::Extensible; -get '/about' => require_login sub { +get '/ajax/content/statistics' => require_login sub { my $time1 = time; my $schema = schema('netdisco'); - my $devices = $schema->resultset('Device')->search( + my $devices = $schema->resultset('Device'); + + # used only to get the PostgreSQL version + my $users = $schema->resultset('User')->search( {}, { select => [ { version => '' } ], as => [qw/ version /], @@ -50,16 +53,15 @@ get '/about' => require_login sub { my $process_time = $time2 - $time1; my $disco_ver = $App::Netdisco::VERSION; - my $db_version = $devices->next->get_column('version'); + my $db_version = $users->next->get_column('version'); my $dbi_ver = $DBI::VERSION; my $dbdpg_ver = $DBD::Pg::VERSION; eval 'require SNMP::Info'; my $snmpinfo_ver = ($@ ? 'n/a' : $SNMP::Info::VERSION); - var( nav => 'about' ); - - template 'about', + var( nav => 'statistics' ); + template 'ajax/statistics.tt', { device_count => $device_count, device_ip_count => $device_ip_count, @@ -76,7 +78,8 @@ get '/about' => require_login sub { dbdpg_ver => $dbdpg_ver, snmpinfo_ver => $snmpinfo_ver, schema_ver => $schema_version, - }; + }, + { layout => undef }; }; true; diff --git a/Netdisco/share/public/css/netdisco.css b/Netdisco/share/public/css/netdisco.css index ffc63734..56b97245 100644 --- a/Netdisco/share/public/css/netdisco.css +++ b/Netdisco/share/public/css/netdisco.css @@ -110,6 +110,11 @@ div.content > div.tab-content table.nd_floatinghead thead { font-weight: normal; } +/* for System Information bar */ +.nd_sysinfo-heading { + background-color: #eeeeee; +} + /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ /* styles to adjust the hero box used for homepage + login */ diff --git a/Netdisco/share/public/javascripts/netdisco.js b/Netdisco/share/public/javascripts/netdisco.js index dcf55ebd..1750106d 100644 --- a/Netdisco/share/public/javascripts/netdisco.js +++ b/Netdisco/share/public/javascripts/netdisco.js @@ -34,7 +34,7 @@ function do_search (event, tab) { function(response, status, xhr) { if (status !== "success") { $(target).html( - '
| [% device_links | format_number %] layer 2 links between devices. | +[% device_links | format_number %] layer 2 links between devices |
|---|---|
| [% node_count | format_number %] nodes in [% node_table_count | format_number %] entries. | +[% node_count | format_number %] nodes in [% node_table_count | format_number %] entries |
| [% ip_count | format_number %] IPs in [% ip_table_count | format_number %] entries. | +[% ip_count | format_number %] IPs in [% ip_table_count | format_number %] entries |
| Statistics took [% process_time %] seconds to process. | |