anselal / antminer-monitor

Cryptocurrency ASIC mining hardware monitor using a simple web interface
GNU General Public License v3.0
228 stars 145 forks source link

change IP sorting #187

Open HMCmin opened 2 years ago

HMCmin commented 2 years ago

Hello,

How change default sort function:

{%- for active_miner in active_miners|sort(attribute='ip') %}

I have now about 105 L3 running with different subnets

10.0.0.100 10.0.0.101 10.0.0.102 10.0.0.103 10.0.0.104 10.0.0.105 10.0.1.1 10.0.1.10 10.0.1.100 10.0.1.11

And I want to list them propertly.

Best Regards

anselal commented 2 years ago

Hi there,

glad you liked my software.

Well, you already have the solution. The sorting happens in the frontend but you want to sort in the backend.

Remove |sort(attribute='ip') from the html files amd sort the miners in the following view:

https://github.com/anselal/antminer-monitor/blob/5c62e1064af30674bacb9e1917d5980efbde1fcd/antminermonitor/blueprints/asicminer/views/antminer.py#L23

HMCmin commented 2 years ago

hello,

it is possible to change {%- for active_miner in active_miners|sort(attribute='ip') %}

to {%- for active_miner in active_miners|dictsort(true) %}

Best Regards

HMCmin commented 2 years ago

I Have forked and made some changes: https://github.com/HMCmin/antminer-monitor

thanks for great software

Best Regards