Skip to content

Commit 9ed705b

Browse files
authored
dominant color processing on a full image + Fixes (#1856)
* Fix - Retries are not done when connection is destructed * Remove costly unpack and streamline code * Update Flatbuffer client code * Support for dominant color processing on a full image which is applied to all LEDs (#1853) * Allow uni dominant enums for API * Fix C&P issue * Missing remote buttons' text * Allow to provide additional details in error dialogue * Ensure UI getConfig always get instances * Stop API service when Hyperion is quitting * Update UI that Single and Multiple instance commands are correctly supported * Fix that effects are not created/deleted per instance * Fix dangling reference * Correct instance dependencies on API commaands * Add failing command to Error dialog * Fix - Return correct mapping type for a running instance * Update changelog * Cleanup Flatbuffer processing * Use switched instance for API calls without instance provided * Treat an empty instance array as "all instances" for multi-instance commands * Fixed - Last update of an effect event is not removed in sources overview * Translate no sources text element * Fix CodeQL finding * JSON API clean-up * Http-Server: Support Cross-Origin Resource Sharing (CORS) (#1496) * Dress CodeQL Findings (2)
1 parent d5664b6 commit 9ed705b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+612
-334
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1818
- Support for Skydimo devices
1919
- Support gaps on Matrix Layout (#1696)
2020
- Support a configurable grabber inactive detection time interval (#1740)
21+
- Support for dominant color processing on a full image which is applied to all LEDs (#1853)
2122
- Windows: Added a new grabber that uses the DXGI DDA (Desktop Duplication API). This has much better performance than the DX grabber as it does more of its work on the GPU.
2223
- Support to freely select source and target instances to be used by forwarder
2324
- Support to import, export and backup Hyperion's full configuration via the UI, JSON-API and commandline (`--importConfig, --exportConfig`) (#804)
2425
- Allow to force starting Hyperion in read-only mode (`--readonlyMode`)
2526
- Effects: Limit the maximum update rate to 200Hz
2627
- Systray: Support multiple instances
2728
- UI: Validate that key ports do not overlap across editors and pages
29+
- UI: Provide additional details in error dialogue
30+
- Http-Server: Support Cross-Origin Resource Sharing (CORS) (#1496)
2831

2932
**JSON-API**
3033
- New subscription support for event updates, i.e. `Suspend, Resume, Idle, idleResume, Restart, Quit`.
@@ -64,15 +67,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
6467
- Fixed that LED Buffer and Layout might get out of sync.
6568
- Fixed Screen capture error (#1824)
6669
- Fixed Provide custom forwarding targets is not possible (#1713)
70+
- Fixed Last update of an effect event is not removed in sources overview
6771

6872
**JSON-API**
6973
- Refactored JSON-API to ensure consistent authorization behaviour across sessions and single requests with token authorization.
7074
- Provide additional error details with API responses, esp. on JSON parsing, validation or token errors.
7175
- Generate random TANs for every API request from the Hyperion UI
7276
- Configuration requests do not any longer require a running instance
77+
- Ensure that API service does not process commands when Hyperion is quitting
7378
- Fixed: Handling of IP4 addresses wrapped in IPv6 for external network connections
7479
- Fixed: Local Admin API Authentication rejects valid tokens (#1251)
7580
- Fixed: Create a proper API response, when Effects are not part of a build
81+
- Fixed: Return correct mapping type for a running instance
7682

7783
### Removed
7884

assets/webconfig/i18n/en.json

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@
407407
"edt_conf_enum_dl_verbose2": "Verbosity level 2",
408408
"edt_conf_enum_dl_verbose3": "Verbosity level 3",
409409
"edt_conf_enum_dominant_color": "Dominant Color - per LED",
410-
"edt_conf_enum_dominant_color_advanced": "Dominant Color Advanced - per LED",
410+
"edt_conf_enum_dominant_color_advanced": "Dominant Color (advanced) - per LED",
411411
"edt_conf_enum_effect": "Effect",
412412
"edt_conf_enum_gbr": "GBR",
413413
"edt_conf_enum_grb": "GRB",
@@ -432,7 +432,9 @@
432432
"edt_conf_enum_transeffect_sudden": "Sudden",
433433
"edt_conf_enum_udp_ddp": "DDP",
434434
"edt_conf_enum_udp_raw": "RAW",
435-
"edt_conf_enum_unicolor_mean": "Mean Color Image - applied to all LEDs",
435+
"edt_conf_enum_unicolor_mean": "Image's mean color - applied to all LEDs",
436+
"edt_conf_enum_unicolor_dominant": "Image's dominant color - applied to all LEDs",
437+
"edt_conf_enum_unicolor_dominant_advanced": "Image's dominant color (advanced) - applied to all LEDs",
436438
"edt_conf_flatbufServer_heading_title": "Flatbuffer Server",
437439
"edt_conf_flatbufServer_timeout_expl": "If no data is received for the given period, the component will be (soft) disabled.",
438440
"edt_conf_flatbufServer_timeout_title": "Timeout",
@@ -1090,6 +1092,7 @@
10901092
"remote_input_ip": "IP:",
10911093
"remote_input_label": "Source Selection",
10921094
"remote_input_label_autoselect": "Auto Selection",
1095+
"remote_input_no_sources": "No sources available",
10931096
"remote_input_origin": "Origin",
10941097
"remote_input_owner": "Type",
10951098
"remote_input_priority": "Priority",
@@ -1099,11 +1102,13 @@
10991102
"remote_losthint": "Note: All changes will be lost after a restart.",
11001103
"remote_maptype_intro": "Usually the LED layout defines which LED covers a specific picture area. You can change it here: $1.",
11011104
"remote_maptype_label": "Mapping type",
1102-
"remote_maptype_label_dominant_color": "Dominant Color",
1103-
"remote_maptype_label_dominant_color_advanced": "Dominant Color Advanced",
1104-
"remote_maptype_label_multicolor_mean": "Mean Color Simple",
1105-
"remote_maptype_label_multicolor_mean_squared": "Mean Color Squared",
1106-
"remote_maptype_label_unicolor_mean": "Mean Color Image",
1105+
"remote_maptype_label_dominant_color": "Dominant Color - simple",
1106+
"remote_maptype_label_dominant_color_advanced": "Dominant Color - advanced",
1107+
"remote_maptype_label_multicolor_mean": "Mean Color - simple",
1108+
"remote_maptype_label_multicolor_mean_squared": "Mean Color - squared",
1109+
"remote_maptype_label_unicolor_dominant": "Dominant Color whole image - simple",
1110+
"remote_maptype_label_unicolor_dominant_advanced": "Dominant Color whole image - advanced",
1111+
"remote_maptype_label_unicolor_mean": "Mean Color whole image",
11071112
"remote_optgroup_syseffets": "System Effects",
11081113
"remote_optgroup_templates_custom": "User Templates",
11091114
"remote_optgroup_templates_system": "System Templates",
@@ -1228,6 +1233,9 @@
12281233
"wiz_yeelight_desc2": "Now choose which lamps should be added. The position assigns the lamp to a specific position on your \"picture\". Disabled lamps won't be added. To identify single lamps press the button on the right.",
12291234
"wiz_yeelight_intro1": "This wizard configures Hyperion for the Yeelight system. Features are the Yeelights' auto detection, setting each light to a specific position on your picture or disable it and tune the Hyperion settings automatically! So in short: All you need are some clicks and you are done!",
12301235
"wiz_yeelight_title": "Yeelight Wizard",
1231-
"wiz_yeelight_unsupported": "Unsupported"
1236+
"wiz_yeelight_unsupported": "Unsupported",
1237+
"ws_error_occured": "WebSocket error occured",
1238+
"ws_not_supported": "Websocket is not supported by your browser",
1239+
"ws_processing_exception": "Exception during Websocket message processing"
12321240
}
12331241

assets/webconfig/js/content_index.js

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -158,9 +158,10 @@ $(document).ready(function () {
158158
let instanceId = window.currentHyperionInstance;
159159
const config = event.response.info;
160160
const { instanceIds } = config;
161-
if (instanceIds.length !== 0) {
161+
162+
if (Array.isArray(instanceIds) && instanceIds.length !== 0) {
162163
if (!instanceIds.includes(window.currentHyperionInstance)) {
163-
// If instanceID is not valid try to switch to the first enabled or or fall back to the first instance configured
164+
// If instanceID is not valid try to switch to the first enabled or fall back to the first instance configured
164165
const { instances } = config;
165166

166167
const firstEnabledInstanceId = instances.find((instance) => instance.enabled)?.id;
@@ -170,7 +171,6 @@ $(document).ready(function () {
170171
} else {
171172
instanceId = window.currentHyperionInstance = instanceIds[0];
172173
}
173-
174174
}
175175
}
176176

@@ -242,11 +242,22 @@ $(document).ready(function () {
242242
$(window.hyperion).on("error", function (event) {
243243
//If we are getting an error "No Authorization" back with a set loginToken we will forward to new Login (Token is expired.
244244
//e.g.: hyperiond was started new in the meantime)
245-
if (event.reason == "No Authorization" && getStorage("loginToken")) {
245+
246+
const error = event.reason;
247+
248+
if (error?.message === "No Authorization" && getStorage("loginToken")) {
246249
removeStorage("loginToken");
247250
requestRequiresDefaultPasswortChange();
248251
} else {
249-
showInfoDialog("error", "Error", event.reason);
252+
const errorDetails = [];
253+
254+
if (error?.cmd) {
255+
errorDetails.push(`Command: "${error.cmd}"`);
256+
}
257+
258+
errorDetails.push(error?.details || "No additional details.");
259+
260+
showInfoDialog("error", "", error?.message || "Unknown error", errorDetails);
250261
}
251262
});
252263

assets/webconfig/js/content_remote.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,11 +124,17 @@ $(document).ready(function () {
124124
// Update input select options based on priorities
125125
function updateInputSelect() {
126126
// Clear existing elements
127-
$('.sstbody').empty();
127+
$('.sstbody').empty().html('');
128128

129129
const prios = window.serverInfo.priorities;
130130
let clearAll = false;
131131

132+
if (prios.length === 0) {
133+
$('.sstbody').append(`<tr><td colspan="4" class="text-center text-muted">${$.i18n('remote_input_no_sources')}</td></tr>`);
134+
$('#auto_btn').empty();
135+
return;
136+
}
137+
132138
// Iterate over priorities
133139
for (let i = 0; i < prios.length; i++) {
134140
let origin = prios[i].origin ? prios[i].origin : "System";

0 commit comments

Comments
 (0)