sirixdb / sirix-web-frontend

A web front-end for SirixDB based on Nuxt.js/Vue.js, D3.js and Typescript
https://sirix.io
17 stars 20 forks source link

TableView / Loading data on demand #4

Open JohannesLichtenberger opened 5 years ago

JohannesLichtenberger commented 5 years ago

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 commented 5 years ago

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

viettrung9012 commented 5 years ago

let me take a look at this

JohannesLichtenberger commented 5 years ago

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.

viettrung9012 commented 5 years ago

@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

JohannesLichtenberger commented 5 years ago

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

viettrung9012 commented 5 years ago

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

JohannesLichtenberger commented 5 years ago

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.

Rackar commented 5 years ago

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.

JohannesLichtenberger commented 5 years ago

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.