sistemazione finale - server .php
This commit is contained in:
@@ -267,3 +267,51 @@ Il test del pulsante "Test API" continua a restituire 403 Forbidden quando acces
|
||||
- `src/AssetTab.php`: Aggiunti metodi `startBackup()`, `saveInternetMode()`, `saveDefaultDirs()`
|
||||
- `src/UrbackupApiClient.php`: Aggiunti metodi `updateClientSettings()`, `saveInternetMode()`
|
||||
- `front/asset.form.php`: Gestione azioni per salvataggio impostazioni e backup
|
||||
|
||||
### Refactoring server.form.php e nuove tab (v0.4.7)
|
||||
|
||||
**Data**: 2026-05-21
|
||||
|
||||
**Descrizione**: Restrutturazione completa della pagina server con tab laterali e nuove funzionalità:
|
||||
|
||||
**Refactoring Server::showForm()**:
|
||||
- Estratto `showFormFields(?int $ID)` da `showForm()` per permettere layout custom
|
||||
- `showForm()` ora chiama header + fields + buttons in sequenza
|
||||
|
||||
**Tab laterali (server.form.php)**:
|
||||
- Side tabs a sinistra (col-2) con `nav-pills flex-column`
|
||||
- 4 tab: Server, Linked clients, Unlinked clients, Missing clients
|
||||
- Tab persistence via URL hash (JS su `shown.bs.tab`)
|
||||
|
||||
**Missing clients tab**:
|
||||
- Mostra asset GLPI con root location matching, non ancora collegati a ServerAsset e non presenti su UrBackup
|
||||
- Colonne: Name (link all'asset), Entity, Location (completename), Inventory number, IP, State, User, Group
|
||||
- Ricerca testuale client-side
|
||||
- Ordinamento colonne click-to-sort vanilla JS
|
||||
- Navigazione server spostata in server.form.php (sopra i tab, indipendente dalle sezioni)
|
||||
|
||||
**Bug fix namespace risolto**:
|
||||
- `getCachedName()` usava `new $classname()` con stringa → PHP cercava `GlpiPlugin\Urbackup\Group` invece di `\Group`
|
||||
- Fix: `$fqcn = '\\' . ltrim($classname, '\\')` per forzare global namespace
|
||||
|
||||
**Gruppo asset corretto**:
|
||||
- Gruppo non in `glpi_computers.groups_id` (colonna inesistente)
|
||||
- Letto da `glpi_groups_items` WHERE `type = 1` (GROUP_TYPE_NORMAL)
|
||||
- Usa `completename` per gerarchia (es. "Helpdesk > Livello 1")
|
||||
|
||||
**Indirizzo IP asset**:
|
||||
- Query JOIN: `glpi_ipaddresses → glpi_networknames → glpi_networkports`
|
||||
- Primo IP valido per l'item
|
||||
|
||||
**Breadcrumb**:
|
||||
- Cambiato da `'Assets'` a `'admin'` in `Html::header()` di server.php e server.form.php
|
||||
- Mostra: Pagina principale > Amministrazione > UrBackup servers
|
||||
|
||||
**Fix port default per nuovi server**:
|
||||
- `prepareInputForAdd()` ora setta default 55414 per `port`, 'http' per `protocol`, 1 per `is_active`, ecc.
|
||||
- `prepareInputForUpdate()` normalizza anche valori vuoti
|
||||
|
||||
**File modificati**:
|
||||
- `src/Server.php`: `showFormFields()`, `showMissingClientsTab()`, `getCachedName()` fix, `getAssetGroupName()`, `getAssetIp()`, `getCachedLocationName()`, `prepareInputForAdd/Update` default fix
|
||||
- `front/server.form.php`: Tab laterali, tab hash JS, breadcrumb admin
|
||||
- `front/server.php`: Breadcrumb admin, rimosso pulsante "Add" manuale (GLPI lo genera)
|
||||
|
||||
Reference in New Issue
Block a user