Commit Graph

20 Commits

Author SHA1 Message Date
ske087 cdaa17803a feat(digiserver-v2): port edited media report and deploy badge features from standalone
- Added edited_media_report route to players blueprint with tabular report view
- Created edited_media_report.html template with summary stats, dark mode, print/PDF support
- Created _deploy_badge.html partial template for deployment status display
- Added deployment status column and badge CSS to players_list.html
- Added 'View Report' button to manage_player.html next to 'View All Edited Media'
- Fixed api.py receive_edited_media with robust content lookup:
  - Fallback content lookup by regex path matching (edited_media/<id>/)
  - Fallback via PlayerEdit record if direct lookup fails
  - First-edit original file preservation (moves original to versionized folder)

Enterprise-specific features (portal SSO, internal sync, playlist permissions, WAL mode) are preserved unchanged.
2026-07-21 10:42:31 +03:00
ske087 83a8f79c36 IT Assets: make GDPR Mask function discoverable from users list
- Users list: add eye-slash icon button per unmasked row (editor+ only)
  clicking opens a compact confirmation modal inline in the list
- User detail: gate Edit / Assign / Mask buttons behind is_editor check
  (button was shown to all but route already blocked readonly users)
2026-07-09 01:04:00 +03:00
ske087 6ca5cd613d IT Assets: add template tags reference table to doc-templates page
Collapsible table showing all 21 available {{ variable }} tags grouped by
section (User, Asset, Assignment, Document/Company) with descriptions,
format notes, and GDPR masking indicators.
2026-07-09 00:34:59 +03:00
ske087 c4e718ac4b IT Assets: add dark mode matching portal color scheme
- Inline <script> in <head> applies edp_theme from localStorage before first
  paint — no flash of unstyled content
- Bootstrap 5.3 data-bs-theme + custom data-edp-theme attribute for overrides
- Dark palette mirrors portal (bg #0d1117, surface #161b22, card #1c2128,
  accent-blue #388bfd, text #e6edf3, borders #30363d)
- CSS tokens for both themes via :root and [data-edp-theme='dark']
- All Bootstrap components overridden in dark mode: cards, tables, forms,
  modals, alerts, breadcrumbs, code, badges, inputs
- Moon/sun toggle button in topbar; sun shown in dark mode, moon in light
- Shared localStorage key 'edp_theme' — setting persists across all EDP apps
2026-07-09 00:20:06 +03:00
ske087 ca0d48d4b1 Fix 404 on maintenance update: use url_for instead of hardcoded path
Hardcoded '/maintenance/{id}/update' ignored the '/itassets/' nginx prefix.
Generate the base URL with url_for and replace the placeholder id in JS.
2026-07-08 23:29:02 +03:00
ske087 38991400f2 Fix TemplateSyntaxError in assets/detail.html
The compliance history section had two bugs:
- {% if compliance_log %} opened a card div and card-header div that were
  never closed, then accidentally wrapped {% if check_history %} inside it
- {% if asset.asset_type in Laptop/Desktop %} was missing its closing {% endif %}

Fix: remove the broken compliance_log wrapper; check_history now sits at the
correct nesting level with its own properly closed card structure; added the
missing {% endif %} for the asset_type block.
2026-07-08 23:21:51 +03:00
ske087 1f2fedba95 IT Assets: bulk-entry mode for Add Asset form
- Green info banner explains that hardware fields persist between saves
- Identifiers section badge shows 'These fields clear after each save'
- MAC Address gets same warning hint
- Submit button relabelled 'Save & Add Next' in add mode
- 'Reset All' button clears localStorage and the entire form
- localStorage saves all shared fields on submit; restores on page load
  (only Service Tag, Asset Tag and MAC Address are cleared each time)
- Cursor auto-focuses Service Tag field for fast keyboard entry
- Dell pre-fill still takes priority over stored state
2026-07-08 23:06:33 +03:00
ske087 55a088eff4 IT Assets: add Maintenance page with modal form
New database table: maintenance_records
- Fields: asset, start_date, end_date, status (open/in_progress/closed),
  initial_diagnosis, action_taken, action_result

New routes (/maintenance/):
- List with status + asset filters and pagination
- POST /new — create record (editor+); auto-sets asset status to 'maintenance'
- GET /<id>/edit — opens list page with modal pre-filled
- POST /<id>/update — save edits; auto-clears 'maintenance' status on close
- POST /<id>/delete — remove record

UI:
- Bootstrap modal form shared for add and edit
- Clicking any table row opens the modal pre-filled with that row's data
- Asset field locked in edit mode (cannot change asset)
- Delete button per row (with confirmation)
- Sidebar: 'Maintenance' link added under Hardware section
2026-07-08 22:56:21 +03:00
ske087 95ea6a3a35 IT Assets: remove manual user creation from settings
Users are sourced exclusively from the portal (via SSO auto-create or
the Sync from Portal button). The Add User form and create_admin route
are removed to prevent out-of-sync local-only accounts.
A footer hint now links admins to the portal settings page.
2026-07-08 22:39:35 +03:00
ske087 06b2152331 IT Assets: add portal sync button + wire env vars in start-dev.sh
- Portal: add /api/internal/itassets-users endpoint (returns all portal users
  with itassets access + their effective role)
- IT Assets: add PORTAL_INTERNAL_URL config key
- IT Assets: add POST /settings/sync-from-portal route (admin only) — pulls
  users from the portal API and upserts them locally
- Settings page: 'Sync from Portal' button next to the users table header
- start-dev.sh: pass INTERNAL_SYNC_SECRET and ITASSETS_INTERNAL_URL to portal;
  pass PORTAL_INTERNAL_URL and INTERNAL_SYNC_SECRET to itassets
- Also includes 'Back to Portal' icon button added to sidebar footer
2026-07-08 21:54:08 +03:00
ske087 7d24e7f527 IT Assets: add role-based auth system and portal user sync
Auth:
- Fix local login (was redirecting to portal; now authenticates AdminUser directly)
- Portal SSO still takes priority in production via nginx headers

Role system (admin | editor | readonly):
- New app/utils/decorators.py with editor_required and admin_required decorators
- All write routes protected with editor_required (create/edit/delete/import/mask)
- Settings user management protected with admin_required
- Sidebar hides write-only links for readonly users
- Dashboard quick actions and list page buttons hidden for readonly

Settings page:
- Role colour badges (admin=red, editor=blue, readonly=grey)
- Inline role changer per user (dropdown auto-submit)
- Reset password modal per user
- Delete user button with confirmation
- Add user form includes role selector with legend

Portal user sync:
- New /internal/sync-user endpoint receives user pre-creation from portal
- INTERNAL_SYNC_SECRET added to config
- portal/config.py: added internal_url for itassets app so _sync_user_to_app works
2026-07-08 21:35:16 +03:00
ske087 6034a62b08 Add platform icons and fix dark mode contrast on HTTPS config page
- Portal: replace placeholder brand icon with Icon_platform.png in topbar
- NetworkView: replace placeholder sidebar logo with Icon_networkView.png
- DigiServer: fix https_config.html dark mode contrast (hardcoded light colors
  replaced with body.dark-mode CSS overrides and CSS variables)
2026-07-08 21:06:45 +03:00
ske087 1f6217d347 feat: 3-tier role system across all platform apps
Portal:
- Replace is_admin boolean with role column (admin/advanced/standard)
- Settings UI: 3-tier portal role select + per-app role dropdowns
- /portal-return endpoint: re-establishes session from JWT for sub-app back-links
- /api/internal/nv-users: internal endpoint for NetworkView user sync
- portal/migrate_roles.py: one-time DB migration script
- Role badges (admin/advanced/standard) in topbar and settings table

DigiServer:
- Add editor and viewer roles (portal advanced->editor, standard->viewer)
- PlaylistPermission model: grant viewer users edit access to specific playlists
- app/utils/access.py: shared editor_required, admin_required, can_edit_playlist helpers
- Content routes: editor_required on create/delete, per-playlist permission check on mutations
- Admin: playlist_permissions route + template to manage viewer playlist grants
- Base template: hide Admin nav for viewers, Portal button (⬡) returns to portal
- content_list_new: hide create/delete for viewers; Manage vs View button per permission
- manage_playlist_content: view-only mode when user lacks edit permission

NetworkView:
- backend/src/middleware/rbac.js: requireRole + requireWriteAccess helpers
- site_permissions table: one site per advanced user
- All mutating routes guarded (admin=all, advanced=assigned site, viewer=read-only)
- Portal SSO auto-upsert: user row synced from X-Auth-Role on every request
- GET /api/users: merges portal users list with local NV data (all 4 portal users visible)
- GET/PUT /api/users/:id/site-permission: assign site to advanced user
- Settings Users tab: role badges, site dropdown for advanced, (portal only) indicator
- Sidebar: ⬡ Portal button between Settings and Logout
- Frontend build: VITE_API_BASE=/networkview/api now set in start-dev.sh

IT Assets / Server Monitor:
- portal_sso.py updated: map advanced->editor/viewer, standard->readonly
- AdminUser model: add editor role + is_editor property
2026-07-07 00:08:46 +03:00
ske087 5762dd420d no docke on the horizont 2026-07-01 23:07:44 +03:00
ske087 2c91a5666e updated player deploy and config 2026-07-01 19:21:59 +03:00
ske087 4f4e017ad2 fix: player connectivity and media download pipeline
- nginx: add /api/ shortcut block (no portal auth, X-Script-Name /digiserver,
  Host $http_host) so players can reach DigiServer API without /digiserver prefix
- nginx: use $http_host in /api/ block so Flask host_url includes port — fixes
  media download URLs missing :8080 (was http://ip/digiserver/... not http://ip:8080/...)
- player main.py: fix double-port bug when server_ip already contains a port
  (e.g. 192.168.0.230:8080 was producing http://192.168.0.230:8080:80)
- get_playlists_v2.py: force re-sync when server version differs OR local media
  files are missing on disk — fixes stale playlist after server reset
- digiserver api.py: playlist endpoint builds full media URLs using script_root
  from X-Script-Name header set by nginx
- weblink support, player build/deploy improvements, manage-playlist AJAX prefix fix
2026-06-29 20:04:11 +03:00
ske087 f674330b93 updated player deployment for digiserver 2026-06-07 23:40:50 +03:00
ske087 b97372f74d added gunicorn and updated to the last version of server monitorizare 2026-06-07 21:28:09 +03:00
ske087 0aefadbfd8 NetworkView: API routing fix, logout button, audit trail, port/notes editor tracking
- Fix frontend API base path (VITE_API_BASE env var, GraphPage hardcoded /api)
- Add logout button to NetworkView sidebar (clears portal SSO)
- Add AuditTrail component: inline change history on all entity pages
- DB migration: add updated_at, last_edited_by to ports table
- DB migration: add notes_last_edited_by, notes_updated_at to all entity tables
- Backend: track actor on port create/update; notes editor on entity PUT
- Frontend: extend types, MarkdownEditor shows last editor, port modal/list show last editor
- Fix port CREATE TABLE definition to include new columns upfront
- Add try/catch in handleSavePort to surface API errors in modal
2026-05-10 23:10:02 +03:00
ske087 8d9df56b0b Initial commit: enterprise digital platform with portal SSO, DigiServer, IT Assets, NetworkView, Server Monitor 2026-05-10 21:07:50 +03:00