[pve-devel] [PATCH manager 1/2] Add new renderer function for toggling enabled/disabled options

Emmanuel Kasper e.kasper at proxmox.com
Mon Jan 23 15:24:32 CET 2017


---
 www/manager6/Utils.js | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/www/manager6/Utils.js b/www/manager6/Utils.js
index 40d2fe1..c05a137 100644
--- a/www/manager6/Utils.js
+++ b/www/manager6/Utils.js
@@ -745,6 +745,8 @@ Ext.define('PVE.Utils', { utilities: {
 
     yesText: gettext('Yes'),
     noText: gettext('No'),
+    enabledText: gettext('Enabled'),
+    disabledText: gettext('Disabled'),
     noneText: gettext('none'),
     errorText: gettext('Error'),
     unknownText: gettext('Unknown'),
@@ -817,6 +819,10 @@ Ext.define('PVE.Utils', { utilities: {
 	return !value ? PVE.Utils.yesText : PVE.Utils.noText;
     },
 
+    format_enabled_toggle: function(value) {
+	return value ? PVE.Utils.enabledText :PVE.Utils.disabledText;
+    },
+
     format_ha: function(value) {
 	var text = PVE.Utils.format_boolean(value.managed);
 
-- 
2.1.4





More information about the pve-devel mailing list