mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-26 17:26:10 -06:00
Remove ManagedFile views
This commit is contained in:
parent
0d0e91102d
commit
adeb5e9162
@ -1,2 +1 @@
|
|||||||
from .data import *
|
from .data import *
|
||||||
from .files import *
|
|
||||||
|
@ -1,25 +0,0 @@
|
|||||||
import django_tables2 as tables
|
|
||||||
|
|
||||||
from core.models import *
|
|
||||||
from netbox.tables import NetBoxTable, columns
|
|
||||||
|
|
||||||
__all__ = (
|
|
||||||
'ManagedFileTable',
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
class ManagedFileTable(NetBoxTable):
|
|
||||||
file_path = tables.Column(
|
|
||||||
linkify=True
|
|
||||||
)
|
|
||||||
last_updated = columns.DateTimeColumn()
|
|
||||||
actions = columns.ActionsColumn(
|
|
||||||
actions=('delete',)
|
|
||||||
)
|
|
||||||
|
|
||||||
class Meta(NetBoxTable.Meta):
|
|
||||||
model = ManagedFile
|
|
||||||
fields = (
|
|
||||||
'pk', 'id', 'file_root', 'file_path', 'last_updated', 'size', 'hash',
|
|
||||||
)
|
|
||||||
default_columns = ('pk', 'file_root', 'file_path', 'last_updated')
|
|
@ -19,8 +19,4 @@ urlpatterns = (
|
|||||||
path('data-files/delete/', views.DataFileBulkDeleteView.as_view(), name='datafile_bulk_delete'),
|
path('data-files/delete/', views.DataFileBulkDeleteView.as_view(), name='datafile_bulk_delete'),
|
||||||
path('data-files/<int:pk>/', include(get_model_urls('core', 'datafile'))),
|
path('data-files/<int:pk>/', include(get_model_urls('core', 'datafile'))),
|
||||||
|
|
||||||
# Managed files
|
|
||||||
path('files/', views.ManagedFileListView.as_view(), name='managedfile_list'),
|
|
||||||
path('files/<int:pk>/', include(get_model_urls('core', 'managedfile'))),
|
|
||||||
|
|
||||||
)
|
)
|
||||||
|
@ -120,17 +120,3 @@ class DataFileBulkDeleteView(generic.BulkDeleteView):
|
|||||||
queryset = DataFile.objects.defer('data')
|
queryset = DataFile.objects.defer('data')
|
||||||
filterset = filtersets.DataFileFilterSet
|
filterset = filtersets.DataFileFilterSet
|
||||||
table = tables.DataFileTable
|
table = tables.DataFileTable
|
||||||
|
|
||||||
|
|
||||||
#
|
|
||||||
# Managed files
|
|
||||||
#
|
|
||||||
|
|
||||||
class ManagedFileListView(generic.ObjectListView):
|
|
||||||
queryset = ManagedFile.objects.all()
|
|
||||||
table = tables.ManagedFileTable
|
|
||||||
|
|
||||||
|
|
||||||
@register_model_view(ManagedFile)
|
|
||||||
class ManagedFileView(generic.ObjectView):
|
|
||||||
queryset = ManagedFile.objects.all()
|
|
||||||
|
@ -313,7 +313,6 @@ OTHER_MENU = Menu(
|
|||||||
get_model_item('extras', 'tag', 'Tags'),
|
get_model_item('extras', 'tag', 'Tags'),
|
||||||
get_model_item('extras', 'configcontext', _('Config Contexts'), actions=['add']),
|
get_model_item('extras', 'configcontext', _('Config Contexts'), actions=['add']),
|
||||||
get_model_item('extras', 'configtemplate', _('Config Templates'), actions=['add']),
|
get_model_item('extras', 'configtemplate', _('Config Templates'), actions=['add']),
|
||||||
get_model_item('core', 'managedfile', _('Managed Files'), actions=()),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -1,57 +0,0 @@
|
|||||||
{% extends 'generic/object.html' %}
|
|
||||||
{% load buttons %}
|
|
||||||
{% load custom_links %}
|
|
||||||
{% load helpers %}
|
|
||||||
{% load perms %}
|
|
||||||
{% load plugins %}
|
|
||||||
|
|
||||||
{% block controls %}
|
|
||||||
<div class="controls">
|
|
||||||
<div class="control-group">
|
|
||||||
{% plugin_buttons object %}
|
|
||||||
</div>
|
|
||||||
{% if request.user|can_delete:object %}
|
|
||||||
{% delete_button object %}
|
|
||||||
{% endif %}
|
|
||||||
<div class="control-group">
|
|
||||||
{% custom_links object %}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{% endblock controls %}
|
|
||||||
|
|
||||||
{% block content %}
|
|
||||||
<div class="row mb-3">
|
|
||||||
<div class="col">
|
|
||||||
<div class="card">
|
|
||||||
<h5 class="card-header">Managed File</h5>
|
|
||||||
<div class="card-body">
|
|
||||||
<table class="table table-hover attr-table">
|
|
||||||
<tr>
|
|
||||||
<th scope="row">Root</th>
|
|
||||||
<td>{{ object.get_file_root_display }}</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<th scope="row">Path</th>
|
|
||||||
<td>
|
|
||||||
<span class="font-monospace" id="datafile_path">{{ object.file_path }}</span>
|
|
||||||
<a class="btn btn-sm btn-primary copy-token" data-clipboard-target="#datafile_path" title="Copy to clipboard">
|
|
||||||
<i class="mdi mdi-content-copy"></i>
|
|
||||||
</a>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<th scope="row">Last Updated</th>
|
|
||||||
<td>{{ object.last_updated }}</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{% plugin_left_page object %}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="row mb-3">
|
|
||||||
<div class="col col-md-12">
|
|
||||||
{% plugin_full_width_page object %}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{% endblock %}
|
|
Loading…
Reference in New Issue
Block a user