Open JohannesLichtenberger opened 5 years ago
Check the events in https://element.eleme.io/#/en-US/component/pagination
let me take a look at this
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 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
I think that would be even better, what do you think?
Yes, that would be more suitable for displaying dynamic data.
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.
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.
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.
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
tomost-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...