feat(backend): live connection and per-device settings for paired screens (platform-v2 3.1a)
- WebSocket: credentials may come in the first frame ({cursor, token?, device?}).
A device token alone connects a paired screen (login-none apps get every event, a
sign-in app only events addressed to it); a terminal session's JWT needs its own
device, as over HTTP. Refusals send {type: refused, data: {code}} + close 4001/4003.
- ws_bus: registry of open sockets by user, session and device. Ending a session
closes its sockets (session.ended); revoke/reassign close the device's sockets
(device.revoked / device.updated); edits and module on/off send device.updated.
Events can target devices (device_ids=..., sync_events.target_device_ids, rev 0014).
Pushes go through each socket's own loop (call_soon_threadsafe).
- Device config: DeviceApp.config = typed ConfigFields, validated on pair/edit/
reassign (validation.device_config), effective values (defaults filled) in both
device views and the module catalogue. First field: auto_sign_out_minutes (KDS, POS).
- Manager: DeviceConfigFields renders an app's fields in the pair and edit dialogs.
- @xenia/api createLiveClient: `credentials` and `onRefused` options.
- Tests: tests/test_live.py (11), module texts for config fields, live client,
devices logic, manager.mjs device setting + live socket checks.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -54,7 +54,8 @@
|
||||
"invalid": "Κάποια πεδία δεν είναι σωστά.",
|
||||
"unknown_language": "Μη υποστηριζόμενη γλώσσα: {{language}}.",
|
||||
"unknown_timezone": "Άγνωστη ζώνη ώρας: {{timezone}}.",
|
||||
"setting_value": "Η ρύθμιση {{key}} δεν μπορεί να πάρει την τιμή «{{value}}»."
|
||||
"setting_value": "Η ρύθμιση {{key}} δεν μπορεί να πάρει την τιμή «{{value}}».",
|
||||
"device_config": "Αυτή η ρύθμιση συσκευής δεν είναι έγκυρη: {{key}}."
|
||||
},
|
||||
"internal": {
|
||||
"error": "Κάτι πήγε στραβά στον διακομιστή (αίτημα {{request_id}})."
|
||||
|
||||
@@ -172,6 +172,7 @@
|
||||
"signIn": "Πώς συνδέεται το προσωπικό",
|
||||
"link": "Συνδεδεμένη συσκευή",
|
||||
"noLink": "Καμία",
|
||||
"none": "Κανένα",
|
||||
"linkHint": "Για παράδειγμα μια οθόνη πελάτη που δείχνει την παραγγελία ενός ταμείου πάγκου.",
|
||||
"full": "{{label}}: η άδεια επιτρέπει {{max}} και χρησιμοποιούνται όλα. Αφαιρέστε μία ή ζητήστε μεγαλύτερη άδεια.",
|
||||
"noApps": "Καμία εφαρμογή συσκευών δεν είναι ενεργή. Ενεργοποιήστε μία πρώτα από τις Εφαρμογές."
|
||||
|
||||
@@ -125,6 +125,20 @@
|
||||
"permissions": {
|
||||
"access": "Χρήση της οθόνης κουζίνας",
|
||||
"bump": "Σήμανση πιάτων ως έτοιμων"
|
||||
},
|
||||
"config": {
|
||||
"auto_sign_out_minutes": {
|
||||
"label": "Αποσύνδεση μετά από",
|
||||
"hint": "Επιστροφή στην οθόνη σύνδεσης όταν κανείς δεν έχει χρησιμοποιήσει την οθόνη για τόσο χρόνο.",
|
||||
"choices": {
|
||||
"0": "Ποτέ",
|
||||
"2": "2 λεπτά",
|
||||
"5": "5 λεπτά",
|
||||
"10": "10 λεπτά",
|
||||
"30": "30 λεπτά",
|
||||
"60": "1 ώρα"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"menu_tablet": {
|
||||
@@ -169,6 +183,20 @@
|
||||
},
|
||||
"permissions": {
|
||||
"access": "Χρήση του ταμείου πάγκου"
|
||||
},
|
||||
"config": {
|
||||
"auto_sign_out_minutes": {
|
||||
"label": "Αποσύνδεση μετά από",
|
||||
"hint": "Επιστροφή στην οθόνη σύνδεσης όταν κανείς δεν έχει χρησιμοποιήσει την οθόνη για τόσο χρόνο.",
|
||||
"choices": {
|
||||
"0": "Ποτέ",
|
||||
"2": "2 λεπτά",
|
||||
"5": "5 λεπτά",
|
||||
"10": "10 λεπτά",
|
||||
"30": "30 λεπτά",
|
||||
"60": "1 ώρα"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"pricing": {
|
||||
|
||||
@@ -54,7 +54,8 @@
|
||||
"invalid": "Some fields are invalid.",
|
||||
"unknown_language": "Unsupported language: {{language}}.",
|
||||
"unknown_timezone": "Unknown time zone: {{timezone}}.",
|
||||
"setting_value": "{{key}} can't be set to \"{{value}}\"."
|
||||
"setting_value": "{{key}} can't be set to \"{{value}}\".",
|
||||
"device_config": "This device setting is not valid: {{key}}."
|
||||
},
|
||||
"internal": {
|
||||
"error": "Something went wrong on the server (request {{request_id}})."
|
||||
|
||||
@@ -172,6 +172,7 @@
|
||||
"signIn": "How staff sign in",
|
||||
"link": "Linked device",
|
||||
"noLink": "None",
|
||||
"none": "None",
|
||||
"linkHint": "For example a customer display that shows a counter POS's order.",
|
||||
"full": "{{label}}: the license allows {{max}}, all in use. Remove one or ask for a bigger license.",
|
||||
"noApps": "No device app is turned on. Turn one on in Apps first."
|
||||
|
||||
@@ -125,6 +125,20 @@
|
||||
"permissions": {
|
||||
"access": "Use the kitchen display",
|
||||
"bump": "Mark items ready"
|
||||
},
|
||||
"config": {
|
||||
"auto_sign_out_minutes": {
|
||||
"label": "Sign out after",
|
||||
"hint": "Back to the sign-in screen when nobody has used the screen for this long.",
|
||||
"choices": {
|
||||
"0": "Never",
|
||||
"2": "2 minutes",
|
||||
"5": "5 minutes",
|
||||
"10": "10 minutes",
|
||||
"30": "30 minutes",
|
||||
"60": "1 hour"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"menu_tablet": {
|
||||
@@ -169,6 +183,20 @@
|
||||
},
|
||||
"permissions": {
|
||||
"access": "Use the counter POS"
|
||||
},
|
||||
"config": {
|
||||
"auto_sign_out_minutes": {
|
||||
"label": "Sign out after",
|
||||
"hint": "Back to the sign-in screen when nobody has used the screen for this long.",
|
||||
"choices": {
|
||||
"0": "Never",
|
||||
"2": "2 minutes",
|
||||
"5": "5 minutes",
|
||||
"10": "10 minutes",
|
||||
"30": "30 minutes",
|
||||
"60": "1 hour"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"pricing": {
|
||||
|
||||
Reference in New Issue
Block a user