mirror of
https://github.com/goharbor/harbor.git
synced 2025-02-21 14:21:36 +01:00
updates for popup-details feature of UI.
This commit is contained in:
parent
2bf1742ecb
commit
d3a7beb0ba
@ -108,4 +108,23 @@
|
|||||||
|
|
||||||
.popover{
|
.popover{
|
||||||
max-width: 500px;
|
max-width: 500px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.popover-header {
|
||||||
|
padding:8px 14px;
|
||||||
|
background-color:#f7f7f7;
|
||||||
|
border-bottom:1px solid #ebebeb;
|
||||||
|
-webkit-border-radius:5px 5px 0 0;
|
||||||
|
-moz-border-radius:5px 5px 0 0;
|
||||||
|
border-radius:5px 5px 0 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.popover-title {
|
||||||
|
height: 2.5em;
|
||||||
|
padding: 8px 14px;
|
||||||
|
margin: 0;
|
||||||
|
font-size: 14px;
|
||||||
|
background-color: #f7f7f7;
|
||||||
|
border-bottom: 1px solid #ebebeb;
|
||||||
|
border-radius: 5px 5px 0 0;
|
||||||
|
}
|
||||||
|
@ -125,6 +125,14 @@
|
|||||||
$(document).on('click', clickHandler);
|
$(document).on('click', clickHandler);
|
||||||
|
|
||||||
function clickHandler(e) {
|
function clickHandler(e) {
|
||||||
|
var target = $(e.target).parent();
|
||||||
|
$('[data-toggle="popover"]').each(function () {
|
||||||
|
//the 'is' for buttons that trigger popups
|
||||||
|
//the 'has' for icons within a button that triggers a popup
|
||||||
|
if (!$(this).is(target) && $(this).has(target).length === 0 && $('.popover').has(target).length === 0) {
|
||||||
|
$(this).parent().popover('hide');
|
||||||
|
}
|
||||||
|
});
|
||||||
var targetId = $(e.target).attr('id');
|
var targetId = $(e.target).attr('id');
|
||||||
if(targetId === 'switchPane' ||
|
if(targetId === 'switchPane' ||
|
||||||
targetId === 'retrievePane' ||
|
targetId === 'retrievePane' ||
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
<tbody>
|
<tbody>
|
||||||
<tr ng-repeat="tag in vm.tags">
|
<tr ng-repeat="tag in vm.tags">
|
||||||
<td>//tag//</td>
|
<td>//tag//</td>
|
||||||
<td style="text-align: center;"><popup-details repo-name="//vm.repoName//" tag="//tag//"></popup-details></td>
|
<td style="text-align: center;"><popup-details repo-name="//vm.repoName//" tag="//tag//" index="//$index//"></popup-details></td>
|
||||||
<td>
|
<td>
|
||||||
<pull-command repo-name="//vm.repoName//" tag="//tag//"></pull-command>
|
<pull-command repo-name="//vm.repoName//" tag="//tag//"></pull-command>
|
||||||
</td>
|
</td>
|
||||||
|
@ -61,11 +61,18 @@
|
|||||||
'repoName': '='
|
'repoName': '='
|
||||||
},
|
},
|
||||||
'replace': true,
|
'replace': true,
|
||||||
|
'link': link,
|
||||||
'controller': ListTagController,
|
'controller': ListTagController,
|
||||||
'controllerAs': 'vm',
|
'controllerAs': 'vm',
|
||||||
'bindToController': true
|
'bindToController': true
|
||||||
};
|
};
|
||||||
return directive;
|
return directive;
|
||||||
|
|
||||||
|
function link(scope, element, attrs, ctrl) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
})();
|
})();
|
@ -1,4 +1,4 @@
|
|||||||
<a href="javascript:void(0);">
|
<a href="javascript:void(0)" role="button" data-trigger="click" data-toggle="popover" data-placement="right" disabled>
|
||||||
<span tabindex="0" class="glyphicon glyphicon-info-sign" role="button" data-trigger="focus" data-toggle="popover" data-placement="right">
|
<span class="glyphicon glyphicon-info-sign" >
|
||||||
</span>
|
</span>
|
||||||
</a>
|
</a>
|
||||||
|
@ -10,8 +10,9 @@
|
|||||||
|
|
||||||
function PopupDetailsController(ListManifestService, $filter, dateLFilter) {
|
function PopupDetailsController(ListManifestService, $filter, dateLFilter) {
|
||||||
var vm = this;
|
var vm = this;
|
||||||
|
|
||||||
vm.retrieve = retrieve;
|
vm.retrieve = retrieve;
|
||||||
|
|
||||||
function retrieve() {
|
function retrieve() {
|
||||||
ListManifestService(vm.repoName, vm.tag)
|
ListManifestService(vm.repoName, vm.tag)
|
||||||
.success(getManifestSuccess)
|
.success(getManifestSuccess)
|
||||||
@ -35,7 +36,8 @@
|
|||||||
'templateUrl': '/static/ng/resources/js/components/repository/popup-details.directive.html',
|
'templateUrl': '/static/ng/resources/js/components/repository/popup-details.directive.html',
|
||||||
'scope': {
|
'scope': {
|
||||||
'repoName': '@',
|
'repoName': '@',
|
||||||
'tag': '@'
|
'tag': '@',
|
||||||
|
'index': '@'
|
||||||
},
|
},
|
||||||
'link': link,
|
'link': link,
|
||||||
'controller': PopupDetailsController,
|
'controller': PopupDetailsController,
|
||||||
@ -46,21 +48,34 @@
|
|||||||
|
|
||||||
function link(scope, element, attrs, ctrl) {
|
function link(scope, element, attrs, ctrl) {
|
||||||
ctrl.retrieve();
|
ctrl.retrieve();
|
||||||
scope.$watch('vm.manifest', function(current, origin) {
|
|
||||||
|
scope.$watch('vm.manifest', function(current) {
|
||||||
if(current) {
|
if(current) {
|
||||||
element.find('span').popover({
|
element
|
||||||
'content': generateContent,
|
.popover({
|
||||||
'html': true
|
'template': '<div class="popover" role="tooltip"><div class="arrow"></div><div class="popover-title"></div><div class="popover-content"></div></div>',
|
||||||
});
|
'title': '<div class="pull-right clearfix"><a href="javascript:void(0);"><span class="glyphicon glyphicon-remove-circle"></span></a></div>',
|
||||||
|
'content': generateContent,
|
||||||
|
'html': true
|
||||||
|
})
|
||||||
|
.on('shown.bs.popover', function(e){
|
||||||
|
$('[type="text"]:input', element.parent())
|
||||||
|
.select()
|
||||||
|
.end()
|
||||||
|
.on('click', function() {
|
||||||
|
$(this).select();
|
||||||
|
});
|
||||||
|
element.parent().find('.glyphicon.glyphicon-remove-circle').on('click', function() {
|
||||||
|
element.trigger('click');
|
||||||
|
});
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
function generateContent() {
|
function generateContent() {
|
||||||
var content =
|
var content = '<form class="form-horizontal">' +
|
||||||
'<form class="form-horizontal">' +
|
|
||||||
'<div class="form-group">' +
|
'<div class="form-group">' +
|
||||||
'<label class="col-sm-3 control-label">Id</label>' +
|
'<label class="col-sm-3 control-label">Id</label>' +
|
||||||
'<div class="col-sm-9"><p class="form-control-static long-line">' + ctrl.manifest['Id'] + '</p></div></div>' +
|
'<div class="col-sm-9"><p class="form-control-static long-line"><input type="text" id="txtImageId" value="' + ctrl.manifest['Id'] + '" readonly size="40"></p></div></div>' +
|
||||||
'<div class="form-group"><label class="col-sm-3 control-label">Parent</label>' +
|
'<div class="form-group"><label class="col-sm-3 control-label">Parent</label>' +
|
||||||
'<div class="col-sm-9"><p class="form-control-static long-line">' + ctrl.manifest['Parent'] + '</p></div></div>' +
|
'<div class="col-sm-9"><p class="form-control-static long-line">' + ctrl.manifest['Parent'] + '</p></div></div>' +
|
||||||
'<div class="form-group"><label class="col-sm-3 control-label">Created</label>' +
|
'<div class="form-group"><label class="col-sm-3 control-label">Created</label>' +
|
||||||
|
Loading…
Reference in New Issue
Block a user