fix table with handling, icons implemented
This commit is contained in:
@@ -104,6 +104,7 @@
|
||||
<div class="table-scroll sticky-table" id="asset-table-scroll">
|
||||
<table class="data-table asset-table-fixed" id="asset-table" data-storage-key="asset-columns-{{ selected.id if selected else 'all' }}" data-fixed-column-width="{% if is_admin %}224{% else %}180{% endif %}">
|
||||
<thead><tr>
|
||||
<th class="asset-visual-column" data-no-sort="1" data-no-filter="1" data-field="asset_visual" data-label="{{ t('assets.device_visual', 'Gerät')|e }}" title="{{ t('assets.device_visual', 'Gerät')|e }}">{{ t('assets.device_visual', 'Gerät') }}</th>
|
||||
{% if is_admin %}<th class="selection-column" data-no-sort="1" data-no-filter="1"><input type="checkbox" id="select-all-assets" aria-label="{{ t('assets.select_all') }}"></th>{% endif %}
|
||||
{% set has_name = fields|selectattr('field_name', 'equalto', 'name')|list|length > 0 %}
|
||||
{% if not has_name %}<th draggable="true" data-field="name" data-column-width="220" data-label="{{ t('field.name', 'Bezeichnung')|e }}" style="width:220px;min-width:220px;max-width:220px">{{ t('field.name', 'Bezeichnung') }}</th>{% endif %}
|
||||
@@ -120,6 +121,26 @@
|
||||
</tr></thead>
|
||||
<tbody>
|
||||
{% for a in assets %}<tr data-platform="{{ asset_platforms.get(a.id, 'unknown') }}">
|
||||
<td class="asset-visual-column" data-field="asset_visual">
|
||||
<a href="/assets/{{ a.id }}" class="asset-visual-link" aria-label="{{ a.name|e }}">
|
||||
{% set visual_source = a.visual_source or 'auto' %}
|
||||
{% if visual_source == 'asset_image' %}
|
||||
{% if a.image_path %}<img src="{{ a.image_path }}" alt="" class="asset-list-device-image">{% else %}<span class="asset-list-device-placeholder" aria-hidden="true">▣</span>{% endif %}
|
||||
{% elif visual_source == 'category_image' %}
|
||||
{% if a.category and a.category.image_path %}<img src="{{ a.category.image_path }}" alt="" class="asset-list-device-image category-device-image" title="{{ a.category.name|e }}">{% else %}<span class="asset-list-device-placeholder" aria-hidden="true">▣</span>{% endif %}
|
||||
{% elif visual_source == 'mesh_icon' %}
|
||||
{% if a.mesh_icon and a.mesh_icon >= 1 and a.mesh_icon <= 8 %}<img src="/static/img/meshcentral-device-icons/icons256-{{ a.mesh_icon }}-1.png" alt="" class="asset-list-device-image meshcentral-device-icon" title="{{ t('assets.mesh_icon_title', 'MeshCentral-Geräte-Icon {icon}').format(icon=a.mesh_icon)|e }}">{% else %}<span class="asset-list-device-placeholder" aria-hidden="true">▣</span>{% endif %}
|
||||
{% elif a.image_path %}
|
||||
<img src="{{ a.image_path }}" alt="" class="asset-list-device-image">
|
||||
{% elif a.category and a.category.image_path %}
|
||||
<img src="{{ a.category.image_path }}" alt="" class="asset-list-device-image category-device-image" title="{{ a.category.name|e }}">
|
||||
{% elif a.mesh_icon and a.mesh_icon >= 1 and a.mesh_icon <= 8 %}
|
||||
<img src="/static/img/meshcentral-device-icons/icons256-{{ a.mesh_icon }}-1.png" alt="" class="asset-list-device-image meshcentral-device-icon" title="{{ t('assets.mesh_icon_title', 'MeshCentral-Geräte-Icon {icon}').format(icon=a.mesh_icon)|e }}">
|
||||
{% else %}
|
||||
<span class="asset-list-device-placeholder" aria-hidden="true">▣</span>
|
||||
{% endif %}
|
||||
</a>
|
||||
</td>
|
||||
{% if is_admin %}<td class="selection-column"><input type="checkbox" class="asset-select" value="{{ a.id }}" aria-label="{{ t('assets.select_named', 'Asset {name} markieren').format(name=a.name)|e }}"></td>{% endif %}
|
||||
{% if not has_name %}<td data-field="name"><a href="/assets/{{ a.id }}">{{ a.name }}</a></td>{% endif %}
|
||||
{% if not selected %}<td data-field="category">{{ a.category.name }}</td>{% endif %}
|
||||
|
||||
Reference in New Issue
Block a user