format_size is the "lower" level helper and is not fit (anymore) to
be set as renderer directly, as its parameter signature may clash
with the extra, different ones, that renderers get passed.
For example, the useSI param always gets evaluated as true due to
the metaData "truthy" value that calls to a renderer get passed along
most of the time.
Use the render_size instead, a wrapper which only passes along value
to format_size.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
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>
The listing of the contents of the deferred queue gets its data via
postqueue (1) json output, which lists the size in bytes.
Change the column renderer to use the Proxmox.Utils.format_size
renderer, which computes a sane human readable unit.
Tested by sending a mail, which gets deferred and comparing the
output with the size of the file on disk in
'/var/spool/postfix/deferred'
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>