mirror of
https://github.com/rzuasti/oott.git
synced 2026-07-08 19:21:54 +02:00
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:
co-authored by
Claude Opus 4.7
parent
3a579f0321
commit
0f6296759d
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user