|
|
|
@ -38,8 +38,8 @@ app.controller('Servers', function ($scope, $window, $http) {
|
|
|
|
((server.vcpus || 0) * $scope.serverPricing.vcpu) +
|
|
|
|
((server.vcpus || 0) * $scope.serverPricing.vcpu) +
|
|
|
|
((server.ram || 0) * $scope.serverPricing.ram) +
|
|
|
|
((server.ram || 0) * $scope.serverPricing.ram) +
|
|
|
|
((server.disk || 0) * $scope.serverPricing.disk) +
|
|
|
|
((server.disk || 0) * $scope.serverPricing.disk) +
|
|
|
|
(Math.ceil((server.windows ? 1 : 0) * $scope.serverPricing.windows * (server.vcpus || 0) / 2) * 2) +
|
|
|
|
(Math.floor((server.windows ? 1 : 0) * $scope.serverPricing.windows * (server.vcpus || 0) / 2) * 2) +
|
|
|
|
(Math.ceil((server.sql ? 1 : 0) * $scope.serverPricing.sql * (server.vcpus || 0) / 2) * 2) +
|
|
|
|
(Math.floor((server.sql ? 1 : 0) * $scope.serverPricing.sql * (server.vcpus || 0) / 2)) +
|
|
|
|
((server.ip ? 1 : 0) * $scope.serverPricing.ip)
|
|
|
|
((server.ip ? 1 : 0) * $scope.serverPricing.ip)
|
|
|
|
);
|
|
|
|
);
|
|
|
|
// console.log(server.cost)
|
|
|
|
// console.log(server.cost)
|
|
|
|
@ -48,7 +48,13 @@ app.controller('Servers', function ($scope, $window, $http) {
|
|
|
|
$scope.serverTotals = (type) => {
|
|
|
|
$scope.serverTotals = (type) => {
|
|
|
|
localStorage.setItem("servers", angular.toJson($scope.servers));
|
|
|
|
localStorage.setItem("servers", angular.toJson($scope.servers));
|
|
|
|
return $scope.servers?.reduce(function (a, b) {
|
|
|
|
return $scope.servers?.reduce(function (a, b) {
|
|
|
|
|
|
|
|
if (type == "windows") {
|
|
|
|
|
|
|
|
return a + ((b?.windows ?? 0) * (b.vcpus ?? 0) / 2 ?? 0);
|
|
|
|
|
|
|
|
} else if (type == "sql") {
|
|
|
|
|
|
|
|
return a + ((b?.sql ?? 0) * (b.vcpus ?? 0) / 2 ?? 0);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
return a + (b?.[type] ?? 0);
|
|
|
|
return a + (b?.[type] ?? 0);
|
|
|
|
|
|
|
|
}
|
|
|
|
}, 0);
|
|
|
|
}, 0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$scope.servicesTotals = () => {
|
|
|
|
$scope.servicesTotals = () => {
|
|
|
|
|