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:
1 parent
c3f1ef43db
commit
261b4f2029
35 files changed
+768
-308
No files matched your search
@@ -3,6 +3,9 @@ POSTGRES_DB=assetmanager
|
|||||||
POSTGRES_USER=assetmanager
|
POSTGRES_USER=assetmanager
|
||||||
POSTGRES_PASSWORD=CHANGE_ME
|
POSTGRES_PASSWORD=CHANGE_ME
|
||||||
SESSION_SECRET=CHANGE_ME_LONG_RANDOM
|
SESSION_SECRET=CHANGE_ME_LONG_RANDOM
|
||||||
|
# Set to true once AssetManager is only reached through HTTPS (reverse proxy).
|
||||||
|
# Keep false for a first local start over plain HTTP, otherwise login fails.
|
||||||
|
SESSION_COOKIE_SECURE=false
|
||||||
MESHCENTRAL_PASSWORD=
|
MESHCENTRAL_PASSWORD=
|
||||||
LDAP_BIND_PASSWORD=
|
LDAP_BIND_PASSWORD=
|
||||||
LOCAL_ADMIN_USERNAME=emergency-admin
|
LOCAL_ADMIN_USERNAME=emergency-admin
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# AssetManager 0.5.5.92
|
# AssetManager 0.5.5.93
|
||||||
|
|
||||||
AssetManager is a self-hosted web application for managing IT equipment and other organizational assets. It provides asset inventory, software inventory, remote job execution, reporting, privacy/retention documentation, and optional integration with MeshCentral.
|
AssetManager is a self-hosted web application for managing IT equipment and other organizational assets. It provides asset inventory, software inventory, remote job execution, reporting, privacy/retention documentation, and optional integration with MeshCentral.
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,23 @@
|
|||||||
|
from typing import Any
|
||||||
|
|
||||||
|
from fastapi import HTTPException
|
||||||
|
|
||||||
|
|
||||||
|
class TranslatedHTTPException(HTTPException):
|
||||||
|
"""HTTP error carrying a translation key instead of fixed text.
|
||||||
|
|
||||||
|
The application exception handler translates the key into the language of
|
||||||
|
the current user. ``detail`` holds the English default so handlers without
|
||||||
|
translation support (for example the callback-only service) still return
|
||||||
|
readable text.
|
||||||
|
"""
|
||||||
|
|
||||||
|
def __init__(self, status_code: int, key: str, default: str, **values: Any) -> None:
|
||||||
|
try:
|
||||||
|
detail = default.format(**values)
|
||||||
|
except (KeyError, ValueError):
|
||||||
|
detail = default
|
||||||
|
super().__init__(status_code, detail)
|
||||||
|
self.translation_key = key
|
||||||
|
self.translation_default = default
|
||||||
|
self.translation_values = values
|
||||||
+240
@@ -109,6 +109,11 @@ BASE_TRANSLATIONS = {
|
|||||||
"status.help": ("Define which status is set when assets are issued and returned.", "Lege hier fest, welcher Status beim Ausgeben und Zurücknehmen gesetzt wird."),
|
"status.help": ("Define which status is set when assets are issued and returned.", "Lege hier fest, welcher Status beim Ausgeben und Zurücknehmen gesetzt wird."),
|
||||||
"status.on_issue": ("On issue", "Beim Ausgeben"), "status.on_return": ("On return", "Beim Zurücknehmen"),
|
"status.on_issue": ("On issue", "Beim Ausgeben"), "status.on_return": ("On return", "Beim Zurücknehmen"),
|
||||||
"status.show_in_software_list": ("In software lists", "In Softwarelisten"),
|
"status.show_in_software_list": ("In software lists", "In Softwarelisten"),
|
||||||
|
"status.meshcentral_sync": ("MeshCentral sync", "MeshCentral-Abgleich"),
|
||||||
|
"status.meshcentral_sync_help": (
|
||||||
|
"Assets whose status has 'MeshCentral sync' disabled (e.g. scrapped) are skipped by the MeshCentral sync: they are not updated, not reported as missing and no new asset is created for a matching device.",
|
||||||
|
"Assets mit einem Status ohne Haken bei 'MeshCentral-Abgleich' (z. B. verschrottet) werden beim MeshCentral-Abgleich übersprungen: Sie werden nicht aktualisiert, nicht als fehlend gemeldet und für ein passendes Gerät wird kein neues Asset angelegt."
|
||||||
|
),
|
||||||
"status.software_list_help": (
|
"status.software_list_help": (
|
||||||
"Only statuses with this option disabled are excluded from the global software lists. Assets without an assigned status remain included.",
|
"Only statuses with this option disabled are excluded from the global software lists. Assets without an assigned status remain included.",
|
||||||
"Nur Statuswerte ohne diesen Haken werden aus den globalen Softwarelisten ausgeschlossen. Assets ohne zugewiesenen Status bleiben enthalten."
|
"Nur Statuswerte ohne diesen Haken werden aus den globalen Softwarelisten ausgeschlossen. Assets ohne zugewiesenen Status bleiben enthalten."
|
||||||
@@ -1316,6 +1321,7 @@ BASE_TRANSLATIONS.update({
|
|||||||
"mesh.sync_status.created": ("Created", "Neu angelegt"),
|
"mesh.sync_status.created": ("Created", "Neu angelegt"),
|
||||||
"mesh.sync_status.conflict": ("Conflict", "Konflikt"),
|
"mesh.sync_status.conflict": ("Conflict", "Konflikt"),
|
||||||
"mesh.sync_status.missing": ("Missing in MeshCentral", "In MeshCentral nicht gefunden"),
|
"mesh.sync_status.missing": ("Missing in MeshCentral", "In MeshCentral nicht gefunden"),
|
||||||
|
"mesh.sync_status.excluded": ("Excluded from sync", "Vom Abgleich ausgenommen"),
|
||||||
"settings.ldap_debug_logging": ("Enable detailed LDAP debug logging", "Ausführliches LDAP-Debug-Protokoll aktivieren"),
|
"settings.ldap_debug_logging": ("Enable detailed LDAP debug logging", "Ausführliches LDAP-Debug-Protokoll aktivieren"),
|
||||||
"settings.ldap_debug_logging_help": ("When disabled, the LDAP log records only the searched username, whether it was found, and whether authentication succeeded. Enable this only temporarily for troubleshooting.", "Wenn deaktiviert, protokolliert LDAP nur den gesuchten Benutzernamen, ob er gefunden wurde und ob die Anmeldung erfolgreich war. Nur vorübergehend zur Fehlersuche aktivieren."),
|
"settings.ldap_debug_logging_help": ("When disabled, the LDAP log records only the searched username, whether it was found, and whether authentication succeeded. Enable this only temporarily for troubleshooting.", "Wenn deaktiviert, protokolliert LDAP nur den gesuchten Benutzernamen, ob er gefunden wurde und ob die Anmeldung erfolgreich war. Nur vorübergehend zur Fehlersuche aktivieren."),
|
||||||
|
|
||||||
@@ -1726,3 +1732,237 @@ BASE_TRANSLATIONS.update({
|
|||||||
"software.settings.remote_cleanup_hours_help": ("Job directories whose creation time is older than this value are treated as stale. Active jobs are excluded. Default: 24 hours (1 day).", "Jobverzeichnisse, deren Erstellzeit älter als dieser Wert ist, gelten als veraltet. Aktive Jobs werden ausgeschlossen. Standard: 24 Stunden (1 Tag)."),
|
"software.settings.remote_cleanup_hours_help": ("Job directories whose creation time is older than this value are treated as stale. Active jobs are excluded. Default: 24 hours (1 day).", "Jobverzeichnisse, deren Erstellzeit älter als dieser Wert ist, gelten als veraltet. Aktive Jobs werden ausgeschlossen. Standard: 24 Stunden (1 Tag)."),
|
||||||
"software.settings.remote_cleanup_paths": ("Managed job roots", "Verwaltete Jobpfade"),
|
"software.settings.remote_cleanup_paths": ("Managed job roots", "Verwaltete Jobpfade"),
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
# Previously hard-coded UI messages (HTTP errors, toasts, import results, templates).
|
||||||
|
BASE_TRANSLATIONS.update({
|
||||||
|
"assets.bulk_edit.applies_to": ("The change is applied to {count} selected assets.", "Die Änderung wird auf {count} markierte Assets angewendet."),
|
||||||
|
"assets.bulk_edit.empty_value": ("Empty / not set", "Leer / nicht gesetzt"),
|
||||||
|
"assets.bulk_edit.help": ("An empty value removes the previous value. Asset tag, serial number and MeshCentral node ID are excluded from bulk changes for safety reasons.", "Ein leerer Wert entfernt den bisherigen Wert. Inventarnummer, Seriennummer und MeshCentral Node-ID sind aus Sicherheitsgründen von der Massenänderung ausgeschlossen."),
|
||||||
|
"assets.bulk_edit.no_parent": ("No parent asset", "Kein übergeordnetes Gerät"),
|
||||||
|
"assets.bulk_edit.save_for": ("Save for {count} assets", "Für {count} Assets speichern"),
|
||||||
|
"assets.bulk_edit.select_category": ("Please select a category", "Bitte Kategorie auswählen"),
|
||||||
|
"assets.bulk_edit.show_selected": ("Show selected assets", "Ausgewählte Assets anzeigen"),
|
||||||
|
"assets.bulk_edit.title": ("Change data of multiple assets", "Daten mehrerer Assets ändern"),
|
||||||
|
"assets.duplicate_notice": ("The original asset data was copied. Asset tag and MeshCentral node ID were cleared.", "Die Daten des ursprünglichen Assets wurden kopiert. Inventarnummer und MeshCentral Node-ID wurden geleert."),
|
||||||
|
"assets.export": ("Export", "Export"),
|
||||||
|
"assets.export_download": ("Download assets as Excel", "Assets als Excel herunterladen"),
|
||||||
|
"assets.import": ("Import", "Import"),
|
||||||
|
"assets.import.action_error": ("Error", "Fehler"),
|
||||||
|
"assets.import.asset_id_invalid": ("Asset ID ‘{asset_id}’ is invalid.", "Asset-ID ‚{asset_id}‘ ist ungültig."),
|
||||||
|
"assets.import.asset_id_not_found": ("Asset ID {asset_id} was not found.", "Asset-ID {asset_id} wurde nicht gefunden."),
|
||||||
|
"assets.import.back_to_list": ("Back to asset list", "Zur Asset-Liste"),
|
||||||
|
"assets.import.category_not_found": ("Category ‘{category}’ was not found.", "Kategorie ‚{category}‘ wurde nicht gefunden."),
|
||||||
|
"assets.import.changed_fields": ("Changed fields: {fields}", "Geänderte Felder: {fields}"),
|
||||||
|
"assets.import.created": ("Created", "Neu angelegt"),
|
||||||
|
"assets.import.dry_run": ("Test import", "Test-Import"),
|
||||||
|
"assets.import.dry_run_help": ("The test import checks the same file with the same logic but rolls back the complete database transaction at the end.", "Der Test-Import prüft dieselbe Datei mit derselben Logik, führt aber am Ende einen vollständigen Datenbank-Rollback durch."),
|
||||||
|
"assets.import.dry_run_label": ("Test run:", "Testlauf:"),
|
||||||
|
"assets.import.dry_run_notice": ("No data was saved. The counters and row results show what a real import would do.", "Es wurden keine Daten gespeichert. Die Zähler und Zeilenergebnisse zeigen, was ein echter Import ausführen würde."),
|
||||||
|
"assets.import.dry_run_result": ("Test import result", "Ergebnis des Test-Imports"),
|
||||||
|
"assets.import.error_summary": ("Error summary", "Fehlerübersicht"),
|
||||||
|
"assets.import.excel_row": ("Excel row", "Excel-Zeile"),
|
||||||
|
"assets.import.name_missing": ("The name is missing for a new asset.", "Für ein neues Asset fehlt die Bezeichnung."),
|
||||||
|
"assets.import.new_in_category": ("New asset in category {category}", "Neues Asset in Kategorie {category}"),
|
||||||
|
"assets.import.no_changes": ("No changes; all filled-in values already match the record.", "Keine Änderungen; alle ausgefüllten Werte entsprechen bereits dem Datensatz."),
|
||||||
|
"assets.import.reason": ("Reason", "Begründung"),
|
||||||
|
"assets.import.result": ("Import result", "Importergebnis"),
|
||||||
|
"assets.import.row_error": ("Row {row}: {message}", "Zeile {row}: {message}"),
|
||||||
|
"assets.import.row_results": ("Result per Excel row", "Ergebnis je Excel-Zeile"),
|
||||||
|
"assets.import.skipped": ("Skipped", "Übersprungen"),
|
||||||
|
"assets.import.unchanged": ("Unchanged", "Unverändert"),
|
||||||
|
"assets.import.unique_violation": ("The new asset violates a uniqueness rule (for example asset tag, serial number or MeshCentral node ID).", "Das neue Asset verletzt eine Eindeutigkeitsregel (zum Beispiel Inventarnummer, Seriennummer oder MeshCentral Node-ID)."),
|
||||||
|
"assets.import.unknown_columns": ("Unrecognized columns", "Nicht erkannte Spalten"),
|
||||||
|
"assets.import.updated": ("Updated", "Aktualisiert"),
|
||||||
|
"assets.import_open": ("Open import", "Import öffnen"),
|
||||||
|
"assets.loading": ("Loading assets …", "Assets werden geladen …"),
|
||||||
|
"assets.toast.bulk_deleted": ("{count} assets deleted.", "{count} Assets gelöscht."),
|
||||||
|
"assets.toast.bulk_updated": ("{count} assets updated.", "{count} Assets aktualisiert."),
|
||||||
|
"auth.disabled_short": ("Authentication disabled", "Authentifizierung deaktiviert"),
|
||||||
|
"auth.invalid_credentials": ("Username or password is invalid.", "Benutzername oder Passwort ist ungültig."),
|
||||||
|
"auth.sign_in_disabled": ("Sign-in is currently disabled.", "Die Anmeldung ist derzeit deaktiviert."),
|
||||||
|
"auth.sign_in_first": ("Please sign in first.", "Bitte zuerst anmelden."),
|
||||||
|
"auth.sign_in_required": ("Sign-in required.", "Anmeldung erforderlich."),
|
||||||
|
"auth.sign_in_success": ("Signed in successfully.", "Anmeldung erfolgreich."),
|
||||||
|
"auth.signed_out": ("You have been signed out.", "Sie wurden abgemeldet."),
|
||||||
|
"categories.fields_managed_centrally": ("Labels, descriptions, data types and read-only settings are managed centrally under Settings → Fields.", "Bezeichnungen, Beschreibungen, Datentypen und Schreibschutz werden zentral unter Einstellungen → Felder verwaltet."),
|
||||||
|
"categories.toast.default_fields_activated": ("Default fields activated: {existing} existing and {created} new assignments.", "Standardfelder aktiviert: {existing} vorhandene und {created} neue Zuordnungen."),
|
||||||
|
"categories.toast.deleted": ("Category deleted.", "Kategorie wurde gelöscht."),
|
||||||
|
"categories.toast.duplicated": ("Category duplicated.", "Kategorie wurde dupliziert."),
|
||||||
|
"categories.toast.in_use": ("The category cannot be deleted: it is still used by {count} asset(s).", "Kategorie kann nicht gelöscht werden: Sie wird noch von {count} Asset(s) verwendet."),
|
||||||
|
"categories.toast.no_default_fields": ("No default fields are marked.", "Es sind keine Standardfelder markiert."),
|
||||||
|
"categories.toast.none_selected": ("No categories selected.", "Keine Kategorien ausgewählt."),
|
||||||
|
"charts.no_matching_data": ("No matching data available.", "Keine passenden Daten vorhanden."),
|
||||||
|
"charts.toast.created": ("Chart created.", "Diagramm angelegt."),
|
||||||
|
"charts.toast.deleted": ("Chart deleted.", "Diagramm gelöscht."),
|
||||||
|
"charts.toast.duplicated": ("Chart duplicated.", "Diagramm dupliziert."),
|
||||||
|
"charts.toast.saved": ("Chart saved.", "Diagramm gespeichert."),
|
||||||
|
"charts.toast.system_not_deletable": ("Default charts can be edited but not deleted.", "Standarddiagramme können bearbeitet, aber nicht gelöscht werden."),
|
||||||
|
"charts.total_devices": ("{count} devices", "{count} Geräte"),
|
||||||
|
"common.please_select": ("Please select", "Bitte auswählen"),
|
||||||
|
"duplicates.toast.merged": ("{count} duplicates were merged into asset {target}.", "{count} Duplikate wurden in Asset {target} zusammengeführt."),
|
||||||
|
"errors.admin_only": ("This function is only available to administrators.", "Diese Funktion ist nur für Administratoren verfügbar."),
|
||||||
|
"errors.analysis_metadata_unavailable": ("Analysis metadata is not available.", "Die Analyse-Metadaten sind nicht verfügbar."),
|
||||||
|
"errors.analysis_token_invalid": ("Invalid analysis token.", "Ungültiges Analyse-Token."),
|
||||||
|
"errors.analysis_unavailable": ("Analysis is no longer available.", "Die Analyse ist nicht mehr verfügbar."),
|
||||||
|
"errors.asset_not_found": ("Asset not found.", "Asset nicht gefunden."),
|
||||||
|
"errors.asset_not_found_or_forbidden": ("Asset not found or access denied.", "Asset nicht gefunden oder keine Berechtigung."),
|
||||||
|
"errors.asset_or_category_not_found": ("Asset or category not found.", "Asset oder Kategorie nicht gefunden."),
|
||||||
|
"errors.asset_save_unique": ("The asset could not be saved. The asset tag, serial number or MeshCentral node ID may already be in use.", "Asset konnte nicht gespeichert werden. Inventarnummer, Seriennummer oder MeshCentral Node-ID ist möglicherweise bereits vergeben."),
|
||||||
|
"errors.asset_tag_in_use": ("The asset tag {asset_tag} is already in use.", "Die Inventarnummer {asset_tag} ist bereits vergeben."),
|
||||||
|
"errors.bulk_field_not_allowed": ("The selected field is not allowed in all selected asset categories.", "Das gewählte Feld ist nicht in allen ausgewählten Gerätekategorien zugelassen."),
|
||||||
|
"errors.bulk_save_failed": ("The data could not be saved for all assets.", "Die Daten konnten nicht für alle Assets gespeichert werden."),
|
||||||
|
"errors.callback_part_too_large": ("{label} is too large.", "{label} ist zu groß."),
|
||||||
|
"errors.callback_token_expired": ("Callback token has expired.", "Callback-Token ist abgelaufen."),
|
||||||
|
"errors.callback_token_invalid": ("Invalid callback token.", "Ungültiger Callback-Token."),
|
||||||
|
"errors.cannot_delete_current_user": ("The currently signed-in user cannot be deleted.", "Der aktuell angemeldete Benutzer kann nicht gelöscht werden."),
|
||||||
|
"errors.cannot_delete_last_admin": ("The last active administrator cannot be deleted.", "Der letzte aktive Administrator kann nicht gelöscht werden."),
|
||||||
|
"errors.category_invalid": ("The category is invalid.", "Die Kategorie ist ungültig."),
|
||||||
|
"errors.category_not_found": ("Category not found.", "Kategorie nicht gefunden."),
|
||||||
|
"errors.category_save_unique": ("The category could not be saved. The category name may already exist.", "Kategorie konnte nicht gespeichert werden. Der Kategoriename ist möglicherweise bereits vorhanden."),
|
||||||
|
"errors.chart_invalid": ("Invalid chart configuration.", "Ungültige Diagrammkonfiguration."),
|
||||||
|
"errors.chart_name_exists": ("A chart with this name already exists.", "Ein Diagramm mit diesem Namen existiert bereits."),
|
||||||
|
"errors.chart_not_found": ("Chart not found.", "Diagramm nicht gefunden."),
|
||||||
|
"errors.chart_stack_required": ("A stacked chart requires a valid subdivision field.", "Für ein gestapeltes Diagramm ist eine gültige Unterteilung erforderlich."),
|
||||||
|
"errors.chart_value_mode_invalid": ("Invalid value display.", "Ungültige Wertedarstellung."),
|
||||||
|
"errors.compare_field_unsupported": ("Unsupported comparison selection field.", "Nicht unterstütztes Auswahlfeld für den Vergleich."),
|
||||||
|
"errors.data_type_locked": ("The data type can only be changed while the custom field has no stored values.", "Der Datentyp kann nur geändert werden, solange das eigene Feld keine gespeicherten Werte hat."),
|
||||||
|
"errors.excel_invalid": ("The Excel file is invalid or damaged.", "Die Excel-Datei ist ungültig oder beschädigt."),
|
||||||
|
"errors.excel_no_header": ("The Excel file has no header row.", "Die Excel-Datei enthält keine Kopfzeile."),
|
||||||
|
"errors.field_has_values": ("This field contains values for {count} assets. Confirm deletion of all values.", "Dieses Feld enthält Werte für {count} Assets. Bitte das Löschen aller Werte bestätigen."),
|
||||||
|
"errors.field_name_exists": ("A field with this name already exists.", "Ein Feld mit diesem Namen existiert bereits."),
|
||||||
|
"errors.field_name_invalid": ("The field name is invalid or already reserved.", "Der Feldname ist ungültig oder bereits reserviert."),
|
||||||
|
"errors.field_not_found": ("Field not found.", "Feld nicht gefunden."),
|
||||||
|
"errors.generator_action_unsupported": ("Unsupported generator action.", "Nicht unterstützte Generator-Aktion."),
|
||||||
|
"errors.http_status": ("HTTP error {status}", "HTTP-Fehler {status}"),
|
||||||
|
"errors.image_type_not_allowed": ("Only PNG, JPG, WEBP or GIF are allowed.", "Nur PNG, JPG, WEBP oder GIF sind erlaubt."),
|
||||||
|
"errors.import_duplicate_unique": ("The import could not be saved because of duplicate unique values.", "Der Import konnte wegen doppelter eindeutiger Werte nicht gespeichert werden."),
|
||||||
|
"errors.import_name_column_missing": ("The column ‘Name’ is missing.", "Die Spalte ‚Bezeichnung‘ bzw. ‚Name‘ fehlt."),
|
||||||
|
"errors.installer_empty": ("The uploaded installer is empty.", "Der hochgeladene Installer ist leer."),
|
||||||
|
"errors.installer_type_unsupported": ("Unsupported installer file type.", "Nicht unterstützter Installer-Dateityp."),
|
||||||
|
"errors.installer_unavailable": ("Installer file is no longer available.", "Die Installer-Datei ist nicht mehr verfügbar."),
|
||||||
|
"errors.internal_server_error": ("Internal server error", "Interner Serverfehler"),
|
||||||
|
"errors.interpreter_unsupported": ("Unsupported interpreter.", "Nicht unterstützter Interpreter."),
|
||||||
|
"errors.invalid_data_type": ("Invalid data type.", "Ungültiger Datentyp."),
|
||||||
|
"errors.invalid_fallback_category": ("Invalid fallback category.", "Ungültige Ersatzkategorie."),
|
||||||
|
"errors.invalid_integer": ("Invalid integer value for {field}.", "Ungültiger ganzzahliger Wert für {field}."),
|
||||||
|
"errors.invalid_job_parameters": ("Invalid job parameter definition.", "Ungültige Definition der Jobparameter."),
|
||||||
|
"errors.invalid_json": ("Invalid JSON.", "Ungültiges JSON."),
|
||||||
|
"errors.invalid_json_request": ("Invalid JSON request.", "Ungültige JSON-Anfrage."),
|
||||||
|
"errors.invalid_registry_entries": ("Invalid registry entry definition.", "Ungültige Definition der Registry-Einträge."),
|
||||||
|
"errors.job_not_found": ("Job not found.", "Job nicht gefunden."),
|
||||||
|
"errors.job_template_markers_invalid": ("Job script template markers are invalid.", "Die Markierungen der Jobskript-Vorlage sind ungültig."),
|
||||||
|
"errors.job_template_missing": ("Job script template is missing.", "Die Jobskript-Vorlage fehlt."),
|
||||||
|
"errors.json_object_expected": ("JSON object expected.", "JSON-Objekt erwartet."),
|
||||||
|
"errors.language_unsupported": ("Unsupported language.", "Nicht unterstützte Sprache."),
|
||||||
|
"errors.ldap_base_dn_missing": ("LDAP user base DN is not configured.", "LDAP Benutzer-Basis-DN ist nicht konfiguriert."),
|
||||||
|
"errors.ldap_bind_failed": ("LDAP bind failed: {error}", "LDAP Bind fehlgeschlagen: {error}"),
|
||||||
|
"errors.ldap_bind_password_missing": ("LDAP bind password is missing (environment variable {env_name}).", "LDAP-Bind-Passwort fehlt (Umgebungsvariable {env_name})."),
|
||||||
|
"errors.ldap_password_not_changeable": ("LDAP passwords cannot be changed here.", "LDAP-Passwörter können hier nicht geändert werden."),
|
||||||
|
"errors.ldap_query_failed": ("LDAP query failed.", "LDAP-Abfrage fehlgeschlagen."),
|
||||||
|
"errors.ldap_server_missing": ("LDAP server is not configured.", "LDAP-Server ist nicht konfiguriert."),
|
||||||
|
"errors.ldap_starttls_failed": ("LDAP StartTLS failed: {error}", "LDAP StartTLS fehlgeschlagen: {error}"),
|
||||||
|
"errors.mesh_category_mapping_invalid": ("Invalid category mapping for MeshCentral type {type_id}.", "Ungültige Kategoriezuordnung für MeshCentral-Typ {type_id}."),
|
||||||
|
"errors.mesh_category_unknown": ("Unknown category for MeshCentral type {type_id}.", "Unbekannte Kategorie für MeshCentral-Typ {type_id}."),
|
||||||
|
"errors.name_missing": ("Name is missing.", "Bezeichnung fehlt."),
|
||||||
|
"errors.new_password_too_short": ("The new password must be at least 8 characters long.", "Das neue Passwort muss mindestens 8 Zeichen lang sein."),
|
||||||
|
"errors.no_categories": ("No asset categories are available.", "Es sind keine Asset-Kategorien vorhanden."),
|
||||||
|
"errors.no_issue_status": ("No status is configured for the issue action.", "Kein Status für die Aktion Ausgeben konfiguriert."),
|
||||||
|
"errors.no_meshctrl_handler": ("No safe MeshCtrl handler is available for this operating system.", "Für dieses Betriebssystem ist kein sicherer MeshCtrl-Handler verfügbar."),
|
||||||
|
"errors.no_return_status": ("No status is configured for the return action.", "Kein Status für die Aktion Zurücknehmen konfiguriert."),
|
||||||
|
"errors.parent_cycle": ("This assignment would create a cycle in the asset tree.", "Diese Zuordnung würde einen Kreis in der Baumstruktur erzeugen."),
|
||||||
|
"errors.parent_cycle_asset": ("The assignment would create a cycle in the asset tree for asset {name}.", "Die Zuordnung würde beim Asset {name} einen Kreis in der Baumstruktur erzeugen."),
|
||||||
|
"errors.parent_in_selection": ("A selected asset cannot also be used as the parent asset for the whole selection.", "Ein ausgewähltes Asset kann nicht gleichzeitig als übergeordnetes Gerät für die gesamte Auswahl verwendet werden."),
|
||||||
|
"errors.parent_invalid": ("The parent asset is invalid.", "Das übergeordnete Gerät ist ungültig."),
|
||||||
|
"errors.parent_not_found": ("The selected parent asset was not found.", "Das gewählte übergeordnete Gerät wurde nicht gefunden."),
|
||||||
|
"errors.password_too_short": ("The password must be at least 8 characters long.", "Das Passwort muss mindestens 8 Zeichen lang sein."),
|
||||||
|
"errors.payload_directory_invalid": ("Invalid embedded payload directory.", "Ungültiges Verzeichnis für eingebettete Inhalte."),
|
||||||
|
"errors.payload_empty": ("Embedded payload is empty.", "Der eingebettete Inhalt ist leer."),
|
||||||
|
"errors.payload_unavailable": ("Embedded payload is no longer available.", "Der eingebettete Inhalt ist nicht mehr verfügbar."),
|
||||||
|
"errors.privacy_category_not_found": ("Privacy category not found.", "Datenschutzkategorie nicht gefunden."),
|
||||||
|
"errors.privacy_export_invalid": ("Privacy Excel export could not be validated: {error}", "Der Datenschutz-Excel-Export konnte nicht geprüft werden: {error}"),
|
||||||
|
"errors.select_at_least_one_asset": ("Please select at least one asset.", "Bitte mindestens ein Asset markieren."),
|
||||||
|
"errors.select_at_least_two_assets": ("Please select at least two assets.", "Bitte mindestens zwei Assets auswählen."),
|
||||||
|
"errors.select_category": ("Please select a category.", "Bitte eine Kategorie auswählen."),
|
||||||
|
"errors.select_two_different_assets": ("Select two different assets.", "Bitte zwei verschiedene Assets auswählen."),
|
||||||
|
"errors.select_xlsx": ("Please select an XLSX file.", "Bitte eine XLSX-Datei auswählen."),
|
||||||
|
"errors.selected_asset_not_found": ("At least one selected asset was not found.", "Mindestens ein ausgewähltes Asset wurde nicht gefunden."),
|
||||||
|
"errors.selected_category_not_found": ("The selected category was not found.", "Die gewählte Kategorie wurde nicht gefunden."),
|
||||||
|
"errors.selection_empty_or_incomplete": ("The selection is empty or no longer complete.", "Die Auswahl ist leer oder nicht mehr vollständig vorhanden."),
|
||||||
|
"errors.serial_in_use": ("The serial number {serial_number} already exists for manufacturer {manufacturer}.", "Die Seriennummer {serial_number} ist beim Hersteller {manufacturer} bereits vorhanden."),
|
||||||
|
"errors.standard_image_invalid": ("Invalid standard image selected.", "Ungültiges Standardbild ausgewählt."),
|
||||||
|
"errors.status_not_found": ("Status value not found.", "Statuswert nicht gefunden."),
|
||||||
|
"errors.status_not_unique": ("Status values must be unique.", "Statuswerte müssen eindeutig sein."),
|
||||||
|
"errors.sync_job_not_found": ("Synchronization job not found.", "Synchronisierungsauftrag nicht gefunden."),
|
||||||
|
"errors.system_field_not_deletable": ("System fields cannot be deleted.", "Systemfelder können nicht gelöscht werden."),
|
||||||
|
"errors.translation_import_key_column": ("The first Excel column must be Key.", "Die erste Excel-Spalte muss Key heißen."),
|
||||||
|
"errors.ui_state_invalid": ("Invalid UI state.", "Ungültiger UI-Zustand."),
|
||||||
|
"errors.ui_state_key_invalid": ("Invalid UI state key.", "Ungültiger UI-Zustandsschlüssel."),
|
||||||
|
"errors.ui_state_stored_too_large": ("The stored UI state is too large.", "Gespeicherter UI-Zustand ist zu groß."),
|
||||||
|
"errors.ui_state_too_large": ("The UI state is too large.", "UI-Zustand ist zu groß."),
|
||||||
|
"errors.ui_state_too_many": ("Too many UI states in one request.", "Zu viele UI-Zustände in einer Anfrage."),
|
||||||
|
"errors.unexpected": ("An unexpected error occurred. Details have been logged.", "Ein unerwarteter Fehler ist aufgetreten. Details wurden protokolliert."),
|
||||||
|
"errors.upload_too_large": ("Maximum upload size exceeded ({max_mb} MB).", "Maximale Uploadgröße überschritten ({max_mb} MB)."),
|
||||||
|
"errors.user_account_not_found": ("User account not found.", "Benutzerkonto wurde nicht gefunden."),
|
||||||
|
"errors.user_not_found": ("User not found.", "Benutzer nicht gefunden."),
|
||||||
|
"errors.username_exists": ("The username already exists.", "Der Benutzername ist bereits vorhanden."),
|
||||||
|
"errors.username_missing": ("Username is missing.", "Benutzername fehlt."),
|
||||||
|
"errors.value_mapping_incomplete": ("Incomplete value mapping in line {line}.", "Unvollständige Wertzuordnung in Zeile {line}."),
|
||||||
|
"errors.value_mapping_invalid": ("Invalid value mapping in line {line}. Expected: search text => display name", "Ungültige Wertzuordnung in Zeile {line}. Erwartet: Suchtext => Anzeigename"),
|
||||||
|
"fields.list_width": ("List width", "Listenbreite"),
|
||||||
|
"fields.list_width_hint": ("Initial column width in pixels in the asset list (40–800). Leave empty to use the standard width.", "Anfängliche Spaltenbreite in Pixeln in der Asset-Liste (40–800). Leer lassen für die Standardbreite."),
|
||||||
|
"fields.toast.created": ("Field created.", "Feld angelegt."),
|
||||||
|
"fields.toast.deleted": ("Field deleted.", "Feld gelöscht."),
|
||||||
|
"fields.toast.saved": ("Field saved.", "Feld gespeichert."),
|
||||||
|
"history.changed_at": ("Time", "Zeitpunkt"),
|
||||||
|
"history.empty": ("No changes recorded yet.", "Noch keine Änderungen protokolliert."),
|
||||||
|
"history.hint": ("Every changed field is recorded with its old and new value.", "Jede geänderte Feldbezeichnung wird mit altem und neuem Wert gespeichert."),
|
||||||
|
"history.new_value": ("New value", "Neuer Wert"),
|
||||||
|
"history.old_value": ("Old value", "Alter Wert"),
|
||||||
|
"history.source": ("Source", "Quelle"),
|
||||||
|
"history.title": ("History: {name}", "Historie: {name}"),
|
||||||
|
"history.user": ("User", "Benutzer"),
|
||||||
|
"inventory.android_unsupported": ("The MeshCentral Android agent currently provides no comparable RunCommand channel for this inventory.", "Der MeshCentral-Android-Agent stellt derzeit keinen vergleichbaren RunCommand-Kanal für diese Inventur bereit."),
|
||||||
|
"inventory.platform_unknown": ("The operating system could not be detected reliably.", "Das Betriebssystem konnte nicht sicher erkannt werden."),
|
||||||
|
"inventory.start_failed": ("The software inventory could not be started.", "Die Softwareinventur konnte nicht gestartet werden."),
|
||||||
|
"jobdefs.path_placeholder": ("/scripts/windows/example.ps1 or \\\\server\\share\\script.ps1", "/scripts/windows/example.ps1 oder \\\\server\\share\\script.ps1"),
|
||||||
|
"ldap.toast.import_result": ("{created} LDAP users created, {updated} updated, {skipped} skipped.", "{created} LDAP-Benutzer angelegt, {updated} aktualisiert, {skipped} übersprungen."),
|
||||||
|
"ldap.toast.none_selected": ("No users selected.", "Keine Benutzer ausgewählt."),
|
||||||
|
"mesh.meshctrl_path": ("meshctrl.js path", "meshctrl.js-Pfad"),
|
||||||
|
"mesh.mapping_not_found": ("Mapping rule not found.", "Mapping-Regel nicht gefunden."),
|
||||||
|
"mesh.source_path": ("Source path", "Quellpfad"),
|
||||||
|
"mesh.sync_already_running": ("A synchronization is already running.", "Es läuft bereits eine Synchronisierung."),
|
||||||
|
"mesh.sync_or_dry_run_running": ("A synchronization or dry run is already running.", "Es läuft bereits eine Synchronisierung oder ein Dry-Run."),
|
||||||
|
"mesh.toast.mapping_created": ("New mapping rule created.", "Neue Mapping-Regel angelegt."),
|
||||||
|
"mesh.toast.mapping_deleted": ("Mapping rule deleted.", "Mapping-Regel gelöscht."),
|
||||||
|
"mesh.toast.mapping_required": ("Source path and target field are required.", "Quellpfad und Zielfeld sind erforderlich."),
|
||||||
|
"mesh.toast.mappings_saved": ("Mapping rules saved.", "Mapping-Regeln gespeichert."),
|
||||||
|
"mesh.toast.settings_saved": ("MeshCentral settings saved.", "MeshCentral-Einstellungen gespeichert."),
|
||||||
|
"mesh.toast.system_mapping_not_deletable": ("System mappings can be disabled but not deleted.", "System-Mappings können deaktiviert, aber nicht gelöscht werden."),
|
||||||
|
"mesh.toast.target_field_invalid": ("The target field does not exist or is inactive.", "Das Zielfeld existiert nicht oder ist inaktiv."),
|
||||||
|
"mesh.websocket_url": ("WebSocket URL", "WebSocket-URL"),
|
||||||
|
"navigation.main": ("Main navigation", "Hauptnavigation"),
|
||||||
|
"navigation.toggle": ("Expand/collapse navigation", "Navigation ein-/ausklappen"),
|
||||||
|
"profile.toast.browser_state_disabled": ("Browser storage disabled.", "Browserspeicherung deaktiviert."),
|
||||||
|
"profile.toast.browser_state_enabled": ("Browser storage enabled.", "Browserspeicherung aktiviert."),
|
||||||
|
"profile.toast.current_password_wrong": ("The current password is incorrect.", "Das aktuelle Passwort ist falsch."),
|
||||||
|
"profile.toast.password_changed": ("Password changed.", "Passwort geändert."),
|
||||||
|
"profile.toast.password_local_only": ("Passwords can only be changed for local accounts.", "Passwortänderungen sind nur für lokale Konten möglich."),
|
||||||
|
"profile.toast.toast_settings_saved": ("Notification settings saved.", "Toast-Einstellungen gespeichert."),
|
||||||
|
"settings.backup": ("Backup", "Sicherung"),
|
||||||
|
"settings.import_export": ("Import / Export", "Import / Export"),
|
||||||
|
"assets.loading_hint": ("Preparing the table view and saved settings.", "Tabellenansicht und gespeicherte Einstellungen werden vorbereitet."),
|
||||||
|
"settings.export_help": ("Download the current asset inventory with asset ID and all exportable fields.", "Den aktuellen Assetbestand mit Asset-ID und allen exportierbaren Feldern herunterladen."),
|
||||||
|
"settings.import_export_help": ("Export assets as an Excel file or import them from an Excel file.", "Assets als Excel-Datei exportieren oder aus einer Excel-Datei importieren."),
|
||||||
|
"settings.import_help": ("Update existing assets by asset ID and create new assets without an asset ID.", "Vorhandene Assets über die Asset-ID aktualisieren und neue Assets ohne Asset-ID anlegen."),
|
||||||
|
"settings.ldap": ("LDAP", "LDAP"),
|
||||||
|
"settings.meshcentral": ("MeshCentral", "MeshCentral"),
|
||||||
|
"settings.toast.saved": ("Settings saved.", "Einstellungen gespeichert."),
|
||||||
|
"software.compare.select_two": ("Select exactly two assets for the software comparison.", "Für den Softwarevergleich genau zwei Assets auswählen."),
|
||||||
|
"translations.toast.imported": ("{count} translations imported.", "{count} Übersetzungen importiert."),
|
||||||
|
"translations.toast.updated": ("Translations updated.", "Übersetzungen aktualisiert."),
|
||||||
|
"tree.name_filter_placeholder": ("e.g. Dell", "z. B. Dell"),
|
||||||
|
"users.toast.created": ("User created.", "Benutzer angelegt."),
|
||||||
|
"users.toast.deleted": ("User deleted.", "Benutzer gelöscht."),
|
||||||
|
"users.toast.saved": ("User saved.", "Benutzer gespeichert."),
|
||||||
|
})
|
||||||
+363
-223
File diff suppressed because it is too large.
Load diff
+26
-1
@@ -11,7 +11,7 @@ from sqlalchemy import func
|
|||||||
from sqlalchemy.orm import Session
|
from sqlalchemy.orm import Session
|
||||||
|
|
||||||
from .config import load_config
|
from .config import load_config
|
||||||
from .models import Asset, AssetHistory, Category, SyncRun, FieldDefinition, AssetFieldValue, MeshFieldMapping
|
from .models import Asset, AssetHistory, Category, SyncRun, FieldDefinition, AssetFieldValue, MeshFieldMapping, StatusOption
|
||||||
from .fields import ASSET_FIELDS
|
from .fields import ASSET_FIELDS
|
||||||
|
|
||||||
|
|
||||||
@@ -1074,6 +1074,16 @@ def synchronize(db: Session, log: Callable[[str, str], None] | None = None, *, d
|
|||||||
definition.field_name: definition
|
definition.field_name: definition
|
||||||
for definition in db.query(FieldDefinition).filter(FieldDefinition.is_active.is_(True)).all()
|
for definition in db.query(FieldDefinition).filter(FieldDefinition.is_active.is_(True)).all()
|
||||||
}
|
}
|
||||||
|
# Assets whose status has the MeshCentral sync disabled (e.g. scrapped
|
||||||
|
# devices) are neither updated nor reported as missing.
|
||||||
|
excluded_statuses = {
|
||||||
|
name for (name,) in db.query(StatusOption.name).filter(StatusOption.meshcentral_sync.is_(False)).all()
|
||||||
|
}
|
||||||
|
excluded_count = 0
|
||||||
|
|
||||||
|
def mark_excluded(asset: Asset) -> None:
|
||||||
|
asset.mesh_sync_status = "excluded"
|
||||||
|
asset.mesh_sync_message = f"Status '{asset.status}' ist vom MeshCentral-Abgleich ausgenommen"
|
||||||
|
|
||||||
try:
|
try:
|
||||||
log("info", f"{len(mapping_rows)} aktive Feld-Mapping(s) geladen.")
|
log("info", f"{len(mapping_rows)} aktive Feld-Mapping(s) geladen.")
|
||||||
@@ -1091,6 +1101,8 @@ def synchronize(db: Session, log: Callable[[str, str], None] | None = None, *, d
|
|||||||
log("error", f"Systemfeld '{target}' besitzt keine Asset-Datenbankspalte und wird übersprungen.")
|
log("error", f"Systemfeld '{target}' besitzt keine Asset-Datenbankspalte und wird übersprungen.")
|
||||||
run.error_count += 1
|
run.error_count += 1
|
||||||
log("info", "Dry-Run gestartet; es werden keine Datenbankänderungen gespeichert." if dry_run else "Synchronisierung gestartet.")
|
log("info", "Dry-Run gestartet; es werden keine Datenbankänderungen gespeichert." if dry_run else "Synchronisierung gestartet.")
|
||||||
|
if excluded_statuses:
|
||||||
|
log("info", "Vom Abgleich ausgenommene Status: " + ", ".join(sorted(excluded_statuses)))
|
||||||
log("info", "Asset-Zuordnung: " + " → ".join(cfg.get("match_order", ["node_id", "mac_address", "serial_number"])))
|
log("info", "Asset-Zuordnung: " + " → ".join(cfg.get("match_order", ["node_id", "mac_address", "serial_number"])))
|
||||||
if cfg.get("serial_match_manufacturer", False):
|
if cfg.get("serial_match_manufacturer", False):
|
||||||
log("info", "Seriennummern-Abgleich erfordert zusätzlich einen normalisierten Herstellervergleich.")
|
log("info", "Seriennummern-Abgleich erfordert zusätzlich einen normalisierten Herstellervergleich.")
|
||||||
@@ -1162,6 +1174,13 @@ def synchronize(db: Session, log: Callable[[str, str], None] | None = None, *, d
|
|||||||
run.conflict_count += 1
|
run.conflict_count += 1
|
||||||
log("warning", f"{mapped.get('name', node_id)}: {match_error}")
|
log("warning", f"{mapped.get('name', node_id)}: {match_error}")
|
||||||
continue
|
continue
|
||||||
|
if asset is not None and asset.status in excluded_statuses:
|
||||||
|
# Matched an excluded asset: do not update it and do not
|
||||||
|
# create a duplicate asset for this device either.
|
||||||
|
excluded_count += 1
|
||||||
|
mark_excluded(asset)
|
||||||
|
log("info", f"{asset.name}: Status '{asset.status}' ist vom Abgleich ausgenommen; Gerät '{mapped.get('name', node_id)}' wird übersprungen.")
|
||||||
|
continue
|
||||||
is_new = asset is None
|
is_new = asset is None
|
||||||
if asset is None:
|
if asset is None:
|
||||||
if not cfg.get("create_missing_assets", True):
|
if not cfg.get("create_missing_assets", True):
|
||||||
@@ -1288,10 +1307,16 @@ def synchronize(db: Session, log: Callable[[str, str], None] | None = None, *, d
|
|||||||
linked = db.query(Asset).filter(Asset.mesh_node_id.isnot(None)).all()
|
linked = db.query(Asset).filter(Asset.mesh_node_id.isnot(None)).all()
|
||||||
for asset in linked:
|
for asset in linked:
|
||||||
if asset.mesh_node_id not in seen_node_ids:
|
if asset.mesh_node_id not in seen_node_ids:
|
||||||
|
if asset.status in excluded_statuses:
|
||||||
|
excluded_count += 1
|
||||||
|
mark_excluded(asset)
|
||||||
|
continue
|
||||||
asset.mesh_sync_status = "missing"
|
asset.mesh_sync_status = "missing"
|
||||||
asset.mesh_sync_message = "Beim letzten MeshCentral-Import nicht gefunden"
|
asset.mesh_sync_message = "Beim letzten MeshCentral-Import nicht gefunden"
|
||||||
log("warning", f"{asset.name}: in MeshCentral nicht mehr gefunden.")
|
log("warning", f"{asset.name}: in MeshCentral nicht mehr gefunden.")
|
||||||
|
|
||||||
|
if excluded_count:
|
||||||
|
log("info", f"{excluded_count} Asset(s) wegen ihres Status vom Abgleich ausgenommen.")
|
||||||
run.status = "success" if run.error_count == 0 else "partial"
|
run.status = "success" if run.error_count == 0 else "partial"
|
||||||
run.finished_at = datetime.utcnow()
|
run.finished_at = datetime.utcnow()
|
||||||
if dry_run:
|
if dry_run:
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ STATUS_COLUMNS = {
|
|||||||
"use_for_issue": "BOOLEAN DEFAULT FALSE",
|
"use_for_issue": "BOOLEAN DEFAULT FALSE",
|
||||||
"use_for_return": "BOOLEAN DEFAULT FALSE",
|
"use_for_return": "BOOLEAN DEFAULT FALSE",
|
||||||
"show_in_software_list": "BOOLEAN NOT NULL DEFAULT TRUE",
|
"show_in_software_list": "BOOLEAN NOT NULL DEFAULT TRUE",
|
||||||
|
"meshcentral_sync": "BOOLEAN NOT NULL DEFAULT TRUE",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -194,6 +194,9 @@ class StatusOption(Base):
|
|||||||
use_for_issue: Mapped[bool] = mapped_column(Boolean, default=False)
|
use_for_issue: Mapped[bool] = mapped_column(Boolean, default=False)
|
||||||
use_for_return: Mapped[bool] = mapped_column(Boolean, default=False)
|
use_for_return: Mapped[bool] = mapped_column(Boolean, default=False)
|
||||||
show_in_software_list: Mapped[bool] = mapped_column(Boolean, default=True, nullable=False)
|
show_in_software_list: Mapped[bool] = mapped_column(Boolean, default=True, nullable=False)
|
||||||
|
# False excludes assets with this status from the MeshCentral sync, e.g.
|
||||||
|
# scrapped devices that no longer exist in MeshCentral.
|
||||||
|
meshcentral_sync: Mapped[bool] = mapped_column(Boolean, default=True, nullable=False)
|
||||||
|
|
||||||
|
|
||||||
class SyncRun(Base):
|
class SyncRun(Base):
|
||||||
|
|||||||
+11
-10
@@ -40,6 +40,7 @@ from .analyzer_profiles import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
from fastapi import Depends, File, Form, HTTPException, Request, UploadFile
|
from fastapi import Depends, File, Form, HTTPException, Request, UploadFile
|
||||||
|
from .errors import TranslatedHTTPException
|
||||||
from fastapi.responses import RedirectResponse, StreamingResponse
|
from fastapi.responses import RedirectResponse, StreamingResponse
|
||||||
|
|
||||||
try:
|
try:
|
||||||
@@ -126,7 +127,7 @@ async def _save_upload(upload: UploadFile) -> tuple[str, Path, int, str]:
|
|||||||
extension = Path(filename).suffix.lower()
|
extension = Path(filename).suffix.lower()
|
||||||
if extension not in ALLOWED_EXTENSIONS:
|
if extension not in ALLOWED_EXTENSIONS:
|
||||||
await upload.close()
|
await upload.close()
|
||||||
raise HTTPException(400, "Unsupported installer file type.")
|
raise TranslatedHTTPException(400, "errors.installer_type_unsupported", "Unsupported installer file type.")
|
||||||
|
|
||||||
token = uuid.uuid4().hex
|
token = uuid.uuid4().hex
|
||||||
job_dir = TEMP_ROOT / token
|
job_dir = TEMP_ROOT / token
|
||||||
@@ -144,7 +145,7 @@ async def _save_upload(upload: UploadFile) -> tuple[str, Path, int, str]:
|
|||||||
break
|
break
|
||||||
total += len(chunk)
|
total += len(chunk)
|
||||||
if total > limit:
|
if total > limit:
|
||||||
raise HTTPException(413, f"Maximum upload size exceeded ({MAX_UPLOAD_MB} MB).")
|
raise TranslatedHTTPException(413, "errors.upload_too_large", "Maximum upload size exceeded ({max_mb} MB).", max_mb=MAX_UPLOAD_MB)
|
||||||
digest.update(chunk)
|
digest.update(chunk)
|
||||||
handle.write(chunk)
|
handle.write(chunk)
|
||||||
except Exception:
|
except Exception:
|
||||||
@@ -155,24 +156,24 @@ async def _save_upload(upload: UploadFile) -> tuple[str, Path, int, str]:
|
|||||||
|
|
||||||
if total == 0:
|
if total == 0:
|
||||||
shutil.rmtree(job_dir, ignore_errors=True)
|
shutil.rmtree(job_dir, ignore_errors=True)
|
||||||
raise HTTPException(400, "The uploaded installer is empty.")
|
raise TranslatedHTTPException(400, "errors.installer_empty", "The uploaded installer is empty.")
|
||||||
return token, target, total, digest.hexdigest()
|
return token, target, total, digest.hexdigest()
|
||||||
|
|
||||||
|
|
||||||
def _analysis_file(token: str) -> tuple[Path, dict[str, Any]]:
|
def _analysis_file(token: str) -> tuple[Path, dict[str, Any]]:
|
||||||
if not re.fullmatch(r"[0-9a-f]{32}", token or ""):
|
if not re.fullmatch(r"[0-9a-f]{32}", token or ""):
|
||||||
raise HTTPException(400, "Invalid analysis token.")
|
raise TranslatedHTTPException(400, "errors.analysis_token_invalid", "Invalid analysis token.")
|
||||||
job_dir = TEMP_ROOT / token
|
job_dir = TEMP_ROOT / token
|
||||||
meta_file = job_dir / "analysis.json"
|
meta_file = job_dir / "analysis.json"
|
||||||
if not meta_file.is_file():
|
if not meta_file.is_file():
|
||||||
raise HTTPException(404, "Analysis is no longer available.")
|
raise TranslatedHTTPException(404, "errors.analysis_unavailable", "Analysis is no longer available.")
|
||||||
try:
|
try:
|
||||||
meta = json.loads(meta_file.read_text(encoding="utf-8"))
|
meta = json.loads(meta_file.read_text(encoding="utf-8"))
|
||||||
except (OSError, ValueError) as exc:
|
except (OSError, ValueError) as exc:
|
||||||
raise HTTPException(404, "Analysis metadata is not available.") from exc
|
raise TranslatedHTTPException(404, "errors.analysis_metadata_unavailable", "Analysis metadata is not available.") from exc
|
||||||
target = job_dir / _safe_filename(meta.get("filename"))
|
target = job_dir / _safe_filename(meta.get("filename"))
|
||||||
if not target.is_file():
|
if not target.is_file():
|
||||||
raise HTTPException(404, "Installer file is no longer available.")
|
raise TranslatedHTTPException(404, "errors.installer_unavailable", "Installer file is no longer available.")
|
||||||
return target, meta
|
return target, meta
|
||||||
|
|
||||||
|
|
||||||
@@ -1129,15 +1130,15 @@ def _create_payload_archive(target: Path, meta: dict[str, Any]) -> Path:
|
|||||||
root = (target.parent / root_rel).resolve()
|
root = (target.parent / root_rel).resolve()
|
||||||
job_root = target.parent.resolve()
|
job_root = target.parent.resolve()
|
||||||
if job_root != root and job_root not in root.parents:
|
if job_root != root and job_root not in root.parents:
|
||||||
raise HTTPException(400, "Invalid embedded payload directory.")
|
raise TranslatedHTTPException(400, "errors.payload_directory_invalid", "Invalid embedded payload directory.")
|
||||||
if not root.is_dir():
|
if not root.is_dir():
|
||||||
raise HTTPException(404, "Embedded payload is no longer available.")
|
raise TranslatedHTTPException(404, "errors.payload_unavailable", "Embedded payload is no longer available.")
|
||||||
archive_path = target.parent / "embedded-payload.zip"
|
archive_path = target.parent / "embedded-payload.zip"
|
||||||
if archive_path.exists():
|
if archive_path.exists():
|
||||||
archive_path.unlink()
|
archive_path.unlink()
|
||||||
count, total = _validate_extracted_tree(root, MAX_EXTRACTED_FILES, MAX_EXTRACTED_MB * 1024 * 1024)
|
count, total = _validate_extracted_tree(root, MAX_EXTRACTED_FILES, MAX_EXTRACTED_MB * 1024 * 1024)
|
||||||
if count <= 0 or total <= 0:
|
if count <= 0 or total <= 0:
|
||||||
raise HTTPException(400, "Embedded payload is empty.")
|
raise TranslatedHTTPException(400, "errors.payload_empty", "Embedded payload is empty.")
|
||||||
with zipfile.ZipFile(archive_path, "w", compression=zipfile.ZIP_DEFLATED, compresslevel=6) as archive:
|
with zipfile.ZipFile(archive_path, "w", compression=zipfile.ZIP_DEFLATED, compresslevel=6) as archive:
|
||||||
for item in sorted(root.rglob("*")):
|
for item in sorted(root.rglob("*")):
|
||||||
if item.is_file():
|
if item.is_file():
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ from datetime import datetime
|
|||||||
from urllib.parse import quote
|
from urllib.parse import quote
|
||||||
|
|
||||||
from fastapi import HTTPException
|
from fastapi import HTTPException
|
||||||
|
from .errors import TranslatedHTTPException
|
||||||
|
|
||||||
from .config import load_config
|
from .config import load_config
|
||||||
from .database import SessionLocal
|
from .database import SessionLocal
|
||||||
@@ -401,7 +402,7 @@ def _job_execution_artifacts(db, platform: str, callback_url: str, job_id: int,
|
|||||||
return windows_inventory(callback_url, job_id), 'powershell', True
|
return windows_inventory(callback_url, job_id), 'powershell', True
|
||||||
if platform in {'linux','macos'}:
|
if platform in {'linux','macos'}:
|
||||||
return unix_python_payload(platform, callback_url, job_id), 'python', True
|
return unix_python_payload(platform, callback_url, job_id), 'python', True
|
||||||
raise HTTPException(400, 'Fuer dieses Betriebssystem ist kein sicherer MeshCtrl-Handler verfuegbar.')
|
raise TranslatedHTTPException(400, "errors.no_meshctrl_handler", "No safe MeshCtrl handler is available for this operating system.")
|
||||||
|
|
||||||
|
|
||||||
def _script_extension(interpreter: str) -> str:
|
def _script_extension(interpreter: str) -> str:
|
||||||
|
|||||||
@@ -120,11 +120,11 @@
|
|||||||
|
|
||||||
const selectedOption = select.options[select.selectedIndex];
|
const selectedOption = select.options[select.selectedIndex];
|
||||||
const fieldLabel = selectedOption?.textContent?.trim() || field;
|
const fieldLabel = selectedOption?.textContent?.trim() || field;
|
||||||
const duplicateTemplate = contextStatus?.dataset.duplicateTemplate || 'Duplikate: {field}';
|
const duplicateTemplate = contextStatus?.dataset.duplicateTemplate || 'Duplicates: {field}';
|
||||||
if (duplicateLabel) duplicateLabel.textContent = duplicateTemplate.replace('{field}', fieldLabel);
|
if (duplicateLabel) duplicateLabel.textContent = duplicateTemplate.replace('{field}', fieldLabel);
|
||||||
refreshContextStatus();
|
refreshContextStatus();
|
||||||
|
|
||||||
const summaryTemplate = dialog.dataset.resultSummaryTemplate || '{records} Datensätze in {groups} Dublettengruppen gefunden.';
|
const summaryTemplate = dialog.dataset.resultSummaryTemplate || '{records} records found in {groups} duplicate groups.';
|
||||||
if (summary) {
|
if (summary) {
|
||||||
summary.textContent = summaryTemplate
|
summary.textContent = summaryTemplate
|
||||||
.replace('{records}', String(duplicateRows.size))
|
.replace('{records}', String(duplicateRows.size))
|
||||||
|
|||||||
@@ -93,7 +93,7 @@
|
|||||||
|
|
||||||
function summary() {
|
function summary() {
|
||||||
const sorted = [...results].sort((a, b) => (b.Dauer_ms || 0) - (a.Dauer_ms || 0));
|
const sorted = [...results].sort((a, b) => (b.Dauer_ms || 0) - (a.Dauer_ms || 0));
|
||||||
console.groupCollapsed(`${prefix} Zusammenfassung – langsamste Vorgänge`);
|
console.groupCollapsed(`${prefix} Summary – slowest operations`);
|
||||||
console.table(sorted.slice(0, 30));
|
console.table(sorted.slice(0, 30));
|
||||||
console.groupEnd();
|
console.groupEnd();
|
||||||
return sorted;
|
return sorted;
|
||||||
|
|||||||
@@ -72,7 +72,7 @@
|
|||||||
saveChain = saveChain
|
saveChain = saveChain
|
||||||
.catch(() => {})
|
.catch(() => {})
|
||||||
.then(() => postState(updates, removals))
|
.then(() => postState(updates, removals))
|
||||||
.catch(error => console.warn('[AssetManager] Benutzerbezogener Tabellenzustand konnte nicht gespeichert werden.', error));
|
.catch(error => console.warn('[AssetManager] User-specific table state could not be saved.', error));
|
||||||
return saveChain;
|
return saveChain;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -149,12 +149,12 @@
|
|||||||
});
|
});
|
||||||
if (Object.keys(migration).length) {
|
if (Object.keys(migration).length) {
|
||||||
try { await postState(migration, []); }
|
try { await postState(migration, []); }
|
||||||
catch (error) { console.warn('[AssetManager] Vorhandener Browserzustand konnte nicht in das Benutzerkonto übernommen werden.', error); }
|
catch (error) { console.warn('[AssetManager] Existing browser state could not be transferred to the user account.', error); }
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// Browser storage remains the safe fallback if the account-state endpoint
|
// Browser storage remains the safe fallback if the account-state endpoint
|
||||||
// is temporarily unavailable.
|
// is temporarily unavailable.
|
||||||
console.warn('[AssetManager] Benutzerbezogener Tabellenzustand nicht verfügbar; Browser-Fallback wird verwendet.', error);
|
console.warn('[AssetManager] User-specific table state unavailable; using browser fallback.', error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -46,7 +46,7 @@
|
|||||||
: rows.length;
|
: rows.length;
|
||||||
const target = countTarget(table, index);
|
const target = countTarget(table, index);
|
||||||
if (target) {
|
if (target) {
|
||||||
const template = document.body.dataset.recordCountTemplate || 'Angezeigt: {visible} von {total} Datensätzen';
|
const template = document.body.dataset.recordCountTemplate || 'Showing {visible} of {total} records';
|
||||||
target.textContent = template
|
target.textContent = template
|
||||||
.replace('{visible}', String(visible))
|
.replace('{visible}', String(visible))
|
||||||
.replace('{total}', String(total));
|
.replace('{total}', String(total));
|
||||||
|
|||||||
@@ -569,7 +569,7 @@
|
|||||||
clearButton.type = 'button';
|
clearButton.type = 'button';
|
||||||
clearButton.className = 'button button-secondary table-filter-clear';
|
clearButton.className = 'button button-secondary table-filter-clear';
|
||||||
clearButton.textContent =
|
clearButton.textContent =
|
||||||
document.body.dataset.clearFiltersLabel || 'Filter zurücksetzen';
|
document.body.dataset.clearFiltersLabel || 'Reset filters';
|
||||||
clearButton.addEventListener('click', () => {
|
clearButton.addEventListener('click', () => {
|
||||||
filterDefinitions.forEach(definition => {
|
filterDefinitions.forEach(definition => {
|
||||||
definition.input.value = '';
|
definition.input.value = '';
|
||||||
@@ -614,7 +614,7 @@
|
|||||||
document.body.dataset.filtersActiveTemplate || '{count} Filter aktiv';
|
document.body.dataset.filtersActiveTemplate || '{count} Filter aktiv';
|
||||||
const statusTemplate =
|
const statusTemplate =
|
||||||
document.body.dataset.filterStatusTemplate ||
|
document.body.dataset.filterStatusTemplate ||
|
||||||
'Gefiltert: {visible} von {total} Datensätzen';
|
'Filtered: {visible} of {total} records';
|
||||||
|
|
||||||
label.textContent = activeTemplate.replace('{count}', String(activeCount));
|
label.textContent = activeTemplate.replace('{count}', String(activeCount));
|
||||||
details.textContent = statusTemplate
|
details.textContent = statusTemplate
|
||||||
|
|||||||
@@ -25,7 +25,8 @@
|
|||||||
const toast = document.createElement('div');
|
const toast = document.createElement('div');
|
||||||
toast.className = `toast toast-${level}`;
|
toast.className = `toast toast-${level}`;
|
||||||
const symbol = level === 'success' ? '✓' : level === 'warning' ? '⚠' : '✕';
|
const symbol = level === 'success' ? '✓' : level === 'warning' ? '⚠' : '✕';
|
||||||
toast.innerHTML = `<span class="toast-symbol">${symbol}</span><span class="toast-message"></span><button type="button" class="toast-close" aria-label="Schließen">×</button>`;
|
toast.innerHTML = `<span class="toast-symbol">${symbol}</span><span class="toast-message"></span><button type="button" class="toast-close">×</button>`;
|
||||||
|
toast.querySelector('.toast-close').setAttribute('aria-label', document.body.dataset.toastCloseLabel || 'Close');
|
||||||
toast.querySelector('.toast-message').textContent = message;
|
toast.querySelector('.toast-message').textContent = message;
|
||||||
toast.querySelector('.toast-close').addEventListener('click', () => toast.remove());
|
toast.querySelector('.toast-close').addEventListener('click', () => toast.remove());
|
||||||
container.appendChild(toast);
|
container.appendChild(toast);
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
<section class="chart-card">
|
<section class="chart-card">
|
||||||
<div class="chart-card-head">
|
<div class="chart-card-head">
|
||||||
<div><h3>{{ item.chart.name }}</h3>{% if item.chart.description %}<p>{{ item.chart.description }}</p>{% endif %}</div>
|
<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>
|
</div>
|
||||||
{% if not item['items'] %}
|
{% 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'] %}
|
{% elif item.chart.chart_type in ['donut', 'pie'] %}
|
||||||
<div class="donut-layout">
|
<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>
|
<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,6 +1,6 @@
|
|||||||
{% extends 'base.html' %}{% block content %}
|
{% 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>
|
<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>
|
<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>
|
<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 '') %}
|
{% 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 '') %}
|
||||||
|
|||||||
@@ -1,22 +1,22 @@
|
|||||||
{% extends 'base.html' %}
|
{% extends 'base.html' %}
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<div class="toolbar">
|
<div class="toolbar">
|
||||||
<h1>Historie: {{ asset.name }}</h1>
|
<h1>{{ t('history.title', name=asset.name) }}</h1>
|
||||||
<div class="toolbar-actions">
|
<div class="toolbar-actions">
|
||||||
<a class="button button-secondary" href="/assets/{{ asset.id }}/history/export.xlsx">Excel exportieren</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 }}">Zurück zum Asset</a>
|
<a class="button" href="/assets/{{ asset.id }}">{{ t('software.back_to_asset') }}</a>
|
||||||
</div>
|
</div>
|
||||||
</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">
|
<div class="table-scroll">
|
||||||
<table class="data-table">
|
<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>
|
<tbody>
|
||||||
{% for entry in entries %}
|
{% for entry in entries %}
|
||||||
{% for label, change in entry.changes.items() %}
|
{% 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>
|
<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 %}
|
{% 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>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -49,7 +49,7 @@
|
|||||||
</label>
|
</label>
|
||||||
|
|
||||||
<label class="tree-filter-field">{{ t('tree.name_contains') }}
|
<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>
|
||||||
|
|
||||||
<label class="tree-toggle-option">
|
<label class="tree-toggle-option">
|
||||||
|
|||||||
@@ -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 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 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 %}
|
{% 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) %}
|
{% 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_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>
|
<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>
|
||||||
|
|||||||
@@ -1,36 +1,36 @@
|
|||||||
{% extends 'base.html' %}
|
{% extends 'base.html' %}
|
||||||
{% block content %}
|
{% 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">
|
<section class="panel bulk-edit-panel">
|
||||||
<form method="post" action="/assets/bulk-edit/apply" id="bulk-edit-apply-form">
|
<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 %}
|
{% 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 %}
|
{% if category_id %}<input type="hidden" name="category_id" value="{{ category_id }}">{% endif %}
|
||||||
<div class="form-grid">
|
<div class="form-grid">
|
||||||
<label>Feld
|
<label>{{ t('common.field') }}
|
||||||
<select name="field_name" id="bulk-field" required>
|
<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 %}
|
{% for field in fields %}<option value="{{ field.field_name }}">{{ field.label }}</option>{% endfor %}
|
||||||
</select>
|
</select>
|
||||||
</label>
|
</label>
|
||||||
<label>Neuer Wert
|
<label>{{ t('history.new_value') }}
|
||||||
<input name="new_value" id="bulk-value" autocomplete="off">
|
<input name="new_value" id="bulk-value" autocomplete="off">
|
||||||
<select id="bulk-status-value" class="hidden-control">
|
<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 %}
|
{% for status in status_options %}<option value="{{ status.name }}">{{ status.name }}</option>{% endfor %}
|
||||||
</select>
|
</select>
|
||||||
<select id="bulk-parent-value" class="hidden-control">
|
<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 %}
|
{% 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>
|
||||||
<select id="bulk-category-value" class="hidden-control">
|
<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 %}
|
{% for category in categories %}<option value="{{ category.id }}">{{ category.name }}</option>{% endfor %}
|
||||||
</select>
|
</select>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</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>
|
<p class="muted">{{ t('assets.bulk_edit.help') }}</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>
|
<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 %}">Abbrechen</a><button type="submit">💾 Für {{ assets|length }} Assets speichern</button></div>
|
<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>
|
</form>
|
||||||
</section>
|
</section>
|
||||||
<script>
|
<script>
|
||||||
|
|||||||
@@ -2,12 +2,12 @@
|
|||||||
{% block content %}
|
{% block content %}
|
||||||
<div class="toolbar">
|
<div class="toolbar">
|
||||||
<h1>{{ t('assets.import_title') }}</h1>
|
<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>
|
</div>
|
||||||
|
|
||||||
<section class="panel">
|
<section class="panel">
|
||||||
<form method="post" action="/assets/import" enctype="multipart/form-data">
|
<form method="post" action="/assets/import" enctype="multipart/form-data">
|
||||||
<label>Kategorie
|
<label>{{ t('common.category') }}
|
||||||
<select name="category_id" required>
|
<select name="category_id" required>
|
||||||
{% for category in categories %}
|
{% for category in categories %}
|
||||||
<option value="{{ category.id }}" {% if selected and selected.id == category.id %}selected{% endif %}>{{ category.name }}</option>
|
<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>
|
<p><a class="button button-secondary" href="/assets/import/template.xlsx?category_id={{ selected.id }}">{{ t('assets.import_template') }}</a></p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<label>Excel-Datei
|
<label>{{ t('assets.import_file') }}
|
||||||
<input type="file" name="file" accept=".xlsx" required>
|
<input type="file" name="file" accept=".xlsx" required>
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
<label class="checkbox-label">
|
<label class="checkbox-label">
|
||||||
<input class="checkbox" type="checkbox" name="import_only_active_fields" {% if import_only_active_fields %}checked{% endif %}>
|
<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>
|
</label>
|
||||||
<p class="muted">
|
<p class="muted">{{ t('assets.import_only_active_help') }}</p>
|
||||||
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>
|
|
||||||
|
|
||||||
<div class="form-actions">
|
<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>
|
<button type="submit" class="button button-save" name="import_mode" value="import">{{ t('assets.import_start') }}</button>
|
||||||
</div>
|
</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>
|
</form>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
{% if result %}
|
{% if result %}
|
||||||
<section class="panel">
|
<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 %}
|
{% 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 %}
|
{% endif %}
|
||||||
<dl class="config-list">
|
<dl class="config-list">
|
||||||
<dt>Neu angelegt</dt><dd>{{ result.created }}</dd>
|
<dt>{{ t('assets.import.created') }}</dt><dd>{{ result.created }}</dd>
|
||||||
<dt>Aktualisiert</dt><dd>{{ result.updated }}</dd>
|
<dt>{{ t('assets.import.updated') }}</dt><dd>{{ result.updated }}</dd>
|
||||||
<dt>Unverändert</dt><dd>{{ result.skipped }}</dd>
|
<dt>{{ t('assets.import.unchanged') }}</dt><dd>{{ result.skipped }}</dd>
|
||||||
</dl>
|
</dl>
|
||||||
{% if result.unknown_headers %}
|
{% if result.unknown_headers %}
|
||||||
<h3>Nicht erkannte Spalten</h3>
|
<h3>{{ t('assets.import.unknown_columns') }}</h3>
|
||||||
<p>{{ result.unknown_headers|join(', ') }}</p>
|
<p>{{ result.unknown_headers|join(', ') }}</p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if result.row_results %}
|
{% if result.row_results %}
|
||||||
<h3>Ergebnis je Excel-Zeile</h3>
|
<h3>{{ t('assets.import.row_results') }}</h3>
|
||||||
<div class="table-scroll">
|
<div class="table-scroll">
|
||||||
<table class="data-table">
|
<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>
|
<tbody>
|
||||||
{% for row in result.row_results %}
|
{% for row in result.row_results %}
|
||||||
<tr>
|
<tr>
|
||||||
@@ -75,7 +71,7 @@
|
|||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if result.errors %}
|
{% 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>
|
<ul>{% for error in result.errors %}<li>{{ error }}</li>{% endfor %}</ul>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</section>
|
</section>
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
--am-warning:{{ colors.get('warning_color', '#d97706') }};
|
--am-warning:{{ colors.get('warning_color', '#d97706') }};
|
||||||
--am-danger:{{ colors.get('danger_color', '#b42318') }};
|
--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">
|
<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>
|
<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 %}
|
{% endif %}
|
||||||
<button type="button" class="header-help-button" id="about-dialog-button" title="{{ t('about.open') }}" aria-label="{{ t('about.open') }}">?</button>
|
<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="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>
|
</header>
|
||||||
{% if auth.get('mode', 'none') == 'none' %}
|
{% if auth.get('mode', 'none') == 'none' %}
|
||||||
<div class="authentication-disabled-banner" role="status">
|
<div class="authentication-disabled-banner" role="status">
|
||||||
|
|||||||
@@ -37,7 +37,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<h2>{{ t('categories.fields_title') }}</h2>
|
<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>
|
<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) %}
|
{% 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>
|
<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>
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
<h2>{{ t('dashboard.recently_changed') }}</h2>
|
<h2>{{ t('dashboard.recently_changed') }}</h2>
|
||||||
<p class="table-hint">{{ t('dashboard.list_fields_hint') }}</p>
|
<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>
|
<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>
|
</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>
|
{% 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 %}
|
{% endblock %}
|
||||||
@@ -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.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="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">{{ 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">
|
<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>
|
<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>
|
<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">
|
<div data-script-help="powershell">
|
||||||
<p>{{ t('jobdefs.script_help.powershell') }}</p>
|
<p>{{ t('jobdefs.script_help.powershell') }}</p>
|
||||||
<pre class="sync-log">$count = 3
|
<pre class="sync-log">$count = 3
|
||||||
Write-JobLog "Gefundene Dateien: $count"
|
Write-JobLog "Processed files: $count"
|
||||||
$JobResult["processed_count"] = $count</pre>
|
$JobResult["processed_count"] = $count</pre>
|
||||||
</div>
|
</div>
|
||||||
<div data-script-help="python">
|
<div data-script-help="python">
|
||||||
|
|||||||
@@ -10,11 +10,11 @@
|
|||||||
<form method="post" action="/sync/meshcentral/settings" class="compact-form">
|
<form method="post" action="/sync/meshcentral/settings" class="compact-form">
|
||||||
<div class="form-grid">
|
<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 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.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>{{ 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>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>
|
<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>
|
||||||
<div class="checkbox-row">
|
<div class="checkbox-row">
|
||||||
@@ -91,7 +91,7 @@
|
|||||||
<h2>3. {{ t('mesh.field_mappings') }}</h2>
|
<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>
|
<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">
|
<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 %}
|
{% for m in mappings %}
|
||||||
<tr>
|
<tr>
|
||||||
<td><input type="checkbox" name="mapping_{{m.id}}_enabled" {% if m.enabled %}checked{% endif %}></td>
|
<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>
|
<p class="muted">{{ t('mesh.new_mapping_help') }}</p>
|
||||||
<form method="post" action="/sync/meshcentral/mappings/new" class="compact-form">
|
<form method="post" action="/sync/meshcentral/mappings/new" class="compact-form">
|
||||||
<div class="form-grid">
|
<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>{{ 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>Source Path<input name="source_path" required placeholder="node.example.path"></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>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>{{ 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>Trennzeichen<input name="separator" value="\n"></label>
|
<label>{{ t('mesh.separator') }}<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>{{ 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>Beschreibung<input name="description"></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>
|
<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>
|
</div><button class="button button-save">+ {{ t('mesh.create_mapping') }}</button>
|
||||||
</form>
|
</form>
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
{% extends 'base.html' %}{% block content %}
|
{% extends 'base.html' %}{% block content %}
|
||||||
<div class="toolbar"><h1>{{ t('app.status_values') }}</h1></div><p>{{ t('status.help') }}</p>
|
<div class="toolbar"><h1>{{ t('app.status_values') }}</h1></div><p>{{ t('status.help') }}</p>
|
||||||
<p class="muted">{{ t('status.software_list_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>
|
<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><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 %}
|
{% 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></td></tr></tbody></table></div><div class="form-actions"><button class="button button-save" type="submit">💾 {{ t('common.save') }}</button></div></form>
|
<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.software_list_help') }}</p>
|
||||||
|
<p class="form-help">{{ t('status.meshcentral_sync_help') }}</p>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
+1
-1
@@ -1,2 +1,2 @@
|
|||||||
APP_VERSION = "0.5.5.92"
|
APP_VERSION = "0.5.5.93"
|
||||||
__version__ = APP_VERSION
|
__version__ = APP_VERSION
|
||||||
@@ -53,6 +53,7 @@ services:
|
|||||||
SOFTWARE_PACKAGE_IMPORT_MAX_FILES: ${SOFTWARE_PACKAGE_IMPORT_MAX_FILES:-20000}
|
SOFTWARE_PACKAGE_IMPORT_MAX_FILES: ${SOFTWARE_PACKAGE_IMPORT_MAX_FILES:-20000}
|
||||||
LDAP_BIND_PASSWORD: ${LDAP_BIND_PASSWORD:-}
|
LDAP_BIND_PASSWORD: ${LDAP_BIND_PASSWORD:-}
|
||||||
SESSION_SECRET: ${SESSION_SECRET:-}
|
SESSION_SECRET: ${SESSION_SECRET:-}
|
||||||
|
SESSION_COOKIE_SECURE: ${SESSION_COOKIE_SECURE:-false}
|
||||||
LOCAL_ADMIN_USERNAME: ${LOCAL_ADMIN_USERNAME:-}
|
LOCAL_ADMIN_USERNAME: ${LOCAL_ADMIN_USERNAME:-}
|
||||||
LOCAL_ADMIN_PASSWORD: ${LOCAL_ADMIN_PASSWORD:-}
|
LOCAL_ADMIN_PASSWORD: ${LOCAL_ADMIN_PASSWORD:-}
|
||||||
CALLBACK_PORT: ${CALLBACK_PORT:-8090}
|
CALLBACK_PORT: ${CALLBACK_PORT:-8090}
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ POSTGRES_DB=assetmanager
|
|||||||
POSTGRES_USER=assetmanager
|
POSTGRES_USER=assetmanager
|
||||||
POSTGRES_PASSWORD=CHANGE_ME
|
POSTGRES_PASSWORD=CHANGE_ME
|
||||||
SESSION_SECRET=CHANGE_ME_LONG_RANDOM
|
SESSION_SECRET=CHANGE_ME_LONG_RANDOM
|
||||||
|
SESSION_COOKIE_SECURE=false
|
||||||
LOCAL_ADMIN_USERNAME=emergency-admin
|
LOCAL_ADMIN_USERNAME=emergency-admin
|
||||||
LOCAL_ADMIN_PASSWORD=CHANGE_ME_MIN_12_CHARS
|
LOCAL_ADMIN_PASSWORD=CHANGE_ME_MIN_12_CHARS
|
||||||
MESHCENTRAL_PASSWORD=
|
MESHCENTRAL_PASSWORD=
|
||||||
@@ -85,6 +86,7 @@ services:
|
|||||||
SCRIPT_DIR: /assetmanager-data/scripts
|
SCRIPT_DIR: /assetmanager-data/scripts
|
||||||
LDAP_BIND_PASSWORD: ${LDAP_BIND_PASSWORD:-}
|
LDAP_BIND_PASSWORD: ${LDAP_BIND_PASSWORD:-}
|
||||||
SESSION_SECRET: ${SESSION_SECRET:-}
|
SESSION_SECRET: ${SESSION_SECRET:-}
|
||||||
|
SESSION_COOKIE_SECURE: ${SESSION_COOKIE_SECURE:-false}
|
||||||
LOCAL_ADMIN_USERNAME: ${LOCAL_ADMIN_USERNAME:-}
|
LOCAL_ADMIN_USERNAME: ${LOCAL_ADMIN_USERNAME:-}
|
||||||
LOCAL_ADMIN_PASSWORD: ${LOCAL_ADMIN_PASSWORD:-}
|
LOCAL_ADMIN_PASSWORD: ${LOCAL_ADMIN_PASSWORD:-}
|
||||||
CALLBACK_BIND_IP: ${CALLBACK_BIND_IP:-127.0.0.1}
|
CALLBACK_BIND_IP: ${CALLBACK_BIND_IP:-127.0.0.1}
|
||||||
@@ -190,6 +192,8 @@ http://192.0.2.10:8088
|
|||||||
|
|
||||||
For Internet-facing use, HTTPS through a properly configured reverse proxy is strongly recommended. The callback endpoint must be reachable from the managed client.
|
For Internet-facing use, HTTPS through a properly configured reverse proxy is strongly recommended. The callback endpoint must be reachable from the managed client.
|
||||||
|
|
||||||
|
Once the web interface is only reached through HTTPS, set `SESSION_COOKIE_SECURE=true` in `.env` and restart the application container with `docker compose up -d app`. Browsers then send the session cookie only over HTTPS. Keep the value `false` while you still access AssetManager over plain HTTP (for example `http://server:8088` during the first start); otherwise the browser discards the cookie and sign-in fails.
|
||||||
|
|
||||||
If no callback base address is configured, AssetManager derives the address from the current request.
|
If no callback base address is configured, AssetManager derives the address from the current request.
|
||||||
|
|
||||||
## 6. Verify the installation
|
## 6. Verify the installation
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
- [0.5.5.93](UPDATE-0.5.5.93.md) - custom fields in asset lists, MeshCentral sync flag for statuses, enforced session secret and translated UI texts.
|
||||||
- [0.5.5.92](UPDATE-0.5.5.92.md) - startup diagnostics with runtime, database and callback endpoint information.
|
- [0.5.5.92](UPDATE-0.5.5.92.md) - startup diagnostics with runtime, database and callback endpoint information.
|
||||||
- [0.5.5.91](UPDATE-0.5.5.91.md) - smoother table scrolling and consolidated current development changes.
|
- [0.5.5.91](UPDATE-0.5.5.91.md) - smoother table scrolling and consolidated current development changes.
|
||||||
- [0.5.5.90](UPDATE-0.5.5.90.md) - modular analyzer profiles, community repository foundation and portable package import/export.
|
- [0.5.5.90](UPDATE-0.5.5.90.md) - modular analyzer profiles, community repository foundation and portable package import/export.
|
||||||
@@ -28,7 +29,7 @@
|
|||||||
|
|
||||||
Release notes are stored outside the project root to keep the repository overview compact.
|
Release notes are stored outside the project root to keep the repository overview compact.
|
||||||
|
|
||||||
The current release is **0.5.5.92**.
|
The current release is **0.5.5.93**.
|
||||||
|
|
||||||
Older notes are concise English summaries migrated from the original release documents. Git history remains authoritative for exact implementation details.
|
Older notes are concise English summaries migrated from the original release documents. Git history remains authoritative for exact implementation details.
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,19 @@
|
|||||||
|
# Update 0.5.5.93
|
||||||
|
|
||||||
|
Version 0.5.5.93 fixes custom field columns in asset lists, adds a status flag that excludes assets from the MeshCentral sync, hardens session handling and translates remaining fixed UI texts.
|
||||||
|
|
||||||
|
## Changes
|
||||||
|
|
||||||
|
- Custom fields configured as list columns now show their values in the asset list, the dashboard table and the asset list Excel export. Values are loaded in one query per page; booleans are shown as Yes/No in the user's language.
|
||||||
|
- New status flag **MeshCentral sync** (Settings → Status values). Assets whose status has the flag disabled, for example scrapped devices, are skipped by the MeshCentral sync: they are not updated, not reported as missing and no new asset is created for a matching device. Such assets get the sync status "Excluded from sync". Existing statuses keep the flag enabled.
|
||||||
|
- `SESSION_SECRET` is now mandatory: AssetManager refuses to start if it is missing, a known placeholder or shorter than 32 characters, and prints a short explanation instead of a traceback. Generate one with `openssl rand -hex 32`.
|
||||||
|
- New setting `SESSION_COOKIE_SECURE` (default `false`). Set it to `true` once AssetManager is only reached through HTTPS.
|
||||||
|
- Session permissions are refreshed on every request, so deactivated or deleted users are signed out immediately and role changes take effect without a new sign-in.
|
||||||
|
- HTTP error messages are translated into the user's language (`TranslatedHTTPException`); unexpected errors are logged and shown as a toast.
|
||||||
|
- Remaining fixed German/English texts in templates and scripts (asset history, bulk edit, Excel import, charts, MeshCentral sync, job definitions, toasts, table counters) now use the translation catalog.
|
||||||
|
- Version updated to 0.5.5.93.
|
||||||
|
|
||||||
|
## Upgrade notes
|
||||||
|
|
||||||
|
- Make sure `.env` contains a random `SESSION_SECRET` of at least 32 characters before updating, then recreate the container with `docker compose up -d`.
|
||||||
|
- The database column `status_options.meshcentral_sync` is added automatically at startup.
|
||||||
Reference in new issue
Block a user