[pve-devel] [PATCH manager v2] replication; merge status and status text and add to dc mode

Thomas Lamprecht t.lamprecht at proxmox.com
Thu Jun 29 11:22:53 CEST 2017


It was a bit strange to have two separate status columns, which do
effectively the same thing. So merge them together to save a bit
space and have less columns.

We do not need to translate 'Status Text' as a nice side effect.

Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
---

changes since v1:
* we cannot show this as is in the datacenter panel, as we do not have all
  information available there.

 www/manager6/grid/Replication.js | 38 ++++++++++----------------------------
 1 file changed, 10 insertions(+), 28 deletions(-)

diff --git a/www/manager6/grid/Replication.js b/www/manager6/grid/Replication.js
index 682da659..387d32c2 100644
--- a/www/manager6/grid/Replication.js
+++ b/www/manager6/grid/Replication.js
@@ -347,7 +347,8 @@ Ext.define('PVE.grid.ReplicaView', {
 		{
 		    text: gettext('Status'),
 		    dataIndex: 'state',
-		    width: 60,
+		    minWidth: 160,
+		    flex: 1,
 		    renderer: function(value, metadata, record) {
 
 			if (record.data.pid) {
@@ -355,46 +356,27 @@ Ext.define('PVE.grid.ReplicaView', {
 			    return '';
 			}
 
+			var icons = [];
 			var states = [];
 
 			if (record.data.remove_job) {
-			    states.push('<i class="fa fa-ban warning" title="'
+			    icons.push('<i class="fa fa-ban warning" title="'
 					+ gettext("Removal Scheduled") + '"></i>');
-			}
-
-			if (record.data.error) {
-			    states.push('<i class="fa fa-times critical" title="'
-					+ gettext("Error") + '"></i>');
-			}
-
-			if (states.length > 0) {
-			    return states.join(',');
-			}
-
-			return '<i class="fa fa-check good"></i>';
-		    }
-		},
-		{
-		    text: gettext('Status Text'),
-		    dataIndex: 'error',
-		    minWidth: 100,
-		    flex: 1,
-		    renderer: function(value, metadata, record) {
-			var states = [];
-
-			if (record.data.remove_job) {
 			    states.push(gettext("Removal Scheduled"));
 			}
 
 			if (record.data.error) {
+			    icons.push('<i class="fa fa-times critical" title="'
+					+ gettext("Error") + '"></i>');
 			    states.push(record.data.error);
 			}
 
-			if (states.length > 0) {
-			    return states.join(', ');
+			if (icons.length == 0) {
+			    icons.push('<i class="fa fa-check good"></i>');
+			    states.push(gettext('OK'));
 			}
 
-			return gettext('OK');
+			return icons.join(',') + ' ' + states.join(',');
 		    }
 		},
 		{
-- 
2.11.0





More information about the pve-devel mailing list