Add edit dialog for registered devices

Extend PUT /api/devices/{mac} to accept an optional name and surface an
Edit action from both the device detail screen and the per-row overflow
menu, letting users modify owner, device type, vendor and name without
forgetting and re-registering.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
rzuasti
2026-05-30 11:27:52 -04:00
co-authored by Claude Opus 4.7
parent 3a579f0321
commit 0f6296759d
7 changed files with 186 additions and 18 deletions
+19 -8
View File
@@ -199,14 +199,25 @@ class _DeviceActions extends StatelessWidget {
final colorScheme = Theme.of(context).colorScheme;
if (device.isRegistered) {
return OutlinedButton.icon(
style: OutlinedButton.styleFrom(
foregroundColor: colorScheme.error,
side: BorderSide(color: colorScheme.error),
),
onPressed: () => confirmForgetDevice(context, device, onAction),
icon: const Icon(Icons.link_off),
label: const Text('Forget Device'),
return Wrap(
spacing: 12,
runSpacing: 12,
children: [
FilledButton.icon(
onPressed: () => showEditDeviceDialog(context, device, onAction),
icon: const Icon(Icons.edit),
label: const Text('Edit'),
),
OutlinedButton.icon(
style: OutlinedButton.styleFrom(
foregroundColor: colorScheme.error,
side: BorderSide(color: colorScheme.error),
),
onPressed: () => confirmForgetDevice(context, device, onAction),
icon: const Icon(Icons.link_off),
label: const Text('Forget Device'),
),
],
);
}
return FilledButton.icon(