ipfabric_netbox 4.2.0b6__py3-none-any.whl → 4.2.0b7__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.2.0b6"
9
+ version = "4.2.0b7"
10
10
  base_url = "ipfabric"
11
11
  min_version = "4.2.4"
12
12
 
ipfabric_netbox/models.py CHANGED
@@ -667,6 +667,10 @@ class IPFabricSync(IPFabricClient, JobsMixin, TagsMixin, ChangeLoggedModel):
667
667
  else:
668
668
  return False
669
669
 
670
+ @property
671
+ def last_ingestion(self):
672
+ return self.ipfabricingestion_set.last()
673
+
670
674
  @staticmethod
671
675
  def get_transform_maps(group_ids=None):
672
676
  """
ipfabric_netbox/tables.py CHANGED
@@ -142,20 +142,41 @@ class IPFabricSourceTable(NetBoxTable):
142
142
  default_columns = ("pk", "name", "status", "description", "snapshot_count")
143
143
 
144
144
 
145
- class SyncTable(NetBoxTable):
146
- actions = None
145
+ class IPFabricSyncTable(NetBoxTable):
146
+ name = tables.Column(linkify=True)
147
147
  status = columns.ChoiceFieldColumn()
148
148
  snapshot_name = tables.Column(
149
- verbose_name="Snapshot Name", accessor="snapshot_data"
149
+ verbose_name="Snapshot Name",
150
+ accessor="snapshot_data",
151
+ linkify=True,
152
+ )
153
+ last_ingestion = tables.Column(
154
+ accessor="last_ingestion",
155
+ verbose_name="Last Ingestion",
156
+ linkify=True,
150
157
  )
151
158
 
152
- def render_snapshot_name(self, value):
153
- return value.get("name", "---")
159
+ def render_last_ingestion(self, value: IPFabricIngestion):
160
+ return getattr(value, "name", "---") if value else "---"
161
+
162
+ def render_snapshot_name(self, value: IPFabricSnapshot):
163
+ return getattr(value, "name", "---") if value else "---"
154
164
 
155
165
  class Meta(NetBoxTable.Meta):
156
166
  model = IPFabricSync
157
- fields = ("id", "status", "snapshot_name")
158
- default_columns = ("id", "status", "snapshot_name")
167
+ fields = (
168
+ "auto_merge",
169
+ "id",
170
+ "interval",
171
+ "last_synced",
172
+ "last_ingestion",
173
+ "name",
174
+ "scheduled",
175
+ "status",
176
+ "snapshot_name",
177
+ "user",
178
+ )
179
+ default_columns = ("name", "status", "last_ingestion", "snapshot_name")
159
180
 
160
181
 
161
182
  class IPFabricIngestionChangesTable(NetBoxTable):
ipfabric_netbox/views.py CHANGED
@@ -37,6 +37,7 @@ from .filtersets import IPFabricIngestionFilterSet
37
37
  from .filtersets import IPFabricIngestionIssueFilterSet
38
38
  from .filtersets import IPFabricSnapshotFilterSet
39
39
  from .filtersets import IPFabricSourceFilterSet
40
+ from .filtersets import IPFabricSyncFilterSet
40
41
  from .filtersets import IPFabricTransformMapFilterSet
41
42
  from .filtersets import IPFabricTransformMapGroupFilterSet
42
43
  from .forms import IPFabricIngestionFilterForm
@@ -69,6 +70,7 @@ from .tables import IPFabricIngestionTable
69
70
  from .tables import IPFabricRelationshipFieldTable
70
71
  from .tables import IPFabricSnapshotTable
71
72
  from .tables import IPFabricSourceTable
73
+ from .tables import IPFabricSyncTable
72
74
  from .tables import IPFabricTransformFieldTable
73
75
  from .tables import IPFabricTransformMapGroupTable
74
76
  from .tables import IPFabricTransformMapTable
@@ -528,14 +530,10 @@ class IPFabricSourceBulkDeleteView(generic.BulkDeleteView):
528
530
 
529
531
 
530
532
  # Sync
531
- class IPFabricSyncListView(View):
532
- def get(self, request):
533
- syncs = IPFabricSync.objects.prefetch_related("snapshot_data")
534
- return render(
535
- request,
536
- "ipfabric_netbox/ipfabricsync_list.html",
537
- {"model": IPFabricSync, "syncs": syncs},
538
- )
533
+ class IPFabricSyncListView(generic.ObjectListView):
534
+ queryset = IPFabricSync.objects.all()
535
+ table = IPFabricSyncTable
536
+ filterset = IPFabricSyncFilterSet
539
537
 
540
538
 
541
539
  @register_model_view(IPFabricSync, "edit")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: ipfabric_netbox
3
- Version: 4.2.0b6
3
+ Version: 4.2.0b7
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=E5BKH5-wfz4YUPlNookiC6kVSmlN7ZR5mc7rN9YeHCY,674
1
+ ipfabric_netbox/__init__.py,sha256=GYju0tg0eaMQXudqlau7AFn4csVDg1NA4mdly9R8Ivg,674
2
2
  ipfabric_netbox/api/__init__.py,sha256=XRclTGWVR0ZhAAwgYul5Wm_loug5_hUjEumbLQEwKYM,47
3
3
  ipfabric_netbox/api/serializers.py,sha256=RV1tmkbRF_Est3x1w_bfk63qwgEQc97Bm4mk89tv2FU,6502
4
4
  ipfabric_netbox/api/urls.py,sha256=1fXXVTxNY5E64Nfz6b7zXD9bZI3FcefuxAWKMe0w_QU,1240
@@ -33,10 +33,10 @@ ipfabric_netbox/migrations/0015_ipfabricingestionissue.py,sha256=AjAkyboa4BSXsN5
33
33
  ipfabric_netbox/migrations/0016_tags_and_changelog_for_snapshots.py,sha256=XqftTQ4GFnoCoGSHPa2WL_bjSVCGxdP2MFXCUa6LN1k,929
34
34
  ipfabric_netbox/migrations/0017_ipfabricsync_update_custom_fields.py,sha256=IVbAL2WdigYT40sXN0A8K3HweJ_O4QqyzjB06TbkG5E,447
35
35
  ipfabric_netbox/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
36
- ipfabric_netbox/models.py,sha256=U9_ooh8juhtXwwcj0ay_6KZ-FlBt2SYrR7YCScAYa9k,36168
36
+ ipfabric_netbox/models.py,sha256=5vsvqe7-lJjn2E-0YHJeiZm3cnglBPcKWXLSetRu1Kc,36262
37
37
  ipfabric_netbox/navigation.py,sha256=2dEJ_wKHb52Tl0FOV1TH3JbxRe8YZ56ewrTsBFGKpCg,2210
38
38
  ipfabric_netbox/signals.py,sha256=cGa5PVD2i24pGXiVNfbu6ruIDqPVdwKQHTSWe9Ura84,1838
39
- ipfabric_netbox/tables.py,sha256=pHKv6Bosjnc-7aApak3nLhzxqBiA30olPdaMO8F1PQg,8262
39
+ ipfabric_netbox/tables.py,sha256=XT2cD0yGMaVxxpZwH6iMXP65OGE8G8OdDEtPjicAajE,8870
40
40
  ipfabric_netbox/template_content.py,sha256=bP2nUf5MM-GUbtQxJ8QoYVNXhrDCrkb8wZnbeqa07EA,315
41
41
  ipfabric_netbox/templates/ipfabric_netbox/inc/clone_form.html,sha256=K-2TTDaS1F4wUIR8FFFPqex4KJbySXtHiz5V-OEwelY,967
42
42
  ipfabric_netbox/templates/ipfabric_netbox/inc/diff.html,sha256=xOiIrvRIBtqDD65u6xcLo2xdwDKNpAylDmzznaJRGCw,3281
@@ -53,7 +53,6 @@ ipfabric_netbox/templates/ipfabric_netbox/ipfabricingestion.html,sha256=fm_X2FLn
53
53
  ipfabric_netbox/templates/ipfabric_netbox/ipfabricsnapshot.html,sha256=hj8ORs_4mM_xTjmw3McHN-da5seC8nbbkzobn0f1TSc,3482
54
54
  ipfabric_netbox/templates/ipfabric_netbox/ipfabricsource.html,sha256=koR_t6Mf2FhWlPZHchWsTOQDSLB7AWrqtY0TRnIzrrM,3864
55
55
  ipfabric_netbox/templates/ipfabric_netbox/ipfabricsync.html,sha256=BicVS7mCP85fFZJEt46GUm5xppi1Jw3byw1el9BB2WE,4448
56
- ipfabric_netbox/templates/ipfabric_netbox/ipfabricsync_list.html,sha256=b6uE317N69oeknOOqnJo5I-qm44QezDlBTRqslbEO8I,2593
57
56
  ipfabric_netbox/templates/ipfabric_netbox/ipfabrictransformmap.html,sha256=qFo_Ku5oksx5co4HVtVq0xAVFI6CLWs-iBrwYzGsEGA,1460
58
57
  ipfabric_netbox/templates/ipfabric_netbox/ipfabrictransformmap_list.html,sha256=p8zqn0-B6mawSUM3zQrus6dsKUM5SRBTO0X94pLboX8,452
59
58
  ipfabric_netbox/templates/ipfabric_netbox/ipfabrictransformmap_restore.html,sha256=cuvOBKnlMudMI-CX77W3vTpwhtc4CBcc6j6Ye-IBBMQ,2562
@@ -78,7 +77,7 @@ ipfabric_netbox/utilities/ipfutils.py,sha256=wFmL5oriuF-is1ZlrIcLmoeYUY5ih-CA9we
78
77
  ipfabric_netbox/utilities/logging.py,sha256=GYknjocMN6LQ2873_az3y0RKm29TCXaWviUIIneH-x0,3445
79
78
  ipfabric_netbox/utilities/nbutils.py,sha256=kFBEiJOGvr_49hJWCS2duXojx2-A9kVk0Xp_vj0ohfs,2641
80
79
  ipfabric_netbox/utilities/transform_map.py,sha256=QotbGc2TksINJrb62STgAigpC5Nsgi5umYHu_0rZd8k,2204
81
- ipfabric_netbox/views.py,sha256=nGWO-PlTyKviBzGEdmE3C_1I-xFjZMldqOWGx12wdbg,36855
82
- ipfabric_netbox-4.2.0b6.dist-info/METADATA,sha256=UKZI463uPse64h8bR0yCQQvkYUbqTuWwZlDMtG5fpFY,4638
83
- ipfabric_netbox-4.2.0b6.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
84
- ipfabric_netbox-4.2.0b6.dist-info/RECORD,,
80
+ ipfabric_netbox/views.py,sha256=W7By73eiopwX-Q10S4kcFVL-lkz0WG0pwe2doNpvYg0,36807
81
+ ipfabric_netbox-4.2.0b7.dist-info/METADATA,sha256=uuj3z6XFfZ08QxhrhI7fiAU9XxbWthsqxvN9IFBAd3Q,4638
82
+ ipfabric_netbox-4.2.0b7.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
83
+ ipfabric_netbox-4.2.0b7.dist-info/RECORD,,
@@ -1,71 +0,0 @@
1
- {% extends 'base/layout.html' %}
2
- {% load buttons %}
3
- {% load helpers %}
4
- {% load perms %}
5
-
6
- {% block title %}Ingestion{% endblock %}
7
-
8
- {% block tabs %}
9
- <ul class="nav nav-tabs px-3">
10
- <li class="nav-item" role="presentation">
11
- <a class="nav-link active" role="tab">Ingestion</a>
12
- </li>
13
- </ul>
14
- {% endblock tabs %}
15
-
16
- {% block controls %}
17
- <div class="controls">
18
- <div class="control-group">
19
- {% block extra_controls %}{% endblock %}
20
- {% add_button model %}
21
- </div>
22
- </div>
23
- {% endblock controls %}
24
-
25
- {% block content %}
26
- <div class="tab-content">
27
- {% for sync in syncs %}
28
- <div class="card">
29
- <h5 class="card-header d-flex justify-content-between" id="module{{ module.pk }}">
30
- <div>
31
- <i class="mdi mdi-cloud-sync"></i><i class="mdi mdi-sync"></i> <a href="{% url 'plugins:ipfabric_netbox:ipfabricsync' pk=sync.pk %}">{{ sync.name}}</a>
32
- </div>
33
- {% if perms.ipfabric_netbox.delete_ipfabricsync %}
34
- <a href="{% url 'plugins:ipfabric_netbox:ipfabricsync_delete' pk=sync.pk %}" class="btn btn-danger btn-sm">
35
- <i class="mdi mdi-trash-can-outline" aria-hidden="true"></i> Delete
36
- </a>
37
- {% endif %}
38
-
39
- </h5>
40
- <div class="card-body">
41
- {% include 'inc/sync_warning.html' with object=module %}
42
- <table class="table table-hover table-headings reports">
43
- <thead>
44
- <tr>
45
- <th width="200">Source</th>
46
- <th width="400">Snapshot</th>
47
- <th>Status</th>
48
- <th>Last Run</th>
49
- </tr>
50
- </thead>
51
- <tbody>
52
- <tr>
53
- <td><a href="{% url 'plugins:ipfabric_netbox:ipfabricsource' pk=sync.snapshot_data.source.pk %}">{{ sync.snapshot_data.source.name }}</a></td>
54
- <td><a href="{% url 'plugins:ipfabric_netbox:ipfabricsnapshot' pk=sync.snapshot_data.pk %}">{{ sync.snapshot_data.name}}</a></td>
55
- <td>{% badge sync.get_status_display last_job.get_status_color %}</td>
56
- <td>{{sync.last_synced}}</td>
57
- </tr>
58
- </tbody>
59
- </table>
60
- </div>
61
- </div>
62
- {% empty %}
63
- <div class="alert alert-info" role="alert">
64
- <h4 class="alert-heading">Sync Jobs Settings Found</h4>
65
- {% if perms.extras.add_reportmodule %}
66
- Get started by <a href="{% url 'plugins:ipfabric_netbox:ipfabricsync_add' %}">creating a sync</a> from an IP Fabric source.
67
- {% endif %}
68
- </div>
69
- {% endfor %}
70
- </div>
71
- {% endblock content %}