]> git.proxmox.com Git - pmg-gui.git/commitdiff
fix #1976: enable remoteSort for PostfixMailQueue
authorStoiko Ivanov <s.ivanov@proxmox.com>
Thu, 28 May 2020 08:04:59 +0000 (10:04 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 4 Jun 2020 06:34:55 +0000 (08:34 +0200)
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@proxmox.com>
js/PostfixMailQueue.js

index 61236e32584609ee6b09475c3edbab82df395339..666eabce585cd895fcbb07552543f8a5794071b3 100644 (file)
@@ -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
        };