keys ui WIP
This commit is contained in:
parent
dc593c0197
commit
11ff3e9b59
25 changed files with 1154 additions and 74 deletions
|
@ -25,6 +25,34 @@ angular.module('quay').factory('StringBuilderService', ['$sce', 'UtilService', f
|
|||
'client_id': 'chain'
|
||||
};
|
||||
|
||||
var filters = {
|
||||
'obj': function(value) {
|
||||
if (!value) { return []; }
|
||||
return Object.getOwnPropertyNames(value);
|
||||
},
|
||||
|
||||
'updated_tags': function(value) {
|
||||
if (!value) { return []; }
|
||||
return Object.getOwnPropertyNames(value);
|
||||
},
|
||||
|
||||
'kid': function(kid, metadata) {
|
||||
if (metadata.name) {
|
||||
return metadata.name;
|
||||
}
|
||||
|
||||
return metadata.kid.substr(0, 12);
|
||||
},
|
||||
|
||||
'expiration_date': function(value) {
|
||||
return moment.unix(value).format('LLL');
|
||||
},
|
||||
|
||||
'old_expiration_date': function(value) {
|
||||
return moment.unix(value).format('LLL');
|
||||
}
|
||||
};
|
||||
|
||||
stringBuilderService.buildUrl = function(value_or_func, metadata) {
|
||||
var url = value_or_func;
|
||||
if (typeof url != 'string') {
|
||||
|
@ -105,18 +133,6 @@ angular.module('quay').factory('StringBuilderService', ['$sce', 'UtilService', f
|
|||
}
|
||||
|
||||
stringBuilderService.buildString = function(value_or_func, metadata, opt_codetag) {
|
||||
var filters = {
|
||||
'obj': function(value) {
|
||||
if (!value) { return []; }
|
||||
return Object.getOwnPropertyNames(value);
|
||||
},
|
||||
|
||||
'updated_tags': function(value) {
|
||||
if (!value) { return []; }
|
||||
return Object.getOwnPropertyNames(value);
|
||||
}
|
||||
};
|
||||
|
||||
var description = value_or_func;
|
||||
if (typeof description != 'string') {
|
||||
description = description(metadata);
|
||||
|
@ -126,7 +142,7 @@ angular.module('quay').factory('StringBuilderService', ['$sce', 'UtilService', f
|
|||
if (metadata.hasOwnProperty(key)) {
|
||||
var value = metadata[key] != null ? metadata[key] : '(Unknown)';
|
||||
if (filters[key]) {
|
||||
value = filters[key](value);
|
||||
value = filters[key](value, metadata);
|
||||
}
|
||||
|
||||
description = stringBuilderService.replaceField(description, '', key, value, opt_codetag);
|
||||
|
|
Reference in a new issue