-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added server bandwidth and traffice consumption views
- Loading branch information
1 parent
96bfe22
commit 38ce0f5
Showing
2 changed files
with
58 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<?php | ||
|
||
use hipanel\widgets\ChartJs; | ||
use yii\helpers\Html; | ||
|
||
list($labels, $data) = $model->groupUsesForCharts(); | ||
|
||
?> | ||
|
||
<div class="row"> | ||
<div class="col-md-12"> | ||
<?php | ||
if ($data === []) { | ||
echo Yii::t('hipanel/server', 'Bandwidth consumption history is not available for this server'); | ||
} else { | ||
echo Html::tag('div', ChartJs::widget([ | ||
'type' => 'Line', | ||
'legend' => true, | ||
'data' => [ | ||
'labels' => array_values($labels), | ||
'datasets' => [ | ||
[ | ||
'label' => Yii::t('hipanel/server', '95th percentile for outgoing bandwidth, Mbit/s'), | ||
'fillColor' => "rgba(220,220,220,0.5)", | ||
'strokeColor' => "rgba(220,220,220,1)", | ||
'pointColor' => "rgba(220,220,220,1)", | ||
'pointStrokeColor' => "#fff", | ||
'data' => $data['server_traf95'] | ||
], | ||
[ | ||
'label' => Yii::t('hipanel/server', '95th percentile for incoming bandwidth, Mbit/s'), | ||
'fillColor' => "rgba(151,187,205,0.5)", | ||
'strokeColor' => "rgba(151,187,205,1)", | ||
'pointColor' => "rgba(151,187,205,1)", | ||
'pointStrokeColor' => "#fff", | ||
'data' => $data['server_traf95_in'] | ||
] | ||
] | ||
], | ||
'clientOptions' => [ | ||
'bezierCurve' => false, | ||
'responsive' => true, | ||
'maintainAspectRatio' => true, | ||
] | ||
]), ['class' => 'traffic-chart-wrapper']); | ||
} | ||
|
||
?> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters