Feature: Add customisable icons in topology (#193)

* [up] add config for custom images, better js

* [up] use bundler to bundle js

* [fix] remove domcontentloaded since defer is used

* [fix] formatting with black

* [fix] images drf api

* [up] add support for custom icons on additional roles: power panel, power feed, circuit

* [up] optimize topology generation by using `_id` when trying to access pk of related object

* [fix] kebab case instead of slugification

* [fix] use empty queryset in api views & change coord save logic
This commit is contained in:
Victor Gorchilov
2022-12-09 13:40:39 +01:00
committed by GitHub
parent 5c87694b87
commit 52c2611e9d
30 changed files with 1395 additions and 628 deletions
+7 -5
View File
@@ -1,8 +1,10 @@
from rest_framework import routers
from . import views
from netbox.api.routers import NetBoxRouter
router = routers.DefaultRouter()
from netbox_topology_views.api import views
router.register('save-coords', views.SaveCoordsViewSet, basename='save_coords')
router = NetBoxRouter()
urlpatterns = router.urls
router.register("save-coords", views.SaveCoordsViewSet)
router.register("images", views.SaveRoleImageViewSet)
urlpatterns = router.urls