commit 28/10/2025

This commit is contained in:
2025-10-28 15:42:40 +07:00
parent 1f979fba9a
commit a4e655a932
23 changed files with 29088 additions and 318 deletions

28905
html/webpage/assets/css/all.min.css vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -93,7 +93,6 @@ function change_droparea_enable() {
}
});
});
console.log(`Selected Category: ${selected_category}, Language: ${selected_language}, Voice: ${selected_voice}`);
if (selected_category && selected_language && selected_voice) {
$("#drop-area").removeClass("disabled");
getSoundBankFiles(selected_category, selected_language, selected_voice);
@@ -112,7 +111,6 @@ function get_soundbank_path() {
fetchAPI("Settings/SoundbankDirectory", "GET", {}, null, (okdata) => {
if (okdata.message && okdata.message.trim().length > 0) {
let path = okdata.message.trim();
//console.log("Soundbank path retrieved: " + path);
$("#setting_path").val(path);
}
}, (errdata) => {
@@ -164,17 +162,12 @@ function play(path, filename, cbplay = null) {
const player = document.getElementById("audioplayer");
if (player) {
player.pause();
if (window.lastplaybutton){
let $icon = $(window.lastplaybutton).find("i");
$icon.removeClass("fa-stop").addClass("fa-play");
}
player.src = url;
player.load();
$("#audioplayer").show();
player.play();
player.onplay = () => {
console.log("Playing audio file: " + filename);
if (cbplay && typeof cbplay === "function") {
cbplay();
}
@@ -198,35 +191,38 @@ function get_pagingresult_files() {
$("#tbody_resultpaging").empty();
fetchAPI(url, "GET", {}, null, (okdata) => {
if (Array.isArray(okdata) && okdata.length > 0) {
console.log("Paging result files: ", JSON.stringify(okdata));
okdata.forEach((file) => {
let filename = file.split(/[/\\]/).pop();
let $tr = $("<tr></tr>");
let $tdtitle = $("<td></td>").text(filename);
// add button inside td to download the file
let $btndownload = $("<button></button>").addClass("btn btn-primary").html("<i class='fa-solid fa-download'></i>");
let $btnplay = $("<button></button>").addClass("btn btn-primary").html("<i class='fa-solid fa-play'></i>");
$btndownload.on('click', function () {
let $btndownload = $("<button></button>").addClass("btn btn-primary").html("<i class='fa fa-download'></i>");
let $btnplay = $("<button></button>").addClass("btn btn-success pad-btn").html("<i class='fa fa-play'></i>");
$btndownload.off('click').on('click', function () {
download("DownloadPagingResultFile", filename);
});
$btnplay.on('click', function () {
let $icon = $(this).find("i");
$btnplay.off('click').on('click', function () {
const $icon = $(this).find("svg");
if ($icon.hasClass("fa-stop")) {
// stop playback
const player = document.getElementById("audioplayer");
if (player) {
player.pause();
window.URL.revokeObjectURL(player.src);
window.lastplaybutton = null;
$icon.removeClass("fa-stop").addClass("fa-play");
}
} else {
// start playback
play("PlayPagingResultFile", filename, () => {
window.lastplaybutton = $btnplay;
$icon.removeClass("fa-play").addClass("fa-stop");
if (window.lastplaybutton){
if (window.lastplaybutton !== $(this)){
const $lasticon = window.lastplaybutton.find("svg");
$lasticon.removeClass("fa-stop").addClass("fa-play");
}
}
window.lastplaybutton = $(this);
});
}
$icon.toggleClass("fa-play fa-stop");
});
let $tdbutton = $("<td></td>").append($btndownload).append($btnplay).addClass("text-center");
@@ -245,37 +241,40 @@ function get_soundbankresult_files() {
$("#tbody_resultsoundbank").empty();
fetchAPI(url, "GET", {}, null, (okdata) => {
if (Array.isArray(okdata) && okdata.length > 0) {
console.log("Soundbank result files: ", JSON.stringify(okdata));
okdata.forEach((file) => {
let filename = file.split(/[/\\]/).pop();
let $tr = $("<tr></tr>");
let $tdtitle = $("<td></td>").text(filename);
// add button inside td to download and play the file
let $btndownload = $("<button></button>").addClass("btn btn-primary").html("<i class='fa-solid fa-download'></i>");
let $btnplay = $("<button></button>").addClass("btn btn-primary").html("<i class='fa-solid fa-play'></i>");
let $btndownload = $("<button></button>").addClass("btn btn-primary").html("<i class='fa fa-download'></i>");
let $btnplay = $("<button></button>").addClass("btn btn-success").html("<i class='fa fa-play'></i>");
let $tdbutton = $("<td></td>").append($btndownload).append($btnplay).addClass("text-center");
$btndownload.on('click', function () {
$btndownload.off('click').on('click', function () {
download("DownloadSoundbankResultFile", filename);
});
$btnplay.on('click', function () {
let $icon = $(this).find("i");
$btnplay.off('click').on('click', function () {
const $icon = $(this).find("svg");
if ($icon.hasClass("fa-stop")) {
// stop playback
const player = document.getElementById("audioplayer");
if (player) {
player.pause();
window.URL.revokeObjectURL(player.src);
window.lastplaybutton = null;
$icon.removeClass("fa-stop").addClass("fa-play");
}
} else {
// start playback
play("PlaySoundbankResultFile", filename, () => {
window.lastplaybutton = $btnplay;
$icon.removeClass("fa-play").addClass("fa-stop");
if (window.lastplaybutton){
if (window.lastplaybutton !== $(this)){
const $lasticon = window.lastplaybutton.find("svg");
$lasticon.removeClass("fa-stop").addClass("fa-play");
}
}
window.lastplaybutton = $(this);
});
}
$icon.toggleClass("fa-play fa-stop");
});
$tr.append($tdtitle);
$tr.append($tdbutton);
@@ -290,7 +289,7 @@ function get_soundbankresult_files() {
$(document).ready(function () {
console.log("filemanagement.js xx loaded");
console.log("filemanagement.js x3 loaded");
load_setting_category();
load_setting_language();
@@ -380,4 +379,55 @@ $(document).ready(function () {
} else alert("Please select Language before uploading files.");
});
$("#clear_soundbank").off('click').on('click', function () {
if (confirm("Are you sure want to delete all soundbank result files from the server? This action cannot be undone.")) {
fetchAPI("FileManager/ClearSoundbankResultFiles","DELETE",{},null,(okdata)=>{
alert("All soundbank result files have been deleted from the server.");
get_soundbankresult_files();
},(errdata)=>{
alert("Error deleting soundbank result files : " + errdata.message);
});
}
});
$("#reload_soundbank").off('click').on('click', function () {
get_soundbankresult_files();
});
$("#search_soundbank").off('input').on('input', function () {
let searchTerm = $(this).val().toLowerCase();
// find inside tbody_resultsoundbank, <tr> that have <td> with <p> containing the search term
$("#tbody_resultsoundbank tr").each(function () {
let fileName = $(this).find("td:first").text().toLowerCase();
if (fileName.includes(searchTerm)) {
$(this).show();
} else {
$(this).hide();
}
});
});
$("#clear_paging").off('click').on('click', function () {
if (confirm("Are you sure want to delete all paging result files from the server? This action cannot be undone.")) {
fetchAPI("FileManager/ClearPagingResultFiles","DELETE",{},null,(okdata)=>{
alert("All paging result files have been deleted from the server.");
get_pagingresult_files();
},(errdata)=>{
alert("Error deleting paging result files : " + errdata.message);
});
}
});
$("#reload_paging").off('click').on('click', function () {
get_pagingresult_files();
});
$("#search_paging").off('input').on('input', function () {
let searchTerm = $(this).val().toLowerCase();
// find inside tbody_resultpaging, <tr> that have <td> with <p> containing the search term
$("#tbody_resultpaging tr").each(function () {
let fileName = $(this).find("td:first").text().toLowerCase();
if (fileName.includes(searchTerm)) {
$(this).show();
} else {
$(this).hide();
}
});
});
});

View File

@@ -69,7 +69,7 @@ function UpdateStreamerCard(values) {
if (card.title) card.title.text(vv.channel ? vv.channel : `Channel ${i.toString().padStart(2, '0')}`);
if (card.ip) card.ip.text(`IP Address: ${vv.ipaddress ? vv.ipaddress : 'N/A'}`);
if (card.buffer) card.buffer.text(`Buffer: ${vv.bufferRemain !== undefined && vv.bufferRemain !== null ? vv.bufferRemain.toString() : 'N/A'}`);
if (card.status) card.status.text(`Status: ${vv.isPlaying ? 'Playing' : 'Stopped'}`);
if (card.status) card.status.text(`Status: ${vv.isPlaying ? 'Playing' : 'Idle'}`);
if (card.vu) {
setProgress(i, card.vu, vv.vu, 100);
}

View File

@@ -14,6 +14,7 @@
<link rel="stylesheet" href="assets/css/Font%20Awesome%206%20Pro.css">
<link rel="stylesheet" href="assets/css/FontAwesome.css">
<link rel="stylesheet" href="assets/css/bss-overrides.css">
<link rel="stylesheet" href="assets/css/all.min.css">
<link rel="stylesheet" href="assets/css/Login-Form-Basic-icons.css">
<link rel="stylesheet" href="assets/css/styles.css">
</head>

View File

@@ -14,6 +14,7 @@
<link rel="stylesheet" href="assets/css/Font%20Awesome%206%20Pro.css">
<link rel="stylesheet" href="assets/css/FontAwesome.css">
<link rel="stylesheet" href="assets/css/bss-overrides.css">
<link rel="stylesheet" href="assets/css/all.min.css">
<link rel="stylesheet" href="assets/css/Login-Form-Basic-icons.css">
<link rel="stylesheet" href="assets/css/styles.css">
</head>

View File

@@ -14,6 +14,7 @@
<link rel="stylesheet" href="assets/css/Font%20Awesome%206%20Pro.css">
<link rel="stylesheet" href="assets/css/FontAwesome.css">
<link rel="stylesheet" href="assets/css/bss-overrides.css">
<link rel="stylesheet" href="assets/css/all.min.css">
<link rel="stylesheet" href="assets/css/select2.min.css">
<link rel="stylesheet" href="assets/css/Login-Form-Basic-icons.css">
<link rel="stylesheet" href="assets/css/styles.css">

View File

@@ -14,6 +14,7 @@
<link rel="stylesheet" href="assets/css/Font%20Awesome%206%20Pro.css">
<link rel="stylesheet" href="assets/css/FontAwesome.css">
<link rel="stylesheet" href="assets/css/bss-overrides.css">
<link rel="stylesheet" href="assets/css/all.min.css">
<link rel="stylesheet" href="assets/css/Login-Form-Basic-icons.css">
<link rel="stylesheet" href="assets/css/styles.css">
</head>

View File

@@ -14,6 +14,7 @@
<link rel="stylesheet" href="assets/css/Font%20Awesome%206%20Pro.css">
<link rel="stylesheet" href="assets/css/FontAwesome.css">
<link rel="stylesheet" href="assets/css/bss-overrides.css">
<link rel="stylesheet" href="assets/css/all.min.css">
<link rel="stylesheet" href="assets/css/Login-Form-Basic-icons.css">
<link rel="stylesheet" href="assets/css/styles.css">
</head>

View File

@@ -14,6 +14,7 @@
<link rel="stylesheet" href="assets/css/Font%20Awesome%206%20Pro.css">
<link rel="stylesheet" href="assets/css/FontAwesome.css">
<link rel="stylesheet" href="assets/css/bss-overrides.css">
<link rel="stylesheet" href="assets/css/all.min.css">
<link rel="stylesheet" href="assets/css/Login-Form-Basic-icons.css">
<link rel="stylesheet" href="assets/css/styles.css">
</head>

View File

@@ -14,6 +14,7 @@
<link rel="stylesheet" href="assets/css/Font%20Awesome%206%20Pro.css">
<link rel="stylesheet" href="assets/css/FontAwesome.css">
<link rel="stylesheet" href="assets/css/bss-overrides.css">
<link rel="stylesheet" href="assets/css/all.min.css">
<link rel="stylesheet" href="assets/css/Login-Form-Basic-icons.css">
<link rel="stylesheet" href="assets/css/styles.css">
</head>

View File

@@ -14,6 +14,7 @@
<link rel="stylesheet" href="assets/css/Font%20Awesome%206%20Pro.css">
<link rel="stylesheet" href="assets/css/FontAwesome.css">
<link rel="stylesheet" href="assets/css/bss-overrides.css">
<link rel="stylesheet" href="assets/css/all.min.css">
<link rel="stylesheet" href="assets/css/Login-Form-Basic-icons.css">
<link rel="stylesheet" href="assets/css/styles.css">
</head>

View File

@@ -14,6 +14,7 @@
<link rel="stylesheet" href="assets/css/Font%20Awesome%206%20Pro.css">
<link rel="stylesheet" href="assets/css/FontAwesome.css">
<link rel="stylesheet" href="assets/css/bss-overrides.css">
<link rel="stylesheet" href="assets/css/all.min.css">
<link rel="stylesheet" href="assets/css/Login-Form-Basic-icons.css">
<link rel="stylesheet" href="assets/css/styles.css">
</head>

View File

@@ -14,6 +14,7 @@
<link rel="stylesheet" href="assets/css/Font%20Awesome%206%20Pro.css">
<link rel="stylesheet" href="assets/css/FontAwesome.css">
<link rel="stylesheet" href="assets/css/bss-overrides.css">
<link rel="stylesheet" href="assets/css/all.min.css">
<link rel="stylesheet" href="assets/css/Login-Form-Basic-icons.css">
<link rel="stylesheet" href="assets/css/styles.css">
</head>

View File

@@ -14,6 +14,7 @@
<link rel="stylesheet" href="assets/css/Font%20Awesome%206%20Pro.css">
<link rel="stylesheet" href="assets/css/FontAwesome.css">
<link rel="stylesheet" href="assets/css/bss-overrides.css">
<link rel="stylesheet" href="assets/css/all.min.css">
<link rel="stylesheet" href="assets/css/Login-Form-Basic-icons.css">
<link rel="stylesheet" href="assets/css/styles.css">
</head>

View File

@@ -14,6 +14,7 @@
<link rel="stylesheet" href="assets/css/Font%20Awesome%206%20Pro.css">
<link rel="stylesheet" href="assets/css/FontAwesome.css">
<link rel="stylesheet" href="assets/css/bss-overrides.css">
<link rel="stylesheet" href="assets/css/all.min.css">
<link rel="stylesheet" href="assets/css/Login-Form-Basic-icons.css">
<link rel="stylesheet" href="assets/css/styles.css">
</head>

View File

@@ -14,6 +14,7 @@
<link rel="stylesheet" href="assets/css/Font%20Awesome%206%20Pro.css">
<link rel="stylesheet" href="assets/css/FontAwesome.css">
<link rel="stylesheet" href="assets/css/bss-overrides.css">
<link rel="stylesheet" href="assets/css/all.min.css">
<link rel="stylesheet" href="assets/css/Login-Form-Basic-icons.css">
<link rel="stylesheet" href="assets/css/styles.css">
</head>