1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-25 08:19:40 +02:00

feat(azure): add experimental Azure endpoint support (#1936)

This commit is contained in:
Anthony Lapenna 2018-05-28 16:40:33 +02:00 committed by GitHub
parent 415c6ce5e1
commit 9ad9cc5e2d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
52 changed files with 1665 additions and 79 deletions

View file

@ -0,0 +1,41 @@
angular.module('portainer.azure')
.controller('AzureContainerInstancesController', ['$scope', '$state', 'AzureService', 'Notifications',
function ($scope, $state, AzureService, Notifications) {
function initView() {
AzureService.subscriptions()
.then(function success(data) {
var subscriptions = data;
return AzureService.containerGroups(subscriptions);
})
.then(function success(data) {
$scope.containerGroups = AzureService.aggregate(data);
})
.catch(function error(err) {
Notifications.error('Failure', err, 'Unable to load container groups');
});
}
$scope.deleteAction = function (selectedItems) {
var actionCount = selectedItems.length;
angular.forEach(selectedItems, function (item) {
AzureService.deleteContainerGroup(item.Id)
.then(function success() {
Notifications.success('Container group successfully removed', item.Name);
var index = $scope.containerGroups.indexOf(item);
$scope.containerGroups.splice(index, 1);
})
.catch(function error(err) {
Notifications.error('Failure', err, 'Unable to remove container group');
})
.finally(function final() {
--actionCount;
if (actionCount === 0) {
$state.reload();
}
});
});
};
initView();
}]);