summaryrefslogtreecommitdiff
path: root/web/share/js/kvm/stream.js
diff options
context:
space:
mode:
authorMaxim Devaev <[email protected]>2024-03-25 01:01:21 +0200
committerMaxim Devaev <[email protected]>2024-03-25 01:29:43 +0200
commit71e5e4d138ebc36644b022aa18e5990caa4bf9c5 (patch)
tree4ee39613616ef9bdd403c82a0e6ad34ec11315b7 /web/share/js/kvm/stream.js
parent1d48ba0a5a4f347321f7f46cd0fe317e3c87d3df (diff)
refactoring
Diffstat (limited to 'web/share/js/kvm/stream.js')
-rw-r--r--web/share/js/kvm/stream.js16
1 files changed, 6 insertions, 10 deletions
diff --git a/web/share/js/kvm/stream.js b/web/share/js/kvm/stream.js
index 202379d7..b811a657 100644
--- a/web/share/js/kvm/stream.js
+++ b/web/share/js/kvm/stream.js
@@ -295,11 +295,9 @@ export function Streamer() {
wm.confirm("Are you sure you want to reset stream?").then(function (ok) {
if (ok) {
__resetStream();
- let http = tools.makeRequest("POST", "/api/streamer/reset", function() {
- if (http.readyState === 4) {
- if (http.status !== 200) {
- wm.error("Can't reset stream:<br>", http.responseText);
- }
+ tools.httpPost("/api/streamer/reset", function(http) {
+ if (http.status !== 200) {
+ wm.error("Can't reset stream:<br>", http.responseText);
}
});
}
@@ -307,11 +305,9 @@ export function Streamer() {
};
var __sendParam = function(name, value) {
- let http = tools.makeRequest("POST", `/api/streamer/set_params?${name}=${value}`, function() {
- if (http.readyState === 4) {
- if (http.status !== 200) {
- wm.error("Can't configure stream:<br>", http.responseText);
- }
+ tools.httpPost(`/api/streamer/set_params?${name}=${value}`, function(http) {
+ if (http.status !== 200) {
+ wm.error("Can't configure stream:<br>", http.responseText);
}
});
};