yxw 2023-11-23 10:47:43 +08:00
parent 037e5ce534
commit 3d87ce6dab
1 changed files with 29 additions and 16 deletions

View File

@ -303,7 +303,8 @@
<div style="width: 200px;">
<div class="d-flex justify-content-center align-items-center" style="height: 30px;">
<div class="d-flex redio-switche">
<input type="checkbox" disabled checked="checked" class="btn-check" name="mic1" id="mic1-on">
<input type="checkbox" disabled checked="checked" class="btn-check" name="mic1"
id="mic1-on">
<label class="btn btn-sm redio-btn on-btn" for="mic1-on">PHANTOM (48V)</label>
</div>
</div>
@ -509,7 +510,8 @@
<div style="width: 200px;">
<div class="d-flex justify-content-center align-items-center" style="height: 30px;">
<div class="d-flex redio-switche">
<input type="checkbox" disabled checked="checked" class="btn-check" name="mic2" id="mic2-on">
<input type="checkbox" disabled checked="checked" class="btn-check" name="mic2"
id="mic2-on">
<label class="btn btn-sm redio-btn on-btn" for="mic2-on">PHANTOM (48V)</label>
</div>
</div>
@ -972,7 +974,7 @@
$("#lineinput input[name='lineinput']").on('click', function () {
let url = "http://192.168.0.116/cgi-bin/test.cgi"
let postData = {
action:'home_set',
action: 'home_set',
subaction: 'lineinput',
signal: $("input[name='lineinput']:checked").val(),
module: 'lineinput'
@ -1015,7 +1017,7 @@
let url = "http://192.168.0.116/cgi-bin/test.cgi"
let state = $("input[name='lineinput-voice-close']:checked").val() == 'on'
let postData = {
action:'home_set',
action: 'home_set',
subaction: 'lineinput',
state: state ? "close" : "open",
module: 'lineinput'
@ -1060,7 +1062,7 @@
let url = "http://192.168.0.116/cgi-bin/test.cgi"
let state = $("input[name='microphone1-voice-close']:checked").val() == 'on'
let postData = {
action:'home_set',
action: 'home_set',
subaction: 'mic1',
state: state ? "close" : "open",
module: 'mic1'
@ -1106,7 +1108,7 @@
let url = "http://192.168.0.116/cgi-bin/test.cgi"
let state = $("input[name='microphone2-voice-close']:checked").val() == 'on'
let postData = {
action:'home_set',
action: 'home_set',
subaction: 'mic2',
state: state ? "close" : "open",
module: 'mic2'
@ -1150,7 +1152,7 @@
let url = "http://192.168.0.116/cgi-bin/test.cgi"
let state = $("input[name='outputvolume-voice-close']:checked").val() == 'on'
let postData = {
action:'home_set',
action: 'home_set',
subaction: 'output',
state: state ? "close" : "open",
module: 'output'
@ -1178,13 +1180,17 @@
// alert(state ? "close" : "open")
})
$("#lineinput .volume-slider input").on('change',function(){
alert(111);
})
})
function changeInputValue(module, number) {
let url = "http://192.168.0.116/cgi-bin/test.cgi"
let postData = {
action:'home_set',
action: 'home_set',
subaction: module,
audio: number,
module: module
@ -1201,22 +1207,18 @@
if (resData.success) {
if (module == 'lineinput') {
data.lineinput = resData.content.lineinput
lineinputValue = data.lineinput.audio
}
else if (module == 'mic1') {
data.mic1 = resData.content.mic1
mic1Value = data.mic1.audio
}
else if (module == 'mic2') {
data.mic2 = resData.content.mic2
mic2Value = data.mic2.audio
}
else {
data.output = resData.content.output
outputValue = data.mic2.audio
}
bindData()
}
@ -1299,10 +1301,21 @@
$("input[name='microphone1-voice-close']").attr('checked', data.mic1.state == 'close')
$("input[name='lineinput-voice-close']").attr('checked', data.lineinput.state == 'close')
LineInputSlider(data.lineinput.audio)
Microphone1Slider(data.mic1.audio)
Microphone2Slider(data.mic2.audio)
OutputVolumeSlider(data.output.audio)
if (data.lineinput.audio != lineinputValue) {
lineinputValue = data.lineinput.audio
LineInputSlider(data.lineinput.audio)
}
if (data.mic1.audio != mic1Value) {
mic1Value = data.mic1.audio
Microphone1Slider(data.mic1.audio)
}
if (data.mic2.audio != mic2Value) {
mic2Value = data.mic2.audio
Microphone2Slider(data.mic2.audio)
}
if (data.output.audio != outputValue) {
OutputVolumeSlider(data.output.audio)
}
}