Compare commits
24
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
50c90a4328 | ||
|
|
374a88266a | ||
|
|
60cbc94a62 | ||
|
|
649305c83e | ||
|
|
b3397f4f4a | ||
|
|
a23604261a | ||
|
|
d9571b30b5 | ||
|
|
76b43f5d1e | ||
|
|
becfaaa054 | ||
|
|
bec301eb9d | ||
|
|
f28623b378 | ||
|
|
16837047be | ||
|
|
987c7ef34c | ||
|
|
dbe331afb8 | ||
|
|
86c0c55896 | ||
|
|
78b8a5ae97 | ||
|
|
71e4807cb1 | ||
|
|
dfbe26318f | ||
|
|
debc314714 | ||
|
|
d14d9c1414 | ||
|
|
d48d213b2c | ||
|
|
e5e5a8a0ef | ||
|
|
1b64f40564 | ||
|
|
33a198517b |
No files matched your search
@@ -50,6 +50,9 @@ python3 manage.py collectstatic --no-input
|
|||||||
|
|
||||||
| netbox version | netbox-topology-views version |
|
| netbox version | netbox-topology-views version |
|
||||||
| -------------- | ----------------------------- |
|
| -------------- | ----------------------------- |
|
||||||
|
| >= 3.7.0 | >= v3.9.0 |
|
||||||
|
| >= 3.6.4 | >= v3.8.1 |
|
||||||
|
| >= 3.6.0 | >= v3.7.X |
|
||||||
| >= 3.5.0 | >= v3.4.X |
|
| >= 3.5.0 | >= v3.4.X |
|
||||||
| >= 3.4.0 | >= v3.X.X |
|
| >= 3.4.0 | >= v3.X.X |
|
||||||
| >= 3.3.0 | >= v3.0.0 |
|
| >= 3.3.0 | >= v3.0.0 |
|
||||||
@@ -199,3 +202,12 @@ Set `Coordinate Groups` according to your needs:
|
|||||||
|
|
||||||
Set `Coordinates` according to your needs:
|
Set `Coordinates` according to your needs:
|
||||||
+ netbox_topology_views | coordinate | view/add/change/delete
|
+ netbox_topology_views | coordinate | view/add/change/delete
|
||||||
|
|
||||||
|
Set `Power Feed Coordinates` according to your needs:
|
||||||
|
+ netbox_topology_views | power feed coordinate | view/add/change/delete
|
||||||
|
|
||||||
|
Set `Power Panel Coordinates` according to your needs:
|
||||||
|
+ netbox_topology_views | power panel coordinate | view/add/change/delete
|
||||||
|
|
||||||
|
Set `Circuit Coordinates` according to your needs:
|
||||||
|
+ netbox_topology_views | circuit coordinate | view/add/change/delete
|
||||||
@@ -5,7 +5,7 @@ class TopologyViewsConfig(PluginConfig):
|
|||||||
name = "netbox_topology_views"
|
name = "netbox_topology_views"
|
||||||
verbose_name = "Topology views"
|
verbose_name = "Topology views"
|
||||||
description = "An plugin to render topology maps"
|
description = "An plugin to render topology maps"
|
||||||
version = "3.6.0-beta.2"
|
version = "3.9-beta1"
|
||||||
author = "Mattijs Vanhaverbeke"
|
author = "Mattijs Vanhaverbeke"
|
||||||
author_email = "[email protected]"
|
author_email = "[email protected]"
|
||||||
base_url = "netbox_topology_views"
|
base_url = "netbox_topology_views"
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ from dcim.models import Device, DeviceRole
|
|||||||
from rest_framework.serializers import ModelSerializer
|
from rest_framework.serializers import ModelSerializer
|
||||||
from netbox.api.serializers import NetBoxModelSerializer
|
from netbox.api.serializers import NetBoxModelSerializer
|
||||||
|
|
||||||
from netbox_topology_views.models import RoleImage, IndividualOptions, CoordinateGroup, Coordinate
|
from netbox_topology_views.models import RoleImage, IndividualOptions, CoordinateGroup, Coordinate, CircuitCoordinate, PowerPanelCoordinate, PowerFeedCoordinate
|
||||||
|
|
||||||
|
|
||||||
class TopologyDummySerializer(ModelSerializer):
|
class TopologyDummySerializer(ModelSerializer):
|
||||||
@@ -32,6 +32,21 @@ class CoordinateSerializer(NetBoxModelSerializer):
|
|||||||
model = Coordinate
|
model = Coordinate
|
||||||
fields = ("x", "y")
|
fields = ("x", "y")
|
||||||
|
|
||||||
|
class CircuitCoordinateSerializer(NetBoxModelSerializer):
|
||||||
|
class Meta:
|
||||||
|
model = CircuitCoordinate
|
||||||
|
fields = ("x", "y")
|
||||||
|
|
||||||
|
class PowerPanelCoordinateSerializer(NetBoxModelSerializer):
|
||||||
|
class Meta:
|
||||||
|
model = PowerPanelCoordinate
|
||||||
|
fields = ("x", "y")
|
||||||
|
|
||||||
|
class PowerFeedCoordinateSerializer(NetBoxModelSerializer):
|
||||||
|
class Meta:
|
||||||
|
model = PowerFeedCoordinate
|
||||||
|
fields = ("x", "y")
|
||||||
|
|
||||||
class IndividualOptionsSerializer(NetBoxModelSerializer):
|
class IndividualOptionsSerializer(NetBoxModelSerializer):
|
||||||
class Meta:
|
class Meta:
|
||||||
model = IndividualOptions
|
model = IndividualOptions
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
from typing import Dict
|
from typing import Dict
|
||||||
|
import sys
|
||||||
|
|
||||||
from circuits.models import Circuit
|
from circuits.models import Circuit
|
||||||
from dcim.models import Device, DeviceRole, PowerFeed, PowerPanel
|
from dcim.models import Device, DeviceRole, PowerFeed, PowerPanel
|
||||||
@@ -14,7 +15,8 @@ from netbox_topology_views.api.serializers import (
|
|||||||
RoleImageSerializer,
|
RoleImageSerializer,
|
||||||
TopologyDummySerializer,
|
TopologyDummySerializer,
|
||||||
)
|
)
|
||||||
from netbox_topology_views.models import RoleImage, IndividualOptions, CoordinateGroup, Coordinate
|
import netbox_topology_views.models
|
||||||
|
from netbox_topology_views.models import RoleImage, IndividualOptions, CoordinateGroup, Coordinate, CircuitCoordinate, PowerPanelCoordinate, PowerFeedCoordinate
|
||||||
from netbox_topology_views.views import get_topology_data
|
from netbox_topology_views.views import get_topology_data
|
||||||
from netbox_topology_views.utils import get_image_from_url, export_data_to_xml, get_query_settings
|
from netbox_topology_views.utils import get_image_from_url, export_data_to_xml, get_query_settings
|
||||||
from netbox_topology_views.filters import DeviceFilterSet
|
from netbox_topology_views.filters import DeviceFilterSet
|
||||||
@@ -41,20 +43,26 @@ class SaveCoordsViewSet(PermissionRequiredMixin, ReadOnlyModelViewSet):
|
|||||||
if device_id.startswith("c"):
|
if device_id.startswith("c"):
|
||||||
device_id = device_id.lstrip("c")
|
device_id = device_id.lstrip("c")
|
||||||
actual_device = Circuit.objects.get(id=device_id)
|
actual_device = Circuit.objects.get(id=device_id)
|
||||||
|
model_name = 'CircuitCoordinate'
|
||||||
elif device_id.startswith("p"):
|
elif device_id.startswith("p"):
|
||||||
device_id = device_id.lstrip("p")
|
device_id = device_id.lstrip("p")
|
||||||
actual_device = PowerPanel.objects.get(id=device_id)
|
actual_device = PowerPanel.objects.get(id=device_id)
|
||||||
|
model_name = 'PowerPanelCoordinate'
|
||||||
elif device_id.startswith("f"):
|
elif device_id.startswith("f"):
|
||||||
device_id = device_id.lstrip("f")
|
device_id = device_id.lstrip("f")
|
||||||
actual_device = PowerFeed.objects.get(id=device_id)
|
actual_device = PowerFeed.objects.get(id=device_id)
|
||||||
|
model_name = 'PowerFeedCoordinate'
|
||||||
elif device_id.isnumeric():
|
elif device_id.isnumeric():
|
||||||
actual_device = Device.objects.get(id=device_id)
|
actual_device = Device.objects.get(id=device_id)
|
||||||
|
model_name = 'Coordinate'
|
||||||
|
|
||||||
if not actual_device:
|
if not actual_device:
|
||||||
return Response({"status": "invalid node_id in body"}, status=400)
|
return Response({"status": "invalid node_id in body"}, status=400)
|
||||||
|
|
||||||
|
model_class = getattr(netbox_topology_views.models, model_name)
|
||||||
|
|
||||||
if group_id is None or group_id == "default":
|
if group_id is None or group_id == "default":
|
||||||
group_id = Coordinate.get_or_create_default_group(group_id)
|
group_id = model_class.get_or_create_default_group(group_id)
|
||||||
if not group_id:
|
if not group_id:
|
||||||
return Response(
|
return Response(
|
||||||
{"status": "Error while creating default group."}, status=500
|
{"status": "Error while creating default group."}, status=500
|
||||||
@@ -66,12 +74,12 @@ class SaveCoordsViewSet(PermissionRequiredMixin, ReadOnlyModelViewSet):
|
|||||||
# Hen-and-egg-problem. Thanks, Django! By default, Django updates records that
|
# Hen-and-egg-problem. Thanks, Django! By default, Django updates records that
|
||||||
# already exist and inserts otherwise. This does not work with our
|
# already exist and inserts otherwise. This does not work with our
|
||||||
# unique_together key if no pk is given. But: No record, no pk.
|
# unique_together key if no pk is given. But: No record, no pk.
|
||||||
if not Coordinate.objects.filter(group=group, device=actual_device):
|
if not model_class.objects.filter(group=group, device=actual_device):
|
||||||
# Unique group/device pair does not exist. Prepare new data set
|
# Unique group/device pair does not exist. Prepare new data set
|
||||||
coords = Coordinate(group=group, device=actual_device, x=x_coord, y=y_coord)
|
coords = model_class(group=group, device=actual_device, x=x_coord, y=y_coord)
|
||||||
else:
|
else:
|
||||||
# Unique group/device pair already exists. Update data
|
# Unique group/device pair already exists. Update data
|
||||||
coords = Coordinate(pk=Coordinate.objects.get(group=group, device=actual_device).pk, group=group, device=actual_device, x=x_coord, y=y_coord)
|
coords = model_class(pk=model_class.objects.get(group=group, device=actual_device).pk, group=group, device=actual_device, x=x_coord, y=y_coord)
|
||||||
coords.save()
|
coords.save()
|
||||||
except:
|
except:
|
||||||
return Response(
|
return Response(
|
||||||
@@ -90,7 +98,7 @@ class ExportTopoToXML(PermissionRequiredMixin, ViewSet):
|
|||||||
|
|
||||||
self.filterset = DeviceFilterSet
|
self.filterset = DeviceFilterSet
|
||||||
self.queryset = Device.objects.all().select_related(
|
self.queryset = Device.objects.all().select_related(
|
||||||
"device_type", "device_role"
|
"device_type", "role"
|
||||||
)
|
)
|
||||||
self.queryset = self.filterset(request.GET, self.queryset).qs
|
self.queryset = self.filterset(request.GET, self.queryset).qs
|
||||||
|
|
||||||
@@ -131,8 +139,8 @@ class SaveRoleImageViewSet(PermissionRequiredMixin, ReadOnlyModelViewSet):
|
|||||||
queryset = DeviceRole.objects.none()
|
queryset = DeviceRole.objects.none()
|
||||||
serializer_class = RoleImageSerializer
|
serializer_class = RoleImageSerializer
|
||||||
permission_required = (
|
permission_required = (
|
||||||
"dcim.add_device_role",
|
"dcim.add_devicerole",
|
||||||
"dcim.change_device_role",
|
"dcim.change_devicerole",
|
||||||
)
|
)
|
||||||
|
|
||||||
@action(detail=False, methods=["post"])
|
@action(detail=False, methods=["post"])
|
||||||
@@ -142,15 +150,26 @@ class SaveRoleImageViewSet(PermissionRequiredMixin, ReadOnlyModelViewSet):
|
|||||||
{"status": "Missing or malformed request body"}, status=400
|
{"status": "Missing or malformed request body"}, status=400
|
||||||
)
|
)
|
||||||
|
|
||||||
device_roles = {
|
if sys.version_info >= (3,9,0):
|
||||||
k: v.removeprefix(settings.STATIC_URL)
|
device_roles = {
|
||||||
for k, v in request.data.items()
|
k: v.removeprefix(settings.STATIC_URL)
|
||||||
if k.isnumeric()}
|
for k, v in request.data.items()
|
||||||
content_type_ids = {
|
if k.isnumeric()}
|
||||||
k[2:]: v.removeprefix(settings.STATIC_URL)
|
content_type_ids = {
|
||||||
for k, v in request.data.items()
|
k[2:]: v.removeprefix(settings.STATIC_URL)
|
||||||
if k.startswith("ct") and k[2:].isnumeric()
|
for k, v in request.data.items()
|
||||||
}
|
if k.startswith("ct") and k[2:].isnumeric()
|
||||||
|
}
|
||||||
|
else:
|
||||||
|
device_roles = {}
|
||||||
|
for k, v in request.data.items():
|
||||||
|
if k.isdigit() and v.startswith(settings.STATIC_URL):
|
||||||
|
device_roles[k] = v[len(settings.STATIC_URL):]
|
||||||
|
|
||||||
|
content_type_ids = {}
|
||||||
|
for k, v in request.data.items():
|
||||||
|
if k.startswith("ct") and k[2:].isdigit() and v.startswith(settings.STATIC_URL):
|
||||||
|
content_type_ids[k[2:]] = v[len(settings.STATIC_URL):]
|
||||||
|
|
||||||
roles: Dict[int, DeviceRole] = DeviceRole.objects.in_bulk(device_roles.keys())
|
roles: Dict[int, DeviceRole] = DeviceRole.objects.in_bulk(device_roles.keys())
|
||||||
content_types: Dict[int, ContentType] = ContentType.objects.in_bulk(
|
content_types: Dict[int, ContentType] = ContentType.objects.in_bulk(
|
||||||
|
|||||||
@@ -1,28 +1,56 @@
|
|||||||
import django_filters
|
import django_filters
|
||||||
|
from circuits.models import Circuit
|
||||||
from dcim.choices import DeviceStatusChoices
|
from dcim.choices import DeviceStatusChoices
|
||||||
from dcim.models import Device, DeviceRole, Location, Rack, Region, Site
|
from dcim.models import Device, DeviceRole, Location, Rack, Region, Site, SiteGroup, Manufacturer, DeviceType, Platform, PowerPanel, PowerFeed
|
||||||
from django.db.models import Q
|
from django.db.models import Q
|
||||||
|
from extras.filtersets import LocalConfigContextFilterSet
|
||||||
|
from extras.models import ConfigTemplate
|
||||||
from netbox.filtersets import NetBoxModelFilterSet
|
from netbox.filtersets import NetBoxModelFilterSet
|
||||||
from tenancy.filtersets import TenancyFilterSet
|
from tenancy.filtersets import TenancyFilterSet, ContactModelFilterSet
|
||||||
from utilities.filters import TreeNodeMultipleChoiceFilter
|
from utilities.filters import TreeNodeMultipleChoiceFilter, MultiValueCharFilter, MultiValueMACAddressFilter
|
||||||
from netbox_topology_views.models import CoordinateGroup, Coordinate
|
from netbox_topology_views.models import CoordinateGroup, Coordinate, CircuitCoordinate, PowerPanelCoordinate, PowerFeedCoordinate
|
||||||
|
|
||||||
class DeviceFilterSet(TenancyFilterSet, NetBoxModelFilterSet):
|
class DeviceFilterSet(NetBoxModelFilterSet, TenancyFilterSet, ContactModelFilterSet, LocalConfigContextFilterSet):
|
||||||
q = django_filters.CharFilter(
|
q = django_filters.CharFilter(
|
||||||
method="search",
|
method="search",
|
||||||
label="Search",
|
label="Search",
|
||||||
)
|
)
|
||||||
device_role_id = django_filters.ModelMultipleChoiceFilter(
|
manufacturer_id = django_filters.ModelMultipleChoiceFilter(
|
||||||
field_name="device_role_id",
|
field_name='device_type__manufacturer',
|
||||||
|
queryset=Manufacturer.objects.all(),
|
||||||
|
label="Manufacturer (ID)",
|
||||||
|
)
|
||||||
|
manufacturer = django_filters.ModelMultipleChoiceFilter(
|
||||||
|
field_name='device_type__manufacturer__slug',
|
||||||
|
queryset=Manufacturer.objects.all(),
|
||||||
|
to_field_name='slug',
|
||||||
|
label="Manufacturer (slug)",
|
||||||
|
)
|
||||||
|
device_type_id = django_filters.ModelMultipleChoiceFilter(
|
||||||
|
queryset=DeviceType.objects.all(),
|
||||||
|
label="Device type (ID)",
|
||||||
|
)
|
||||||
|
role_id = django_filters.ModelMultipleChoiceFilter(
|
||||||
|
field_name="role_id",
|
||||||
queryset=DeviceRole.objects.all(),
|
queryset=DeviceRole.objects.all(),
|
||||||
label="Role (ID)",
|
label="Role (ID)",
|
||||||
)
|
)
|
||||||
|
platform_id = django_filters.ModelMultipleChoiceFilter(
|
||||||
|
queryset=Platform.objects.all(),
|
||||||
|
label="Platform (ID)",
|
||||||
|
)
|
||||||
region_id = TreeNodeMultipleChoiceFilter(
|
region_id = TreeNodeMultipleChoiceFilter(
|
||||||
queryset=Region.objects.all(),
|
queryset=Region.objects.all(),
|
||||||
field_name="site__region",
|
field_name="site__region",
|
||||||
lookup_expr="in",
|
lookup_expr="in",
|
||||||
label="Region (ID)",
|
label="Region (ID)",
|
||||||
)
|
)
|
||||||
|
site_group_id = TreeNodeMultipleChoiceFilter(
|
||||||
|
queryset=SiteGroup.objects.all(),
|
||||||
|
field_name="site__group",
|
||||||
|
lookup_expr="in",
|
||||||
|
label="Site Group (ID)",
|
||||||
|
)
|
||||||
site_id = django_filters.ModelMultipleChoiceFilter(
|
site_id = django_filters.ModelMultipleChoiceFilter(
|
||||||
queryset=Site.objects.all(),
|
queryset=Site.objects.all(),
|
||||||
label="Site (ID)",
|
label="Site (ID)",
|
||||||
@@ -42,10 +70,57 @@ class DeviceFilterSet(TenancyFilterSet, NetBoxModelFilterSet):
|
|||||||
choices=DeviceStatusChoices,
|
choices=DeviceStatusChoices,
|
||||||
null_value=None,
|
null_value=None,
|
||||||
)
|
)
|
||||||
|
mac_address = MultiValueMACAddressFilter(
|
||||||
|
field_name='interfaces__mac_address',
|
||||||
|
label="MAC address",
|
||||||
|
)
|
||||||
|
serial = MultiValueCharFilter(
|
||||||
|
lookup_expr='iexact'
|
||||||
|
)
|
||||||
|
console_ports = django_filters.BooleanFilter(
|
||||||
|
method='_console_ports',
|
||||||
|
label="Has console ports",
|
||||||
|
)
|
||||||
|
console_server_ports = django_filters.BooleanFilter(
|
||||||
|
method='_console_server_ports',
|
||||||
|
label="Has console server ports",
|
||||||
|
)
|
||||||
|
power_ports = django_filters.BooleanFilter(
|
||||||
|
method='_power_ports',
|
||||||
|
label="Has power ports",
|
||||||
|
)
|
||||||
|
power_outlets = django_filters.BooleanFilter(
|
||||||
|
method='_power_outlets',
|
||||||
|
label="Has power outlets",
|
||||||
|
)
|
||||||
|
interfaces = django_filters.BooleanFilter(
|
||||||
|
method='_interfaces',
|
||||||
|
label="Has interfaces",
|
||||||
|
)
|
||||||
|
pass_through_ports = django_filters.BooleanFilter(
|
||||||
|
method='_pass_through_ports',
|
||||||
|
label="Has pass-through ports",
|
||||||
|
)
|
||||||
|
config_template_id = django_filters.ModelMultipleChoiceFilter(
|
||||||
|
queryset=ConfigTemplate.objects.all(),
|
||||||
|
label="Config template (ID)",
|
||||||
|
)
|
||||||
|
has_primary_ip = django_filters.BooleanFilter(
|
||||||
|
method='_has_primary_ip',
|
||||||
|
label="Has a primary IP",
|
||||||
|
)
|
||||||
|
has_oob_ip = django_filters.BooleanFilter(
|
||||||
|
method='_has_oob_ip',
|
||||||
|
label="Has an out-of-band IP",
|
||||||
|
)
|
||||||
|
virtual_chassis_member = django_filters.BooleanFilter(
|
||||||
|
method='_virtual_chassis_member',
|
||||||
|
label="Is a virtual chassis member",
|
||||||
|
)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = Device
|
model = Device
|
||||||
fields = ["id", "name"]
|
fields = ["id", "name", "asset_tag", "airflow"]
|
||||||
|
|
||||||
def search(self, queryset, name, value):
|
def search(self, queryset, name, value):
|
||||||
"""Perform the filtered search."""
|
"""Perform the filtered search."""
|
||||||
@@ -54,6 +129,108 @@ class DeviceFilterSet(TenancyFilterSet, NetBoxModelFilterSet):
|
|||||||
qs_filter = Q(name__icontains=value)
|
qs_filter = Q(name__icontains=value)
|
||||||
return queryset.filter(qs_filter)
|
return queryset.filter(qs_filter)
|
||||||
|
|
||||||
|
def _console_ports(self, queryset, name, value):
|
||||||
|
return queryset.exclude(consoleports__isnull=value)
|
||||||
|
|
||||||
|
def _console_server_ports(self, queryset, name, value):
|
||||||
|
return queryset.exclude(consoleserverports__isnull=value)
|
||||||
|
|
||||||
|
def _power_ports(self, queryset, name, value):
|
||||||
|
return queryset.exclude(powerports__isnull=value)
|
||||||
|
|
||||||
|
def _power_outlets(self, queryset, name, value):
|
||||||
|
return queryset.exclude(poweroutlets__isnull=value)
|
||||||
|
|
||||||
|
def _interfaces(self, queryset, name, value):
|
||||||
|
return queryset.exclude(interfaces__isnull=value)
|
||||||
|
|
||||||
|
def _pass_through_ports(self, queryset, name, value):
|
||||||
|
return queryset.exclude(
|
||||||
|
frontports__isnull=value,
|
||||||
|
rearports__isnull=value
|
||||||
|
)
|
||||||
|
|
||||||
|
def _has_primary_ip(self, queryset, name, value):
|
||||||
|
params = Q(primary_ip4__isnull=False) | Q(primary_ip6__isnull=False)
|
||||||
|
if value:
|
||||||
|
return queryset.filter(params)
|
||||||
|
return queryset.exclude(params)
|
||||||
|
|
||||||
|
def _has_oob_ip(self, queryset, name, value):
|
||||||
|
params = Q(oob_ip__isnull=False)
|
||||||
|
if value:
|
||||||
|
return queryset.filter(params)
|
||||||
|
return queryset.exclude(params)
|
||||||
|
|
||||||
|
def _virtual_chassis_member(self, queryset, name, value):
|
||||||
|
return queryset.exclude(virtual_chassis__isnull=value)
|
||||||
|
|
||||||
|
class CircuitCoordinatesFilterSet(NetBoxModelFilterSet):
|
||||||
|
group = django_filters.ModelMultipleChoiceFilter(
|
||||||
|
queryset = CoordinateGroup.objects.all(),
|
||||||
|
)
|
||||||
|
|
||||||
|
device = django_filters.ModelMultipleChoiceFilter(
|
||||||
|
queryset = Circuit.objects.all(),
|
||||||
|
)
|
||||||
|
|
||||||
|
class Meta:
|
||||||
|
model = CircuitCoordinate
|
||||||
|
fields = ['id', 'group', 'device', 'x', 'y']
|
||||||
|
|
||||||
|
def search(self, queryset, name, value):
|
||||||
|
"""Perform the filtered search."""
|
||||||
|
if not value.strip():
|
||||||
|
return queryset
|
||||||
|
return queryset.filter(
|
||||||
|
Q(group__name__icontains=value) |
|
||||||
|
Q(device__name__icontains=value)
|
||||||
|
)
|
||||||
|
|
||||||
|
class PowerPanelCoordinatesFilterSet(NetBoxModelFilterSet):
|
||||||
|
group = django_filters.ModelMultipleChoiceFilter(
|
||||||
|
queryset = CoordinateGroup.objects.all(),
|
||||||
|
)
|
||||||
|
|
||||||
|
device = django_filters.ModelMultipleChoiceFilter(
|
||||||
|
queryset = PowerPanel.objects.all(),
|
||||||
|
)
|
||||||
|
|
||||||
|
class Meta:
|
||||||
|
model = PowerPanelCoordinate
|
||||||
|
fields = ['id', 'group', 'device', 'x', 'y']
|
||||||
|
|
||||||
|
def search(self, queryset, name, value):
|
||||||
|
"""Perform the filtered search."""
|
||||||
|
if not value.strip():
|
||||||
|
return queryset
|
||||||
|
return queryset.filter(
|
||||||
|
Q(group__name__icontains=value) |
|
||||||
|
Q(device__name__icontains=value)
|
||||||
|
)
|
||||||
|
|
||||||
|
class PowerFeedCoordinatesFilterSet(NetBoxModelFilterSet):
|
||||||
|
group = django_filters.ModelMultipleChoiceFilter(
|
||||||
|
queryset = CoordinateGroup.objects.all(),
|
||||||
|
)
|
||||||
|
|
||||||
|
device = django_filters.ModelMultipleChoiceFilter(
|
||||||
|
queryset = PowerFeed.objects.all(),
|
||||||
|
)
|
||||||
|
|
||||||
|
class Meta:
|
||||||
|
model = PowerFeedCoordinate
|
||||||
|
fields = ['id', 'group', 'device', 'x', 'y']
|
||||||
|
|
||||||
|
def search(self, queryset, name, value):
|
||||||
|
"""Perform the filtered search."""
|
||||||
|
if not value.strip():
|
||||||
|
return queryset
|
||||||
|
return queryset.filter(
|
||||||
|
Q(group__name__icontains=value) |
|
||||||
|
Q(device__name__icontains=value)
|
||||||
|
)
|
||||||
|
|
||||||
class CoordinatesFilterSet(NetBoxModelFilterSet):
|
class CoordinatesFilterSet(NetBoxModelFilterSet):
|
||||||
group = django_filters.ModelMultipleChoiceFilter(
|
group = django_filters.ModelMultipleChoiceFilter(
|
||||||
queryset = CoordinateGroup.objects.all(),
|
queryset = CoordinateGroup.objects.all(),
|
||||||
|
|||||||
+368
-141
@@ -1,152 +1,262 @@
|
|||||||
from cProfile import label
|
from cProfile import label
|
||||||
import imp
|
|
||||||
from django import forms
|
from django import forms
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
|
|
||||||
from django.utils.translation import gettext as _
|
from django.utils.translation import gettext as _
|
||||||
|
|
||||||
from dcim.models import Device, Site, Region, DeviceRole, Location, Rack
|
from circuits.models import Circuit
|
||||||
|
from dcim.models import Device, Site, SiteGroup, Region, DeviceRole, Location, Rack, Manufacturer, DeviceType, Platform, PowerPanel, PowerFeed
|
||||||
|
|
||||||
from django import forms
|
from django import forms
|
||||||
from dcim.choices import DeviceStatusChoices
|
from dcim.choices import DeviceStatusChoices, DeviceAirflowChoices
|
||||||
from tenancy.models import TenantGroup, Tenant
|
from tenancy.models import TenantGroup, Tenant
|
||||||
from tenancy.forms import TenancyFilterForm
|
from extras.models import ConfigTemplate
|
||||||
|
from extras.forms import LocalConfigContextFilterForm
|
||||||
|
from tenancy.forms import ContactModelFilterForm, TenancyFilterForm
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from netbox.forms import NetBoxModelFilterSetForm, NetBoxModelForm, NetBoxModelImportForm
|
from netbox.forms import NetBoxModelFilterSetForm, NetBoxModelForm, NetBoxModelImportForm
|
||||||
|
from utilities.forms import BOOLEAN_WITH_BLANK_CHOICES, add_blank_choice
|
||||||
from utilities.forms.fields import (
|
from utilities.forms.fields import (
|
||||||
TagFilterField,
|
TagFilterField,
|
||||||
DynamicModelMultipleChoiceField
|
DynamicModelMultipleChoiceField
|
||||||
)
|
)
|
||||||
|
|
||||||
from netbox_topology_views.models import IndividualOptions, CoordinateGroup, Coordinate
|
from netbox_topology_views.models import IndividualOptions, CoordinateGroup, Coordinate, CircuitCoordinate, PowerPanelCoordinate, PowerFeedCoordinate
|
||||||
|
|
||||||
class DeviceFilterForm(TenancyFilterForm, NetBoxModelFilterSetForm):
|
class DeviceFilterForm(
|
||||||
|
LocalConfigContextFilterForm,
|
||||||
|
TenancyFilterForm,
|
||||||
|
ContactModelFilterForm,
|
||||||
|
NetBoxModelFilterSetForm
|
||||||
|
):
|
||||||
|
default_renderer = forms.renderers.DjangoTemplates()
|
||||||
model = Device
|
model = Device
|
||||||
fieldsets = (
|
fieldsets = (
|
||||||
(
|
(None, ('q', 'filter_id', 'tag')),
|
||||||
None,
|
(_('Options'), (
|
||||||
(
|
'group', 'save_coords', 'show_unconnected', 'show_cables', 'show_logical_connections',
|
||||||
"q",
|
'show_single_cable_logical_conns', 'show_neighbors', 'show_circuit', 'show_power', 'show_wireless',
|
||||||
"filter_id",
|
)),
|
||||||
),
|
(_('Device'), ('id',)),
|
||||||
),
|
(_('Location'), ('region_id', 'site_group_id', 'site_id', 'location_id', 'rack_id')),
|
||||||
(
|
(_('Operation'), ('status', 'role_id', 'airflow', 'serial', 'asset_tag', 'mac_address')),
|
||||||
None,
|
(_('Hardware'), ('manufacturer_id', 'device_type_id', 'platform_id')),
|
||||||
(
|
(_('Tenant'), ('tenant_group_id', 'tenant_id')),
|
||||||
"group",
|
(_('Contacts'), ('contact', 'contact_role', 'contact_group')),
|
||||||
"save_coords",
|
(_('Components'), (
|
||||||
"show_unconnected",
|
'console_ports', 'console_server_ports', 'power_ports', 'power_outlets', 'interfaces', 'pass_through_ports',
|
||||||
"show_cables",
|
)),
|
||||||
"show_logical_connections",
|
(_('Miscellaneous'), (
|
||||||
"show_single_cable_logical_conns",
|
'has_primary_ip', 'has_oob_ip', 'virtual_chassis_member', 'config_template_id', 'local_context_data',
|
||||||
"show_neighbors",
|
)),
|
||||||
"show_circuit",
|
|
||||||
"show_power",
|
|
||||||
"show_wireless",
|
|
||||||
),
|
|
||||||
),
|
|
||||||
(
|
|
||||||
None,
|
|
||||||
(
|
|
||||||
"tenant_group_id",
|
|
||||||
"tenant_id",
|
|
||||||
),
|
|
||||||
),
|
|
||||||
(None, ("region_id", "site_id", "location_id", "rack_id")),
|
|
||||||
(
|
|
||||||
None,
|
|
||||||
(
|
|
||||||
"device_role_id",
|
|
||||||
"id",
|
|
||||||
"status",
|
|
||||||
),
|
|
||||||
),
|
|
||||||
(None, ("tag",)),
|
|
||||||
)
|
)
|
||||||
group = forms.ModelChoiceField(
|
group = forms.ModelChoiceField(
|
||||||
queryset=CoordinateGroup.objects.all(),
|
queryset=CoordinateGroup.objects.all(),
|
||||||
required=False,
|
required=False,
|
||||||
label=_("Coordinate group"),
|
label=_('Coordinate group'),
|
||||||
)
|
|
||||||
region_id = DynamicModelMultipleChoiceField(
|
|
||||||
queryset=Region.objects.all(), required=False, label=_("Region")
|
|
||||||
)
|
|
||||||
device_role_id = DynamicModelMultipleChoiceField(
|
|
||||||
queryset=DeviceRole.objects.all(), required=False, label=_("Device Role")
|
|
||||||
)
|
)
|
||||||
id = DynamicModelMultipleChoiceField(
|
id = DynamicModelMultipleChoiceField(
|
||||||
queryset=Device.objects.all(),
|
queryset=Device.objects.all(),
|
||||||
required=False,
|
required=False,
|
||||||
label=_("Device"),
|
label=_('Device'),
|
||||||
query_params={
|
query_params={
|
||||||
"location_id": "$location_id",
|
'location_id': '$location_id',
|
||||||
"region_id": "$region_id",
|
'region_id': '$region_id',
|
||||||
"site_id": "$site_id",
|
'site_group_id': '$site_group_id',
|
||||||
"role_id": "$device_role_id",
|
'site_id': '$site_id',
|
||||||
|
'role_id': '$role_id',
|
||||||
|
'contact': '$contact',
|
||||||
|
'contact_role': '$contact_role',
|
||||||
|
'contact_group': '$contact_group',
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
region_id = DynamicModelMultipleChoiceField(
|
||||||
|
queryset=Region.objects.all(),
|
||||||
|
required=False,
|
||||||
|
label=_('Region')
|
||||||
|
)
|
||||||
|
site_group_id = DynamicModelMultipleChoiceField(
|
||||||
|
queryset=SiteGroup.objects.all(),
|
||||||
|
required=False,
|
||||||
|
label=_('Site Group'),
|
||||||
|
)
|
||||||
site_id = DynamicModelMultipleChoiceField(
|
site_id = DynamicModelMultipleChoiceField(
|
||||||
queryset=Site.objects.all(),
|
queryset=Site.objects.all(),
|
||||||
required=False,
|
required=False,
|
||||||
query_params={
|
query_params={
|
||||||
"region_id": "$region_id",
|
'region_id': '$region_id',
|
||||||
|
'group_id': '$site_group_id',
|
||||||
},
|
},
|
||||||
label=_("Site"),
|
label=_('Site'),
|
||||||
)
|
)
|
||||||
location_id = DynamicModelMultipleChoiceField(
|
location_id = DynamicModelMultipleChoiceField(
|
||||||
queryset=Location.objects.all(),
|
queryset=Location.objects.all(),
|
||||||
required=False,
|
required=False,
|
||||||
query_params={
|
query_params={
|
||||||
"region_id": "$region_id",
|
'region_id': '$region_id',
|
||||||
"site_id": "$site_id",
|
'site_group_id': '$site_group_id',
|
||||||
|
'site_id': '$site_id',
|
||||||
},
|
},
|
||||||
label=_("Location"),
|
label=_('Location'),
|
||||||
)
|
)
|
||||||
rack_id = DynamicModelMultipleChoiceField(
|
rack_id = DynamicModelMultipleChoiceField(
|
||||||
queryset=Rack.objects.all(),
|
queryset=Rack.objects.all(),
|
||||||
required=False,
|
required=False,
|
||||||
query_params={
|
query_params={
|
||||||
"region_id": "$region_id",
|
'region_id': '$region_id',
|
||||||
"site_id": "$site_id",
|
'site_group_id': '$site_group_id',
|
||||||
"location_id": "$location_id",
|
'site_id': '$site_id',
|
||||||
|
'location_id': '$location_id',
|
||||||
},
|
},
|
||||||
label=_("Rack"),
|
label=_('Rack'),
|
||||||
)
|
)
|
||||||
status = forms.MultipleChoiceField(
|
status = forms.MultipleChoiceField(
|
||||||
choices=DeviceStatusChoices, required=False, label=_("Device Status")
|
choices=DeviceStatusChoices,
|
||||||
|
required=False,
|
||||||
|
label=_('Device Status')
|
||||||
)
|
)
|
||||||
|
role_id = DynamicModelMultipleChoiceField(
|
||||||
|
queryset=DeviceRole.objects.all(),
|
||||||
|
required=False,
|
||||||
|
label=_('Role')
|
||||||
|
)
|
||||||
|
airflow = forms.MultipleChoiceField(
|
||||||
|
label=_('Airflow'),
|
||||||
|
choices=add_blank_choice(DeviceAirflowChoices),
|
||||||
|
required=False
|
||||||
|
)
|
||||||
|
serial = forms.CharField(
|
||||||
|
label=_('Serial'),
|
||||||
|
required=False
|
||||||
|
)
|
||||||
|
asset_tag = forms.CharField(
|
||||||
|
label=_('Asset tag'),
|
||||||
|
required=False
|
||||||
|
)
|
||||||
|
mac_address = forms.CharField(
|
||||||
|
required=False,
|
||||||
|
label=_('MAC address')
|
||||||
|
)
|
||||||
|
manufacturer_id = DynamicModelMultipleChoiceField(
|
||||||
|
queryset=Manufacturer.objects.all(),
|
||||||
|
required=False,
|
||||||
|
label=_('Manufacturer')
|
||||||
|
)
|
||||||
|
device_type_id = DynamicModelMultipleChoiceField(
|
||||||
|
queryset=DeviceType.objects.all(),
|
||||||
|
required=False,
|
||||||
|
query_params={
|
||||||
|
'manufacturer_id': '$manufacturer_id'
|
||||||
|
},
|
||||||
|
label=_('Model')
|
||||||
|
)
|
||||||
|
platform_id = DynamicModelMultipleChoiceField(
|
||||||
|
queryset=Platform.objects.all(),
|
||||||
|
required=False,
|
||||||
|
null_option='None',
|
||||||
|
label=_('Platform')
|
||||||
|
)
|
||||||
|
console_ports = forms.NullBooleanField(
|
||||||
|
required=False,
|
||||||
|
label=_('Has console ports'),
|
||||||
|
widget=forms.Select(
|
||||||
|
choices=BOOLEAN_WITH_BLANK_CHOICES
|
||||||
|
)
|
||||||
|
)
|
||||||
|
console_server_ports = forms.NullBooleanField(
|
||||||
|
required=False,
|
||||||
|
label=_('Has console server ports'),
|
||||||
|
widget=forms.Select(
|
||||||
|
choices=BOOLEAN_WITH_BLANK_CHOICES
|
||||||
|
)
|
||||||
|
)
|
||||||
|
power_ports = forms.NullBooleanField(
|
||||||
|
required=False,
|
||||||
|
label=_('Has power ports'),
|
||||||
|
widget=forms.Select(
|
||||||
|
choices=BOOLEAN_WITH_BLANK_CHOICES
|
||||||
|
)
|
||||||
|
)
|
||||||
|
power_outlets = forms.NullBooleanField(
|
||||||
|
required=False,
|
||||||
|
label=_('Has power outlets'),
|
||||||
|
widget=forms.Select(
|
||||||
|
choices=BOOLEAN_WITH_BLANK_CHOICES
|
||||||
|
)
|
||||||
|
)
|
||||||
|
interfaces = forms.NullBooleanField(
|
||||||
|
required=False,
|
||||||
|
label=_('Has interfaces'),
|
||||||
|
widget=forms.Select(
|
||||||
|
choices=BOOLEAN_WITH_BLANK_CHOICES
|
||||||
|
)
|
||||||
|
)
|
||||||
|
pass_through_ports = forms.NullBooleanField(
|
||||||
|
required=False,
|
||||||
|
label=_('Has pass-through ports'),
|
||||||
|
widget=forms.Select(
|
||||||
|
choices=BOOLEAN_WITH_BLANK_CHOICES
|
||||||
|
)
|
||||||
|
)
|
||||||
|
config_template_id = DynamicModelMultipleChoiceField(
|
||||||
|
queryset=ConfigTemplate.objects.all(),
|
||||||
|
required=False,
|
||||||
|
label=_('Config template')
|
||||||
|
)
|
||||||
|
has_primary_ip = forms.NullBooleanField(
|
||||||
|
required=False,
|
||||||
|
label=_('Has a primary IP'),
|
||||||
|
widget=forms.Select(
|
||||||
|
choices=BOOLEAN_WITH_BLANK_CHOICES
|
||||||
|
)
|
||||||
|
)
|
||||||
|
has_oob_ip = forms.NullBooleanField(
|
||||||
|
required=False,
|
||||||
|
label='Has an OOB IP',
|
||||||
|
widget=forms.Select(
|
||||||
|
choices=BOOLEAN_WITH_BLANK_CHOICES
|
||||||
|
)
|
||||||
|
)
|
||||||
|
virtual_chassis_member = forms.NullBooleanField(
|
||||||
|
required=False,
|
||||||
|
label=_('Virtual chassis member'),
|
||||||
|
widget=forms.Select(
|
||||||
|
choices=BOOLEAN_WITH_BLANK_CHOICES
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
tag = TagFilterField(model)
|
tag = TagFilterField(model)
|
||||||
|
|
||||||
# options
|
# options
|
||||||
save_coords = forms.BooleanField(
|
save_coords = forms.BooleanField(
|
||||||
label=_("Save Coordinates"),
|
label=_('Save Coordinates'),
|
||||||
required=False,
|
required=False,
|
||||||
disabled=(not settings.PLUGINS_CONFIG["netbox_topology_views"]["allow_coordinates_saving"] or settings.PLUGINS_CONFIG["netbox_topology_views"]["always_save_coordinates"]),
|
disabled=(not settings.PLUGINS_CONFIG['netbox_topology_views']['allow_coordinates_saving'] or settings.PLUGINS_CONFIG['netbox_topology_views']['always_save_coordinates']),
|
||||||
initial=(settings.PLUGINS_CONFIG["netbox_topology_views"]["always_save_coordinates"])
|
initial=(settings.PLUGINS_CONFIG['netbox_topology_views']['always_save_coordinates'])
|
||||||
)
|
)
|
||||||
show_unconnected = forms.BooleanField(
|
show_unconnected = forms.BooleanField(
|
||||||
label=_("Show Unconnected"), required=False, initial=False
|
label=_('Show Unconnected'), required=False, initial=False
|
||||||
)
|
)
|
||||||
show_cables = forms.BooleanField(
|
show_cables = forms.BooleanField(
|
||||||
label =_("Show Cables"), required=False, initial=False
|
label =_('Show Cables'), required=False, initial=False
|
||||||
)
|
)
|
||||||
show_logical_connections = forms.BooleanField(
|
show_logical_connections = forms.BooleanField(
|
||||||
label =_("Show Logical Connections"), required=False, initial=False
|
label =_('Show Logical Connections'), required=False, initial=False
|
||||||
)
|
)
|
||||||
show_single_cable_logical_conns = forms.BooleanField(
|
show_single_cable_logical_conns = forms.BooleanField(
|
||||||
label =_("Show redundant Cable and Logical Connection"), required=False, initial=False
|
label =_('Show redundant Cable and Logical Connection'), required=False, initial=False
|
||||||
)
|
)
|
||||||
show_neighbors = forms.BooleanField(
|
show_neighbors = forms.BooleanField(
|
||||||
label =_("Show Neighbors"), required=False, initial=False
|
label =_('Show Neighbors'), required=False, initial=False
|
||||||
)
|
)
|
||||||
show_circuit = forms.BooleanField(
|
show_circuit = forms.BooleanField(
|
||||||
label=_("Show Circuit Terminations"), required=False, initial=False
|
label=_('Show Circuit Terminations'), required=False, initial=False
|
||||||
)
|
)
|
||||||
show_power = forms.BooleanField(
|
show_power = forms.BooleanField(
|
||||||
label=_("Show Power Feeds"), required=False, initial=False
|
label=_('Show Power Feeds'), required=False, initial=False
|
||||||
)
|
)
|
||||||
show_wireless = forms.BooleanField(
|
show_wireless = forms.BooleanField(
|
||||||
label =_("Show Wireless Links"), required=False, initial=False
|
label =_('Show Wireless Links'), required=False, initial=False
|
||||||
)
|
)
|
||||||
|
|
||||||
class CoordinateGroupsForm(NetBoxModelForm):
|
class CoordinateGroupsForm(NetBoxModelForm):
|
||||||
@@ -163,6 +273,33 @@ class CoordinateGroupsImportForm(NetBoxModelImportForm):
|
|||||||
model = CoordinateGroup
|
model = CoordinateGroup
|
||||||
fields = ('name', 'description')
|
fields = ('name', 'description')
|
||||||
|
|
||||||
|
class CircuitCoordinatesForm(NetBoxModelForm):
|
||||||
|
fieldsets = (
|
||||||
|
('CircuitCoordinate', ('group', 'device', 'x', 'y')),
|
||||||
|
)
|
||||||
|
|
||||||
|
class Meta:
|
||||||
|
model = CircuitCoordinate
|
||||||
|
fields = ('group', 'device', 'x', 'y')
|
||||||
|
|
||||||
|
class PowerPanelCoordinatesForm(NetBoxModelForm):
|
||||||
|
fieldsets = (
|
||||||
|
('PowerPanel', ('group', 'device', 'x', 'y')),
|
||||||
|
)
|
||||||
|
|
||||||
|
class Meta:
|
||||||
|
model = PowerPanelCoordinate
|
||||||
|
fields = ('group', 'device', 'x', 'y')
|
||||||
|
|
||||||
|
class PowerFeedCoordinatesForm(NetBoxModelForm):
|
||||||
|
fieldsets = (
|
||||||
|
('PowerFeedCoordinate', ('group', 'device', 'x', 'y')),
|
||||||
|
)
|
||||||
|
|
||||||
|
class Meta:
|
||||||
|
model = PowerFeedCoordinate
|
||||||
|
fields = ('group', 'device', 'x', 'y')
|
||||||
|
|
||||||
class CoordinatesForm(NetBoxModelForm):
|
class CoordinatesForm(NetBoxModelForm):
|
||||||
fieldsets = (
|
fieldsets = (
|
||||||
('Coordinate', ('group', 'device', 'x', 'y')),
|
('Coordinate', ('group', 'device', 'x', 'y')),
|
||||||
@@ -172,11 +309,101 @@ class CoordinatesForm(NetBoxModelForm):
|
|||||||
model = Coordinate
|
model = Coordinate
|
||||||
fields = ('group', 'device', 'x', 'y')
|
fields = ('group', 'device', 'x', 'y')
|
||||||
|
|
||||||
|
class CircuitCoordinatesImportForm(NetBoxModelImportForm):
|
||||||
|
class Meta:
|
||||||
|
model = CircuitCoordinate
|
||||||
|
fields = ('group', 'device', 'x', 'y')
|
||||||
|
|
||||||
|
class PowerPanelCoordinatesImportForm(NetBoxModelImportForm):
|
||||||
|
class Meta:
|
||||||
|
model = PowerPanelCoordinate
|
||||||
|
fields = ('group', 'device', 'x', 'y')
|
||||||
|
|
||||||
|
class PowerFeedCoordinatesImportForm(NetBoxModelImportForm):
|
||||||
|
class Meta:
|
||||||
|
model = PowerFeedCoordinate
|
||||||
|
fields = ('group', 'device', 'x', 'y')
|
||||||
|
|
||||||
class CoordinatesImportForm(NetBoxModelImportForm):
|
class CoordinatesImportForm(NetBoxModelImportForm):
|
||||||
class Meta:
|
class Meta:
|
||||||
model = Coordinate
|
model = Coordinate
|
||||||
fields = ('group', 'device', 'x', 'y')
|
fields = ('group', 'device', 'x', 'y')
|
||||||
|
|
||||||
|
class CircuitCoordinatesFilterForm(NetBoxModelFilterSetForm):
|
||||||
|
model = CircuitCoordinate
|
||||||
|
fieldsets = (
|
||||||
|
(None, ('q', 'filter_id')),
|
||||||
|
('CircuitCoordinates', ('group', 'device', 'x', 'y'))
|
||||||
|
)
|
||||||
|
|
||||||
|
group = forms.ModelMultipleChoiceField(
|
||||||
|
queryset=CoordinateGroup.objects.all(),
|
||||||
|
required=False
|
||||||
|
)
|
||||||
|
|
||||||
|
device = DynamicModelMultipleChoiceField(
|
||||||
|
queryset=Circuit.objects.all(),
|
||||||
|
required=False
|
||||||
|
)
|
||||||
|
|
||||||
|
x = forms.IntegerField(
|
||||||
|
required=False
|
||||||
|
)
|
||||||
|
|
||||||
|
y = forms.IntegerField(
|
||||||
|
required=False
|
||||||
|
)
|
||||||
|
|
||||||
|
class PowerPanelCoordinatesFilterForm(NetBoxModelFilterSetForm):
|
||||||
|
model = PowerPanelCoordinate
|
||||||
|
fieldsets = (
|
||||||
|
(None, ('q', 'filter_id')),
|
||||||
|
('PowerPanelCoordinates', ('group', 'device', 'x', 'y'))
|
||||||
|
)
|
||||||
|
|
||||||
|
group = forms.ModelMultipleChoiceField(
|
||||||
|
queryset=CoordinateGroup.objects.all(),
|
||||||
|
required=False
|
||||||
|
)
|
||||||
|
|
||||||
|
device = DynamicModelMultipleChoiceField(
|
||||||
|
queryset=PowerPanel.objects.all(),
|
||||||
|
required=False
|
||||||
|
)
|
||||||
|
|
||||||
|
x = forms.IntegerField(
|
||||||
|
required=False
|
||||||
|
)
|
||||||
|
|
||||||
|
y = forms.IntegerField(
|
||||||
|
required=False
|
||||||
|
)
|
||||||
|
|
||||||
|
class PowerFeedCoordinatesFilterForm(NetBoxModelFilterSetForm):
|
||||||
|
model = Coordinate
|
||||||
|
fieldsets = (
|
||||||
|
(None, ('q', 'filter_id')),
|
||||||
|
('PowerFeedCoordinates', ('group', 'device', 'x', 'y'))
|
||||||
|
)
|
||||||
|
|
||||||
|
group = forms.ModelMultipleChoiceField(
|
||||||
|
queryset=CoordinateGroup.objects.all(),
|
||||||
|
required=False
|
||||||
|
)
|
||||||
|
|
||||||
|
device = DynamicModelMultipleChoiceField(
|
||||||
|
queryset=PowerFeed.objects.all(),
|
||||||
|
required=False
|
||||||
|
)
|
||||||
|
|
||||||
|
x = forms.IntegerField(
|
||||||
|
required=False
|
||||||
|
)
|
||||||
|
|
||||||
|
y = forms.IntegerField(
|
||||||
|
required=False
|
||||||
|
)
|
||||||
|
|
||||||
class CoordinatesFilterForm(NetBoxModelFilterSetForm):
|
class CoordinatesFilterForm(NetBoxModelFilterSetForm):
|
||||||
model = Coordinate
|
model = Coordinate
|
||||||
fieldsets = (
|
fieldsets = (
|
||||||
@@ -207,20 +434,20 @@ class IndividualOptionsForm(NetBoxModelForm):
|
|||||||
(
|
(
|
||||||
None,
|
None,
|
||||||
(
|
(
|
||||||
"user_id",
|
'user_id',
|
||||||
"ignore_cable_type",
|
'ignore_cable_type',
|
||||||
"preselected_device_roles",
|
'preselected_device_roles',
|
||||||
"preselected_tags",
|
'preselected_tags',
|
||||||
"save_coords",
|
'save_coords',
|
||||||
"show_unconnected",
|
'show_unconnected',
|
||||||
"show_cables",
|
'show_cables',
|
||||||
"show_logical_connections",
|
'show_logical_connections',
|
||||||
"show_single_cable_logical_conns",
|
'show_single_cable_logical_conns',
|
||||||
"show_neighbors",
|
'show_neighbors',
|
||||||
"show_circuit",
|
'show_circuit',
|
||||||
"show_power",
|
'show_power',
|
||||||
"show_wireless",
|
'show_wireless',
|
||||||
"draw_default_layout",
|
'draw_default_layout',
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
@@ -228,105 +455,105 @@ class IndividualOptionsForm(NetBoxModelForm):
|
|||||||
user_id = forms.CharField(widget=forms.HiddenInput())
|
user_id = forms.CharField(widget=forms.HiddenInput())
|
||||||
|
|
||||||
ignore_cable_type = forms.MultipleChoiceField(
|
ignore_cable_type = forms.MultipleChoiceField(
|
||||||
label=_("Ignore Termination Types"),
|
label=_('Ignore Termination Types'),
|
||||||
required=False,
|
required=False,
|
||||||
choices=IndividualOptions.CHOICES,
|
choices=IndividualOptions.CHOICES,
|
||||||
help_text=_("Choose Termination Types that you want to be ignored. "
|
help_text=_('Choose Termination Types that you want to be ignored. '
|
||||||
"If any ignored Termination Type is part of a connection, the "
|
'If any ignored Termination Type is part of a connection, the '
|
||||||
"cable is not displayed.")
|
'cable is not displayed.')
|
||||||
)
|
)
|
||||||
preselected_device_roles = DynamicModelMultipleChoiceField(
|
preselected_device_roles = DynamicModelMultipleChoiceField(
|
||||||
label=_("Preselected Device Role"),
|
label=_('Preselected Device Role'),
|
||||||
queryset=DeviceRole.objects.all(),
|
queryset=DeviceRole.objects.all(),
|
||||||
required=False,
|
required=False,
|
||||||
help_text=_("Select Device Roles that you want to have "
|
help_text=_('Select Device Roles that you want to have '
|
||||||
"preselected in the filter tab.")
|
'preselected in the filter tab.')
|
||||||
)
|
)
|
||||||
preselected_tags = forms.ModelMultipleChoiceField(
|
preselected_tags = forms.ModelMultipleChoiceField(
|
||||||
label=_("Preselected Tags"),
|
label=_('Preselected Tags'),
|
||||||
queryset=Device.tags.all(),
|
queryset=Device.tags.all(),
|
||||||
required=False,
|
required=False,
|
||||||
help_text=_("Select Tags that you want to have "
|
help_text=_('Select Tags that you want to have '
|
||||||
"preselected in the filter tab.")
|
'preselected in the filter tab.')
|
||||||
)
|
)
|
||||||
save_coords = forms.BooleanField(
|
save_coords = forms.BooleanField(
|
||||||
label=_("Save Coordinates"),
|
label=_('Save Coordinates'),
|
||||||
required=False,
|
required=False,
|
||||||
initial=False,
|
initial=False,
|
||||||
help_text=_("Coordinates of nodes will be saved if dragged to a different "
|
help_text=_('Coordinates of nodes will be saved if dragged to a different '
|
||||||
"position. This option depends on parameters set in the config file. "
|
'position. This option depends on parameters set in the config file. '
|
||||||
"It has no effect if 'allow_coordinates_saving' has not been set or "
|
'It has no effect if \'allow_coordinates_saving\' has not been set or '
|
||||||
" 'always_save_coordinates' has been set.")
|
' \'always_save_coordinates\' has been set.')
|
||||||
)
|
)
|
||||||
show_unconnected = forms.BooleanField(
|
show_unconnected = forms.BooleanField(
|
||||||
label=_("Show Unconnected"),
|
label=_('Show Unconnected'),
|
||||||
required=False,
|
required=False,
|
||||||
initial=False,
|
initial=False,
|
||||||
help_text=_("Draws devices that have no connections or for which no "
|
help_text=_('Draws devices that have no connections or for which no '
|
||||||
"connection is displayed. This option depends on other parameters "
|
'connection is displayed. This option depends on other parameters '
|
||||||
"like 'Show Cables' and 'Show Logical Connections'.")
|
'like \'Show Cables\' and \'Show Logical Connections\'.')
|
||||||
)
|
)
|
||||||
show_cables = forms.BooleanField(
|
show_cables = forms.BooleanField(
|
||||||
label =_("Show Cables"),
|
label =_('Show Cables'),
|
||||||
required=False,
|
required=False,
|
||||||
initial=False,
|
initial=False,
|
||||||
help_text=_("Displays connections between interfaces that are connected "
|
help_text=_('Displays connections between interfaces that are connected '
|
||||||
"with one or more cables. These connections are displayed as solid "
|
'with one or more cables. These connections are displayed as solid '
|
||||||
"lines in the color of the cable.")
|
'lines in the color of the cable.')
|
||||||
)
|
)
|
||||||
show_logical_connections = forms.BooleanField(
|
show_logical_connections = forms.BooleanField(
|
||||||
label =_("Show Logical Connections"),
|
label =_('Show Logical Connections'),
|
||||||
required=False,
|
required=False,
|
||||||
initial=False,
|
initial=False,
|
||||||
help_text=_("Displays connections between devices that are not "
|
help_text=_('Displays connections between devices that are not '
|
||||||
"directly connected (e.g. via patch panels). These connections "
|
'directly connected (e.g. via patch panels). These connections '
|
||||||
"are displayed as yellow dotted lines.")
|
'are displayed as yellow dotted lines.')
|
||||||
)
|
)
|
||||||
show_single_cable_logical_conns = forms.BooleanField(
|
show_single_cable_logical_conns = forms.BooleanField(
|
||||||
label = ("Show redundant Cable and Logical Connection"),
|
label = ('Show redundant Cable and Logical Connection'),
|
||||||
required = False,
|
required = False,
|
||||||
initial=False,
|
initial=False,
|
||||||
help_text=_("Shows a logical connection (in addition to a cable), "
|
help_text=_('Shows a logical connection (in addition to a cable), '
|
||||||
"even if a cable is directly connected. Leaving this option "
|
'even if a cable is directly connected. Leaving this option '
|
||||||
"disabled prevents that redundant display. This option only "
|
'disabled prevents that redundant display. This option only '
|
||||||
"has an effect if 'Show Logical Connections' is activated.")
|
'has an effect if \'Show Logical Connections\' is activated.')
|
||||||
)
|
)
|
||||||
show_neighbors = forms.BooleanField(
|
show_neighbors = forms.BooleanField(
|
||||||
label =_("Show Neighbors"),
|
label =_('Show Neighbors'),
|
||||||
required=False,
|
required=False,
|
||||||
initial=False,
|
initial=False,
|
||||||
help_text=_("Adds neighbors to the filter result set automatically. "
|
help_text=_('Adds neighbors to the filter result set automatically. '
|
||||||
"Link peers will be added if 'Show Cables' is ticked, far-end "
|
'Link peers will be added if \'Show Cables\' is ticked, far-end '
|
||||||
"terminations will be added if 'Show Logical Connections' is ticked.")
|
'terminations will be added if \'Show Logical Connections\' is ticked.')
|
||||||
)
|
)
|
||||||
show_circuit = forms.BooleanField(
|
show_circuit = forms.BooleanField(
|
||||||
label=_("Show Circuit Terminations"),
|
label=_('Show Circuit Terminations'),
|
||||||
required=False,
|
required=False,
|
||||||
initial=False,
|
initial=False,
|
||||||
help_text=_("Displays connections between circuit terminations. "
|
help_text=_('Displays connections between circuit terminations. '
|
||||||
"These connections are displayed as blue dashed lines.")
|
'These connections are displayed as blue dashed lines.')
|
||||||
)
|
)
|
||||||
show_power = forms.BooleanField(
|
show_power = forms.BooleanField(
|
||||||
label=_("Show Power Feeds"),
|
label=_('Show Power Feeds'),
|
||||||
required=False,
|
required=False,
|
||||||
initial=False,
|
initial=False,
|
||||||
help_text=_("Displays connections between power outlets and power "
|
help_text=_('Displays connections between power outlets and power '
|
||||||
"ports. These connections are displayed as solid lines in the "
|
'ports. These connections are displayed as solid lines in the '
|
||||||
"color of the cable. This option depends on 'Show Cables'.")
|
'color of the cable. This option depends on \'Show Cables\'.')
|
||||||
)
|
)
|
||||||
show_wireless = forms.BooleanField(
|
show_wireless = forms.BooleanField(
|
||||||
label =_("Show Wireless Links"),
|
label =_('Show Wireless Links'),
|
||||||
required=False,
|
required=False,
|
||||||
initial=False,
|
initial=False,
|
||||||
help_text=_("Displays wireless connections. These connections are "
|
help_text=_('Displays wireless connections. These connections are '
|
||||||
"displayed as blue dotted lines.")
|
'displayed as blue dotted lines.')
|
||||||
)
|
)
|
||||||
draw_default_layout = forms.BooleanField(
|
draw_default_layout = forms.BooleanField(
|
||||||
label = ("Draw Default Layout"),
|
label = ('Draw Default Layout'),
|
||||||
required=False,
|
required=False,
|
||||||
initial=False,
|
initial=False,
|
||||||
help_text=_("Enable this option if you want to draw the topology on "
|
help_text=_('Enable this option if you want to draw the topology on '
|
||||||
"the initial load (when you go to the topology plugin page).")
|
'the initial load (when you go to the topology plugin page).')
|
||||||
)
|
)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
|
|||||||
@@ -9,8 +9,6 @@ import utilities.json
|
|||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
('dcim', '0171_cabletermination_change_logging'),
|
|
||||||
('extras', '0092_delete_jobresult'),
|
|
||||||
('netbox_topology_views', '0003_individualoptions_show_neighbors'),
|
('netbox_topology_views', '0003_individualoptions_show_neighbors'),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|||||||
+70
@@ -0,0 +1,70 @@
|
|||||||
|
# Generated by Django 4.1.8 on 2023-09-25 21:18
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
import django.db.models.deletion
|
||||||
|
import taggit.managers
|
||||||
|
import utilities.json
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('netbox_topology_views', '0005_individualoptions_save_coords'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.CreateModel(
|
||||||
|
name='PowerPanelCoordinate',
|
||||||
|
fields=[
|
||||||
|
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False)),
|
||||||
|
('created', models.DateTimeField(auto_now_add=True, null=True)),
|
||||||
|
('last_updated', models.DateTimeField(auto_now=True, null=True)),
|
||||||
|
('custom_field_data', models.JSONField(blank=True, default=dict, encoder=utilities.json.CustomFieldJSONEncoder)),
|
||||||
|
('x', models.IntegerField()),
|
||||||
|
('y', models.IntegerField()),
|
||||||
|
('device', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='dcim.powerpanel')),
|
||||||
|
('group', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='netbox_topology_views.coordinategroup')),
|
||||||
|
('tags', taggit.managers.TaggableManager(through='extras.TaggedItem', to='extras.Tag')),
|
||||||
|
],
|
||||||
|
options={
|
||||||
|
'ordering': ['group', 'device'],
|
||||||
|
'unique_together': {('device', 'group')},
|
||||||
|
},
|
||||||
|
),
|
||||||
|
migrations.CreateModel(
|
||||||
|
name='PowerFeedCoordinate',
|
||||||
|
fields=[
|
||||||
|
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False)),
|
||||||
|
('created', models.DateTimeField(auto_now_add=True, null=True)),
|
||||||
|
('last_updated', models.DateTimeField(auto_now=True, null=True)),
|
||||||
|
('custom_field_data', models.JSONField(blank=True, default=dict, encoder=utilities.json.CustomFieldJSONEncoder)),
|
||||||
|
('x', models.IntegerField()),
|
||||||
|
('y', models.IntegerField()),
|
||||||
|
('device', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='dcim.powerfeed')),
|
||||||
|
('group', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='netbox_topology_views.coordinategroup')),
|
||||||
|
('tags', taggit.managers.TaggableManager(through='extras.TaggedItem', to='extras.Tag')),
|
||||||
|
],
|
||||||
|
options={
|
||||||
|
'ordering': ['group', 'device'],
|
||||||
|
'unique_together': {('device', 'group')},
|
||||||
|
},
|
||||||
|
),
|
||||||
|
migrations.CreateModel(
|
||||||
|
name='CircuitCoordinate',
|
||||||
|
fields=[
|
||||||
|
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False)),
|
||||||
|
('created', models.DateTimeField(auto_now_add=True, null=True)),
|
||||||
|
('last_updated', models.DateTimeField(auto_now=True, null=True)),
|
||||||
|
('custom_field_data', models.JSONField(blank=True, default=dict, encoder=utilities.json.CustomFieldJSONEncoder)),
|
||||||
|
('x', models.IntegerField()),
|
||||||
|
('y', models.IntegerField()),
|
||||||
|
('device', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='circuits.circuit')),
|
||||||
|
('group', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='netbox_topology_views.coordinategroup')),
|
||||||
|
('tags', taggit.managers.TaggableManager(through='extras.TaggedItem', to='extras.Tag')),
|
||||||
|
],
|
||||||
|
options={
|
||||||
|
'ordering': ['group', 'device'],
|
||||||
|
'unique_together': {('device', 'group')},
|
||||||
|
},
|
||||||
|
),
|
||||||
|
]
|
||||||
@@ -1,7 +1,8 @@
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import Optional
|
from typing import Optional
|
||||||
|
|
||||||
from dcim.models import Device, DeviceRole
|
from circuits.models import Circuit
|
||||||
|
from dcim.models import Device, DeviceRole, PowerPanel, PowerFeed
|
||||||
from extras.models import Tag
|
from extras.models import Tag
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.contrib.contenttypes.models import ContentType
|
from django.contrib.contenttypes.models import ContentType
|
||||||
@@ -12,7 +13,7 @@ from netbox.models import NetBoxModel
|
|||||||
from netbox.models.features import (
|
from netbox.models.features import (
|
||||||
ChangeLoggingMixin,
|
ChangeLoggingMixin,
|
||||||
ExportTemplatesMixin,
|
ExportTemplatesMixin,
|
||||||
WebhooksMixin,
|
EventRulesMixin,
|
||||||
)
|
)
|
||||||
|
|
||||||
from netbox_topology_views.utils import (
|
from netbox_topology_views.utils import (
|
||||||
@@ -25,7 +26,7 @@ from netbox_topology_views.utils import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
class RoleImage(ChangeLoggingMixin, ExportTemplatesMixin, WebhooksMixin):
|
class RoleImage(ChangeLoggingMixin, ExportTemplatesMixin, EventRulesMixin):
|
||||||
class Meta:
|
class Meta:
|
||||||
indexes = [
|
indexes = [
|
||||||
models.Index(fields=["content_type", "object_id"]),
|
models.Index(fields=["content_type", "object_id"]),
|
||||||
@@ -130,11 +131,11 @@ class Coordinate(NetBoxModel):
|
|||||||
|
|
||||||
x = models.IntegerField(
|
x = models.IntegerField(
|
||||||
help_text='X-coordinate of the device (horizontal) on the canvas. '
|
help_text='X-coordinate of the device (horizontal) on the canvas. '
|
||||||
'Smaller values correspond to a position further up on the monitor.',
|
'Smaller values correspond to a position further to the left on the monitor.',
|
||||||
)
|
)
|
||||||
y = models.IntegerField(
|
y = models.IntegerField(
|
||||||
help_text='Y-coordinate of the device (vertical) on the canvas. '
|
help_text='Y-coordinate of the device (vertical) on the canvas. '
|
||||||
'Smaller values correspond to a position further to the left on the monitor.',
|
'Smaller values correspond to a position further up on the monitor.',
|
||||||
)
|
)
|
||||||
|
|
||||||
def get_or_create_default_group(group_id):
|
def get_or_create_default_group(group_id):
|
||||||
@@ -168,6 +169,153 @@ class Coordinate(NetBoxModel):
|
|||||||
def get_absolute_url(self):
|
def get_absolute_url(self):
|
||||||
return reverse('plugins:netbox_topology_views:coordinate', args=[self.pk])
|
return reverse('plugins:netbox_topology_views:coordinate', args=[self.pk])
|
||||||
|
|
||||||
|
class CircuitCoordinate(NetBoxModel):
|
||||||
|
"""
|
||||||
|
Coordinates are being used to place devices in a topology view onto a certain
|
||||||
|
position. Devices belong to one or more coordinate groups. They have to
|
||||||
|
be unique together.
|
||||||
|
"""
|
||||||
|
device = models.ForeignKey(Circuit, on_delete=models.CASCADE)
|
||||||
|
group = models.ForeignKey(CoordinateGroup, on_delete=models.CASCADE)
|
||||||
|
|
||||||
|
x = models.IntegerField(
|
||||||
|
help_text='X-coordinate of the device (horizontal) on the canvas. '
|
||||||
|
'Smaller values correspond to a position further to the left on the monitor.',
|
||||||
|
)
|
||||||
|
y = models.IntegerField(
|
||||||
|
help_text='Y-coordinate of the device (vertical) on the canvas. '
|
||||||
|
'Smaller values correspond to a position further up on the monitor.',
|
||||||
|
)
|
||||||
|
|
||||||
|
def get_or_create_default_group(group_id):
|
||||||
|
# Default group named "default" must always exist in order to make sure
|
||||||
|
# that coordinate values can be stored even if no coordinate group has been
|
||||||
|
# selected. The default group will be added automatically if it does not exist.
|
||||||
|
try:
|
||||||
|
if CoordinateGroup.objects.filter(name="default"):
|
||||||
|
group = CoordinateGroup.objects.get(name="default")
|
||||||
|
group_id = group.pk
|
||||||
|
else:
|
||||||
|
group = CoordinateGroup(
|
||||||
|
name="default",
|
||||||
|
description="Automatically generated default group. If you delete "
|
||||||
|
"this group, all default coordinates are gone for good but "
|
||||||
|
"the group itself will be re-created."
|
||||||
|
)
|
||||||
|
group.save()
|
||||||
|
group_id = group.pk
|
||||||
|
except:
|
||||||
|
return False
|
||||||
|
return group_id
|
||||||
|
|
||||||
|
class Meta:
|
||||||
|
ordering = ['group', 'device']
|
||||||
|
unique_together = ('device', 'group')
|
||||||
|
|
||||||
|
def __str__(self):
|
||||||
|
return f'{self.x};{self.y}'
|
||||||
|
|
||||||
|
def get_absolute_url(self):
|
||||||
|
return reverse('plugins:netbox_topology_views:circuitcoordinate', args=[self.pk])
|
||||||
|
|
||||||
|
class PowerPanelCoordinate(NetBoxModel):
|
||||||
|
"""
|
||||||
|
Coordinates are being used to place devices in a topology view onto a certain
|
||||||
|
position. Devices belong to one or more coordinate groups. They have to
|
||||||
|
be unique together.
|
||||||
|
"""
|
||||||
|
device = models.ForeignKey(PowerPanel, on_delete=models.CASCADE)
|
||||||
|
group = models.ForeignKey(CoordinateGroup, on_delete=models.CASCADE)
|
||||||
|
|
||||||
|
x = models.IntegerField(
|
||||||
|
help_text='X-coordinate of the device (horizontal) on the canvas. '
|
||||||
|
'Smaller values correspond to a position further to the left on the monitor.',
|
||||||
|
)
|
||||||
|
y = models.IntegerField(
|
||||||
|
help_text='Y-coordinate of the device (vertical) on the canvas. '
|
||||||
|
'Smaller values correspond to a position further up on the monitor.',
|
||||||
|
)
|
||||||
|
|
||||||
|
def get_or_create_default_group(group_id):
|
||||||
|
# Default group named "default" must always exist in order to make sure
|
||||||
|
# that coordinate values can be stored even if no coordinate group has been
|
||||||
|
# selected. The default group will be added automatically if it does not exist.
|
||||||
|
try:
|
||||||
|
if CoordinateGroup.objects.filter(name="default"):
|
||||||
|
group = CoordinateGroup.objects.get(name="default")
|
||||||
|
group_id = group.pk
|
||||||
|
else:
|
||||||
|
group = CoordinateGroup(
|
||||||
|
name="default",
|
||||||
|
description="Automatically generated default group. If you delete "
|
||||||
|
"this group, all default coordinates are gone for good but "
|
||||||
|
"the group itself will be re-created."
|
||||||
|
)
|
||||||
|
group.save()
|
||||||
|
group_id = group.pk
|
||||||
|
except:
|
||||||
|
return False
|
||||||
|
return group_id
|
||||||
|
|
||||||
|
class Meta:
|
||||||
|
ordering = ['group', 'device']
|
||||||
|
unique_together = ('device', 'group')
|
||||||
|
|
||||||
|
def __str__(self):
|
||||||
|
return f'{self.x};{self.y}'
|
||||||
|
|
||||||
|
def get_absolute_url(self):
|
||||||
|
return reverse('plugins:netbox_topology_views:powerpanelcoordinate', args=[self.pk])
|
||||||
|
|
||||||
|
class PowerFeedCoordinate(NetBoxModel):
|
||||||
|
"""
|
||||||
|
Coordinates are being used to place devices in a topology view onto a certain
|
||||||
|
position. Devices belong to one or more coordinate groups. They have to
|
||||||
|
be unique together.
|
||||||
|
"""
|
||||||
|
device = models.ForeignKey(PowerFeed, on_delete=models.CASCADE)
|
||||||
|
group = models.ForeignKey(CoordinateGroup, on_delete=models.CASCADE)
|
||||||
|
|
||||||
|
x = models.IntegerField(
|
||||||
|
help_text='X-coordinate of the device (horizontal) on the canvas. '
|
||||||
|
'Smaller values correspond to a position further to the left on the monitor.',
|
||||||
|
)
|
||||||
|
y = models.IntegerField(
|
||||||
|
help_text='Y-coordinate of the device (vertical) on the canvas. '
|
||||||
|
'Smaller values correspond to a position further up on the monitor.',
|
||||||
|
)
|
||||||
|
|
||||||
|
def get_or_create_default_group(group_id):
|
||||||
|
# Default group named "default" must always exist in order to make sure
|
||||||
|
# that coordinate values can be stored even if no coordinate group has been
|
||||||
|
# selected. The default group will be added automatically if it does not exist.
|
||||||
|
try:
|
||||||
|
if CoordinateGroup.objects.filter(name="default"):
|
||||||
|
group = CoordinateGroup.objects.get(name="default")
|
||||||
|
group_id = group.pk
|
||||||
|
else:
|
||||||
|
group = CoordinateGroup(
|
||||||
|
name="default",
|
||||||
|
description="Automatically generated default group. If you delete "
|
||||||
|
"this group, all default coordinates are gone for good but "
|
||||||
|
"the group itself will be re-created."
|
||||||
|
)
|
||||||
|
group.save()
|
||||||
|
group_id = group.pk
|
||||||
|
except:
|
||||||
|
return False
|
||||||
|
return group_id
|
||||||
|
|
||||||
|
class Meta:
|
||||||
|
ordering = ['group', 'device']
|
||||||
|
unique_together = ('device', 'group')
|
||||||
|
|
||||||
|
def __str__(self):
|
||||||
|
return f'{self.x};{self.y}'
|
||||||
|
|
||||||
|
def get_absolute_url(self):
|
||||||
|
return reverse('plugins:netbox_topology_views:powerfeedcoordinate', args=[self.pk])
|
||||||
|
|
||||||
class IndividualOptions(NetBoxModel):
|
class IndividualOptions(NetBoxModel):
|
||||||
CHOICES = (
|
CHOICES = (
|
||||||
('interface', 'interface'),
|
('interface', 'interface'),
|
||||||
|
|||||||
@@ -7,12 +7,65 @@ coordinategroup_buttons = (
|
|||||||
title='Add',
|
title='Add',
|
||||||
icon_class='mdi mdi-plus-thick',
|
icon_class='mdi mdi-plus-thick',
|
||||||
color=ButtonColorChoices.GREEN,
|
color=ButtonColorChoices.GREEN,
|
||||||
|
permissions=['netbox_topology_views.add_coordinategroup']
|
||||||
),
|
),
|
||||||
PluginMenuButton(
|
PluginMenuButton(
|
||||||
link='plugins:netbox_topology_views:coordinategroup_import',
|
link='plugins:netbox_topology_views:coordinategroup_import',
|
||||||
title='Import',
|
title='Import',
|
||||||
icon_class='mdi mdi-upload',
|
icon_class='mdi mdi-upload',
|
||||||
color=ButtonColorChoices.CYAN,
|
color=ButtonColorChoices.CYAN,
|
||||||
|
permissions=['netbox_topology_views.add_coordinategroup']
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
circuitcoordinate_buttons = (
|
||||||
|
PluginMenuButton(
|
||||||
|
link='plugins:netbox_topology_views:circuitcoordinate_add',
|
||||||
|
title='Add',
|
||||||
|
icon_class='mdi mdi-plus-thick',
|
||||||
|
color=ButtonColorChoices.GREEN,
|
||||||
|
permissions=['netbox_topology_views.add_coordinate']
|
||||||
|
),
|
||||||
|
PluginMenuButton(
|
||||||
|
link='plugins:netbox_topology_views:circuitcoordinate_import',
|
||||||
|
title='Import',
|
||||||
|
icon_class='mdi mdi-upload',
|
||||||
|
color=ButtonColorChoices.CYAN,
|
||||||
|
permissions=['netbox_topology_views.add_coordinate']
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
powerpanelcoordinate_buttons = (
|
||||||
|
PluginMenuButton(
|
||||||
|
link='plugins:netbox_topology_views:powerpanelcoordinate_add',
|
||||||
|
title='Add',
|
||||||
|
icon_class='mdi mdi-plus-thick',
|
||||||
|
color=ButtonColorChoices.GREEN,
|
||||||
|
permissions=['netbox_topology_views.add_coordinate']
|
||||||
|
),
|
||||||
|
PluginMenuButton(
|
||||||
|
link='plugins:netbox_topology_views:powerpanelcoordinate_import',
|
||||||
|
title='Import',
|
||||||
|
icon_class='mdi mdi-upload',
|
||||||
|
color=ButtonColorChoices.CYAN,
|
||||||
|
permissions=['netbox_topology_views.add_coordinate']
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
powerfeedcoordinate_buttons = (
|
||||||
|
PluginMenuButton(
|
||||||
|
link='plugins:netbox_topology_views:powerfeedcoordinate_add',
|
||||||
|
title='Add',
|
||||||
|
icon_class='mdi mdi-plus-thick',
|
||||||
|
color=ButtonColorChoices.GREEN,
|
||||||
|
permissions=['netbox_topology_views.add_coordinate']
|
||||||
|
),
|
||||||
|
PluginMenuButton(
|
||||||
|
link='plugins:netbox_topology_views:powerfeedcoordinate_import',
|
||||||
|
title='Import',
|
||||||
|
icon_class='mdi mdi-upload',
|
||||||
|
color=ButtonColorChoices.CYAN,
|
||||||
|
permissions=['netbox_topology_views.add_coordinate']
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -22,12 +75,14 @@ coordinate_buttons = (
|
|||||||
title='Add',
|
title='Add',
|
||||||
icon_class='mdi mdi-plus-thick',
|
icon_class='mdi mdi-plus-thick',
|
||||||
color=ButtonColorChoices.GREEN,
|
color=ButtonColorChoices.GREEN,
|
||||||
|
permissions=['netbox_topology_views.add_coordinate']
|
||||||
),
|
),
|
||||||
PluginMenuButton(
|
PluginMenuButton(
|
||||||
link='plugins:netbox_topology_views:coordinate_import',
|
link='plugins:netbox_topology_views:coordinate_import',
|
||||||
title='Import',
|
title='Import',
|
||||||
icon_class='mdi mdi-upload',
|
icon_class='mdi mdi-upload',
|
||||||
color=ButtonColorChoices.CYAN,
|
color=ButtonColorChoices.CYAN,
|
||||||
|
permissions=['netbox_topology_views.add_coordinate']
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -37,15 +92,22 @@ menu = PluginMenu(
|
|||||||
groups=(
|
groups=(
|
||||||
('TOPOLOGY',
|
('TOPOLOGY',
|
||||||
(
|
(
|
||||||
PluginMenuItem(link="plugins:netbox_topology_views:home", link_text="Topology"),
|
PluginMenuItem(link="plugins:netbox_topology_views:home", link_text="Topology", permissions=["dcim.view_site", "dcim.view_device"]),
|
||||||
PluginMenuItem(link="plugins:netbox_topology_views:coordinategroup_list", link_text="Coordinate Groups", buttons=coordinategroup_buttons),
|
),
|
||||||
PluginMenuItem(link="plugins:netbox_topology_views:coordinate_list", link_text="Coordinates", buttons=coordinate_buttons),
|
),
|
||||||
|
('COORDINATES',
|
||||||
|
(
|
||||||
|
PluginMenuItem(link="plugins:netbox_topology_views:coordinategroup_list", link_text="Coordinate Groups", buttons=coordinategroup_buttons, permissions=['netbox_topology_views.view_coordinategroup']),
|
||||||
|
PluginMenuItem(link="plugins:netbox_topology_views:coordinate_list", link_text="Device Coordinates", buttons=coordinate_buttons, permissions=['netbox_topology_views.view_coordinate']),
|
||||||
|
PluginMenuItem(link="plugins:netbox_topology_views:powerfeedcoordinate_list", link_text="Power Feed Coords", buttons=powerfeedcoordinate_buttons, permissions=['netbox_topology_views.view_coordinate']),
|
||||||
|
PluginMenuItem(link="plugins:netbox_topology_views:powerpanelcoordinate_list", link_text="Power Panel Coords", buttons=powerpanelcoordinate_buttons, permissions=['netbox_topology_views.view_coordinate']),
|
||||||
|
PluginMenuItem(link="plugins:netbox_topology_views:circuitcoordinate_list", link_text="Circuit Coordinates", buttons=circuitcoordinate_buttons, permissions=['netbox_topology_views.view_coordinate']),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
('PREFERENCES',
|
('PREFERENCES',
|
||||||
(
|
(
|
||||||
PluginMenuItem(link="plugins:netbox_topology_views:images", link_text="Images"),
|
PluginMenuItem(link="plugins:netbox_topology_views:images", link_text="Images", permissions=[ "dcim.view_site","dcim.view_devicerole"]),
|
||||||
PluginMenuItem(link="plugins:netbox_topology_views:individualoptions", link_text="Individual Options"),
|
PluginMenuItem(link="plugins:netbox_topology_views:individualoptions", link_text="Individual Options", permissions=['netbox_topology_views.change_individualoptions']),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
(()=>{var In=Object.create;var kt=Object.defineProperty,Pn=Object.defineProperties,Mn=Object.getOwnPropertyDescriptor,Dn=Object.getOwnPropertyDescriptors,Fn=Object.getOwnPropertyNames,Ui=Object.getOwnPropertySymbols,Nn=Object.getPrototypeOf,Yi=Object.prototype.hasOwnProperty,Bn=Object.prototype.propertyIsEnumerable;var Jt=(n,e,t)=>e in n?kt(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,de=(n,e)=>{for(var t in e||(e={}))Yi.call(e,t)&&Jt(n,t,e[t]);if(Ui)for(var t of Ui(e))Bn.call(e,t)&&Jt(n,t,e[t]);return n},Be=(n,e)=>Pn(n,Dn(e)),An=n=>kt(n,"__esModule",{value:!0});var ei=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports);var zn=(n,e,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Fn(e))!Yi.call(n,i)&&i!=="default"&&kt(n,i,{get:()=>e[i],enumerable:!(t=Mn(e,i))||t.enumerable});return n},ti=n=>zn(An(kt(n!=null?In(Nn(n)):{},"default",n&&n.__esModule&&"default"in n?{get:()=>n.default,enumerable:!0}:{value:n,enumerable:!0})),n);var $=(n,e,t)=>(Jt(n,typeof e!="symbol"?e+"":e,t),t);var Xi=(n,e,t)=>new Promise((i,s)=>{var o=d=>{try{a(t.next(d))}catch(h){s(h)}},r=d=>{try{a(t.throw(d))}catch(h){s(h)}},a=d=>d.done?i(d.value):Promise.resolve(d.value).then(o,r);a((t=t.apply(n,e)).next())});var si=ei((Va,ii)=>{typeof ii!="undefined"&&(ii.exports=ne);function ne(n){if(n)return Ln(n)}function Ln(n){for(var e in ne.prototype)n[e]=ne.prototype[e];return n}ne.prototype.on=ne.prototype.addEventListener=function(n,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+n]=this._callbacks["$"+n]||[]).push(e),this};ne.prototype.once=function(n,e){function t(){this.off(n,t),e.apply(this,arguments)}return t.fn=e,this.on(n,t),this};ne.prototype.off=ne.prototype.removeListener=ne.prototype.removeAllListeners=ne.prototype.removeEventListener=function(n,e){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var t=this._callbacks["$"+n];if(!t)return this;if(arguments.length==1)return delete this._callbacks["$"+n],this;for(var i,s=0;s<t.length;s++)if(i=t[s],i===e||i.fn===e){t.splice(s,1);break}return t.length===0&&delete this._callbacks["$"+n],this};ne.prototype.emit=function(n){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),t=this._callbacks["$"+n],i=1;i<arguments.length;i++)e[i-1]=arguments[i];if(t){t=t.slice(0);for(var i=0,s=t.length;i<s;++i)t[i].apply(this,e)}return this};ne.prototype.listeners=function(n){return this._callbacks=this._callbacks||{},this._callbacks["$"+n]||[]};ne.prototype.hasListeners=function(n){return!!this.listeners(n).length}});var io=ei(Ut=>{(function(n,e){if(typeof define=="function"&&define.amd)define("timsort",["exports"],e);else if(typeof Ut!="undefined")e(Ut);else{var t={exports:{}};e(t.exports),n.timsort=t.exports}})(Ut,function(n){"use strict";n.__esModule=!0,n.sort=C;function e(f,g){if(!(f instanceof g))throw new TypeError("Cannot call a class as a function")}var t=32,i=7,s=256,o=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9];function r(f){return f<1e5?f<100?f<10?0:1:f<1e4?f<1e3?2:3:4:f<1e7?f<1e6?5:6:f<1e9?f<1e8?7:8:9}function a(f,g){if(f===g)return 0;if(~~f===f&&~~g===g){if(f===0||g===0)return f<g?-1:1;if(f<0||g<0){if(g>=0)return-1;if(f>=0)return 1;f=-f,g=-g}var m=r(f),v=r(g),_=0;return m<v?(f*=o[v-m-1],g/=10,_=-1):m>v&&(g*=o[m-v-1],f/=10,_=1),f===g?_:f<g?-1:1}var E=String(f),T=String(g);return E===T?0:E<T?-1:1}function d(f){for(var g=0;f>=t;)g|=f&1,f>>=1;return f+g}function h(f,g,m,v){var _=g+1;if(_===m)return 1;if(v(f[_++],f[g])<0){for(;_<m&&v(f[_],f[_-1])<0;)_++;l(f,g,_)}else for(;_<m&&v(f[_],f[_-1])>=0;)_++;return _-g}function l(f,g,m){for(m--;g<m;){var v=f[g];f[g++]=f[m],f[m--]=v}}function c(f,g,m,v,_){for(v===g&&v++;v<m;v++){for(var E=f[v],T=g,x=v;T<x;){var w=T+x>>>1;_(E,f[w])<0?x=w:T=w+1}var k=v-T;switch(k){case 3:f[T+3]=f[T+2];case 2:f[T+2]=f[T+1];case 1:f[T+1]=f[T];break;default:for(;k>0;)f[T+k]=f[T+k-1],k--}f[T]=E}}function u(f,g,m,v,_,E){var T=0,x=0,w=1;if(E(f,g[m+_])>0){for(x=v-_;w<x&&E(f,g[m+_+w])>0;)T=w,w=(w<<1)+1,w<=0&&(w=x);w>x&&(w=x),T+=_,w+=_}else{for(x=_+1;w<x&&E(f,g[m+_-w])<=0;)T=w,w=(w<<1)+1,w<=0&&(w=x);w>x&&(w=x);var k=T;T=_-w,w=_-k}for(T++;T<w;){var N=T+(w-T>>>1);E(f,g[m+N])>0?T=N+1:w=N}return w}function p(f,g,m,v,_,E){var T=0,x=0,w=1;if(E(f,g[m+_])<0){for(x=_+1;w<x&&E(f,g[m+_-w])<0;)T=w,w=(w<<1)+1,w<=0&&(w=x);w>x&&(w=x);var k=T;T=_-w,w=_-k}else{for(x=v-_;w<x&&E(f,g[m+_+w])>=0;)T=w,w=(w<<1)+1,w<=0&&(w=x);w>x&&(w=x),T+=_,w+=_}for(T++;T<w;){var N=T+(w-T>>>1);E(f,g[m+N])<0?w=N:T=N+1}return w}var b=function(){function f(g,m){e(this,f),this.array=null,this.compare=null,this.minGallop=i,this.length=0,this.tmpStorageLength=s,this.stackLength=0,this.runStart=null,this.runLength=null,this.stackSize=0,this.array=g,this.compare=m,this.length=g.length,this.length<2*s&&(this.tmpStorageLength=this.length>>>1),this.tmp=new Array(this.tmpStorageLength),this.stackLength=this.length<120?5:this.length<1542?10:this.length<119151?19:40,this.runStart=new Array(this.stackLength),this.runLength=neLine truncated
|
(()=>{var bn=Object.create;var Tt=Object.defineProperty,vn=Object.defineProperties,wn=Object.getOwnPropertyDescriptor,_n=Object.getOwnPropertyDescriptors,En=Object.getOwnPropertyNames,ji=Object.getOwnPropertySymbols,xn=Object.getPrototypeOf,Wi=Object.prototype.hasOwnProperty,Cn=Object.prototype.propertyIsEnumerable;var Zt=(n,e,t)=>e in n?Tt(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,de=(n,e)=>{for(var t in e||(e={}))Wi.call(e,t)&&Zt(n,t,e[t]);if(ji)for(var t of ji(e))Cn.call(e,t)&&Zt(n,t,e[t]);return n},Me=(n,e)=>vn(n,_n(e)),Tn=n=>Tt(n,"__esModule",{value:!0});var kn=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports);var On=(n,e,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of En(e))!Wi.call(n,i)&&i!=="default"&&Tt(n,i,{get:()=>e[i],enumerable:!(t=wn(e,i))||t.enumerable});return n},Vi=n=>On(Tn(Tt(n!=null?bn(xn(n)):{},"default",n&&n.__esModule&&"default"in n?{get:()=>n.default,enumerable:!0}:{value:n,enumerable:!0})),n);var Y=(n,e,t)=>(Zt(n,typeof e!="symbol"?e+"":e,t),t);var qi=(n,e,t)=>new Promise((i,s)=>{var o=d=>{try{a(t.next(d))}catch(h){s(h)}},r=d=>{try{a(t.throw(d))}catch(h){s(h)}},a=d=>d.done?i(d.value):Promise.resolve(d.value).then(o,r);a((t=t.apply(n,e)).next())});var Jt=kn((za,Qt)=>{typeof Qt!="undefined"&&(Qt.exports=te);function te(n){if(n)return Sn(n)}function Sn(n){for(var e in te.prototype)n[e]=te.prototype[e];return n}te.prototype.on=te.prototype.addEventListener=function(n,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+n]=this._callbacks["$"+n]||[]).push(e),this};te.prototype.once=function(n,e){function t(){this.off(n,t),e.apply(this,arguments)}return t.fn=e,this.on(n,t),this};te.prototype.off=te.prototype.removeListener=te.prototype.removeAllListeners=te.prototype.removeEventListener=function(n,e){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var t=this._callbacks["$"+n];if(!t)return this;if(arguments.length==1)return delete this._callbacks["$"+n],this;for(var i,s=0;s<t.length;s++)if(i=t[s],i===e||i.fn===e){t.splice(s,1);break}return t.length===0&&delete this._callbacks["$"+n],this};te.prototype.emit=function(n){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),t=this._callbacks["$"+n],i=1;i<arguments.length;i++)e[i-1]=arguments[i];if(t){t=t.slice(0);for(var i=0,s=t.length;i<s;++i)t[i].apply(this,e)}return this};te.prototype.listeners=function(n){return this._callbacks=this._callbacks||{},this._callbacks["$"+n]||[]};te.prototype.hasListeners=function(n){return!!this.listeners(n).length}});var Os=Vi(Jt());function he(){return he=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},he.apply(this,arguments)}function oe(n,e){n.prototype=Object.create(e.prototype),n.prototype.constructor=n,n.__proto__=e}function kt(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}var ei;typeof Object.assign!="function"?ei=function(e){if(e==null)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),i=1;i<arguments.length;i++){var s=arguments[i];if(s!=null)for(var o in s)s.hasOwnProperty(o)&&(t[o]=s[o])}return t}:ei=Object.assign;var Fe=ei,Ui=["","webkit","Moz","MS","ms","o"],In=typeof document=="undefined"?{style:{}}:document.createElement("div"),Pn="function",Ke=Math.round,Ne=Math.abs,ti=Date.now;function Ot(n,e){for(var t,i,s=e[0].toUpperCase()+e.slice(1),o=0;o<Ui.length;){if(t=Ui[o],i=t?t+s:e,i in n)return i;o++}}var pe;typeof window=="undefined"?pe={}:pe=window;var Yi=Ot(In.style,"touchAction"),Xi=Yi!==void 0;function Dn(){if(!Xi)return!1;var n={},e=pe.CSS&&pe.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(t){return n[t]=e?pe.CSS.supports("touch-action",t):!0}),n}var Gi="compute",Ki="auto",ii="manipulation",Be="none",ot="pan-x",nt="pan-y",St=Dn(),Mn=/mobile|tablet|ip(ad|hone|od)|android/i,$i="ontouchstart"in pe,Fn=Ot(pe,"PointerEvent")!==void 0,Nn=$i&&Mn.test(navigator.userAgent),rt="touch",Bn="pen",si="mouse",An="kinect",zn=25,$=1,Ae=2,j=4,J=8,It=1,at=2,dt=4,ht=8,$e=16,ce=at|dt,ze=ht|$e,Zi=ce|ze,Qi=["x","y"],Pt=["clientX","clientY"];function ge(n,e,t){var i;if(!!n)if(n.forEach)n.forEach(e,t);else if(n.length!==void 0)for(i=0;i<n.length;)e.call(t,n[i],i,n),i++;else for(i in n)n.hasOwnProperty(i)&&e.call(t,n[i],i,n)}function Dt(n,e){return typeof n===Pn?n.apply(e&&e[0]||void 0,e):n}function Re(n,e){return n.indexOf(e)>-1}function Rn(n){if(Re(n,Be))return Be;var e=Re(n,ot),t=Re(n,nt);return e&&t?Be:e||t?e?ot:nt:Re(n,ii)?ii:Ki}var Ji=function(){function n(t,i){this.manager=t,this.set(i)}var e=n.prototype;return e.set=function(i){i===Gi&&(i=this.compute()),Xi&&this.manager.element.style&&St[i]&&(this.manager.element.style[Yi]=i),this.actions=i.toLowerCase().trim()},e.update=function(){this.set(this.manager.options.touchAction)},e.coLine truncated
|
||||||
`+t+` AT
|
`+t+` AT
|
||||||
`;return function(){var s=new Error("get-stack-trace"),o=s&&s.stack?s.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",r=window.console&&(window.console.warn||window.console.log);return r&&r.call(window.console,i,o),n.apply(this,arguments)}}var ks=Ts(function(n,e,t){for(var i=Object.keys(e),s=0;s<i.length;)(!t||t&&n[i[s]]===void 0)&&(n[i[s]]=e[i[s]]),s++;return n},"extend","Use `assign`."),Er=Ts(function(n,e){return ks(n,e,!0)},"merge","Use `assign`.");function xr(n,e,t){var i=e.prototype,s;s=n.prototype=Object.create(i),s.constructor=n,s._super=i,t&&Ae(s,t)}function Ss(n,e){return function(){return n.apply(e,arguments)}}var Os=function(){var n=function(t,i){return i===void 0&&(i={}),new Cs(t,fe({recognizers:_s.concat()},i))};return n.VERSION="2.0.17-rc",n.DIRECTION_ALL=es,n.DIRECTION_DOWN=Qe,n.DIRECTION_LEFT=dt,n.DIRECTION_RIGHT=ht,n.DIRECTION_UP=lt,n.DIRECTION_HORIZONTAL=pe,n.DIRECTION_VERTICAL=He,n.DIRECTION_NONE=Pt,n.DIRECTION_DOWN=Qe,n.INPUT_START=ee,n.INPUT_MOVE=Re,n.INPUT_END=K,n.INPUT_CANCEL=se,n.STATE_POSSIBLE=Nt,n.STATE_BEGAN=le,n.STATE_CHANGED=et,n.STATE_ENDED=Oe,n.STATE_RECOGNIZED=ve,n.STATE_CANCELLED=gt,n.STATE_FAILED=ge,n.Manager=Cs,n.Input=$e,n.TouchAction=is,n.TouchInput=ci,n.MouseInput=ui,n.PointerEventInput=ls,n.TouchMouseInput=fs,n.SingleTouchInput=wr,n.Recognizer=mt,n.AttrRecognizer=tt,n.Tap=fi,n.Pan=pi,n.Swipe=ms,n.Pinch=ys,n.Rotate=bs,n.Press=vs,n.on=ut,n.off=ft,n.each=be,n.merge=Er,n.extend=ks,n.bindFn=Ss,n.assign=Ae,n.inherit=xr,n.bindFn=Ss,n.prefixed=Ot,n.toArray=pt,n.inArray=We,n.uniqueArray=li,n.splitStr=ct,n.boolOrFn=Dt,n.hasParent=di,n.addEventListeners=ut,n.removeEventListeners=ft,n.defaults=Ae({},ws,{preset:_s}),n}(),qa=Os.defaults,Is=Os;var gi=Symbol("DELETE");function Ms(n,...e){return Ds({},n,...e)}function Ds(...n){let e=At(...n);return Ns(e),e}function At(...n){if(n.length<2)return n[0];if(n.length>2)return At(Ds(n[0],n[1]),...n.slice(2));let e=n[0],t=n[1];for(let i of Reflect.ownKeys(t))Object.prototype.propertyIsEnumerable.call(t,i)&&(t[i]===gi?delete e[i]:e[i]!==null&&t[i]!==null&&typeof e[i]=="object"&&typeof t[i]=="object"&&!Array.isArray(e[i])&&!Array.isArray(t[i])?e[i]=At(e[i],t[i]):e[i]=Fs(t[i]));return e}function Fs(n){return Array.isArray(n)?n.map(e=>Fs(e)):typeof n=="object"&&n!==null?At({},n):n}function Ns(n){for(let e of Object.keys(n))n[e]===gi?delete n[e]:typeof n[e]=="object"&&n[e]!==null&&Ns(n[e])}function yt(...n){return Cr(n.length?n:[Date.now()])}function Cr(n){let[e,t,i]=Tr(n),s=1,o=()=>{let r=2091639*e+s*23283064365386963e-26;return e=t,t=i,i=r-(s=r|0)};return o.uint32=()=>o()*4294967296,o.fract53=()=>o()+(o()*2097152|0)*11102230246251565e-32,o.algorithm="Alea",o.seed=n,o.version="0.9",o}function Tr(...n){let e=kr(),t=e(" "),i=e(" "),s=e(" ");for(let o=0;o<n.length;o++)t-=e(n[o]),t<0&&(t+=1),i-=e(n[o]),i<0&&(i+=1),s-=e(n[o]),s<0&&(s+=1);return[t,i,s]}function kr(){let n=4022871197;return function(e){let t=e.toString();for(let i=0;i<t.length;i++){n+=t.charCodeAt(i);let s=.02519603282416938*n;n=s>>>0,s-=n,s*=n,n=s>>>0,s-=n,n+=s*4294967296}return(n>>>0)*23283064365386963e-26}}function Sr(){let n=()=>{};return{on:n,off:n,destroy:n,emit:n,get(){return{set:n}}}}var mi=typeof window!="undefined"?window.Hammer||Is:function(){return Sr()};function me(n){this._cleanupQueue=[],this.active=!1,this._dom={container:n,overlay:document.createElement("div")},this._dom.overlay.classList.add("vis-overlay"),this._dom.container.appendChild(this._dom.overlay),this._cleanupQueue.push(()=>{this._dom.overlay.parentNode.removeChild(this._dom.overlay)});let e=mi(this._dom.overlay);e.on("tap",this._onTapOverlay.bind(this)),this._cleanupQueue.push(()=>{e.destroy()}),["tap","doubletap","press","pinch","pan","panstart","panmove","panend"].forEach(i=>{e.on(i,s=>{s.srcEvent.stopPropagation()})}),document&&document.body&&(this._onClick=i=>{Or(i.target,n)||this.deactivate()},document.body.addEventListener("click",this._onClick),this._cleanupQueue.push(()=>{document.body.removeEventListener("click",this._onClick)})),this._escListener=i=>{("key"in i?i.key==="Escape":i.keyCode===27)&&this.deactivate()}}(0,Ps.default)(me.prototype);me.current=null;me.prototype.destroy=function(){this.deactivate();for(let n of this._cleanupQueue.splice(0).reverse())n()};me.prototype.activate=function(){me.current&&me.current.deactivate(),me.current=this,this.active=!0,this._dom.overlay.style.display="none",this._dom.container.classList.add("vis-active"),this.emit("change"),this.emit("activate"),document.body.addEventListener("keydown",this._escListener)};me.prototype.deactivate=function(){this.active=!1,this._dom.overlay.style.display="block",this._dom.container.classList.remove("vis-active"),document.body.removeEventListener("keydown",this._escListener),this.emit("change"),this.emit("deactivate")};me.prototype._onTapOverlay=function(n){this.activate(),n.srcEvent.stopPropagation()};function Or(n,e){for(;n;){if(n===e)
Line truncated
|
`;return function(){var s=new Error("get-stack-trace"),o=s&&s.stack?s.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",r=window.console&&(window.console.warn||window.console.log);return r&&r.call(window.console,i,o),n.apply(this,arguments)}}var xs=Es(function(n,e,t){for(var i=Object.keys(e),s=0;s<i.length;)(!t||t&&n[i[s]]===void 0)&&(n[i[s]]=e[i[s]]),s++;return n},"extend","Use `assign`."),ur=Es(function(n,e){return xs(n,e,!0)},"merge","Use `assign`.");function fr(n,e,t){var i=e.prototype,s;s=n.prototype=Object.create(i),s.constructor=n,s._super=i,t&&Fe(s,t)}function Cs(n,e){return function(){return n.apply(e,arguments)}}var Ts=function(){var n=function(t,i){return i===void 0&&(i={}),new _s(t,he({recognizers:bs.concat()},i))};return n.VERSION="2.0.17-rc",n.DIRECTION_ALL=Zi,n.DIRECTION_DOWN=$e,n.DIRECTION_LEFT=at,n.DIRECTION_RIGHT=dt,n.DIRECTION_UP=ht,n.DIRECTION_HORIZONTAL=ce,n.DIRECTION_VERTICAL=ze,n.DIRECTION_NONE=It,n.DIRECTION_DOWN=$e,n.INPUT_START=$,n.INPUT_MOVE=Ae,n.INPUT_END=j,n.INPUT_CANCEL=J,n.STATE_POSSIBLE=Ft,n.STATE_BEGAN=ne,n.STATE_CHANGED=Je,n.STATE_ENDED=Te,n.STATE_RECOGNIZED=me,n.STATE_CANCELLED=pt,n.STATE_FAILED=ue,n.Manager=_s,n.Input=Ze,n.TouchAction=Ji,n.TouchInput=ai,n.MouseInput=di,n.PointerEventInput=as,n.TouchMouseInput=ls,n.SingleTouchInput=lr,n.Recognizer=gt,n.AttrRecognizer=et,n.Tap=hi,n.Pan=li,n.Swipe=fs,n.Pinch=ps,n.Rotate=gs,n.Press=ms,n.on=ct,n.off=ut,n.each=ge,n.merge=ur,n.extend=xs,n.bindFn=Cs,n.assign=Fe,n.inherit=fr,n.bindFn=Cs,n.prefixed=Ot,n.toArray=ft,n.inArray=Le,n.uniqueArray=ri,n.splitStr=lt,n.boolOrFn=Dt,n.hasParent=oi,n.addEventListeners=ct,n.removeEventListeners=ut,n.defaults=Fe({},ys,{preset:bs}),n}(),Ra=Ts.defaults,ks=Ts;var ci=Symbol("DELETE");function Ss(n,...e){return Is({},n,...e)}function Is(...n){let e=Bt(...n);return Ds(e),e}function Bt(...n){if(n.length<2)return n[0];if(n.length>2)return Bt(Is(n[0],n[1]),...n.slice(2));let e=n[0],t=n[1];if(e instanceof Date&&t instanceof Date)return e.setTime(t.getTime()),e;for(let i of Reflect.ownKeys(t))Object.prototype.propertyIsEnumerable.call(t,i)&&(t[i]===ci?delete e[i]:e[i]!==null&&t[i]!==null&&typeof e[i]=="object"&&typeof t[i]=="object"&&!Array.isArray(e[i])&&!Array.isArray(t[i])?e[i]=Bt(e[i],t[i]):e[i]=Ps(t[i]));return e}function Ps(n){return Array.isArray(n)?n.map(e=>Ps(e)):typeof n=="object"&&n!==null?n instanceof Date?new Date(n.getTime()):Bt({},n):n}function Ds(n){for(let e of Object.keys(n))n[e]===ci?delete n[e]:typeof n[e]=="object"&&n[e]!==null&&Ds(n[e])}function mt(...n){return pr(n.length?n:[Date.now()])}function pr(n){let[e,t,i]=gr(n),s=1,o=()=>{let r=2091639*e+s*23283064365386963e-26;return e=t,t=i,i=r-(s=r|0)};return o.uint32=()=>o()*4294967296,o.fract53=()=>o()+(o()*2097152|0)*11102230246251565e-32,o.algorithm="Alea",o.seed=n,o.version="0.9",o}function gr(...n){let e=mr(),t=e(" "),i=e(" "),s=e(" ");for(let o=0;o<n.length;o++)t-=e(n[o]),t<0&&(t+=1),i-=e(n[o]),i<0&&(i+=1),s-=e(n[o]),s<0&&(s+=1);return[t,i,s]}function mr(){let n=4022871197;return function(e){let t=e.toString();for(let i=0;i<t.length;i++){n+=t.charCodeAt(i);let s=.02519603282416938*n;n=s>>>0,s-=n,s*=n,n=s>>>0,s-=n,n+=s*4294967296}return(n>>>0)*23283064365386963e-26}}function yr(){let n=()=>{};return{on:n,off:n,destroy:n,emit:n,get(){return{set:n}}}}var ui=typeof window!="undefined"?window.Hammer||ks:function(){return yr()};function fe(n){this._cleanupQueue=[],this.active=!1,this._dom={container:n,overlay:document.createElement("div")},this._dom.overlay.classList.add("vis-overlay"),this._dom.container.appendChild(this._dom.overlay),this._cleanupQueue.push(()=>{this._dom.overlay.parentNode.removeChild(this._dom.overlay)});let e=ui(this._dom.overlay);e.on("tap",this._onTapOverlay.bind(this)),this._cleanupQueue.push(()=>{e.destroy()}),["tap","doubletap","press","pinch","pan","panstart","panmove","panend"].forEach(i=>{e.on(i,s=>{s.srcEvent.stopPropagation()})}),document&&document.body&&(this._onClick=i=>{br(i.target,n)||this.deactivate()},document.body.addEventListener("click",this._onClick),this._cleanupQueue.push(()=>{document.body.removeEventListener("click",this._onClick)})),this._escListener=i=>{("key"in i?i.key==="Escape":i.keyCode===27)&&this.deactivate()}}(0,Os.default)(fe.prototype);fe.current=null;fe.prototype.destroy=function(){this.deactivate();for(let n of this._cleanupQueue.splice(0).reverse())n()};fe.prototype.activate=function(){fe.current&&fe.current.deactivate(),fe.current=this,this.active=!0,this._dom.overlay.style.display="none",this._dom.container.classList.add("vis-active"),this.emit("change"),this.emit("activate"),document.body.addEventListener("keydown",this._escListener)};fe.prototype.deactivate=function(){this.active=!1,this._dom.overlay.style.display="block",this._dom.container.classList.remove("vis-active"),document.body.removeEventListener("keydown",this._escListener),this.emit("change"),this.emit("deactivate")};fe.prototy
Line truncated
|
||||||
|
|
||||||
`:o.distance<=a&&s.distance>o.distance?d=" in "+X.printLocation(s.path,e,"")+"Perhaps it was misplaced? Matching option found at: "+X.printLocation(o.path,o.closestMatch,""):s.distance<=r?d='. Did you mean "'+s.closestMatch+'"?'+X.printLocation(s.path,e):d=". Did you mean one of these: "+X.print(Object.keys(t))+X.printLocation(i,e),console.error('%cUnknown option detected: "'+e+'"'+d,wi),wt=!0}static findInOptions(e,t,i,s=!1){let o=1e9,r="",a=[],d=e.toLowerCase(),h;for(let l in t){let c;if(t[l].__type__!==void 0&&s===!0){let u=X.findInOptions(e,t[l],zt(i,l));o>u.distance&&(r=u.closestMatch,a=u.path,o=u.distance,h=u.indexMatch)}else l.toLowerCase().indexOf(d)!==-1&&(h=l),c=X.levenshteinDistance(e,l),o>c&&(r=l,a=Fr(i),o=c)}return{closestMatch:r,path:a,distance:o,indexMatch:h}}static printLocation(e,t,i=`Problem value found at:
|
`:o.distance<=a&&s.distance>o.distance?d=" in "+R.printLocation(s.path,e,"")+"Perhaps it was misplaced? Matching option found at: "+R.printLocation(o.path,o.closestMatch,""):s.distance<=r?d='. Did you mean "'+s.closestMatch+'"?'+R.printLocation(s.path,e):d=". Did you mean one of these: "+R.print(Object.keys(t))+R.printLocation(i,e),console.error('%cUnknown option detected: "'+e+'"'+d,mi),vt=!0}static findInOptions(e,t,i,s=!1){let o=1e9,r="",a=[],d=e.toLowerCase(),h;for(let l in t){let c;if(t[l].__type__!==void 0&&s===!0){let u=R.findInOptions(e,t[l],At(i,l));o>u.distance&&(r=u.closestMatch,a=u.path,o=u.distance,h=u.indexMatch)}else l.toLowerCase().indexOf(d)!==-1&&(h=l),c=R.levenshteinDistance(e,l),o>c&&(r=l,a=xr(i),o=c)}return{closestMatch:r,path:a,distance:o,indexMatch:h}}static printLocation(e,t,i=`Problem value found at:
|
||||||
`){let s=`
|
`){let s=`
|
||||||
|
|
||||||
`+i+`options = {
|
`+i+`options = {
|
||||||
@@ -11,16 +11,16 @@
|
|||||||
`;for(let o=0;o<e.length+1;o++){for(let r=0;r<e.length-o;r++)s+=" ";s+=`}
|
`;for(let o=0;o<e.length+1;o++){for(let r=0;r<e.length-o;r++)s+=" ";s+=`}
|
||||||
`}return s+`
|
`}return s+`
|
||||||
|
|
||||||
`}static print(e){return JSON.stringify(e).replace(/(")|(\[)|(\])|(,"__type__")/g,"").replace(/(,)/g,", ")}static levenshteinDistance(e,t){if(e.length===0)return t.length;if(t.length===0)return e.length;let i=[],s;for(s=0;s<=t.length;s++)i[s]=[s];let o;for(o=0;o<=e.length;o++)i[0][o]=o;for(s=1;s<=t.length;s++)for(o=1;o<=e.length;o++)t.charAt(s-1)==e.charAt(o-1)?i[s][o]=i[s-1][o-1]:i[s][o]=Math.min(i[s-1][o-1]+1,Math.min(i[s][o-1]+1,i[s-1][o]+1));return i[t.length][e.length]}},Gs=me;var Ks=Us,Ue=mi,Zs=Ys,_i=wi,Qs=X;var jt,zr=new Uint8Array(16);function Ei(){if(!jt&&(jt=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),!jt))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return jt(zr)}var $s=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function Lr(n){return typeof n=="string"&&$s.test(n)}var Js=Lr;var Q=[];for(Wt=0;Wt<256;++Wt)Q.push((Wt+256).toString(16).substr(1));var Wt;function Rr(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,t=(Q[n[e+0]]+Q[n[e+1]]+Q[n[e+2]]+Q[n[e+3]]+"-"+Q[n[e+4]]+Q[n[e+5]]+"-"+Q[n[e+6]]+Q[n[e+7]]+"-"+Q[n[e+8]]+Q[n[e+9]]+"-"+Q[n[e+10]]+Q[n[e+11]]+Q[n[e+12]]+Q[n[e+13]]+Q[n[e+14]]+Q[n[e+15]]).toLowerCase();if(!Js(t))throw TypeError("Stringified UUID is invalid");return t}var eo=Rr;function Hr(n,e,t){n=n||{};var i=n.random||(n.rng||Ei)();if(i[6]=i[6]&15|64,i[8]=i[8]&63|128,e){t=t||0;for(var s=0;s<16;++s)e[t+s]=i[s];return e}return eo(i)}var Ce=Hr;function to(n){return typeof n=="string"||typeof n=="number"}var Vt=class{constructor(e){$(this,"delay");$(this,"max");$(this,"_queue",[]);$(this,"_timeout",null);$(this,"_extended",null);this.delay=null,this.max=1/0,this.setOptions(e)}setOptions(e){e&&typeof e.delay!="undefined"&&(this.delay=e.delay),e&&typeof e.max!="undefined"&&(this.max=e.max),this._flushIfNeeded()}static extend(e,t){let i=new Vt(t);if(e.flush!==void 0)throw new Error("Target object already has a property flush");e.flush=()=>{i.flush()};let s=[{name:"flush",original:void 0}];if(t&&t.replace)for(let o=0;o<t.replace.length;o++){let r=t.replace[o];s.push({name:r,original:e[r]}),i.replace(e,r)}return i._extended={object:e,methods:s},i}destroy(){if(this.flush(),this._extended){let e=this._extended.object,t=this._extended.methods;for(let i=0;i<t.length;i++){let s=t[i];s.original?e[s.name]=s.original:delete e[s.name]}this._extended=null}}replace(e,t){let i=this,s=e[t];if(!s)throw new Error("Method "+t+" undefined");e[t]=function(...o){i.queue({args:o,fn:s,context:this})}}queue(e){typeof e=="function"?this._queue.push({fn:e}):this._queue.push(e),this._flushIfNeeded()}_flushIfNeeded(){this._queue.length>this.max&&this.flush(),this._timeout!=null&&(clearTimeout(this._timeout),this._timeout=null),this.queue.length>0&&typeof this.delay=="number"&&(this._timeout=setTimeout(()=>{this.flush()},this.delay))}flush(){this._queue.splice(0).forEach(e=>{e.fn.apply(e.context||e.fn,e.args||[])})}},_t=class{constructor(){$(this,"_subscribers",{"*":[],add:[],remove:[],update:[]});$(this,"subscribe",_t.prototype.on);$(this,"unsubscribe",_t.prototype.off)}_trigger(e,t,i){if(e==="*")throw new Error("Cannot trigger event *");[...this._subscribers[e],...this._subscribers["*"]].forEach(s=>{s(e,t,i!=null?i:null)})}on(e,t){typeof t=="function"&&this._subscribers[e].push(t)}off(e,t){this._subscribers[e]=this._subscribers[e].filter(i=>i!==t)}},Ie=class{constructor(e){$(this,"_pairs");this._pairs=e}*[Symbol.iterator](){for(let[e,t]of this._pairs)yield[e,t]}*entries(){for(let[e,t]of this._pairs)yield[e,t]}*keys(){for(let[e]of this._pairs)yield e}*values(){for(let[,e]of this._pairs)yield e}toIdArray(){return[...this._pairs].map(e=>e[0])}toItemArray(){return[...this._pairs].map(e=>e[1])}toEntryArray(){return[...this._pairs]}toObjectMap(){let e=Object.create(null);for(let[t,i]of this._pairs)e[t]=i;return e}toMap(){return new Map(this._pairs)}toIdSet(){return new Set(this.toIdArray())}toItemSet(){return new Set(this.toItemArray())}cache(){return new Ie([...this._pairs])}distinct(e){let t=new Set;for(let[i,s]of this._pairs)t.add(e(s,i));return t}filter(e){let t=this._pairs;return new Ie({*[Symbol.iterator](){for(let[i,s]of t)e(s,i)&&(yield[i,s])}})}forEach(e){for(let[t,i]of this._pairs)e(i,t)}map(e){let t=this._pairs;return new Ie({*[Symbol.iterator](){for(let[i,s]of t)yield[i,e(s,i)]}})}max(e){let t=this._pairs[Symbol.iterator](),i=t.next();if(i.done)return null;let s=i.value[1],o=e(i.value[1],i.value[0]);for(;!(i=t.next()).done;){let[r,a]=i.value,d=e(a,r);d>o&&(o=d,s=a)}return s}min(e){let t=this._pairs[Symbol.iterator](),i=t.next();if(i.done)return null;let s=i.value[1],o=e(i.value[1],i.value[0]);for(;!(i=t.next()).done;){let[r,a]=i.value,d=e(a,r);d<o&&(o=d,s=a)}return s}reduce(e,t){for(let[i,s]of
Line truncated
|
`}static print(e){return JSON.stringify(e).replace(/(")|(\[)|(\])|(,"__type__")/g,"").replace(/(,)/g,", ")}static levenshteinDistance(e,t){if(e.length===0)return t.length;if(t.length===0)return e.length;let i=[],s;for(s=0;s<=t.length;s++)i[s]=[s];let o;for(o=0;o<=e.length;o++)i[0][o]=o;for(s=1;s<=t.length;s++)for(o=1;o<=e.length;o++)t.charAt(s-1)==e.charAt(o-1)?i[s][o]=i[s-1][o-1]:i[s][o]=Math.min(i[s-1][o-1]+1,Math.min(i[s][o-1]+1,i[s-1][o]+1));return i[t.length][e.length]}},Hs=fe;var js=Sr,We=ui,Ws=Ir,yi=mi,Vs=Pr;var Ht,Dr=new Uint8Array(16);function bi(){if(!Ht&&(Ht=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),!Ht))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Ht(Dr)}var qs=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function Mr(n){return typeof n=="string"&&qs.test(n)}var Us=Mr;var q=[];for(jt=0;jt<256;++jt)q.push((jt+256).toString(16).substr(1));var jt;function Fr(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,t=(q[n[e+0]]+q[n[e+1]]+q[n[e+2]]+q[n[e+3]]+"-"+q[n[e+4]]+q[n[e+5]]+"-"+q[n[e+6]]+q[n[e+7]]+"-"+q[n[e+8]]+q[n[e+9]]+"-"+q[n[e+10]]+q[n[e+11]]+q[n[e+12]]+q[n[e+13]]+q[n[e+14]]+q[n[e+15]]).toLowerCase();if(!Us(t))throw TypeError("Stringified UUID is invalid");return t}var Ys=Fr;function Nr(n,e,t){n=n||{};var i=n.random||(n.rng||bi)();if(i[6]=i[6]&15|64,i[8]=i[8]&63|128,e){t=t||0;for(var s=0;s<16;++s)e[t+s]=i[s];return e}return Ys(i)}var _e=Nr;function Xs(n){return typeof n=="string"||typeof n=="number"}var Wt=class{constructor(e){Y(this,"delay");Y(this,"max");Y(this,"_queue",[]);Y(this,"_timeout",null);Y(this,"_extended",null);this.delay=null,this.max=1/0,this.setOptions(e)}setOptions(e){e&&typeof e.delay!="undefined"&&(this.delay=e.delay),e&&typeof e.max!="undefined"&&(this.max=e.max),this._flushIfNeeded()}static extend(e,t){let i=new Wt(t);if(e.flush!==void 0)throw new Error("Target object already has a property flush");e.flush=()=>{i.flush()};let s=[{name:"flush",original:void 0}];if(t&&t.replace)for(let o=0;o<t.replace.length;o++){let r=t.replace[o];s.push({name:r,original:e[r]}),i.replace(e,r)}return i._extended={object:e,methods:s},i}destroy(){if(this.flush(),this._extended){let e=this._extended.object,t=this._extended.methods;for(let i=0;i<t.length;i++){let s=t[i];s.original?e[s.name]=s.original:delete e[s.name]}this._extended=null}}replace(e,t){let i=this,s=e[t];if(!s)throw new Error("Method "+t+" undefined");e[t]=function(...o){i.queue({args:o,fn:s,context:this})}}queue(e){typeof e=="function"?this._queue.push({fn:e}):this._queue.push(e),this._flushIfNeeded()}_flushIfNeeded(){this._queue.length>this.max&&this.flush(),this._timeout!=null&&(clearTimeout(this._timeout),this._timeout=null),this.queue.length>0&&typeof this.delay=="number"&&(this._timeout=setTimeout(()=>{this.flush()},this.delay))}flush(){this._queue.splice(0).forEach(e=>{e.fn.apply(e.context||e.fn,e.args||[])})}},wt=class{constructor(){Y(this,"_subscribers",{"*":[],add:[],remove:[],update:[]});Y(this,"subscribe",wt.prototype.on);Y(this,"unsubscribe",wt.prototype.off)}_trigger(e,t,i){if(e==="*")throw new Error("Cannot trigger event *");[...this._subscribers[e],...this._subscribers["*"]].forEach(s=>{s(e,t,i!=null?i:null)})}on(e,t){typeof t=="function"&&this._subscribers[e].push(t)}off(e,t){this._subscribers[e]=this._subscribers[e].filter(i=>i!==t)}},ke=class{constructor(e){Y(this,"_pairs");this._pairs=e}*[Symbol.iterator](){for(let[e,t]of this._pairs)yield[e,t]}*entries(){for(let[e,t]of this._pairs)yield[e,t]}*keys(){for(let[e]of this._pairs)yield e}*values(){for(let[,e]of this._pairs)yield e}toIdArray(){return[...this._pairs].map(e=>e[0])}toItemArray(){return[...this._pairs].map(e=>e[1])}toEntryArray(){return[...this._pairs]}toObjectMap(){let e=Object.create(null);for(let[t,i]of this._pairs)e[t]=i;return e}toMap(){return new Map(this._pairs)}toIdSet(){return new Set(this.toIdArray())}toItemSet(){return new Set(this.toItemArray())}cache(){return new ke([...this._pairs])}distinct(e){let t=new Set;for(let[i,s]of this._pairs)t.add(e(s,i));return t}filter(e){let t=this._pairs;return new ke({*[Symbol.iterator](){for(let[i,s]of t)e(s,i)&&(yield[i,s])}})}forEach(e){for(let[t,i]of this._pairs)e(i,t)}map(e){let t=this._pairs;return new ke({*[Symbol.iterator](){for(let[i,s]of t)yield[i,e(s,i)]}})}max(e){let t=this._pairs[Symbol.iterator](),i=t.next();if(i.done)return null;let s=i.value[1],o=e(i.value[1],i.value[0]);for(;!(i=t.next()).done;){let[r,a]=i.value,d=e(a,r);d>o&&(o=d,s=a)}return s}min(e){let t=this._pairs[Symbol.iterator](),i=t.next();if(i.done)return null;let s=i.value[1],o=e(i.value[1],i.value[0]);for(;!(i=t.next()).done;){let[r,a]=i.value,d=e(a,r);d<o&&(o=d,s=a)}return s}reduce(e,t){for(let[i,s]of
Line truncated
|
||||||
`||z==="\r";)Z();do{var n=!1;if(z==="#"){for(var e=it-1;Pe.charAt(e)===" "||Pe.charAt(e)===" ";)e--;if(Pe.charAt(e)===`
|
`||P==="\r";)V();do{var n=!1;if(P==="#"){for(var e=tt-1;Oe.charAt(e)===" "||Oe.charAt(e)===" ";)e--;if(Oe.charAt(e)===`
|
||||||
`||Pe.charAt(e)===""){for(;z!=""&&z!=`
|
`||Oe.charAt(e)===""){for(;P!=""&&P!=`
|
||||||
`;)Z();n=!0}}if(z==="/"&&st()==="/"){for(;z!=""&&z!=`
|
`;)V();n=!0}}if(P==="/"&&it()==="/"){for(;P!=""&&P!=`
|
||||||
`;)Z();n=!0}if(z==="/"&&st()==="*"){for(;z!="";)if(z==="*"&&st()==="/"){Z(),Z();break}else Z();n=!0}for(;z===" "||z===" "||z===`
|
`;)V();n=!0}if(P==="/"&&it()==="*"){for(;P!="";)if(P==="*"&&it()==="/"){V(),V();break}else V();n=!0}for(;P===" "||P===" "||P===`
|
||||||
`||z==="\r";)Z()}while(n);if(z===""){oe=te.DELIMITER;return}var t=z+st();if(uo[t]){oe=te.DELIMITER,M=t,Z(),Z();return}if(uo[z]){oe=te.DELIMITER,M=z,Z();return}if(fo(z)||z==="-"){for(M+=z,Z();fo(z);)M+=z,Z();M==="false"?M=!1:M==="true"?M=!0:isNaN(Number(M))||(M=Number(M)),oe=te.IDENTIFIER;return}if(z==='"'){for(Z();z!=""&&(z!='"'||z==='"'&&st()==='"');)z==='"'?(M+=z,Z()):z==="\\"&&st()==="n"?(M+=`
|
`||P==="\r";)V()}while(n);if(P===""){ee=Z.DELIMITER;return}var t=P+it();if(eo[t]){ee=Z.DELIMITER,k=t,V(),V();return}if(eo[P]){ee=Z.DELIMITER,k=P,V();return}if(to(P)||P==="-"){for(k+=P,V();to(P);)k+=P,V();k==="false"?k=!1:k==="true"?k=!0:isNaN(Number(k))||(k=Number(k)),ee=Z.IDENTIFIER;return}if(P==='"'){for(V();P!=""&&(P!='"'||P==='"'&&it()==='"');)P==='"'?(k+=P,V()):P==="\\"&&it()==="n"?(k+=`
|
||||||
`,Z()):M+=z,Z();if(z!='"')throw ie('End of string " expected');Z(),oe=te.IDENTIFIER;return}for(oe=te.UNKNOWN;z!="";)M+=z,Z();throw new SyntaxError('Syntax error in part "'+vo(M,30)+'"')}function ea(){var n={};if(Qr(),V(),M==="strict"&&(n.strict=!0,V()),(M==="graph"||M==="digraph")&&(n.type=M,V()),oe===te.IDENTIFIER&&(n.id=M,V()),M!="{")throw ie("Angle bracket { expected");if(V(),mo(n),M!="}")throw ie("Angle bracket } expected");if(V(),M!=="")throw ie("End of file expected");return V(),delete n.node,delete n.edge,delete n.graph,n}function mo(n){for(;M!==""&&M!="}";)ta(n),M===";"&&V()}function ta(n){var e=yo(n);if(e){bo(n,e);return}var t=ia(n);if(!t){if(oe!=te.IDENTIFIER)throw ie("Identifier expected");var i=M;if(V(),M==="="){if(V(),oe!=te.IDENTIFIER)throw ie("Identifier expected");n[i]=M,V()}else sa(n,i)}}function yo(n){var e=null;if(M==="subgraph"&&(e={},e.type="subgraph",V(),oe===te.IDENTIFIER&&(e.id=M,V())),M==="{"){if(V(),e||(e={}),e.parent=n,e.node=n.node,e.edge=n.edge,e.graph=n.graph,mo(e),M!="}")throw ie("Angle bracket } expected");V(),delete e.node,delete e.edge,delete e.graph,delete e.parent,n.subgraphs||(n.subgraphs=[]),n.subgraphs.push(e)}return e}function ia(n){return M==="node"?(V(),n.node=xt(),"node"):M==="edge"?(V(),n.edge=xt(),"edge"):M==="graph"?(V(),n.graph=xt(),"graph"):null}function sa(n,e){var t={id:e},i=xt();i&&(t.attr=i),po(n,t),bo(n,e)}function bo(n,e){for(;M==="->"||M==="--";){var t,i=M;V();var s=yo(n);if(s)t=s;else{if(oe!=te.IDENTIFIER)throw ie("Identifier or subgraph expected");t=M,po(n,{id:t}),V()}var o=xt(),r=go(n,e,t,i,o);Jr(n,r),e=t}}function xt(){for(var n,e=null,t={dashed:!0,solid:!1,dotted:[1,5]},i={dot:"circle",box:"box",crow:"crow",curve:"curve",icurve:"inv_curve",normal:"triangle",inv:"inv_triangle",diamond:"diamond",tee:"bar",vee:"vee"},s=new Array,o=new Array;M==="[";){for(V(),e={};M!==""&&M!="]";){if(oe!=te.IDENTIFIER)throw ie("Attribute name expected");var r=M;if(V(),M!="=")throw ie("Equal sign = expected");if(V(),oe!=te.IDENTIFIER)throw ie("Attribute value expected");var a=M;r==="style"&&(a=t[a]);var d;r==="arrowhead"&&(d=i[a],r="arrows",a={to:{enabled:!0,type:d}}),r==="arrowtail"&&(d=i[a],r="arrows",a={from:{enabled:!0,type:d}}),s.push({attr:e,name:r,value:a}),o.push(r),V(),M==","&&V()}if(M!="]")throw ie("Bracket ] expected");V()}if(o.includes("dir")){var h={};for(h.arrows={},n=0;n<s.length;n++)if(s[n].name==="arrows")if(s[n].value.to!=null)h.arrows.to=n;else if(s[n].value.from!=null)h.arrows.from=n;else throw ie("Invalid value of arrows");else s[n].name==="dir"&&(h.dir=n);var l=s[h.dir].value;if(!o.includes("arrows"))if(l==="both")s.push({attr:s[h.dir].attr,name:"arrows",value:{to:{enabled:!0}}}),h.arrows.to=s.length-1,s.push({attr:s[h.dir].attr,name:"arrows",value:{from:{enabled:!0}}}),h.arrows.from=s.length-1;else if(l==="forward")s.push({attr:s[h.dir].attr,name:"arrows",value:{to:{enabled:!0}}}),h.arrows.to=s.length-1;else if(l==="back")s.push({attr:s[h.dir].attr,name:"arrows",value:{from:{enabled:!0}}}),h.arrows.from=s.length-1;else if(l==="none")s.push({attr:s[h.dir].attr,name:"arrows",value:""}),h.arrows.to=s.length-1;else throw ie('Invalid dir type "'+l+'"');var c,u;if(l==="both")h.arrows.to&&h.arrows.from?(u=s[h.arrows.to].value.to.type,c=s[h.arrows.from].value.from.type,s[h.arrows.to]={attr:s[h.arrows.to].attr,name:s[h.arrows.to].name,value:{to:{enabled:!0,type:u},from:{enabled:!0,type:c}}},s.splice(h.arrows.from,1)):h.arrows.to?(u=s[h.arrows.to].value.to.type,c="arrow",s[h.arrows.to]={attr:s[h.arrows.to].attr,name:s[h.arrows.to].name,value:{to:{enabled:!0,type:u},from:{enabled:!0,type:c}}}):h.arrows.from&&(u="arrow",c=s[h.arrows.from].value.from.type,s[h.arrows.from]={attr:s[h.arrows.from].attr,name:s[h.arrows.from].name,value:{to:{enabled:!0,type:u},from:{enabled:!0,type:c}}});else if(l==="back")h.arrows.to&&h.arrows.from?(u="",c=s[h.arrows.from].value.from.type,s[h.arrows.from]={attr:s[h.arrows.from].attr,name:s[h.arrows.from].name,value:{to:{enabled:!0,type:u},from:{enabled:!0,type:c}}}):h.arrows.to?(u="",c="arrow",h.arrows.from=h.arrows.to,s[h.arrows.from]={attr:s[h.arrows.from].attr,name:s[h.arrows.from].name,value:{to:{enabled:!0,type:u},from:{enabled:!0,type:c}}}):h.arrows.from&&(u="",c=s[h.arrows.from].value.from.type,s[h.arrows.to]={attr:s[h.arrows.from].attr,name:s[h.arrows.from].name,value:{to:{enabled:!0,type:u},from:{enabled:!0,type:c}}}),s[h.arrows.from]={attr:s[h.arrows.from].attr,name:s[h.arrows.from].name,value:{from:{enabled:!0,type:s[h.arrows.from].value.from.type}}};else if(l==="none"){var p;h.arrows.to?p=h.arrows.to:p=h.arrows.from,s[p]={attr:s[p].attr,name:s[p].name,value:""}}else if(l==="forward")h.arrows.to&&h.arrows.from?(u=s[h.arrows.to].value.to.type,c="",s[h.arrows.to]={attr:s[h.arrows.to].attr,name:s[h.arrows.to].name,value:{to:{enabled:!0,type:u},from:{enabled:!0,type:c}}}):h.arrows.to?(u=s[h.arrows.to].value.to.type,c="",s[h.arrows.to]={attr:s[h.arrows.to].attr,name:s[h.arrows.to].name,value:{to:{enabled:!0,type:u},from:{en
Line truncated
|
`,V()):k+=P,V();if(P!='"')throw Q('End of string " expected');V(),ee=Z.IDENTIFIER;return}for(ee=Z.UNKNOWN;P!="";)k+=P,V();throw new SyntaxError('Syntax error in part "'+ao(k,30)+'"')}function Gr(){var n={};if(Ur(),N(),k==="strict"&&(n.strict=!0,N()),(k==="graph"||k==="digraph")&&(n.type=k,N()),ee===Z.IDENTIFIER&&(n.id=k,N()),k!="{")throw Q("Angle bracket { expected");if(N(),oo(n),k!="}")throw Q("Angle bracket } expected");if(N(),k!=="")throw Q("End of file expected");return N(),delete n.node,delete n.edge,delete n.graph,n}function oo(n){for(;k!==""&&k!="}";)Kr(n),k===";"&&N()}function Kr(n){var e=no(n);if(e){ro(n,e);return}var t=$r(n);if(!t){if(ee!=Z.IDENTIFIER)throw Q("Identifier expected");var i=k;if(N(),k==="="){if(N(),ee!=Z.IDENTIFIER)throw Q("Identifier expected");n[i]=k,N()}else Zr(n,i)}}function no(n){var e=null;if(k==="subgraph"&&(e={},e.type="subgraph",N(),ee===Z.IDENTIFIER&&(e.id=k,N())),k==="{"){if(N(),e||(e={}),e.parent=n,e.node=n.node,e.edge=n.edge,e.graph=n.graph,oo(e),k!="}")throw Q("Angle bracket } expected");N(),delete e.node,delete e.edge,delete e.graph,delete e.parent,n.subgraphs||(n.subgraphs=[]),n.subgraphs.push(e)}return e}function $r(n){return k==="node"?(N(),n.node=_t(),"node"):k==="edge"?(N(),n.edge=_t(),"edge"):k==="graph"?(N(),n.graph=_t(),"graph"):null}function Zr(n,e){var t={id:e},i=_t();i&&(t.attr=i),io(n,t),ro(n,e)}function ro(n,e){for(;k==="->"||k==="--";){var t,i=k;N();var s=no(n);if(s)t=s;else{if(ee!=Z.IDENTIFIER)throw Q("Identifier or subgraph expected");t=k,io(n,{id:t}),N()}var o=_t(),r=so(n,e,t,i,o);Xr(n,r),e=t}}function _t(){for(var n,e=null,t={dashed:!0,solid:!1,dotted:[1,5]},i={dot:"circle",box:"box",crow:"crow",curve:"curve",icurve:"inv_curve",normal:"triangle",inv:"inv_triangle",diamond:"diamond",tee:"bar",vee:"vee"},s=new Array,o=new Array;k==="[";){for(N(),e={};k!==""&&k!="]";){if(ee!=Z.IDENTIFIER)throw Q("Attribute name expected");var r=k;if(N(),k!="=")throw Q("Equal sign = expected");if(N(),ee!=Z.IDENTIFIER)throw Q("Attribute value expected");var a=k;r==="style"&&(a=t[a]);var d;r==="arrowhead"&&(d=i[a],r="arrows",a={to:{enabled:!0,type:d}}),r==="arrowtail"&&(d=i[a],r="arrows",a={from:{enabled:!0,type:d}}),s.push({attr:e,name:r,value:a}),o.push(r),N(),k==","&&N()}if(k!="]")throw Q("Bracket ] expected");N()}if(o.includes("dir")){var h={};for(h.arrows={},n=0;n<s.length;n++)if(s[n].name==="arrows")if(s[n].value.to!=null)h.arrows.to=n;else if(s[n].value.from!=null)h.arrows.from=n;else throw Q("Invalid value of arrows");else s[n].name==="dir"&&(h.dir=n);var l=s[h.dir].value;if(!o.includes("arrows"))if(l==="both")s.push({attr:s[h.dir].attr,name:"arrows",value:{to:{enabled:!0}}}),h.arrows.to=s.length-1,s.push({attr:s[h.dir].attr,name:"arrows",value:{from:{enabled:!0}}}),h.arrows.from=s.length-1;else if(l==="forward")s.push({attr:s[h.dir].attr,name:"arrows",value:{to:{enabled:!0}}}),h.arrows.to=s.length-1;else if(l==="back")s.push({attr:s[h.dir].attr,name:"arrows",value:{from:{enabled:!0}}}),h.arrows.from=s.length-1;else if(l==="none")s.push({attr:s[h.dir].attr,name:"arrows",value:""}),h.arrows.to=s.length-1;else throw Q('Invalid dir type "'+l+'"');var c,u;if(l==="both")h.arrows.to&&h.arrows.from?(u=s[h.arrows.to].value.to.type,c=s[h.arrows.from].value.from.type,s[h.arrows.to]={attr:s[h.arrows.to].attr,name:s[h.arrows.to].name,value:{to:{enabled:!0,type:u},from:{enabled:!0,type:c}}},s.splice(h.arrows.from,1)):h.arrows.to?(u=s[h.arrows.to].value.to.type,c="arrow",s[h.arrows.to]={attr:s[h.arrows.to].attr,name:s[h.arrows.to].name,value:{to:{enabled:!0,type:u},from:{enabled:!0,type:c}}}):h.arrows.from&&(u="arrow",c=s[h.arrows.from].value.from.type,s[h.arrows.from]={attr:s[h.arrows.from].attr,name:s[h.arrows.from].name,value:{to:{enabled:!0,type:u},from:{enabled:!0,type:c}}});else if(l==="back")h.arrows.to&&h.arrows.from?(u="",c=s[h.arrows.from].value.from.type,s[h.arrows.from]={attr:s[h.arrows.from].attr,name:s[h.arrows.from].name,value:{to:{enabled:!0,type:u},from:{enabled:!0,type:c}}}):h.arrows.to?(u="",c="arrow",h.arrows.from=h.arrows.to,s[h.arrows.from]={attr:s[h.arrows.from].attr,name:s[h.arrows.from].name,value:{to:{enabled:!0,type:u},from:{enabled:!0,type:c}}}):h.arrows.from&&(u="",c=s[h.arrows.from].value.from.type,s[h.arrows.to]={attr:s[h.arrows.from].attr,name:s[h.arrows.from].name,value:{to:{enabled:!0,type:u},from:{enabled:!0,type:c}}}),s[h.arrows.from]={attr:s[h.arrows.from].attr,name:s[h.arrows.from].name,value:{from:{enabled:!0,type:s[h.arrows.from].value.from.type}}};else if(l==="none"){var f;h.arrows.to?f=h.arrows.to:f=h.arrows.from,s[f]={attr:s[f].attr,name:s[f].name,value:""}}else if(l==="forward")h.arrows.to&&h.arrows.from?(u=s[h.arrows.to].value.to.type,c="",s[h.arrows.to]={attr:s[h.arrows.to].attr,name:s[h.arrows.to].name,value:{to:{enabled:!0,type:u},from:{enabled:!0,type:c}}}):h.arrows.to?(u=s[h.arrows.to].value.to.type,c="",s[h.arrows.to]={attr:s[h.arrows.to].attr,name:s[h.arrows.to].name,value:{to:{enabled:!0,type:u},from:{enabled:!0,type:c}}}):h.a
Line truncated
|
||||||
`),e=e.replace(/\r/g,`
|
`),e=e.replace(/\r/g,`
|
||||||
`);let i=String(e).split(`
|
`);let i=String(e).split(`
|
||||||
`),s=i.length;if(t.multi)for(let o=0;o<s;o++){let r=this.splitBlocks(i[o],t.multi);if(r!==void 0){if(r.length===0){this.lines.newLine("");continue}if(t.maxWdt>0)for(let a=0;a<r.length;a++){let d=r[a].mod,h=r[a].text;this.splitStringIntoLines(h,d,!0)}else for(let a=0;a<r.length;a++){let d=r[a].mod,h=r[a].text;this.lines.append(h,d)}this.lines.newLine()}}else if(t.maxWdt>0)for(let o=0;o<s;o++)this.splitStringIntoLines(i[o]);else for(let o=0;o<s;o++)this.lines.newLine(i[o]);return this.lines.finalize()}decodeMarkupSystem(e){let t="none";return e==="markdown"||e==="md"?t="markdown":(e===!0||e==="html")&&(t="html"),t}splitHtmlBlocks(e){let t=new Pi(e),i=s=>/&/.test(s)?(t.replace(t.text,"<","<")||t.replace(t.text,"&","&")||t.add("&"),!0):!1;for(;t.position<t.text.length;){let s=t.text.charAt(t.position);t.parseWS(s)||/</.test(s)&&(t.parseStartTag("bold","<b>")||t.parseStartTag("ital","<i>")||t.parseStartTag("mono","<code>")||t.parseEndTag("bold","</b>")||t.parseEndTag("ital","</i>")||t.parseEndTag("mono","</code>"))||i(s)||t.add(s),t.position++}return t.emitBlock(),t.blocks}splitMarkdownBlocks(e){let t=new Pi(e),i=!0,s=o=>/\\/.test(o)?(t.position<this.text.length+1&&(t.position++,o=this.text.charAt(t.position),/ \t/.test(o)?t.spacing=!0:(t.add(o),i=!1)),!0):!1;for(;t.position<t.text.length;){let o=t.text.charAt(t.position);t.parseWS(o)||s(o)||(i||t.spacing)&&(t.parseStartTag("bold","*")||t.parseStartTag("ital","_")||t.parseStartTag("mono","`"))||t.parseEndTag("bold","*","afterBold")||t.parseEndTag("ital","_","afterItal")||t.parseEndTag("mono","`","afterMono")||(t.add(o),i=!1),t.position++}return t.emitBlock(),t.blocks}splitBlocks(e,t){let i=this.decodeMarkupSystem(t);if(i==="none")return[{text:e,mod:"normal"}];if(i==="markdown")return this.splitMarkdownBlocks(e);if(i==="html")return this.splitHtmlBlocks(e)}overMaxWidth(e){let t=this.ctx.measureText(e).width;return this.lines.curWidth()+t>this.parent.fontOptions.maxWdt}getLongestFit(e){let t="",i=0;for(;i<e.length;){let o=t+(t===""?"":" ")+e[i];if(this.overMaxWidth(o))break;t=o,i++}return i}getLongestFitWord(e){let t=0;for(;t<e.length&&!this.overMaxWidth(e.slice(0,t));)t++;return t}splitStringIntoLines(e,t="normal",i=!1){this.parent.getFormattingValues(this.ctx,this.selected,this.hover,t),e=e.replace(/^( +)/g,"$1\r"),e=e.replace(/([^\r][^ ]*)( +)/g,"$1\r$2\r");let s=e.split("\r");for(;s.length>0;){let o=this.getLongestFit(s);if(o===0){let r=s[0],a=this.getLongestFitWord(r);this.lines.newLine(r.slice(0,a),t),s[0]=r.slice(a)}else{let r=o;s[o-1]===" "?o--:s[r]===" "&&r++;let a=s.slice(0,o).join("");o==s.length&&i?this.lines.append(a,t):this.lines.newLine(a,t),s=s.slice(r)}}}},Xt=["bold","ital","boldital","mono"],Ye=class{constructor(e,t,i=!1){this.body=e,this.pointToSelf=!1,this.baseSize=void 0,this.fontOptions={},this.setOptions(t),this.size={top:0,left:0,width:0,height:0,yLine:0},this.isEdgeLabel=i}setOptions(e){if(this.elementOptions=e,this.initFontOptions(e.font),Yt(e.label)?this.labelDirty=!0:e.label=void 0,e.font!==void 0&&e.font!==null){if(typeof e.font=="string")this.baseSize=this.fontOptions.size;else if(typeof e.font=="object"){let t=e.font.size;t!==void 0&&(this.baseSize=t)}}}initFontOptions(e){if(A(Xt,t=>{this.fontOptions[t]={}}),Ye.parseFontString(this.fontOptions,e)){this.fontOptions.vadjust=0;return}A(e,(t,i)=>{t!=null&&typeof t!="object"&&(this.fontOptions[i]=t)})}static parseFontString(e,t){if(!t||typeof t!="string")return!1;let i=t.split(" ");return e.size=+i[0].replace("px",""),e.face=i[1],e.color=i[2],!0}constrain(e){let t={constrainWidth:!1,maxWdt:-1,minWdt:-1,constrainHeight:!1,minHgt:-1,valign:"middle"},i=xe(e,"widthConstraint");if(typeof i=="number")t.maxWdt=Number(i),t.minWdt=Number(i);else if(typeof i=="object"){let o=xe(e,["widthConstraint","maximum"]);typeof o=="number"&&(t.maxWdt=Number(o));let r=xe(e,["widthConstraint","minimum"]);typeof r=="number"&&(t.minWdt=Number(r))}let s=xe(e,"heightConstraint");if(typeof s=="number")t.minHgt=Number(s);else if(typeof s=="object"){let o=xe(e,["heightConstraint","minimum"]);typeof o=="number"&&(t.minHgt=Number(o));let r=xe(e,["heightConstraint","valign"]);typeof r=="string"&&(r==="top"||r==="bottom")&&(t.valign=r)}return t}update(e,t){this.setOptions(e,!0),this.propagateFonts(t),j(this.fontOptions,this.constrain(t)),this.fontOptions.chooser=Oi("label",t)}adjustSizes(e){let t=e?e.right+e.left:0;this.fontOptions.constrainWidth&&(this.fontOptions.maxWdt-=t,this.fontOptions.minWdt-=t);let i=e?e.top+e.bottom:0;this.fontOptions.constrainHeight&&(this.fontOptions.minHgt-=i)}addFontOptionsToPile(e,t){for(let i=0;i<t.length;++i)this.addFontToPile(e,t[i])}addFontToPile(e,t){if(t===void 0||t.font===void 0||t.font===null)return;let i=t.font;e.push(i)}getBasicOptions(e){let t={};for(let i=0;i<e.length;++i){let s=e[i],o={};Ye.parseFontString(o,s)&&(s=o),A(s,(r,a)=>{r!==void 0&&(Object.prototype.hasOwnProperty.call(t,a)||(Xt.indexOf(a)!==-1?t[a]={}:t[a]=r))})}return t}getFontOption(e,t,i){let s;for(let o=0;
Line truncated
|
`),s=i.length;if(t.multi)for(let o=0;o<s;o++){let r=this.splitBlocks(i[o],t.multi);if(r!==void 0){if(r.length===0){this.lines.newLine("");continue}if(t.maxWdt>0)for(let a=0;a<r.length;a++){let d=r[a].mod,h=r[a].text;this.splitStringIntoLines(h,d,!0)}else for(let a=0;a<r.length;a++){let d=r[a].mod,h=r[a].text;this.lines.append(h,d)}this.lines.newLine()}}else if(t.maxWdt>0)for(let o=0;o<s;o++)this.splitStringIntoLines(i[o]);else for(let o=0;o<s;o++)this.lines.newLine(i[o]);return this.lines.finalize()}decodeMarkupSystem(e){let t="none";return e==="markdown"||e==="md"?t="markdown":(e===!0||e==="html")&&(t="html"),t}splitHtmlBlocks(e){let t=new ki(e),i=s=>/&/.test(s)?(t.replace(t.text,"<","<")||t.replace(t.text,"&","&")||t.add("&"),!0):!1;for(;t.position<t.text.length;){let s=t.text.charAt(t.position);t.parseWS(s)||/</.test(s)&&(t.parseStartTag("bold","<b>")||t.parseStartTag("ital","<i>")||t.parseStartTag("mono","<code>")||t.parseEndTag("bold","</b>")||t.parseEndTag("ital","</i>")||t.parseEndTag("mono","</code>"))||i(s)||t.add(s),t.position++}return t.emitBlock(),t.blocks}splitMarkdownBlocks(e){let t=new ki(e),i=!0,s=o=>/\\/.test(o)?(t.position<this.text.length+1&&(t.position++,o=this.text.charAt(t.position),/ \t/.test(o)?t.spacing=!0:(t.add(o),i=!1)),!0):!1;for(;t.position<t.text.length;){let o=t.text.charAt(t.position);t.parseWS(o)||s(o)||(i||t.spacing)&&(t.parseStartTag("bold","*")||t.parseStartTag("ital","_")||t.parseStartTag("mono","`"))||t.parseEndTag("bold","*","afterBold")||t.parseEndTag("ital","_","afterItal")||t.parseEndTag("mono","`","afterMono")||(t.add(o),i=!1),t.position++}return t.emitBlock(),t.blocks}splitBlocks(e,t){let i=this.decodeMarkupSystem(t);if(i==="none")return[{text:e,mod:"normal"}];if(i==="markdown")return this.splitMarkdownBlocks(e);if(i==="html")return this.splitHtmlBlocks(e)}overMaxWidth(e){let t=this.ctx.measureText(e).width;return this.lines.curWidth()+t>this.parent.fontOptions.maxWdt}getLongestFit(e){let t="",i=0;for(;i<e.length;){let o=t+(t===""?"":" ")+e[i];if(this.overMaxWidth(o))break;t=o,i++}return i}getLongestFitWord(e){let t=0;for(;t<e.length&&!this.overMaxWidth(e.slice(0,t));)t++;return t}splitStringIntoLines(e,t="normal",i=!1){this.parent.getFormattingValues(this.ctx,this.selected,this.hover,t),e=e.replace(/^( +)/g,"$1\r"),e=e.replace(/([^\r][^ ]*)( +)/g,"$1\r$2\r");let s=e.split("\r");for(;s.length>0;){let o=this.getLongestFit(s);if(o===0){let r=s[0],a=this.getLongestFitWord(r);this.lines.newLine(r.slice(0,a),t),s[0]=r.slice(a)}else{let r=o;s[o-1]===" "?o--:s[r]===" "&&r++;let a=s.slice(0,o).join("");o==s.length&&i?this.lines.append(a,t):this.lines.newLine(a,t),s=s.slice(r)}}}},Ut=["bold","ital","boldital","mono"],Ve=class{constructor(e,t,i=!1){this.body=e,this.pointToSelf=!1,this.baseSize=void 0,this.fontOptions={},this.setOptions(t),this.size={top:0,left:0,width:0,height:0,yLine:0},this.isEdgeLabel=i}setOptions(e){if(this.elementOptions=e,this.initFontOptions(e.font),qt(e.label)?this.labelDirty=!0:e.label=void 0,e.font!==void 0&&e.font!==null){if(typeof e.font=="string")this.baseSize=this.fontOptions.size;else if(typeof e.font=="object"){let t=e.font.size;t!==void 0&&(this.baseSize=t)}}}initFontOptions(e){if(I(Ut,t=>{this.fontOptions[t]={}}),Ve.parseFontString(this.fontOptions,e)){this.fontOptions.vadjust=0;return}I(e,(t,i)=>{t!=null&&typeof t!="object"&&(this.fontOptions[i]=t)})}static parseFontString(e,t){if(!t||typeof t!="string")return!1;let i=t.split(" ");return e.size=+i[0].replace("px",""),e.face=i[1],e.color=i[2],!0}constrain(e){let t={constrainWidth:!1,maxWdt:-1,minWdt:-1,constrainHeight:!1,minHgt:-1,valign:"middle"},i=we(e,"widthConstraint");if(typeof i=="number")t.maxWdt=Number(i),t.minWdt=Number(i);else if(typeof i=="object"){let o=we(e,["widthConstraint","maximum"]);typeof o=="number"&&(t.maxWdt=Number(o));let r=we(e,["widthConstraint","minimum"]);typeof r=="number"&&(t.minWdt=Number(r))}let s=we(e,"heightConstraint");if(typeof s=="number")t.minHgt=Number(s);else if(typeof s=="object"){let o=we(e,["heightConstraint","minimum"]);typeof o=="number"&&(t.minHgt=Number(o));let r=we(e,["heightConstraint","valign"]);typeof r=="string"&&(r==="top"||r==="bottom")&&(t.valign=r)}return t}update(e,t){this.setOptions(e,!0),this.propagateFonts(t),D(this.fontOptions,this.constrain(t)),this.fontOptions.chooser=Ci("label",t)}adjustSizes(e){let t=e?e.right+e.left:0;this.fontOptions.constrainWidth&&(this.fontOptions.maxWdt-=t,this.fontOptions.minWdt-=t);let i=e?e.top+e.bottom:0;this.fontOptions.constrainHeight&&(this.fontOptions.minHgt-=i)}addFontOptionsToPile(e,t){for(let i=0;i<t.length;++i)this.addFontToPile(e,t[i])}addFontToPile(e,t){if(t===void 0||t.font===void 0||t.font===null)return;let i=t.font;e.push(i)}getBasicOptions(e){let t={};for(let i=0;i<e.length;++i){let s=e[i],o={};Ve.parseFontString(o,s)&&(s=o),I(s,(r,a)=>{r!==void 0&&(Object.prototype.hasOwnProperty.call(t,a)||(Ut.indexOf(a)!==-1?t[a]={}:t[a]=r))})}return t}getFontOption(e,t,i){let s;for(let o=0;
Line truncated
|
||||||
/*! Hammer.JS - v2.0.17-rc - 2019-12-16
|
/*! Hammer.JS - v2.0.17-rc - 2019-12-16
|
||||||
* http://naver.github.io/egjs
|
* http://naver.github.io/egjs
|
||||||
*
|
*
|
||||||
@@ -33,8 +33,8 @@
|
|||||||
*
|
*
|
||||||
* Manage unstructured data using DataSet. Add, update, and remove data, and listen for changes in the data.
|
* Manage unstructured data using DataSet. Add, update, and remove data, and listen for changes in the data.
|
||||||
*
|
*
|
||||||
* @version 7.1.6
|
* @version 7.1.9
|
||||||
* @date 2023-03-22T11:39:37.256Z
|
* @date 2023-11-24T17:53:34.179Z
|
||||||
*
|
*
|
||||||
* @copyright (c) 2011-2017 Almende B.V, http://almende.com
|
* @copyright (c) 2011-2017 Almende B.V, http://almende.com
|
||||||
* @copyright (c) 2017-2019 visjs contributors, https://github.com/visjs
|
* @copyright (c) 2017-2019 visjs contributors, https://github.com/visjs
|
||||||
@@ -58,8 +58,8 @@
|
|||||||
*
|
*
|
||||||
* A dynamic, browser-based visualization library.
|
* A dynamic, browser-based visualization library.
|
||||||
*
|
*
|
||||||
* @version 9.1.6
|
* @version 9.1.9
|
||||||
* @date 2023-03-23T21:31:19.223Z
|
* @date 2023-11-03T01:42:27.418Z
|
||||||
*
|
*
|
||||||
* @copyright (c) 2011-2017 Almende B.V, http://almende.com
|
* @copyright (c) 2011-2017 Almende B.V, http://almende.com
|
||||||
* @copyright (c) 2017-2019 visjs contributors, https://github.com/visjs
|
* @copyright (c) 2017-2019 visjs contributors, https://github.com/visjs
|
||||||
@@ -83,8 +83,8 @@
|
|||||||
*
|
*
|
||||||
* utilitie collection for visjs
|
* utilitie collection for visjs
|
||||||
*
|
*
|
||||||
* @version 5.0.3
|
* @version 5.0.7
|
||||||
* @date 2022-03-04T18:53:16.725Z
|
* @date 2023-11-20T09:06:51.067Z
|
||||||
*
|
*
|
||||||
* @copyright (c) 2011-2017 Almende B.V, http://almende.com
|
* @copyright (c) 2011-2017 Almende B.V, http://almende.com
|
||||||
* @copyright (c) 2017-2019 visjs contributors, https://github.com/visjs
|
* @copyright (c) 2017-2019 visjs contributors, https://github.com/visjs
|
||||||
|
|||||||
@@ -79,7 +79,26 @@ const coordSaveCheckbox = document.querySelector('#id_save_coords')
|
|||||||
Promise.allSettled(
|
Promise.allSettled(
|
||||||
Object.entries(graph.getPositions(params.nodes)).map(
|
Object.entries(graph.getPositions(params.nodes)).map(
|
||||||
async ([nodeId, nodePosition]) => {
|
async ([nodeId, nodePosition]) => {
|
||||||
window.nodes.update({id: parseInt(nodeId), physics: false, x: nodePosition.x, y: nodePosition.y});
|
if(!isNaN(parseInt(nodeId))) {
|
||||||
|
nodeKey = parseInt(nodeId);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
nodeKey = nodeId;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
window.nodes.update({id: nodeKey, physics: false, x: nodePosition.x, y: nodePosition.y});
|
||||||
|
}
|
||||||
|
catch (e) {
|
||||||
|
console.log([
|
||||||
|
'Error while executing window.nodes.update()',
|
||||||
|
'nodeId: ' + nodeId,
|
||||||
|
'nodeKey: ' + nodeKey,
|
||||||
|
'x: ' + nodePosition.x,
|
||||||
|
'y: ' + nodePosition.y
|
||||||
|
]);
|
||||||
|
console.log(e);
|
||||||
|
}
|
||||||
const res = await fetch(
|
const res = await fetch(
|
||||||
'/' + basePath + 'api/plugins/netbox_topology_views/save-coords/save_coords/',
|
'/' + basePath + 'api/plugins/netbox_topology_views/save-coords/save_coords/',
|
||||||
{
|
{
|
||||||
@@ -97,8 +116,6 @@ const coordSaveCheckbox = document.querySelector('#id_save_coords')
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
console.log(nodeId, res.status, res.statusText)
|
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|||||||
+814
-33
@@ -1,14 +1,796 @@
|
|||||||
{
|
{
|
||||||
"name": "netbox_topology_views",
|
"name": "netbox_topology_views",
|
||||||
"version": "3.6.0-beta.2",
|
"version": "3.9.0",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
|
"packages": {
|
||||||
|
"": {
|
||||||
|
"name": "netbox_topology_views",
|
||||||
|
"version": "3.9.0",
|
||||||
|
"dependencies": {
|
||||||
|
"vis-data": "^7.1.9",
|
||||||
|
"vis-network": "^9.1.9",
|
||||||
|
"vis-util": "^5.0.7"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@egjs/hammerjs": "^2.0.0",
|
||||||
|
"component-emitter": "^1.3.0",
|
||||||
|
"esbuild": "^0.12.24",
|
||||||
|
"esbuild-sass-plugin": "^1.5.2",
|
||||||
|
"keycharm": "^0.4.0",
|
||||||
|
"timsort": "^0.3.0",
|
||||||
|
"uuid": "^8.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@egjs/hammerjs": {
|
||||||
|
"version": "2.0.17",
|
||||||
|
"resolved": "https://registry.npmjs.org/@egjs/hammerjs/-/hammerjs-2.0.17.tgz",
|
||||||
|
"integrity": "sha512-XQsZgjm2EcVUiZQf11UBJQfmZeEmOW8DpI1gsFeln6w0ae0ii4dMQEQ0kjl6DspdWX1aGY1/loyXnP0JS06e/A==",
|
||||||
|
"dependencies": {
|
||||||
|
"@types/hammerjs": "^2.0.36"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=0.8.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@esbuild/linux-loong64": {
|
||||||
|
"version": "0.14.54",
|
||||||
|
"resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.14.54.tgz",
|
||||||
|
"integrity": "sha512-bZBrLAIX1kpWelV0XemxBZllyRmM6vgFQQG2GdNb+r3Fkp0FOh1NJSvekXDs7jq70k4euu1cryLMfU+mTXlEpw==",
|
||||||
|
"cpu": [
|
||||||
|
"loong64"
|
||||||
|
],
|
||||||
|
"dev": true,
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"linux"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@types/hammerjs": {
|
||||||
|
"version": "2.0.41",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/hammerjs/-/hammerjs-2.0.41.tgz",
|
||||||
|
"integrity": "sha512-ewXv/ceBaJprikMcxCmWU1FKyMAQ2X7a9Gtmzw8fcg2kIePI1crERDM818W+XYrxqdBBOdlf2rm137bU+BltCA=="
|
||||||
|
},
|
||||||
|
"node_modules/anymatch": {
|
||||||
|
"version": "3.1.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz",
|
||||||
|
"integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==",
|
||||||
|
"dev": true,
|
||||||
|
"dependencies": {
|
||||||
|
"normalize-path": "^3.0.0",
|
||||||
|
"picomatch": "^2.0.4"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 8"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/binary-extensions": {
|
||||||
|
"version": "2.2.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz",
|
||||||
|
"integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==",
|
||||||
|
"dev": true,
|
||||||
|
"engines": {
|
||||||
|
"node": ">=8"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/braces": {
|
||||||
|
"version": "3.0.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz",
|
||||||
|
"integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==",
|
||||||
|
"dev": true,
|
||||||
|
"dependencies": {
|
||||||
|
"fill-range": "^7.0.1"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=8"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/chokidar": {
|
||||||
|
"version": "3.5.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz",
|
||||||
|
"integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==",
|
||||||
|
"dev": true,
|
||||||
|
"funding": [
|
||||||
|
{
|
||||||
|
"type": "individual",
|
||||||
|
"url": "https://paulmillr.com/funding/"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"dependencies": {
|
||||||
|
"anymatch": "~3.1.2",
|
||||||
|
"braces": "~3.0.2",
|
||||||
|
"glob-parent": "~5.1.2",
|
||||||
|
"is-binary-path": "~2.1.0",
|
||||||
|
"is-glob": "~4.0.1",
|
||||||
|
"normalize-path": "~3.0.0",
|
||||||
|
"readdirp": "~3.6.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 8.10.0"
|
||||||
|
},
|
||||||
|
"optionalDependencies": {
|
||||||
|
"fsevents": "~2.3.2"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/component-emitter": {
|
||||||
|
"version": "1.3.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz",
|
||||||
|
"integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg=="
|
||||||
|
},
|
||||||
|
"node_modules/esbuild": {
|
||||||
|
"version": "0.12.29",
|
||||||
|
"resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.12.29.tgz",
|
||||||
|
"integrity": "sha512-w/XuoBCSwepyiZtIRsKsetiLDUVGPVw1E/R3VTFSecIy8UR7Cq3SOtwKHJMFoVqqVG36aGkzh4e8BvpO1Fdc7g==",
|
||||||
|
"dev": true,
|
||||||
|
"hasInstallScript": true,
|
||||||
|
"bin": {
|
||||||
|
"esbuild": "bin/esbuild"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/esbuild-android-64": {
|
||||||
|
"version": "0.14.54",
|
||||||
|
"resolved": "https://registry.npmjs.org/esbuild-android-64/-/esbuild-android-64-0.14.54.tgz",
|
||||||
|
"integrity": "sha512-Tz2++Aqqz0rJ7kYBfz+iqyE3QMycD4vk7LBRyWaAVFgFtQ/O8EJOnVmTOiDWYZ/uYzB4kvP+bqejYdVKzE5lAQ==",
|
||||||
|
"cpu": [
|
||||||
|
"x64"
|
||||||
|
],
|
||||||
|
"dev": true,
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"android"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/esbuild-android-arm64": {
|
||||||
|
"version": "0.14.54",
|
||||||
|
"resolved": "https://registry.npmjs.org/esbuild-android-arm64/-/esbuild-android-arm64-0.14.54.tgz",
|
||||||
|
"integrity": "sha512-F9E+/QDi9sSkLaClO8SOV6etqPd+5DgJje1F9lOWoNncDdOBL2YF59IhsWATSt0TLZbYCf3pNlTHvVV5VfHdvg==",
|
||||||
|
"cpu": [
|
||||||
|
"arm64"
|
||||||
|
],
|
||||||
|
"dev": true,
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"android"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/esbuild-darwin-64": {
|
||||||
|
"version": "0.14.54",
|
||||||
|
"resolved": "https://registry.npmjs.org/esbuild-darwin-64/-/esbuild-darwin-64-0.14.54.tgz",
|
||||||
|
"integrity": "sha512-jtdKWV3nBviOd5v4hOpkVmpxsBy90CGzebpbO9beiqUYVMBtSc0AL9zGftFuBon7PNDcdvNCEuQqw2x0wP9yug==",
|
||||||
|
"cpu": [
|
||||||
|
"x64"
|
||||||
|
],
|
||||||
|
"dev": true,
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"darwin"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/esbuild-darwin-arm64": {
|
||||||
|
"version": "0.14.54",
|
||||||
|
"resolved": "https://registry.npmjs.org/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.14.54.tgz",
|
||||||
|
"integrity": "sha512-OPafJHD2oUPyvJMrsCvDGkRrVCar5aVyHfWGQzY1dWnzErjrDuSETxwA2HSsyg2jORLY8yBfzc1MIpUkXlctmw==",
|
||||||
|
"cpu": [
|
||||||
|
"arm64"
|
||||||
|
],
|
||||||
|
"dev": true,
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"darwin"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/esbuild-freebsd-64": {
|
||||||
|
"version": "0.14.54",
|
||||||
|
"resolved": "https://registry.npmjs.org/esbuild-freebsd-64/-/esbuild-freebsd-64-0.14.54.tgz",
|
||||||
|
"integrity": "sha512-OKwd4gmwHqOTp4mOGZKe/XUlbDJ4Q9TjX0hMPIDBUWWu/kwhBAudJdBoxnjNf9ocIB6GN6CPowYpR/hRCbSYAg==",
|
||||||
|
"cpu": [
|
||||||
|
"x64"
|
||||||
|
],
|
||||||
|
"dev": true,
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"freebsd"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/esbuild-freebsd-arm64": {
|
||||||
|
"version": "0.14.54",
|
||||||
|
"resolved": "https://registry.npmjs.org/esbuild-freebsd-arm64/-/esbuild-freebsd-arm64-0.14.54.tgz",
|
||||||
|
"integrity": "sha512-sFwueGr7OvIFiQT6WeG0jRLjkjdqWWSrfbVwZp8iMP+8UHEHRBvlaxL6IuKNDwAozNUmbb8nIMXa7oAOARGs1Q==",
|
||||||
|
"cpu": [
|
||||||
|
"arm64"
|
||||||
|
],
|
||||||
|
"dev": true,
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"freebsd"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/esbuild-linux-32": {
|
||||||
|
"version": "0.14.54",
|
||||||
|
"resolved": "https://registry.npmjs.org/esbuild-linux-32/-/esbuild-linux-32-0.14.54.tgz",
|
||||||
|
"integrity": "sha512-1ZuY+JDI//WmklKlBgJnglpUL1owm2OX+8E1syCD6UAxcMM/XoWd76OHSjl/0MR0LisSAXDqgjT3uJqT67O3qw==",
|
||||||
|
"cpu": [
|
||||||
|
"ia32"
|
||||||
|
],
|
||||||
|
"dev": true,
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"linux"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/esbuild-linux-64": {
|
||||||
|
"version": "0.14.54",
|
||||||
|
"resolved": "https://registry.npmjs.org/esbuild-linux-64/-/esbuild-linux-64-0.14.54.tgz",
|
||||||
|
"integrity": "sha512-EgjAgH5HwTbtNsTqQOXWApBaPVdDn7XcK+/PtJwZLT1UmpLoznPd8c5CxqsH2dQK3j05YsB3L17T8vE7cp4cCg==",
|
||||||
|
"cpu": [
|
||||||
|
"x64"
|
||||||
|
],
|
||||||
|
"dev": true,
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"linux"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/esbuild-linux-arm": {
|
||||||
|
"version": "0.14.54",
|
||||||
|
"resolved": "https://registry.npmjs.org/esbuild-linux-arm/-/esbuild-linux-arm-0.14.54.tgz",
|
||||||
|
"integrity": "sha512-qqz/SjemQhVMTnvcLGoLOdFpCYbz4v4fUo+TfsWG+1aOu70/80RV6bgNpR2JCrppV2moUQkww+6bWxXRL9YMGw==",
|
||||||
|
"cpu": [
|
||||||
|
"arm"
|
||||||
|
],
|
||||||
|
"dev": true,
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"linux"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/esbuild-linux-arm64": {
|
||||||
|
"version": "0.14.54",
|
||||||
|
"resolved": "https://registry.npmjs.org/esbuild-linux-arm64/-/esbuild-linux-arm64-0.14.54.tgz",
|
||||||
|
"integrity": "sha512-WL71L+0Rwv+Gv/HTmxTEmpv0UgmxYa5ftZILVi2QmZBgX3q7+tDeOQNqGtdXSdsL8TQi1vIaVFHUPDe0O0kdig==",
|
||||||
|
"cpu": [
|
||||||
|
"arm64"
|
||||||
|
],
|
||||||
|
"dev": true,
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"linux"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/esbuild-linux-mips64le": {
|
||||||
|
"version": "0.14.54",
|
||||||
|
"resolved": "https://registry.npmjs.org/esbuild-linux-mips64le/-/esbuild-linux-mips64le-0.14.54.tgz",
|
||||||
|
"integrity": "sha512-qTHGQB8D1etd0u1+sB6p0ikLKRVuCWhYQhAHRPkO+OF3I/iSlTKNNS0Lh2Oc0g0UFGguaFZZiPJdJey3AGpAlw==",
|
||||||
|
"cpu": [
|
||||||
|
"mips64el"
|
||||||
|
],
|
||||||
|
"dev": true,
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"linux"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/esbuild-linux-ppc64le": {
|
||||||
|
"version": "0.14.54",
|
||||||
|
"resolved": "https://registry.npmjs.org/esbuild-linux-ppc64le/-/esbuild-linux-ppc64le-0.14.54.tgz",
|
||||||
|
"integrity": "sha512-j3OMlzHiqwZBDPRCDFKcx595XVfOfOnv68Ax3U4UKZ3MTYQB5Yz3X1mn5GnodEVYzhtZgxEBidLWeIs8FDSfrQ==",
|
||||||
|
"cpu": [
|
||||||
|
"ppc64"
|
||||||
|
],
|
||||||
|
"dev": true,
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"linux"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/esbuild-linux-riscv64": {
|
||||||
|
"version": "0.14.54",
|
||||||
|
"resolved": "https://registry.npmjs.org/esbuild-linux-riscv64/-/esbuild-linux-riscv64-0.14.54.tgz",
|
||||||
|
"integrity": "sha512-y7Vt7Wl9dkOGZjxQZnDAqqn+XOqFD7IMWiewY5SPlNlzMX39ocPQlOaoxvT4FllA5viyV26/QzHtvTjVNOxHZg==",
|
||||||
|
"cpu": [
|
||||||
|
"riscv64"
|
||||||
|
],
|
||||||
|
"dev": true,
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"linux"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/esbuild-linux-s390x": {
|
||||||
|
"version": "0.14.54",
|
||||||
|
"resolved": "https://registry.npmjs.org/esbuild-linux-s390x/-/esbuild-linux-s390x-0.14.54.tgz",
|
||||||
|
"integrity": "sha512-zaHpW9dziAsi7lRcyV4r8dhfG1qBidQWUXweUjnw+lliChJqQr+6XD71K41oEIC3Mx1KStovEmlzm+MkGZHnHA==",
|
||||||
|
"cpu": [
|
||||||
|
"s390x"
|
||||||
|
],
|
||||||
|
"dev": true,
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"linux"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/esbuild-netbsd-64": {
|
||||||
|
"version": "0.14.54",
|
||||||
|
"resolved": "https://registry.npmjs.org/esbuild-netbsd-64/-/esbuild-netbsd-64-0.14.54.tgz",
|
||||||
|
"integrity": "sha512-PR01lmIMnfJTgeU9VJTDY9ZerDWVFIUzAtJuDHwwceppW7cQWjBBqP48NdeRtoP04/AtO9a7w3viI+PIDr6d+w==",
|
||||||
|
"cpu": [
|
||||||
|
"x64"
|
||||||
|
],
|
||||||
|
"dev": true,
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"netbsd"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/esbuild-openbsd-64": {
|
||||||
|
"version": "0.14.54",
|
||||||
|
"resolved": "https://registry.npmjs.org/esbuild-openbsd-64/-/esbuild-openbsd-64-0.14.54.tgz",
|
||||||
|
"integrity": "sha512-Qyk7ikT2o7Wu76UsvvDS5q0amJvmRzDyVlL0qf5VLsLchjCa1+IAvd8kTBgUxD7VBUUVgItLkk609ZHUc1oCaw==",
|
||||||
|
"cpu": [
|
||||||
|
"x64"
|
||||||
|
],
|
||||||
|
"dev": true,
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"openbsd"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/esbuild-sass-plugin": {
|
||||||
|
"version": "1.8.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/esbuild-sass-plugin/-/esbuild-sass-plugin-1.8.2.tgz",
|
||||||
|
"integrity": "sha512-ZBjONsRSpmzMKvxSNohnNXCNaBBVlYLqYhyZtN8leGGkJktCvVMKC6g9V5TWIemk1SEaW2XK+YFxz3Whw3+YYw==",
|
||||||
|
"dev": true,
|
||||||
|
"dependencies": {
|
||||||
|
"esbuild": "^0.14.5",
|
||||||
|
"picomatch": "^2.3.0",
|
||||||
|
"resolve": "^1.20.0",
|
||||||
|
"sass": "^1.45.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/esbuild-sass-plugin/node_modules/esbuild": {
|
||||||
|
"version": "0.14.54",
|
||||||
|
"resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.14.54.tgz",
|
||||||
|
"integrity": "sha512-Cy9llcy8DvET5uznocPyqL3BFRrFXSVqbgpMJ9Wz8oVjZlh/zUSNbPRbov0VX7VxN2JH1Oa0uNxZ7eLRb62pJA==",
|
||||||
|
"dev": true,
|
||||||
|
"hasInstallScript": true,
|
||||||
|
"bin": {
|
||||||
|
"esbuild": "bin/esbuild"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12"
|
||||||
|
},
|
||||||
|
"optionalDependencies": {
|
||||||
|
"@esbuild/linux-loong64": "0.14.54",
|
||||||
|
"esbuild-android-64": "0.14.54",
|
||||||
|
"esbuild-android-arm64": "0.14.54",
|
||||||
|
"esbuild-darwin-64": "0.14.54",
|
||||||
|
"esbuild-darwin-arm64": "0.14.54",
|
||||||
|
"esbuild-freebsd-64": "0.14.54",
|
||||||
|
"esbuild-freebsd-arm64": "0.14.54",
|
||||||
|
"esbuild-linux-32": "0.14.54",
|
||||||
|
"esbuild-linux-64": "0.14.54",
|
||||||
|
"esbuild-linux-arm": "0.14.54",
|
||||||
|
"esbuild-linux-arm64": "0.14.54",
|
||||||
|
"esbuild-linux-mips64le": "0.14.54",
|
||||||
|
"esbuild-linux-ppc64le": "0.14.54",
|
||||||
|
"esbuild-linux-riscv64": "0.14.54",
|
||||||
|
"esbuild-linux-s390x": "0.14.54",
|
||||||
|
"esbuild-netbsd-64": "0.14.54",
|
||||||
|
"esbuild-openbsd-64": "0.14.54",
|
||||||
|
"esbuild-sunos-64": "0.14.54",
|
||||||
|
"esbuild-windows-32": "0.14.54",
|
||||||
|
"esbuild-windows-64": "0.14.54",
|
||||||
|
"esbuild-windows-arm64": "0.14.54"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/esbuild-sunos-64": {
|
||||||
|
"version": "0.14.54",
|
||||||
|
"resolved": "https://registry.npmjs.org/esbuild-sunos-64/-/esbuild-sunos-64-0.14.54.tgz",
|
||||||
|
"integrity": "sha512-28GZ24KmMSeKi5ueWzMcco6EBHStL3B6ubM7M51RmPwXQGLe0teBGJocmWhgwccA1GeFXqxzILIxXpHbl9Q/Kw==",
|
||||||
|
"cpu": [
|
||||||
|
"x64"
|
||||||
|
],
|
||||||
|
"dev": true,
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"sunos"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/esbuild-windows-32": {
|
||||||
|
"version": "0.14.54",
|
||||||
|
"resolved": "https://registry.npmjs.org/esbuild-windows-32/-/esbuild-windows-32-0.14.54.tgz",
|
||||||
|
"integrity": "sha512-T+rdZW19ql9MjS7pixmZYVObd9G7kcaZo+sETqNH4RCkuuYSuv9AGHUVnPoP9hhuE1WM1ZimHz1CIBHBboLU7w==",
|
||||||
|
"cpu": [
|
||||||
|
"ia32"
|
||||||
|
],
|
||||||
|
"dev": true,
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"win32"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/esbuild-windows-64": {
|
||||||
|
"version": "0.14.54",
|
||||||
|
"resolved": "https://registry.npmjs.org/esbuild-windows-64/-/esbuild-windows-64-0.14.54.tgz",
|
||||||
|
"integrity": "sha512-AoHTRBUuYwXtZhjXZbA1pGfTo8cJo3vZIcWGLiUcTNgHpJJMC1rVA44ZereBHMJtotyN71S8Qw0npiCIkW96cQ==",
|
||||||
|
"cpu": [
|
||||||
|
"x64"
|
||||||
|
],
|
||||||
|
"dev": true,
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"win32"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/esbuild-windows-arm64": {
|
||||||
|
"version": "0.14.54",
|
||||||
|
"resolved": "https://registry.npmjs.org/esbuild-windows-arm64/-/esbuild-windows-arm64-0.14.54.tgz",
|
||||||
|
"integrity": "sha512-M0kuUvXhot1zOISQGXwWn6YtS+Y/1RT9WrVIOywZnJHo3jCDyewAc79aKNQWFCQm+xNHVTq9h8dZKvygoXQQRg==",
|
||||||
|
"cpu": [
|
||||||
|
"arm64"
|
||||||
|
],
|
||||||
|
"dev": true,
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"win32"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/fill-range": {
|
||||||
|
"version": "7.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz",
|
||||||
|
"integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==",
|
||||||
|
"dev": true,
|
||||||
|
"dependencies": {
|
||||||
|
"to-regex-range": "^5.0.1"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=8"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/fsevents": {
|
||||||
|
"version": "2.3.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz",
|
||||||
|
"integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==",
|
||||||
|
"dev": true,
|
||||||
|
"hasInstallScript": true,
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"darwin"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": "^8.16.0 || ^10.6.0 || >=11.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/function-bind": {
|
||||||
|
"version": "1.1.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz",
|
||||||
|
"integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
|
"node_modules/glob-parent": {
|
||||||
|
"version": "5.1.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz",
|
||||||
|
"integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==",
|
||||||
|
"dev": true,
|
||||||
|
"dependencies": {
|
||||||
|
"is-glob": "^4.0.1"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 6"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/has": {
|
||||||
|
"version": "1.0.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz",
|
||||||
|
"integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==",
|
||||||
|
"dev": true,
|
||||||
|
"dependencies": {
|
||||||
|
"function-bind": "^1.1.1"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.4.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/immutable": {
|
||||||
|
"version": "4.3.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/immutable/-/immutable-4.3.0.tgz",
|
||||||
|
"integrity": "sha512-0AOCmOip+xgJwEVTQj1EfiDDOkPmuyllDuTuEX+DDXUgapLAsBIfkg3sxCYyCEA8mQqZrrxPUGjcOQ2JS3WLkg==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
|
"node_modules/is-binary-path": {
|
||||||
|
"version": "2.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz",
|
||||||
|
"integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==",
|
||||||
|
"dev": true,
|
||||||
|
"dependencies": {
|
||||||
|
"binary-extensions": "^2.0.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=8"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/is-core-module": {
|
||||||
|
"version": "2.12.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.12.1.tgz",
|
||||||
|
"integrity": "sha512-Q4ZuBAe2FUsKtyQJoQHlvP8OvBERxO3jEmy1I7hcRXcJBGGHFh/aJBswbXuS9sgrDH2QUO8ilkwNPHvHMd8clg==",
|
||||||
|
"dev": true,
|
||||||
|
"dependencies": {
|
||||||
|
"has": "^1.0.3"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/ljharb"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/is-extglob": {
|
||||||
|
"version": "2.1.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz",
|
||||||
|
"integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==",
|
||||||
|
"dev": true,
|
||||||
|
"engines": {
|
||||||
|
"node": ">=0.10.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/is-glob": {
|
||||||
|
"version": "4.0.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz",
|
||||||
|
"integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==",
|
||||||
|
"dev": true,
|
||||||
|
"dependencies": {
|
||||||
|
"is-extglob": "^2.1.1"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=0.10.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/is-number": {
|
||||||
|
"version": "7.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz",
|
||||||
|
"integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==",
|
||||||
|
"dev": true,
|
||||||
|
"engines": {
|
||||||
|
"node": ">=0.12.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/keycharm": {
|
||||||
|
"version": "0.4.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/keycharm/-/keycharm-0.4.0.tgz",
|
||||||
|
"integrity": "sha512-TyQTtsabOVv3MeOpR92sIKk/br9wxS+zGj4BG7CR8YbK4jM3tyIBaF0zhzeBUMx36/Q/iQLOKKOT+3jOQtemRQ=="
|
||||||
|
},
|
||||||
|
"node_modules/normalize-path": {
|
||||||
|
"version": "3.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz",
|
||||||
|
"integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==",
|
||||||
|
"dev": true,
|
||||||
|
"engines": {
|
||||||
|
"node": ">=0.10.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/path-parse": {
|
||||||
|
"version": "1.0.7",
|
||||||
|
"resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz",
|
||||||
|
"integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
|
"node_modules/picomatch": {
|
||||||
|
"version": "2.3.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz",
|
||||||
|
"integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==",
|
||||||
|
"dev": true,
|
||||||
|
"engines": {
|
||||||
|
"node": ">=8.6"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/jonschlinkert"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/readdirp": {
|
||||||
|
"version": "3.6.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz",
|
||||||
|
"integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==",
|
||||||
|
"dev": true,
|
||||||
|
"dependencies": {
|
||||||
|
"picomatch": "^2.2.1"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=8.10.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/resolve": {
|
||||||
|
"version": "1.22.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.2.tgz",
|
||||||
|
"integrity": "sha512-Sb+mjNHOULsBv818T40qSPeRiuWLyaGMa5ewydRLFimneixmVy2zdivRl+AF6jaYPC8ERxGDmFSiqui6SfPd+g==",
|
||||||
|
"dev": true,
|
||||||
|
"dependencies": {
|
||||||
|
"is-core-module": "^2.11.0",
|
||||||
|
"path-parse": "^1.0.7",
|
||||||
|
"supports-preserve-symlinks-flag": "^1.0.0"
|
||||||
|
},
|
||||||
|
"bin": {
|
||||||
|
"resolve": "bin/resolve"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/ljharb"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/sass": {
|
||||||
|
"version": "1.63.6",
|
||||||
|
"resolved": "https://registry.npmjs.org/sass/-/sass-1.63.6.tgz",
|
||||||
|
"integrity": "sha512-MJuxGMHzaOW7ipp+1KdELtqKbfAWbH7OLIdoSMnVe3EXPMTmxTmlaZDCTsgIpPCs3w99lLo9/zDKkOrJuT5byw==",
|
||||||
|
"dev": true,
|
||||||
|
"dependencies": {
|
||||||
|
"chokidar": ">=3.0.0 <4.0.0",
|
||||||
|
"immutable": "^4.0.0",
|
||||||
|
"source-map-js": ">=0.6.2 <2.0.0"
|
||||||
|
},
|
||||||
|
"bin": {
|
||||||
|
"sass": "sass.js"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=14.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/source-map-js": {
|
||||||
|
"version": "1.0.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz",
|
||||||
|
"integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==",
|
||||||
|
"dev": true,
|
||||||
|
"engines": {
|
||||||
|
"node": ">=0.10.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/supports-preserve-symlinks-flag": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz",
|
||||||
|
"integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==",
|
||||||
|
"dev": true,
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.4"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/ljharb"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/timsort": {
|
||||||
|
"version": "0.3.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/timsort/-/timsort-0.3.0.tgz",
|
||||||
|
"integrity": "sha512-qsdtZH+vMoCARQtyod4imc2nIJwg9Cc7lPRrw9CzF8ZKR0khdr8+2nX80PBhET3tcyTtJDxAffGh2rXH4tyU8A==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
|
"node_modules/to-regex-range": {
|
||||||
|
"version": "5.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz",
|
||||||
|
"integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==",
|
||||||
|
"dev": true,
|
||||||
|
"dependencies": {
|
||||||
|
"is-number": "^7.0.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=8.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/uuid": {
|
||||||
|
"version": "8.3.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz",
|
||||||
|
"integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==",
|
||||||
|
"bin": {
|
||||||
|
"uuid": "dist/bin/uuid"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/vis-data": {
|
||||||
|
"version": "7.1.9",
|
||||||
|
"resolved": "https://registry.npmjs.org/vis-data/-/vis-data-7.1.9.tgz",
|
||||||
|
"integrity": "sha512-COQsxlVrmcRIbZMMTYwD+C2bxYCFDNQ2EHESklPiInbD/Pk3JZ6qNL84Bp9wWjYjAzXfSlsNaFtRk+hO9yBPWA==",
|
||||||
|
"funding": {
|
||||||
|
"type": "opencollective",
|
||||||
|
"url": "https://opencollective.com/visjs"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"uuid": "^3.4.0 || ^7.0.0 || ^8.0.0 || ^9.0.0",
|
||||||
|
"vis-util": "^5.0.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/vis-network": {
|
||||||
|
"version": "9.1.9",
|
||||||
|
"resolved": "https://registry.npmjs.org/vis-network/-/vis-network-9.1.9.tgz",
|
||||||
|
"integrity": "sha512-Ft+hLBVyiLstVYSb69Q1OIQeh3FeUxHJn0WdFcq+BFPqs+Vq1ibMi2sb//cxgq1CP7PH4yOXnHxEH/B2VzpZYA==",
|
||||||
|
"funding": {
|
||||||
|
"type": "opencollective",
|
||||||
|
"url": "https://opencollective.com/visjs"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"@egjs/hammerjs": "^2.0.0",
|
||||||
|
"component-emitter": "^1.3.0",
|
||||||
|
"keycharm": "^0.2.0 || ^0.3.0 || ^0.4.0",
|
||||||
|
"uuid": "^3.4.0 || ^7.0.0 || ^8.0.0 || ^9.0.0",
|
||||||
|
"vis-data": "^6.3.0 || ^7.0.0",
|
||||||
|
"vis-util": "^5.0.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/vis-util": {
|
||||||
|
"version": "5.0.7",
|
||||||
|
"resolved": "https://registry.npmjs.org/vis-util/-/vis-util-5.0.7.tgz",
|
||||||
|
"integrity": "sha512-E3L03G3+trvc/X4LXvBfih3YIHcKS2WrP0XTdZefr6W6Qi/2nNCqZfe4JFfJU6DcQLm6Gxqj2Pfl+02859oL5A==",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=8"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"type": "opencollective",
|
||||||
|
"url": "https://opencollective.com/visjs"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"@egjs/hammerjs": "^2.0.0",
|
||||||
|
"component-emitter": "^1.3.0 || ^2.0.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@egjs/hammerjs": {
|
"@egjs/hammerjs": {
|
||||||
"version": "2.0.17",
|
"version": "2.0.17",
|
||||||
"resolved": "https://registry.npmjs.org/@egjs/hammerjs/-/hammerjs-2.0.17.tgz",
|
"resolved": "https://registry.npmjs.org/@egjs/hammerjs/-/hammerjs-2.0.17.tgz",
|
||||||
"integrity": "sha512-XQsZgjm2EcVUiZQf11UBJQfmZeEmOW8DpI1gsFeln6w0ae0ii4dMQEQ0kjl6DspdWX1aGY1/loyXnP0JS06e/A==",
|
"integrity": "sha512-XQsZgjm2EcVUiZQf11UBJQfmZeEmOW8DpI1gsFeln6w0ae0ii4dMQEQ0kjl6DspdWX1aGY1/loyXnP0JS06e/A==",
|
||||||
"dev": true,
|
|
||||||
"requires": {
|
"requires": {
|
||||||
"@types/hammerjs": "^2.0.36"
|
"@types/hammerjs": "^2.0.36"
|
||||||
}
|
}
|
||||||
@@ -23,8 +805,7 @@
|
|||||||
"@types/hammerjs": {
|
"@types/hammerjs": {
|
||||||
"version": "2.0.41",
|
"version": "2.0.41",
|
||||||
"resolved": "https://registry.npmjs.org/@types/hammerjs/-/hammerjs-2.0.41.tgz",
|
"resolved": "https://registry.npmjs.org/@types/hammerjs/-/hammerjs-2.0.41.tgz",
|
||||||
"integrity": "sha512-ewXv/ceBaJprikMcxCmWU1FKyMAQ2X7a9Gtmzw8fcg2kIePI1crERDM818W+XYrxqdBBOdlf2rm137bU+BltCA==",
|
"integrity": "sha512-ewXv/ceBaJprikMcxCmWU1FKyMAQ2X7a9Gtmzw8fcg2kIePI1crERDM818W+XYrxqdBBOdlf2rm137bU+BltCA=="
|
||||||
"dev": true
|
|
||||||
},
|
},
|
||||||
"anymatch": {
|
"anymatch": {
|
||||||
"version": "3.1.3",
|
"version": "3.1.3",
|
||||||
@@ -70,8 +851,7 @@
|
|||||||
"component-emitter": {
|
"component-emitter": {
|
||||||
"version": "1.3.0",
|
"version": "1.3.0",
|
||||||
"resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz",
|
"resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz",
|
||||||
"integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==",
|
"integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg=="
|
||||||
"dev": true
|
|
||||||
},
|
},
|
||||||
"esbuild": {
|
"esbuild": {
|
||||||
"version": "0.12.29",
|
"version": "0.12.29",
|
||||||
@@ -303,9 +1083,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"immutable": {
|
"immutable": {
|
||||||
"version": "4.1.0",
|
"version": "4.3.0",
|
||||||
"resolved": "https://registry.npmjs.org/immutable/-/immutable-4.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/immutable/-/immutable-4.3.0.tgz",
|
||||||
"integrity": "sha512-oNkuqVTA8jqG1Q6c+UglTOD1xhC1BtjKI7XkCXRkZHrN5m18/XsnUp8Q89GkQO/z+0WjonSvl0FLhDYftp46nQ==",
|
"integrity": "sha512-0AOCmOip+xgJwEVTQj1EfiDDOkPmuyllDuTuEX+DDXUgapLAsBIfkg3sxCYyCEA8mQqZrrxPUGjcOQ2JS3WLkg==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"is-binary-path": {
|
"is-binary-path": {
|
||||||
@@ -318,9 +1098,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"is-core-module": {
|
"is-core-module": {
|
||||||
"version": "2.11.0",
|
"version": "2.12.1",
|
||||||
"resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.11.0.tgz",
|
"resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.12.1.tgz",
|
||||||
"integrity": "sha512-RRjxlvLDkD1YJwDbroBHMb+cukurkDWNyHx7D3oNB5x9rb5ogcksMC5wHCadcXoo67gVr/+3GFySh3134zi6rw==",
|
"integrity": "sha512-Q4ZuBAe2FUsKtyQJoQHlvP8OvBERxO3jEmy1I7hcRXcJBGGHFh/aJBswbXuS9sgrDH2QUO8ilkwNPHvHMd8clg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"has": "^1.0.3"
|
"has": "^1.0.3"
|
||||||
@@ -350,8 +1130,7 @@
|
|||||||
"keycharm": {
|
"keycharm": {
|
||||||
"version": "0.4.0",
|
"version": "0.4.0",
|
||||||
"resolved": "https://registry.npmjs.org/keycharm/-/keycharm-0.4.0.tgz",
|
"resolved": "https://registry.npmjs.org/keycharm/-/keycharm-0.4.0.tgz",
|
||||||
"integrity": "sha512-TyQTtsabOVv3MeOpR92sIKk/br9wxS+zGj4BG7CR8YbK4jM3tyIBaF0zhzeBUMx36/Q/iQLOKKOT+3jOQtemRQ==",
|
"integrity": "sha512-TyQTtsabOVv3MeOpR92sIKk/br9wxS+zGj4BG7CR8YbK4jM3tyIBaF0zhzeBUMx36/Q/iQLOKKOT+3jOQtemRQ=="
|
||||||
"dev": true
|
|
||||||
},
|
},
|
||||||
"normalize-path": {
|
"normalize-path": {
|
||||||
"version": "3.0.0",
|
"version": "3.0.0",
|
||||||
@@ -381,20 +1160,20 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"resolve": {
|
"resolve": {
|
||||||
"version": "1.22.1",
|
"version": "1.22.2",
|
||||||
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.1.tgz",
|
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.2.tgz",
|
||||||
"integrity": "sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw==",
|
"integrity": "sha512-Sb+mjNHOULsBv818T40qSPeRiuWLyaGMa5ewydRLFimneixmVy2zdivRl+AF6jaYPC8ERxGDmFSiqui6SfPd+g==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"is-core-module": "^2.9.0",
|
"is-core-module": "^2.11.0",
|
||||||
"path-parse": "^1.0.7",
|
"path-parse": "^1.0.7",
|
||||||
"supports-preserve-symlinks-flag": "^1.0.0"
|
"supports-preserve-symlinks-flag": "^1.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"sass": {
|
"sass": {
|
||||||
"version": "1.56.2",
|
"version": "1.63.6",
|
||||||
"resolved": "https://registry.npmjs.org/sass/-/sass-1.56.2.tgz",
|
"resolved": "https://registry.npmjs.org/sass/-/sass-1.63.6.tgz",
|
||||||
"integrity": "sha512-ciEJhnyCRwzlBCB+h5cCPM6ie/6f8HrhZMQOf5vlU60Y1bI1rx5Zb0vlDZvaycHsg/MqFfF1Eq2eokAa32iw8w==",
|
"integrity": "sha512-MJuxGMHzaOW7ipp+1KdELtqKbfAWbH7OLIdoSMnVe3EXPMTmxTmlaZDCTsgIpPCs3w99lLo9/zDKkOrJuT5byw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"chokidar": ">=3.0.0 <4.0.0",
|
"chokidar": ">=3.0.0 <4.0.0",
|
||||||
@@ -432,23 +1211,25 @@
|
|||||||
"uuid": {
|
"uuid": {
|
||||||
"version": "8.3.2",
|
"version": "8.3.2",
|
||||||
"resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz",
|
"resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz",
|
||||||
"integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==",
|
"integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg=="
|
||||||
"dev": true
|
|
||||||
},
|
},
|
||||||
"vis-data": {
|
"vis-data": {
|
||||||
"version": "7.1.6",
|
"version": "7.1.9",
|
||||||
"resolved": "https://registry.npmjs.org/vis-data/-/vis-data-7.1.6.tgz",
|
"resolved": "https://registry.npmjs.org/vis-data/-/vis-data-7.1.9.tgz",
|
||||||
"integrity": "sha512-lG7LJdkawlKSXsdcEkxe/zRDyW29a4r7N7PMwxCPxK12/QIdqxJwcMxwjVj9ozdisRhP5TyWDHZwsgjmj0g6Dg=="
|
"integrity": "sha512-COQsxlVrmcRIbZMMTYwD+C2bxYCFDNQ2EHESklPiInbD/Pk3JZ6qNL84Bp9wWjYjAzXfSlsNaFtRk+hO9yBPWA==",
|
||||||
|
"requires": {}
|
||||||
},
|
},
|
||||||
"vis-network": {
|
"vis-network": {
|
||||||
"version": "9.1.6",
|
"version": "9.1.9",
|
||||||
"resolved": "https://registry.npmjs.org/vis-network/-/vis-network-9.1.6.tgz",
|
"resolved": "https://registry.npmjs.org/vis-network/-/vis-network-9.1.9.tgz",
|
||||||
"integrity": "sha512-Eiwx1JleAsUqfy4pzcsFngCVlCEdjAtRPB/OwCV7PHBm+o2jtE4IZPcPITAEGUlxvL4Fdw7/lZsfD32dL+IL6g=="
|
"integrity": "sha512-Ft+hLBVyiLstVYSb69Q1OIQeh3FeUxHJn0WdFcq+BFPqs+Vq1ibMi2sb//cxgq1CP7PH4yOXnHxEH/B2VzpZYA==",
|
||||||
|
"requires": {}
|
||||||
},
|
},
|
||||||
"vis-util": {
|
"vis-util": {
|
||||||
"version": "5.0.3",
|
"version": "5.0.7",
|
||||||
"resolved": "https://registry.npmjs.org/vis-util/-/vis-util-5.0.3.tgz",
|
"resolved": "https://registry.npmjs.org/vis-util/-/vis-util-5.0.7.tgz",
|
||||||
"integrity": "sha512-Wf9STUcFrDzK4/Zr7B6epW2Kvm3ORNWF+WiwEz2dpf5RdWkLUXFSbLcuB88n1W6tCdFwVN+v3V4/Xmn9PeL39g=="
|
"integrity": "sha512-E3L03G3+trvc/X4LXvBfih3YIHcKS2WrP0XTdZefr6W6Qi/2nNCqZfe4JFfJU6DcQLm6Gxqj2Pfl+02859oL5A==",
|
||||||
|
"requires": {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,16 +1,16 @@
|
|||||||
{
|
{
|
||||||
"private": true,
|
"private": true,
|
||||||
"name": "netbox_topology_views",
|
"name": "netbox_topology_views",
|
||||||
"version": "3.6.0-beta.2",
|
"version": "3.9-beta1",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"bundle": "node bundle.js",
|
"bundle": "node bundle.js",
|
||||||
"bundle:styles": "node bundle.js --styles",
|
"bundle:styles": "node bundle.js --styles",
|
||||||
"bundle:scripts": "node bundle.js --scripts"
|
"bundle:scripts": "node bundle.js --scripts"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"vis-data": "^7.1.6",
|
"vis-data": "^7.1.9",
|
||||||
"vis-network": "^9.1.6",
|
"vis-network": "^9.1.9",
|
||||||
"vis-util": "^5.0.3"
|
"vis-util": "^5.0.7"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@egjs/hammerjs": "^2.0.0",
|
"@egjs/hammerjs": "^2.0.0",
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import django_tables2 as tables
|
import django_tables2 as tables
|
||||||
|
|
||||||
from netbox.tables import NetBoxTable, ChoiceFieldColumn
|
from netbox.tables import NetBoxTable, ChoiceFieldColumn
|
||||||
from netbox_topology_views.models import CoordinateGroup, Coordinate
|
from netbox_topology_views.models import CoordinateGroup, Coordinate, CircuitCoordinate, PowerPanelCoordinate, PowerFeedCoordinate
|
||||||
|
|
||||||
class CoordinateGroupListTable(NetBoxTable):
|
class CoordinateGroupListTable(NetBoxTable):
|
||||||
name = tables.Column(
|
name = tables.Column(
|
||||||
@@ -14,6 +14,48 @@ class CoordinateGroupListTable(NetBoxTable):
|
|||||||
fields = ('pk', 'id', 'name', 'description', 'devices')
|
fields = ('pk', 'id', 'name', 'description', 'devices')
|
||||||
default_columns = ('name', 'description', 'devices')
|
default_columns = ('name', 'description', 'devices')
|
||||||
|
|
||||||
|
class CircuitCoordinateListTable(NetBoxTable):
|
||||||
|
group = tables.Column(
|
||||||
|
linkify=True
|
||||||
|
)
|
||||||
|
|
||||||
|
device = tables.Column(
|
||||||
|
linkify=True
|
||||||
|
)
|
||||||
|
|
||||||
|
class Meta(NetBoxTable.Meta):
|
||||||
|
model = CircuitCoordinate
|
||||||
|
fields = ('pk', 'id', 'group', 'device', 'x', 'y')
|
||||||
|
default_columns = ('id', 'group', 'device', 'x', 'y')
|
||||||
|
|
||||||
|
class PowerPanelCoordinateListTable(NetBoxTable):
|
||||||
|
group = tables.Column(
|
||||||
|
linkify=True
|
||||||
|
)
|
||||||
|
|
||||||
|
device = tables.Column(
|
||||||
|
linkify=True
|
||||||
|
)
|
||||||
|
|
||||||
|
class Meta(NetBoxTable.Meta):
|
||||||
|
model = PowerPanelCoordinate
|
||||||
|
fields = ('pk', 'id', 'group', 'device', 'x', 'y')
|
||||||
|
default_columns = ('id', 'group', 'device', 'x', 'y')
|
||||||
|
|
||||||
|
class PowerFeedCoordinateListTable(NetBoxTable):
|
||||||
|
group = tables.Column(
|
||||||
|
linkify=True
|
||||||
|
)
|
||||||
|
|
||||||
|
device = tables.Column(
|
||||||
|
linkify=True
|
||||||
|
)
|
||||||
|
|
||||||
|
class Meta(NetBoxTable.Meta):
|
||||||
|
model = PowerFeedCoordinate
|
||||||
|
fields = ('pk', 'id', 'group', 'device', 'x', 'y')
|
||||||
|
default_columns = ('id', 'group', 'device', 'x', 'y')
|
||||||
|
|
||||||
class CoordinateListTable(NetBoxTable):
|
class CoordinateListTable(NetBoxTable):
|
||||||
group = tables.Column(
|
group = tables.Column(
|
||||||
linkify=True
|
linkify=True
|
||||||
@@ -27,4 +69,3 @@ class CoordinateListTable(NetBoxTable):
|
|||||||
model = Coordinate
|
model = Coordinate
|
||||||
fields = ('pk', 'id', 'group', 'device', 'x', 'y')
|
fields = ('pk', 'id', 'group', 'device', 'x', 'y')
|
||||||
default_columns = ('id', 'group', 'device', 'x', 'y')
|
default_columns = ('id', 'group', 'device', 'x', 'y')
|
||||||
|
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
{% extends 'generic/object.html' %}
|
||||||
|
{% load helpers %}
|
||||||
|
{% load plugins %}
|
||||||
|
|
||||||
|
{% block title %}Topology Views Coordinates{% endblock title %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<div class="row mb-3">
|
||||||
|
<div class="col col-md-6">
|
||||||
|
<div class="card">
|
||||||
|
<h5 class="card-header">
|
||||||
|
Coordinates
|
||||||
|
</h5>
|
||||||
|
<div class="card-body">
|
||||||
|
<table class="table table-hover attr-table">
|
||||||
|
<tr>
|
||||||
|
<th scope="row">Group</th>
|
||||||
|
<td>{{ object.group|linkify }}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th scope="row">Circuit</th>
|
||||||
|
<td>{{ object.device|linkify }}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th scope="row">X-Coordinate</th>
|
||||||
|
<td>{{ object.x }}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th scope="row">Y-Coordinate</th>
|
||||||
|
<td>{{ object.y }}</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% plugin_left_page object %}
|
||||||
|
</div>
|
||||||
|
<div class="col col-md-6">
|
||||||
|
{% include 'inc/panels/custom_fields.html' %}
|
||||||
|
{% plugin_right_page object %}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endblock content %}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
{% extends 'generic/object_edit.html' %}
|
||||||
|
|
||||||
|
{% block title %}Add new Circuit Coordinates{% endblock title %}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
{% extends 'generic/object_edit.html' %}
|
||||||
|
|
||||||
|
{% block title %}Edit Circuit Coordinates{% endblock title %}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
{% extends 'generic/object_list.html' %}
|
||||||
|
|
||||||
|
{% block title %}Circuit Coordinates{% endblock title %}
|
||||||
@@ -32,10 +32,34 @@
|
|||||||
{% plugin_right_page object %}
|
{% plugin_right_page object %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row mb-3">
|
||||||
<div class="col col-md-12">
|
<div class="col col-md-12">
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<h5 class="card-header">Coordinates</h5>
|
<h5 class="card-header">Circuit Coordinates</h5>
|
||||||
|
<div class="card-body table-responsive">
|
||||||
|
{% render_table circuitcoordinates_table %}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col col-md-12">
|
||||||
|
<div class="card">
|
||||||
|
<h5 class="card-header">Power Panel Coordinates</h5>
|
||||||
|
<div class="card-body table-responsive">
|
||||||
|
{% render_table powerpanelcoordinates_table %}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col col-md-12">
|
||||||
|
<div class="card">
|
||||||
|
<h5 class="card-header">Power Feed Coordinates</h5>
|
||||||
|
<div class="card-body table-responsive">
|
||||||
|
{% render_table powerfeedcoordinates_table %}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col col-md-12">
|
||||||
|
<div class="card">
|
||||||
|
<h5 class="card-header">Device Coordinates</h5>
|
||||||
<div class="card-body table-responsive">
|
<div class="card-body table-responsive">
|
||||||
{% render_table coordinates_table %}
|
{% render_table coordinates_table %}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -29,7 +29,7 @@
|
|||||||
{% endblock controls %}
|
{% endblock controls %}
|
||||||
|
|
||||||
{% block tabs %}
|
{% block tabs %}
|
||||||
<ul class="nav nav-tabs px-3">
|
<ul class="nav nav-tabs px-3" id="tabswrapper">
|
||||||
{% block tab_items %}
|
{% block tab_items %}
|
||||||
<li class="nav-item" role="presentation">
|
<li class="nav-item" role="presentation">
|
||||||
<button class="nav-link active" id="network-tab" data-bs-toggle="tab" data-bs-target="#networks" type="button" role="tab" aria-controls="filters-form" aria-selected="true">
|
<button class="nav-link active" id="network-tab" data-bs-toggle="tab" data-bs-target="#networks" type="button" role="tab" aria-controls="filters-form" aria-selected="true">
|
||||||
@@ -50,11 +50,13 @@
|
|||||||
|
|
||||||
{% block content-wrapper %}
|
{% block content-wrapper %}
|
||||||
{% with config=settings.PLUGINS_CONFIG.netbox_topology_views %}
|
{% with config=settings.PLUGINS_CONFIG.netbox_topology_views %}
|
||||||
<div class="tab-content">
|
<div class="tab-content" id="tabcontentwrapper">
|
||||||
|
|
||||||
{# Applied filters #}
|
{# Applied filters #}
|
||||||
{% if filter_form %}
|
{% if filter_form %}
|
||||||
{% applied_filters model filter_form request.GET %}
|
<div id="filterwrapper">
|
||||||
|
{% applied_filters model filter_form request.GET %}
|
||||||
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<div class="tab-pane show active" id="networks" role="tabpanel" aria-labelledby="network-tab">
|
<div class="tab-pane show active" id="networks" role="tabpanel" aria-labelledby="network-tab">
|
||||||
|
|||||||
@@ -0,0 +1,42 @@
|
|||||||
|
{% extends 'generic/object.html' %}
|
||||||
|
{% load helpers %}
|
||||||
|
{% load plugins %}
|
||||||
|
|
||||||
|
{% block title %}Topology Views Coordinates{% endblock title %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<div class="row mb-3">
|
||||||
|
<div class="col col-md-6">
|
||||||
|
<div class="card">
|
||||||
|
<h5 class="card-header">
|
||||||
|
Coordinates
|
||||||
|
</h5>
|
||||||
|
<div class="card-body">
|
||||||
|
<table class="table table-hover attr-table">
|
||||||
|
<tr>
|
||||||
|
<th scope="row">Group</th>
|
||||||
|
<td>{{ object.group|linkify }}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th scope="row">Power Feed</th>
|
||||||
|
<td>{{ object.device|linkify }}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th scope="row">X-Coordinate</th>
|
||||||
|
<td>{{ object.x }}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th scope="row">Y-Coordinate</th>
|
||||||
|
<td>{{ object.y }}</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% plugin_left_page object %}
|
||||||
|
</div>
|
||||||
|
<div class="col col-md-6">
|
||||||
|
{% include 'inc/panels/custom_fields.html' %}
|
||||||
|
{% plugin_right_page object %}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endblock content %}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
{% extends 'generic/object_edit.html' %}
|
||||||
|
|
||||||
|
{% block title %}Add new Power Feed Coordinates{% endblock title %}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
{% extends 'generic/object_edit.html' %}
|
||||||
|
|
||||||
|
{% block title %}Edit Power Feed Coordinates{% endblock title %}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
{% extends 'generic/object_list.html' %}
|
||||||
|
|
||||||
|
{% block title %}Power Feed Coordinates{% endblock title %}
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
{% extends 'generic/object.html' %}
|
||||||
|
{% load helpers %}
|
||||||
|
{% load plugins %}
|
||||||
|
|
||||||
|
{% block title %}Topology Views Coordinates{% endblock title %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<div class="row mb-3">
|
||||||
|
<div class="col col-md-6">
|
||||||
|
<div class="card">
|
||||||
|
<h5 class="card-header">
|
||||||
|
Coordinates
|
||||||
|
</h5>
|
||||||
|
<div class="card-body">
|
||||||
|
<table class="table table-hover attr-table">
|
||||||
|
<tr>
|
||||||
|
<th scope="row">Group</th>
|
||||||
|
<td>{{ object.group|linkify }}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th scope="row">Power Panel</th>
|
||||||
|
<td>{{ object.device|linkify }}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th scope="row">X-Coordinate</th>
|
||||||
|
<td>{{ object.x }}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th scope="row">Y-Coordinate</th>
|
||||||
|
<td>{{ object.y }}</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% plugin_left_page object %}
|
||||||
|
</div>
|
||||||
|
<div class="col col-md-6">
|
||||||
|
{% include 'inc/panels/custom_fields.html' %}
|
||||||
|
{% plugin_right_page object %}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endblock content %}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
{% extends 'generic/object_edit.html' %}
|
||||||
|
|
||||||
|
{% block title %}Add new Power Panel Coordinates{% endblock title %}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
{% extends 'generic/object_edit.html' %}
|
||||||
|
|
||||||
|
{% block title %}Edit Power Panel Coordinates{% endblock title %}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
{% extends 'generic/object_list.html' %}
|
||||||
|
|
||||||
|
{% block title %}Power Panel Coordinates{% endblock title %}
|
||||||
@@ -14,12 +14,39 @@ urlpatterns = (
|
|||||||
# Coordinate Group
|
# Coordinate Group
|
||||||
path("coordinate-groups/", views.CoordinateGroupListView.as_view(), name="coordinategroup_list"),
|
path("coordinate-groups/", views.CoordinateGroupListView.as_view(), name="coordinategroup_list"),
|
||||||
path("coordinate-groups/add/", views.CoordinateGroupAddView.as_view(), name="coordinategroup_add"),
|
path("coordinate-groups/add/", views.CoordinateGroupAddView.as_view(), name="coordinategroup_add"),
|
||||||
path('coordinate/import/', views.CoordinateGroupBulkImportView.as_view(), name='coordinategroup_import'),
|
path('coordinate-groups/import/', views.CoordinateGroupBulkImportView.as_view(), name='coordinategroup_import'),
|
||||||
path("coordinate-groups/<int:pk>/", views.CoordinateGroupView.as_view(), name="coordinategroup"),
|
path("coordinate-groups/<int:pk>/", views.CoordinateGroupView.as_view(), name="coordinategroup"),
|
||||||
path("coordinate-groups/<int:pk>/edit/", views.CoordinateGroupEditView.as_view(), name="coordinategroup_edit"),
|
path("coordinate-groups/<int:pk>/edit/", views.CoordinateGroupEditView.as_view(), name="coordinategroup_edit"),
|
||||||
path("coordinate-groups/<int:pk>/delete/", views.CoordinateGroupDeleteView.as_view(), name="coordinategroup_delete"),
|
path("coordinate-groups/<int:pk>/delete/", views.CoordinateGroupDeleteView.as_view(), name="coordinategroup_delete"),
|
||||||
path("coordinate-groups/<int:pk>/changelog/", ObjectChangeLogView.as_view(), name="coordinategroup_changelog", kwargs={'model': models.CoordinateGroup}),
|
path("coordinate-groups/<int:pk>/changelog/", ObjectChangeLogView.as_view(), name="coordinategroup_changelog", kwargs={'model': models.CoordinateGroup}),
|
||||||
|
|
||||||
|
# Circuit Coordinate
|
||||||
|
path("circuitcoordinate/", views.CircuitCoordinateListView.as_view(), name="circuitcoordinate_list"),
|
||||||
|
path("circuitcoordinate/add/", views.CircuitCoordinateAddView.as_view(), name="circuitcoordinate_add"),
|
||||||
|
path('circuitcoordinate/import/', views.CircuitCoordinateBulkImportView.as_view(), name='circuitcoordinate_import'),
|
||||||
|
path("circuitcoordinate/<int:pk>/", views.CircuitCoordinateView.as_view(), name="circuitcoordinate"),
|
||||||
|
path("circuitcoordinate/<int:pk>/edit/", views.CircuitCoordinateEditView.as_view(), name="circuitcoordinate_edit"),
|
||||||
|
path("circuitcoordinate/<int:pk>/delete/", views.CircuitCoordinateDeleteView.as_view(), name="circuitcoordinate_delete"),
|
||||||
|
path("circuitcoordinate/<int:pk>/changelog/", ObjectChangeLogView.as_view(), name="circuitcoordinate_changelog", kwargs={'model': models.CircuitCoordinate}),
|
||||||
|
|
||||||
|
# Power Panel Coordinate
|
||||||
|
path("powerpanelcoordinate/", views.PowerPanelCoordinateListView.as_view(), name="powerpanelcoordinate_list"),
|
||||||
|
path("powerpanelcoordinate/add/", views.PowerPanelCoordinateAddView.as_view(), name="powerpanelcoordinate_add"),
|
||||||
|
path('powerpanelcoordinate/import/', views.PowerPanelCoordinateBulkImportView.as_view(), name='powerpanelcoordinate_import'),
|
||||||
|
path("powerpanelcoordinate/<int:pk>/", views.PowerPanelCoordinateView.as_view(), name="powerpanelcoordinate"),
|
||||||
|
path("powerpanelcoordinate/<int:pk>/edit/", views.PowerPanelCoordinateEditView.as_view(), name="powerpanelcoordinate_edit"),
|
||||||
|
path("powerpanelcoordinate/<int:pk>/delete/", views.PowerPanelCoordinateDeleteView.as_view(), name="powerpanelcoordinate_delete"),
|
||||||
|
path("powerpanelcoordinate/<int:pk>/changelog/", ObjectChangeLogView.as_view(), name="powerpanelcoordinate_changelog", kwargs={'model': models.PowerPanelCoordinate}),
|
||||||
|
|
||||||
|
# Power Feed Coordinate
|
||||||
|
path("powerfeedcoordinate/", views.PowerFeedCoordinateListView.as_view(), name="powerfeedcoordinate_list"),
|
||||||
|
path("powerfeedcoordinate/add/", views.PowerFeedCoordinateAddView.as_view(), name="powerfeedcoordinate_add"),
|
||||||
|
path('powerfeedcoordinate/import/', views.PowerFeedCoordinateBulkImportView.as_view(), name='powerfeedcoordinate_import'),
|
||||||
|
path("powerfeedcoordinate/<int:pk>/", views.PowerFeedCoordinateView.as_view(), name="powerfeedcoordinate"),
|
||||||
|
path("powerfeedcoordinate/<int:pk>/edit/", views.PowerFeedCoordinateEditView.as_view(), name="powerfeedcoordinate_edit"),
|
||||||
|
path("powerfeedcoordinate/<int:pk>/delete/", views.PowerFeedCoordinateDeleteView.as_view(), name="powerfeedcoordinate_delete"),
|
||||||
|
path("powerfeedcoordinate/<int:pk>/changelog/", ObjectChangeLogView.as_view(), name="powerfeedcoordinate_changelog", kwargs={'model': models.PowerFeedCoordinate}),
|
||||||
|
|
||||||
# Coordinate
|
# Coordinate
|
||||||
path("coordinate/", views.CoordinateListView.as_view(), name="coordinate_list"),
|
path("coordinate/", views.CoordinateListView.as_view(), name="coordinate_list"),
|
||||||
path("coordinate/add/", views.CoordinateAddView.as_view(), name="coordinate_add"),
|
path("coordinate/add/", views.CoordinateAddView.as_view(), name="coordinate_add"),
|
||||||
|
|||||||
+175
-17
@@ -5,7 +5,7 @@ import time
|
|||||||
from itertools import chain
|
from itertools import chain
|
||||||
|
|
||||||
from utilities.htmx import is_htmx
|
from utilities.htmx import is_htmx
|
||||||
from circuits.models import Circuit, CircuitTermination
|
from circuits.models import Circuit, CircuitTermination, ProviderNetwork
|
||||||
from dcim.models import (
|
from dcim.models import (
|
||||||
Cable,
|
Cable,
|
||||||
CableTermination,
|
CableTermination,
|
||||||
@@ -37,20 +37,36 @@ from netbox.views.generic import (
|
|||||||
ObjectChangeLogView,
|
ObjectChangeLogView,
|
||||||
BulkImportView
|
BulkImportView
|
||||||
)
|
)
|
||||||
|
from netbox_topology_views.filters import DeviceFilterSet, CoordinatesFilterSet, CircuitCoordinatesFilterSet, PowerPanelCoordinatesFilterSet, PowerFeedCoordinatesFilterSet
|
||||||
|
|
||||||
from netbox_topology_views.filters import DeviceFilterSet, CoordinatesFilterSet
|
|
||||||
from netbox_topology_views.forms import (
|
from netbox_topology_views.forms import (
|
||||||
DeviceFilterForm,
|
DeviceFilterForm,
|
||||||
IndividualOptionsForm,
|
IndividualOptionsForm,
|
||||||
CoordinateGroupsForm,
|
CoordinateGroupsForm,
|
||||||
|
CircuitCoordinatesForm,
|
||||||
|
CircuitCoordinatesFilterForm,
|
||||||
|
CircuitCoordinatesImportForm,
|
||||||
|
PowerPanelCoordinatesForm,
|
||||||
|
PowerPanelCoordinatesFilterForm,
|
||||||
|
PowerPanelCoordinatesImportForm,
|
||||||
|
PowerFeedCoordinatesForm,
|
||||||
|
PowerFeedCoordinatesFilterForm,
|
||||||
|
PowerFeedCoordinatesImportForm,
|
||||||
CoordinatesForm,
|
CoordinatesForm,
|
||||||
CoordinatesFilterForm,
|
CoordinatesFilterForm,
|
||||||
CoordinateGroupsImportForm,
|
CoordinateGroupsImportForm,
|
||||||
CoordinatesImportForm
|
CoordinatesImportForm
|
||||||
)
|
)
|
||||||
from netbox_topology_views.models import RoleImage, CoordinateGroup, Coordinate, IndividualOptions
|
import netbox_topology_views.models
|
||||||
from netbox_topology_views.tables import CoordinateGroupListTable, CoordinateListTable
|
from netbox_topology_views.models import (
|
||||||
|
RoleImage,
|
||||||
|
IndividualOptions,
|
||||||
|
CoordinateGroup,
|
||||||
|
Coordinate,
|
||||||
|
CircuitCoordinate,
|
||||||
|
PowerPanelCoordinate,
|
||||||
|
PowerFeedCoordinate,
|
||||||
|
)
|
||||||
|
from netbox_topology_views.tables import CoordinateGroupListTable, CoordinateListTable, CircuitCoordinateListTable, PowerPanelCoordinateListTable, PowerFeedCoordinateListTable
|
||||||
from netbox_topology_views.utils import (
|
from netbox_topology_views.utils import (
|
||||||
CONF_IMAGE_DIR,
|
CONF_IMAGE_DIR,
|
||||||
find_image_url,
|
find_image_url,
|
||||||
@@ -67,7 +83,7 @@ from netbox_topology_views.utils import (
|
|||||||
def get_image_for_entity(entity: Union[Device, Circuit, PowerPanel, PowerFeed]):
|
def get_image_for_entity(entity: Union[Device, Circuit, PowerPanel, PowerFeed]):
|
||||||
is_device = isinstance(entity, Device)
|
is_device = isinstance(entity, Device)
|
||||||
query = (
|
query = (
|
||||||
{"object_id": entity.device_role_id}
|
{"object_id": entity.role_id}
|
||||||
if is_device
|
if is_device
|
||||||
else {"content_type_id": ContentType.objects.get_for_model(entity).pk}
|
else {"content_type_id": ContentType.objects.get_for_model(entity).pk}
|
||||||
)
|
)
|
||||||
@@ -88,6 +104,7 @@ def create_node(
|
|||||||
if isinstance(device, Circuit):
|
if isinstance(device, Circuit):
|
||||||
dev_name = device.cid
|
dev_name = device.cid
|
||||||
node["id"] = f"c{device.pk}"
|
node["id"] = f"c{device.pk}"
|
||||||
|
model_name = 'CircuitCoordinate'
|
||||||
|
|
||||||
if device.provider is not None:
|
if device.provider is not None:
|
||||||
node_content += (
|
node_content += (
|
||||||
@@ -98,6 +115,7 @@ def create_node(
|
|||||||
elif isinstance(device, PowerPanel):
|
elif isinstance(device, PowerPanel):
|
||||||
dev_name = device.name
|
dev_name = device.name
|
||||||
node["id"] = f"p{device.pk}"
|
node["id"] = f"p{device.pk}"
|
||||||
|
model_name = 'PowerPanelCoordinate'
|
||||||
|
|
||||||
if device.site is not None:
|
if device.site is not None:
|
||||||
node_content += f"<tr><th>Site: </th><td>{device.site.name}</td></tr>"
|
node_content += f"<tr><th>Site: </th><td>{device.site.name}</td></tr>"
|
||||||
@@ -108,6 +126,7 @@ def create_node(
|
|||||||
elif isinstance(device, PowerFeed):
|
elif isinstance(device, PowerFeed):
|
||||||
dev_name = device.name
|
dev_name = device.name
|
||||||
node["id"] = f"f{device.pk}"
|
node["id"] = f"f{device.pk}"
|
||||||
|
model_name = 'PowerFeedCoordinate'
|
||||||
|
|
||||||
if device.power_panel is not None:
|
if device.power_panel is not None:
|
||||||
node_content += (
|
node_content += (
|
||||||
@@ -124,6 +143,7 @@ def create_node(
|
|||||||
if device.voltage is not None:
|
if device.voltage is not None:
|
||||||
node_content += f"<tr><th>Voltage: </th><td>{device.voltage}</td></tr>"
|
node_content += f"<tr><th>Voltage: </th><td>{device.voltage}</td></tr>"
|
||||||
else:
|
else:
|
||||||
|
model_name = 'Coordinate'
|
||||||
dev_name = device.name
|
dev_name = device.name
|
||||||
if dev_name is None:
|
if dev_name is None:
|
||||||
dev_name = device.device_type.get_full_name
|
dev_name = device.device_type.get_full_name
|
||||||
@@ -163,8 +183,10 @@ def create_node(
|
|||||||
if device.device_role.color != "":
|
if device.device_role.color != "":
|
||||||
node["color.border"] = "#" + device.device_role.color
|
node["color.border"] = "#" + device.device_role.color
|
||||||
|
|
||||||
|
model_class = getattr(netbox_topology_views.models, model_name)
|
||||||
|
|
||||||
if group_id is None or group_id == "default":
|
if group_id is None or group_id == "default":
|
||||||
group_id = Coordinate.get_or_create_default_group(group_id)
|
group_id = model_class.get_or_create_default_group(group_id)
|
||||||
if not group_id:
|
if not group_id:
|
||||||
print('Exception occured while handling default group.')
|
print('Exception occured while handling default group.')
|
||||||
return node
|
return node
|
||||||
@@ -176,10 +198,10 @@ def create_node(
|
|||||||
# will not be placed correctly by vis-network.
|
# will not be placed correctly by vis-network.
|
||||||
node["x"] = 0
|
node["x"] = 0
|
||||||
node["y"] = 0
|
node["y"] = 0
|
||||||
if Coordinate.objects.filter(group=group, device=device.pk).values('x') and Coordinate.objects.filter(group=group, device=device.pk).values('y'):
|
if model_class.objects.filter(group=group, device=device.pk).values('x') and model_class.objects.filter(group=group, device=device.pk).values('y'):
|
||||||
# Coordinates data for the device exists in Coordinates Group. Let's assign them
|
# Coordinates data for the device exists in Coordinates Group. Let's assign them
|
||||||
node["x"] = Coordinate.objects.get(group=group, device=device.pk).x
|
node["x"] = model_class.objects.get(group=group, device=device.pk).x
|
||||||
node["y"] = Coordinate.objects.get(group=group, device=device.pk).y
|
node["y"] = model_class.objects.get(group=group, device=device.pk).y
|
||||||
node["physics"] = False
|
node["physics"] = False
|
||||||
elif "coordinates" in device.custom_field_data:
|
elif "coordinates" in device.custom_field_data:
|
||||||
# We prefer the new Coordinate model but leave the deprecated method
|
# We prefer the new Coordinate model but leave the deprecated method
|
||||||
@@ -352,7 +374,8 @@ def get_topology_data(
|
|||||||
)
|
)
|
||||||
for path_complete_interface in path_complete_interfaces:
|
for path_complete_interface in path_complete_interfaces:
|
||||||
for connected_endpoint in path_complete_interface.connected_endpoints:
|
for connected_endpoint in path_complete_interface.connected_endpoints:
|
||||||
device_ids.append(connected_endpoint.device.id)
|
if type(connected_endpoint) != ProviderNetwork:
|
||||||
|
device_ids.append(connected_endpoint.device.id)
|
||||||
|
|
||||||
if show_circuit:
|
if show_circuit:
|
||||||
circuit_terminations = CircuitTermination.objects.filter(
|
circuit_terminations = CircuitTermination.objects.filter(
|
||||||
@@ -653,7 +676,7 @@ class TopologyHomeView(PermissionRequiredMixin, View):
|
|||||||
def get(self, request):
|
def get(self, request):
|
||||||
self.filterset = DeviceFilterSet
|
self.filterset = DeviceFilterSet
|
||||||
self.queryset = Device.objects.all().select_related(
|
self.queryset = Device.objects.all().select_related(
|
||||||
"device_type", "device_role"
|
"device_type", "role"
|
||||||
)
|
)
|
||||||
self.queryset = self.filterset(request.GET, self.queryset).qs
|
self.queryset = self.filterset(request.GET, self.queryset).qs
|
||||||
self.model = self.queryset.model
|
self.model = self.queryset.model
|
||||||
@@ -694,7 +717,7 @@ class TopologyHomeView(PermissionRequiredMixin, View):
|
|||||||
preselected_tags = IndividualOptions.objects.get(id=individualOptions.id).preselected_tags.all().values_list(Lower('name'), flat=True)
|
preselected_tags = IndividualOptions.objects.get(id=individualOptions.id).preselected_tags.all().values_list(Lower('name'), flat=True)
|
||||||
|
|
||||||
q = QueryDict(mutable=True)
|
q = QueryDict(mutable=True)
|
||||||
q.setlist("device_role_id", list(preselected_device_roles))
|
q.setlist("role_id", list(preselected_device_roles))
|
||||||
q.setlist("tag", list(preselected_tags))
|
q.setlist("tag", list(preselected_tags))
|
||||||
|
|
||||||
if individualOptions.save_coords: q['save_coords'] = "on"
|
if individualOptions.save_coords: q['save_coords'] = "on"
|
||||||
@@ -748,9 +771,9 @@ ADDITIONAL_ROLES = (PowerPanel, PowerFeed, Circuit)
|
|||||||
class TopologyImagesView(PermissionRequiredMixin, View):
|
class TopologyImagesView(PermissionRequiredMixin, View):
|
||||||
permission_required = (
|
permission_required = (
|
||||||
"dcim.view_site",
|
"dcim.view_site",
|
||||||
"dcim.view_device_role",
|
"dcim.view_devicerole",
|
||||||
"dcim.add_device_role",
|
"dcim.add_devicerole",
|
||||||
"dcim.change_device_role",
|
"dcim.change_devicerole",
|
||||||
)
|
)
|
||||||
|
|
||||||
def get(self, request: HttpRequest):
|
def get(self, request: HttpRequest):
|
||||||
@@ -799,6 +822,132 @@ class TopologyImagesView(PermissionRequiredMixin, View):
|
|||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
class CircuitCoordinateView(PermissionRequiredMixin, ObjectView):
|
||||||
|
permission_required = 'netbox_topology_views.view_coordinate'
|
||||||
|
|
||||||
|
queryset = CircuitCoordinate.objects.all()
|
||||||
|
|
||||||
|
class CircuitCoordinateAddView(PermissionRequiredMixin, ObjectEditView):
|
||||||
|
permission_required = 'netbox_topology_views.add_coordinate'
|
||||||
|
|
||||||
|
queryset = CircuitCoordinate.objects.all()
|
||||||
|
form = CircuitCoordinatesForm
|
||||||
|
template_name = 'netbox_topology_views/circuitcoordinate_add.html'
|
||||||
|
|
||||||
|
class CircuitCoordinateBulkImportView(BulkImportView):
|
||||||
|
queryset = CircuitCoordinate.objects.all()
|
||||||
|
model_form = CircuitCoordinatesImportForm
|
||||||
|
|
||||||
|
class CircuitCoordinateListView(PermissionRequiredMixin, ObjectListView):
|
||||||
|
permission_required = 'netbox_topology_views.view_coordinate'
|
||||||
|
|
||||||
|
queryset = CircuitCoordinate.objects.all()
|
||||||
|
table = CircuitCoordinateListTable
|
||||||
|
template_name = 'netbox_topology_views/circuitcoordinate_list.html'
|
||||||
|
filterset = CircuitCoordinatesFilterSet
|
||||||
|
filterset_form = CircuitCoordinatesFilterForm
|
||||||
|
|
||||||
|
class CircuitCoordinateEditView(PermissionRequiredMixin, ObjectEditView):
|
||||||
|
permission_required = 'netbox_topology_views.change_coordinate'
|
||||||
|
|
||||||
|
queryset = CircuitCoordinate.objects.all()
|
||||||
|
form = CircuitCoordinatesForm
|
||||||
|
template_name = 'netbox_topology_views/circuitcoordinate_edit.html'
|
||||||
|
|
||||||
|
class CircuitCoordinateDeleteView(PermissionRequiredMixin, ObjectDeleteView):
|
||||||
|
permission_required = 'netbox_topology_views.delete_coordinate'
|
||||||
|
|
||||||
|
queryset = CircuitCoordinate.objects.all()
|
||||||
|
|
||||||
|
class CircuitCoordinateChangeLogView(PermissionRequiredMixin, ObjectChangeLogView):
|
||||||
|
permission_required = 'netbox_topology_views.view_coordinate'
|
||||||
|
|
||||||
|
queryset = CircuitCoordinate.objects.all()
|
||||||
|
|
||||||
|
class PowerPanelCoordinateView(PermissionRequiredMixin, ObjectView):
|
||||||
|
permission_required = 'netbox_topology_views.view_coordinate'
|
||||||
|
|
||||||
|
queryset = PowerPanelCoordinate.objects.all()
|
||||||
|
|
||||||
|
class PowerPanelCoordinateAddView(PermissionRequiredMixin, ObjectEditView):
|
||||||
|
permission_required = 'netbox_topology_views.add_coordinate'
|
||||||
|
|
||||||
|
queryset = PowerPanelCoordinate.objects.all()
|
||||||
|
form = PowerPanelCoordinatesForm
|
||||||
|
template_name = 'netbox_topology_views/powerpanelcoordinate_add.html'
|
||||||
|
|
||||||
|
class PowerPanelCoordinateBulkImportView(BulkImportView):
|
||||||
|
queryset = PowerPanelCoordinate.objects.all()
|
||||||
|
model_form = PowerPanelCoordinatesImportForm
|
||||||
|
|
||||||
|
class PowerPanelCoordinateListView(PermissionRequiredMixin, ObjectListView):
|
||||||
|
permission_required = 'netbox_topology_views.view_coordinate'
|
||||||
|
|
||||||
|
queryset = PowerPanelCoordinate.objects.all()
|
||||||
|
table = PowerPanelCoordinateListTable
|
||||||
|
template_name = 'netbox_topology_views/powerpanelcoordinate_list.html'
|
||||||
|
filterset = PowerPanelCoordinatesFilterSet
|
||||||
|
filterset_form = PowerPanelCoordinatesFilterForm
|
||||||
|
|
||||||
|
class PowerPanelCoordinateEditView(PermissionRequiredMixin, ObjectEditView):
|
||||||
|
permission_required = 'netbox_topology_views.change_coordinate'
|
||||||
|
|
||||||
|
queryset = PowerPanelCoordinate.objects.all()
|
||||||
|
form = PowerPanelCoordinatesForm
|
||||||
|
template_name = 'netbox_topology_views/powerpanelcoordinate_edit.html'
|
||||||
|
|
||||||
|
class PowerPanelCoordinateDeleteView(PermissionRequiredMixin, ObjectDeleteView):
|
||||||
|
permission_required = 'netbox_topology_views.delete_coordinate'
|
||||||
|
|
||||||
|
queryset = PowerPanelCoordinate.objects.all()
|
||||||
|
|
||||||
|
class PowerPanelCoordinateChangeLogView(PermissionRequiredMixin, ObjectChangeLogView):
|
||||||
|
permission_required = 'netbox_topology_views.view_coordinate'
|
||||||
|
|
||||||
|
queryset = PowerPanelCoordinate.objects.all()
|
||||||
|
|
||||||
|
class PowerFeedCoordinateView(PermissionRequiredMixin, ObjectView):
|
||||||
|
permission_required = 'netbox_topology_views.view_coordinate'
|
||||||
|
|
||||||
|
queryset = PowerFeedCoordinate.objects.all()
|
||||||
|
|
||||||
|
class PowerFeedCoordinateAddView(PermissionRequiredMixin, ObjectEditView):
|
||||||
|
permission_required = 'netbox_topology_views.add_coordinate'
|
||||||
|
|
||||||
|
queryset = PowerFeedCoordinate.objects.all()
|
||||||
|
form = PowerFeedCoordinatesForm
|
||||||
|
template_name = 'netbox_topology_views/powerfeedcoordinate_add.html'
|
||||||
|
|
||||||
|
class PowerFeedCoordinateBulkImportView(BulkImportView):
|
||||||
|
queryset = PowerFeedCoordinate.objects.all()
|
||||||
|
model_form = PowerFeedCoordinatesImportForm
|
||||||
|
|
||||||
|
class PowerFeedCoordinateListView(PermissionRequiredMixin, ObjectListView):
|
||||||
|
permission_required = 'netbox_topology_views.view_coordinate'
|
||||||
|
|
||||||
|
queryset = PowerFeedCoordinate.objects.all()
|
||||||
|
table = PowerFeedCoordinateListTable
|
||||||
|
template_name = 'netbox_topology_views/powerfeedcoordinate_list.html'
|
||||||
|
filterset = PowerFeedCoordinatesFilterSet
|
||||||
|
filterset_form = PowerFeedCoordinatesFilterForm
|
||||||
|
|
||||||
|
class PowerFeedCoordinateEditView(PermissionRequiredMixin, ObjectEditView):
|
||||||
|
permission_required = 'netbox_topology_views.change_coordinate'
|
||||||
|
|
||||||
|
queryset = PowerFeedCoordinate.objects.all()
|
||||||
|
form = PowerFeedCoordinatesForm
|
||||||
|
template_name = 'netbox_topology_views/powerfeedcoordinate_edit.html'
|
||||||
|
|
||||||
|
class PowerFeedCoordinateDeleteView(PermissionRequiredMixin, ObjectDeleteView):
|
||||||
|
permission_required = 'netbox_topology_views.delete_coordinate'
|
||||||
|
|
||||||
|
queryset = PowerFeedCoordinate.objects.all()
|
||||||
|
|
||||||
|
class PowerFeedCoordinateChangeLogView(PermissionRequiredMixin, ObjectChangeLogView):
|
||||||
|
permission_required = 'netbox_topology_views.view_coordinate'
|
||||||
|
|
||||||
|
queryset = PowerFeedCoordinate.objects.all()
|
||||||
|
|
||||||
class CoordinateView(PermissionRequiredMixin, ObjectView):
|
class CoordinateView(PermissionRequiredMixin, ObjectView):
|
||||||
permission_required = 'netbox_topology_views.view_coordinate'
|
permission_required = 'netbox_topology_views.view_coordinate'
|
||||||
|
|
||||||
@@ -847,10 +996,19 @@ class CoordinateGroupView(PermissionRequiredMixin, ObjectView):
|
|||||||
queryset = CoordinateGroup.objects.all()
|
queryset = CoordinateGroup.objects.all()
|
||||||
|
|
||||||
def get_extra_context(self, request, instance):
|
def get_extra_context(self, request, instance):
|
||||||
|
circuittable = CircuitCoordinateListTable(instance.circuitcoordinate_set.all())
|
||||||
|
circuittable.configure(request)
|
||||||
|
powerpaneltable = PowerPanelCoordinateListTable(instance.powerpanelcoordinate_set.all())
|
||||||
|
powerpaneltable.configure(request)
|
||||||
|
powerfeedtable = PowerFeedCoordinateListTable(instance.powerfeedcoordinate_set.all())
|
||||||
|
powerfeedtable.configure(request)
|
||||||
table = CoordinateListTable(instance.coordinate_set.all())
|
table = CoordinateListTable(instance.coordinate_set.all())
|
||||||
table.configure(request)
|
table.configure(request)
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
'circuitcoordinates_table': circuittable,
|
||||||
|
'powerpanelcoordinates_table': powerpaneltable,
|
||||||
|
'powerfeedcoordinates_table': powerfeedtable,
|
||||||
'coordinates_table': table,
|
'coordinates_table': table,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ long_description = readme.read_text()
|
|||||||
|
|
||||||
setup(
|
setup(
|
||||||
name="netbox-topology-views",
|
name="netbox-topology-views",
|
||||||
version="3.6.0-beta.2",
|
version="3.9-beta1",
|
||||||
description="An NetBox plugin to create Topology maps",
|
description="An NetBox plugin to create Topology maps",
|
||||||
long_description=long_description,
|
long_description=long_description,
|
||||||
long_description_content_type="text/markdown",
|
long_description_content_type="text/markdown",
|
||||||
|
|||||||
Reference in new issue
Block a user