mirror of
https://git.proxmox.com/git/proxmox-widget-toolkit
synced 2025-05-12 01:42:09 +00:00
new helper format_subscription_level
This commit is contained in:
parent
c3457485e6
commit
02ef30c91f
19
Utils.js
19
Utils.js
@ -60,6 +60,11 @@ Ext.define('Proxmox.Utils', { utilities: {
|
|||||||
stateText: gettext('State'),
|
stateText: gettext('State'),
|
||||||
groupText: gettext('Group'),
|
groupText: gettext('Group'),
|
||||||
|
|
||||||
|
communityText: gettext('Community'),
|
||||||
|
basicText: gettext('Basic'),
|
||||||
|
standardText: gettext('Standard'),
|
||||||
|
premiumText: gettext('Premium'),
|
||||||
|
|
||||||
getNoSubKeyHtml: function(url) {
|
getNoSubKeyHtml: function(url) {
|
||||||
// url http://www.proxmox.com/products/proxmox-ve/subscription-service-plans
|
// url http://www.proxmox.com/products/proxmox-ve/subscription-service-plans
|
||||||
return Ext.String.format('You do not have a valid subscription for this server. Please visit <a target="_blank" href="{0}">www.proxmox.com</a> to get a list of available options.', url || 'http://www.proxmox.com');
|
return Ext.String.format('You do not have a valid subscription for this server. Please visit <a target="_blank" href="{0}">www.proxmox.com</a> to get a list of available options.', url || 'http://www.proxmox.com');
|
||||||
@ -136,6 +141,20 @@ Ext.define('Proxmox.Utils', { utilities: {
|
|||||||
return days.toFixed(0) + 'd';
|
return days.toFixed(0) + 'd';
|
||||||
},
|
},
|
||||||
|
|
||||||
|
format_subscription_level: function(level) {
|
||||||
|
if (level === 'c') {
|
||||||
|
return Proxmox.Utils.communityText;
|
||||||
|
} else if (level === 'b') {
|
||||||
|
return Proxmox.Utils.basicText;
|
||||||
|
} else if (level === 's') {
|
||||||
|
return Proxmox.Utils.standardText;
|
||||||
|
} else if (level === 'p') {
|
||||||
|
return Proxmox.Utils.premiumText;
|
||||||
|
} else {
|
||||||
|
return Proxmox.Utils.noneText;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
compute_min_label_width: function(text, width) {
|
compute_min_label_width: function(text, width) {
|
||||||
|
|
||||||
if (width === undefined) { width = 100; }
|
if (width === undefined) { width = 100; }
|
||||||
|
Loading…
Reference in New Issue
Block a user