[pmg-devel] [PATCH pmg-gui 1/1] fix #1976: enable remoteSort for PostfixMailQueue

Stoiko Ivanov s.ivanov at proxmox.com
Thu May 28 10:04:59 CEST 2020


The mailq results are potentially very large, why a BufferedStore is used.

BufferedStores only support [0] remote filtering (which is already done) and
remote sorting (which this patch enables).

simpleSortMode (getting sortfield and sortdirection as two parameters instead
of an array with multiple objects containing those fields), is enabled to
work with our API.

[0] quite naturally, since you'd need to have the complete result to sort it,
 however only documented in the source code (and not the reference docs)

Signed-off-by: Stoiko Ivanov <s.ivanov at proxmox.com>
---
 js/PostfixMailQueue.js | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/js/PostfixMailQueue.js b/js/PostfixMailQueue.js
index 61236e3..666eabc 100644
--- a/js/PostfixMailQueue.js
+++ b/js/PostfixMailQueue.js
@@ -24,6 +24,7 @@ Ext.define('PMG.Postfix.MailQueue', {
 	xclass: 'Ext.data.BufferedStore',
 	model: 'pmg-mailq',
 	remoteFilter: true,
+	remoteSort: true,
 	pageSize: 2000
     },
 
@@ -181,6 +182,9 @@ Ext.define('PMG.Postfix.MailQueue', {
 	    type: 'proxmox',
 	    startParam: 'start',
 	    limitParam: 'limit',
+	    sortParam: 'sortfield',
+	    directionParam: 'sortdir',
+	    simpleSortMode: true,
 	    url: "/api2/json/nodes/" + me.nodename + "/postfix/queue/" + me.queuename
 	};
 
-- 
2.20.1




More information about the pmg-devel mailing list