Major refactoring of the ChartDownloader code.#49
Major refactoring of the ChartDownloader code.#49batuakan wants to merge 6 commits intoSignalK:masterfrom
Conversation
Hi @tkurki Can you do it for me, I tried to base my solution on the mbtiles branch after our previous talk but i failed to do so |
ca990a8 to
4b4b8e4
Compare
Move away from file based caching to MBTiles based caching for better performance and reliability.
Added an option to the webui to vacuum mbtiles to free disk space.
Added an option to the webui to create a separate mbtiles file per region/chart combination.
Added an button under region view to the webui to delete mbtiles files for selected regions/charts.
Estimate tile counts for progress reporting without needing to pre-generate tile lists.
Optimize memory usage during tile downloads.
Added possibility to load ChartProvider from a javascript file to be able to calculate dynamic URLs.
Caching of tiles stops if disk usage exceeds a certain threshold. Previously this was only checked for seeding jobs
Added a new endpoint for reporting cache stats for the current session for all chart providers.
Expanded existing cache related endpoints for more flexible usage.
Rewrite of the WebUI, with builtin map using leaflet,
Ability to add/remove/edit regions/polygons/rectangles, and store them on the server side.
Improve the download job management, with better status reporting and error handling.
Added option to web ui to be able refetch tiles from remote server and update local cache.
Various bug fixes and improvements.
Warning
This commit depends on @signalk/mbtiles library. Changes from PR SignalK#43 were copied manually
4b4b8e4 to
8af2bb9
Compare
|
Rebased and tests passing - you take it from here? |
I am mostly happy with the code as it is just the modal welcome page/documentation needs to be improved. In the meanwhile can you run my feature branch and see the new features and fixes before we move on to actually reviewing the code. I am excited to hear your feedback on the new features |
|
Reload should not take you to the beginning: save chart viewport and the selected visible layers The modal initial help is less useful than it could be, as when you first see it you don't know what the page is going to look like, so it is hard to understand what it is saying => make the help panel always initially visible at bottom left corner for example, with the ability to minimise (and remaximise afterwards) Vacuuming is only useful if the mbtiles already exists and you choose to refresh also existing tiles, right? I would change the checkboxes to
and refresh all tiles would be gray if there are no existing cached tiles, and compact would be gray unless you select refresh all. Vacuum is not end user friendly terminology.... The jobs button is really low key. It could show an (animated) indicator if there are jobs running. Why can you start a job that is already completed? You can't change its parameters. Start and stop buttons seem a little unresponsive - like I need to press them multiple times? We could implement a websocket mechanism for sending the status of the jobs instead of polling. The Serif font in the help panel hurts my brain 😁 |
|
Installed the branch and have a few questions comments. First of all great effort and function, I really like the way your regions work especially in edit mode, real easy to e.g. follow a coastline.
Please let me know if this is not the correct way to submit things, e.g. the first might be a bug with the regions --> maybe better as an issue..... Hope I can help testing, so let me know of any special directions you want me to exercise :) |
|
@batuakan just to be clear - are you planning to address my feedback or do you expect this to be merged as is, then published as beta for testing or a release? |
|
Lets get this going again, and sorry responding late, was busy with other SK projects @tkurki I can add a settings endpoint similar to freeboardsk, to save and load the viewpoint and the zoom and the active regions. I added a new button on the bottom corner, but the contents of the help dialog is still a matter of procrastination :D Changed the check boxes, for separate mbtiles creation, I should explicitly say in the documentation that first the tiles are cached into the global tile cache, once that is finished a new mbtiles is created and the tiles are copied to the new one. If you use the layer you want to seed there will definitely be some tiles in the cache for the area you are browsing. I changed the icon on the jobs button, I can look into how to add a badge to the jobs button to show the number of ongoing jobs. I will remove the start/stop button from the jobs view then, the user can cancel and remove a job by using the X button at the top right corner. The buttons are bit unresponsive depending on when you click because at every poll to the server, the whole jobs view is discarded and recreated, but once we remove the buttons the situation should improve Any font recommendations? I don't think you would approve to merge this code before going through a strict code review :D. I am expecting many rounds of back and forth |
|
I am happy it worked for you.
|
|
About regions, I understand what you are saying but changing the name in edit still makes sense. On visualize regions, does the cache hold info on the region it was created from? Mapstyle json did not cache as tiles, but you can add it and check the proxy box. I have no clue whats happening behind the scenes with that type of source/provider. I was merely hoping it would be cachable :) |
- Removed start/stop button under seeding jobs view - Added a badge showing number of active jobs - Added a new button to toggle help modal - Updated the checkboxes text in the region modal view
|
Hi @tkurki I added the help page as well, shall we begin the code review process? |
Warning
This commit depends on @signalk/mbtiles library. Changes from PR #43 were copied manually