Show Offline routers in the dashboard
This commit is contained in:
parent
7963c2f388
commit
11ec4185e7
@ -209,6 +209,12 @@ if (file_exists($cacheMSfile) && time() - filemtime($cacheMSfile) < 43200) {
|
|||||||
file_put_contents($cacheMSfile, json_encode($monthlySales));
|
file_put_contents($cacheMSfile, json_encode($monthlySales));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($config['router_check']) {
|
||||||
|
$routeroffs = ORM::for_table('tbl_routers')->selects(['id', 'name', 'last_seen'])->where('status', 'Offline')->order_by_desc('name')->find_array();
|
||||||
|
print_r($routeroffs);
|
||||||
|
$ui->assign('routeroffs', $routeroffs);
|
||||||
|
}
|
||||||
|
|
||||||
// Assign the monthly sales data to Smarty
|
// Assign the monthly sales data to Smarty
|
||||||
$ui->assign('start_date', $start_date);
|
$ui->assign('start_date', $start_date);
|
||||||
$ui->assign('current_date', $current_date);
|
$ui->assign('current_date', $current_date);
|
||||||
|
@ -175,6 +175,25 @@
|
|||||||
|
|
||||||
|
|
||||||
<div class="col-md-5">
|
<div class="col-md-5">
|
||||||
|
{if $_c['router_check']}
|
||||||
|
<div class="panel panel-danger">
|
||||||
|
<div class="panel-heading text-bold">{Lang::T('Routers Offline')}</div>
|
||||||
|
<div class="table-responsive">
|
||||||
|
<table class="table table-condensed">
|
||||||
|
<tbody>
|
||||||
|
{foreach $routeroffs as $ros}
|
||||||
|
<tr>
|
||||||
|
<td><a href="{$_url}routers/edit/{$ros['id']}" class="text-bold text-red">{$ros['name']}</a></td>
|
||||||
|
<td data-toggle="tooltip" data-placement="top" class="text-red"
|
||||||
|
title="{Lang::dateTimeFormat($ros['last_seen'])}">{Lang::timeElapsed($ros['last_seen'])}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
{/foreach}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{/if}
|
||||||
{if $_c['hide_pg'] != 'yes'}
|
{if $_c['hide_pg'] != 'yes'}
|
||||||
<div class="panel panel-success panel-hovered mb20 activities">
|
<div class="panel panel-success panel-hovered mb20 activities">
|
||||||
<div class="panel-heading">{Lang::T('Payment Gateway')}: {str_replace(',',', ',$_c['payment_gateway'])}
|
<div class="panel-heading">{Lang::T('Payment Gateway')}: {str_replace(',',', ',$_c['payment_gateway'])}
|
||||||
@ -337,7 +356,7 @@
|
|||||||
//lets calculate the inactive users as reported
|
//lets calculate the inactive users as reported
|
||||||
var expired = u_all - u_act;
|
var expired = u_all - u_act;
|
||||||
var inactive = c_all - u_all;
|
var inactive = c_all - u_all;
|
||||||
if(inactive < 0){
|
if (inactive < 0) {
|
||||||
inactive = 0;
|
inactive = 0;
|
||||||
}
|
}
|
||||||
// Create the chart data
|
// Create the chart data
|
||||||
|
@ -28,8 +28,8 @@
|
|||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-4">
|
<div class="col-md-4">
|
||||||
<a href="{$_url}routers/add" class="btn btn-primary btn-block"><i
|
<a href="{$_url}routers/add" class="btn btn-primary btn-block"><i class="ion ion-android-add">
|
||||||
class="ion ion-android-add"> </i> {Lang::T('New Router')}</a>
|
</i> {Lang::T('New Router')}</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="table-responsive">
|
<div class="table-responsive">
|
||||||
@ -40,10 +40,10 @@
|
|||||||
<th>{Lang::T('IP Address')}</th>
|
<th>{Lang::T('IP Address')}</th>
|
||||||
<th>{Lang::T('Username')}</th>
|
<th>{Lang::T('Username')}</th>
|
||||||
<th>{Lang::T('Description')}</th>
|
<th>{Lang::T('Description')}</th>
|
||||||
{if $config['router_check']}
|
{if $_c['router_check']}
|
||||||
<th>{Lang::T('Online Status')}</th>
|
<th>{Lang::T('Online Status')}</th>
|
||||||
{/if}
|
|
||||||
<th>{Lang::T('Last Seen')}</th>
|
<th>{Lang::T('Last Seen')}</th>
|
||||||
|
{/if}
|
||||||
<th>{Lang::T('Status')}</th>
|
<th>{Lang::T('Status')}</th>
|
||||||
<th>{Lang::T('Manage')}</th>
|
<th>{Lang::T('Manage')}</th>
|
||||||
<th>ID</th>
|
<th>ID</th>
|
||||||
@ -67,13 +67,19 @@
|
|||||||
onmouseleave="this.style.backgroundColor = 'black';"
|
onmouseleave="this.style.backgroundColor = 'black';"
|
||||||
onmouseenter="this.style.backgroundColor = 'white';">{$ds['username']}</td>
|
onmouseenter="this.style.backgroundColor = 'white';">{$ds['username']}</td>
|
||||||
<td>{$ds['description']}</td>
|
<td>{$ds['description']}</td>
|
||||||
{if $config['router_check']}
|
{if $_c['router_check']}
|
||||||
<td><span
|
<td>
|
||||||
class="label {if $ds['status'] == 'Online'}label-success {else}label-danger {/if}">{if
|
<span
|
||||||
$ds['status'] == 'Online'}{Lang::T('Online')}{else}{Lang::T('Offline')}{/if}</span>
|
class="label {if $ds['status'] == 'Online'}label-success {else}label-danger {/if}">
|
||||||
</td>
|
{if $ds['status'] == 'Online'}
|
||||||
|
{Lang::T('Online')}
|
||||||
|
{else}
|
||||||
|
{Lang::T('Offline')}
|
||||||
{/if}
|
{/if}
|
||||||
|
</span>
|
||||||
|
</td>
|
||||||
<td>{$ds['last_seen']}</td>
|
<td>{$ds['last_seen']}</td>
|
||||||
|
{/if}
|
||||||
<td>{if $ds['enabled'] == 1}{Lang::T('Enabled')}{else}{Lang::T('Disabled')}{/if}</td>
|
<td>{if $ds['enabled'] == 1}{Lang::T('Enabled')}{else}{Lang::T('Disabled')}{/if}</td>
|
||||||
<td>
|
<td>
|
||||||
<a href="{$_url}routers/edit/{$ds['id']}"
|
<a href="{$_url}routers/edit/{$ds['id']}"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user