diff --git a/static/ng/resources/css/admin-options.css b/static/ng/resources/css/admin-options.css new file mode 100644 index 000000000..c361947ed --- /dev/null +++ b/static/ng/resources/css/admin-options.css @@ -0,0 +1,17 @@ +.switch-pane-admin-options { + display: inline; + width: 345px; + float: right; + list-style-type: none; +} + +.switch-pane-admin-options a, .switch-pane-admin-options span { + display: inline-block; + text-decoration: none; + float: left; +} + +.switch-pane-admin-options li .active { + border-bottom: 2px solid rgb(0, 84, 190); + font-weight: bold; +} \ No newline at end of file diff --git a/static/ng/resources/css/header.css b/static/ng/resources/css/header.css index 4d8f86da1..24b1a7c81 100644 --- a/static/ng/resources/css/header.css +++ b/static/ng/resources/css/header.css @@ -51,6 +51,7 @@ nav .container-custom { .nav-custom .active { border-bottom: 3px solid #EFEFEF; + font-weight: bold; } .dropdown { diff --git a/static/ng/resources/css/repository.css b/static/ng/resources/css/repository.css index 74ce340c3..6c927ec76 100644 --- a/static/ng/resources/css/repository.css +++ b/static/ng/resources/css/repository.css @@ -39,6 +39,7 @@ .switch-pane-tabs li .active { border-bottom: 2px solid rgb(0, 84, 190); + font-weight: bold; } .switch-pane-drop-down { diff --git a/static/ng/resources/js/components/details/retrieve-projects.directive.js b/static/ng/resources/js/components/details/retrieve-projects.directive.js index 510a6f8cc..26913b671 100644 --- a/static/ng/resources/js/components/details/retrieve-projects.directive.js +++ b/static/ng/resources/js/components/details/retrieve-projects.directive.js @@ -6,16 +6,16 @@ .module('harbor.details') .directive('retrieveProjects', retrieveProjects); - RetrieveProjectsController.$inject = ['$scope', 'nameFilter', '$filter', 'CurrentProjectMemberService', 'ListProjectService', '$routeParams', '$route', '$location']; + RetrieveProjectsController.$inject = ['$scope', 'nameFilter', '$filter', 'CurrentProjectMemberService', 'ListProjectService', '$location', 'getParameterByName', '$window']; - function RetrieveProjectsController($scope, nameFilter, $filter, CurrentProjectMemberService, ListProjectService, $routeParams, $route, $location) { + function RetrieveProjectsController($scope, nameFilter, $filter, CurrentProjectMemberService, ListProjectService, $location, getParameterByName, $window) { var vm = this; vm.projectName = ''; vm.isOpen = false; - if($route.current.params.is_public) { - vm.isPublic = $route.current.params.is_public === 'true' ? 1 : 0; + if(getParameterByName('is_public', $location.absUrl())) { + vm.isPublic = getParameterByName('is_public', $location.absUrl()) === 'true' ? 1 : 0; vm.publicity = (vm.isPublic === 1) ? true : false; } @@ -56,9 +56,9 @@ vm.selectedProject = vm.projects[0]; - if($routeParams.project_id){ + if(getParameterByName('project_id', $location.absUrl())){ angular.forEach(vm.projects, function(value, index) { - if(value['ProjectId'] === Number($routeParams.project_id)) { + if(value['ProjectId'] === Number(getParameterByName('project_id', $location.absUrl()))) { vm.selectedProject = value; } }); @@ -98,6 +98,7 @@ vm.checkProjectMember(vm.selectedProject.ProjectId); vm.isOpen = false; $location.search('project_id', vm.selectedProject.ProjectId); + $window.location.reload(); } } @@ -113,7 +114,6 @@ 'isProjectMember': '=' }, link: link, - replace: true, controller: RetrieveProjectsController, bindToController: true, controllerAs: 'vm' diff --git a/static/ng/resources/js/components/details/switch-pane-projects.directive.js b/static/ng/resources/js/components/details/switch-pane-projects.directive.js index 7c1ba33f6..9dfac3a74 100644 --- a/static/ng/resources/js/components/details/switch-pane-projects.directive.js +++ b/static/ng/resources/js/components/details/switch-pane-projects.directive.js @@ -34,7 +34,6 @@ var directive = { restrict: 'E', templateUrl: '/static/ng/resources/js/components/details/switch-pane-projects.directive.html', - replace: true, scope: { 'isOpen': '=', 'selectedProject': '=' diff --git a/static/ng/resources/js/components/log/list-log.directive.js b/static/ng/resources/js/components/log/list-log.directive.js index ad7f4e323..8a64142d5 100644 --- a/static/ng/resources/js/components/log/list-log.directive.js +++ b/static/ng/resources/js/components/log/list-log.directive.js @@ -6,9 +6,9 @@ .module('harbor.log') .directive('listLog', listLog); - ListLogController.$inject = ['$scope','ListLogService', '$routeParams']; + ListLogController.$inject = ['$scope','ListLogService', 'getParameterByName', '$location']; - function ListLogController($scope, ListLogService, $routeParams) { + function ListLogController($scope, ListLogService, getParameterByName, $location) { var vm = this; vm.isOpen = false; @@ -22,7 +22,7 @@ vm.search = search; vm.showAdvancedSearch = showAdvancedSearch; - vm.projectId = $routeParams.project_id; + vm.projectId = getParameterByName('project_id', $location.absUrl()); vm.queryParams = { 'beginTimestamp' : vm.beginTimestamp, 'endTimestamp' : vm.endTimestamp, @@ -91,7 +91,6 @@ var directive = { restrict: 'E', templateUrl: '/static/ng/resources/js/components/log/list-log.directive.html', - replace: true, scope: true, controller: ListLogController, controllerAs: 'vm', diff --git a/static/ng/resources/js/components/project-member/list-project-member.directive.js b/static/ng/resources/js/components/project-member/list-project-member.directive.js index 1e16d5ba0..dd9666071 100644 --- a/static/ng/resources/js/components/project-member/list-project-member.directive.js +++ b/static/ng/resources/js/components/project-member/list-project-member.directive.js @@ -6,16 +6,16 @@ .module('harbor.project.member') .directive('listProjectMember', listProjectMember); - ListProjectMemberController.$inject = ['$scope', 'ListProjectMemberService', '$routeParams', 'currentUser']; + ListProjectMemberController.$inject = ['$scope', 'ListProjectMemberService', 'getParameterByName', '$location', 'currentUser']; - function ListProjectMemberController($scope, ListProjectMemberService, $routeParams, currentUser) { + function ListProjectMemberController($scope, ListProjectMemberService, getParameterByName, $location, currentUser) { var vm = this; vm.isOpen = false; vm.search = search; vm.addProjectMember = addProjectMember; vm.retrieve = retrieve; - vm.projectId = $routeParams.project_id; + vm.projectId = getParameterByName('project_id', $location.absUrl()); vm.username = ""; vm.retrieve(); @@ -55,7 +55,6 @@ var directive = { restrict: 'E', templateUrl: '/static/ng/resources/js/components/project-member/list-project-member.directive.html', - replace: true, scope: true, controller: ListProjectMemberController, controllerAs: 'vm', diff --git a/static/ng/resources/js/components/repository/list-repository.directive.js b/static/ng/resources/js/components/repository/list-repository.directive.js index 306216062..4d827bfbf 100644 --- a/static/ng/resources/js/components/repository/list-repository.directive.js +++ b/static/ng/resources/js/components/repository/list-repository.directive.js @@ -5,9 +5,9 @@ .module('harbor.repository') .directive('listRepository', listRepository); - ListRepositoryController.$inject = ['$scope', 'ListRepositoryService', 'DeleteRepositoryService', '$routeParams', '$filter', 'trFilter', '$location']; + ListRepositoryController.$inject = ['$scope', 'ListRepositoryService', 'DeleteRepositoryService', '$filter', 'trFilter', '$location', 'getParameterByName']; - function ListRepositoryController($scope, ListRepositoryService, DeleteRepositoryService, $routeParams, $filter, trFilter, $location) { + function ListRepositoryController($scope, ListRepositoryService, DeleteRepositoryService, $filter, trFilter, $location, getParameterByName) { var vm = this; vm.filterInput = ''; @@ -23,7 +23,7 @@ } vm.retrieve = retrieve; - vm.projectId = $routeParams.project_id; + vm.projectId = getParameterByName('project_id', $location.absUrl()); vm.tagCount = {}; vm.retrieve(); @@ -99,7 +99,6 @@ var directive = { restrict: 'E', templateUrl: '/static/ng/resources/js/components/repository/list-repository.directive.html', - replace: true, controller: ListRepositoryController, controllerAs: 'vm', bindToController: true diff --git a/static/ng/resources/js/components/system-management/configuration.directive.html b/static/ng/resources/js/components/system-management/configuration.directive.html new file mode 100644 index 000000000..2afdfa3e7 --- /dev/null +++ b/static/ng/resources/js/components/system-management/configuration.directive.html @@ -0,0 +1,62 @@ +
\ No newline at end of file diff --git a/static/ng/resources/js/layout/system-management/system-management.controller.js b/static/ng/resources/js/components/system-management/configuration.directive.js similarity index 51% rename from static/ng/resources/js/layout/system-management/system-management.controller.js rename to static/ng/resources/js/components/system-management/configuration.directive.js index 719f0ab0d..e37388ef1 100644 --- a/static/ng/resources/js/layout/system-management/system-management.controller.js +++ b/static/ng/resources/js/components/system-management/configuration.directive.js @@ -3,11 +3,14 @@ 'use strict'; angular - .module('harbor.layout.system.management') - .controller('SystemManagementController', SystemManagementController); - - function SystemManagementController() { + .module('harbor.system.management') + .directive('configuration', configuration); + + ConfigurationController.$inject = []; + + function ConfigurationController() { var vm = this; + vm.registrationOptions = [ { 'name': 'on', @@ -36,4 +39,16 @@ } } + function configuration() { + var directive = { + 'restrict': 'E', + 'templateUrl': '/static/ng/resources/js/components/system-management/configuration.directive.html', + 'scope': true, + 'controller': ConfigurationController, + 'controllerAs': 'vm', + 'bindToController': true + }; + return directive; + } + })(); \ No newline at end of file diff --git a/static/ng/resources/js/components/system-management/destination.directive.html b/static/ng/resources/js/components/system-management/destination.directive.html new file mode 100644 index 000000000..be2d5fc56 --- /dev/null +++ b/static/ng/resources/js/components/system-management/destination.directive.html @@ -0,0 +1 @@ +destination \ No newline at end of file diff --git a/static/ng/resources/js/components/system-management/destination.directive.js b/static/ng/resources/js/components/system-management/destination.directive.js new file mode 100644 index 000000000..f618e6917 --- /dev/null +++ b/static/ng/resources/js/components/system-management/destination.directive.js @@ -0,0 +1,25 @@ +(function() { + + 'use strict'; + + angular + .module('harbor.system.management') + .directive('destination', destination); + + function DestinationController() { + var vm = this; + } + + function destination() { + var directive = { + 'restrict': 'E', + 'templateUrl': '/static/ng/resources/js/components/system-management/destination.directive.html', + 'scope': true, + 'controller': DestinationController, + 'controllerAs': 'vm', + 'bindToController': true + }; + return directive; + } + +})(); \ No newline at end of file diff --git a/static/ng/resources/js/components/system-management/replication.directive.html b/static/ng/resources/js/components/system-management/replication.directive.html new file mode 100644 index 000000000..c191bf55f --- /dev/null +++ b/static/ng/resources/js/components/system-management/replication.directive.html @@ -0,0 +1 @@ +replication \ No newline at end of file diff --git a/static/ng/resources/js/components/system-management/replication.directive.js b/static/ng/resources/js/components/system-management/replication.directive.js new file mode 100644 index 000000000..8eec2ed81 --- /dev/null +++ b/static/ng/resources/js/components/system-management/replication.directive.js @@ -0,0 +1,25 @@ +(function() { + + 'use strict'; + + angular + .module('harbor.system.management') + .directive('replication', replication); + + function ReplicationController() { + var vm = this; + } + + function replication() { + var directive = { + 'restrict': 'E', + 'templateUrl': '/static/ng/resources/js/components/system-management/replication.directive.html', + 'scope': true, + 'controller': ReplicationController, + 'controllerAs': 'vm', + 'bindToController': true + }; + return directive; + } + +})(); \ No newline at end of file diff --git a/static/ng/resources/js/components/system-management/system-management.directive.html b/static/ng/resources/js/components/system-management/system-management.directive.html new file mode 100644 index 000000000..57e3affab --- /dev/null +++ b/static/ng/resources/js/components/system-management/system-management.directive.html @@ -0,0 +1,10 @@ +// 'username' | tr // | // 'role' | tr // | // 'email' | tr // | // 'registration_time' | tr // | // 'operation' | tr // | @@ -28,7 +27,6 @@
---|