14731 filtering

This commit is contained in:
Arthur Hanson 2024-07-08 14:23:11 +07:00
parent 7be752aba3
commit 577e9c7146
4 changed files with 28 additions and 2 deletions

View File

@ -34,6 +34,7 @@ class CertifiedPluginTable(BaseTable):
default_columns = (
'version', 'last_updated', 'min_version', 'max_version',
)
orderable = False
def render_last_updated(self, value, record):
return naturalday(datetime.fromisoformat(value))

View File

@ -671,7 +671,7 @@ def get_local_plugins(plugins):
'config_name': None,
'name': plugin_config.verbose_name,
'tag_line': plugin_config.description,
'description_short': None,
'description_short': plugin_config.description,
'author': plugin_config.author or _('Unknown Author'),
'version': plugin_config.version,
'icon': None,

View File

@ -54,7 +54,8 @@ From
</div>
<div class="tab-pane" id="version-history" role="tabpanel" aria-labelledby="version-history-tab">
<div class="card">
<div class="table-responsive" id="object_list">
<div class="htmx-container table-responsive" id="object_list">
{% include 'htmx/table.html' %}
</div>
</div>

View File

@ -20,6 +20,30 @@
{% block content %}
<p>{% trans "NetBox plugins enable you to document and model new kinds of resources, connect automations, add workflows, and much more." %}</p>
<div class="row mb-3" id="results">
<div class="col-auto d-print-none">
<div class="input-group input-group-flat me-2 quicksearch" hx-disinherit="hx-select hx-swap">
<input type="search" results="5" name="q" id="quicksearch" class="form-control" placeholder="{% trans "Quick search" %}"
hx-get="{{ request.full_path }}" hx-target="#object_list" hx-trigger="keyup changed delay:500ms, search"/>
<span class="input-group-text py-1">
<a href="#" id="quicksearch_clear" class="invisible text-secondary"><i class="mdi mdi-close-circle"></i></a>
</span>
</div>
</div>
<div class="col-auto ms-auto d-print-none">
{% if request.user.is_authenticated and table_modal %}
<div class="table-configure input-group">
<button type="button" data-bs-toggle="modal" title="{% trans "Configure Table" %}"
data-bs-target="#{{ table_modal }}"
class="btn">
<i class="mdi mdi-cog"></i> {% trans "Configure Table" %}
</button>
</div>
{% endif %}
</div>
</div>
{# System status #}
<div class="row mb-3">
{% for plugin in plugins %}