{% extends "base.html" %} {% macro inventory_label(label) -%} {%- set text = label|string -%} {{- t(text, text) if text.startswith('inventory.') else text -}} {%- endmacro %} {% macro inventory_icon(label) -%} {%- set key = (label|string)|lower -%} {%- if 'system_overview' in key or 'window' in key or key in ['computer', 'system', 'hardware'] -%}🖥️ {%- elif 'processor' in key or 'cpu' in key -%}🧠 {%- elif 'memory' in key or 'ram' in key -%}🧩 {%- elif 'storage' in key or 'drive' in key or 'disk' in key or 'volume' in key or 'partition' in key -%}💾 {%- elif 'graphic' in key or 'gpu' in key or 'video' in key or 'display' in key -%}🎨 {%- elif 'monitor' in key or 'screen' in key -%}🖥️ {%- elif 'network' in key or 'ethernet' in key or 'wifi' in key or 'adapter' in key or 'wlan' in key -%}🌐 {%- elif 'battery' in key -%}🔋 {%- elif 'bios' in key or 'uefi' in key or 'firmware' in key -%}⚙️ {%- elif 'board' in key or 'motherboard' in key or 'mainboard' in key -%}🔌 {%- elif 'audio' in key or 'sound' in key -%}🔊 {%- elif 'usb' in key -%}🔗 {%- elif 'printer' in key -%}🖨️ {%- elif 'software' in key or 'application' in key -%}📦 {%- elif 'os_' in key or 'operating' in key -%}🪟 {%- elif 'antivirus' in key or 'security' in key or 'tpm' in key -%}🛡️ {%- elif 'mesh' in key or 'agent' in key or 'connection' in key -%}🔗 {%- else -%}📁 {%- endif -%} {%- endmacro %} {% macro inventory_node(label, value, level=0, path='root') %} {% set node_path = path ~ '/' ~ (label|string)|replace(' ', '_')|replace('/', '_') %} {% if value is mapping %}
{{ inventory_label(label) }}{{ value|length }}
{% for key, child in value.items() %}{{ inventory_node(key, child, level + 1, node_path) }}{% endfor %}
{% elif value is sequence and value is not string %}
{{ inventory_label(label) }}{{ value|length }}
{% for child in value %} {% if child is mapping %}{% set child_label = child.get('inventory.property.name') or child.get('Name') or child.get('name') or child.get('Caption') or child.get('caption') or child.get('DeviceID') or child.get('Tag') or (t('inventory.entry', 'Entry') ~ ' ' ~ loop.index) %}{% else %}{% set child_label = t('inventory.entry', 'Entry') ~ ' ' ~ loop.index %}{% endif %} {{ inventory_node(child_label, child, level + 1, node_path) }} {% endfor %}
{% else %}
{{ inventory_label(label) }}{% if value == 'inventory.value.unknown' %}{{ t('inventory.value.unknown', 'Unknown') }}{% elif value is sameas true %}{{ t('common.yes') }}{% elif value is sameas false %}{{ t('common.no') }}{% else %}{{ value if value is not none and value != '' else '–' }}{% endif %}
{% endif %} {% endmacro %} {% block content %}

{{ asset.name }}

{% if asset.mesh_node_id %} {{ t('presence.' ~ (asset.mesh_online_state or 'unknown')) }} {% endif %} {% if is_admin %} {% if issue_status_name and asset.status == issue_status_name %}
{% else %}{% endif %} ⧉ {{ t('assets.duplicate') }}
✎ {{ t('common.edit') }} {% endif %} 🕘 {{ t('assets.history') }} ({{ history_count }})
{% if asset.image_path %}{% elif asset.category.image_path %}{% endif %}
{% for f in active_fields %}{% if f.field_name not in ['room_number', 'parent_asset_id'] %}{% set d=f.definition %}{% set v=custom_values.get(f.field_name) if d and not d.is_system else asset|attr(f.field_name) %}{% if v %}
{{ t(d.translation_key, d.label) if d else f.label }}
{{ v }}
{% endif %}{% endif %}{% endfor %}{% if asset.room_number %}
{{ t('assets.room') }}
{{ asset.room_number }}
{% endif %} {% if parent_asset %}
{{ t('assets.parent') }}
{{ parent_asset.name }}
{% endif %} {% if child_assets %}
{{ t('assets.child_assets') }}
{% for child in child_assets %}{{ child.name }}{% if not loop.last %}, {% endif %}{% endfor %}
{% endif %}
{% if is_admin %}

{{ t('mesh.link.section_title', 'MeshCentral link') }}

{{ t('mesh.link.section_help', 'The node ID can be changed manually without deleting the asset. Other asset fields are updated only by the next MeshCentral synchronization.') }}

{{ t('field.mesh_node_id', 'MeshCentral node ID') }}: {{ asset.mesh_node_id or '–' }} {% if asset.mesh_sync_status %}{{ t('assets.status', 'Status') }}: {{ t('mesh.sync_status.' ~ asset.mesh_sync_status, asset.mesh_sync_status) }}{% endif %}
{% endif %} {% if is_admin and asset.mesh_node_id %}

{{ t('jobs.run_definition', 'Job ausführen') }}

{{ t('jobs.run_definition_help', 'Es werden nur aktive Jobdefinitionen angezeigt, die zur erkannten Plattform dieses Assets passen.') }}

{% if job_definitions %}
{% else %} {{ t('jobs.no_compatible_definitions', 'Für diese Plattform ist keine aktive Jobdefinition verfügbar.') }} {% endif %}
{% endif %} {% if is_admin %}

{{ t('jobparams.asset_title') }}

{{ t('jobparams.asset_help') }}

{% if job_definitions %}
{% for definition in job_definitions %}
{{ definition.name }}{% if definition.description %}{{ definition.description }}{% endif %} {{ t('jobparams.parameter_count', count=definition.parameters|length) }} {% if definition.parameters %}
{% for parameter in definition.parameters %} {% set override = job_parameter_overrides.get(parameter.id) %}
{% endfor %}
{% else %}

{{ t('jobparams.none_defined') }}

{% endif %}
{% endfor %}
{% else %}

{{ t('jobs.no_compatible_definitions') }}

{% endif %}
{% endif %} {% if asset.mesh_node_id %}

{{ t('inventory.title') }}

{{ t('inventory.subtitle') }}

{{ t('inventory.download_json') }}
{{ t('mesh.node_id') }}: {{ asset.mesh_node_id }} {{ t('inventory.snapshot') }}: {% if asset.mesh_inventory_updated_at or asset.mesh_last_sync %}{% else %}{{ '–' }}{% endif %} {{ t('assets.status') }}: {% if asset.mesh_sync_status %}{{ t('mesh.sync_status.' ~ asset.mesh_sync_status, asset.mesh_sync_status) }}{% else %}{{ t('common.unknown') }}{% endif %} {{ t('presence.title') }}: {{ t('presence.' ~ (asset.mesh_online_state or 'unknown')) }} · {{ t('presence.updated') }}: {% if asset.mesh_presence_updated_at %}{% else %}{{ '–' }}{% endif %} · {{ t('presence.last_seen') }}: {% if asset.mesh_last_seen %}{% else %}{{ '–' }}{% endif %} · {{ t('presence.last_online') }}: {% if asset.mesh_last_online_at %}{% else %}{{ '–' }}{% endif %}
{% if hardware_inventory %}
{% for key, value in hardware_inventory.items() %}{{ inventory_node(key, value) }}{% endfor %}
{% else %}
{{ t('inventory.no_hardware') }}
{% endif %}

{{ t('software.installed') }}

{% if installed_software %}

{{ t('software.inventory_count', '{count} software entries stored.', count=installed_software|length) }}

{% else %}

{{ t('software.inventory_not_initialized') }}

{% endif %}
{% if is_admin %}
{% endif %}
{% if latest_software_job %}
{{ t('software.last_job') }}: #{{ latest_software_job.id }} {{ t('software.status') }}: {{ t('software.status.' ~ latest_software_job.status, latest_software_job.status) }} {{ t('software.last_inventory') }}: {% if latest_software_job.finished_at or latest_software_job.created_at %}{% else %}{{ '–' }}{% endif %}
{% endif %} {% if installed_software %}
{% if is_admin %}
{{ t('software.selected_count') }}: 0
{% endif %}
{% if is_admin %}{% endif %} {% for entry in installed_software %} {% if is_admin %}{% endif %} {% endfor %}
{{ t('common.name') }} {{ t('about.version') }} {{ t('software.publisher') }} {{ t('software.architecture') }} {{ t('software.platform') }} {{ t('software.install_date') }} {{ t('software.last_seen') }}
{{ entry.name }} {{ entry.version or '' }} {{ entry.publisher or '' }} {{ entry.architecture or '' }} {{ t('software.platform.' ~ (entry.platform or 'unknown'), entry.platform or 'unknown') }} {{ entry.install_date or '' }} {% if entry.last_seen_at %}{% else %}{{ '' }}{% endif %}
{% else %}
{{ t('software.inventory_not_initialized') }} {{ t('software.inventory_initialize_help') }}
{% endif %}
{% if raw_inventory %}
{{ raw_inventory|tojson(indent=2) }}
{% else %}
{{ t('inventory.no_raw_data') }}
{% endif %}
{{ t('mesh.last_sync') }}
{{ asset.mesh_last_sync or '–' }}
{{ t('mesh.message') }}
{{ asset.mesh_sync_message or '–' }}
{% if asset.mesh_conflicts %}

{{ t('mesh.field_conflicts') }}

{% for field, conflict in asset.mesh_conflicts.items() %}{% endfor %}
{{ t('common.field') }}{{ t('mesh.local_value') }}MeshCentral{{ t('mesh.rule') }}
{{ field }}{{ conflict.local }}{{ conflict.meshcentral }}{{ conflict.rule }}
{% endif %}
{% endif %} {% if is_admin %}

{{ t('assets.issue_asset') }}

{% endif %} {% endblock %}