[pve-devel] r6087 - in pve-manager/pve2/www/manager: . qemu

svn-commits at proxmox.com svn-commits at proxmox.com
Thu Jun 16 08:25:57 CEST 2011


Author: dietmar
Date: 2011-06-16 08:25:57 +0200 (Thu, 16 Jun 2011)
New Revision: 6087

Modified:
   pve-manager/pve2/www/manager/PVEUtils.js
   pve-manager/pve2/www/manager/qemu/HardwareView.js
Log:
improve data rendering


Modified: pve-manager/pve2/www/manager/PVEUtils.js
===================================================================
--- pve-manager/pve2/www/manager/PVEUtils.js	2011-06-15 12:45:45 UTC (rev 6086)
+++ pve-manager/pve2/www/manager/PVEUtils.js	2011-06-16 06:25:57 UTC (rev 6087)
@@ -58,6 +58,42 @@
 	    5: "notice",
 	    6: "info",
 	    7: "debug"
+	},
+
+	kvm_keymaps: {
+	    ar: 'Arabic',
+	    da: 'Danish',
+	    de: 'German', 
+	    'de-ch': 'German (Swiss)', 
+	    'en-gb': 'English (UK)', 
+	    'en-us': 'English (USA',
+	    es: 'Spanish',
+	    et: 'Estonia',
+	    fi: 'Finnish',
+	    fo: 'Faroe Islands', 
+	    fr: 'French', 
+	    'fr-be': 'French (Belgium)', 
+	    'fr-ca': 'French (Canada)',
+	    'fr-ch': 'French (Swiss)',
+	    hr: 'Croatia',
+	    hu: 'Hungarian',
+	    is: 'Icelandic',
+	    it: 'Italian', 
+	    ja: 'Japanese',
+	    lt: 'Lithuanian',
+	    lv: 'Latvian',
+	    mk: 'Macedonian', 
+	    nl: 'Dutch',
+	    'nl-be': 'Dutch (Belgium)',
+	    no: 'Norwegian', 
+	    pl: 'Polish',
+	    pt: 'Portuguese',
+	    'pt-br': 'Portuguese (Brazil)',
+	    ru: 'Russian',
+	    sl: 'Slovenian',
+	    sv: 'Swedish',
+	    th: 'Thai',
+	    tr: 'Turkish'
 	}
     },
 
@@ -341,6 +377,13 @@
 	return PVE.Utils.statics().log_severity_hash[value] || value;
     },
 
+    render_kvm_language: function (value) {
+	var text = PVE.Utils.statics().kvm_keymaps[value];
+	if (text) 
+	    return text + ' (' + value + ')';
+	return value;
+    },
+
     render_cpu: function(value, metaData, record, rowIndex, colIndex, store) {
 
 	var maxcpu = record.data.maxcpu;

Modified: pve-manager/pve2/www/manager/qemu/HardwareView.js
===================================================================
--- pve-manager/pve2/www/manager/qemu/HardwareView.js	2011-06-15 12:45:45 UTC (rev 6086)
+++ pve-manager/pve2/www/manager/qemu/HardwareView.js	2011-06-16 06:25:57 UTC (rev 6087)
@@ -44,14 +44,19 @@
 		tdCls: 'pve-itype-icon-processor',
 		defaultValue: 1,
 		renderer: function(value, metaData, record, rowIndex, colIndex, store) {
-		    var cores = (store.snapshot || store.data).get('cores');
-		    return cores ? value * cores.data.value : value;
+		    var rec = (store.snapshot || store.data).get('cores');
+		    if (!rec || (rec.data.value <= 1))
+			return value;
+
+		    var cores = rec.data.value;
+		    return (value*cores) + ' (' + value + ' x ' + cores + ' cores)';
 		}
 	    },
 	    keyboard: {
 		header: 'Keyboard',
 		tdCls: 'pve-itype-icon-keyboard',
-		defaultValue: 'default'
+		defaultValue: 'default',
+		renderer: PVE.Utils.render_kvm_language
 	    },
 	    vga: {
 		header: 'Display',



More information about the pve-devel mailing list