sirix-web-frontend icon indicating copy to clipboard operation
sirix-web-frontend copied to clipboard

TableView / Loading data on demand

Open JohannesLichtenberger opened this issue 4 years ago • 9 comments

As SirixDB is able to store Integer.MAX - 1 revisions, we have to take paging into account.

So the table should be loaded at first with the metadata from most-recent-revision-number to most-recent-revision-number - N revisions, to display the metadata from the most recent n revisions. Then on page 2 or when scrolling down the next 10 should be requested from the HTTP-Server...

JohannesLichtenberger avatar Oct 04 '19 08:10 JohannesLichtenberger

Check the events in https://element.eleme.io/#/en-US/component/pagination

JohannesLichtenberger avatar Oct 04 '19 08:10 JohannesLichtenberger

let me take a look at this

viettrung9012 avatar Oct 05 '19 14:10 viettrung9012

Hey, basically SirixDB provides a generic REST-API (should not only be used by our web application in the future):

https://localhost:9443/database/resource/history?startRevision=233&endRevision=183

For instance for the first page

https://localhost:9443/database/resource/history?startRevision=182&endRevision=132

For the second page and so on if a page has 50 rows :slight_smile: start and end revisions are always included.

So you need to calculate the revisions. page=3&count=50 would obviously be easier.

JohannesLichtenberger avatar Oct 05 '19 14:10 JohannesLichtenberger

@JohannesLichtenberger sorry it seems like my attempts so far did not work, so I hope someone else might pick this up. Element has infinite scroll option too so it might be more suitable for lazy loading data from server compare to pagination https://element.eleme.io/#/en-US/component/infiniteScroll

viettrung9012 avatar Oct 05 '19 16:10 viettrung9012

I think that would be even better, what do you think?

JohannesLichtenberger avatar Oct 05 '19 16:10 JohannesLichtenberger

Yes, that would be more suitable for displaying dynamic data.

viettrung9012 avatar Oct 05 '19 16:10 viettrung9012

You'd like to work on this? For now you can simply use the dummy JSON data, maybe.

Or try to get the HTTP-Server up and running: https://github.com/sirixdb/sirix-web-frontend/issues/14

There you can scroll down a bit where I added some links.

JohannesLichtenberger avatar Oct 05 '19 16:10 JohannesLichtenberger

OK, I saw the ts changes. I am not good at it, I will try. Infinite scroll is a better option for mobile. I think pagination is good enough to jump, but before page it, I need another API to get the total count (maybe most-recent-revision-number in this case). We must choose one of them.

Rackar avatar Oct 05 '19 17:10 Rackar

As of now there's no specific endpoint, but it's an easy query:

sdb:revision(sdb:doc('database','resource'))

That can be sent with a POST HTTP request to https://localhost:9433 for instance.

JohannesLichtenberger avatar Oct 05 '19 17:10 JohannesLichtenberger