[pve-devel] [PATCH manager 5/5] highlight errors in grids

Dominik Csapak d.csapak at proxmox.com
Fri Apr 14 10:09:24 CEST 2017


we gave erroneous entries in grids the class .x-form-invalid-field
but since we changed to the "crisp" theme, this class did not have any
highlighting

so instead we use our own "pve-invalid-row" class
and give it a light red background

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 www/css/ext6-pve.css               | 4 ++++
 www/manager6/dc/Log.js             | 2 +-
 www/manager6/dc/Tasks.js           | 2 +-
 www/manager6/grid/FirewallRules.js | 2 +-
 www/manager6/ha/Resources.js       | 2 +-
 www/manager6/node/Tasks.js         | 2 +-
 www/manager6/panel/IPSet.js        | 2 +-
 7 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/www/css/ext6-pve.css b/www/css/ext6-pve.css
index f42e935e..b7dec986 100644
--- a/www/css/ext6-pve.css
+++ b/www/css/ext6-pve.css
@@ -517,3 +517,7 @@ table.osds td:first-of-type {
 .x-webkit :not(.x-form-textarea-body) > .x-form-trigger-wrap {
     height: initial;
 }
+
+.pve-invalid-row {
+    background-color: #f3d6d7;
+}
diff --git a/www/manager6/dc/Log.js b/www/manager6/dc/Log.js
index aa14331a..62370eca 100644
--- a/www/manager6/dc/Log.js
+++ b/www/manager6/dc/Log.js
@@ -36,7 +36,7 @@ Ext.define('PVE.dc.Log', {
 		    var pri = record.get('pri');
 
 		    if (pri && pri <= 3) {
-			return "x-form-invalid-field";
+			return "pve-invalid-row";
 		    }
 		}
 	    },
diff --git a/www/manager6/dc/Tasks.js b/www/manager6/dc/Tasks.js
index ad9a22ca..5d65bd2e 100644
--- a/www/manager6/dc/Tasks.js
+++ b/www/manager6/dc/Tasks.js
@@ -61,7 +61,7 @@ Ext.define('PVE.dc.Tasks', {
 		    var status = record.get('status');
 
 		    if (status && status != 'OK') {
-			return "x-form-invalid-field";
+			return "pve-invalid-row";
 		    }
 		}
 	    },
diff --git a/www/manager6/grid/FirewallRules.js b/www/manager6/grid/FirewallRules.js
index 92c3d350..2cd79ab7 100644
--- a/www/manager6/grid/FirewallRules.js
+++ b/www/manager6/grid/FirewallRules.js
@@ -629,7 +629,7 @@ Ext.define('PVE.FirewallRules', {
 	var render_errors = function(name, value, metaData, record) {
 	    var errors = record.data.errors;
 	    if (errors && errors[name]) {
-		metaData.tdCls = 'x-form-invalid-field';
+		metaData.tdCls = 'pve-invalid-row';
 		var html = '<p>' +  Ext.htmlEncode(errors[name]) + '</p>';
 		metaData.tdAttr = 'data-qwidth=600 data-qtitle="ERROR" data-qtip="' + 
 		    html.replace(/\"/g,'"') + '"';
diff --git a/www/manager6/ha/Resources.js b/www/manager6/ha/Resources.js
index 9f716eb3..a73a38ad 100644
--- a/www/manager6/ha/Resources.js
+++ b/www/manager6/ha/Resources.js
@@ -35,7 +35,7 @@ Ext.define('PVE.ha.ResourcesView', {
 	    if (errors) {
 		var msg = errors[dataIndex];
 		if (msg) {
-		    metaData.tdCls = 'x-form-invalid-field';
+		    metaData.tdCls = 'pve-invalid-row';
 		    var html = '<p>' +  Ext.htmlEncode(msg) + '</p>';
 		    metaData.tdAttr = 'data-qwidth=600 data-qtitle="ERROR" data-qtip="' + 
 			html.replace(/\"/g,'"') + '"';
diff --git a/www/manager6/node/Tasks.js b/www/manager6/node/Tasks.js
index b7c31346..7d3b0754 100644
--- a/www/manager6/node/Tasks.js
+++ b/www/manager6/node/Tasks.js
@@ -82,7 +82,7 @@ Ext.define('PVE.node.Tasks', {
 		    var status = record.get('status');
 
 		    if (status && status != 'OK') {
-			return "x-form-invalid-field";
+			return "pve-invalid-row";
 		    }
 		}
 	    },
diff --git a/www/manager6/panel/IPSet.js b/www/manager6/panel/IPSet.js
index beae5dc1..c020a2f3 100644
--- a/www/manager6/panel/IPSet.js
+++ b/www/manager6/panel/IPSet.js
@@ -372,7 +372,7 @@ Ext.define('PVE.IPSetGrid', {
 	    if (errors) {
 		var msg = errors.cidr || errors.nomatch;
 		if (msg) {
-		    metaData.tdCls = 'x-form-invalid-field';
+		    metaData.tdCls = 'pve-invalid-row';
 		    var html = '<p>' +  Ext.htmlEncode(msg) + '</p>';
 		    metaData.tdAttr = 'data-qwidth=600 data-qtitle="ERROR" data-qtip="' + 
 			html.replace(/\"/g,'"') + '"';
-- 
2.11.0





More information about the pve-devel mailing list