fix table with handling, icons implemented

This commit is contained in:
root
2026-08-09 08:50:13 +02:00
parent 5e32be7d0c
commit 3ff0794cfc
43 changed files with 1027 additions and 95 deletions
+47
View File
@@ -0,0 +1,47 @@
# Asset visuals
AssetManager can display a visual marker for each asset in lists and detail views.
## Display priority
The default `auto` mode uses the following order:
1. asset-specific image
2. category image
3. MeshCentral device icon (`mesh_icon`)
4. neutral placeholder
An administrator can override this per asset and explicitly select the asset image, category image, or MeshCentral icon. If the selected source is not available, no alternative source is forced; this makes manual overrides predictable.
## Category images
Categories can already store an uploaded image. In 0.5.5.54 this image is also used consistently as the category icon in the asset list and asset detail view. Category images are therefore the preferred way to represent asset types that MeshCentral does not cover, such as monitors, keyboards, headsets, mice, cameras, NAS systems, modems, firewalls, printers, switches, routers, keys, or RFID items.
## MeshCentral icons
MeshCentral reports its device icon as `node.icon`; AssetManager stores this in the `mesh_icon` system field. The field uses the normal MeshCentral mapping update policy (`fill empty`, `MeshCentral wins`, or `local wins`). Display source selection is independent from synchronization policy.
The bundled MeshCentral device icons are third-party assets and remain documented in `THIRD_PARTY_NOTICES.md`.
## Upload lifecycle and shared references
Uploaded asset/category images use unique UUID-based filenames. The original client filename is therefore never used as the storage key and cannot overwrite an existing upload.
Image removal and replacement only change the database reference. The physical upload is deliberately retained because duplicated categories or other records may still reference the same file. A future maintenance task may identify and remove upload files that are no longer referenced by any record.
## Standard image library
Version 0.5.5.60 adds a reusable standard image library for assets and categories.
- Persistent Docker host directory: `./data/uploads/library`
- Container directory: `/app/app/static/uploads/library`
- Public application path: `/static/uploads/library/`
- Supported formats: PNG, JPG/JPEG, WEBP and GIF
- Existing library images can be selected directly in the asset and category forms.
- A new image can be uploaded to the shared library from either form and is then reusable.
- Library images are referenced, not copied per asset/category.
- Removing or replacing an association never deletes the physical library file.
- Uploads never overwrite an existing file. If a name already exists, a numeric suffix is added (`switch-1.png`, `switch-2.png`, ...).
- Administrators may also place supported image files directly into the persistent host directory.
Orphaned or unused library images are intentionally retained. A later maintenance function can safely identify and remove unreferenced files.
+55
View File
@@ -231,3 +231,58 @@ Check:
### A configuration file is missing
If `config.json` or `APPINFO.json` is absent, restart the application container. The entrypoint creates a missing default file without overwriting an existing one.
### Persistent standard image library
Add the following persistent volume to the application service:
```yaml
- ./data/uploads:/app/app/static/uploads
```
Create the host directory before the first start if desired:
```bash
mkdir -p data/uploads/library
```
Images uploaded through the AssetManager standard image library are stored there. You can also copy PNG, JPG/JPEG, WEBP or GIF files directly into this directory. They are then offered for selection in asset and category forms after the page is reloaded.
## Standard image library
Reusable asset/category images are stored persistently on the Docker host in:
```text
./data/uploads/library
```
The library is a subdirectory of the already existing uploads volume. No additional Docker mount is required. The existing Compose mapping:
```text
./data/uploads -> /app/app/static/uploads
```
therefore exposes the library as:
```text
Host: ./data/uploads/library
Container: /app/app/static/uploads/library
```
Images may be uploaded from the AssetManager forms or copied directly into `./data/uploads/library` on the Docker host. They remain persistent because `data/uploads` is already part of the standard AssetManager volume layout.
For image-based installations use:
```bash
docker compose down
docker compose pull
docker compose up -d
```
You can verify the active mount with:
```bash
```
Images copied directly into `./data/uploads/library` are available in the AssetManager image library after reloading the page.
+17
View File
@@ -0,0 +1,17 @@
# AssetManager 0.5.5.53
## MeshCentral device icon integration
- Separates the MeshCentral group type (`mtype`) from the per-device `node.icon` / agent platform type.
- Stores the MeshCentral device icon in the new read-only `mesh_icon` asset field.
- Uses `mesh_icon` for category assignment when new assets are created from MeshCentral; existing category mapping values 1-8 remain compatible.
- Repairs only the known historical system mapping that combined `mtype` and `icon`; user-created field mappings are left unchanged.
- Shows MeshCentral device icon previews in the category mapping UI.
- Adds a visual device column to the asset table directly after the row number: an uploaded asset image is preferred, otherwise the corresponding MeshCentral device icon is shown.
- Redistributes the MeshCentral device icon assets used by this feature under the upstream Apache License 2.0; see `THIRD_PARTY_NOTICES.md`.
## Compatibility
- Existing assets are not automatically recategorized by this change.
- Run a MeshCentral synchronization to populate `mesh_icon` for existing linked assets.
- The existing `mesh_mtype` field remains available and now explicitly represents the MeshCentral group type only.
+10
View File
@@ -0,0 +1,10 @@
# AssetManager 0.5.5.54
## Asset visual sources
- Added a persistent per-asset display source setting.
- Default display order is asset image, category image, MeshCentral icon, then placeholder.
- Added explicit per-asset choices for asset image, category image, or MeshCentral icon.
- Category images are now used consistently in the asset list as well as the asset detail view.
- Category edit view now shows the current category image and allows clearing it.
- Added documentation for the visual-source model and its relationship to MeshCentral field update rules.
+10
View File
@@ -0,0 +1,10 @@
# AssetManager 0.5.5.55
## Changes
- Asset images are visible while editing an asset and can be removed explicitly.
- Replacing an asset image removes the previous uploaded file.
- Category images are displayed in the category table.
- Column resizing is available centrally for regular application tables, with persistent widths per table and column.
- Category table columns use stable storage keys for persistent widths.
- Dashboard category images use contained scaling so images are not cropped in their preview frame.
+7
View File
@@ -0,0 +1,7 @@
# AssetManager 0.5.5.56
- Uses the same transparent image presentation in asset and category tables.
- Asset and category edit forms now use the same immediate image-removal button workflow.
- Replacing or removing a category image removes the superseded upload file.
- Table resize handles are kept inside each header cell and pointer tracking is handled globally, improving column resizing on management tables such as Categories, Translations, Status Values and Fields.
- Dashboard/category images use `object-fit: contain` so the complete image remains visible.
+6
View File
@@ -0,0 +1,6 @@
# AssetManager 0.5.5.57
- Fixed column resizing on management tables such as categories, translations, status values, fields, and dashboard/recent-job tables by routing all non-asset tables through the shared resize implementation.
- Added permanently visible column separators and a larger resize hit area.
- Unified asset and category image removal behavior. The preview now disappears immediately, a pending-removal message is shown, and the removal is applied on save.
- Added a shared image editor script for consistent behavior across asset and category forms.
+9
View File
@@ -0,0 +1,9 @@
# AssetManager 0.5.5.58
## Table column resizing
- Manual column resizing now keeps all intermediate columns unchanged.
- When a non-rightmost column is resized, only the far-right visible column absorbs the width difference.
- The far-right column keeps a minimum width to prevent collapsing.
- Resizing the far-right column itself changes the overall table width and can therefore produce horizontal scrolling.
- Both changed widths are persisted per table and column.
+13
View File
@@ -0,0 +1,13 @@
# AssetManager 0.5.5.59
## Image association safety
- Removing or replacing an asset/category image now removes only the database association.
- Physical upload files are intentionally retained because duplicated records can reference the same file.
- Orphaned image files are reserved for a later maintenance cleanup task.
- Uploads continue to use unique UUID-based filenames, so files with the same original filename never overwrite one another and the same source image can be uploaded multiple times safely.
## Image editor preview
- After an image is marked for removal, selecting a replacement immediately previews the newly selected local image instead of restoring the old server image.
- The removal marker is cleared automatically when a replacement image is selected.
+11
View File
@@ -0,0 +1,11 @@
# AssetManager 0.5.5.60
## Reusable standard image library
- Added a shared standard image library for assets and categories.
- Existing images can be selected from a thumbnail gallery instead of uploading the same image repeatedly.
- New standard images can be added once directly from an asset or category form.
- Standard images use the persistent Docker directory `./data/image-library` mounted at `/app/app/static/img/library`.
- Standard-library images are referenced and are never deleted when an asset/category association is removed or replaced.
- Duplicate upload names never overwrite existing files; a numeric suffix is added automatically.
- Direct per-record uploads remain available and continue to use unique UUID file names.
+10
View File
@@ -0,0 +1,10 @@
# AssetManager 0.5.5.61
## Standard image library path and upload workflow
- Clarified that the persistent standard image library lives in `./data/image-library` on the Docker host.
- The bind mount exposes that same directory at `/app/app/static/img/library` inside the application container; this is not a second copy.
- Added explicit `STANDARD_IMAGE_DIR` configuration and startup creation/logging of the active library directory.
- Removed the direct per-record image upload controls from asset and category forms. New images are added to the shared library and can then be reused.
- Existing legacy `/static/uploads/...` references remain supported for backward compatibility.
- Documentation now explains that adding a new bind mount requires recreating the container, not only restarting it.
+9
View File
@@ -0,0 +1,9 @@
# Update 0.5.5.62
## Standard image library without an additional Docker mount
- Removed the dedicated `data/image-library` bind mount introduced in 0.5.5.60.
- Reuses the existing persistent uploads volume.
- Standard images are stored in `data/uploads/library` on the Docker host and `/app/app/static/uploads/library` in the container.
- No duplicate image storage and no additional Compose volume entry are required.
- Removed the misleading source-tree `app/static/img/library` directory.