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
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user