diff --git a/static/resources/js/components/repository/popup-details.directive.js b/static/resources/js/components/repository/popup-details.directive.js index 88e0cf9f1..6aff8ad84 100644 --- a/static/resources/js/components/repository/popup-details.directive.js +++ b/static/resources/js/components/repository/popup-details.directive.js @@ -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 = '
' + '
' + '' + - '

' + + '

' + '
' + - '

' + + '

' + '
' + - '

' + ctrl.manifest['created'] + '

' + + '

' + check_output(ctrl.manifest['created']) + '

' + '
' + - '

' + ((!angular.isDefined(ctrl.manifest['author']) || ctrl.manifest['author'] === '') ? 'N/A' : ctrl.manifest['author']) + '

' + + '

' + check_output(ctrl.manifest['author']) + '

' + '
' + - '

' + ((!angular.isDefined(ctrl.manifest['architecture']) || ctrl.manifest['architecture'] === '') ? 'N/A' : ctrl.manifest['architecture']) + '

' + + '

' + check_output(ctrl.manifest['architecture']) + '

' + '
' + - '

' + ((!angular.isDefined(ctrl.manifest['docker_version']) || ctrl.manifest['docker_version'] === '') ? 'N/A' : ctrl.manifest['docker_version']) + '

' + + '

' + check_output(ctrl.manifest['docker_version']) + '

' + '
' + - '

' + ((!angular.isDefined(ctrl.manifest['os']) || ctrl.manifest['os'] === '') ? 'N/A' : ctrl.manifest['os']) + '

' + + '

' + check_output(ctrl.manifest['os']) + '

' + '
'; return content; } + function check_output(s) { + return (angular.isUndefined(s) || s === '') ? 'N/A' : s; + } } } diff --git a/static/resources/js/harbor.config.js b/static/resources/js/harbor.config.js index 35770f15e..fb919b29e 100644 --- a/static/resources/js/harbor.config.js +++ b/static/resources/js/harbor.config.js @@ -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; } diff --git a/views/search.htm b/views/search.htm index 7676c4b4e..3daa16970 100644 --- a/views/search.htm +++ b/views/search.htm @@ -23,13 +23,13 @@