public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH manager 0/3] some small ui fixes
@ 2021-05-20 14:59 Dominik Csapak
  2021-05-20 14:59 ` [pve-devel] [PATCH manager 1/3] ui: Parser: fix bind and dev mounts for lxc Dominik Csapak
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Dominik Csapak @ 2021-05-20 14:59 UTC (permalink / raw)
  To: pve-devel

some small ui fixes that popped up during testing with extjs 7.0, but
that have nothing to do with that

Dominik Csapak (3):
  ui: Parser: fix bind and dev mounts for lxc
  ui: dc/RoleView: add variableRowHeight
  ui: ResourceGrid: correctly remove ResourceStore listener

 www/manager6/Parser.js            | 6 +++---
 www/manager6/dc/RoleView.js       | 1 +
 www/manager6/grid/ResourceGrid.js | 5 +----
 3 files changed, 5 insertions(+), 7 deletions(-)

-- 
2.20.1





^ permalink raw reply	[flat|nested] 5+ messages in thread

* [pve-devel] [PATCH manager 1/3] ui: Parser: fix bind and dev mounts for lxc
  2021-05-20 14:59 [pve-devel] [PATCH manager 0/3] some small ui fixes Dominik Csapak
@ 2021-05-20 14:59 ` Dominik Csapak
  2021-05-20 14:59 ` [pve-devel] [PATCH manager 2/3] ui: dc/RoleView: add variableRowHeight Dominik Csapak
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Dominik Csapak @ 2021-05-20 14:59 UTC (permalink / raw)
  To: pve-devel

match returns 'null' if the regex does not match, which is not
destructurable. so we have to save the match and check if it valid

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
 www/manager6/Parser.js | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/www/manager6/Parser.js b/www/manager6/Parser.js
index 1db82331..bb6a9a33 100644
--- a/www/manager6/Parser.js
+++ b/www/manager6/Parser.js
@@ -367,9 +367,9 @@ Ext.define('PVE.Parser', {
 	    return undefined;
 	}
 
-	const [, storage] = res.file.match(/^([a-z][a-z0-9\-_.]*[a-z0-9]):/i);
-	if (storage) {
-	    res.storage = storage;
+	const match = res.file.match(/^([a-z][a-z0-9\-_.]*[a-z0-9]):/i);
+	if (match) {
+	    res.storage = match[1];
 	    res.type = 'volume';
 	} else if (res.file.match(/^\/dev\//)) {
 	    res.type = 'device';
-- 
2.20.1





^ permalink raw reply	[flat|nested] 5+ messages in thread

* [pve-devel] [PATCH manager 2/3] ui: dc/RoleView: add variableRowHeight
  2021-05-20 14:59 [pve-devel] [PATCH manager 0/3] some small ui fixes Dominik Csapak
  2021-05-20 14:59 ` [pve-devel] [PATCH manager 1/3] ui: Parser: fix bind and dev mounts for lxc Dominik Csapak
@ 2021-05-20 14:59 ` Dominik Csapak
  2021-05-20 14:59 ` [pve-devel] [PATCH manager 3/3] ui: ResourceGrid: correctly remove ResourceStore listener Dominik Csapak
  2021-05-20 19:05 ` [pve-devel] applied-series: [PATCH manager 0/3] some small ui fixes Thomas Lamprecht
  3 siblings, 0 replies; 5+ messages in thread
From: Dominik Csapak @ 2021-05-20 14:59 UTC (permalink / raw)
  To: pve-devel

otherwise the grid is confused about the row height (since it is
variable here) and renders the scrollbars weirdly

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
 www/manager6/dc/RoleView.js | 1 +
 1 file changed, 1 insertion(+)

diff --git a/www/manager6/dc/RoleView.js b/www/manager6/dc/RoleView.js
index eccb35d0..e4247e23 100644
--- a/www/manager6/dc/RoleView.js
+++ b/www/manager6/dc/RoleView.js
@@ -71,6 +71,7 @@ Ext.define('PVE.dc.RoleView', {
 			metaData.style = 'white-space:normal;'; // allow word wrap
 			return value.replace(/,/g, ' ');
 		    },
+		    variableRowHeight: true,
 		    dataIndex: 'privs',
 		    flex: 1,
 		},
-- 
2.20.1





^ permalink raw reply	[flat|nested] 5+ messages in thread

* [pve-devel] [PATCH manager 3/3] ui: ResourceGrid: correctly remove ResourceStore listener
  2021-05-20 14:59 [pve-devel] [PATCH manager 0/3] some small ui fixes Dominik Csapak
  2021-05-20 14:59 ` [pve-devel] [PATCH manager 1/3] ui: Parser: fix bind and dev mounts for lxc Dominik Csapak
  2021-05-20 14:59 ` [pve-devel] [PATCH manager 2/3] ui: dc/RoleView: add variableRowHeight Dominik Csapak
@ 2021-05-20 14:59 ` Dominik Csapak
  2021-05-20 19:05 ` [pve-devel] applied-series: [PATCH manager 0/3] some small ui fixes Thomas Lamprecht
  3 siblings, 0 replies; 5+ messages in thread
From: Dominik Csapak @ 2021-05-20 14:59 UTC (permalink / raw)
  To: pve-devel

while the function in '.on' and '.un' are identical, they are not the
*same* function, thus the '.un' does not really remove the listener,
and we have leftover references to the grid which means it will never
really garbage-collected

instead, use '.mon' on the grid, which automatically cleans up the
listeners

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
 www/manager6/grid/ResourceGrid.js | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/www/manager6/grid/ResourceGrid.js b/www/manager6/grid/ResourceGrid.js
index c6757e9b..07048b88 100644
--- a/www/manager6/grid/ResourceGrid.js
+++ b/www/manager6/grid/ResourceGrid.js
@@ -125,14 +125,11 @@ Ext.define('PVE.grid.ResourceGrid', {
 		    var ws = me.up('pveStdWorkspace');
 		    ws.selectById(record.data.id);
 		},
-		destroy: function() {
-		    rstore.un("load", () => updateGrid());
-		},
 	    },
             columns: rstore.defaultColumns(),
 	});
 	me.callParent();
 	updateGrid();
-	rstore.on("load", () => updateGrid());
+	me.mon(rstore, 'load', () => updateGrid());
     },
 });
-- 
2.20.1





^ permalink raw reply	[flat|nested] 5+ messages in thread

* [pve-devel] applied-series: [PATCH manager 0/3] some small ui fixes
  2021-05-20 14:59 [pve-devel] [PATCH manager 0/3] some small ui fixes Dominik Csapak
                   ` (2 preceding siblings ...)
  2021-05-20 14:59 ` [pve-devel] [PATCH manager 3/3] ui: ResourceGrid: correctly remove ResourceStore listener Dominik Csapak
@ 2021-05-20 19:05 ` Thomas Lamprecht
  3 siblings, 0 replies; 5+ messages in thread
From: Thomas Lamprecht @ 2021-05-20 19:05 UTC (permalink / raw)
  To: Proxmox VE development discussion, Dominik Csapak

On 20.05.21 16:59, Dominik Csapak wrote:
> some small ui fixes that popped up during testing with extjs 7.0, but
> that have nothing to do with that
> 
> Dominik Csapak (3):
>   ui: Parser: fix bind and dev mounts for lxc
>   ui: dc/RoleView: add variableRowHeight
>   ui: ResourceGrid: correctly remove ResourceStore listener
> 
>  www/manager6/Parser.js            | 6 +++---
>  www/manager6/dc/RoleView.js       | 1 +
>  www/manager6/grid/ResourceGrid.js | 5 +----
>  3 files changed, 5 insertions(+), 7 deletions(-)
> 

Great finds, 1/3 and 3/3 were actually regressions from my eslint mania, especially
3/3 was pretty stupid in hindsight ...

applied series to stable-6 and master, thanks!




^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-05-20 19:05 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-20 14:59 [pve-devel] [PATCH manager 0/3] some small ui fixes Dominik Csapak
2021-05-20 14:59 ` [pve-devel] [PATCH manager 1/3] ui: Parser: fix bind and dev mounts for lxc Dominik Csapak
2021-05-20 14:59 ` [pve-devel] [PATCH manager 2/3] ui: dc/RoleView: add variableRowHeight Dominik Csapak
2021-05-20 14:59 ` [pve-devel] [PATCH manager 3/3] ui: ResourceGrid: correctly remove ResourceStore listener Dominik Csapak
2021-05-20 19:05 ` [pve-devel] applied-series: [PATCH manager 0/3] some small ui fixes Thomas Lamprecht

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal