mirror of
https://git.proxmox.com/git/pve-manager
synced 2025-08-14 06:42:26 +00:00
add render functions for Certificates
this adds render_optional_url for a field which may contain a link and render_san which simply displays the different values in each line Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
parent
57a9d4cb67
commit
27809975f2
@ -721,6 +721,27 @@ Ext.define('PVE.Utils', { utilities: {
|
||||
return PVE.Utils.render_size_usage(record.used, record.total);
|
||||
},
|
||||
|
||||
render_optional_url: function(value) {
|
||||
var match;
|
||||
if (value && (match = value.match(/^https?:\/\//)) !== null) {
|
||||
return '<a href="' + value + '">' + value + '</a>';
|
||||
}
|
||||
return value;
|
||||
},
|
||||
|
||||
render_san: function(value) {
|
||||
var names = [];
|
||||
if (Ext.isArray(value)) {
|
||||
value.forEach(function(val) {
|
||||
if (!Ext.isNumber(val)) {
|
||||
names.push(val);
|
||||
}
|
||||
});
|
||||
return names.join('<br>');
|
||||
}
|
||||
return value;
|
||||
},
|
||||
|
||||
windowHostname: function() {
|
||||
return window.location.hostname.replace(Proxmox.Utils.IP6_bracket_match,
|
||||
function(m, addr, offset, original) { return addr; });
|
||||
|
Loading…
Reference in New Issue
Block a user