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
@@ -333,6 +333,8 @@ class _DeviceActionsMenu extends StatelessWidget {
onSelected: (value) async {
if (value == 'details') {
context.push('/devices/${device.macAddress}');
} else if (value == 'edit') {
await showEditDeviceDialog(context, device, onRefresh);
} else if (value == 'forget') {
await confirmForgetDevice(context, device, onRefresh);
} else if (value == 'register') {
@@ -341,6 +343,8 @@ class _DeviceActionsMenu extends StatelessWidget {
},
itemBuilder: (context) => [
const PopupMenuItem(value: 'details', child: Text('View details')),
if (device.isRegistered)
const PopupMenuItem(value: 'edit', child: Text('Edit')),
if (device.isRegistered)
const PopupMenuItem(value: 'forget', child: Text('Forget')),
if (!device.isRegistered)