mirror of
https://github.com/goharbor/harbor.git
synced 2024-09-30 14:27:35 +02:00
add inline-help onto the UI and some other refinements.
This commit is contained in:
parent
9052206b99
commit
d270d8bb04
@ -124,4 +124,8 @@ nav .container-custom {
|
||||
height: 1.2em;
|
||||
margin-bottom: 2px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
}
|
||||
|
||||
a:hover, a:visited, a:link {
|
||||
text-decoration: none;
|
||||
}
|
@ -0,0 +1,5 @@
|
||||
<a href="javascript:void(0)" role="button" tab-index="0"
|
||||
data-trigger="focus" data-toggle="popover" data-placement="right"
|
||||
data-title="//vm.helpTitle//">
|
||||
<span class="glyphicon glyphicon-info-sign"></span>
|
||||
</a>
|
@ -0,0 +1,34 @@
|
||||
(function() {
|
||||
|
||||
'use strict';
|
||||
|
||||
angular
|
||||
.module('harbor.inline.help')
|
||||
.directive('inlineHelp', inlineHelp);
|
||||
function InlineHelpController() {
|
||||
var vm = this;
|
||||
}
|
||||
function inlineHelp() {
|
||||
var directive = {
|
||||
'restrict': 'E',
|
||||
'templateUrl': '/static/resources/js/components/inline-help/inline-help.directive.html',
|
||||
'scope': {
|
||||
'helpTitle': '@',
|
||||
'content': '@'
|
||||
},
|
||||
'link': link,
|
||||
'controller': InlineHelpController,
|
||||
'controllerAs': 'vm',
|
||||
'bindToController': true
|
||||
};
|
||||
return directive;
|
||||
function link(scope, element, attr, ctrl) {
|
||||
element.popover({
|
||||
'title': ctrl.helpTitle,
|
||||
'content': ctrl.content,
|
||||
'html': true
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
})();
|
@ -0,0 +1,8 @@
|
||||
(function() {
|
||||
|
||||
'use strict';
|
||||
|
||||
angular
|
||||
.module('harbor.inline.help', []);
|
||||
|
||||
})();
|
@ -45,7 +45,7 @@
|
||||
function optionalMenu() {
|
||||
var directive = {
|
||||
'restrict': 'E',
|
||||
'templateUrl': '/optional_menu',
|
||||
'templateUrl': '/optional_menu?timestamp=' + new Date().getTime(),
|
||||
'scope': true,
|
||||
'controller': OptionalMenuController,
|
||||
'controllerAs': 'vm',
|
||||
|
@ -12,9 +12,10 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="roleIdList">// 'role' | tr //:</label>
|
||||
<label for="roleIdList">// 'role' | tr //:</label>
|
||||
<inline-help help-title="//'inline_help_role_title' | tr//" content="//'inline_help_role' | tr//"></inline-help>
|
||||
<span ng-repeat="role in vm.roles">
|
||||
<input type="radio" name="role" ng-model="vm.optRole" value="//role.id//"> //role.name//
|
||||
<input type="radio" name="role" ng-model="vm.optRole" value="//role.id//"> //role.name | tr//
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -9,15 +9,15 @@
|
||||
|
||||
function roles() {
|
||||
return [
|
||||
{'id': '1', 'name': 'Project Admin', 'roleName': 'projectAdmin'},
|
||||
{'id': '2', 'name': 'Developer', 'roleName': 'developer'},
|
||||
{'id': '3', 'name': 'Guest', 'roleName': 'guest'}
|
||||
{'id': '1', 'name': 'project_admin', 'roleName': 'projectAdmin'},
|
||||
{'id': '2', 'name': 'developer', 'roleName': 'developer'},
|
||||
{'id': '3', 'name': 'guest', 'roleName': 'guest'}
|
||||
];
|
||||
}
|
||||
|
||||
getRole.$inject = ['roles'];
|
||||
getRole.$inject = ['roles', '$filter', 'trFilter'];
|
||||
|
||||
function getRole(roles) {
|
||||
function getRole(roles, $filter, trFilter) {
|
||||
var r = roles();
|
||||
return get;
|
||||
function get(query) {
|
||||
@ -26,6 +26,7 @@
|
||||
var role = r[i];
|
||||
if(query.key === 'roleName' && role.roleName === query.value
|
||||
|| query.key === 'roleId' && role.id === String(query.value)) {
|
||||
console.log('role.name: ' + role.name);
|
||||
return role;
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
<ng-switch on="vm.editMode">
|
||||
<span ng-switch-default>//vm.currentRole.name//</span>
|
||||
<select class="form-control" style="width: auto; height: auto; padding: 0;" ng-switch-when="true" ng-model="vm.currentRole" ng-options="role as role.name for role in vm.roles track by role.roleName" ng-change="vm.selectRole(vm.currentRole)">
|
||||
<span ng-switch-default>//vm.currentRole.name | tr//</span>
|
||||
<select class="form-control" style="width: auto; height: auto; padding: 0;" ng-switch-when="true" ng-model="vm.currentRole" ng-options="role as (role.name | tr) for role in vm.roles track by role.roleName" ng-change="vm.selectRole(vm.currentRole)">
|
||||
</select>
|
||||
</ng-switch>
|
@ -13,7 +13,8 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" style="margin-top: 5px;">
|
||||
<input type="checkbox" ng-model="vm.isPublic"> // 'public' | tr //
|
||||
<input type="checkbox" ng-model="vm.isPublic"> // 'public' | tr //
|
||||
<inline-help help-title="// 'inline_help_publicity_title' | tr //" content="// 'inline_help_publicity' | tr //"></inline-help>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-2 col-md-2">
|
||||
|
@ -409,7 +409,7 @@
|
||||
if(!ctrl.toggleErrorMessage) {
|
||||
element.find('#createPolicyModal').modal('hide');
|
||||
}
|
||||
}, 50);
|
||||
}, 150);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -21,10 +21,10 @@
|
||||
return {
|
||||
'responseError': function(rejection) {
|
||||
var pathname = $window.location.pathname;
|
||||
var exclusions = ['/', '/search', '/reset_password', '/sign_up', '/forgot_password'];
|
||||
var exclusion = ['/', '/search', '/reset_password', '/sign_up', '/forgot_password', '/repository'];
|
||||
var isExcluded = false;
|
||||
for(var i in exclusions) {
|
||||
if(exclusions[i] === pathname) {
|
||||
for(var i in exclusion) {
|
||||
if(exclusion[i] === pathname) {
|
||||
isExcluded = true;
|
||||
break;
|
||||
}
|
||||
|
@ -44,6 +44,7 @@
|
||||
'harbor.validator',
|
||||
'harbor.replication',
|
||||
'harbor.system.management',
|
||||
'harbor.loading.progress'
|
||||
'harbor.loading.progress',
|
||||
'harbor.inline.help'
|
||||
]);
|
||||
})();
|
@ -23,7 +23,7 @@
|
||||
function navigationDetails() {
|
||||
var directive = {
|
||||
restrict: 'E',
|
||||
templateUrl: '/navigation_detail',
|
||||
templateUrl: '/navigation_detail?timestamp=' + new Date().getTime(),
|
||||
link: link,
|
||||
scope: {
|
||||
'target': '='
|
||||
|
@ -16,7 +16,7 @@
|
||||
function navigationHeader() {
|
||||
var directive = {
|
||||
restrict: 'E',
|
||||
templateUrl: '/navigation_header',
|
||||
templateUrl: '/navigation_header?timestamp=' + new Date().getTime(),
|
||||
link: link,
|
||||
scope: true,
|
||||
controller: NavigationHeaderController,
|
||||
|
@ -235,5 +235,14 @@ var locale_messages = {
|
||||
'failed_to_delete_destination': 'Failed to delete destination.',
|
||||
'failed_to_create_destination': 'Failed to create destination.',
|
||||
'failed_to_update_destination': 'Failed to update destination.',
|
||||
'project_admin': 'Project Admin',
|
||||
'developer': 'Developer',
|
||||
'guest': 'Guest',
|
||||
'inline_help_role_title': '<strong>The Definitions of Roles</strong>',
|
||||
'inline_help_role': '<strong>Project Admin</strong>: When creating a new project, you will be assigned the "ProjectAdmin" role to the project. Besides read-write privileges, the "ProjectAdmin" also has some management privileges, such as adding and removing members.<br/>' +
|
||||
'<strong>Developer</strong>: Developer has read and write privileges for a project.<br/>' +
|
||||
'<strong>Guest</strong>: Guest has read-only privilege for a specified project.',
|
||||
'inline_help_publicity_title': '<strong>Publicity of Project</strong>',
|
||||
'inline_help_publicity': 'Setting the project as public.'
|
||||
|
||||
};
|
@ -234,5 +234,14 @@ var locale_messages = {
|
||||
'failed_to_update_replication_policy': '修改复制策略失败。',
|
||||
'failed_to_delete_destination': '删除目标失败。',
|
||||
'failed_to_create_destination': '创建目标失败。',
|
||||
'failed_to_update_destination': '修改目标失败。'
|
||||
'failed_to_update_destination': '修改目标失败。',
|
||||
'project_admin': '项目管理员',
|
||||
'developer': '开发人员',
|
||||
'guest': '来宾用户',
|
||||
'inline_help_role_title': '<strong>角色定义</strong>',
|
||||
'inline_help_role': '<strong>项目管理员</strong>: 当创建一个新项目后,您将被指派一个“项目管理员”角色。除了具备读/写权限外,“项目管理员”还拥有添加、删除其他项目成员的管理权限。<br/>'+
|
||||
'<strong>开发人员</strong>: “开发人员” 拥有一个项目的读/写权限。<br/>' +
|
||||
'<strong>来宾用户</strong>: “来宾用户”拥有特定项目的只读权限。',
|
||||
'inline_help_publicity_title': '<strong>公开项目</strong>',
|
||||
'inline_help_publicity': '设置该项目为公开。'
|
||||
};
|
@ -237,4 +237,7 @@
|
||||
<script src="/static/resources/js/components/top-repository/top-repository.directive.js"></script>
|
||||
|
||||
<script src="/static/resources/js/components/loading-progress/loading-progress.module.js"></script>
|
||||
<script src="/static/resources/js/components/loading-progress/loading-progress.directive.js"></script>
|
||||
<script src="/static/resources/js/components/loading-progress/loading-progress.directive.js"></script>
|
||||
|
||||
<script src="/static/resources/js/components/inline-help/inline-help.module.js"></script>
|
||||
<script src="/static/resources/js/components/inline-help/inline-help.directive.js"></script>
|
Loading…
Reference in New Issue
Block a user