mailcow / mailcow-dockerized

mailcow: dockerized - šŸ® + šŸ‹ = šŸ’•
https://mailcow.email
GNU General Public License v3.0
8.86k stars 1.18k forks source link

ADMIN UI: mailbox percent usage is not sorting correct #5030

Closed q16marvin closed 1 year ago

q16marvin commented 1 year ago

Contribution guidelines

I've found a bug and checked that ...

Description

Hi,

it seems sorting of percente usage is not corretly:

https://i.imgur.com/USvzqmR.png

Logs:

no

Steps to reproduce:

no

Which branch are you using?

master

Operating System:

Ubuntu 18.04.6 LTS

Server/VM specifications:

8GB Memory, 4 Cores

Is Apparmor, SELinux or similar active?

no

Virtualization technology:

KVM

Docker version:

20.10.23

docker-compose version or docker compose version:

v2.9.0

mailcow version:

2023-01a

Reverse proxy:

no revery proxy

Logs of git diff:

no changes

Logs of iptables -L -vn:

no

Logs of ip6tables -L -vn:

no

Logs of iptables -L -vn -t nat:

no

Logs of ip6tables -L -vn -t nat:

no

DNS check:

no
tomudding commented 1 year ago

Same issue as with #4911 and #4957: sorting is based on the actual value, not the numerical value.

Can probably (not tested) be fixed by changing

https://github.com/mailcow/mailcow-dockerized/blob/640f535e9995f27fcc1541a60f0a56648d0d66cc/data/web/js/site/mailbox.js#L926-L928

and

https://github.com/mailcow/mailcow-dockerized/blob/640f535e9995f27fcc1541a60f0a56648d0d66cc/data/web/js/site/mailbox.js#L992-L998

to

 item.in_use = {
   sortBy: item.percent_in_use,
   value: '<div class="progress">' + 
     '<div class="progress-bar-mailbox progress-bar progress-bar-' + item.percent_class + '" role="progressbar" aria-valuenow="' + item.percent_in_use + '" aria-valuemin="0" aria-valuemax="100" ' + 
     'style="min-width:2em;width:' + item.percent_in_use + '%">' + item.percent_in_use + '%' + '</div></div>',
 };
 { 
   title: lang.in_use, 
   data: 'in_use', 
   defaultContent: '', 
   responsivePriority: 9, 
   className: 'dt-data-w100',
   createdCell: function(td, cellData) {
     $(td).attr({
       "data-order": cellData.sortBy,
       "data-sort": cellData.sortBy
     });
     $(td).html(cellData.value);
   }
 }, 
milkmaker commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

pave1h commented 11 months ago

This is still a problem in version 2023-11, the issue should not be closed. When sorting mailboxes by In use (%) in descending order, I still get 90%, then 9%, then 80% etc.