netbox-toolkit-plugin 0.1.0__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.
Files changed (56) hide show
  1. netbox_toolkit/__init__.py +30 -0
  2. netbox_toolkit/admin.py +16 -0
  3. netbox_toolkit/api/__init__.py +0 -0
  4. netbox_toolkit/api/mixins.py +54 -0
  5. netbox_toolkit/api/schemas.py +234 -0
  6. netbox_toolkit/api/serializers.py +158 -0
  7. netbox_toolkit/api/urls.py +10 -0
  8. netbox_toolkit/api/views/__init__.py +10 -0
  9. netbox_toolkit/api/views/command_logs.py +170 -0
  10. netbox_toolkit/api/views/commands.py +267 -0
  11. netbox_toolkit/config.py +159 -0
  12. netbox_toolkit/connectors/__init__.py +15 -0
  13. netbox_toolkit/connectors/base.py +97 -0
  14. netbox_toolkit/connectors/factory.py +301 -0
  15. netbox_toolkit/connectors/netmiko_connector.py +443 -0
  16. netbox_toolkit/connectors/scrapli_connector.py +486 -0
  17. netbox_toolkit/exceptions.py +36 -0
  18. netbox_toolkit/filtersets.py +85 -0
  19. netbox_toolkit/forms.py +31 -0
  20. netbox_toolkit/migrations/0001_initial.py +54 -0
  21. netbox_toolkit/migrations/0002_alter_command_options_alter_command_unique_together_and_more.py +66 -0
  22. netbox_toolkit/migrations/0003_permission_system_update.py +48 -0
  23. netbox_toolkit/migrations/0004_remove_django_permissions.py +77 -0
  24. netbox_toolkit/migrations/0005_alter_command_options_and_more.py +25 -0
  25. netbox_toolkit/migrations/0006_commandlog_parsed_data_commandlog_parsing_success_and_more.py +28 -0
  26. netbox_toolkit/migrations/0007_alter_commandlog_parsing_template.py +18 -0
  27. netbox_toolkit/migrations/__init__.py +0 -0
  28. netbox_toolkit/models.py +89 -0
  29. netbox_toolkit/navigation.py +30 -0
  30. netbox_toolkit/search.py +21 -0
  31. netbox_toolkit/services/__init__.py +7 -0
  32. netbox_toolkit/services/command_service.py +357 -0
  33. netbox_toolkit/services/device_service.py +87 -0
  34. netbox_toolkit/services/rate_limiting_service.py +228 -0
  35. netbox_toolkit/static/netbox_toolkit/css/toolkit.css +143 -0
  36. netbox_toolkit/static/netbox_toolkit/js/toolkit.js +657 -0
  37. netbox_toolkit/tables.py +37 -0
  38. netbox_toolkit/templates/netbox_toolkit/command.html +108 -0
  39. netbox_toolkit/templates/netbox_toolkit/command_edit.html +10 -0
  40. netbox_toolkit/templates/netbox_toolkit/command_list.html +12 -0
  41. netbox_toolkit/templates/netbox_toolkit/commandlog.html +170 -0
  42. netbox_toolkit/templates/netbox_toolkit/commandlog_list.html +4 -0
  43. netbox_toolkit/templates/netbox_toolkit/device_toolkit.html +536 -0
  44. netbox_toolkit/urls.py +22 -0
  45. netbox_toolkit/utils/__init__.py +1 -0
  46. netbox_toolkit/utils/connection.py +125 -0
  47. netbox_toolkit/utils/error_parser.py +428 -0
  48. netbox_toolkit/utils/logging.py +58 -0
  49. netbox_toolkit/utils/network.py +157 -0
  50. netbox_toolkit/views.py +385 -0
  51. netbox_toolkit_plugin-0.1.0.dist-info/METADATA +76 -0
  52. netbox_toolkit_plugin-0.1.0.dist-info/RECORD +56 -0
  53. netbox_toolkit_plugin-0.1.0.dist-info/WHEEL +5 -0
  54. netbox_toolkit_plugin-0.1.0.dist-info/entry_points.txt +2 -0
  55. netbox_toolkit_plugin-0.1.0.dist-info/licenses/LICENSE +200 -0
  56. netbox_toolkit_plugin-0.1.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,143 @@
1
+ /**
2
+ * NetBox Toolkit Plugin - Highly Optimized Styles
3
+ *
4
+ * This optimized version removes CSS duplication and leverages Tabler/NetBox
5
+ * built-in classes to improve maintainability and consistency.
6
+ *
7
+ * Total lines reduced from ~513 to ~131 lines (74% reduction)
8
+ *
9
+ * Most styles have been replaced with Tabler utility classes:
10
+ * - Layout: d-flex, flex-column, h-100
11
+ * - Tables: align-middle, border-0, fw-semibold, text-muted, font-monospace
12
+ * - Alerts: alert alert-primary with utility classes
13
+ * - Buttons: cursor-not-allowed via utility class
14
+ * - Spacing: mb-0, me-2, pt-3, etc.
15
+ */
16
+
17
+ /* ========================================
18
+ PLUGIN-SPECIFIC LAYOUT - REMOVED
19
+ ======================================== */
20
+
21
+ /* Layout classes replaced with Tabler utility classes:
22
+ - .toolkit-main-row -> removed (standard Bootstrap row)
23
+ - .left-column -> d-flex flex-column
24
+ - .output-card -> h-100
25
+ This section removed in favor of Tabler utilities */
26
+
27
+ /* ========================================
28
+ COMMAND OUTPUT DISPLAY
29
+ ======================================== */
30
+
31
+ /* Command output - specific styling for network device output */
32
+ .command-output {
33
+ min-height: 300px;
34
+ max-height: 600px;
35
+ overflow-y: auto;
36
+ white-space: pre-wrap;
37
+ font-size: 0.9rem;
38
+ }
39
+
40
+ /* Small font utility for connection info - avoids inline styles */
41
+ .text-xs {
42
+ font-size: 0.875rem;
43
+ }
44
+
45
+ /* ========================================
46
+ COMMAND LIST INTERFACE ENHANCEMENTS
47
+ ======================================== */
48
+
49
+ /* Command item specific styling that extends Tabler list-group */
50
+ .list-group-item.command-item {
51
+ white-space: nowrap;
52
+ overflow: hidden;
53
+ text-overflow: ellipsis;
54
+ transition: all 0.2s ease;
55
+ }
56
+
57
+ .list-group-item.command-item a {
58
+ color: inherit;
59
+ text-decoration: none;
60
+ flex-grow: 1;
61
+ }
62
+
63
+ .list-group-item.command-item a:hover {
64
+ color: var(--tblr-primary);
65
+ text-decoration: underline;
66
+ }
67
+
68
+ .card-commands {
69
+ max-height: 500px;
70
+ overflow-y: auto;
71
+ }
72
+
73
+ /* ========================================
74
+ COMMAND EXECUTION BUTTONS
75
+ ======================================== */
76
+
77
+ /* Command run button - plugin specific interaction */
78
+ .command-run-btn {
79
+ opacity: 0;
80
+ visibility: hidden;
81
+ transition: all 0.2s ease;
82
+ }
83
+
84
+ .command-item:hover .command-run-btn,
85
+ .command-item.active .command-run-btn {
86
+ opacity: 1;
87
+ visibility: visible;
88
+ }
89
+
90
+ /* Processing state indicator */
91
+ .command-run-btn[data-processing="true"] {
92
+ opacity: 1;
93
+ visibility: visible;
94
+ background-color: var(--tblr-warning) !important;
95
+ border-color: var(--tblr-warning) !important;
96
+ }
97
+
98
+ /* Copy button success state - temporary styling */
99
+ .copy-output-btn.copied,
100
+ .copy-parsed-btn.copied {
101
+ background-color: var(--tblr-success) !important;
102
+ border-color: var(--tblr-success) !important;
103
+ color: white !important;
104
+ }
105
+
106
+ /* ========================================
107
+ CONNECTION INFO STYLING - REMOVED
108
+ ======================================== */
109
+
110
+ /* Connection info styling now handled by Tabler utility classes in HTML:
111
+ - align-middle, border-0, fw-semibold, text-muted, font-monospace
112
+ - pt-3, border-top, mt-2 for footer styling
113
+ This section removed in favor of Tabler utilities */
114
+
115
+ /* ========================================
116
+ COMMAND WARNINGS & INDICATORS - REMOVED
117
+ ======================================== */
118
+
119
+ /* Config command warning now handled by Tabler utility classes:
120
+ - text-danger, me-2, opacity-75, plus inline style for font-size
121
+ - Hover states removed in favor of simpler UX
122
+ This section removed in favor of Tabler utilities */
123
+
124
+ /* ========================================
125
+ RUNNING COMMAND INDICATOR - REMOVED
126
+ ======================================== */
127
+
128
+ /* Running command indicator now handled by Tabler utility classes in JS:
129
+ - alert alert-primary d-flex align-items-center mb-0
130
+ - spinner-border spinner-border-sm with inline styles for dimensions
131
+ This section removed in favor of Tabler utilities */
132
+
133
+ /* ========================================
134
+ COLLAPSE ICON ANIMATION
135
+ ======================================== */
136
+
137
+ .collapse-icon {
138
+ transition: transform 0.3s;
139
+ }
140
+
141
+ .collapsed .collapse-icon {
142
+ transform: rotate(180deg);
143
+ }