Version 0.5.5.93: custom fields in lists, MeshCentral sync flag for statuses

- Show custom field values in asset list, dashboard and list Excel export
- New status flag to exclude assets (e.g. scrapped) from MeshCentral sync
- Require a secure SESSION_SECRET with a readable startup message
- Add SESSION_COOKIE_SECURE and refresh session permissions per request
- Translate HTTP errors and remaining fixed UI texts

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
RolandandClaude Opus 5.5 committed 2026-11-17 22:06:56 +01:00
1 parent c3f1ef43db
commit 261b4f2029
35 files changed
+768 -308

No files matched your search

+2 -2
View File
@@ -1,10 +1,10 @@
<section class="chart-card">
<div class="chart-card-head">
<div><h3>{{ item.chart.name }}</h3>{% if item.chart.description %}<p>{{ item.chart.description }}</p>{% endif %}</div>
<span class="chart-total">{{ item.total }} Geräte</span>
<span class="chart-total">{{ t('charts.total_devices', count=item.total) }}</span>
</div>
{% if not item['items'] %}
<div class="chart-empty">Keine passenden Daten vorhanden.</div>
<div class="chart-empty">{{ t('charts.no_matching_data') }}</div>
{% elif item.chart.chart_type in ['donut', 'pie'] %}
<div class="donut-layout">
<div class="donut-chart {% if item.chart.chart_type == 'pie' %}pie-chart{% endif %}" style="background: conic-gradient({{ item.donut_gradient }})"><span>{{ item.total }}</span></div>
+1 -1
View File
@@ -1,6 +1,6 @@
{% extends 'base.html' %}{% block content %}
<h1>{% if duplicate_mode %}{{t('assets.duplicate')}}{% elif asset %}{{t('common.edit')}} {{t('app.assets')}}{% else %}{{t('assets.create')}}{% endif %}</h1>
{% if duplicate_mode %}<p class="notice">The original asset data was copied. Asset tag and MeshCentral node ID were cleared.</p>{% endif %}
{% if duplicate_mode %}<p class="notice">{{ t('assets.duplicate_notice') }}</p>{% endif %}
<form method="post" action="{% if duplicate_mode or not asset %}/assets/new{% else %}/assets/{{asset.id}}/edit{% endif %}" enctype="multipart/form-data" data-category-form>
<label>{{t('assets.category')}}<select name="category_id" onchange="location.href='{% if duplicate_mode %}/assets/new{% elif asset %}/assets/{{asset.id}}/edit{% else %}/assets/new{% endif %}?category_id='+this.value">{% for c in categories %}<option value="{{c.id}}" {% if selected and c.id==selected.id %}selected{% endif %}>{{c.name}}</option>{% endfor %}</select></label>
{% if selected %}{% for f in selected.visible_fields if f.active %}{% set d=f.definition %}{% set custom=d and not d.is_system %}{% set value=custom_values.get(f.field_name) if custom else (asset|attr(f.field_name) if asset else '') %}
+6 -6
View File
@@ -1,22 +1,22 @@
{% extends 'base.html' %}
{% block content %}
<div class="toolbar">
<h1>Historie: {{ asset.name }}</h1>
<h1>{{ t('history.title', name=asset.name) }}</h1>
<div class="toolbar-actions">
<a class="button button-secondary" href="/assets/{{ asset.id }}/history/export.xlsx">Excel exportieren</a>
<a class="button" href="/assets/{{ asset.id }}">Zurück zum Asset</a>
<a class="button button-secondary" href="/assets/{{ asset.id }}/history/export.xlsx">{{ t('assets.export_excel') }}</a>
<a class="button" href="/assets/{{ asset.id }}">{{ t('software.back_to_asset') }}</a>
</div>
</div>
<p class="table-hint">Jede geänderte Feldbezeichnung wird mit altem und neuem Wert gespeichert.</p>
<p class="table-hint">{{ t('history.hint') }}</p>
<div class="table-scroll">
<table class="data-table">
<thead><tr><th>Zeitpunkt</th><th>Quelle</th><th>Benutzer</th><th>Feld</th><th>Alter Wert</th><th>Neuer Wert</th></tr></thead>
<thead><tr><th>{{ t('history.changed_at') }}</th><th>{{ t('history.source') }}</th><th>{{ t('history.user') }}</th><th>{{ t('common.field') }}</th><th>{{ t('history.old_value') }}</th><th>{{ t('history.new_value') }}</th></tr></thead>
<tbody>
{% for entry in entries %}
{% for label, change in entry.changes.items() %}
<tr><td>{{ entry.changed_at }}</td><td>{{ entry.source }}</td><td>{{ entry.changed_by or '' }}</td><td>{{ label }}</td><td class="multiline">{{ change.old }}</td><td class="multiline">{{ change.new }}</td></tr>
{% endfor %}
{% else %}<tr><td colspan="6" class="empty-state">Noch keine Änderungen protokolliert.</td></tr>{% endfor %}
{% else %}<tr><td colspan="6" class="empty-state">{{ t('history.empty') }}</td></tr>{% endfor %}
</tbody>
</table>
</div>
+1 -1
View File
@@ -49,7 +49,7 @@
</label>
<label class="tree-filter-field">{{ t('tree.name_contains') }}
<input name="name_filter" value="{{ name_filter }}" placeholder="z. B. Dell">
<input name="name_filter" value="{{ name_filter }}" placeholder="{{ t('tree.name_filter_placeholder') }}">
</label>
<label class="tree-toggle-option">
+1 -1
View File
@@ -171,7 +171,7 @@
{% 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 %}
{% for f in fields %}{% set list_width = f.definition.list_width if f.definition and f.definition.list_width else (220 if f.field_name == 'name' else 180) %}<td data-field="{{ f.field_name }}" class="multiline" style="width:{{ list_width }}px;min-width:{{ list_width }}px;max-width:{{ list_width }}px">{% if f.field_name == 'name' %}<a href="/assets/{{ a.id }}">{{ a.name }}</a>{% else %}{{ a|attr(f.field_name) or '' }}{% endif %}</td>{% endfor %}
{% for f in fields %}{% set list_width = f.definition.list_width if f.definition and f.definition.list_width else (220 if f.field_name == 'name' else 180) %}<td data-field="{{ f.field_name }}" class="multiline" style="width:{{ list_width }}px;min-width:{{ list_width }}px;max-width:{{ list_width }}px">{% if f.field_name == 'name' %}<a href="/assets/{{ a.id }}">{{ a.name }}</a>{% elif f.definition and not f.definition.is_system %}{{ (custom_values_by_asset.get(a.id) or {}).get(f.field_name, '') }}{% else %}{{ a|attr(f.field_name) or '' }}{% endif %}</td>{% endfor %}
{% if job_filter %}{% set job_state = job_state_by_asset.get(a.id) %}
<td data-field="job_filter_status" style="width:180px;min-width:180px;max-width:180px"><span class="job-status job-status-{{ job_state.status }}">{{ t('software.status.' ~ job_state.status, t('assets.job_filter.never_run', 'Noch nie ausgeführt') if job_state.status == 'never_run' else job_state.status) }}</span>{% if job_filter.specs|length > 1 and job_state.job_label %}<small class="muted job-filter-source">{{ job_state.job_label }}</small>{% endif %}</td>
<td data-field="job_filter_last_execution" style="width:175px;min-width:175px;max-width:175px">{% if job_state.last_execution %}<time class="local-time" datetime="{{ utc_iso(job_state.last_execution) }}" data-utc="{{ utc_iso(job_state.last_execution) }}">{{ job_state.last_execution }}</time>{% else %}<span class="muted">—</span>{% endif %}</td>
+10 -10
View File
@@ -1,36 +1,36 @@
{% extends 'base.html' %}
{% block content %}
<div class="toolbar"><div><h1>Daten mehrerer Assets ändern</h1><p class="muted">Die Änderung wird auf {{ assets|length }} markierte Assets angewendet.</p></div><a class="button button-secondary" href="/assets{% if category_id %}?category_id={{ category_id }}{% endif %}">Abbrechen</a></div>
<div class="toolbar"><div><h1>{{ t('assets.bulk_edit.title') }}</h1><p class="muted">{{ t('assets.bulk_edit.applies_to', count=assets|length) }}</p></div><a class="button button-secondary" href="/assets{% if category_id %}?category_id={{ category_id }}{% endif %}">{{ t('common.cancel') }}</a></div>
<section class="panel bulk-edit-panel">
<form method="post" action="/assets/bulk-edit/apply" id="bulk-edit-apply-form">
{% for id in asset_ids %}<input type="hidden" name="asset_ids" value="{{ id }}">{% endfor %}
{% if category_id %}<input type="hidden" name="category_id" value="{{ category_id }}">{% endif %}
<div class="form-grid">
<label>Feld
<label>{{ t('common.field') }}
<select name="field_name" id="bulk-field" required>
<option value="">Bitte auswählen</option>
<option value="">{{ t('common.please_select') }}</option>
{% for field in fields %}<option value="{{ field.field_name }}">{{ field.label }}</option>{% endfor %}
</select>
</label>
<label>Neuer Wert
<label>{{ t('history.new_value') }}
<input name="new_value" id="bulk-value" autocomplete="off">
<select id="bulk-status-value" class="hidden-control">
<option value="">Leer / nicht gesetzt</option>
<option value="">{{ t('assets.bulk_edit.empty_value') }}</option>
{% for status in status_options %}<option value="{{ status.name }}">{{ status.name }}</option>{% endfor %}
</select>
<select id="bulk-parent-value" class="hidden-control">
<option value="">Kein übergeordnetes Gerät</option>
<option value="">{{ t('assets.bulk_edit.no_parent') }}</option>
{% for parent in parent_candidates %}<option value="{{ parent.id }}">{{ parent.name }}{% if parent.asset_tag %} – {{ parent.asset_tag }}{% endif %} ({{ parent.category.name }})</option>{% endfor %}
</select>
<select id="bulk-category-value" class="hidden-control">
<option value="">Bitte Kategorie auswählen</option>
<option value="">{{ t('assets.bulk_edit.select_category') }}</option>
{% for category in categories %}<option value="{{ category.id }}">{{ category.name }}</option>{% endfor %}
</select>
</label>
</div>
<p class="muted">Ein leerer Wert entfernt den bisherigen Wert. Inventarnummer, Seriennummer und MeshCentral Node-ID sind aus Sicherheitsgründen von der Massenänderung ausgeschlossen.</p>
<details><summary>Ausgewählte Assets anzeigen</summary><ul class="compact-list">{% for asset in assets %}<li>{{ asset.name }} <span class="muted">({{ asset.category.name }})</span></li>{% endfor %}</ul></details>
<div class="form-actions"><a class="button button-secondary" href="/assets{% if category_id %}?category_id={{ category_id }}{% endif %}">Abbrechen</a><button type="submit">💾 Für {{ assets|length }} Assets speichern</button></div>
<p class="muted">{{ t('assets.bulk_edit.help') }}</p>
<details><summary>{{ t('assets.bulk_edit.show_selected') }}</summary><ul class="compact-list">{% for asset in assets %}<li>{{ asset.name }} <span class="muted">({{ asset.category.name }})</span></li>{% endfor %}</ul></details>
<div class="form-actions"><a class="button button-secondary" href="/assets{% if category_id %}?category_id={{ category_id }}{% endif %}">{{ t('common.cancel') }}</a><button type="submit">💾 {{ t('assets.bulk_edit.save_for', count=assets|length) }}</button></div>
</form>
</section>
<script>
+16 -20
View File
@@ -2,12 +2,12 @@
{% block content %}
<div class="toolbar">
<h1>{{ t('assets.import_title') }}</h1>
<div class="toolbar-actions"><a class="button button-secondary" href="/assets">← Zur Asset-Liste</a></div>
<div class="toolbar-actions"><a class="button button-secondary" href="/assets">← {{ t('assets.import.back_to_list') }}</a></div>
</div>
<section class="panel">
<form method="post" action="/assets/import" enctype="multipart/form-data">
<label>Kategorie
<label>{{ t('common.category') }}
<select name="category_id" required>
{% for category in categories %}
<option value="{{ category.id }}" {% if selected and selected.id == category.id %}selected{% endif %}>{{ category.name }}</option>
@@ -19,48 +19,44 @@
<p><a class="button button-secondary" href="/assets/import/template.xlsx?category_id={{ selected.id }}">{{ t('assets.import_template') }}</a></p>
{% endif %}
<label>Excel-Datei
<label>{{ t('assets.import_file') }}
<input type="file" name="file" accept=".xlsx" required>
</label>
<label class="checkbox-label">
<input class="checkbox" type="checkbox" name="import_only_active_fields" {% if import_only_active_fields %}checked{% endif %}>
Import only active fields
{{ t('assets.import_only_active') }}
</label>
<p class="muted">
Standardmäßig werden alle bekannten und für den Excel-Import freigegebenen Felder übernommen,
auch wenn sie in der jeweiligen Kategorie nicht aktiv oder sichtbar sind.
Aktiviere diese Option nur, wenn der Import auf die aktiven Felder der Kategorie begrenzt werden soll.
</p>
<p class="muted">{{ t('assets.import_only_active_help') }}</p>
<div class="form-actions">
<button type="submit" class="button button-secondary" name="import_mode" value="dry_run">🧪 Test-Import</button>
<button type="submit" class="button button-secondary" name="import_mode" value="dry_run">🧪 {{ t('assets.import.dry_run') }}</button>
<button type="submit" class="button button-save" name="import_mode" value="import">{{ t('assets.import_start') }}</button>
</div>
<p class="muted">Der Test-Import prüft dieselbe Datei mit derselben Logik, führt aber am Ende einen vollständigen Datenbank-Rollback durch.</p>
<p class="muted">{{ t('assets.import.dry_run_help') }}</p>
</form>
</section>
{% if result %}
<section class="panel">
<h2>{% if result.dry_run %}Ergebnis des Test-Imports{% else %}Importergebnis{% endif %}</h2>
<h2>{% if result.dry_run %}{{ t('assets.import.dry_run_result') }}{% else %}{{ t('assets.import.result') }}{% endif %}</h2>
{% if result.dry_run %}
<div class="notice"><strong>Testlauf:</strong> Es wurden keine Daten gespeichert. Die Zähler und Zeilenergebnisse zeigen, was ein echter Import ausführen würde.</div>
<div class="notice"><strong>{{ t('assets.import.dry_run_label') }}</strong> {{ t('assets.import.dry_run_notice') }}</div>
{% endif %}
<dl class="config-list">
<dt>Neu angelegt</dt><dd>{{ result.created }}</dd>
<dt>Aktualisiert</dt><dd>{{ result.updated }}</dd>
<dt>Unverändert</dt><dd>{{ result.skipped }}</dd>
<dt>{{ t('assets.import.created') }}</dt><dd>{{ result.created }}</dd>
<dt>{{ t('assets.import.updated') }}</dt><dd>{{ result.updated }}</dd>
<dt>{{ t('assets.import.unchanged') }}</dt><dd>{{ result.skipped }}</dd>
</dl>
{% if result.unknown_headers %}
<h3>Nicht erkannte Spalten</h3>
<h3>{{ t('assets.import.unknown_columns') }}</h3>
<p>{{ result.unknown_headers|join(', ') }}</p>
{% endif %}
{% if result.row_results %}
<h3>Ergebnis je Excel-Zeile</h3>
<h3>{{ t('assets.import.row_results') }}</h3>
<div class="table-scroll">
<table class="data-table">
<thead><tr><th>Excel-Zeile</th><th>Asset-ID</th><th>Aktion</th><th>Begründung</th></tr></thead>
<thead><tr><th>{{ t('assets.import.excel_row') }}</th><th>{{ t('assets.asset_id') }}</th><th>{{ t('jobs.action') }}</th><th>{{ t('assets.import.reason') }}</th></tr></thead>
<tbody>
{% for row in result.row_results %}
<tr>
@@ -75,7 +71,7 @@
</div>
{% endif %}
{% if result.errors %}
<h3>Fehlerübersicht</h3>
<h3>{{ t('assets.import.error_summary') }}</h3>
<ul>{% for error in result.errors %}<li>{{ error }}</li>{% endfor %}</ul>
{% endif %}
</section>
+2 -2
View File
@@ -14,7 +14,7 @@
--am-warning:{{ colors.get('warning_color', '#d97706') }};
--am-danger:{{ colors.get('danger_color', '#b42318') }};
}
</style><script>(()=>{try{if(localStorage.getItem('assetmanager.sidebar.collapsed')==='true')document.documentElement.classList.add('sidebar-collapsed-preset')}catch(_){}})();</script><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>{{ title or general.get('title', 'AssetManager') }}</title>{% set favicon_path = general.get('favicon') or general.get('logo') %}{% if favicon_path %}<link rel="icon" href="{{ favicon_path }}">{% endif %}<link rel="stylesheet" href="/static/css/app.css?v={{ application_version() }}"><link rel="stylesheet" href="/custom.css"></head><body{% if request and request.url.path == '/assets' %} class="asset-list-scroll-page"{% endif %} data-record-count-template="{{ t('lists.record_count', 'Angezeigt: {visible} von {total} Datensätzen')|e }}" data-record-count-title="{{ t('lists.record_count_hint', 'Die Anzeige berücksichtigt die aktuell gesetzten Tabellenfilter.')|e }}" data-filter-active-label="{{ t('lists.filter_active', 'Filter aktiv')|e }}" data-filters-active-template="{{ t('lists.filters_active', '{count} Filter aktiv')|e }}" data-filter-status-template="{{ t('lists.filter_status', 'Gefiltert: {visible} von {total} Datensätzen')|e }}" data-clear-filters-label="{{ t('lists.clear_filters', 'Filter zurücksetzen')|e }}" data-row-number-label="{{ t('lists.row_number', 'Zeilennummer')|e }}" data-row-number-resize-label="{{ t('lists.row_number_resize', 'Ziehen, um die Breite der Nummernspalte zu ändern')|e }}" data-column-resize-label="{{ t('lists.column_resize', 'Ziehen, um die Spaltenbreite zu ändern')|e }}" data-multi-value-filter-hint="{{ t('lists.multi_value_filter_hint', 'Mehrere Suchwerte können zeilenweise eingefügt werden. Innerhalb einer Spalte gilt ODER.')|e }}" data-advanced-filter-title="{{ t('lists.advanced_filter.title')|e }}" data-advanced-filter-operator="{{ t('lists.advanced_filter.operator')|e }}" data-advanced-filter-value="{{ t('lists.advanced_filter.value')|e }}" data-advanced-filter-value-from="{{ t('lists.advanced_filter.value_from')|e }}" data-advanced-filter-value-to="{{ t('lists.advanced_filter.value_to')|e }}" data-advanced-filter-equal="{{ t('lists.advanced_filter.equal')|e }}" data-advanced-filter-gt="{{ t('lists.advanced_filter.gt')|e }}" data-advanced-filter-gte="{{ t('lists.advanced_filter.gte')|e }}" data-advanced-filter-lt="{{ t('lists.advanced_filter.lt')|e }}" data-advanced-filter-lte="{{ t('lists.advanced_filter.lte')|e }}" data-advanced-filter-range="{{ t('lists.advanced_filter.range')|e }}" data-advanced-filter-apply="{{ t('lists.advanced_filter.apply')|e }}" data-advanced-filter-clear="{{ t('lists.advanced_filter.clear')|e }}" data-advanced-filter-empty="{{ t('lists.advanced_filter.empty')|e }}" data-advanced-filter-not-empty="{{ t('lists.advanced_filter.not_empty')|e }}" data-persist-browser-state="{{ 'true' if session_user and session_user.persist_browser_state else 'false' }}" data-toast-position="{{ session_user.toast_position if session_user else 'top-right' }}" data-toast-duration="{{ session_user.toast_duration_seconds if session_user else 6 }}">
</style><script>(()=>{try{if(localStorage.getItem('assetmanager.sidebar.collapsed')==='true')document.documentElement.classList.add('sidebar-collapsed-preset')}catch(_){}})();</script><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>{{ title or general.get('title', 'AssetManager') }}</title>{% set favicon_path = general.get('favicon') or general.get('logo') %}{% if favicon_path %}<link rel="icon" href="{{ favicon_path }}">{% endif %}<link rel="stylesheet" href="/static/css/app.css?v={{ application_version() }}"><link rel="stylesheet" href="/custom.css"></head><body{% if request and request.url.path == '/assets' %} class="asset-list-scroll-page"{% endif %} data-record-count-template="{{ t('lists.record_count', 'Angezeigt: {visible} von {total} Datensätzen')|e }}" data-record-count-title="{{ t('lists.record_count_hint', 'Die Anzeige berücksichtigt die aktuell gesetzten Tabellenfilter.')|e }}" data-filter-active-label="{{ t('lists.filter_active', 'Filter aktiv')|e }}" data-filters-active-template="{{ t('lists.filters_active', '{count} Filter aktiv')|e }}" data-filter-status-template="{{ t('lists.filter_status', 'Gefiltert: {visible} von {total} Datensätzen')|e }}" data-clear-filters-label="{{ t('lists.clear_filters', 'Filter zurücksetzen')|e }}" data-row-number-label="{{ t('lists.row_number', 'Zeilennummer')|e }}" data-row-number-resize-label="{{ t('lists.row_number_resize', 'Ziehen, um die Breite der Nummernspalte zu ändern')|e }}" data-column-resize-label="{{ t('lists.column_resize', 'Ziehen, um die Spaltenbreite zu ändern')|e }}" data-multi-value-filter-hint="{{ t('lists.multi_value_filter_hint', 'Mehrere Suchwerte können zeilenweise eingefügt werden. Innerhalb einer Spalte gilt ODER.')|e }}" data-advanced-filter-title="{{ t('lists.advanced_filter.title')|e }}" data-advanced-filter-operator="{{ t('lists.advanced_filter.operator')|e }}" data-advanced-filter-value="{{ t('lists.advanced_filter.value')|e }}" data-advanced-filter-value-from="{{ t('lists.advanced_filter.value_from')|e }}" data-advanced-filter-value-to="{{ t('lists.advanced_filter.value_to')|e }}" data-advanced-filter-equal="{{ t('lists.advanced_filter.equal')|e }}" data-advanced-filter-gt="{{ t('lists.advanced_filter.gt')|e }}" data-advanced-filter-gte="{{ t('lists.advanced_filter.gte')|e }}" data-advanced-filter-lt="{{ t('lists.advanced_filter.lt')|e }}" data-advanced-filter-lte="{{ t('lists.advanced_filter.lte')|e }}" data-advanced-filter-range="{{ t('lists.advanced_filter.range')|e }}" data-advanced-filter-apply="{{ t('lists.advanced_filter.apply')|e }}" data-advanced-filter-clear="{{ t('lists.advanced_filter.clear')|e }}" data-advanced-filter-empty="{{ t('lists.advanced_filter.empty')|e }}" data-advanced-filter-not-empty="{{ t('lists.advanced_filter.not_empty')|e }}" data-persist-browser-state="{{ 'true' if session_user and session_user.persist_browser_state else 'false' }}" data-toast-position="{{ session_user.toast_position if session_user else 'top-right' }}" data-toast-duration="{{ session_user.toast_duration_seconds if session_user else 6 }}" data-toast-close-label="{{ t('common.close')|e }}">
<header class="main-header">
<a class="brand" href="/">{% if general.get('logo') %}<img src="{{ general.get('logo') }}" alt="Logo">{% endif %}<span>{{ general.get('title', 'AssetManager') }}</span>{% if general.get('company_name') %}<span class="brand-company">– {{ general.get('company_name') }}</span>{% endif %}</a>
@@ -31,7 +31,7 @@
{% endif %}
<button type="button" class="header-help-button" id="about-dialog-button" title="{{ t('about.open') }}" aria-label="{{ t('about.open') }}">?</button>
<details class="language-menu"><summary>🌐 {{ current_language|upper }} ▾</summary><div class="user-menu-panel">{% for language in available_languages() %}<form method="post" action="/profile/language"><input type="hidden" name="language_code" value="{{ language.code }}"><input type="hidden" name="next_url" value="{{ request.url.path }}{% if request.url.query %}?{{ request.url.query }}{% endif %}"><button type="submit" class="menu-button{% if language.code == current_language %} active{% endif %}">{{ language.native_name }}</button></form>{% endfor %}</div></details>
<details class="user-menu"><summary>👤 {{ session_user.display_name if session_user else t('app.guest') }} ▾</summary><div class="user-menu-panel">{% if session_user %}<a href="/profile">{{ t('app.profile') }}</a><a href="/logout">{{ t('app.logout') }}</a>{% else %}{% if auth.get('mode', 'none') == 'none' %}<span class="muted">Authentication disabled</span>{% endif %}<a href="/login">{{ t('app.login') }}</a>{% endif %}</div></details></div>
<details class="user-menu"><summary>👤 {{ session_user.display_name if session_user else t('app.guest') }} ▾</summary><div class="user-menu-panel">{% if session_user %}<a href="/profile">{{ t('app.profile') }}</a><a href="/logout">{{ t('app.logout') }}</a>{% else %}{% if auth.get('mode', 'none') == 'none' %}<span class="muted">{{ t('auth.disabled_short') }}</span>{% endif %}<a href="/login">{{ t('app.login') }}</a>{% endif %}</div></details></div>
</header>
{% if auth.get('mode', 'none') == 'none' %}
<div class="authentication-disabled-banner" role="status">
+1 -1
View File
@@ -37,7 +37,7 @@
</div>
</div>
<h2>{{ t('categories.fields_title') }}</h2>
<p class="muted">Labels, descriptions, data types and read-only settings are managed centrally under Settings → Fields.</p>
<p class="muted">{{ t('categories.fields_managed_centrally') }}</p>
<table class="data-table"><thead><tr><th>{{ t('common.active') }}</th><th>{{ t('categories.database_field') }}</th><th>{{ t('categories.display_name') }}</th><th>{{ t('categories.required') }}</th><th>{{ t('categories.in_list') }}</th><th>{{ t('categories.readonly') }}</th></tr></thead><tbody>
{% for definition in definitions %}{% set cfg=selected_fields.get(definition.field_name) %}
<tr><td><input class="checkbox" type="checkbox" name="active_{{definition.id}}" {% if (cfg and cfg.active) or definition.field_name == 'name' %}checked{% endif %}{% if definition.field_name == 'name' %} disabled{% endif %}></td>
+1 -1
View File
@@ -6,7 +6,7 @@
<h2>{{ t('dashboard.recently_changed') }}</h2>
<p class="table-hint">{{ t('dashboard.list_fields_hint') }}</p>
<div class="table-scroll sticky-table"><table class="data-table" id="dashboard-asset-table"><thead><tr><th>{{ t('assets.name') }}</th><th>{{ t('assets.category') }}</th>{% for f in fields if f.field_name != 'name' %}<th>{{ t('field.' ~ f.field_name, f.label) }}</th>{% endfor %}<th data-no-sort="1" data-no-filter="1">{{ t('common.actions') }}</th></tr></thead><tbody>
{% for a in assets %}<tr><td><a href="/assets/{{a.id}}">{{a.name}}</a></td><td>{{a.category.name}}</td>{% for f in fields if f.field_name != 'name' %}<td class="multiline">{{a|attr(f.field_name) or ''}}</td>{% endfor %}<td class="row-actions">{% if is_admin %}{% if issue_status_name and a.status == issue_status_name %}<form class="inline-form" method="post" action="/assets/{{a.id}}/return"><input type="hidden" name="return_to" value="dashboard"><button class="icon-button button-return" title="{{ t('assets.return') }}">↩</button></form>{% else %}<button type="button" class="icon-button button-issue" data-issue-action="/assets/{{a.id}}/issue" data-return-to="dashboard" title="{{ t('assets.issue') }}">↗</button>{% endif %}<a class="icon-button button-duplicate" href="/assets/{{a.id}}/duplicate" title="{{ t('assets.duplicate') }}">⧉</a><form class="inline-form" method="post" action="/assets/{{a.id}}/delete" onsubmit="return confirm({{ t('assets.delete_confirm', name=a.name)|tojson }});"><button class="icon-button button-danger" title="{{ t('common.delete') }}">🗑</button></form>{% else %}<span class="muted">{{ t('common.read_only') }}</span>{% endif %}</td></tr>{% else %}<tr><td colspan="40" class="empty-state">{{ t('assets.none') }}</td></tr>{% endfor %}
{% for a in assets %}<tr><td><a href="/assets/{{a.id}}">{{a.name}}</a></td><td>{{a.category.name}}</td>{% for f in fields if f.field_name != 'name' %}<td class="multiline">{% if f.definition and not f.definition.is_system %}{{ (custom_values_by_asset.get(a.id) or {}).get(f.field_name, '') }}{% else %}{{a|attr(f.field_name) or ''}}{% endif %}</td>{% endfor %}<td class="row-actions">{% if is_admin %}{% if issue_status_name and a.status == issue_status_name %}<form class="inline-form" method="post" action="/assets/{{a.id}}/return"><input type="hidden" name="return_to" value="dashboard"><button class="icon-button button-return" title="{{ t('assets.return') }}">↩</button></form>{% else %}<button type="button" class="icon-button button-issue" data-issue-action="/assets/{{a.id}}/issue" data-return-to="dashboard" title="{{ t('assets.issue') }}">↗</button>{% endif %}<a class="icon-button button-duplicate" href="/assets/{{a.id}}/duplicate" title="{{ t('assets.duplicate') }}">⧉</a><form class="inline-form" method="post" action="/assets/{{a.id}}/delete" onsubmit="return confirm({{ t('assets.delete_confirm', name=a.name)|tojson }});"><button class="icon-button button-danger" title="{{ t('common.delete') }}">🗑</button></form>{% else %}<span class="muted">{{ t('common.read_only') }}</span>{% endif %}</td></tr>{% else %}<tr><td colspan="40" class="empty-state">{{ t('assets.none') }}</td></tr>{% endfor %}
</tbody></table></div>
{% if is_admin %}<dialog id="issue-dialog"><form method="post" id="issue-form"><input type="hidden" name="return_to" id="issue-return-to"><h2>{{ t('assets.issue_asset') }}</h2><label>{{ t('common.name') }}<input name="assigned_to" required></label><label>{{ t('common.date') }}<input type="date" name="assigned_on" required></label><div class="form-actions"><button type="button" onclick="this.closest('dialog').close()">{{ t('common.cancel') }}</button><button type="submit">↗ {{ t('assets.issue') }}</button></div></form></dialog>{% endif %}<script src="/static/js/issue-dialog.js?v={{ application_version() }}"></script>
{% endblock %}
+2 -2
View File
@@ -9,7 +9,7 @@
<label class="script-only-field">{{ t('jobdefs.interpreter') }}<select name="interpreter" id="job-interpreter">{% for x in ['powershell','cmd','bash','python'] %}<option value="{{x}}" {% if definition and definition.interpreter==x %}selected{% endif %}>{{ t('jobdefs.interpreter.'~x,x) }}</option>{% endfor %}</select></label>
<label class="script-only-field">{{ t('jobdefs.source') }}<select name="source_type" id="job-source-type">{% for x in ['inline','mounted','unc'] %}<option value="{{x}}" {% if definition and definition.source_type==x %}selected{% endif %}>{{ t('jobdefs.source.'~x,x) }}</option>{% endfor %}</select></label>
<label class="form-wide">{{ t('common.description') }}<textarea name="description" rows="2">{{ definition.description if definition else '' }}</textarea></label>
<label class="form-wide job-source-path">{{ t('jobdefs.path') }}<input name="source_path" value="{{ definition.source_path if definition else '' }}" placeholder="/scripts/windows/example.ps1 oder \\server\share\script.ps1"><small>{{ t('jobdefs.path_help') }}</small></label>
<label class="form-wide job-source-path">{{ t('jobdefs.path') }}<input name="source_path" value="{{ definition.source_path if definition else '' }}" placeholder="{{ t('jobdefs.path_placeholder') }}"><small>{{ t('jobdefs.path_help') }}</small></label>
<div class="form-wide job-inline-script">
<label>{{ t('jobdefs.own_script') }}<textarea id="job-inline-script" name="inline_script" rows="18" spellcheck="false" class="code-editor">{{ definition.inline_script if definition else '' }}</textarea><small>{{ t('jobdefs.own_script_help') }}</small></label>
<div class="form-actions" style="margin-top:.75rem"><button class="button button-secondary" type="button" id="insert-job-test-script">{{ t('jobdefs.insert_test_commands') }}</button></div>
@@ -24,7 +24,7 @@
<div data-script-help="powershell">
<p>{{ t('jobdefs.script_help.powershell') }}</p>
<pre class="sync-log">$count = 3
Write-JobLog "Gefundene Dateien: $count"
Write-JobLog "Processed files: $count"
$JobResult["processed_count"] = $count</pre>
</div>
<div data-script-help="python">
+9 -9
View File
@@ -10,11 +10,11 @@
<form method="post" action="/sync/meshcentral/settings" class="compact-form">
<div class="form-grid">
<label class="checkbox-label"><input class="checkbox" type="checkbox" name="enabled" {% if config.meshcentral.enabled %}checked{% endif %}> {{ t('common.active') }}</label>
<label>WebSocket-URL<input name="url" value="{{config.meshcentral.url or ''}}" placeholder="wss://meshcentral.example.org:443"></label>
<label>{{ t('mesh.websocket_url') }}<input name="url" value="{{config.meshcentral.url or ''}}" placeholder="wss://meshcentral.example.org:443"></label>
<label>{{ t('mesh.username') }}<input name="username" value="{{config.meshcentral.username or ''}}"></label>
<label>{{ t('mesh.password_env') }}<input name="password_env" value="{{config.meshcentral.password_env or 'MESHCENTRAL_PASSWORD'}}"></label>
<label>Tenant<input name="tenant" value="{{config.meshcentral.tenant or ''}}"></label>
<label>meshctrl.js-Pfad<input name="meshctrl_path" value="{{config.meshcentral.meshctrl_path}}"></label>
<label>{{ t('mesh.meshctrl_path') }}<input name="meshctrl_path" value="{{config.meshcentral.meshctrl_path}}"></label>
<label>{{ t('mesh.timeout_seconds') }}<input type="number" min="10" max="3600" name="timeout_seconds" value="{{config.meshcentral.timeout_seconds or 600}}"></label>
</div>
<div class="checkbox-row">
@@ -91,7 +91,7 @@
<h2>3. {{ t('mesh.field_mappings') }}</h2>
<p class="muted">{{ t('mesh.mappings_help') }} {{ t('mesh.mappings_examples') }}: <code>node.osdesc</code>, <code>sys.hardware.windows.cpu[].Name</code>, <code>node.name|name</code>.</p>
<form method="post" action="/sync/meshcentral/mappings/save">
<div class="table-scroll management-table-scroll"><table class="data-table mesh-mapping-table"><thead><tr><th>{{ t('common.active') }}</th><th>{{ t('mesh.priority') }}</th><th>{{ t('mesh.target_field') }}</th><th>Source Path</th><th>{{ t('mesh.transformation') }}</th><th>{{ t('mesh.multi_values') }}</th><th>{{ t('mesh.separator') }}</th><th>{{ t('mesh.update_rule') }}</th><th>{{ t('common.description') }}</th><th></th></tr></thead><tbody>
<div class="table-scroll management-table-scroll"><table class="data-table mesh-mapping-table"><thead><tr><th>{{ t('common.active') }}</th><th>{{ t('mesh.priority') }}</th><th>{{ t('mesh.target_field') }}</th><th>{{ t('mesh.source_path') }}</th><th>{{ t('mesh.transformation') }}</th><th>{{ t('mesh.multi_values') }}</th><th>{{ t('mesh.separator') }}</th><th>{{ t('mesh.update_rule') }}</th><th>{{ t('common.description') }}</th><th></th></tr></thead><tbody>
{% for m in mappings %}
<tr>
<td><input type="checkbox" name="mapping_{{m.id}}_enabled" {% if m.enabled %}checked{% endif %}></td>
@@ -116,13 +116,13 @@
<p class="muted">{{ t('mesh.new_mapping_help') }}</p>
<form method="post" action="/sync/meshcentral/mappings/new" class="compact-form">
<div class="form-grid">
<label>Zielfeld<select name="target_field_name" required><option value="">{{ t('common.select') }}</option>{% for d in definitions %}<option value="{{d.field_name}}">{{d.label}} ({{d.field_name}}) – {{'System' if d.is_system else 'Custom'}}</option>{% endfor %}</select></label>
<label>Source Path<input name="source_path" required placeholder="node.example.path"></label>
<label>{{ t('mesh.target_field') }}<select name="target_field_name" required><option value="">{{ t('common.select') }}</option>{% for d in definitions %}<option value="{{d.field_name}}">{{d.label}} ({{d.field_name}}) – {{'System' if d.is_system else 'Custom'}}</option>{% endfor %}</select></label>
<label>{{ t('mesh.source_path') }}<input name="source_path" required placeholder="node.example.path"></label>
<label>Transformation<select name="transform">{% for v in transform_options %}<option value="{{v}}">{{v}}</option>{% endfor %}</select></label>
<label>Mehrfachwerte<select name="multi_value_mode"><option value="first">first</option><option value="join">join</option><option value="json">json</option><option value="count">count</option></select></label>
<label>Trennzeichen<input name="separator" value="\n"></label>
<label>Update-Regel<select name="update_rule"><option value="fill_empty">{{ t('mesh.rule_fill_empty') }}</option><option value="meshcentral_wins">{{ t('mesh.rule_mesh_wins') }}</option><option value="local_wins">{{ t('mesh.rule_local_wins') }}</option></select></label>
<label>Beschreibung<input name="description"></label>
<label>{{ t('mesh.multi_values') }}<select name="multi_value_mode"><option value="first">first</option><option value="join">join</option><option value="json">json</option><option value="count">count</option></select></label>
<label>{{ t('mesh.separator') }}<input name="separator" value="\n"></label>
<label>{{ t('mesh.update_rule') }}<select name="update_rule"><option value="fill_empty">{{ t('mesh.rule_fill_empty') }}</option><option value="meshcentral_wins">{{ t('mesh.rule_mesh_wins') }}</option><option value="local_wins">{{ t('mesh.rule_local_wins') }}</option></select></label>
<label>{{ t('common.description') }}<input name="description"></label>
<label class="checkbox-label"><input class="checkbox" type="checkbox" name="enabled" checked> {{ t('common.active') }}</label>
</div><button class="button button-save">+ {{ t('mesh.create_mapping') }}</button>
</form>
+4 -3
View File
@@ -1,8 +1,9 @@
{% extends 'base.html' %}{% block content %}
<div class="toolbar"><h1>{{ t('app.status_values') }}</h1></div><p>{{ t('status.help') }}</p>
<p class="muted">{{ t('status.software_list_help') }}</p>
<form method="post"><div class="table-scroll management-table-scroll"><table class="data-table"><thead><tr><th>{{ t('common.order') }}</th><th>{{ t('assets.status') }}</th><th>{{ t('common.active') }}</th><th>{{ t('status.on_issue') }}</th><th>{{ t('status.on_return') }}</th><th>{{ t('status.show_in_software_list') }}</th><th>{{ t('common.actions') }}</th></tr></thead><tbody>
{% for option in options %}<tr><td><input type="number" name="sort_{{option.id}}" value="{{option.sort_order}}"></td><td><input name="name_{{option.id}}" value="{{option.name}}" required></td><td><input class="checkbox" type="checkbox" name="active_{{option.id}}" {% if option.active %}checked{% endif %}></td><td><input type="radio" name="issue_status_id" value="{{ option.id }}" {% if option.use_for_issue %}checked{% endif %}></td><td><input type="radio" name="return_status_id" value="{{ option.id }}" {% if option.use_for_return %}checked{% endif %}></td><td><input class="checkbox" type="checkbox" name="software_list_{{option.id}}" {% if option.show_in_software_list %}checked{% endif %}></td><td><button formmethod="post" formaction="/status-options/{{option.id}}/delete" class="icon-button button-danger" onclick="return confirm({{ t('status.delete_confirm')|tojson }});">🗑</button></td></tr>{% endfor %}
<tr><td>{{ t('common.new') }}</td><td><input name="new_name" placeholder="{{ t('status.new_value') }}"></td><td colspan="3"></td><td><input class="checkbox" type="checkbox" name="new_show_in_software_list" checked></td><td></td></tr></tbody></table></div><div class="form-actions"><button class="button button-save" type="submit">💾 {{ t('common.save') }}</button></div></form>
<form method="post"><div class="table-scroll management-table-scroll"><table class="data-table"><thead><tr><th>{{ t('common.order') }}</th><th>{{ t('assets.status') }}</th><th>{{ t('common.active') }}</th><th>{{ t('status.on_issue') }}</th><th>{{ t('status.on_return') }}</th><th>{{ t('status.show_in_software_list') }}</th><th>{{ t('status.meshcentral_sync') }}</th><th>{{ t('common.actions') }}</th></tr></thead><tbody>
{% for option in options %}<tr><td><input type="number" name="sort_{{option.id}}" value="{{option.sort_order}}"></td><td><input name="name_{{option.id}}" value="{{option.name}}" required></td><td><input class="checkbox" type="checkbox" name="active_{{option.id}}" {% if option.active %}checked{% endif %}></td><td><input type="radio" name="issue_status_id" value="{{ option.id }}" {% if option.use_for_issue %}checked{% endif %}></td><td><input type="radio" name="return_status_id" value="{{ option.id }}" {% if option.use_for_return %}checked{% endif %}></td><td><input class="checkbox" type="checkbox" name="software_list_{{option.id}}" {% if option.show_in_software_list %}checked{% endif %}></td><td><input class="checkbox" type="checkbox" name="meshcentral_sync_{{option.id}}" {% if option.meshcentral_sync %}checked{% endif %}></td><td><button formmethod="post" formaction="/status-options/{{option.id}}/delete" class="icon-button button-danger" onclick="return confirm({{ t('status.delete_confirm')|tojson }});">🗑</button></td></tr>{% endfor %}
<tr><td>{{ t('common.new') }}</td><td><input name="new_name" placeholder="{{ t('status.new_value') }}"></td><td colspan="3"></td><td><input class="checkbox" type="checkbox" name="new_show_in_software_list" checked></td><td><input class="checkbox" type="checkbox" name="new_meshcentral_sync" checked></td><td></td></tr></tbody></table></div><div class="form-actions"><button class="button button-save" type="submit">💾 {{ t('common.save') }}</button></div></form>
<p class="form-help">{{ t('status.software_list_help') }}</p>
<p class="form-help">{{ t('status.meshcentral_sync_help') }}</p>
{% endblock %}