ipfabric_netbox 4.3.2b3__py3-none-any.whl → 4.3.2b5__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of ipfabric_netbox might be problematic. Click here for more details.

@@ -6,7 +6,7 @@ class NetboxIPFabricConfig(PluginConfig):
6
6
  name = "ipfabric_netbox"
7
7
  verbose_name = "NetBox IP Fabric SoT Plugin"
8
8
  description = "Sync IP Fabric into NetBox"
9
- version = "4.3.2b3"
9
+ version = "4.3.2b5"
10
10
  base_url = "ipfabric"
11
11
  min_version = "4.4.0"
12
12
 
ipfabric_netbox/tables.py CHANGED
@@ -89,7 +89,7 @@ class IPFabricTransformMapTable(NetBoxTable):
89
89
 
90
90
 
91
91
  class IPFabricIngestionTable(NetBoxTable):
92
- name = tables.Column(linkify=True)
92
+ name = tables.Column(linkify=True, order_by=("branch_name", "sync_name", "id"))
93
93
  sync = tables.Column(verbose_name=_("IP Fabric Sync"), linkify=True)
94
94
  branch = tables.Column(linkify=True)
95
95
  changes = tables.Column(
@@ -97,6 +97,14 @@ class IPFabricIngestionTable(NetBoxTable):
97
97
  )
98
98
  actions = columns.ActionsColumn(actions=("delete",))
99
99
 
100
+ def render_name(self, record):
101
+ if getattr(record, "branch_name", None):
102
+ return record.branch_name
103
+ elif getattr(record, "sync_name", None):
104
+ return f"{record.sync_name} (Ingestion {record.pk})"
105
+ else:
106
+ return f"Ingestion {record.pk} (No Sync)"
107
+
100
108
  class Meta(NetBoxTable.Meta):
101
109
  model = IPFabricIngestion
102
110
  fields = ("name", "sync", "branch", "description", "user", "changes")
@@ -158,6 +166,7 @@ class IPFabricSyncTable(NetBoxTable):
158
166
  accessor="last_ingestion",
159
167
  verbose_name=_("Last Ingestion"),
160
168
  linkify=True,
169
+ order_by="last_ingestion_pk",
161
170
  )
162
171
 
163
172
  def render_last_ingestion(self, value: IPFabricIngestion):
@@ -190,8 +199,9 @@ class IPFabricIngestionChangesTable(NetBoxTable):
190
199
  object_type = tables.Column(
191
200
  accessor="object_type.model", verbose_name=_("Object Type")
192
201
  )
193
- object = tables.Column(verbose_name=_("Object"))
194
- actions = columns.TemplateColumn(template_code=DIFF_BUTTON)
202
+ object = tables.Column(verbose_name=_("Object"), order_by="object_repr")
203
+ actions = None
204
+ diffs = columns.TemplateColumn(template_code=DIFF_BUTTON, orderable=False)
195
205
 
196
206
  def render_object(self, value, record):
197
207
  model_templates = {
@@ -213,7 +223,7 @@ class IPFabricIngestionChangesTable(NetBoxTable):
213
223
  if value and (class_name := value.__class__.__name__) in model_templates:
214
224
  field_value = model_templates[class_name](value)
215
225
  if url := value.get_absolute_url():
216
- return format_html("<a href={}>{}</a>", url, field_value)
226
+ return format_html("<a href='{}'>{}</a>", url, field_value)
217
227
  else:
218
228
  field_value = record.object_repr
219
229
  return field_value
@@ -221,8 +231,8 @@ class IPFabricIngestionChangesTable(NetBoxTable):
221
231
  class Meta(NetBoxTable.Meta):
222
232
  model = ChangeDiff
223
233
  name = "staged_changes"
224
- fields = ("object", "action", "object_type", "actions")
225
- default_columns = ("object", "action", "object_type", "actions")
234
+ fields = ("object", "action", "object_type", "diffs")
235
+ default_columns = ("object", "action", "object_type", "diffs")
226
236
 
227
237
 
228
238
  class IPFabricIngestionIssuesTable(NetBoxTable):
@@ -18,7 +18,7 @@
18
18
  <div class="row mb-3">
19
19
  <div class="col col-md-6">
20
20
  <div class="card">
21
- <h5 class="card-header">{% trans "Snapshot Information</h5>
21
+ <h5 class="card-header">{% trans "Snapshot Information" %}</h5>
22
22
  <div class="card-body">
23
23
  <table class="table table-hover attr-table">
24
24
  <tr>
ipfabric_netbox/views.py CHANGED
@@ -727,7 +727,13 @@ class IPFabricSourceTopology(LoginRequiredMixin, View):
727
727
  # region - Sync
728
728
  @register_model_view(IPFabricSync, "list", path="", detail=False)
729
729
  class IPFabricSyncListView(generic.ObjectListView):
730
- queryset = IPFabricSync.objects.all()
730
+ queryset = IPFabricSync.objects.annotate(
731
+ last_ingestion_pk=models.Subquery(
732
+ IPFabricIngestion.objects.filter(sync=models.OuterRef("pk"))
733
+ .order_by("-pk")
734
+ .values("pk")[:1]
735
+ )
736
+ )
731
737
  table = IPFabricSyncTable
732
738
  filterset = IPFabricSyncFilterSet
733
739
  actions = (AddObject, BulkExport, BulkEdit, BulkRename, BulkDelete)
@@ -877,6 +883,8 @@ class IPFabricIngestionTabView(generic.ObjectChildrenView):
877
883
  description=models.F("branch__description"),
878
884
  user=models.F("sync__user__username"),
879
885
  staged_changes=models.Count(models.F("branch__changediff")),
886
+ branch_name=models.F("branch__name"),
887
+ sync_name=models.F("sync__name"),
880
888
  )
881
889
 
882
890
 
@@ -890,6 +898,8 @@ class IPFabricIngestionListView(generic.ObjectListView):
890
898
  description=models.F("branch__description"),
891
899
  user=models.F("sync__user__username"),
892
900
  staged_changes=models.Count(models.F("branch__changediff")),
901
+ branch_name=models.F("branch__name"),
902
+ sync_name=models.F("sync__name"),
893
903
  )
894
904
  filterset = IPFabricIngestionFilterSet
895
905
  filterset_form = IPFabricIngestionFilterForm
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ipfabric_netbox
3
- Version: 4.3.2b3
3
+ Version: 4.3.2b5
4
4
  Summary: NetBox plugin to sync IP Fabric data into NetBox
5
5
  License: MIT
6
6
  Keywords: netbox,ipfabric,plugin,sync
@@ -1,4 +1,4 @@
1
- ipfabric_netbox/__init__.py,sha256=ubD3_CcKoeKzWiGAgw-Jbc6qYADxMkuX4GHa2dTMYK0,674
1
+ ipfabric_netbox/__init__.py,sha256=Y0eTGqE2S1Bo0EEpLOqg-aeHQD7Z9fbJT4_AV7MWIrM,674
2
2
  ipfabric_netbox/api/__init__.py,sha256=XRclTGWVR0ZhAAwgYul5Wm_loug5_hUjEumbLQEwKYM,47
3
3
  ipfabric_netbox/api/serializers.py,sha256=92Cwhnqsm1l1oZfdHH5aJI1VFX0eO5JS4BsdXE6Ur18,6738
4
4
  ipfabric_netbox/api/urls.py,sha256=1fXXVTxNY5E64Nfz6b7zXD9bZI3FcefuxAWKMe0w_QU,1240
@@ -40,7 +40,7 @@ ipfabric_netbox/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJ
40
40
  ipfabric_netbox/models.py,sha256=5bgQzfGfCUWQdRL3j6CNFXVDW3oDfxpQ0Y6JCKRJz-M,39250
41
41
  ipfabric_netbox/navigation.py,sha256=g2PyyaMqjgYwO3VIKza8vMS-dhbkvxscsHwVfWBj_dk,2287
42
42
  ipfabric_netbox/signals.py,sha256=y3x2jKT8yTjOfC4B3h4YZPRsYQkBal4cFdHJFkbPoS8,1411
43
- ipfabric_netbox/tables.py,sha256=jXiHcRrR4XwkvyUnnU92JW290nZg-85IdpKjsQOsFcc,9052
43
+ ipfabric_netbox/tables.py,sha256=5zLupcghoeQeQ0SQyMrYQg00cpGzeO9DL4IJ54-b7Fo,9496
44
44
  ipfabric_netbox/template_content.py,sha256=lxZ02BFVihbSgjXCETGsWmhdElQUUO3uUGd0WfhlRmw,1120
45
45
  ipfabric_netbox/templates/ipfabric_netbox/inc/clone_form.html,sha256=f6O5ugjQg7u37QWxUpKvE38jNslwb3rCMghlAUqjWBk,1127
46
46
  ipfabric_netbox/templates/ipfabric_netbox/inc/diff.html,sha256=tuXJdQnesdIF0pUoKoho_8fQTGSIwdoEWhieHu6ikVM,3439
@@ -54,7 +54,7 @@ ipfabric_netbox/templates/ipfabric_netbox/inc/transform_map_field_map.html,sha25
54
54
  ipfabric_netbox/templates/ipfabric_netbox/inc/transform_map_relationship_map.html,sha256=tmIV0gDhfVxBse4xDeE5atMi4KEMkvxB_WRx94gu44U,539
55
55
  ipfabric_netbox/templates/ipfabric_netbox/ipfabric_table.html,sha256=HsxENF0KaaGT8w0_K6251LVH0W_mg60W8ktApxAG59U,1689
56
56
  ipfabric_netbox/templates/ipfabric_netbox/ipfabricingestion.html,sha256=4cUP5KxCEtH4j5RFT68-7UJUCnJcOCxA0iBzrxwua4I,4760
57
- ipfabric_netbox/templates/ipfabric_netbox/ipfabricsnapshot.html,sha256=HWCGi1e0O_jL-5XnIYfCC5EQh5oSw-1-ZUpjH6-cGV0,3690
57
+ ipfabric_netbox/templates/ipfabric_netbox/ipfabricsnapshot.html,sha256=JzvLqu0lIutCn_2f0alNVOAFbv2P6sqoZ1nYtVL9O8Y,3694
58
58
  ipfabric_netbox/templates/ipfabric_netbox/ipfabricsource.html,sha256=I9K7Eob-jjNAy6lryq2QKpp-5JyR1DEJSPF3D6JKR_w,4063
59
59
  ipfabric_netbox/templates/ipfabric_netbox/ipfabricsync.html,sha256=M7tig8Y42ndsipBHKVVfSFb9tSGvm7Cf4fj-B54xizs,4852
60
60
  ipfabric_netbox/templates/ipfabric_netbox/ipfabrictransformmap.html,sha256=bAau1cqRMUsOWHIxkMP-6ALf7l-6AZSQfh-iPGUPR6U,1560
@@ -82,7 +82,7 @@ ipfabric_netbox/utilities/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJW
82
82
  ipfabric_netbox/utilities/ipfutils.py,sha256=wc6wVBEHKJ8RoCOrp6Fm3w08nf1xiHGGMsMYrypOcpA,38852
83
83
  ipfabric_netbox/utilities/logging.py,sha256=GYknjocMN6LQ2873_az3y0RKm29TCXaWviUIIneH-x0,3445
84
84
  ipfabric_netbox/utilities/transform_map.py,sha256=nJhEdi2DqqowrtfowNgg-FZiE3_lN0MhQvaNwHS4yXw,8979
85
- ipfabric_netbox/views.py,sha256=CPVtPvHcKCeCAusxjC0WvnOUKn6p5m3lgd57wOp29dI,44829
86
- ipfabric_netbox-4.3.2b3.dist-info/METADATA,sha256=x5CPFIHt27uvIVjSJ3v38qFptMdLXYyC5y-jA6hNnDY,4789
87
- ipfabric_netbox-4.3.2b3.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
88
- ipfabric_netbox-4.3.2b3.dist-info/RECORD,,
85
+ ipfabric_netbox/views.py,sha256=nFqb9htUH-D8NXvJcWPb5D5u909rfHMZ4trUbCULafU,45208
86
+ ipfabric_netbox-4.3.2b5.dist-info/METADATA,sha256=BGU2f-PPRiSy2wedUc8muqMfLABDWvZYnQZVPeljMO4,4789
87
+ ipfabric_netbox-4.3.2b5.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
88
+ ipfabric_netbox-4.3.2b5.dist-info/RECORD,,