mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-27 04:35:16 +01:00
updates for pull-command and popover-details of UI.
This commit is contained in:
parent
ce2454472b
commit
c0f16a620b
@ -58,7 +58,7 @@
|
||||
|
||||
if($routeParams.project_id){
|
||||
angular.forEach(vm.projects, function(value, index) {
|
||||
if(value['ProjectId'] === $routeParams.project_id) {
|
||||
if(value['ProjectId'] === Number($routeParams.project_id)) {
|
||||
vm.selectedProject = value;
|
||||
}
|
||||
});
|
||||
@ -123,13 +123,12 @@
|
||||
|
||||
function link(scope, element, attrs, ctrl) {
|
||||
$(document).on('click', clickHandler);
|
||||
|
||||
|
||||
function clickHandler(e) {
|
||||
var target = $(e.target).parent();
|
||||
$('[data-toggle="popover"]').each(function () {
|
||||
$('[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) {
|
||||
if (!$(this).is(e.target) && $(this).has(e.target).length === 0 && $('.popover').has(e.target).length === 0) {
|
||||
$(this).parent().popover('hide');
|
||||
}
|
||||
});
|
||||
|
@ -1,4 +1,4 @@
|
||||
<a href="javascript:void(0)" role="button" data-trigger="click" data-toggle="popover" data-placement="right" disabled>
|
||||
<span class="glyphicon glyphicon-info-sign" >
|
||||
<a href="javascript:void(0)" >
|
||||
<span class="glyphicon glyphicon-info-sign" role="button" data-trigger="click" data-toggle="popover" data-placement="right">
|
||||
</span>
|
||||
</a>
|
||||
|
@ -39,6 +39,7 @@
|
||||
'tag': '@',
|
||||
'index': '@'
|
||||
},
|
||||
'replace': true,
|
||||
'link': link,
|
||||
'controller': PopupDetailsController,
|
||||
'controllerAs': 'vm',
|
||||
@ -48,9 +49,9 @@
|
||||
|
||||
function link(scope, element, attrs, ctrl) {
|
||||
ctrl.retrieve();
|
||||
|
||||
scope.$watch('vm.manifest', function(current) {
|
||||
if(current) {
|
||||
|
||||
element
|
||||
.popover({
|
||||
'template': '<div class="popover" role="tooltip"><div class="arrow"></div><div class="popover-title"></div><div class="popover-content"></div></div>',
|
||||
@ -58,15 +59,16 @@
|
||||
'content': generateContent,
|
||||
'html': true
|
||||
})
|
||||
.on('shown.bs.popover', function(e){
|
||||
$('[type="text"]:input', element.parent())
|
||||
.on('shown.bs.popover', function(e){
|
||||
var self = jQuery(this);
|
||||
$('[type="text"]:input', self.parent())
|
||||
.select()
|
||||
.end()
|
||||
.on('click', function() {
|
||||
$(this).select();
|
||||
});
|
||||
element.parent().find('.glyphicon.glyphicon-remove-circle').on('click', function() {
|
||||
element.trigger('click');
|
||||
self.parent().find('.glyphicon.glyphicon-remove-circle').on('click', function() {
|
||||
element.trigger('click');
|
||||
});
|
||||
});
|
||||
}
|
||||
|
@ -1,9 +1,9 @@
|
||||
<form class="form-inline">
|
||||
<div class="form-group">
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control" id="//vm.repoName//-//vm.tag//" value="docker pull //vm.harborRegUrl////vm.repoName//://vm.tag//" readonly="readonly" size="60">
|
||||
<input type="text" class="form-control" value="docker pull //vm.harborRegUrl////vm.repoName//://vm.tag//" readonly="readonly" size="60">
|
||||
<div class="input-group-addon">
|
||||
<a href="javascript:void(0);" data-clipboard-target="//vm.repoName//-//vm.tag//"><span class="glyphicon glyphicon-duplicate" data-toggle="tooltip" data-placement="right" title="Copied!"></span></a>
|
||||
<a href="javascript:void(0);"><span class="glyphicon glyphicon-duplicate"></span></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -29,26 +29,10 @@
|
||||
|
||||
ctrl.harborRegUrl = $('#HarborRegUrl').val() + '/';
|
||||
|
||||
ZeroClipboard.config( { swfPath: "/static/ng/vendors/zc/v2.2.0/ZeroClipboard.swf" } );
|
||||
var clip = new ZeroClipboard(element.find('a'));
|
||||
element.find('span').tooltip({'trigger': 'click'});
|
||||
|
||||
clip.on("ready", function() {
|
||||
console.log("Flash movie loaded and ready.");
|
||||
this.on("aftercopy", function(event) {
|
||||
console.log("Copied text to clipboard: " + event.data["text/plain"]);
|
||||
element.find('span').tooltip('show');
|
||||
setTimeout(function(){
|
||||
element.find('span').tooltip('hide');
|
||||
}, 1000);
|
||||
});
|
||||
});
|
||||
|
||||
clip.on("error", function(event) {
|
||||
console.log('error[name="' + event.name + '"]: ' + event.message);
|
||||
ZeroClipboard.destroy();
|
||||
element.find('span').tooltip('destroy');
|
||||
});
|
||||
element.find('a').on('click', clickHandler);
|
||||
function clickHandler(e) {
|
||||
element.find('input[type="text"]').select();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
2610
static/ng/vendors/zc/v2.2.0/ZeroClipboard.js
vendored
2610
static/ng/vendors/zc/v2.2.0/ZeroClipboard.js
vendored
File diff suppressed because it is too large
Load Diff
BIN
static/ng/vendors/zc/v2.2.0/ZeroClipboard.swf
vendored
BIN
static/ng/vendors/zc/v2.2.0/ZeroClipboard.swf
vendored
Binary file not shown.
@ -10,7 +10,6 @@
|
||||
<link rel="stylesheet" href="/static/ng/vendors/eonasdan-bootstrap-datetimepicker/build/css/bootstrap-datetimepicker.min.css" />
|
||||
<script src="/static/ng/vendors/spinner/spinner.min.js"></script>
|
||||
|
||||
<script src="/static/ng/vendors/zc/v2.2.0/ZeroClipboard.js"></script>
|
||||
|
||||
<!-- Latest compiled and minified CSS -->
|
||||
<!--link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous"-->
|
||||
|
Loading…
Reference in New Issue
Block a user