netbox-toolkit-plugin 0.1.0__py3-none-any.whl → 0.1.2__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.
- netbox_toolkit_plugin/__init__.py +32 -0
- {netbox_toolkit → netbox_toolkit_plugin}/api/serializers.py +71 -35
- {netbox_toolkit → netbox_toolkit_plugin}/api/urls.py +3 -3
- {netbox_toolkit → netbox_toolkit_plugin}/connectors/factory.py +170 -111
- {netbox_toolkit → netbox_toolkit_plugin}/connectors/netmiko_connector.py +242 -179
- {netbox_toolkit → netbox_toolkit_plugin}/connectors/scrapli_connector.py +256 -172
- netbox_toolkit_plugin/migrations/0001_initial.py +108 -0
- netbox_toolkit_plugin/migrations/0002_alter_command_options_alter_command_unique_together_and_more.py +70 -0
- {netbox_toolkit → netbox_toolkit_plugin}/migrations/0003_permission_system_update.py +26 -12
- {netbox_toolkit → netbox_toolkit_plugin}/migrations/0004_remove_django_permissions.py +27 -29
- {netbox_toolkit → netbox_toolkit_plugin}/migrations/0005_alter_command_options_and_more.py +7 -8
- {netbox_toolkit → netbox_toolkit_plugin}/migrations/0006_commandlog_parsed_data_commandlog_parsing_success_and_more.py +7 -8
- {netbox_toolkit → netbox_toolkit_plugin}/migrations/0007_alter_commandlog_parsing_template.py +6 -4
- {netbox_toolkit → netbox_toolkit_plugin}/models.py +31 -32
- {netbox_toolkit → netbox_toolkit_plugin}/navigation.py +6 -6
- {netbox_toolkit → netbox_toolkit_plugin}/services/command_service.py +188 -128
- {netbox_toolkit → netbox_toolkit_plugin}/services/rate_limiting_service.py +104 -97
- netbox_toolkit_plugin/settings.py +176 -0
- netbox_toolkit_plugin/tables.py +51 -0
- netbox_toolkit_plugin/templates/netbox_toolkit/command.html +108 -0
- netbox_toolkit_plugin/templates/netbox_toolkit/command_list.html +12 -0
- netbox_toolkit_plugin/templates/netbox_toolkit/commandlog.html +170 -0
- netbox_toolkit_plugin/templates/netbox_toolkit/device_toolkit.html +557 -0
- {netbox_toolkit/templates/netbox_toolkit → netbox_toolkit_plugin/templates/netbox_toolkit_plugin}/command.html +5 -5
- {netbox_toolkit/templates/netbox_toolkit → netbox_toolkit_plugin/templates/netbox_toolkit_plugin}/command_list.html +2 -2
- {netbox_toolkit/templates/netbox_toolkit → netbox_toolkit_plugin/templates/netbox_toolkit_plugin}/commandlog.html +2 -2
- {netbox_toolkit/templates/netbox_toolkit → netbox_toolkit_plugin/templates/netbox_toolkit_plugin}/device_toolkit.html +6 -6
- netbox_toolkit_plugin/urls.py +38 -0
- {netbox_toolkit → netbox_toolkit_plugin}/utils/logging.py +20 -19
- {netbox_toolkit → netbox_toolkit_plugin}/views.py +251 -169
- {netbox_toolkit_plugin-0.1.0.dist-info → netbox_toolkit_plugin-0.1.2.dist-info}/METADATA +2 -2
- netbox_toolkit_plugin-0.1.2.dist-info/RECORD +60 -0
- netbox_toolkit_plugin-0.1.2.dist-info/entry_points.txt +2 -0
- netbox_toolkit_plugin-0.1.2.dist-info/top_level.txt +1 -0
- netbox_toolkit/__init__.py +0 -30
- netbox_toolkit/config.py +0 -159
- netbox_toolkit/migrations/0001_initial.py +0 -54
- netbox_toolkit/migrations/0002_alter_command_options_alter_command_unique_together_and_more.py +0 -66
- netbox_toolkit/tables.py +0 -37
- netbox_toolkit/urls.py +0 -22
- netbox_toolkit_plugin-0.1.0.dist-info/RECORD +0 -56
- netbox_toolkit_plugin-0.1.0.dist-info/entry_points.txt +0 -2
- netbox_toolkit_plugin-0.1.0.dist-info/top_level.txt +0 -1
- {netbox_toolkit → netbox_toolkit_plugin}/admin.py +0 -0
- {netbox_toolkit → netbox_toolkit_plugin}/api/__init__.py +0 -0
- {netbox_toolkit → netbox_toolkit_plugin}/api/mixins.py +0 -0
- {netbox_toolkit → netbox_toolkit_plugin}/api/schemas.py +0 -0
- {netbox_toolkit → netbox_toolkit_plugin}/api/views/__init__.py +0 -0
- {netbox_toolkit → netbox_toolkit_plugin}/api/views/command_logs.py +0 -0
- {netbox_toolkit → netbox_toolkit_plugin}/api/views/commands.py +0 -0
- {netbox_toolkit → netbox_toolkit_plugin}/connectors/__init__.py +0 -0
- {netbox_toolkit → netbox_toolkit_plugin}/connectors/base.py +0 -0
- {netbox_toolkit → netbox_toolkit_plugin}/exceptions.py +0 -0
- {netbox_toolkit → netbox_toolkit_plugin}/filtersets.py +0 -0
- {netbox_toolkit → netbox_toolkit_plugin}/forms.py +0 -0
- {netbox_toolkit → netbox_toolkit_plugin}/migrations/__init__.py +0 -0
- {netbox_toolkit → netbox_toolkit_plugin}/search.py +0 -0
- {netbox_toolkit → netbox_toolkit_plugin}/services/__init__.py +0 -0
- {netbox_toolkit → netbox_toolkit_plugin}/services/device_service.py +0 -0
- {netbox_toolkit/static/netbox_toolkit → netbox_toolkit_plugin/static/netbox_toolkit_plugin}/css/toolkit.css +0 -0
- {netbox_toolkit/static/netbox_toolkit → netbox_toolkit_plugin/static/netbox_toolkit_plugin}/js/toolkit.js +0 -0
- {netbox_toolkit/templates/netbox_toolkit → netbox_toolkit_plugin/templates/netbox_toolkit_plugin}/command_edit.html +0 -0
- {netbox_toolkit/templates/netbox_toolkit → netbox_toolkit_plugin/templates/netbox_toolkit_plugin}/commandlog_list.html +0 -0
- {netbox_toolkit → netbox_toolkit_plugin}/utils/__init__.py +0 -0
- {netbox_toolkit → netbox_toolkit_plugin}/utils/connection.py +0 -0
- {netbox_toolkit → netbox_toolkit_plugin}/utils/error_parser.py +0 -0
- {netbox_toolkit → netbox_toolkit_plugin}/utils/network.py +0 -0
- {netbox_toolkit_plugin-0.1.0.dist-info → netbox_toolkit_plugin-0.1.2.dist-info}/WHEEL +0 -0
- {netbox_toolkit_plugin-0.1.0.dist-info → netbox_toolkit_plugin-0.1.2.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,170 @@
|
|
1
|
+
{% extends 'generic/object.html' %}
|
2
|
+
{% load helpers %}
|
3
|
+
{% load static %}
|
4
|
+
|
5
|
+
{% block style %}
|
6
|
+
<link href="{% static 'netbox_toolkit_plugin/css/toolkit.css' %}" rel="stylesheet">
|
7
|
+
{% endblock %}
|
8
|
+
|
9
|
+
{% block content %}
|
10
|
+
<div class="row mb-3">
|
11
|
+
<div class="col col-md-6">
|
12
|
+
<div class="card">
|
13
|
+
<div class="card-header">
|
14
|
+
<h3 class="card-title">Command Log</h3>
|
15
|
+
</div>
|
16
|
+
<div class="card-body">
|
17
|
+
<table class="table table-hover attr-table">
|
18
|
+
<tr>
|
19
|
+
<th scope="row">Command</th>
|
20
|
+
<td>{{ object.command|linkify }}</td>
|
21
|
+
</tr>
|
22
|
+
<tr>
|
23
|
+
<th scope="row">Device</th>
|
24
|
+
<td>{{ object.device|linkify }}</td>
|
25
|
+
</tr>
|
26
|
+
<tr>
|
27
|
+
<th scope="row">Username</th>
|
28
|
+
<td>{{ object.username }}</td>
|
29
|
+
</tr>
|
30
|
+
<tr>
|
31
|
+
<th scope="row">Execution Time</th>
|
32
|
+
<td>{{ object.execution_time }}</td>
|
33
|
+
</tr>
|
34
|
+
<tr>
|
35
|
+
<th scope="row">Status</th>
|
36
|
+
<td>
|
37
|
+
{% if object.success %}
|
38
|
+
<span class="badge bg-success">Success</span>
|
39
|
+
{% else %}
|
40
|
+
<span class="badge bg-danger">Failed</span>
|
41
|
+
{% endif %}
|
42
|
+
</td>
|
43
|
+
</tr>
|
44
|
+
{% if object.execution_duration %}
|
45
|
+
<tr>
|
46
|
+
<th scope="row">Duration</th>
|
47
|
+
<td>{{ object.execution_duration|floatformat:3 }}s</td>
|
48
|
+
</tr>
|
49
|
+
{% endif %}
|
50
|
+
{% if object.parsing_success %}
|
51
|
+
<tr>
|
52
|
+
<th scope="row">Parsing Status</th>
|
53
|
+
<td>
|
54
|
+
<span class="badge bg-success">
|
55
|
+
<i class="mdi mdi-check-circle me-1"></i>
|
56
|
+
Successfully Parsed
|
57
|
+
</span>
|
58
|
+
{% if object.parsing_template %}
|
59
|
+
<br><small class="text-muted">Template: {{ object.parsing_template }}</small>
|
60
|
+
{% endif %}
|
61
|
+
</td>
|
62
|
+
</tr>
|
63
|
+
{% elif object.parsed_data is not None %}
|
64
|
+
<tr>
|
65
|
+
<th scope="row">Parsing Status</th>
|
66
|
+
<td>
|
67
|
+
<span class="badge bg-warning">
|
68
|
+
<i class="mdi mdi-alert-circle me-1"></i>
|
69
|
+
Parsing Attempted
|
70
|
+
</span>
|
71
|
+
</td>
|
72
|
+
</tr>
|
73
|
+
{% endif %}
|
74
|
+
{% if not object.success and object.error_message %}
|
75
|
+
<tr>
|
76
|
+
<th scope="row">Error</th>
|
77
|
+
<td><code>{{ object.error_message }}</code></td>
|
78
|
+
</tr>
|
79
|
+
{% endif %}
|
80
|
+
</table>
|
81
|
+
</div>
|
82
|
+
</div>
|
83
|
+
</div>
|
84
|
+
</div>
|
85
|
+
<div class="row">
|
86
|
+
<div class="col col-md-12">
|
87
|
+
<div class="card">
|
88
|
+
<div class="card-header">
|
89
|
+
<h3 class="card-title">Command Output</h3>
|
90
|
+
</div>
|
91
|
+
<div class="card-body">
|
92
|
+
<pre>{{ object.output }}</pre>
|
93
|
+
</div>
|
94
|
+
</div>
|
95
|
+
</div>
|
96
|
+
</div>
|
97
|
+
|
98
|
+
{% if object.parsed_data %}
|
99
|
+
<div class="row mt-3">
|
100
|
+
<div class="col col-md-12">
|
101
|
+
<div class="card">
|
102
|
+
<div class="card-header">
|
103
|
+
<h3 class="card-title">
|
104
|
+
<i class="mdi mdi-table me-1"></i>
|
105
|
+
Parsed Data
|
106
|
+
</h3>
|
107
|
+
{% if object.parsing_template %}
|
108
|
+
<div class="card-subtitle">
|
109
|
+
<small class="text-muted">Template: {{ object.parsing_template }}</small>
|
110
|
+
</div>
|
111
|
+
{% endif %}
|
112
|
+
</div>
|
113
|
+
<div class="card-body">
|
114
|
+
{% if object.parsed_data|length > 0 %}
|
115
|
+
{% if object.parsed_data.0 %}
|
116
|
+
<!-- Table format for structured data -->
|
117
|
+
<div class="table-responsive">
|
118
|
+
<table class="table table-sm table-striped">
|
119
|
+
<thead>
|
120
|
+
<tr>
|
121
|
+
{% for key in object.parsed_data.0.keys %}
|
122
|
+
<th>{{ key|title }}</th>
|
123
|
+
{% endfor %}
|
124
|
+
</tr>
|
125
|
+
</thead>
|
126
|
+
<tbody>
|
127
|
+
{% for row in object.parsed_data %}
|
128
|
+
<tr>
|
129
|
+
{% for value in row.values %}
|
130
|
+
<td>{{ value }}</td>
|
131
|
+
{% endfor %}
|
132
|
+
</tr>
|
133
|
+
{% endfor %}
|
134
|
+
</tbody>
|
135
|
+
</table>
|
136
|
+
</div>
|
137
|
+
{% else %}
|
138
|
+
<!-- JSON format for other data types -->
|
139
|
+
<pre class="bg-light p-3 rounded">{{ object.parsed_data|pprint }}</pre>
|
140
|
+
{% endif %}
|
141
|
+
{% else %}
|
142
|
+
<div class="alert alert-info mb-0">
|
143
|
+
<i class="mdi mdi-information-outline me-1"></i>
|
144
|
+
No structured data found in the output.
|
145
|
+
</div>
|
146
|
+
{% endif %}
|
147
|
+
|
148
|
+
<!-- Copy parsed data button -->
|
149
|
+
{% if object.parsed_data|length > 0 %}
|
150
|
+
{{ object.parsed_data|json_script:"commandlog-parsed-data-json" }}
|
151
|
+
<div class="mt-3">
|
152
|
+
<div class="btn-list">
|
153
|
+
<button type="button" class="btn btn-sm btn-outline-primary copy-parsed-btn"
|
154
|
+
title="Copy parsed data as JSON">
|
155
|
+
<i class="mdi mdi-content-copy me-1"></i>Copy Parsed Data
|
156
|
+
</button>
|
157
|
+
</div>
|
158
|
+
</div>
|
159
|
+
{% endif %}
|
160
|
+
</div>
|
161
|
+
</div>
|
162
|
+
</div>
|
163
|
+
</div>
|
164
|
+
{% endif %}
|
165
|
+
{% endblock %}
|
166
|
+
|
167
|
+
{% block javascript %}
|
168
|
+
<!-- Load NetBox Toolkit consolidated JavaScript -->
|
169
|
+
<script src="{% static 'netbox_toolkit_plugin/js/toolkit.js' %}"></script>
|
170
|
+
{% endblock %}
|