diff --git a/lib/l10n/app_en.arb b/lib/l10n/app_en.arb index 1aed543..bf92857 100644 --- a/lib/l10n/app_en.arb +++ b/lib/l10n/app_en.arb @@ -376,5 +376,7 @@ "restoreLeases": "Restore leases", "restoringLeases": "Restoring leases...", "leasesRestored": "Leases restored successfully", - "leasesNotRestored": "The leases couldn't be restored" + "leasesNotRestored": "The leases couldn't be restored", + "dhcpLeases": "DHCP leases", + "noLeases": "No DHCP leases available" } \ No newline at end of file diff --git a/lib/l10n/app_es.arb b/lib/l10n/app_es.arb index 8c842b3..9d6f6df 100644 --- a/lib/l10n/app_es.arb +++ b/lib/l10n/app_es.arb @@ -376,5 +376,7 @@ "restoreLeases": "Restaurar asignaciones", "restoringLeases": "Restaurando asignaciones...", "leasesRestored": "Asignaciones restauradas correctamente", - "leasesNotRestored": "Las asignaciones no pudieron ser restauradas" + "leasesNotRestored": "Las asignaciones no pudieron ser restauradas", + "dhcpLeases": "Asignaciones DHCP", + "noLeases": "No hay asignaciones DHCP disponibles" } \ No newline at end of file diff --git a/lib/screens/settings/dhcp/dhcp.dart b/lib/screens/settings/dhcp/dhcp.dart index c66e2a7..babfd2c 100644 --- a/lib/screens/settings/dhcp/dhcp.dart +++ b/lib/screens/settings/dhcp/dhcp.dart @@ -600,6 +600,52 @@ class _DhcpWidgetState extends State { ), ), ], + SectionLabel( + label: AppLocalizations.of(context)!.dhcpLeases, + ), + if (serversProvider.dhcp.data!.dhcpStatus.leases.isNotEmpty) ListView.builder( + padding: const EdgeInsets.only(top: 0), + itemCount: serversProvider.dhcp.data!.dhcpStatus.leases.length, + itemBuilder: (context, index) => Container( + padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 10), + child: Column( + children: [ + Text( + serversProvider.dhcp.data!.dhcpStatus.leases[index].ip, + style: const TextStyle( + fontWeight: FontWeight.w500 + ), + ), + const SizedBox(height: 3), + Text( + serversProvider.dhcp.data!.dhcpStatus.leases[index].mac, + style: const TextStyle( + color: Colors.grey, + fontSize: 14 + ), + ), + const SizedBox(height: 3), + Text( + serversProvider.dhcp.data!.dhcpStatus.leases[index].hostname, + style: const TextStyle( + fontSize: 14 + ), + ), + ], + ), + ) + ), + if (serversProvider.dhcp.data!.dhcpStatus.leases.isEmpty) Container( + padding: const EdgeInsets.symmetric(horizontal: 28), + child: Text( + AppLocalizations.of(context)!.noLeases, + textAlign: TextAlign.center, + style: const TextStyle( + fontSize: 18, + color: Colors.grey + ), + ), + ), const SizedBox(height: 20), Material( color: Colors.transparent,