commit 23/09/2025

This commit is contained in:
2025-09-23 13:56:16 +07:00
parent 7c67fe90ee
commit 85ccf05634
8 changed files with 237 additions and 56 deletions

View File

@@ -123,7 +123,17 @@ $(document).ready(function () {
function clearBroadcastZoneModal() {
$broadcastzoneindex.prop('disabled', true).val('');
$broadcastzonedescription.val('');
$broadcastzonesoundchannel.val('');
// fill broadcastzonesoundchannel from SoundChannelList
$broadcastzonesoundchannel.empty();
if (Array.isArray(SoundChannelList) && SoundChannelList.length > 0) {
// SoundChannelList ada isinya
SoundChannelList.forEach(ch => {
if (ch.channel && ch.channel.length > 0){
// hanya yang punya channel saja
$broadcastzonesoundchannel.append($('<option>').val(ch.channel).text(ch.channel));
}
});
}
$broadcastzonebox.val('');
for (let i = 1; i <= 32; i++) {
cbRelay(i).prop('checked', false);
@@ -179,7 +189,7 @@ $(document).ready(function () {
Box: box,
Relay: relay
};
fetchAPI(APIURL_BroadcastZone + "Add", "POST", bz, null, (okdata) => {
fetchAPI(APIURL_BroadcastZone + "Add", "POST", {}, bz, (okdata) => {
reloadBroadcastZones(APIURL_BroadcastZone);
alert("Success add new broadcast zone: " + okdata.message);
}, (errdata) => {
@@ -272,7 +282,7 @@ $(document).ready(function () {
Box: box,
Relay: relay
};
fetchAPI(APIURL_BroadcastZone + "UpdateByIndex/" + bz.index, "PATCH", bzUpdate, null, (okdata) => {
fetchAPI(APIURL_BroadcastZone + "UpdateByIndex/" + bz.index, "PATCH", {}, bzUpdate, (okdata) => {
reloadBroadcastZones(APIURL_BroadcastZone);
alert("Success edit broadcast zone: " + okdata.message);
}, (errdata) => {