I've decided to change things up in API schema and doc generation.
Work is not quite complete but its enough for testing in dev and feedback.
Major changes:
* Renaming of api.view classes to match ViewSet inheritance (minor annoyance)
* Introduce drf-spectacular for schema generation and doc UI via swagger-ui
* lots of doc changes for the API to provide a good experience with the above.
New schema generation should work seamlessly in gitlab ci, as well as via /api/schema dynamically.
The new swagger ui view is available via /api/schema/docs/
Signed-off-by: Corey Shields <cshields@gmail.com>
adds the /api-schema URL which will provide the current API schema in OpenAPI format, both in rendered and downloadable formats.
Signed-off-by: Corey Shields <cshields@gmail.com>
Removed most of the bare Exception catches and put proper errors to catch in their place.
Reworked a bit of the gridsquare calculation, any exceptions raised should now be handled within the function.
I am purposefully leaving the 2 W0703's we have for data demodulation alone for now, as that will be quite a rabbit hole. Otherwise,
fixes#316
Signed-off-by: Corey Shields <cshields@gmail.com>
Update to Django Rest Framework 3.12.2 with improved schema generation.
However, it is still not quite complete for what we need (and what we currently postprocess for). Instead of postprocessing, this commit introduces our own extended generator to add the missing fields.
Once this is vetted good, we can remove contrib/postprocess-openapi-schema.py
Also added better comments to api/views.py which will end up in schema docs
Signed-off-by: Corey Shields <cshields@gmail.com>
Kaitai Struct exceptions inherit from 'BaseException' instead of
'Exception' class. This issue is fixed upstream but did not make it
to the release of Kaitai Struct (see PR #53).
Signed-off-by: Vasilis Tsiligiannis <acinonyx@openwrt.gr>
Changes CASCADE to SET_NULL when upstream satellite object is deleted, preserving the TLE history in DB.
Tested locally with a deletion
Fixes#435
Signed-off-by: Corey Shields <cshields@gmail.com>
Adds the ability to sort on the 'status' column (which today does nothing) by setting the field by which datatables will sort on to sat.status
This also has the benefit of filtering on sat.status as well, though one would need to know the backend statuses to use (ie: 'alive' vs 'dead'). Not sure that is ideal but this is a quick fix.
Fixes#428
Signed-off-by: Corey Shields <cshields@gmail.com>
As reported in #433 there was a bug causing export requests for the last week to be treated as a last month export.
Fixes#433 by treating the period variable as the int that it is. Also makes the preceding check a little easier to understand by being explicit against the None case.
Signed-off-by: Corey Shields <cshields@gmail.com>
As currently the only way to add/delete manually Tle objects is
through admin panel, I've replaced Tle signal receivers with custom
admin save/delete methods in order to trigger updating of
LatestTleSet objects more efficently.
Signed-off-by: Alfredos-Panagiotis Damkalis <fredy@fredy.gr>
LatestTle model was a proxy model on Tle one, using it for API adds a
significant delay to respond on the API requests. For this reason
LatestTle model is removed and LatestTleSet model takes its place.
LatestTleSet is updated asynchronously and keeping references to
latest TLE sets of Tle model. This allows to retrieve the TLE sets
faster.
Signed-off-by: Alfredos-Panagiotis Damkalis <fredy@fredy.gr>
The 'norad_follow_id' field is used for aquiring TLE sets for a
satellite with a temporary NORAD ID.
Signed-off-by: Alfredos-Panagiotis Damkalis <fredy@fredy.gr>
Various improvements to the stats page:
Added a legend of top chart items to the footer of bands and modes charts. Fixes#408
Added a (cached) count of decoded frames to the Satellites table. Fixes#400
Added a note about the cached nature of stats. Fixes#403
Signed-off-by: Corey Shields <cshields@gmail.com>
Hooray for success - we have tons of contributors in a 24 hr leaderboard!! Making this fit the screen a bit better and scrollable.
Fixes#402
Signed-off-by: Corey Shields <cshields@gmail.com>
Have to make this card a full width, even at col-xl-6 size it can shrink to stretch past the edge of the card. Adjusted a little more to make better visual use of the space as well.
Fixes#426
Signed-off-by: Corey Shields <cshields@gmail.com>