From e501642b8ebc0d6af25f8a2663b4d1dbfb56bc80 Mon Sep 17 00:00:00 2001 From: FreddleSpl0it Date: Mon, 9 Jan 2023 08:04:16 +0100 Subject: [PATCH] [Web] fix mailboxtable sort by quota --- data/web/js/site/mailbox.js | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/data/web/js/site/mailbox.js b/data/web/js/site/mailbox.js index 2bdd5bf1..83e0d032 100644 --- a/data/web/js/site/mailbox.js +++ b/data/web/js/site/mailbox.js @@ -838,7 +838,13 @@ jQuery(function($){ url: "/api/v1/get/mailbox/reduced", dataSrc: function(json){ $.each(json, function (i, item) { - item.quota = item.quota_used + "/" + item.quota; + item.quota = { + sortBy: item.quota_used, + value: item.quota + } + item.quota.value = (item.quota.value == 0 ? "∞" : humanFileSize(item.quota.value)); + item.quota.value = humanFileSize(item.quota_used) + "/" + item.quota.value; + item.max_quota_for_mbox = humanFileSize(item.max_quota_for_mbox); item.last_mail_login = item.last_imap_login + '/' + item.last_pop3_login + '/' + item.last_smtp_login; /* @@ -943,14 +949,10 @@ jQuery(function($){ }, { title: lang.domain_quota, - data: 'quota', + data: 'quota.value', responsivePriority: 8, - defaultContent: '', - render: function (data, type) { - data = data.split("/"); - var of_q = (data[1] == 0 ? "∞" : humanFileSize(data[1])); - return humanFileSize(data[0]) + " / " + of_q; - } + defaultContent: '', + orderData: 23 }, { title: lang.last_mail_login, @@ -1076,6 +1078,13 @@ jQuery(function($){ responsivePriority: 6, defaultContent: '' }, + { + title: "", + data: 'quota.sortBy', + responsivePriority: 8, + defaultContent: '', + className: "d-none" + }, ] }); }