threefoldtecharchive / tfgrid_dashboard

unified portal + explorer
1 stars 3 forks source link

Rows per page doesn't work in farm table #521

Closed A-Harby closed 1 year ago

A-Harby commented 1 year ago

Description

Rows per page: counts in farm table doesn't work it and it retrieve all the tables in the twin and displays them all regardless the number chosen.

Logs/Alerts

image image

0oM4R commented 1 year ago

@A-Harby1 can you give more steps please, is it on portal or what?

A-Harby commented 1 year ago

yes portal, this is the farm table in the farm page. Create more than 5 farm and try to change Rows per page

0oM4R commented 1 year ago

Looks like the getfarm is using chain to fetch all the farms, then filter them by twin id! and on every farm, it makes a request to get the farmPayoutV2AddressByFarmID . So I think we need to use gridProxy that supports pagination, and the result already contains the v2address. this will make the performance much better on a huge number of farms as in the main net. we may need to keep using the getFarm function as it is used on the doa page and create a new function to improve the farms page in the portal, later on, we can change the Dao page to

0oM4R commented 1 year ago

image while digging in the code i see about 30 requests on just one farm and 10 nodes is that normal ?

0oM4R commented 1 year ago

okay now they are 21 request by adding this line if (this.page === pageNumber && this.size === pageSize) return; to https://github.com/threefoldtech/tfgrid_dashboard/blob/17ed34a1f09c909319e605101d31d9daf0eacb26/src/portal/views/Farms.vue#L344

on this farm we have 10 nodes so the 21 requests :

A-Harby commented 1 year ago

Opening the farm page with twin have more than 10 farms. Nothing changed and all the farm were retrieved.
image Also nothing changes when changing row per page image

A-Harby commented 1 year ago

@0oM4R Is this not deployed yet? Because it should be deployed via the workflow, or is there a problem with it?

0oM4R commented 1 year ago

so weird, it works locally very fine in production mode, @AhmedHanafy725 is there a problem with the mentioned workflow ?

0oM4R commented 1 year ago

Screencast from 29 مار, 2023 EET 05:49:34 م.webm

A-Harby commented 1 year ago

so weird, it works locally very fine in production mode, @AhmedHanafy725 is there a problem with the mentioned workflow ?

I think there is an problem with it because other issues are also having the same problem deployed but not fixed.

A-Harby commented 1 year ago

Verified, Raw per page is now working fine and table farms changes depend on the number selected. image image