Commit ab3b37d8 authored by Dietmar Maurer's avatar Dietmar Maurer

do not use gettext() inside render functions

For performance reasons.
parent 85167ea8
...@@ -10,10 +10,13 @@ Ext.define('PVE.node.StatusView', { ...@@ -10,10 +10,13 @@ Ext.define('PVE.node.StatusView', {
throw "no node name specified"; throw "no node name specified";
} }
var socketText = gettext('Socket');
var socketsText = gettext('Sockets');
var render_cpuinfo = function(value) { var render_cpuinfo = function(value) {
return value.cpus + " x " + value.model + " (" + return value.cpus + " x " + value.model + " (" +
value.sockets.toString() + " " + value.sockets.toString() + " " +
(value.sockets > 1 ? gettext('Sockets') : gettext('Socket')) + ")"; (value.sockets > 1 ? socketsText : socketText) + ")";
}; };
var render_loadavg = function(value) { var render_loadavg = function(value) {
...@@ -29,10 +32,13 @@ Ext.define('PVE.node.StatusView', { ...@@ -29,10 +32,13 @@ Ext.define('PVE.node.StatusView', {
return PVE.Utils.format_size(value.shared); return PVE.Utils.format_size(value.shared);
}; };
var totalText = gettext('Total');
var usedText = gettext('Used');
var render_meminfo = function(value) { var render_meminfo = function(value) {
var per = (value.used / value.total)*100; var per = (value.used / value.total)*100;
var text = "<div>" + gettext('Total') + ": " + PVE.Utils.format_size(value.total) + "</div>" + var text = "<div>" + totalText + ": " + PVE.Utils.format_size(value.total) + "</div>" +
"<div>" + gettext('Used') + ": " + PVE.Utils.format_size(value.used) + "</div>"; "<div>" + usedText + ": " + PVE.Utils.format_size(value.used) + "</div>";
return text; return text;
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment