Redesign devices list as a sortable, responsive headered list

GET /api/devices accepts sort_by/sort_order (whitelisted columns; default
last_seen DESC, stable secondary sort on mac_address), device registration
captures an optional hostname, and the Flutter list switches between a
wide headered layout and a compact ListTile under 600px. Per-row overflow
menu retains View details / Register / Forget actions.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
rzuasti
2026-05-30 11:09:55 -04:00
co-authored by Claude Opus 4.7
parent 29f836f281
commit 3a579f0321
10 changed files with 939 additions and 285 deletions
+11
View File
@@ -53,6 +53,7 @@ Future<void> showRegisterDeviceDialog(
) async {
final formKey = GlobalKey<FormState>();
String owner = '';
String name = device.name ?? '';
DeviceType deviceType = device.deviceType;
final saved = await showDialog<bool>(
@@ -83,6 +84,15 @@ Future<void> showRegisterDeviceDialog(
onSaved: (value) => owner = value?.trim() ?? '',
),
const SizedBox(height: 16),
TextFormField(
initialValue: name,
decoration: const InputDecoration(
labelText: 'Name (optional)',
),
onFieldSubmitted: (_) => save(),
onSaved: (value) => name = value?.trim() ?? '',
),
const SizedBox(height: 16),
DropdownButtonFormField<DeviceType>(
initialValue: deviceType,
decoration: const InputDecoration(labelText: 'Device Type'),
@@ -128,6 +138,7 @@ Future<void> showRegisterDeviceDialog(
device.macAddress,
owner,
deviceType.apiName,
name: name.isEmpty ? null : name,
);
if (!context.mounted) return;
UISnackbars.showSuccess(context, 'Device registered');