mirror of
https://github.com/rzuasti/oott.git
synced 2026-07-08 19:21:54 +02:00
Add Register and Forget actions to devices list
Adds a context menu to each device card with contextual actions: - Unregistered devices show a Register option (dialog with owner field and device type dropdown) - Registered devices show a Forget option (confirmation dialog) Also fixes CORS to allow PUT and DELETE methods, adds device type tooltips on the icon, and renames the "New" filter/badge to "Not registered". Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
d0b9855bad
commit
3094753587
@@ -98,6 +98,24 @@ class BackendAPI {
|
||||
.toList();
|
||||
}
|
||||
|
||||
Future<void> registerDevice(
|
||||
String macAddress,
|
||||
String owner,
|
||||
String deviceType,
|
||||
) async {
|
||||
debugPrint('About to call PUT /devices');
|
||||
await _dio.put('/devices', data: {
|
||||
'mac_address': macAddress,
|
||||
'owner': owner,
|
||||
'device_type': deviceType,
|
||||
});
|
||||
}
|
||||
|
||||
Future<void> forgetDevice(String macAddress) async {
|
||||
debugPrint('About to call DELETE /devices/$macAddress');
|
||||
await _dio.delete('/devices/$macAddress');
|
||||
}
|
||||
|
||||
Future<List<Notification>> listNotifications(bool? isNew, int offset) async {
|
||||
debugPrint('About to call /notifications');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user