mirror of https://github.com/portainer/portainer
Fix network stats error for 1.9.0+ clients, hide networks and volumes better on older clients.
parent
22d35eb32f
commit
9d1193c0b5
|
@ -7,8 +7,8 @@
|
||||||
<li><a href="#/containers/">Containers</a></li>
|
<li><a href="#/containers/">Containers</a></li>
|
||||||
<li><a href="#/containers_network/">Containers Network</a></li>
|
<li><a href="#/containers_network/">Containers Network</a></li>
|
||||||
<li><a href="#/images/">Images</a></li>
|
<li><a href="#/images/">Images</a></li>
|
||||||
<li><a href="#/networks/" ng-if="showNetworksVolumes">Networks</a></li>
|
<li ng-if="showNetworksVolumes"><a href="#/networks/">Networks</a></li>
|
||||||
<li><a href="#/volumes/" ng-if="showNetworksVolumes">Volumes</a></li>
|
<li ng-if="showNetworksVolumes"><a href="#/volumes/">Volumes</a></li>
|
||||||
<li><a href="#/info/">Info</a></li>
|
<li><a href="#/info/">Info</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -11,5 +11,5 @@ angular.module('masthead', [])
|
||||||
|
|
||||||
$scope.refresh = function() {
|
$scope.refresh = function() {
|
||||||
location.reload();
|
location.reload();
|
||||||
}
|
};
|
||||||
}]);
|
}]);
|
||||||
|
|
|
@ -44,7 +44,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<h1>Network</h1>
|
<h1>Network {{ networkName}}</h1>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm-7">
|
<div class="col-sm-7">
|
||||||
<canvas id="network-stats-chart" width="650" height="300"></canvas>
|
<canvas id="network-stats-chart" width="650" height="300"></canvas>
|
||||||
|
|
|
@ -138,6 +138,12 @@ angular.module('stats', [])
|
||||||
var lastRxBytes = 0, lastTxBytes = 0;
|
var lastRxBytes = 0, lastTxBytes = 0;
|
||||||
|
|
||||||
function updateNetworkChart(data) {
|
function updateNetworkChart(data) {
|
||||||
|
// 1.9+ contains an object of networks, for now we'll just show stats for the first network
|
||||||
|
// TODO: Show graphs for all networks
|
||||||
|
if (data.networks) {
|
||||||
|
$scope.networkName = Object.keys(data.networks)[0];
|
||||||
|
data.network = data.networks[$scope.networkName];
|
||||||
|
}
|
||||||
var rxBytes = 0, txBytes = 0;
|
var rxBytes = 0, txBytes = 0;
|
||||||
if (lastRxBytes !== 0 || lastTxBytes !== 0) {
|
if (lastRxBytes !== 0 || lastTxBytes !== 0) {
|
||||||
// These will be zero on first call, ignore to prevent large graph spike
|
// These will be zero on first call, ignore to prevent large graph spike
|
||||||
|
|
Loading…
Reference in New Issue