webapp.scripts.app.entities.projects.projects.controller.js Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of centraldogma-server Show documentation
Show all versions of centraldogma-server Show documentation
Highly-available version-controlled service configuration repository based on Git, ZooKeeper and HTTP/2 (centraldogma-server)
The newest version!
'use strict';
angular.module('CentralDogmaAdmin')
.controller('ProjectsController',
function ($scope, ProjectService, $location, NotificationUtil, ConfirmationDialog) {
$scope.movePageIfAccessible = function (projectName) {
ProjectService.checkPermission(projectName).then(function () {
$location.url('/metadata/' + projectName);
}, function (error) {
NotificationUtil.error(error);
})
};
$scope.restoreProject = function (projectName) {
ConfirmationDialog.openModal('entities.title_restore_project', {
target: projectName
}).then(function () {
ProjectService.restoreProject(projectName).then(function () {
NotificationUtil.success('entities.title_project_restored', {
target: projectName
});
$scope.refresh();
});
});
};
$scope.refresh = function () {
ProjectService.listProjects().then(
function (projects) {
$scope.projects = projects;
}
);
ProjectService.listRemovedProjects().then(
function (removedProjects) {
$scope.removedProjects = removedProjects;
}
)
};
$scope.refresh();
});