commit 10/10/2025

Broadcast Zones and Sound Channels
This commit is contained in:
2025-10-10 15:01:09 +07:00
parent fdc7556dd7
commit 41d6dd7f47
6 changed files with 96 additions and 79 deletions

View File

@@ -18,10 +18,9 @@ window.selectedSoundChannel = null;
* @param {SoundChannel[]} vv Sound channel data to populate the table.
*/
function fill_soundchanneltablebody(vv) {
let $tbody = $('#soundchanneltablebody');
let $btnEditSoundChannel = $('#btnEditSoundChannel');
let $tablesizeSoundChannel = $('#tablesizeSoundChannel');
$tbody.empty();
$('#soundchanneltablebody').empty();
$tablesizeSoundChannel.text('Table Length : N/A');
if (!Array.isArray(vv) || vv.length === 0) return;
@@ -32,9 +31,9 @@ function fill_soundchanneltablebody(vv) {
<td>${item.channel}</td>
<td>${item.ip}</td>
</tr>`;
$tbody.append(row);
$('#soundchanneltablebody').append(row);
let $addedrow = $('#soundchanneltablebody tr:last');
$addedrow.click(function () {
$addedrow.off('click').on('click', function () {
if (selectedSoundChannel) {
selectedSoundChannel.find('td').css('background-color', '');
if (selectedSoundChannel.is($(this))) {
@@ -83,7 +82,7 @@ $(document).ready(function () {
$btnEditSoundChannel.prop('disabled', true);
let API_SoundChannel = "SoundChannel/";
$findsoundchannel.on('input', function () {
$findsoundchannel.off('input').on('input', function () {
let searchTerm = $(this).val().toLowerCase();
if (searchTerm.length==0){
window.selectedSoundChannel = null;
@@ -109,7 +108,7 @@ $(document).ready(function () {
}
reloadSoundChannel(API_SoundChannel);
$btnReinitializeSoundChannel.click(() => {
$btnReinitializeSoundChannel.off('click').on('click', () => {
DoClear(API_SoundChannel, "SoundChannels", (okdata) => {
reloadSoundChannel(API_SoundChannel);
alert("Success clear sound channels: " + okdata.message);
@@ -117,7 +116,7 @@ $(document).ready(function () {
alert("Error clear sound channels: " + errdata.message);
});
});
$btnEditSoundChannel.click(() => {
$btnEditSoundChannel.off('click').on('click', () => {
if (selectedSoundChannel) {
let cells = selectedSoundChannel.find('td');
/** @type {SoundChannel} */
@@ -171,11 +170,11 @@ $(document).ready(function () {
}
}
});
$btnExportSoundChannel.click(() => {
$btnExportSoundChannel.off('click').on('click', () => {
DoExport(API_SoundChannel, "soundchannels.xlsx", {});
});
$btnImportSoundChannel.click(() => {
$btnImportSoundChannel.off('click').on('click', () => {
DoImport(API_SoundChannel, (okdata) => {
reloadSoundChannel(API_SoundChannel);
alert("Success import sound channels: " + okdata.message);