fix coordinate group in saved filter (#536)
This commit is contained in:
@@ -50,4 +50,4 @@ class PowerFeedCoordinateSerializer(NetBoxModelSerializer):
|
|||||||
class IndividualOptionsSerializer(NetBoxModelSerializer):
|
class IndividualOptionsSerializer(NetBoxModelSerializer):
|
||||||
class Meta:
|
class Meta:
|
||||||
model = IndividualOptions
|
model = IndividualOptions
|
||||||
fields = ("ignore_cable_type", "save_coords", "show_unconnected", "show_cables", "show_logical_connections", "show_single_cable_logical_conns", "show_neighbors", "show_circuit", "show_power", "show_wireless", "group_sites", "group_locations", "group_racks", "draw_default_layout", "straight_cables")
|
fields = ("ignore_cable_type", "save_coords", "show_unconnected", "show_cables", "show_logical_connections", "show_single_cable_logical_conns", "show_neighbors", "show_circuit", "show_power", "show_wireless", "group_sites", "group_locations", "group_racks", "group", "draw_default_layout", "straight_cables")
|
||||||
|
|||||||
@@ -109,7 +109,7 @@ class ExportTopoToXML(PermissionRequiredMixin, ViewSet):
|
|||||||
|
|
||||||
if request.GET:
|
if request.GET:
|
||||||
|
|
||||||
filter_id, save_coords, show_unconnected, show_power, show_circuit, show_logical_connections, show_single_cable_logical_conns, show_cables, show_wireless, group_sites, group_locations, group_racks, show_neighbors, straight_cables = get_query_settings(request)
|
filter_id, save_coords, show_unconnected, show_power, show_circuit, show_logical_connections, show_single_cable_logical_conns, show_cables, show_wireless, group_sites, group_locations, group_racks, group, show_neighbors, straight_cables = get_query_settings(request)
|
||||||
|
|
||||||
# Read options from saved filters as NetBox does not handle custom plugin filters
|
# Read options from saved filters as NetBox does not handle custom plugin filters
|
||||||
if "filter_id" in request.GET and request.GET["filter_id"] != '':
|
if "filter_id" in request.GET and request.GET["filter_id"] != '':
|
||||||
@@ -135,7 +135,10 @@ class ExportTopoToXML(PermissionRequiredMixin, ViewSet):
|
|||||||
print(type(inst))
|
print(type(inst))
|
||||||
|
|
||||||
if 'group' not in request.query_params:
|
if 'group' not in request.query_params:
|
||||||
group_id = "default"
|
if 'group' in saved_filter_params:
|
||||||
|
group_id = saved_filter_params['group'][0]
|
||||||
|
else:
|
||||||
|
group_id = "default"
|
||||||
else:
|
else:
|
||||||
group_id = request.query_params["group"]
|
group_id = request.query_params["group"]
|
||||||
topo_data = get_topology_data(
|
topo_data = get_topology_data(
|
||||||
|
|||||||
@@ -173,6 +173,10 @@ def get_query_settings(request):
|
|||||||
if request.GET["group_racks"] == "True" :
|
if request.GET["group_racks"] == "True" :
|
||||||
group_racks = True
|
group_racks = True
|
||||||
|
|
||||||
|
group = False
|
||||||
|
if "group" in request.GET:
|
||||||
|
group = request.GET["group"]
|
||||||
|
|
||||||
show_neighbors = False
|
show_neighbors = False
|
||||||
if "show_neighbors" in request.GET:
|
if "show_neighbors" in request.GET:
|
||||||
if request.GET["show_neighbors"] == "True" :
|
if request.GET["show_neighbors"] == "True" :
|
||||||
@@ -183,7 +187,7 @@ def get_query_settings(request):
|
|||||||
if request.GET["straight_cables"] == "True":
|
if request.GET["straight_cables"] == "True":
|
||||||
straight_cables = True
|
straight_cables = True
|
||||||
|
|
||||||
return filter_id, save_coords, show_unconnected, show_power, show_circuit, show_logical_connections, show_single_cable_logical_conns, show_cables, show_wireless, group_sites, group_locations, group_racks, show_neighbors, straight_cables
|
return filter_id, save_coords, show_unconnected, show_power, show_circuit, show_logical_connections, show_single_cable_logical_conns, show_cables, show_wireless, group_sites, group_locations, group_racks, group, show_neighbors, straight_cables
|
||||||
|
|
||||||
class LinePattern():
|
class LinePattern():
|
||||||
wireless = [2, 10, 2, 10]
|
wireless = [2, 10, 2, 10]
|
||||||
|
|||||||
@@ -719,7 +719,7 @@ class TopologyHomeView(PermissionRequiredMixin, View):
|
|||||||
|
|
||||||
if request.GET:
|
if request.GET:
|
||||||
|
|
||||||
filter_id, save_coords, show_unconnected, show_power, show_circuit, show_logical_connections, show_single_cable_logical_conns, show_cables, show_wireless, group_sites, group_locations, group_racks, show_neighbors, straight_cables = get_query_settings(request)
|
filter_id, save_coords, show_unconnected, show_power, show_circuit, show_logical_connections, show_single_cable_logical_conns, show_cables, show_wireless, group_sites, group_locations, group_racks, group, show_neighbors, straight_cables = get_query_settings(request)
|
||||||
|
|
||||||
# Read options from saved filters as NetBox does not handle custom plugin filters
|
# Read options from saved filters as NetBox does not handle custom plugin filters
|
||||||
if "filter_id" in request.GET and request.GET["filter_id"] != '':
|
if "filter_id" in request.GET and request.GET["filter_id"] != '':
|
||||||
@@ -745,7 +745,10 @@ class TopologyHomeView(PermissionRequiredMixin, View):
|
|||||||
print(type(inst))
|
print(type(inst))
|
||||||
|
|
||||||
if "group" not in request.GET:
|
if "group" not in request.GET:
|
||||||
group_id = "default"
|
if 'group' in saved_filter_params:
|
||||||
|
group_id = saved_filter_params['group'][0]
|
||||||
|
else:
|
||||||
|
group_id = "default"
|
||||||
else:
|
else:
|
||||||
group_id = request.GET["group"]
|
group_id = request.GET["group"]
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user