SAAS-1243: Bandwidth usage status on Listener Stats page

This commit is contained in:
drigato 2015-11-26 13:25:44 -05:00
parent 786b357ed5
commit 21846be7ed
2 changed files with 24 additions and 3 deletions

View File

@ -1,4 +1,16 @@
<div id="listenerstat_content" class="alpha-block padded">
<?php $bandwidthUsage = Application_Model_Preference::getBandwidthLimitCounter(); ?>
<?php $bandwidthLimit = Application_Model_Preference::getBandwidthLimit(); ?>
<?php $percentInUse = sprintf("%01.1f%% ", $bandwidthUsage/$bandwidthLimit*100); ?>
<div id="bandwidth_usage">
<div style="padding-bottom: 2px;"><?php echo _("Monthly Listener Bandwidth Usage") ?></div>
<div class="bandwidth_usage_progress_bar"></div>
<div class="bandwidth_usage_percent_in_use"><?php echo $percentInUse . _("in use") ?></div>
<div class="bandwidth_usage_used" style="width:<?php echo sprintf("%01.1f%%", min(100, $bandwidthUsage/$bandwidthLimit*100)) ?>;"></div>
<div style="margin-top: 17px; font-size: 12px;"><?php echo sprintf("%01.1fGB of %01.1fGB", $bandwidthUsage/pow(2, 30), $bandwidthLimit/pow(2, 30)); ?></div>
</div>
<H2><?php echo _("Listeners")?></H2>
<div id="flot_placeholder" style="height:300px;margin:0px 50px 0px 50px"></div>
<div id="legend" style="width:600px;height:70px;margin:0px 50px 0px 50px"></div>

View File

@ -3914,7 +3914,7 @@ hr {
flex: 0 0 auto;
}
#disk_usage {
#disk_usage, #bandwidth_usage {
border-radius: 1px;
margin: 7px;
font-size: 14px;
@ -3925,7 +3925,7 @@ hr {
color: #ccc;
}
.disk_usage_progress_bar {
.disk_usage_progress_bar, .bandwidth_usage_progress_bar {
float: left;
width: 100%;
height: 13px;
@ -3936,7 +3936,7 @@ hr {
z-index: 1;
}
.disk_usage_percent_in_use {
.disk_usage_percent_in_use, .bandwidth_usage_percent_in_use {
position: absolute;
left: 0;
right: 0;
@ -3956,6 +3956,15 @@ hr {
position: relative;
}
.bandwidth_usage_used {
background-color: #128DFE;
/*background: -moz-linear-gradient(bottom, #128DFE 0%, #1ADDFF 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0, #128DFE), color-stop(100%, #1ADDFF));*/
height:13px;
z-index: 2;
position: relative;
}
.dropdown-menu li > a:hover, .dropdown-menu li > a:focus, .dropdown-submenu:hover > a
{
background: #ff5d1a;