From 1adb8b8f5dba7d900c692f11067ec2cd5f5b5601 Mon Sep 17 00:00:00 2001 From: viktorxda <35473052+viktorxda@users.noreply.github.com> Date: Tue, 25 Feb 2025 15:18:26 +0100 Subject: [PATCH] [no ci] Update wifibroadcast-ng (#1730) --- .../package/wifibroadcast-ng/files/wfb.yaml | 6 +- .../wifibroadcast-ng/files/wifibroadcast | 16 ++--- .../package/wifibroadcast-ng/www/index.html | 24 +++---- .../package/wifibroadcast-ng/www/script.js | 21 ++---- .../package/wifibroadcast-ng/www/style.css | 65 +++++++++++-------- 5 files changed, 68 insertions(+), 64 deletions(-) diff --git a/general/package/wifibroadcast-ng/files/wfb.yaml b/general/package/wifibroadcast-ng/files/wfb.yaml index 4b87d211..fe8e8a59 100644 --- a/general/package/wifibroadcast-ng/files/wfb.yaml +++ b/general/package/wifibroadcast-ng/files/wfb.yaml @@ -1,12 +1,14 @@ wireless: txpower: 1 channel: 161 - mode: HT20 + width: HT20 broadcast: - wfb_index: 2 + mcs_index: 2 tun_index: 1 fec_k: 8 fec_n: 12 + stbc: 0 + ldpc: 0 link_id: 7669206 telemetry: router: msposd diff --git a/general/package/wifibroadcast-ng/files/wifibroadcast b/general/package/wifibroadcast-ng/files/wifibroadcast index fd817bfc..b6a557a5 100755 --- a/general/package/wifibroadcast-ng/files/wifibroadcast +++ b/general/package/wifibroadcast-ng/files/wifibroadcast @@ -55,25 +55,25 @@ load_modules() { load_interface() { iw "$wfb_dev" set monitor none - iw "$wfb_dev" set channel "$channel" "$mode" + iw "$wfb_dev" set channel "$channel" "$width" iw reg set 00 - [ "$driver" = "88XXau" ] && wfb_pwr=$((txpower * -100)) || wfb_pwr=$((txpower * 50)) - iw "$wfb_dev" set txpower fixed "$wfb_pwr" - [ "$mode" = "HT20" ] && bandwidth=20 || bandwidth=40 + [ "$driver" = "88XXau" ] && wfb_power=$((txpower * -100)) || wfb_power=$((txpower * 50)) + iw "$wfb_dev" set txpower fixed "$wfb_power" + [ "$width" = "HT20" ] && wfb_width=20 || wfb_width=40 } start_broadcast() { echo_log "Starting wfb_tx" - wfb_tx -K "$wfb_key" -M "$wfb_index" -B "$bandwidth" -C 8000 -G short \ - -k "$fec_k" -n "$fec_n" -i "$link_id" "$wfb_dev" &> /dev/null & + wfb_tx -K "$wfb_key" -M "$mcs_index" -B "$wfb_width" -k "$fec_k" -n "$fec_n" \ + -S "$stbc" -L "$ldpc" -i "$link_id" -C 8000 -G short "$wfb_dev" &> /dev/null & } start_tunnel() { echo_log "Starting wfb_tun" wfb_rx -p 160 -u 5800 -K "$wfb_key" -i "$link_id" "$wfb_dev" &> /dev/null & - wfb_tx -p 32 -u 5801 -K "$wfb_key" -M "$tun_index" \ - -k "$fec_k" -n "$fec_n" -i "$link_id" "$wfb_dev" &> /dev/null & + wfb_tx -p 32 -u 5801 -K "$wfb_key" -M "$tun_index" -k "$fec_k" -n "$fec_n" \ + -S "$stbc" -L "$ldpc" -i "$link_id" "$wfb_dev" &> /dev/null & wfb_tun -a 10.5.0.10/24 > /dev/null & } diff --git a/general/package/wifibroadcast-ng/www/index.html b/general/package/wifibroadcast-ng/www/index.html index 1d38607e..52552926 100644 --- a/general/package/wifibroadcast-ng/www/index.html +++ b/general/package/wifibroadcast-ng/www/index.html @@ -12,11 +12,11 @@ -
-
- -
+
+ +
+

Video

@@ -41,7 +41,7 @@
- +
@@ -53,7 +53,7 @@
- + -
-
- - + +

@@ -142,6 +140,8 @@ +
+
diff --git a/general/package/wifibroadcast-ng/www/script.js b/general/package/wifibroadcast-ng/www/script.js index ba09b211..e12cb14f 100644 --- a/general/package/wifibroadcast-ng/www/script.js +++ b/general/package/wifibroadcast-ng/www/script.js @@ -22,6 +22,10 @@ async function runCommand(command) { }); } +if (navigator.userAgent.includes("Android")) { + document.querySelector('.video-section').style.display = 'none'; +} + function syncForm(data, formPrefix, mode) { Object.keys(data).forEach((section) => { Object.keys(data[section]).forEach((key) => { @@ -34,17 +38,10 @@ function syncForm(data, formPrefix, mode) { const value = data[section][key]; if (mode === "setup") { - if (isCheckbox) { - field.checked = value === true; - } else { - field.value = value; - } + isCheckbox ? field.checked = value === true : field.value = value; } else if (mode === "update") { - if (isCheckbox) { - data[section][key] = field.checked; - } else { - data[section][key] = field.value; - } + data[section][key] = isCheckbox ? + field.checked : (isNaN(field.value) ? field.value : Number(field.value)); } }); }); @@ -99,7 +96,3 @@ loadYAML('/etc/wfb.yaml', (data) => { configData.wfb = data; syncForm(configData.wfb, 'wfb', "setup"); }); - -if (navigator.userAgent.includes("Android")) { - document.querySelector('.video-section').style.display = 'none'; -} diff --git a/general/package/wifibroadcast-ng/www/style.css b/general/package/wifibroadcast-ng/www/style.css index 0abcaa61..ba936c23 100644 --- a/general/package/wifibroadcast-ng/www/style.css +++ b/general/package/wifibroadcast-ng/www/style.css @@ -19,69 +19,78 @@ h3 { color: #dee2e6bf; } -.row { - margin: 20px; +.container { + display: flex; + justify-content: space-evenly; + width: 100%; +} + +.form-section .row { + display: flex; + justify-content: space-between; + margin: 10px 40px; } .form-section { + width: 45%; + margin: 20px 0; + padding-top: 20px; background-color: #2d2d2d; border-radius: 4px; box-shadow: 0 2px 10px #00000080; - max-width: 60%; - padding: 20px; - margin: 20px auto; } .form-section label { + width: 10vw; + margin: 10px 0 5px; display: inline-block; font-weight: bold; - margin: 10px 0 5px; - width: 150px; - vertical-align: top; color: #dee2e6; + font-size: 0.9rem; } .form-section select { - width: 120px; + width: 16vw; padding: 10px; margin-bottom: 15px; + background-color: #3c3c3c; border-radius: 4px; border: 1px solid #555; - background-color: #3c3c3c; color: #dcdcdc; - display: inline-block; - box-sizing: border-box; + font-size: 0.9rem; } .form-section input { - width: 120px; - height: 25px; + width: 16vw; + height: 26px; + margin-bottom: 25px; +} + +.form-section button { + width: 20vw; + padding: 10px; + margin: 10px; + border: none; + cursor: pointer; + font-size: 1rem; + color: white; + border-radius: 4px; + box-shadow: 0 2px 10px #00000040; } .button-container { display: flex; flex-direction: column; align-items: center; -} - -.form-section button { - width: 160px; - padding: 10px; - margin: 10px; - border: none; - border-radius: 4px; - cursor: pointer; - font-size: 1rem; - color: white; - box-shadow: 0 2px 10px #00000040; + margin: 25px; } #preview { width: 100%; - max-width: 80%; + max-width: 75%; background-color: #000; - box-shadow: 0 2px 10px #00000080; border-radius: 4px; + box-shadow: 0 2px 10px #00000080; } #apply-video-button, #apply-wfb-button {