added destinations and replications in system management and refactored structure of directives for UI

This commit is contained in:
kunw 2016-05-31 18:49:16 +08:00
parent a204215870
commit 98243901d7
49 changed files with 444 additions and 396 deletions

View File

@ -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;
}

View File

@ -51,6 +51,7 @@ nav .container-custom {
.nav-custom .active {
border-bottom: 3px solid #EFEFEF;
font-weight: bold;
}
.dropdown {

View File

@ -39,6 +39,7 @@
.switch-pane-tabs li .active {
border-bottom: 2px solid rgb(0, 84, 190);
font-weight: bold;
}
.switch-pane-drop-down {

View File

@ -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'

View File

@ -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': '='

View File

@ -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',

View File

@ -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',

View File

@ -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

View File

@ -0,0 +1,62 @@
<form name="form" class="form-horizontal" ng-submit="form.$valid && vm.changeSettings(system)" >
<div class="col-md-12">
<h5>System Settings</h5>
<hr/>
</div>
<div class="col-md-12 col-md-off-set-1 main-content">
<div class="form-group">
<label for="hostName" class="col-sm-3 control-label">Host Name:</label>
<div class="col-sm-7">
<input type="text" class="form-control" id="hostName" ng-model="system.hostName" ng-model-options="{ updateOn: 'blur' }" ng-value="vm.system.hostName" name="uHostName" required>
<div ng-messages="form.$dirty && form.uHostName.$error">
<span ng-message="required">Host name is required.</span>
</div>
</div>
</div>
<div class="form-group">
<label for="urlProtocol" class="col-sm-3 control-label">URL Protocol:</label>
<div class="col-sm-7">
<input type="text" class="form-control" id="urlProtocol" ng-model="system.urlProtocol" ng-model-options="{ updateOn: 'blur' }" ng-value="vm.system.urlProtocol" name="uUrlProtocol" required>
<div ng-messages="form.$dirty && form.uUrlProtocol.$error">
<span ng-message="required">Url protocol is required.</span>
</div>
</div>
</div>
<div class="form-group">
<label for="emailServer" class="col-sm-3 control-label">Email server:</label>
<div class="col-sm-7">
<input type="text" class="form-control" id="emailServer" ng-model="system.emailServer" ng-model-options="{ updateOn: 'blur' }" ng-value="vm.system.emailServer" name="uEmailServer" required>
<div ng-messages="form.$dirty && form.uEmailServer.$error">
<span ng-message="required">Email server is required.</span>
</div>
</div>
</div>
<div class="form-group">
<label for="ldapUrl" class="col-sm-3 control-label">LDAP URL:</label>
<div class="col-sm-7">
<input type="text" class="form-control" id="ldapUrl" ng-model="system.ldapUrl" ng-model-options="{ updateOn: 'blur' }" ng-value="vm.system.ldapUrl" name="uLdapUrl" required>
<div ng-messages="form.$dirty && form.uLdapUrl.$error">
<span ng-message="required">LDAP URL is required.</span>
</div>
</div>
</div>
</div>
<div class="col-md-12">
<h5>Registration</h5>
<hr/>
</div>
<div class="col-md-12 col-md-off-set-1 main-content">
<div class="form-group">
<label for="registration" class="col-sm-3 control-label">Registration:</label>
<div class="col-sm-7">
<select class="form-control" ng-model="vm.currentRegistration" ng-options="r as r.name for r in vm.registrationOptions track by r.value" ng-click="vm.selectRegistration()"></select>
</div>
</div>
<div class="form-group">
<div class="col-md-offset-7 col-md-10">
<input type="submit" class="btn btn-primary" ng-disabled="form.$invalid" value="Save">
<input type="submit" class="btn btn-default" ng-click="vm.cancel()" value="Cancel">
</div>
</div>
</div>
</form>

View File

@ -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;
}
})();

View File

@ -0,0 +1 @@
destination

View File

@ -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;
}
})();

View File

@ -0,0 +1 @@
replication

View File

@ -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;
}
})();

View File

@ -0,0 +1,10 @@
<div class="switch-pane">
<span>
<navigation-admin-options target="vm.target"></navigation-admin-options>
</span>
</div>
<div class="pane project-pane">
<destination ng-if="vm.target === 'destinations'"></destination>
<replication ng-if="vm.target === 'replication'"></replication>
<configuration ng-if="vm.target === 'configuration'"></configuration>
</div>

View File

@ -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;
}
})();

View File

@ -0,0 +1,8 @@
(function() {
'use strict';
angular
.module('harbor.system.management', []);
})();

View File

@ -9,8 +9,7 @@
</div>
</div>
<div class="pane project-pane">
<div class="sub-pane">
<div class="sub-pane">
<table class="table">
<thead>
<th>// 'username' | tr //</th><th>// 'role' | tr //</th><th>// 'email' | tr //</th><th>// 'registration_time' | tr //</th><th>// 'operation' | tr //</th>
@ -28,7 +27,6 @@
</tr>
</tbody>
</table>
</div>
<div class="col-xs-4 col-md-12 well well-sm well-custom">
<div class="col-md-offset-10">//vm.users ? vm.users.length : 0// items</div>

View File

@ -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;
}
})();

View File

@ -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() {

View File

@ -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'
]);
})();

View File

@ -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');
})();

View File

@ -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;
}
}
}
}

View File

@ -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;

View File

@ -13,6 +13,7 @@
vm.isProjectMember = false;
vm.togglePublicity = togglePublicity;
vm.target = 'repositories';
function togglePublicity(e) {
vm.publicity = e.publicity;

View File

@ -1 +0,0 @@
<list-log project-id="vm.projectId"></list-log>

View File

@ -1,15 +0,0 @@
(function() {
'use strict';
angular
.module('harbor.layout.log')
.controller('LogController', LogController);
LogController.$inject = ['$scope'];
function LogController($scope) {
}
})();

View File

@ -1,8 +0,0 @@
(function() {
'use strict';
angular
.module('harbor.layout.log', []);
})();

View File

@ -0,0 +1,5 @@
<ul class="switch-pane-admin-options" role="tablist">
<li><a tag="destinations" href="#/destinations">Destinations</a><span class="gutter">|</span></li>
<li><a tag="replication" href="#/replication">Replication</a><span class="gutter">|</span></li>
<li><a tag="configuration" href="#/configuration">Configuration</a></li>
</ul>

View File

@ -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();
}
}
}
})();

View File

@ -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();
}
}

View File

@ -1 +0,0 @@
<list-project-member project-id="vm.projectId"></list-project-member>

View File

@ -1,13 +0,0 @@
(function() {
'use strict';
angular
.module('harbor.layout.project.member')
.controller('ProjectMemberController', ProjectMemberController);
function ProjectMemberController($scope) {
}
})();

View File

@ -1,9 +0,0 @@
(function() {
'use strict';
angular
.module('harbor.layout.project.member', []);
})();

View File

@ -1 +0,0 @@
<list-replication></list-replication>

View File

@ -1,12 +0,0 @@
(function() {
'use strict';
angular
.module('harbor.layout.replication')
.controller('ReplicationController', ReplicationController);
function ReplicationController() {
var vm = this;
}
})();

View File

@ -1,8 +0,0 @@
(function() {
'use strict';
angular
.module('harbor.layout.replication', []);
})();

View File

@ -1 +0,0 @@
<list-repository></list-repository>

View File

@ -1,15 +0,0 @@
(function() {
'use strict';
angular
.module('harbor.layout.repository')
.controller('RepositoryController', RepositoryController);
RepositoryController.$inject = ['$scope'];
function RepositoryController($scope) {
}
})();

View File

@ -1,8 +0,0 @@
(function() {
'use strict';
angular
.module('harbor.layout.repository', []);
})();

View File

@ -1,63 +0,0 @@
<form name="form" class="form-horizontal" ng-submit="form.$valid && vm.changeSettings(system)" >
<div class="col-md-12">
<h5>System Settings</h5>
<hr/>
</div>
<div class="col-md-12 col-md-off-set-1 main-content">
<div class="form-group">
<label for="hostName" class="col-sm-3 control-label">Host Name:</label>
<div class="col-sm-7">
<input type="text" class="form-control" id="hostName" ng-model="system.hostName" ng-model-options="{ updateOn: 'blur' }" ng-value="vm.system.hostName" name="uHostName" required>
<div ng-messages="form.$dirty && form.uHostName.$error">
<span ng-message="required">Host name is required.</span>
</div>
</div>
</div>
<div class="form-group">
<label for="urlProtocol" class="col-sm-3 control-label">URL Protocol:</label>
<div class="col-sm-7">
<input type="text" class="form-control" id="urlProtocol" ng-model="system.urlProtocol" ng-model-options="{ updateOn: 'blur' }" ng-value="vm.system.urlProtocol" name="uUrlProtocol" required>
<div ng-messages="form.$dirty && form.uUrlProtocol.$error">
<span ng-message="required">Url protocol is required.</span>
</div>
</div>
</div>
<div class="form-group">
<label for="emailServer" class="col-sm-3 control-label">Email server:</label>
<div class="col-sm-7">
<input type="text" class="form-control" id="emailServer" ng-model="system.emailServer" ng-model-options="{ updateOn: 'blur' }" ng-value="vm.system.emailServer" name="uEmailServer" required>
<div ng-messages="form.$dirty && form.uEmailServer.$error">
<span ng-message="required">Email server is required.</span>
</div>
</div>
</div>
<div class="form-group">
<label for="ldapUrl" class="col-sm-3 control-label">LDAP URL:</label>
<div class="col-sm-7">
<input type="text" class="form-control" id="ldapUrl" ng-model="system.ldapUrl" ng-model-options="{ updateOn: 'blur' }" ng-value="vm.system.ldapUrl" name="uLdapUrl" required>
<div ng-messages="form.$dirty && form.uLdapUrl.$error">
<span ng-message="required">LDAP URL is required.</span>
</div>
</div>
</div>
</div>
<div class="col-md-12">
<h5>Registration</h5>
<hr/>
</div>
<div class="col-md-12 col-md-off-set-1 main-content">
<div class="form-group">
<label for="registration" class="col-sm-3 control-label">Registration:</label>
<div class="col-sm-7">
<select class="form-control" ng-model="vm.currentRegistration" ng-options="r as r.name for r in vm.registrationOptions track by r.value" ng-click="vm.selectRegistration()"></select>
</div>
</div>
<div class="form-group">
<div class="col-md-offset-7 col-md-10">
<input type="submit" class="btn btn-primary" ng-disabled="form.$invalid" value="Save">
<input type="submit" class="btn btn-default" ng-click="vm.cancel()" value="Cancel">
</div>
</div>
</div>
</form>

View File

@ -1,8 +0,0 @@
(function() {
'use strict';
angular
.module('harbor.layout.system.management', []);
})();

View File

@ -1,10 +0,0 @@
(function() {
'use strict';
angular
.module('harbor.layout.user', [
'harbor.services.user'
]);
})();

View File

@ -3,117 +3,115 @@
<div class="row extend-height">
<div class="section">
<h1 class="col-md-12 col-md-offset-2 main-title title-color">// 'account_setting' | tr //</h1>
<div class="col-md-12 col-md-offset-2 main-content">
<form name="form" class="form-horizontal" ng-submit="form.$valid && vm.changeProile(user)" >
<div class="col-md-12 col-md-offset-2 main-content">
<form name="form" class="form-horizontal" ng-submit="form.$valid && vm.changeProile(user)" >
<div class="form-group">
<label for="username" class="col-sm-3 control-label">// 'username' | tr //:</label>
<div class="col-sm-7">
<input type="text" class="form-control" id="username" ng-model="user.username" ng-value="vm.user.username" name="uUsername" ng-model-options="{ updateOn: 'blur' }" ng-disabled="true" required maxlength="20" invalid-chars>
<div ng-messages="form.$submitted && form.uUsername.$error">
<span ng-message="required">// 'username_is_required' | tr //</span>
<span ng-message="maxlength">// 'username_is_too_long' | tr //</span>
<span ng-message="invalidChars">// 'username_contains_illegal_chars' | tr //</span>
</div>
</div>
<div class="col-sm-2">
<span class="asterisk">*</span>
</div>
</div>
<div class="form-group">
<label for="email" class="col-sm-3 control-label">// 'email' | tr //:</label>
<div class="col-sm-7">
<input type="email" class="form-control" id="email" ng-model="user.email" ng-value="vm.user.email" ng-model-options="{ updateOn: 'blur' }" ng-disabled="true" name="uEmail" required>
<div ng-messages="form.$submitted && form.uEmail.$error">
<span ng-message="required">// 'email_is_required' | tr //</span>
<span ng-message="email">// 'email_content_illegal' | tr //</span>
</div>
</div>
<div class="col-sm-2">
<span class="asterisk">*</span>
</div>
</div>
<div class="form-group">
<label for="fullName" class="col-sm-3 control-label">// 'full_name' | tr //:</label>
<div class="col-sm-7">
<input type="text" class="form-control" id="fullName" ng-model="user.fullName" name="uFullName" ng-model-options="{ updateOn: 'blur' }" ng-value="vm.user.realname" ng-disabled="true" required maxlength="20" invalid-chars>
<div ng-messages="form.$submitted && form.uFullName.$error">
<span ng-message="required">// 'full_name_is_required' | tr //</span>
<span ng-message="invalidChars">// 'full_name_contains_illegal_chars' | tr //</span>
<span ng-message="maxlength">// 'full_name_is_too_long' | tr //</span>
</div>
</div>
<div class="col-sm-2">
<span class="asterisk">*</span>
</div>
</div>
<div class="form-group">
<label for="comments" class="col-sm-3 control-label">// 'comments' | tr //:</label>
<div class="col-sm-7">
<input type="text" class="form-control" id="comments" ng-model="user.comment" name="uComments" ng-model-options="{ updateOn: 'blur' }" ng-value="vm.user.comment" ng-disabled="true" ng-model-options="{ updateOn: 'blur' }" maxlength="20">
<div ng-messages="form.$submitted && form.uComments.$error">
<span ng-show="maxlength">// 'comment_is_too_long' | tr //</span>
</div>
</div>
</div>
</form>
<form name="form" class="form-horizontal css-form" ng-submit="form.$valid && vm.changePassword(user)" novalidate>
<div class="form-group">
<label for="toggleChangePassword" class="col-sm-3 control-label"><a id="toggleChangePassword" href="#" ng-click="vm.toggleChangePassword()">// 'change_password' | tr //</a></label>
</div>
<div ng-show="vm.isOpen">
<hr/>
<div class="form-group">
<label for="username" class="col-sm-3 control-label">// 'username' | tr //:</label>
<label for="oldPassword" class="col-sm-3 control-label">// 'old_password' | tr //:</label>
<div class="col-sm-7">
<input type="text" class="form-control" id="username" ng-model="user.username" ng-value="vm.user.username" name="uUsername" ng-model-options="{ updateOn: 'blur' }" ng-disabled="true" required maxlength="20" invalid-chars>
<div ng-messages="form.$submitted && form.uUsername.$error">
<span ng-message="required">// 'username_is_required' | tr //</span>
<span ng-message="maxlength">// 'username_is_too_long' | tr //</span>
<span ng-message="invalidChars">// 'username_contains_illegal_chars' | tr //</span>
</div>
<input type="password" class="form-control" id="oldPassword" ng-model="user.oldPassword" ng-change="vm.reset()" name="uOldPassword" ng-model-options="{ updateOn: 'blur' }" required>
<div class="error-message" ng-messages="form.uOldPassword.$error" ng-if="form.uOldPassword.$touched">
<span ng-message="required">// 'old_password_is_required' | tr //</span>
</div>
</div>
<div class="col-sm-2">
<span class="asterisk">*</span>
</div>
</div>
<div class="form-group">
<label for="email" class="col-sm-3 control-label">// 'email' | tr //:</label>
<label for="password" class="col-sm-3 control-label">// 'new_password' | tr //:</label>
<div class="col-sm-7">
<input type="email" class="form-control" id="email" ng-model="user.email" ng-value="vm.user.email" ng-model-options="{ updateOn: 'blur' }" ng-disabled="true" name="uEmail" required>
<div ng-messages="form.$submitted && form.uEmail.$error">
<span ng-message="required">// 'email_is_required' | tr //</span>
<span ng-message="email">// 'email_content_illegal' | tr //</span>
<input type="password" class="form-control" id="password" ng-model="user.password" ng-change="vm.reset()" name="uPassword" ng-model-options="{ updateOn: 'blur' }" required password>
<div class="error-message" ng-messages="form.uPassword.$error" ng-if="form.uPassword.$touched">
<span ng-message="required">// 'password_is_required' | tr //</span>
<span ng-message="password">// 'password_is_invalid' | tr //</span>
</div>
<p class="help-block small-size-fonts">// 'password_desc' | tr //</p>
</div>
<div class="col-sm-2">
<span class="asterisk">*</span>
</div>
</div>
<div class="form-group">
<label for="fullName" class="col-sm-3 control-label">// 'full_name' | tr //:</label>
<div class="col-sm-7">
<input type="text" class="form-control" id="fullName" ng-model="user.fullName" name="uFullName" ng-model-options="{ updateOn: 'blur' }" ng-value="vm.user.realname" ng-disabled="true" required maxlength="20" invalid-chars>
<div ng-messages="form.$submitted && form.uFullName.$error">
<span ng-message="required">// 'full_name_is_required' | tr //</span>
<span ng-message="invalidChars">// 'full_name_contains_illegal_chars' | tr //</span>
<span ng-message="maxlength">// 'full_name_is_too_long' | tr //</span>
<label for="confirmPassword" class="col-sm-3 control-label">// 'confirm_password' | tr //:</label>
<div class="col-sm-7">
<input type="password" class="form-control" id="confirmPassword" ng-model="user.confirmPassword" ng-change="vm.reset()" name="uConfirmPassword" ng-model-options="{ updateOn: 'blur' }" compare-to="user.password">
<div class="error-message" ng-messages="form.uConfirmPassword.$error" ng-if="form.uConfirmPassword.$touched">
<span ng-message="compareTo">// 'password_does_not_match' | tr //</span>
</div>
</div>
<div class="col-sm-2">
<span class="asterisk">*</span>
</div>
</div>
<div class="form-group">
<label for="comments" class="col-sm-3 control-label">// 'comments' | tr //:</label>
<div class="col-sm-7">
<input type="text" class="form-control" id="comments" ng-model="user.comment" name="uComments" ng-model-options="{ updateOn: 'blur' }" ng-value="vm.user.comment" ng-disabled="true" ng-model-options="{ updateOn: 'blur' }" maxlength="20">
<div ng-messages="form.$submitted && form.uComments.$error">
<span ng-show="maxlength">// 'comment_is_too_long' | tr //</span>
</div>
</div>
</div>
</form>
<form name="form" class="form-horizontal css-form" ng-submit="form.$valid && vm.changePassword(user)" novalidate>
<div class="form-group">
<label for="toggleChangePassword" class="col-sm-3 control-label"><a id="toggleChangePassword" href="#" ng-click="vm.toggleChangePassword()">// 'change_password' | tr //</a></label>
</div>
<div class="form-group">
<div class="col-md-offset-7 col-md-10">
<input type="submit" class="btn btn-primary" ng-disabled="form.$invalid" value="// 'save' | tr //">
<input type="submit" class="btn btn-default" ng-click="vm.cancel(form)" value="// 'cancel' | tr //">
</div>
<div ng-show="vm.isOpen">
<hr/>
<div class="form-group">
<label for="oldPassword" class="col-sm-3 control-label">// 'old_password' | tr //:</label>
<div class="col-sm-7">
<input type="password" class="form-control" id="oldPassword" ng-model="user.oldPassword" ng-change="vm.reset()" name="uOldPassword" ng-model-options="{ updateOn: 'blur' }" required>
<div class="error-message" ng-messages="form.uOldPassword.$error" ng-if="form.uOldPassword.$touched">
<span ng-message="required">// 'old_password_is_required' | tr //</span>
</div>
</div>
<div class="col-sm-2">
<span class="asterisk">*</span>
</div>
</div>
<div class="form-group">
<label for="password" class="col-sm-3 control-label">// 'new_password' | tr //:</label>
<div class="col-sm-7">
<input type="password" class="form-control" id="password" ng-model="user.password" ng-change="vm.reset()" name="uPassword" ng-model-options="{ updateOn: 'blur' }" required password>
<div class="error-message" ng-messages="form.uPassword.$error" ng-if="form.uPassword.$touched">
<span ng-message="required">// 'password_is_required' | tr //</span>
<span ng-message="password">// 'password_is_invalid' | tr //</span>
</div>
<p class="help-block small-size-fonts">// 'password_desc' | tr //</p>
</div>
<div class="col-sm-2">
<span class="asterisk">*</span>
</div>
</div>
<div class="form-group">
<label for="confirmPassword" class="col-sm-3 control-label">// 'confirm_password' | tr //:</label>
<div class="col-sm-7">
<input type="password" class="form-control" id="confirmPassword" ng-model="user.confirmPassword" ng-change="vm.reset()" name="uConfirmPassword" ng-model-options="{ updateOn: 'blur' }" compare-to="user.password">
<div class="error-message" ng-messages="form.uConfirmPassword.$error" ng-if="form.uConfirmPassword.$touched">
<span ng-message="compareTo">// 'password_does_not_match' | tr //</span>
</div>
</div>
<div class="col-sm-2">
<span class="asterisk">*</span>
</div>
</div>
</div>
<div class="form-group">
<div class="col-md-offset-7 col-md-10">
<input type="submit" class="btn btn-primary" ng-disabled="form.$invalid" value="// 'save' | tr //">
<input type="submit" class="btn btn-default" ng-click="vm.cancel(form)" value="// 'cancel' | tr //">
</div>
</div>
<div class="error-message">
<span ng-show="vm.hasError">// vm.errorMessage | tr //</span>
</div>
</form>
</div>
</div>
<div class="error-message">
<span ng-show="vm.hasError">// vm.errorMessage | tr //</span>
</div>
</form>
</div>
</div>
</div>
</div>

View File

@ -2,17 +2,16 @@
<div class="container container-custom">
<div class="row extend-height">
<div class="col-xs-12 col-md-12">
<div class="section">
<h4 class="page-header">
<span ng-show="!vm.toggle">// 'users' | tr //</span>
<a ng-show="vm.toggle" href="#/all_user" ng-click="vm.toggleAdminOption()">// 'users' | tr //</a>
<span class="gutter">|</span>
<span ng-show="vm.toggle">// 'system_management' | tr //</span>
<a ng-show="!vm.toggle" href="#/system_management" class="title-color" ng-click="vm.toggleAdminOption()">// 'system_management' | tr //</a>
</h4>
<div class="pane project-pane">
<ng-view></ng-view>
</div>
<div class="section">
<h4 class="page-header">
<span ng-if="!vm.toggle">// 'users' | tr //</span>
<a ng-if="vm.toggle" href="#" ng-click="vm.toggleAdminOption()">// 'users' | tr //</a>
<span class="gutter">|</span>
<span ng-if="vm.toggle">// 'system_management' | tr //</span>
<a ng-if="!vm.toggle" href="#/destinations" class="title-color" ng-click="vm.toggleAdminOption()">// 'system_management' | tr //</a>
</h4>
<list-user ng-if="!vm.toggle"></list-user>
<system-management ng-if="vm.toggle"></system-management>
</div>
</div>
</div>

24
views/ng/header.htm Normal file
View File

@ -0,0 +1,24 @@
<nav class="navbar navbar-default navbar-custom" ng-controller="HeaderController as vm">
<div class="container container-custom">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-harbor-navbar-collapse-1" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="/ng/main"><img class="img-responsive" src="/static/ng/resources/img/Harbor_Logo_rec.png" alt="Harbor's Logo"/></a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-harbor-navbar-collapse-1">
<optional-menu current="vm.current"></optional-menu>
<ul class="nav navbar-nav navbar-right">
<li>
<navigation-header></navigation-header>
</li>
<li>
<search-input search-input='vm.searchInput'></search-input>
</li>
</ul>
</div><!-- /.navbar-collapse -->
</div><!-- /.container-fluid -->
</nav>

View File

@ -3,7 +3,7 @@
<li><a tag="dashboard" href="/ng/dashboard">// 'dashboard' | tr //</a></li>
<li><a tag="project" href="/ng/project">// 'projects' | tr //</a></li>
{{ if eq .IsAdmin 1 }}
<li><a tag="admin_option" href="/ng/admin_option#/all_user">// 'admin_options' | tr //</a></li>
<li><a tag="admin_option" href="/ng/admin_option">// 'admin_options' | tr //</a></li>
{{ end }}
</ul>
{{ end }}

View File

@ -12,14 +12,17 @@
<div class="switch-pane">
<switch-pane-projects is-open="vm.isOpen" selected-project="vm.selectedProject"></switch-pane-projects>
<span>
<navigation-details selected-project="vm.selectedProject" ng-show="vm.isProjectMember"></navigation-details>
<navigation-details selected-project="vm.selectedProject" target="vm.target" ng-show="vm.isProjectMember"></navigation-details>
</span>
</div>
<retrieve-projects is-open="vm.isOpen" selected-project="vm.selectedProject" is-project-member="vm.isProjectMember" publicity="vm.publicity"></retrieve-projects>
<!-- Tab panes -->
<div class="tab-content" ng-click="vm.closeRetrievePane()">
<input type="hidden" id="HarborRegUrl" value="{{.HarborRegUrl}}">
<ng-view></ng-view>
<input type="hidden" id="HarborRegUrl" value="{{.HarborRegUrl}}">
<list-repository ng-if="vm.target === 'repositories'"></list-repository>
<list-replication ng-if="vm.target === 'replication'"></list-replication>
<list-project-member ng-if="vm.target === 'users'"></list-project-member>
<list-log ng-if="vm.target === 'logs'"></list-log>
</div>
</div>
</div>

View File

@ -32,6 +32,7 @@
<link rel="stylesheet" href="/static/ng/resources/css/sign-up.css">
<link rel="stylesheet" href="/static/ng/resources/css/search.css">
<link rel="stylesheet" href="/static/ng/resources/css/replication.css">
<link rel="stylesheet" href="/static/ng/resources/css/admin-options.css">
<script src="/static/ng/vendors/angularjs/angular.js"></script>
<script src="/static/ng/vendors/angularjs/angular-route.js"></script>
@ -49,6 +50,7 @@
<script src="/static/ng/resources/js/layout/navigation/navigation.module.js"></script>
<script src="/static/ng/resources/js/layout/navigation/navigation-header.directive.js"></script>
<script src="/static/ng/resources/js/layout/navigation/navigation-details.directive.js"></script>
<script src="/static/ng/resources/js/layout/navigation/navigation-admin-options.directive.js"></script>
<script src="/static/ng/resources/js/layout/sign-up/sign-up.module.js"></script>
<script src="/static/ng/resources/js/layout/sign-up/sign-up.controller.js"></script>
@ -75,21 +77,6 @@
<script src="/static/ng/resources/js/layout/details/details.config.js"></script>
<script src="/static/ng/resources/js/layout/details/details.controller.js"></script>
<script src="/static/ng/resources/js/layout/repository/repository.module.js"></script>
<script src="/static/ng/resources/js/layout/repository/repository.controller.js"></script>
<script src="/static/ng/resources/js/layout/project-member/project-member.module.js"></script>
<script src="/static/ng/resources/js/layout/project-member/project-member.controller.js"></script>
<script src="/static/ng/resources/js/layout/user/user.module.js"></script>
<script src="/static/ng/resources/js/layout/user/user.controller.js"></script>
<script src="/static/ng/resources/js/layout/system-management/system-management.module.js"></script>
<script src="/static/ng/resources/js/layout/system-management/system-management.controller.js"></script>
<script src="/static/ng/resources/js/layout/log/log.module.js"></script>
<script src="/static/ng/resources/js/layout/log/log.controller.js"></script>
<script src="/static/ng/resources/js/layout/admin-option/admin-option.module.js"></script>
<script src="/static/ng/resources/js/layout/admin-option/admin-option.controller.js"></script>
<script src="/static/ng/resources/js/layout/admin-option/admin-option.config.js"></script>
@ -97,9 +84,6 @@
<script src="/static/ng/resources/js/layout/search/search.module.js"></script>
<script src="/static/ng/resources/js/layout/search/search.controller.js"></script>
<script src="/static/ng/resources/js/layout/replication/replication.module.js"></script>
<script src="/static/ng/resources/js/layout/replication/replication.controller.js"></script>
<script src="/static/ng/resources/js/services/i18n/services.i18n.module.js"></script>
{{ if eq .Lang "zh-CN" }}
@ -201,6 +185,7 @@
<script src="/static/ng/resources/js/components/project-member/edit-project-member.directive.js"></script>
<script src="/static/ng/resources/js/components/user/user.module.js"></script>
<script src="/static/ng/resources/js/components/user/list-user.directive.js"></script>
<script src="/static/ng/resources/js/components/user/toggle-admin.directive.js"></script>
<script src="/static/ng/resources/js/components/log/log.module.js"></script>
@ -211,3 +196,11 @@
<script src="/static/ng/resources/js/components/replication/replication.module.js"></script>
<script src="/static/ng/resources/js/components/replication/list-replication.directive.js"></script>
<script src="/static/ng/resources/js/components/replication/create-policy.directive.js"></script>
<script src="/static/ng/resources/js/components/system-management/system-management.module.js"></script>
<script src="/static/ng/resources/js/components/system-management/system-management.directive.js"></script>
<script src="/static/ng/resources/js/components/system-management/destination.directive.js"></script>
<script src="/static/ng/resources/js/components/system-management/replication.directive.js"></script>
<script src="/static/ng/resources/js/components/system-management/configuration.directive.js"></script>