Skip to content
Snippets Groups Projects
Commit 44097782 authored by Nigel Kukard's avatar Nigel Kukard
Browse files

Added sidebar and user source

parent 0ef45fa3
No related branches found
No related tags found
No related merge requests found
...@@ -30,6 +30,19 @@ our (@ISA,@EXPORT,@EXPORT_OK); ...@@ -30,6 +30,19 @@ our (@ISA,@EXPORT,@EXPORT_OK);
); );
use DateTime;
# Sidebar menu options for this module
my $menu = {
'Users' => {
'Show Users' => '',
},
'Admin' => {
'Add User' => 'add',
},
};
sub default sub default
{ {
...@@ -45,14 +58,16 @@ sub default ...@@ -45,14 +58,16 @@ sub default
# Header # Header
$content .=<<EOF; $content .=<<EOF;
<table class="table"> <table class="table">
<caption>User List</caption> <caption>Active User List</caption>
<thead> <thead>
<tr> <tr>
<th>#</th> <th>#</th>
<th>User</th> <th>User</th>
<th>IP</th> <th>IP</th>
<th>Group</th> <th>Source</th>
<th>LastUpdate</th>
<th>Class</th> <th>Class</th>
<th>Group</th>
<th>Limits</th> <th>Limits</th>
</tr> </tr>
</thead> </thead>
...@@ -70,14 +85,20 @@ EOF ...@@ -70,14 +85,20 @@ EOF
$style = "info"; $style = "info";
} }
# Get a nice last update string
my $lastUpdate = DateTime->from_epoch( epoch => $user->{'LastUpdate'} )->iso8601();
my $limits = $user->{'TrafficLimitTx'} . "/" . $user->{'TrafficLimitRx'};
$content .=<<EOF; $content .=<<EOF;
<tr class="$style"> <tr class="$style">
<td>X</td> <td>X</td>
<td>$user->{'Username'}</td> <td>$user->{'Username'}</td>
<td>$user->{'IP'}</td> <td>$user->{'IP'}</td>
<td>$user->{'GroupName'}</td> <td>$user->{'Source'}</td>
<td>$user->{'ClassName'}</td> <td>$lastUpdate</td>
<td>$user->{'Limits'}</td> <td>$user->{'ClassID'}</td>
<td>$user->{'GroupID'}</td>
<td>$limits</td>
</tr> </tr>
EOF EOF
} }
...@@ -85,7 +106,7 @@ EOF ...@@ -85,7 +106,7 @@ EOF
if (keys %{$globals->{'users'}} < 1) { if (keys %{$globals->{'users'}} < 1) {
$content .=<<EOF; $content .=<<EOF;
<tr class="info"> <tr class="info">
<td colspan="6"><p class="text-center">No Results</p></td> <td colspan="8"><p class="text-center">No Results</p></td>
</tr> </tr>
EOF EOF
} }
...@@ -97,7 +118,7 @@ EOF ...@@ -97,7 +118,7 @@ EOF
EOF EOF
return (200,$content); return (200,$content,$menu);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment