All Downloads are FREE. Search and download functionalities are using the official Maven repository.

webapp.scripts.app.entities.projects.projects.controller.js Maven / Gradle / Ivy

Go to download

Highly-available version-controlled service configuration repository based on Git, ZooKeeper and HTTP/2 (centraldogma-server)

There is a newer version: 0.70.0
Show 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();
                });




© 2015 - 2024 Weber Informatics LLC | Privacy Policy