mirror of
https://github.com/portainer/portainer.git
synced 2025-07-30 02:39:41 +02:00
refactor(app): redesign dashboard-item component [EE-3634] (#7175)
This commit is contained in:
parent
a66fd78dc1
commit
8bf1c91bc9
15 changed files with 236 additions and 248 deletions
|
@ -3,6 +3,8 @@ import _ from 'lodash';
|
|||
|
||||
import { isOfflineEndpoint } from '@/portainer/helpers/endpointHelper';
|
||||
import { PortainerEndpointTypes } from 'Portainer/models/endpoint/models';
|
||||
import { useContainerStatusComponent } from '@/react/docker/DashboardView/ContainerStatus';
|
||||
import { useImagesTotalSizeComponent } from '@/react/docker/DashboardView/ImagesTotalSize';
|
||||
|
||||
angular.module('portainer.docker').controller('DashboardController', [
|
||||
'$scope',
|
||||
|
@ -60,7 +62,11 @@ angular.module('portainer.docker').controller('DashboardController', [
|
|||
})
|
||||
.then(function success(data) {
|
||||
$scope.containers = data.containers;
|
||||
$scope.containerStatusComponent = useContainerStatusComponent(data.containers);
|
||||
|
||||
$scope.images = data.images;
|
||||
$scope.imagesTotalSizeComponent = useImagesTotalSizeComponent(imagesTotalSize(data.images));
|
||||
|
||||
$scope.volumeCount = data.volumes.length;
|
||||
$scope.networkCount = data.networks.length;
|
||||
$scope.serviceCount = data.services.length;
|
||||
|
@ -94,3 +100,7 @@ angular.module('portainer.docker').controller('DashboardController', [
|
|||
initView();
|
||||
},
|
||||
]);
|
||||
|
||||
function imagesTotalSize(images) {
|
||||
return images.reduce((acc, image) => acc + image.VirtualSize, 0);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue