commit 27/10/2025

This commit is contained in:
2025-10-27 17:27:19 +07:00
parent 0ef35b2b0c
commit cbd5ea59d3
19 changed files with 187 additions and 98 deletions

View File

@@ -401,7 +401,7 @@ table {
}
.div-file-list {
height: 20vh;
height: 150px;
overflow-y: auto;
overflow-x: hidden;
padding: 10px;
@@ -433,3 +433,12 @@ table {
border-bottom: 1px dashed #000000;
}
.pad-left {
margin-left: 1rem;
}
.btn-download {
background-color: #2d3578;
color: white;
}

View File

@@ -262,7 +262,7 @@ $(document).ready(function () {
}
if (allValid) {
if (confirm(`Are you sure want to upload ${files.length} file(s) to the soundbank directory for Category: ${$("#setting_category").val()}, Language: ${$("#setting_language").val()}, Voice Type: ${$("#setting_voice").val()}?`)) {
let url = `api/Settings/UploadSoundbank/${lang}/${voice}/${category}`;
let url = `api/FileManager/UploadSoundbank/${lang}/${voice}/${category}`;
const formdata = new FormData();
for (let i = 0; i < files.length; i++) {
formdata.append('files', files[i]);
@@ -275,6 +275,8 @@ $(document).ready(function () {
.then(response => response.json())
.then(okdata => {
console.log("Upload result: ", JSON.stringify(okdata));
change_droparea_enable();
alert("Files uploaded successfully to soundbank directory.");
})
.catch(errdata => {
alert("Error uploading files to soundbank directory : " + errdata.message);

View File

@@ -1,8 +1,3 @@
/**
* Load message bank data into selection dropdowns
* @param {Function || null} cbOK callback when complete
@@ -39,6 +34,32 @@ function load_remark_selection() {
});
}
function Get_OldResultDays(){
fetchAPI("Settings/OldResultDays", "GET", {}, null, (okdata) => {
let days = parseInt(okdata.message);
if(isNaN(days) || days < 0){
days = 3;
}
$("#oldresultdays").val(days);
}, (errdata) => {
alert("Error getting Old Result Days : " + errdata.message);
});
}
function Set_OldResultDays(){
let days = parseInt($("#oldresultdays").val());
if(isNaN(days) || days < 0){
alert("Please enter a valid number of days (0 or more).");
return;
}
fetchAPI("Settings/OldResultDays", "POST", {}, { days: days }, (okdata) => {
alert("Old Result Days updated successfully.");
}, (errdata) => {
alert("Error updating Old Result Days : " + errdata.message);
});
}
function load_default_voice(){
$("#input_defaultvoice").empty();
window.voiceTypes.forEach((voice) => {
@@ -49,8 +70,10 @@ function load_default_voice(){
$(document).ready(function () {
console.log("setting.js loaded");
load_default_voice();
Get_OldResultDays();
load_messagebank(() => load_remark_selection());
$("#fiscodesave").off('click').on('click', function () {
Set_OldResultDays();
let gop = $("#input_GOP").val();
let gbd = $("#input_GBD").val();
let gfc = $("#input_GFC").val();