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 @@ +
+
+
System Settings
+
+
+
+
+ +
+ +
+ Host name is required. +
+
+
+
+ +
+ +
+ Url protocol is required. +
+
+
+
+ +
+ +
+ Email server is required. +
+
+
+
+ +
+ +
+ LDAP URL is required. +
+
+
+
+
+
Registration
+
+
+
+
+ +
+ +
+
+
+
+ + +
+
+
+
\ 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 @@ +
+ + + +
+
+ + + +
diff --git a/static/ng/resources/js/components/system-management/system-management.directive.js b/static/ng/resources/js/components/system-management/system-management.directive.js new file mode 100644 index 000000000..4a6b97823 --- /dev/null +++ b/static/ng/resources/js/components/system-management/system-management.directive.js @@ -0,0 +1,26 @@ +(function() { + + 'use strict'; + + angular + .module('harbor.system.management') + .directive('systemManagement', systemManagement); + + function SystemManagementController() { + var vm = this; + vm.target = 'destinations'; + } + + function systemManagement() { + var directive = { + 'restrict': 'E', + 'templateUrl': '/static/ng/resources/js/components/system-management/system-management.directive.html', + 'scope': true, + 'controller': SystemManagementController, + 'controllerAs': 'vm', + 'bindToController': true + }; + return directive; + } + +})(); \ No newline at end of file diff --git a/static/ng/resources/js/components/system-management/system-management.module.js b/static/ng/resources/js/components/system-management/system-management.module.js new file mode 100644 index 000000000..78837cc7c --- /dev/null +++ b/static/ng/resources/js/components/system-management/system-management.module.js @@ -0,0 +1,8 @@ +(function() { + + 'use strict'; + + angular + .module('harbor.system.management', []); + +})(); \ No newline at end of file diff --git a/static/ng/resources/js/layout/user/user.controller.html b/static/ng/resources/js/components/user/list-user.directive.html similarity index 97% rename from static/ng/resources/js/layout/user/user.controller.html rename to static/ng/resources/js/components/user/list-user.directive.html index dcf2149db..3a00ddd6c 100644 --- a/static/ng/resources/js/layout/user/user.controller.html +++ b/static/ng/resources/js/components/user/list-user.directive.html @@ -9,8 +9,7 @@
-
- +
@@ -28,7 +27,6 @@
// 'username' | tr //// 'role' | tr //// 'email' | tr //// 'registration_time' | tr //// 'operation' | tr //
-
//vm.users ? vm.users.length : 0// items
diff --git a/static/ng/resources/js/layout/user/user.controller.js b/static/ng/resources/js/components/user/list-user.directive.js similarity index 64% rename from static/ng/resources/js/layout/user/user.controller.js rename to static/ng/resources/js/components/user/list-user.directive.js index c14ba227f..172a1ad77 100644 --- a/static/ng/resources/js/layout/user/user.controller.js +++ b/static/ng/resources/js/components/user/list-user.directive.js @@ -3,12 +3,12 @@ 'use strict'; angular - .module('harbor.layout.user') - .controller('UserController', UserController); + .module('harbor.user') + .directive('listUser', listUser); - UserController.$inject = ['ListUserService', 'DeleteUserService']; + ListUserController.$inject = ['ListUserService', 'DeleteUserService']; - function UserController(ListUserService, DeleteUserService) { + function ListUserController(ListUserService, DeleteUserService) { var vm = this; vm.username = ''; @@ -49,10 +49,19 @@ function listUserFailed(data, status) { console.log('Failed list user:' + data); - } - - - + } + } + + function listUser() { + var directive = { + 'restrict': 'E', + 'templateUrl': '/static/ng/resources/js/components/user/list-user.directive.html', + 'scope': true, + 'controller': ListUserController, + 'controllerAs': 'vm', + 'bindToController': true + }; + return directive; } })(); \ No newline at end of file diff --git a/static/ng/resources/js/components/user/toggle-admin.directive.js b/static/ng/resources/js/components/user/toggle-admin.directive.js index 37e8f2073..d0eb96a1a 100644 --- a/static/ng/resources/js/components/user/toggle-admin.directive.js +++ b/static/ng/resources/js/components/user/toggle-admin.directive.js @@ -11,7 +11,7 @@ function ToggleAdminController($scope, ToggleAdminService) { var vm = this; - vm.isAdmin = (vm.hasAdminRole === 1) ? true : false; + vm.isAdmin = (vm.hasAdminRole == 1) ? true : false; vm.toggle = toggle; function toggle() { diff --git a/static/ng/resources/js/harbor.module.js b/static/ng/resources/js/harbor.module.js index 15ff76f72..4e5fd26e2 100644 --- a/static/ng/resources/js/harbor.module.js +++ b/static/ng/resources/js/harbor.module.js @@ -15,14 +15,8 @@ 'harbor.layout.index', 'harbor.layout.dashboard', 'harbor.layout.project', - 'harbor.layout.repository', - 'harbor.layout.project.member', - 'harbor.layout.user', - 'harbor.layout.system.management', - 'harbor.layout.log', 'harbor.layout.admin.option', 'harbor.layout.search', - 'harbor.layout.replication', 'harbor.services.i18n', 'harbor.services.project', 'harbor.services.user', @@ -41,6 +35,7 @@ 'harbor.user', 'harbor.log', 'harbor.validator', - 'harbor.replication' + 'harbor.replication', + 'harbor.system.management' ]); })(); \ No newline at end of file diff --git a/static/ng/resources/js/layout/admin-option/admin-option.config.js b/static/ng/resources/js/layout/admin-option/admin-option.config.js index 8ace33f55..b1d43d1a4 100644 --- a/static/ng/resources/js/layout/admin-option/admin-option.config.js +++ b/static/ng/resources/js/layout/admin-option/admin-option.config.js @@ -3,24 +3,6 @@ 'use strict'; angular - .module('harbor.layout.admin.option') - .config(routeConfig); - - function routeConfig($routeProvider) { - $routeProvider - .when('/all_user', { - 'templateUrl': '/static/ng/resources/js/layout/user/user.controller.html', - 'controller': 'UserController', - 'controllerAs': 'vm' - }) - .when('/system_management', { - 'templateUrl': '/static/ng/resources/js/layout/system-management/system-management.controller.html', - 'controller': 'SystemManagementController', - 'controllerAs': 'vm' - }) - .otherwise({ - 'redirectTo': '/' - }); - } + .module('harbor.layout.admin.option'); })(); \ No newline at end of file diff --git a/static/ng/resources/js/layout/admin-option/admin-option.controller.js b/static/ng/resources/js/layout/admin-option/admin-option.controller.js index 39eb1ba72..88bca1e45 100644 --- a/static/ng/resources/js/layout/admin-option/admin-option.controller.js +++ b/static/ng/resources/js/layout/admin-option/admin-option.controller.js @@ -6,6 +6,8 @@ .module('harbor.layout.admin.option') .controller('AdminOptionController', AdminOptionController); + AdminOptionController.$inject = []; + function AdminOptionController() { var vm = this; vm.toggle = false; @@ -16,7 +18,7 @@ vm.toggle = false; }else{ vm.toggle = true; - } + } } } diff --git a/static/ng/resources/js/layout/details/details.config.js b/static/ng/resources/js/layout/details/details.config.js index 5befcb6bc..ba12b1485 100644 --- a/static/ng/resources/js/layout/details/details.config.js +++ b/static/ng/resources/js/layout/details/details.config.js @@ -4,34 +4,8 @@ angular .module('harbor.details') - .config(routeConfig) .filter('name', nameFilter); - - function routeConfig($routeProvider) { - $routeProvider - .when('/repositories', { - templateUrl: '/static/ng/resources/js/layout/repository/repository.controller.html', - controller: 'RepositoryController', - controllerAs: 'vm' - }) - .when('/replication', { - templateUrl: '/static/ng/resources/js/layout/replication/replication.controller.html', - controller: 'ReplicationController', - controllerAs: 'vm' - }) - .when('/users', { - templateUrl: '/static/ng/resources/js/layout/project-member/project-member.controller.html', - controller: 'ProjectMemberController', - controllerAs: 'vm' - }) - .when('/logs', { - templateUrl: '/static/ng/resources/js/layout/log/log.controller.html', - controller: 'LogController', - controllerAs: 'vm' - }); - } - function nameFilter() { return filter; diff --git a/static/ng/resources/js/layout/details/details.controller.js b/static/ng/resources/js/layout/details/details.controller.js index 096e009f0..eb9b673be 100644 --- a/static/ng/resources/js/layout/details/details.controller.js +++ b/static/ng/resources/js/layout/details/details.controller.js @@ -13,6 +13,7 @@ vm.isProjectMember = false; vm.togglePublicity = togglePublicity; + vm.target = 'repositories'; function togglePublicity(e) { vm.publicity = e.publicity; diff --git a/static/ng/resources/js/layout/log/log.controller.html b/static/ng/resources/js/layout/log/log.controller.html deleted file mode 100644 index cfc507eef..000000000 --- a/static/ng/resources/js/layout/log/log.controller.html +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/static/ng/resources/js/layout/log/log.controller.js b/static/ng/resources/js/layout/log/log.controller.js deleted file mode 100644 index 6b8309654..000000000 --- a/static/ng/resources/js/layout/log/log.controller.js +++ /dev/null @@ -1,15 +0,0 @@ -(function() { - - 'use strict'; - - angular - .module('harbor.layout.log') - .controller('LogController', LogController); - - LogController.$inject = ['$scope']; - - function LogController($scope) { - - } - -})(); \ No newline at end of file diff --git a/static/ng/resources/js/layout/log/log.module.js b/static/ng/resources/js/layout/log/log.module.js deleted file mode 100644 index 97b9507e0..000000000 --- a/static/ng/resources/js/layout/log/log.module.js +++ /dev/null @@ -1,8 +0,0 @@ -(function() { - - 'use strict'; - - angular - .module('harbor.layout.log', []); - -})(); \ No newline at end of file diff --git a/static/ng/resources/js/layout/navigation/navigation-admin-options.directive.html b/static/ng/resources/js/layout/navigation/navigation-admin-options.directive.html new file mode 100644 index 000000000..d10b2fbfd --- /dev/null +++ b/static/ng/resources/js/layout/navigation/navigation-admin-options.directive.html @@ -0,0 +1,5 @@ + \ No newline at end of file diff --git a/static/ng/resources/js/layout/navigation/navigation-admin-options.directive.js b/static/ng/resources/js/layout/navigation/navigation-admin-options.directive.js new file mode 100644 index 000000000..f102afa37 --- /dev/null +++ b/static/ng/resources/js/layout/navigation/navigation-admin-options.directive.js @@ -0,0 +1,51 @@ +(function() { + + 'use strict'; + + angular + .module('harbor.layout.navigation') + .directive('navigationAdminOptions', navigationAdminOptions); + + NavigationAdminOptions.$inject = ['$location']; + + function NavigationAdminOptions($location) { + var vm = this; + vm.path = $location.path(); + } + + function navigationAdminOptions() { + var directive = { + 'restrict': 'E', + 'templateUrl': '/static/ng/resources/js/layout/navigation/navigation-admin-options.directive.html', + 'scope': { + 'target': '=' + }, + 'link': link, + 'controller': NavigationAdminOptions, + 'controllerAs': 'vm', + 'bindToController': true + }; + return directive; + + function link(scope, element, attrs, ctrl) { + var visited = ctrl.path.substring(1); + console.log('visited:' + visited); + + if(visited) { + element.find('a[tag="' + visited + '"]').addClass('active'); + }else{ + element.find('a:first').addClass('active'); + } + + element.find('a').on('click', click); + + function click(event) { + element.find('a').removeClass('active'); + $(event.target).addClass('active'); + ctrl.target = $(this).attr('tag'); + scope.$apply(); + } + } + } + +})(); \ No newline at end of file diff --git a/static/ng/resources/js/layout/navigation/navigation-details.directive.js b/static/ng/resources/js/layout/navigation/navigation-details.directive.js index 8a30fe52c..ef0002663 100644 --- a/static/ng/resources/js/layout/navigation/navigation-details.directive.js +++ b/static/ng/resources/js/layout/navigation/navigation-details.directive.js @@ -17,7 +17,7 @@ } }); - vm.url = $location.url(); + vm.path = $location.path(); } function navigationDetails() { @@ -26,7 +26,8 @@ templateUrl: '/ng/navigation_detail', link: link, scope: { - 'selectedProject': '=' + 'selectedProject': '=', + 'target': '=' }, replace: true, controller: NavigationDetailsController, @@ -38,26 +39,24 @@ function link(scope, element, attrs, ctrl) { - var visited = ctrl.url.substring(1); + var visited = ctrl.path.substring(1); if(visited.indexOf('?') >= 0) { visited = ctrl.url.substring(1, ctrl.url.indexOf('?')); } - scope.$watch('vm.selectedProject', function(current) { - if(current) { - element.find('a').removeClass('active'); - if(visited) { - element.find('a[tag="' + visited + '"]').addClass('active'); - }else{ - element.find('a:first').addClass('active'); - } - } - }); + if(visited) { + element.find('a[tag="' + visited + '"]').addClass('active'); + }else{ + element.find('a:first').addClass('active'); + } + element.find('a').on('click', click); function click(event) { element.find('a').removeClass('active'); $(event.target).addClass('active'); + ctrl.target = $(this).attr('tag'); + scope.$apply(); } } diff --git a/static/ng/resources/js/layout/project-member/project-member.controller.html b/static/ng/resources/js/layout/project-member/project-member.controller.html deleted file mode 100644 index ca4821a4b..000000000 --- a/static/ng/resources/js/layout/project-member/project-member.controller.html +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/static/ng/resources/js/layout/project-member/project-member.controller.js b/static/ng/resources/js/layout/project-member/project-member.controller.js deleted file mode 100644 index ec977697d..000000000 --- a/static/ng/resources/js/layout/project-member/project-member.controller.js +++ /dev/null @@ -1,13 +0,0 @@ -(function() { - - 'use strict'; - - angular - .module('harbor.layout.project.member') - .controller('ProjectMemberController', ProjectMemberController); - - function ProjectMemberController($scope) { - - } - -})(); \ No newline at end of file diff --git a/static/ng/resources/js/layout/project-member/project-member.module.js b/static/ng/resources/js/layout/project-member/project-member.module.js deleted file mode 100644 index aef24ae9e..000000000 --- a/static/ng/resources/js/layout/project-member/project-member.module.js +++ /dev/null @@ -1,9 +0,0 @@ -(function() { - - 'use strict'; - - angular - .module('harbor.layout.project.member', []); - - -})(); \ No newline at end of file diff --git a/static/ng/resources/js/layout/replication/replication.controller.html b/static/ng/resources/js/layout/replication/replication.controller.html deleted file mode 100644 index 2496d434e..000000000 --- a/static/ng/resources/js/layout/replication/replication.controller.html +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/static/ng/resources/js/layout/replication/replication.controller.js b/static/ng/resources/js/layout/replication/replication.controller.js deleted file mode 100644 index bd1fcc18e..000000000 --- a/static/ng/resources/js/layout/replication/replication.controller.js +++ /dev/null @@ -1,12 +0,0 @@ -(function() { - - 'use strict'; - - angular - .module('harbor.layout.replication') - .controller('ReplicationController', ReplicationController); - - function ReplicationController() { - var vm = this; - } -})(); \ No newline at end of file diff --git a/static/ng/resources/js/layout/replication/replication.module.js b/static/ng/resources/js/layout/replication/replication.module.js deleted file mode 100644 index 15953e40a..000000000 --- a/static/ng/resources/js/layout/replication/replication.module.js +++ /dev/null @@ -1,8 +0,0 @@ -(function() { - - 'use strict'; - - angular - .module('harbor.layout.replication', []); - -})(); \ No newline at end of file diff --git a/static/ng/resources/js/layout/repository/repository.controller.html b/static/ng/resources/js/layout/repository/repository.controller.html deleted file mode 100644 index 536aaf276..000000000 --- a/static/ng/resources/js/layout/repository/repository.controller.html +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/static/ng/resources/js/layout/repository/repository.controller.js b/static/ng/resources/js/layout/repository/repository.controller.js deleted file mode 100644 index 49de27f07..000000000 --- a/static/ng/resources/js/layout/repository/repository.controller.js +++ /dev/null @@ -1,15 +0,0 @@ -(function() { - - 'use strict'; - - angular - .module('harbor.layout.repository') - .controller('RepositoryController', RepositoryController); - - RepositoryController.$inject = ['$scope']; - - function RepositoryController($scope) { - - } - -})(); \ No newline at end of file diff --git a/static/ng/resources/js/layout/repository/repository.module.js b/static/ng/resources/js/layout/repository/repository.module.js deleted file mode 100644 index fade37efc..000000000 --- a/static/ng/resources/js/layout/repository/repository.module.js +++ /dev/null @@ -1,8 +0,0 @@ -(function() { - - 'use strict'; - - angular - .module('harbor.layout.repository', []); - -})(); \ No newline at end of file diff --git a/static/ng/resources/js/layout/system-management/system-management.controller.html b/static/ng/resources/js/layout/system-management/system-management.controller.html deleted file mode 100644 index fec351f46..000000000 --- a/static/ng/resources/js/layout/system-management/system-management.controller.html +++ /dev/null @@ -1,63 +0,0 @@ - -
-
-
System Settings
-
-
-
-
- -
- -
- Host name is required. -
-
-
-
- -
- -
- Url protocol is required. -
-
-
-
- -
- -
- Email server is required. -
-
-
-
- -
- -
- LDAP URL is required. -
-
-
-
-
-
Registration
-
-
-
-
- -
- -
-
-
-
- - -
-
-
-
diff --git a/static/ng/resources/js/layout/system-management/system-management.module.js b/static/ng/resources/js/layout/system-management/system-management.module.js deleted file mode 100644 index 0fb06b3d5..000000000 --- a/static/ng/resources/js/layout/system-management/system-management.module.js +++ /dev/null @@ -1,8 +0,0 @@ -(function() { - - 'use strict'; - - angular - .module('harbor.layout.system.management', []); - -})(); \ No newline at end of file diff --git a/static/ng/resources/js/layout/user/user.module.js b/static/ng/resources/js/layout/user/user.module.js deleted file mode 100644 index 4bfe54e56..000000000 --- a/static/ng/resources/js/layout/user/user.module.js +++ /dev/null @@ -1,10 +0,0 @@ -(function() { - - 'use strict'; - - angular - .module('harbor.layout.user', [ - 'harbor.services.user' - ]); - -})(); \ No newline at end of file diff --git a/views/ng/account-settings.htm b/views/ng/account-settings.htm index 80b5029d1..22b24ae99 100644 --- a/views/ng/account-settings.htm +++ b/views/ng/account-settings.htm @@ -3,117 +3,115 @@

// 'account_setting' | tr //

- -
-
+
+ +
+ +
+ +
+ // 'username_is_required' | tr // + // 'username_is_too_long' | tr // + // 'username_contains_illegal_chars' | tr // +
+
+
+ * +
+
+
+ +
+ +
+ // 'email_is_required' | tr // + // 'email_content_illegal' | tr // +
+
+
+ * +
+
+
+ +
+ +
+ // 'full_name_is_required' | tr // + // 'full_name_contains_illegal_chars' | tr // + // 'full_name_is_too_long' | tr // +
+
+
+ * +
+
+
+ +
+ +
+ // 'comment_is_too_long' | tr // +
+
+
+ +
+ +
+
- +
- -
- // 'username_is_required' | tr // - // 'username_is_too_long' | tr // - // 'username_contains_illegal_chars' | tr // -
+ +
+ // 'old_password_is_required' | tr // +
*
- +
- -
- // 'email_is_required' | tr // - // 'email_content_illegal' | tr // + +
+ // 'password_is_required' | tr // + // 'password_is_invalid' | tr //
+

// 'password_desc' | tr //

*
- -
- -
- // 'full_name_is_required' | tr // - // 'full_name_contains_illegal_chars' | tr // - // 'full_name_is_too_long' | tr // + +
+ +
+ // 'password_does_not_match' | tr //
*
-
- -
- -
- // 'comment_is_too_long' | tr // -
-
-
- -
- +
+
+ +
-
-
-
- -
- -
- // 'old_password_is_required' | tr // -
-
-
- * -
-
-
- -
- -
- // 'password_is_required' | tr // - // 'password_is_invalid' | tr // -
-

// 'password_desc' | tr //

-
-
- * -
-
-
- -
- -
- // 'password_does_not_match' | tr // -
-
-
- * -
-
-
-
-
- - -
-
-
- // vm.errorMessage | tr // -
- -
- +
+
+ // vm.errorMessage | tr // +
+ +
diff --git a/views/ng/admin-options.htm b/views/ng/admin-options.htm index be10d7e93..0d893a0d4 100644 --- a/views/ng/admin-options.htm +++ b/views/ng/admin-options.htm @@ -2,17 +2,16 @@
-
- -
- -
+
+ + +
diff --git a/views/ng/header.htm b/views/ng/header.htm new file mode 100644 index 000000000..b8d0de74a --- /dev/null +++ b/views/ng/header.htm @@ -0,0 +1,24 @@ + \ No newline at end of file diff --git a/views/ng/navigation-header.htm b/views/ng/navigation-header.htm index 1046715a0..4b0e67e69 100644 --- a/views/ng/navigation-header.htm +++ b/views/ng/navigation-header.htm @@ -3,7 +3,7 @@
  • // 'dashboard' | tr //
  • // 'projects' | tr //
  • {{ if eq .IsAdmin 1 }} -
  • // 'admin_options' | tr //
  • +
  • // 'admin_options' | tr //
  • {{ end }} {{ end }} \ No newline at end of file diff --git a/views/ng/repository.htm b/views/ng/repository.htm index 2ed17f5f3..4d2a9f136 100644 --- a/views/ng/repository.htm +++ b/views/ng/repository.htm @@ -12,14 +12,17 @@
    - +
    - - + + + + +
    diff --git a/views/ng/sections/header-include.htm b/views/ng/sections/header-include.htm index 93a3fae5b..d917e5b19 100644 --- a/views/ng/sections/header-include.htm +++ b/views/ng/sections/header-include.htm @@ -32,6 +32,7 @@ + @@ -49,6 +50,7 @@ + @@ -75,21 +77,6 @@ - - - - - - - - - - - - - - - @@ -97,9 +84,6 @@ - - - {{ if eq .Lang "zh-CN" }} @@ -201,6 +185,7 @@ + @@ -211,3 +196,11 @@ + + + + + + + +