mirror of
https://github.com/goharbor/harbor.git
synced 2025-02-01 20:41:22 +01:00
Update for some refinements in session checking of UI.
This commit is contained in:
parent
198d1ffdb5
commit
2ebc518556
@ -62,7 +62,8 @@
|
||||
console.log('Failed to get manifest of repo :' + ctrl.repoName);
|
||||
return null;
|
||||
});
|
||||
if(data) {
|
||||
ctrl.manifest = {};
|
||||
if(data && angular.isDefined(data.responseJSON)) {
|
||||
ctrl.manifest = angular.fromJson(data.responseJSON.manifest.history[0].v1Compatibility);
|
||||
ctrl.manifest['created'] = $filter('dateL')(ctrl.manifest['created'], 'YYYY-MM-DD HH:mm:ss');
|
||||
}
|
||||
@ -82,22 +83,25 @@
|
||||
var content = '<form class="form-horizontal" width="100%">' +
|
||||
'<div class="form-group">' +
|
||||
'<label class="col-sm-3 control-label">Id</label>' +
|
||||
'<div class="col-sm-9"><p class="form-control-static long-line long-line-margin-right"><input type="text" id="txtImageId" value="' + ctrl.manifest['id'] + '" readonly size="32"></p></div></div>' +
|
||||
'<div class="col-sm-9"><p class="form-control-static long-line long-line-margin-right"><input type="text" id="txtImageId" value="' + check_output(ctrl.manifest['id']) + '" readonly size="32"></p></div></div>' +
|
||||
'<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 long-line-margin-right"><input type="text" id="txtImageId" value="' + ctrl.manifest['parent'] + '" readonly size="32"></p></div></div>' +
|
||||
'<div class="col-sm-9"><p class="form-control-static long-line long-line-margin-right"><input type="text" id="txtImageId" value="' + check_output(ctrl.manifest['parent']) + '" readonly size="32"></p></div></div>' +
|
||||
'<div class="form-group"><label class="col-sm-3 control-label">Created</label>' +
|
||||
'<div class="col-sm-9"><p class="form-control-static long-line-margin-right">' + ctrl.manifest['created'] + '</p></div></div>' +
|
||||
'<div class="col-sm-9"><p class="form-control-static long-line-margin-right">' + check_output(ctrl.manifest['created']) + '</p></div></div>' +
|
||||
'<div class="form-group"><label class="col-sm-3 control-label">Author</label>' +
|
||||
'<div class="col-sm-9"><p class="form-control-static long-line-margin-right">' + ((!angular.isDefined(ctrl.manifest['author']) || ctrl.manifest['author'] === '') ? 'N/A' : ctrl.manifest['author']) + '</p></div></div>' +
|
||||
'<div class="col-sm-9"><p class="form-control-static long-line-margin-right">' + check_output(ctrl.manifest['author']) + '</p></div></div>' +
|
||||
'<div class="form-group"><label class="col-sm-3 control-label">Architecture</label>' +
|
||||
'<div class="col-sm-9"><p class="form-control-static long-line-margin-right">' + ((!angular.isDefined(ctrl.manifest['architecture']) || ctrl.manifest['architecture'] === '') ? 'N/A' : ctrl.manifest['architecture']) + '</p></div></div>' +
|
||||
'<div class="col-sm-9"><p class="form-control-static long-line-margin-right">' + check_output(ctrl.manifest['architecture']) + '</p></div></div>' +
|
||||
'<div class="form-group"><label class="col-sm-3 control-label">Docker Version</label>' +
|
||||
'<div class="col-sm-9"><p class="form-control-static long-line-margin-right">' + ((!angular.isDefined(ctrl.manifest['docker_version']) || ctrl.manifest['docker_version'] === '') ? 'N/A' : ctrl.manifest['docker_version']) + '</p></div></div>' +
|
||||
'<div class="col-sm-9"><p class="form-control-static long-line-margin-right">' + check_output(ctrl.manifest['docker_version']) + '</p></div></div>' +
|
||||
'<div class="form-group"><label class="col-sm-3 control-label">OS</label>' +
|
||||
'<div class="col-sm-9"><p class="form-control-static long-line-margin-right">' + ((!angular.isDefined(ctrl.manifest['os']) || ctrl.manifest['os'] === '') ? 'N/A' : ctrl.manifest['os']) + '</p></div></div>' +
|
||||
'<div class="col-sm-9"><p class="form-control-static long-line-margin-right">' + check_output(ctrl.manifest['os']) + '</p></div></div>' +
|
||||
'</form>';
|
||||
return content;
|
||||
}
|
||||
function check_output(s) {
|
||||
return (angular.isUndefined(s) || s === '') ? 'N/A' : s;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -50,27 +50,15 @@
|
||||
var url = rejection.config.url;
|
||||
console.log('url:' + url);
|
||||
var exclusion = [
|
||||
'/',
|
||||
'/login',
|
||||
'/search',
|
||||
'/reset_password',
|
||||
'/sign_up',
|
||||
'/forgot_password',
|
||||
'/api/targets/ping',
|
||||
'/api/users/current',
|
||||
'/api/repositories',
|
||||
/^\/login$/,
|
||||
/^\/api\/targets\/ping$/,
|
||||
/^\/api\/users\/current$/,
|
||||
/^\/api\/repositories$/,
|
||||
/^\/api\/projects\/[0-9]+\/members\/current$/
|
||||
];
|
||||
var isExcluded = false;
|
||||
for(var i in exclusion) {
|
||||
switch(typeof(exclusion[i])) {
|
||||
case 'string':
|
||||
isExcluded = (exclusion[i] === url);
|
||||
break;
|
||||
case 'object':
|
||||
isExcluded = exclusion[i].test(url);
|
||||
break;
|
||||
}
|
||||
isExcluded = exclusion[i].test(url);
|
||||
if(isExcluded) {
|
||||
break;
|
||||
}
|
||||
|
@ -23,13 +23,13 @@
|
||||
<h4 class="page-header title-color underlined">// 'projects' | tr // <span class="badge">//vm.project.length//</span></h4>
|
||||
<div class="search-result">
|
||||
<ul>
|
||||
<li ng-repeat="p in vm.project"><a href="/repository#/repositories?project_id=//p.id//&is_public=//p.public === 1//">//p.name//</a></li>
|
||||
<li ng-repeat="p in vm.project"><a href="/repository#/repositories?project_id=//p.id//&is_public=//p.public//">//p.name//</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<h4 class="page-header title-color underlined">// 'repositories' | tr // <span class="badge">//vm.repository.length//</span></h4>
|
||||
<div class="search-result">
|
||||
<ul>
|
||||
<li ng-repeat="r in vm.repository"><a href="/repository#/repositories?project_id=//r.project_id//&is_public=//r.project_public === 1//#//r.repository_name//">//r.repository_name//</a></li>
|
||||
<li ng-repeat="r in vm.repository"><a href="/repository#/repositories?project_id=//r.project_id//&is_public=//r.project_public//#//r.repository_name//">//r.repository_name//</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user