summaryrefslogtreecommitdiff
path: root/web/share/js/kvm/stream.js
diff options
context:
space:
mode:
authorMaxim Devaev <[email protected]>2023-03-19 01:17:31 +0200
committerMaxim Devaev <[email protected]>2023-03-19 02:16:20 +0200
commit84563553b8a2f00bbb4b1559029f77ad225627f4 (patch)
tree6795ccb04bff10d2c2bd09c1ce6381f381727007 /web/share/js/kvm/stream.js
parent097dbc517df4fcfb8d37d958744b1eb1f0e8d8b6 (diff)
fixed msd parts api
Diffstat (limited to 'web/share/js/kvm/stream.js')
-rw-r--r--web/share/js/kvm/stream.js18
1 files changed, 6 insertions, 12 deletions
diff --git a/web/share/js/kvm/stream.js b/web/share/js/kvm/stream.js
index 0239a27b..9a73ea56 100644
--- a/web/share/js/kvm/stream.js
+++ b/web/share/js/kvm/stream.js
@@ -176,19 +176,13 @@ export function Streamer() {
}
if (state.features.resolution) {
- if ($("stream-resolution-selector").resolutions !== state.limits.available_resolutions) {
- let resolutions_html = "";
- for (let variant of state.limits.available_resolutions) {
- resolutions_html += `<option value="${variant}">${variant}</option>`;
- }
- if (!state.limits.available_resolutions.includes(resolution_str)) {
- resolutions_html += `<option value="${resolution_str}">${resolution_str}</option>`;
- }
- $("stream-resolution-selector").innerHTML = resolutions_html;
- $("stream-resolution-selector").resolutions = state.limits.available_resolutions;
+ let el = $("stream-resolution-selector");
+ if (!state.limits.available_resolutions.includes(resolution_str)) {
+ state.limits.available_resolutions.push(resolution_str);
}
- document.querySelector(`#stream-resolution-selector [value="${resolution_str}"]`).selected = true;
- tools.el.setEnabled($("stream-resolution-selector"), true);
+ tools.selector.setValues(el, state.limits.available_resolutions);
+ tools.selector.setSelectedValue(el, resolution_str);
+ tools.el.setEnabled(el, true);
}
} else {