commit 27/10/2025
This commit is contained in:
2
.idea/deviceManager.xml
generated
2
.idea/deviceManager.xml
generated
@@ -5,7 +5,7 @@
|
|||||||
<list>
|
<list>
|
||||||
<ColumnSorterState>
|
<ColumnSorterState>
|
||||||
<option name="column" value="Name" />
|
<option name="column" value="Name" />
|
||||||
<option name="order" value="ASCENDING" />
|
<option name="order" value="DESCENDING" />
|
||||||
</ColumnSorterState>
|
</ColumnSorterState>
|
||||||
</list>
|
</list>
|
||||||
</option>
|
</option>
|
||||||
|
|||||||
@@ -1,11 +1,12 @@
|
|||||||
#Configuration file
|
#Configuration file
|
||||||
#Fri Oct 24 10:57:19 WIB 2025
|
#Mon Oct 27 15:51:50 WIB 2025
|
||||||
database.host=localhost
|
database.host=localhost
|
||||||
database.name=aas
|
database.name=aas
|
||||||
database.password=admin
|
database.password=admin
|
||||||
database.port=3306
|
database.port=3306
|
||||||
database.user=admin
|
database.user=admin
|
||||||
remark.FLD=Gate Change [4]
|
default.voice.type=VOICE_1
|
||||||
|
remark.FLD=Arrival [9]
|
||||||
remark.GBD=Second Call [2]
|
remark.GBD=Second Call [2]
|
||||||
remark.GFC=Last Call [3]
|
remark.GFC=Last Call [3]
|
||||||
remark.GOP=First Call [1]
|
remark.GOP=First Call [1]
|
||||||
|
|||||||
@@ -46,6 +46,10 @@
|
|||||||
margin-top: 0!important;
|
margin-top: 0!important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.mt-3 {
|
||||||
|
margin-top: 1rem!important;
|
||||||
|
}
|
||||||
|
|
||||||
.me-2 {
|
.me-2 {
|
||||||
margin-right: .5rem!important;
|
margin-right: .5rem!important;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -128,6 +128,66 @@ body {
|
|||||||
width: 25%;
|
width: 25%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.class30 {
|
||||||
|
width: 30%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.class35 {
|
||||||
|
width: 35%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.class40 {
|
||||||
|
width: 40%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.class45 {
|
||||||
|
width: 45%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.class50 {
|
||||||
|
width: 50%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.class55 {
|
||||||
|
width: 55%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.class60 {
|
||||||
|
width: 60%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.class65 {
|
||||||
|
width: 65%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.class70 {
|
||||||
|
width: 70%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.class75 {
|
||||||
|
width: 75%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.class80 {
|
||||||
|
width: 80%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.class85 {
|
||||||
|
width: 85%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.class90 {
|
||||||
|
width: 90%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.class95 {
|
||||||
|
width: 95%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.class100 {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
.card-login {
|
.card-login {
|
||||||
background-color: white;
|
background-color: white;
|
||||||
box-shadow: rgba(0, 0, 0, 0.15) 0px 15px 25px, rgba(0, 0, 0, 0.05) 0px 5px 10px;
|
box-shadow: rgba(0, 0, 0, 0.15) 0px 15px 25px, rgba(0, 0, 0, 0.05) 0px 5px 10px;
|
||||||
@@ -302,8 +362,8 @@ table {
|
|||||||
border: 2px dashed #ccc;
|
border: 2px dashed #ccc;
|
||||||
border-radius: 20px;
|
border-radius: 20px;
|
||||||
width: 400px;
|
width: 400px;
|
||||||
height: 200px;
|
height: 310px;
|
||||||
display: flex;
|
/*display: flex;*/
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
font-family: sans-serif;
|
font-family: sans-serif;
|
||||||
@@ -318,3 +378,58 @@ table {
|
|||||||
color: #0d6efd;
|
color: #0d6efd;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#table_user_management {
|
||||||
|
table-layout: fixed;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
#table_user_management th, #table_user_management td {
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: normal !important;
|
||||||
|
word-wrap: break-word;
|
||||||
|
overflow-wrap: anywhere;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pad-result {
|
||||||
|
padding-left: 1rem;
|
||||||
|
padding-right: 1rem;
|
||||||
|
border-radius: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pad-icon-menu {
|
||||||
|
margin-top: -0.3rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.div-file-list {
|
||||||
|
height: 20vh;
|
||||||
|
overflow-y: auto;
|
||||||
|
overflow-x: hidden;
|
||||||
|
padding: 10px;
|
||||||
|
/*border: dashed;*/
|
||||||
|
}
|
||||||
|
|
||||||
|
.pad-select {
|
||||||
|
margin-top: 0.3rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.div-label-drop {
|
||||||
|
display: flex;
|
||||||
|
text-align: center;
|
||||||
|
justify-content: center;
|
||||||
|
padding-top: 2rem;
|
||||||
|
/*padding-bottom: 1.5rem;*/
|
||||||
|
}
|
||||||
|
|
||||||
|
.pad-drop {
|
||||||
|
padding-top: 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.div-search {
|
||||||
|
padding: 0.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hr-dashed {
|
||||||
|
border: none;
|
||||||
|
border-bottom: 1px dashed #000000;
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
293
html/webpage/assets/js/filemanagement.js
Normal file
293
html/webpage/assets/js/filemanagement.js
Normal file
@@ -0,0 +1,293 @@
|
|||||||
|
|
||||||
|
/**
|
||||||
|
* Load setting language dropdown
|
||||||
|
*/
|
||||||
|
function load_setting_language() {
|
||||||
|
$("#setting_language").empty().off('change');
|
||||||
|
|
||||||
|
getLanguages(() => {
|
||||||
|
window.languages.forEach((lang) => {
|
||||||
|
let $option = $("<option></option>").attr("value", lang).text(lang);
|
||||||
|
$("#setting_language").append($option);
|
||||||
|
});
|
||||||
|
$("#setting_language").on('change', function () {
|
||||||
|
change_droparea_enable();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Load setting category dropdown
|
||||||
|
*/
|
||||||
|
function load_setting_category() {
|
||||||
|
$("#setting_category").empty().off('change');
|
||||||
|
getCategories(() => {
|
||||||
|
window.categories.forEach((cat) => {
|
||||||
|
let $option = $("<option></option>").attr("value", cat).text(cat);
|
||||||
|
$("#setting_category").append($option);
|
||||||
|
});
|
||||||
|
$("#setting_category").on('change', function () {
|
||||||
|
change_droparea_enable();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Load setting voice dropdown
|
||||||
|
*/
|
||||||
|
function load_setting_voice() {
|
||||||
|
$("#setting_voice").empty().off('change');
|
||||||
|
getVoiceTypes(() => {
|
||||||
|
window.voiceTypes.forEach((voice) => {
|
||||||
|
let $option = $("<option></option>").attr("value", voice).text(voice);
|
||||||
|
$("#setting_voice").append($option);
|
||||||
|
});
|
||||||
|
$("#setting_voice").on('change', function () {
|
||||||
|
change_droparea_enable();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get soundbank files from server based on category, language, and voice
|
||||||
|
* @param {String} category
|
||||||
|
* @param {String} language
|
||||||
|
* @param {String} voice
|
||||||
|
*/
|
||||||
|
function getSoundBankFiles(category, language, voice) {
|
||||||
|
let URL = `FileManager/ListSoundbank/${language}/${voice}/${category}`;
|
||||||
|
fetchAPI(URL, "GET", {}, null, (okdata) => {
|
||||||
|
$("#file-list").empty();
|
||||||
|
if (Array.isArray(okdata) && okdata.length > 0) {
|
||||||
|
okdata.forEach((file) => {
|
||||||
|
// get only the file name from the full path
|
||||||
|
let fileName = file.split(/[/\\]/).pop();
|
||||||
|
let $li = $("<li></li>").text(fileName);
|
||||||
|
$("#file-list").append($li);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}, (errdata) => {
|
||||||
|
alert("Error getting soundbank files : " + errdata.message);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Enable or disable drop area based on selections
|
||||||
|
*/
|
||||||
|
function change_droparea_enable() {
|
||||||
|
let selected_category = $("#setting_category").val();
|
||||||
|
let selected_language = $("#setting_language").val();
|
||||||
|
let selected_voice = $("#setting_voice").val();
|
||||||
|
$("#file-list").empty();
|
||||||
|
$("#searchfilelist").val("");
|
||||||
|
$("#searchfilelist").off('input').on('input', function () {
|
||||||
|
let searchTerm = $(this).val().toLowerCase();
|
||||||
|
$("#file-list li").each(function () {
|
||||||
|
let fileName = $(this).text().toLowerCase();
|
||||||
|
if (fileName.includes(searchTerm)) {
|
||||||
|
$(this).show();
|
||||||
|
} else {
|
||||||
|
$(this).hide();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
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);
|
||||||
|
} else {
|
||||||
|
$("#drop-area").addClass("disabled");
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get Soundbank path from server
|
||||||
|
*/
|
||||||
|
function get_soundbank_path() {
|
||||||
|
$("#setting_path").val("");
|
||||||
|
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) => {
|
||||||
|
alert("Error getting soundbank path : " + errdata.message);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function download(path, filename) {
|
||||||
|
let downloadurl = `/api/FileManager/${path}`;
|
||||||
|
let reqdata = { filename: filename };
|
||||||
|
fetch(downloadurl, {
|
||||||
|
method: 'POST',
|
||||||
|
headers: {},
|
||||||
|
body: JSON.stringify(reqdata)
|
||||||
|
})
|
||||||
|
.then(response => {
|
||||||
|
if (!response.ok) {
|
||||||
|
throw new Error("Network response was not ok");
|
||||||
|
}
|
||||||
|
return response.blob();
|
||||||
|
})
|
||||||
|
.then(blob => {
|
||||||
|
const url = window.URL.createObjectURL(blob);
|
||||||
|
const a = document.createElement('a');
|
||||||
|
a.href = url;
|
||||||
|
a.download = filename;
|
||||||
|
document.body.appendChild(a);
|
||||||
|
a.click();
|
||||||
|
a.remove();
|
||||||
|
window.URL.revokeObjectURL(url);
|
||||||
|
})
|
||||||
|
.catch(errdata => {
|
||||||
|
alert("Error downloading paging result file: " + errdata.message);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function get_pagingresult_files() {
|
||||||
|
const url = `FileManager/PagingResultList`;
|
||||||
|
$("#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>").text("Download").addClass("btn btn-primary");
|
||||||
|
$btndownload.on('click', function () {
|
||||||
|
download("DownloadPagingResultFile", filename);
|
||||||
|
});
|
||||||
|
|
||||||
|
let $tdbutton = $("<td></td>").append($btndownload).addClass("text-center");
|
||||||
|
$tr.append($tdtitle);
|
||||||
|
$tr.append($tdbutton);
|
||||||
|
$("#tbody_resultpaging").append($tr);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}, (errdata) => {
|
||||||
|
alert("Error getting paging result files : " + errdata.message);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function get_soundbankresult_files() {
|
||||||
|
const url = `FileManager/SoundbankResultList`;
|
||||||
|
$("#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 the file
|
||||||
|
let $btndownload = $("<button></button>").text("Download").addClass("btn btn-primary");
|
||||||
|
let $tdbutton = $("<td></td>").append($btndownload).addClass("text-center");
|
||||||
|
$btndownload.on('click', function () {
|
||||||
|
download("DownloadSoundbankResultFile", filename);
|
||||||
|
});
|
||||||
|
$tr.append($tdtitle);
|
||||||
|
$tr.append($tdbutton);
|
||||||
|
$("#tbody_resultsoundbank").append($tr);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}, (errdata) => {
|
||||||
|
alert("Error getting soundbank result files : " + errdata.message);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$(document).ready(function () {
|
||||||
|
console.log("filemanagement.js xx loaded");
|
||||||
|
load_setting_category();
|
||||||
|
load_setting_language();
|
||||||
|
load_setting_voice();
|
||||||
|
get_soundbank_path();
|
||||||
|
setTimeout(() => {
|
||||||
|
change_droparea_enable();
|
||||||
|
}, 1000);
|
||||||
|
get_pagingresult_files();
|
||||||
|
get_soundbankresult_files();
|
||||||
|
$("#save_directory").off('click').on('click', function () {
|
||||||
|
let new_path = $("#setting_path").val();
|
||||||
|
if (new_path && new_path.trim().length > 0) {
|
||||||
|
fetchAPI("Settings/SoundbankDirectory", "POST", {}, { directory: new_path }, (okdata) => {
|
||||||
|
alert("Soundbank directory path saved successfully.");
|
||||||
|
}, (errdata) => {
|
||||||
|
alert("Error saving soundbank directory path : " + errdata.message);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
alert("Please enter a valid soundbank directory path.");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
$("#drop-area").on('dragover', function (e) {
|
||||||
|
e.preventDefault();
|
||||||
|
e.stopPropagation();
|
||||||
|
$(this).addClass('dragover');
|
||||||
|
}).on('dragleave', function (e) {
|
||||||
|
e.preventDefault();
|
||||||
|
e.stopPropagation();
|
||||||
|
$(this).removeClass('dragover');
|
||||||
|
}).on('drop', function (e) {
|
||||||
|
e.preventDefault();
|
||||||
|
e.stopPropagation();
|
||||||
|
$(this).removeClass('dragover');
|
||||||
|
if ($(this).hasClass('disabled')) {
|
||||||
|
alert("Please select Category, Language, and Voice Type before uploading files.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
let lang = $("#setting_language").val().trim();
|
||||||
|
let category = $("#setting_category").val().trim();
|
||||||
|
let voice = $("#setting_voice").val().trim();
|
||||||
|
let files = e.originalEvent.dataTransfer.files;
|
||||||
|
if (lang && lang.length > 0) {
|
||||||
|
if (category && category.length > 0) {
|
||||||
|
if (voice && voice.length > 0) {
|
||||||
|
if (files.length > 0) {
|
||||||
|
// check if each file have type audio/wav , size more than 0, and name ends with .wav
|
||||||
|
let allValid = true;
|
||||||
|
for (let i = 0; i < files.length; i++) {
|
||||||
|
let file = files[i];
|
||||||
|
if (file.type !== 'audio/wav' && !file.name.toLowerCase().endsWith('.wav')) {
|
||||||
|
allValid = false;
|
||||||
|
}
|
||||||
|
if (file.size <= 0) {
|
||||||
|
allValid = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
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}`;
|
||||||
|
const formdata = new FormData();
|
||||||
|
for (let i = 0; i < files.length; i++) {
|
||||||
|
formdata.append('files', files[i]);
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
fetch(url, {
|
||||||
|
method: 'POST',
|
||||||
|
body: formdata
|
||||||
|
})
|
||||||
|
.then(response => response.json())
|
||||||
|
.then(okdata => {
|
||||||
|
console.log("Upload result: ", JSON.stringify(okdata));
|
||||||
|
})
|
||||||
|
.catch(errdata => {
|
||||||
|
alert("Error uploading files to soundbank directory : " + errdata.message);
|
||||||
|
});
|
||||||
|
} catch (err) {
|
||||||
|
alert("Error preparing file upload: " + err.message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else alert("Please upload only valid WAV audio files. Type must be audio/wav and size must be more than 0 bytes.");
|
||||||
|
} else alert("No files detected for upload.");
|
||||||
|
} else alert("Please select Voice Type before uploading files.");
|
||||||
|
} else alert("Please select Category before uploading files.");
|
||||||
|
} else alert("Please select Language before uploading files.");
|
||||||
|
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -444,8 +444,15 @@ $(document).ready(function () {
|
|||||||
let json = JSON.parse(data);
|
let json = JSON.parse(data);
|
||||||
if (Array.isArray(json) && json.length > 0) {
|
if (Array.isArray(json) && json.length > 0) {
|
||||||
json.forEach((net) => {
|
json.forEach((net) => {
|
||||||
|
if (net){
|
||||||
|
if (net.displayName && net.displayName.length>0){
|
||||||
|
if (net.ipV4addr && Array.isArray(net.ipV4addr) && net.ipV4addr.length>0){
|
||||||
if (result.length > 0) result += "\n"
|
if (result.length > 0) result += "\n"
|
||||||
result += `${net.displayName} (${net.ipV4addr.join(";")}) TX:${(net.txSpeed / 1024).toFixed(1)} KB/s RX:${(net.rxSpeed / 1024).toFixed(1)} KB/s`
|
result += `${net.displayName} (${net.ipV4addr.join(";")}) TX:${(net.txSpeed / 1024).toFixed(1)} KB/s RX:${(net.rxSpeed / 1024).toFixed(1)} KB/s`
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
} else result = "N/A";
|
} else result = "N/A";
|
||||||
$('#networkstatus').text(result)
|
$('#networkstatus').text(result)
|
||||||
@@ -585,6 +592,15 @@ $(document).ready(function () {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
|
$('#filemanagement').click(() => {
|
||||||
|
sidemenu.hide();
|
||||||
|
$('#content').load('filemanagement.html', function (response, status, xhr) {
|
||||||
|
if (status === "success") {
|
||||||
|
console.log("File Management content loaded successfully");
|
||||||
|
// pindah ke filemanagement.js
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
$('#logoutlink').click(() => {
|
$('#logoutlink').click(() => {
|
||||||
//window.location.href = "login.html"
|
//window.location.href = "login.html"
|
||||||
fetch("/logout", {method: 'GET'})
|
fetch("/logout", {method: 'GET'})
|
||||||
|
|||||||
@@ -1,82 +1,7 @@
|
|||||||
|
|
||||||
/**
|
|
||||||
* Load setting language dropdown
|
|
||||||
*/
|
|
||||||
function load_setting_language() {
|
|
||||||
$("#setting_language").empty().off('change');
|
|
||||||
|
|
||||||
getLanguages(() => {
|
|
||||||
window.languages.forEach((lang) => {
|
|
||||||
let $option = $("<option></option>").attr("value", lang).text(lang);
|
|
||||||
$("#setting_language").append($option);
|
|
||||||
});
|
|
||||||
$("#setting_language").on('change', function () {
|
|
||||||
change_droparea_enable();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Load setting category dropdown
|
|
||||||
*/
|
|
||||||
function load_setting_category() {
|
|
||||||
$("#setting_category").empty().off('change');
|
|
||||||
getCategories(() => {
|
|
||||||
window.categories.forEach((cat) => {
|
|
||||||
let $option = $("<option></option>").attr("value", cat).text(cat);
|
|
||||||
$("#setting_category").append($option);
|
|
||||||
});
|
|
||||||
$("#setting_category").on('change', function () {
|
|
||||||
change_droparea_enable();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Load setting voice dropdown
|
|
||||||
*/
|
|
||||||
function load_setting_voice() {
|
|
||||||
$("#setting_voice").empty().off('change');
|
|
||||||
getVoiceTypes(() => {
|
|
||||||
window.voiceTypes.forEach((voice) => {
|
|
||||||
let $option = $("<option></option>").attr("value", voice).text(voice);
|
|
||||||
$("#setting_voice").append($option);
|
|
||||||
});
|
|
||||||
$("#setting_voice").on('change', function () {
|
|
||||||
change_droparea_enable();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get Soundbank path from server
|
|
||||||
*/
|
|
||||||
function get_soundbank_path() {
|
|
||||||
$("#setting_path").val("");
|
|
||||||
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) => {
|
|
||||||
alert("Error getting soundbank path : " + errdata.message);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Enable or disable drop area based on selections
|
|
||||||
*/
|
|
||||||
function change_droparea_enable() {
|
|
||||||
let selected_category = $("#setting_category").val();
|
|
||||||
let selected_language = $("#setting_language").val();
|
|
||||||
let selected_voice = $("#setting_voice").val();
|
|
||||||
if (selected_category && selected_language && selected_voice) {
|
|
||||||
$("#drop-area").removeClass("disabled");
|
|
||||||
} else {
|
|
||||||
$("#drop-area").addClass("disabled");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Load message bank data into selection dropdowns
|
* Load message bank data into selection dropdowns
|
||||||
@@ -90,9 +15,7 @@ function load_messagebank(cbOK = null) {
|
|||||||
|
|
||||||
// get messagebank data from server, which contains [FLIGHT_NUMBER]
|
// get messagebank data from server, which contains [FLIGHT_NUMBER]
|
||||||
let messageData = [...new Set(window.messagebankdata.filter(mb => mb.message_Detail.includes('[FLIGHT_NUMBER]')).map(mb => `${mb.description} [${mb.aNN_ID}]`))];
|
let messageData = [...new Set(window.messagebankdata.filter(mb => mb.message_Detail.includes('[FLIGHT_NUMBER]')).map(mb => `${mb.description} [${mb.aNN_ID}]`))];
|
||||||
//console.log("Message bank data with [FLIGHT_NUMBER]: ", messageData);
|
|
||||||
messageData.forEach((item) => {
|
messageData.forEach((item) => {
|
||||||
//console.log("Adding option: " + item);
|
|
||||||
$("#input_GOP").append($("<option></option>").attr("value", item).text(item));
|
$("#input_GOP").append($("<option></option>").attr("value", item).text(item));
|
||||||
$("#input_GBD").append($("<option></option>").attr("value", item).text(item));
|
$("#input_GBD").append($("<option></option>").attr("value", item).text(item));
|
||||||
$("#input_GFC").append($("<option></option>").attr("value", item).text(item));
|
$("#input_GFC").append($("<option></option>").attr("value", item).text(item));
|
||||||
@@ -105,51 +28,41 @@ function load_messagebank(cbOK = null) {
|
|||||||
|
|
||||||
function load_remark_selection() {
|
function load_remark_selection() {
|
||||||
fetchAPI("Settings/FISCode", "GET", {}, null, (okdata) => {
|
fetchAPI("Settings/FISCode", "GET", {}, null, (okdata) => {
|
||||||
//console.log("FIS codes retrieved: ", JSON.stringify(okdata));
|
|
||||||
|
|
||||||
$("#input_GOP").val(okdata.gop)
|
$("#input_GOP").val(okdata.gop)
|
||||||
$("#input_GBD").val(okdata.gbd);
|
$("#input_GBD").val(okdata.gbd);
|
||||||
$("#input_GFC").val(okdata.gfc);
|
$("#input_GFC").val(okdata.gfc);
|
||||||
$("#input_FLD").val(okdata.fld);
|
$("#input_FLD").val(okdata.fld);
|
||||||
|
$("#input_defaultvoice").val(okdata.defaultvoice);
|
||||||
}, (errdata) => {
|
}, (errdata) => {
|
||||||
alert("Error getting FIS codes : " + errdata.message);
|
alert("Error getting FIS codes : " + errdata.message);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function load_default_voice(){
|
||||||
|
$("#input_defaultvoice").empty();
|
||||||
|
window.voiceTypes.forEach((voice) => {
|
||||||
|
$("#input_defaultvoice").append($("<option></option>").attr("value", voice).text(voice));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
console.log("setting.js loaded");
|
console.log("setting.js loaded");
|
||||||
|
load_default_voice();
|
||||||
|
|
||||||
$("#save_directory").off('click').on('click', function () {
|
|
||||||
let new_path = $("#setting_path").val();
|
|
||||||
if (new_path && new_path.trim().length > 0) {
|
|
||||||
fetchAPI("Settings/SoundbankDirectory", "POST", {}, { directory: new_path }, (okdata) => {
|
|
||||||
alert("Soundbank directory path saved successfully.");
|
|
||||||
}, (errdata) => {
|
|
||||||
alert("Error saving soundbank directory path : " + errdata.message);
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
alert("Please enter a valid soundbank directory path.");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
get_soundbank_path();
|
|
||||||
load_setting_category();
|
|
||||||
load_setting_language();
|
|
||||||
load_setting_voice();
|
|
||||||
load_messagebank(() => load_remark_selection());
|
load_messagebank(() => load_remark_selection());
|
||||||
$("#fiscodesave").off('click').on('click', function () {
|
$("#fiscodesave").off('click').on('click', function () {
|
||||||
let gop = $("#input_GOP").val();
|
let gop = $("#input_GOP").val();
|
||||||
let gbd = $("#input_GBD").val();
|
let gbd = $("#input_GBD").val();
|
||||||
let gfc = $("#input_GFC").val();
|
let gfc = $("#input_GFC").val();
|
||||||
let fld = $("#input_FLD").val();
|
let fld = $("#input_FLD").val();
|
||||||
if (gop && gbd && gfc && fld) {
|
let voice = $("#input_defaultvoice").val();
|
||||||
|
if (gop && gbd && gfc && fld && voice) {
|
||||||
let data = {
|
let data = {
|
||||||
GOP: gop,
|
GOP: gop,
|
||||||
GBD: gbd,
|
GBD: gbd,
|
||||||
GFC: gfc,
|
GFC: gfc,
|
||||||
FLD: fld
|
FLD: fld,
|
||||||
|
defaultvoice: voice
|
||||||
};
|
};
|
||||||
fetchAPI("Settings/FISCode", "POST", {}, data, (okdata) => {
|
fetchAPI("Settings/FISCode", "POST", {}, data, (okdata) => {
|
||||||
alert("FIS codes saved successfully.");
|
alert("FIS codes saved successfully.");
|
||||||
@@ -157,75 +70,11 @@ $(document).ready(function () {
|
|||||||
alert("Error saving FIS codes : " + errdata.message);
|
alert("Error saving FIS codes : " + errdata.message);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
alert("Please select all FIS codes (GOP, GBD, GFC, FLD) before saving.");
|
alert("Please select all FIS codes (GOP, GBD, GFC, FLD) and Default Voice before saving.");
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
$("#drop-area").on('dragover', function (e) {
|
|
||||||
e.preventDefault();
|
|
||||||
e.stopPropagation();
|
|
||||||
$(this).addClass('dragover');
|
|
||||||
}).on('dragleave', function (e) {
|
|
||||||
e.preventDefault();
|
|
||||||
e.stopPropagation();
|
|
||||||
$(this).removeClass('dragover');
|
|
||||||
}).on('drop', function (e) {
|
|
||||||
e.preventDefault();
|
|
||||||
e.stopPropagation();
|
|
||||||
$(this).removeClass('dragover');
|
|
||||||
if ($(this).hasClass('disabled')) {
|
|
||||||
alert("Please select Category, Language, and Voice Type before uploading files.");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
let lang = $("#setting_language").val().trim();
|
|
||||||
let category = $("#setting_category").val().trim();
|
|
||||||
let voice = $("#setting_voice").val().trim();
|
|
||||||
let files = e.originalEvent.dataTransfer.files;
|
|
||||||
if (lang && lang.length > 0) {
|
|
||||||
if (category && category.length > 0) {
|
|
||||||
if (voice && voice.length > 0) {
|
|
||||||
if (files.length > 0) {
|
|
||||||
// check if each file have type audio/wav , size more than 0, and name ends with .wav
|
|
||||||
let allValid = true;
|
|
||||||
for (let i = 0; i < files.length; i++) {
|
|
||||||
let file = files[i];
|
|
||||||
if (file.type !== 'audio/wav' && !file.name.toLowerCase().endsWith('.wav')) {
|
|
||||||
allValid = false;
|
|
||||||
}
|
|
||||||
if (file.size <= 0) {
|
|
||||||
allValid = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
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}`;
|
|
||||||
const formdata = new FormData();
|
|
||||||
for (let i = 0; i < files.length; i++) {
|
|
||||||
formdata.append('files', files[i]);
|
|
||||||
}
|
|
||||||
try{
|
|
||||||
fetch(url, {
|
|
||||||
method: 'POST',
|
|
||||||
body: formdata
|
|
||||||
})
|
|
||||||
.then(response => response.json())
|
|
||||||
.then(okdata => {
|
|
||||||
console.log("Upload result: ", JSON.stringify(okdata));
|
|
||||||
})
|
|
||||||
.catch(errdata => {
|
|
||||||
alert("Error uploading files to soundbank directory : " + errdata.message);
|
|
||||||
});
|
|
||||||
} catch(err){
|
|
||||||
alert("Error preparing file upload: " + err.message);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else alert("Please upload only valid WAV audio files. Type must be audio/wav and size must be more than 0 bytes.");
|
|
||||||
} else alert("No files detected for upload.");
|
|
||||||
} else alert("Please select Voice Type before uploading files.");
|
|
||||||
} else alert("Please select Category before uploading files.");
|
|
||||||
} else alert("Please select Language before uploading files.");
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
});
|
});
|
||||||
@@ -4,7 +4,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no">
|
||||||
<title>AAS_NewGen_17OKT25</title>
|
<title>AAS_NewGen_27OKT25</title>
|
||||||
<link rel="stylesheet" href="assets/bootstrap/css/bootstrap.min.css">
|
<link rel="stylesheet" href="assets/bootstrap/css/bootstrap.min.css">
|
||||||
<link rel="stylesheet" href="assets/css/bss-overrides.css">
|
<link rel="stylesheet" href="assets/css/bss-overrides.css">
|
||||||
<link rel="stylesheet" href="assets/css/Login-Form-Basic-icons.css">
|
<link rel="stylesheet" href="assets/css/Login-Form-Basic-icons.css">
|
||||||
|
|||||||
127
html/webpage/filemanagement.html
Normal file
127
html/webpage/filemanagement.html
Normal file
@@ -0,0 +1,127 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html data-bs-theme="light" lang="en">
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no">
|
||||||
|
<title>AAS_NewGen_27OKT25</title>
|
||||||
|
<link rel="stylesheet" href="assets/bootstrap/css/bootstrap.min.css">
|
||||||
|
<link rel="stylesheet" href="assets/css/bss-overrides.css">
|
||||||
|
<link rel="stylesheet" href="assets/css/Login-Form-Basic-icons.css">
|
||||||
|
<link rel="stylesheet" href="assets/css/styles.css">
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col w-100 h-100 pad-header">
|
||||||
|
<h2 style="text-align: center;">File Management</h2>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col">
|
||||||
|
<div class="card card-setting">
|
||||||
|
<div class="card-body">
|
||||||
|
<h4 class="card-title">Upload Soundbank</h4>
|
||||||
|
<hr>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-2 col-sm-2 col-md-2 col-lg-1 col-xl-1"><label class="col-form-label">Path</label></div>
|
||||||
|
<div class="col-4 col-sm-4 col-md-4 col-lg-4 col-xl-4"><input class="w-100 form-control" type="text" id="setting_path"></div>
|
||||||
|
<div class="col-6 col-sm-6 col-md-6 col-lg-6 col-xl-2"><button class="btn w-100 pad-button btn-round-basic color-add" id="save_directory" type="button">Save Directory</button></div>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-6 col-sm-2 col-md-2 col-lg-1 col-xl-1"><label class="col-form-label">Category</label></div>
|
||||||
|
<div class="col-6 col-sm-10 col-md-2 col-lg-2 col-xl-2"><select id="setting_category" class="input-add form-select"></select></div>
|
||||||
|
<div class="col-lg-1 col-xl-1 d-none d-sm-none d-md-none d-lg-block d-xl-block"></div>
|
||||||
|
<div class="col-6 col-sm-2 col-md-2 col-lg-1 col-xl-1"><label class="col-form-label">Language</label></div>
|
||||||
|
<div class="col-6 col-sm-10 col-md-2 col-lg-2 col-xl-2"><select id="setting_language" class="input-add form-select"></select></div>
|
||||||
|
<div class="col-lg-1 col-xl-1 d-none d-sm-none d-md-none d-lg-block d-xl-block"></div>
|
||||||
|
<div class="col-6 col-sm-2 col-md-2 col-lg-1 col-xl-1"><label class="col-form-label">Voice</label></div>
|
||||||
|
<div class="col-6 col-sm-10 col-md-2 col-lg-2 col-xl-2"><select id="setting_voice" class="input-add form-select"></select></div>
|
||||||
|
</div>
|
||||||
|
<div class="row pad-drop">
|
||||||
|
<div class="col-12 col-sm-12 col-md-6 col-lg-6 col-xl-6">
|
||||||
|
<div>
|
||||||
|
<div class="bg-white w-100" id="drop-area" multiple=""><input type="file" id="file-input" multiple="">
|
||||||
|
<div class="div-label-drop"><label class="form-label text-center d">Drop files here to upload</label></div>
|
||||||
|
<div class="div-search">
|
||||||
|
<hr class="hr-dashed">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-8 col-sm-8 col-md-8 col-lg-8 col-xl-8">
|
||||||
|
<p class="text-end text-add">Search</p>
|
||||||
|
</div>
|
||||||
|
<div class="col-4 col-sm-4 col-md-4 col-lg-4 col-xl-4"><input class="w-100 form-control" type="search" id="searchfilelist"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="div-file-list">
|
||||||
|
<p><strong>List Files : </strong></p>
|
||||||
|
<ul class="mt-3" id="file-list"></ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="py-2">
|
||||||
|
<h4 class="text-center pad-result">Soundbank Result</h4>
|
||||||
|
<hr>
|
||||||
|
<div class="table-responsive pad-result">
|
||||||
|
<table class="table table-hover">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th class="class80">File Name</th>
|
||||||
|
<th class="text-center class20">Action</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody id="tbody_resultsoundbank">
|
||||||
|
<tr>
|
||||||
|
<td>Result Soundbank 001</td>
|
||||||
|
<td class="text-center"><button class="btn btn-primary" data-bs-toggle="tooltip" data-bss-tooltip="" data-bs-placement="right" type="button" title="Download"><svg xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 24 24" height="1em" viewBox="0 0 24 24" width="1em" fill="currentColor">
|
||||||
|
<g>
|
||||||
|
<rect fill="none" height="24" width="24"></rect>
|
||||||
|
</g>
|
||||||
|
<g>
|
||||||
|
<path d="M5,20h14v-2H5V20z M19,9h-4V3H9v6H5l7,7L19,9z"></path>
|
||||||
|
</g>
|
||||||
|
</svg></button></td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="py-2">
|
||||||
|
<h4 class="text-center pad-result">Paging Result</h4>
|
||||||
|
<hr>
|
||||||
|
<div class="table-responsive pad-result">
|
||||||
|
<table class="table table-hover table-responsive pad-result">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th class="class80">File Name</th>
|
||||||
|
<th class="text-center class20">Action</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody id="tbody_resultpaging">
|
||||||
|
<tr>
|
||||||
|
<td>Result Paging 001</td>
|
||||||
|
<td class="text-center"><button class="btn btn-primary" data-bs-toggle="tooltip" data-bss-tooltip="" data-bs-placement="right" type="button" title="Download"><svg xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 24 24" height="1em" viewBox="0 0 24 24" width="1em" fill="currentColor">
|
||||||
|
<g>
|
||||||
|
<rect fill="none" height="24" width="24"></rect>
|
||||||
|
</g>
|
||||||
|
<g>
|
||||||
|
<path d="M5,20h14v-2H5V20z M19,9h-4V3H9v6H5l7,7L19,9z"></path>
|
||||||
|
</g>
|
||||||
|
</svg></button></td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<script src="assets/bootstrap/js/bootstrap.min.js"></script>
|
||||||
|
<script src="assets/js/bs-init.js"></script>
|
||||||
|
<script src="assets/js/filemanagement.js"></script>
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
||||||
@@ -34,7 +34,7 @@
|
|||||||
<li class="nav-item"><a class="nav-link active link-light text-menu" id="homelink" href="#" aria-current="page"><svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" fill="currentColor" viewBox="0 0 16 16" class="bi bi-house-door me-2" style="font-size: 20px;">
|
<li class="nav-item"><a class="nav-link active link-light text-menu" id="homelink" href="#" aria-current="page"><svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" fill="currentColor" viewBox="0 0 16 16" class="bi bi-house-door me-2" style="font-size: 20px;">
|
||||||
<path d="M8.354 1.146a.5.5 0 0 0-.708 0l-6 6A.5.5 0 0 0 1.5 7.5v7a.5.5 0 0 0 .5.5h4.5a.5.5 0 0 0 .5-.5v-4h2v4a.5.5 0 0 0 .5.5H14a.5.5 0 0 0 .5-.5v-7a.5.5 0 0 0-.146-.354L13 5.793V2.5a.5.5 0 0 0-.5-.5h-1a.5.5 0 0 0-.5.5v1.293zM2.5 14V7.707l5.5-5.5 5.5 5.5V14H10v-4a.5.5 0 0 0-.5-.5h-3a.5.5 0 0 0-.5.5v4z"></path>
|
<path d="M8.354 1.146a.5.5 0 0 0-.708 0l-6 6A.5.5 0 0 0 1.5 7.5v7a.5.5 0 0 0 .5.5h4.5a.5.5 0 0 0 .5-.5v-4h2v4a.5.5 0 0 0 .5.5H14a.5.5 0 0 0 .5-.5v-7a.5.5 0 0 0-.146-.354L13 5.793V2.5a.5.5 0 0 0-.5-.5h-1a.5.5 0 0 0-.5.5v1.293zM2.5 14V7.707l5.5-5.5 5.5 5.5V14H10v-4a.5.5 0 0 0-.5-.5h-3a.5.5 0 0 0-.5.5v4z"></path>
|
||||||
</svg> Overview</a></li>
|
</svg> Overview</a></li>
|
||||||
<li class="nav-item"><a class="nav-link link-body-emphasis text-menu" id="soundbanklink" href="#"><svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" fill="currentColor" viewBox="0 0 16 16" class="bi bi-soundwave me-2 icon-menu" style="font-size: 20px;">
|
<li class="nav-item"><a class="nav-link link-body-emphasis text-menu" id="soundbanklink" href="#"><svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" fill="currentColor" viewBox="0 0 16 16" class="bi bi-soundwave me-2 icon-menu pad-icon-menu" style="font-size: 20px;">
|
||||||
<path fill-rule="evenodd" d="M8.5 2a.5.5 0 0 1 .5.5v11a.5.5 0 0 1-1 0v-11a.5.5 0 0 1 .5-.5m-2 2a.5.5 0 0 1 .5.5v7a.5.5 0 0 1-1 0v-7a.5.5 0 0 1 .5-.5m4 0a.5.5 0 0 1 .5.5v7a.5.5 0 0 1-1 0v-7a.5.5 0 0 1 .5-.5m-6 1.5A.5.5 0 0 1 5 6v4a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5m8 0a.5.5 0 0 1 .5.5v4a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5m-10 1A.5.5 0 0 1 3 7v2a.5.5 0 0 1-1 0V7a.5.5 0 0 1 .5-.5m12 0a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-1 0V7a.5.5 0 0 1 .5-.5"></path>
|
<path fill-rule="evenodd" d="M8.5 2a.5.5 0 0 1 .5.5v11a.5.5 0 0 1-1 0v-11a.5.5 0 0 1 .5-.5m-2 2a.5.5 0 0 1 .5.5v7a.5.5 0 0 1-1 0v-7a.5.5 0 0 1 .5-.5m4 0a.5.5 0 0 1 .5.5v7a.5.5 0 0 1-1 0v-7a.5.5 0 0 1 .5-.5m-6 1.5A.5.5 0 0 1 5 6v4a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5m8 0a.5.5 0 0 1 .5.5v4a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5m-10 1A.5.5 0 0 1 3 7v2a.5.5 0 0 1-1 0V7a.5.5 0 0 1 .5-.5m12 0a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-1 0V7a.5.5 0 0 1 .5-.5"></path>
|
||||||
</svg> Sound Bank</a></li>
|
</svg> Sound Bank</a></li>
|
||||||
<li class="nav-item"><a class="nav-link link-body-emphasis text-menu" id="messagebanklink" href="#"><svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 24 24" width="1em" fill="currentColor" class="me-2 icon-menu" style="font-size: 20px;">
|
<li class="nav-item"><a class="nav-link link-body-emphasis text-menu" id="messagebanklink" href="#"><svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 24 24" width="1em" fill="currentColor" class="me-2 icon-menu" style="font-size: 20px;">
|
||||||
@@ -45,7 +45,7 @@
|
|||||||
<path d="M0 0h24v24H0z" fill="none"></path>
|
<path d="M0 0h24v24H0z" fill="none"></path>
|
||||||
<path d="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"></path>
|
<path d="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"></path>
|
||||||
</svg> Language Link</a></li>
|
</svg> Language Link</a></li>
|
||||||
<li class="nav-item .icon-menu"><a class="nav-link link-body-emphasis text-menu" id="timerlink" href="#"><svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 24 24" width="1em" fill="currentColor" class="me-2 icon-menu" style="font-size: 20px;">
|
<li class="nav-item .icon-menu"><a class="nav-link link-body-emphasis text-menu" id="timerlink" href="#"><svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 24 24" width="1em" fill="currentColor" class="me-2 icon-menu pad-icon-menu" style="font-size: 20px;">
|
||||||
<path d="M0 0h24v24H0z" fill="none"></path>
|
<path d="M0 0h24v24H0z" fill="none"></path>
|
||||||
<path d="M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"></path>
|
<path d="M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"></path>
|
||||||
<path d="M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"></path>
|
<path d="M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"></path>
|
||||||
@@ -56,17 +56,25 @@
|
|||||||
<circle cx="14" cy="12.5" r="2.5"></circle>
|
<circle cx="14" cy="12.5" r="2.5"></circle>
|
||||||
<path d="M6 5H4v16c0 1.1.89 2 2 2h10v-2H6V5z"></path>
|
<path d="M6 5H4v16c0 1.1.89 2 2 2h10v-2H6V5z"></path>
|
||||||
</svg> Broadcast Zones</a></li>
|
</svg> Broadcast Zones</a></li>
|
||||||
<li class="nav-item"><a class="nav-link link-body-emphasis text-menu" id="loglink" href="#"><svg xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 24 24" height="1em" viewBox="0 0 24 24" width="1em" fill="currentColor" class="icon-menu" style="font-size: 20px;">
|
<li class="nav-item"><a class="nav-link link-body-emphasis text-menu" id="loglink" href="#"><svg xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 24 24" height="1em" viewBox="0 0 24 24" width="1em" fill="currentColor" class="icon-menu pad-icon-menu" style="font-size: 20px;">
|
||||||
<g>
|
<g>
|
||||||
<rect fill="none" height="24" width="24"></rect>
|
<rect fill="none" height="24" width="24"></rect>
|
||||||
<path d="M19,7H9C7.9,7,7,7.9,7,9v10c0,1.1,0.9,2,2,2h10c1.1,0,2-0.9,2-2V9C21,7.9,20.1,7,19,7z M19,9v2H9V9H19z M13,15v-2h2v2H13z M15,17v2h-2v-2H15z M11,15H9v-2h2V15z M17,13h2v2h-2V13z M9,17h2v2H9V17z M17,19v-2h2v2H17z M6,17H5c-1.1,0-2-0.9-2-2V5 c0-1.1,0.9-2,2-2h10c1.1,0,2,0.9,2,2v1h-2V5H5v10h1V17z"></path>
|
<path d="M19,7H9C7.9,7,7,7.9,7,9v10c0,1.1,0.9,2,2,2h10c1.1,0,2-0.9,2-2V9C21,7.9,20.1,7,19,7z M19,9v2H9V9H19z M13,15v-2h2v2H13z M15,17v2h-2v-2H15z M11,15H9v-2h2V15z M17,13h2v2h-2V13z M9,17h2v2H9V17z M17,19v-2h2v2H17z M6,17H5c-1.1,0-2-0.9-2-2V5 c0-1.1,0.9-2,2-2h10c1.1,0,2,0.9,2,2v1h-2V5H5v10h1V17z"></path>
|
||||||
</g>
|
</g>
|
||||||
</svg> Log</a></li>
|
</svg> Log</a></li>
|
||||||
<li class="nav-item"><a class="nav-link link-body-emphasis text-menu" id="usermanagement" href="#"><svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 24 24" width="1em" fill="currentColor" class="me-2 icon-menu" style="font-size: 20px;">
|
<li class="nav-item"><a class="nav-link link-body-emphasis text-menu" id="usermanagement" href="#"><svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 24 24" width="1em" fill="currentColor" class="me-2 icon-menu pad-icon-menu" style="font-size: 20px;">
|
||||||
<path d="M0 0h24v24H0z" fill="none"></path>
|
<path d="M0 0h24v24H0z" fill="none"></path>
|
||||||
<path d="M16 11c1.66 0 2.99-1.34 2.99-3S17.66 5 16 5c-1.66 0-3 1.34-3 3s1.34 3 3 3zm-8 0c1.66 0 2.99-1.34 2.99-3S9.66 5 8 5C6.34 5 5 6.34 5 8s1.34 3 3 3zm0 2c-2.33 0-7 1.17-7 3.5V19h14v-2.5c0-2.33-4.67-3.5-7-3.5zm8 0c-.29 0-.62.02-.97.05 1.16.84 1.97 1.97 1.97 3.45V19h6v-2.5c0-2.33-4.67-3.5-7-3.5z"></path>
|
<path d="M16 11c1.66 0 2.99-1.34 2.99-3S17.66 5 16 5c-1.66 0-3 1.34-3 3s1.34 3 3 3zm-8 0c1.66 0 2.99-1.34 2.99-3S9.66 5 8 5C6.34 5 5 6.34 5 8s1.34 3 3 3zm0 2c-2.33 0-7 1.17-7 3.5V19h14v-2.5c0-2.33-4.67-3.5-7-3.5zm8 0c-.29 0-.62.02-.97.05 1.16.84 1.97 1.97 1.97 3.45V19h6v-2.5c0-2.33-4.67-3.5-7-3.5z"></path>
|
||||||
</svg> User Management</a></li>
|
</svg> User Management</a></li>
|
||||||
<li class="nav-item"><a class="nav-link link-body-emphasis text-menu" id="settinglink" href="#"><svg xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 24 24" height="1em" viewBox="0 0 24 24" width="1em" fill="currentColor" class="me-2 icon-menu" style="font-size: 20px;">
|
<li class="nav-item"><a class="nav-link link-body-emphasis text-menu" id="filemanagement" href="#"><svg xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 24 24" height="1em" viewBox="0 0 24 24" width="1em" fill="currentColor" class="me-2 icon-menu pad-icon-menu" style="font-size: 20px;">
|
||||||
|
<g>
|
||||||
|
<rect fill="none" height="24" width="24"></rect>
|
||||||
|
</g>
|
||||||
|
<g>
|
||||||
|
<path d="M14,2H6C4.9,2,4.01,2.9,4.01,4L4,20c0,1.1,0.89,2,1.99,2H18c1.1,0,2-0.9,2-2V8L14,2z M16,13h-3v3.75 c0,1.24-1.01,2.25-2.25,2.25S8.5,17.99,8.5,16.75c0-1.24,1.01-2.25,2.25-2.25c0.46,0,0.89,0.14,1.25,0.38V11h4V13z M13,9V3.5 L18.5,9H13z"></path>
|
||||||
|
</g>
|
||||||
|
</svg> File Management</a></li>
|
||||||
|
<li class="nav-item"><a class="nav-link link-body-emphasis text-menu" id="settinglink" href="#"><svg xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 24 24" height="1em" viewBox="0 0 24 24" width="1em" fill="currentColor" class="me-2 icon-menu pad-icon-menu" style="font-size: 20px;">
|
||||||
<g>
|
<g>
|
||||||
<path d="M0,0h24v24H0V0z" fill="none"></path>
|
<path d="M0,0h24v24H0V0z" fill="none"></path>
|
||||||
<path d="M19.14,12.94c0.04-0.3,0.06-0.61,0.06-0.94c0-0.32-0.02-0.64-0.07-0.94l2.03-1.58c0.18-0.14,0.23-0.41,0.12-0.61 l-1.92-3.32c-0.12-0.22-0.37-0.29-0.59-0.22l-2.39,0.96c-0.5-0.38-1.03-0.7-1.62-0.94L14.4,2.81c-0.04-0.24-0.24-0.41-0.48-0.41 h-3.84c-0.24,0-0.43,0.17-0.47,0.41L9.25,5.35C8.66,5.59,8.12,5.92,7.63,6.29L5.24,5.33c-0.22-0.08-0.47,0-0.59,0.22L2.74,8.87 C2.62,9.08,2.66,9.34,2.86,9.48l2.03,1.58C4.84,11.36,4.8,11.69,4.8,12s0.02,0.64,0.07,0.94l-2.03,1.58 c-0.18,0.14-0.23,0.41-0.12,0.61l1.92,3.32c0.12,0.22,0.37,0.29,0.59,0.22l2.39-0.96c0.5,0.38,1.03,0.7,1.62,0.94l0.36,2.54 c0.05,0.24,0.24,0.41,0.48,0.41h3.84c0.24,0,0.44-0.17,0.47-0.41l0.36-2.54c0.59-0.24,1.13-0.56,1.62-0.94l2.39,0.96 c0.22,0.08,0.47,0,0.59-0.22l1.92-3.32c0.12-0.22,0.07-0.47-0.12-0.61L19.14,12.94z M12,15.6c-1.98,0-3.6-1.62-3.6-3.6 s1.62-3.6,3.6-3.6s3.6,1.62,3.6,3.6S13.98,15.6,12,15.6z"></path>
|
<path d="M19.14,12.94c0.04-0.3,0.06-0.61,0.06-0.94c0-0.32-0.02-0.64-0.07-0.94l2.03-1.58c0.18-0.14,0.23-0.41,0.12-0.61 l-1.92-3.32c-0.12-0.22-0.37-0.29-0.59-0.22l-2.39,0.96c-0.5-0.38-1.03-0.7-1.62-0.94L14.4,2.81c-0.04-0.24-0.24-0.41-0.48-0.41 h-3.84c-0.24,0-0.43,0.17-0.47,0.41L9.25,5.35C8.66,5.59,8.12,5.92,7.63,6.29L5.24,5.33c-0.22-0.08-0.47,0-0.59,0.22L2.74,8.87 C2.62,9.08,2.66,9.34,2.86,9.48l2.03,1.58C4.84,11.36,4.8,11.69,4.8,12s0.02,0.64,0.07,0.94l-2.03,1.58 c-0.18,0.14-0.23,0.41-0.12,0.61l1.92,3.32c0.12,0.22,0.37,0.29,0.59,0.22l2.39-0.96c0.5,0.38,1.03,0.7,1.62,0.94l0.36,2.54 c0.05,0.24,0.24,0.41,0.48,0.41h3.84c0.24,0,0.44-0.17,0.47-0.41l0.36-2.54c0.59-0.24,1.13-0.56,1.62-0.94l2.39,0.96 c0.22,0.08,0.47,0,0.59-0.22l1.92-3.32c0.12-0.22,0.07-0.47-0.12-0.61L19.14,12.94z M12,15.6c-1.98,0-3.6-1.62-3.6-3.6 s1.62-3.6,3.6-3.6s3.6,1.62,3.6,3.6S13.98,15.6,12,15.6z"></path>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no">
|
||||||
<title>AAS_NewGen_17OKT25</title>
|
<title>AAS_NewGen_27OKT25</title>
|
||||||
<link rel="stylesheet" href="assets/bootstrap/css/bootstrap.min.css">
|
<link rel="stylesheet" href="assets/bootstrap/css/bootstrap.min.css">
|
||||||
<link rel="stylesheet" href="assets/css/bss-overrides.css">
|
<link rel="stylesheet" href="assets/css/bss-overrides.css">
|
||||||
<link rel="stylesheet" href="assets/css/Login-Form-Basic-icons.css">
|
<link rel="stylesheet" href="assets/css/Login-Form-Basic-icons.css">
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no">
|
||||||
<title>AAS_NewGen_17OKT25</title>
|
<title>AAS_NewGen_27OKT25</title>
|
||||||
<link rel="stylesheet" href="assets/bootstrap/css/bootstrap.min.css">
|
<link rel="stylesheet" href="assets/bootstrap/css/bootstrap.min.css">
|
||||||
<link rel="stylesheet" href="assets/css/bss-overrides.css">
|
<link rel="stylesheet" href="assets/css/bss-overrides.css">
|
||||||
<link rel="stylesheet" href="assets/css/Login-Form-Basic-icons.css">
|
<link rel="stylesheet" href="assets/css/Login-Form-Basic-icons.css">
|
||||||
@@ -36,7 +36,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="table-responsive">
|
<div class="table-responsive">
|
||||||
<table class="table">
|
<table class="table table-hover">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th class="class10">No</th>
|
<th class="class10">No</th>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no">
|
||||||
<title>AAS_NewGen_17OKT25</title>
|
<title>AAS_NewGen_27OKT25</title>
|
||||||
<link rel="stylesheet" href="assets/bootstrap/css/bootstrap.min.css">
|
<link rel="stylesheet" href="assets/bootstrap/css/bootstrap.min.css">
|
||||||
<link rel="stylesheet" href="assets/css/bss-overrides.css">
|
<link rel="stylesheet" href="assets/css/bss-overrides.css">
|
||||||
<link rel="stylesheet" href="assets/css/Login-Form-Basic-icons.css">
|
<link rel="stylesheet" href="assets/css/Login-Form-Basic-icons.css">
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no">
|
||||||
<title>AAS_NewGen_17OKT25</title>
|
<title>AAS_NewGen_27OKT25</title>
|
||||||
<link rel="stylesheet" href="assets/bootstrap/css/bootstrap.min.css">
|
<link rel="stylesheet" href="assets/bootstrap/css/bootstrap.min.css">
|
||||||
<link rel="stylesheet" href="assets/css/bss-overrides.css">
|
<link rel="stylesheet" href="assets/css/bss-overrides.css">
|
||||||
<link rel="stylesheet" href="assets/css/Login-Form-Basic-icons.css">
|
<link rel="stylesheet" href="assets/css/Login-Form-Basic-icons.css">
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no">
|
||||||
<title>AAS_NewGen_17OKT25</title>
|
<title>AAS_NewGen_27OKT25</title>
|
||||||
<link rel="stylesheet" href="assets/bootstrap/css/bootstrap.min.css">
|
<link rel="stylesheet" href="assets/bootstrap/css/bootstrap.min.css">
|
||||||
<link rel="stylesheet" href="assets/css/bss-overrides.css">
|
<link rel="stylesheet" href="assets/css/bss-overrides.css">
|
||||||
<link rel="stylesheet" href="assets/css/Login-Form-Basic-icons.css">
|
<link rel="stylesheet" href="assets/css/Login-Form-Basic-icons.css">
|
||||||
@@ -19,41 +19,17 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<div class="card card-setting">
|
<div class="card card-setting"></div>
|
||||||
<div class="card-body">
|
</div>
|
||||||
<h4 class="card-title"><strong>Upload Soundbank</strong></h4>
|
|
||||||
<hr>
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-2 col-sm-2 col-md-2 col-lg-2 col-xl-2"><label class="col-form-label">Path</label></div>
|
|
||||||
<div class="col-4 col-sm-4 col-md-4 col-lg-4 col-xl-4"><input class="w-100 form-control" type="text" id="setting_path"></div>
|
|
||||||
<div class="col-6 col-sm-6 col-md-6 col-lg-6 col-xl-2"><button class="btn w-100 pad-button btn-round-basic color-add" id="save_directory" type="button">Save Directory</button></div>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-6 col-sm-2 col-md-2 col-lg-2 col-xl-2"><label class="col-form-label">Category</label></div>
|
|
||||||
<div class="col-6 col-sm-10 col-md-2 col-lg-2 col-xl-2"><select id="setting_category" class="input-add form-select"></select></div>
|
|
||||||
<div class="col-6 col-sm-2 col-md-2 col-lg-2 col-xl-2"><label class="col-form-label">Language</label></div>
|
|
||||||
<div class="col-6 col-sm-10 col-md-2 col-lg-2 col-xl-2"><select id="setting_language" class="input-add form-select"></select></div>
|
|
||||||
<div class="col-6 col-sm-2 col-md-2 col-lg-2 col-xl-2"><label class="col-form-label">Voice</label></div>
|
|
||||||
<div class="col-6 col-sm-10 col-md-2 col-lg-2 col-xl-2"><select id="setting_voice" class="input-add form-select"></select></div>
|
|
||||||
</div>
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-12 col-sm-12 col-md-6 col-lg-6 col-xl-6">
|
|
||||||
<div class="bg-white w-100" id="drop-area" multiple=""><input type="file" id="file-input" multiple=""><label class="form-label d">Drop files here or click to select</label></div>
|
|
||||||
</div>
|
|
||||||
<div class="col-12 col-sm-12 col-md-6 col-lg-6 col-xl-6">
|
|
||||||
<div class="row"></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="row py-5">
|
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<div class="card card-setting">
|
<div class="card card-setting">
|
||||||
<div class="card-body pad-accordion">
|
<div class="card-body pad-accordion">
|
||||||
<h4 class="card-title"><strong>FIS CODE</strong></h4>
|
<h4 class="card-title">FIS CODE</h4>
|
||||||
<hr>
|
<hr>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-8 col-sm-9 col-md-10 col-lg-10 col-xl-10">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-2 col-sm-2 col-md-2 col-lg-2 col-xl-2"><label class="col-form-label">GOP</label></div>
|
<div class="col-2 col-sm-2 col-md-2 col-lg-2 col-xl-2"><label class="col-form-label">GOP</label></div>
|
||||||
<div class="col-10 col-sm-10 col-md-10 col-lg-10 col-xl-10"><select id="input_GOP" class="input-add form-select"></select></div>
|
<div class="col-10 col-sm-10 col-md-10 col-lg-10 col-xl-10"><select id="input_GOP" class="input-add form-select"></select></div>
|
||||||
@@ -71,8 +47,11 @@
|
|||||||
<div class="col-10 col-sm-10 col-md-10 col-lg-10 col-xl-10"><select id="input_FLD" class="input-add form-select"></select></div>
|
<div class="col-10 col-sm-10 col-md-10 col-lg-10 col-xl-10"><select id="input_FLD" class="input-add form-select"></select></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-2 col-sm-2 col-md-2 col-lg-2 col-xl-2"><label class="col-form-label"></label></div>
|
<div class="col-2 col-sm-2 col-md-2 col-lg-2 col-xl-2"><label class="col-form-label">Default Voice</label></div>
|
||||||
<div class="col-6 col-sm-6 col-md-6 col-lg-6 col-xl-2"><button class="btn w-100 pad-button btn-round-basic color-add" id="fiscodesave" type="button">Save</button></div>
|
<div class="col-10 col-sm-10 col-md-10 col-lg-10 col-xl-10"><select id="input_defaultvoice" class="input-add form-select"></select></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-4 col-sm-3 col-md-2 col-lg-2 col-xl-2"><button class="btn w-100 h-100 pad-button btn-round-basic color-add" id="fiscodesave" type="button">Save</button></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no">
|
||||||
<title>AAS_NewGen_17OKT25</title>
|
<title>AAS_NewGen_27OKT25</title>
|
||||||
<link rel="stylesheet" href="assets/bootstrap/css/bootstrap.min.css">
|
<link rel="stylesheet" href="assets/bootstrap/css/bootstrap.min.css">
|
||||||
<link rel="stylesheet" href="assets/css/bss-overrides.css">
|
<link rel="stylesheet" href="assets/css/bss-overrides.css">
|
||||||
<link rel="stylesheet" href="assets/css/Login-Form-Basic-icons.css">
|
<link rel="stylesheet" href="assets/css/Login-Form-Basic-icons.css">
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no">
|
||||||
<title>AAS_NewGen_17OKT25</title>
|
<title>AAS_NewGen_27OKT25</title>
|
||||||
<link rel="stylesheet" href="assets/bootstrap/css/bootstrap.min.css">
|
<link rel="stylesheet" href="assets/bootstrap/css/bootstrap.min.css">
|
||||||
<link rel="stylesheet" href="assets/css/bss-overrides.css">
|
<link rel="stylesheet" href="assets/css/bss-overrides.css">
|
||||||
<link rel="stylesheet" href="assets/css/Login-Form-Basic-icons.css">
|
<link rel="stylesheet" href="assets/css/Login-Form-Basic-icons.css">
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no">
|
||||||
<title>AAS_NewGen_17OKT25</title>
|
<title>AAS_NewGen_27OKT25</title>
|
||||||
<link rel="stylesheet" href="assets/bootstrap/css/bootstrap.min.css">
|
<link rel="stylesheet" href="assets/bootstrap/css/bootstrap.min.css">
|
||||||
<link rel="stylesheet" href="assets/css/bss-overrides.css">
|
<link rel="stylesheet" href="assets/css/bss-overrides.css">
|
||||||
<link rel="stylesheet" href="assets/css/Login-Form-Basic-icons.css">
|
<link rel="stylesheet" href="assets/css/Login-Form-Basic-icons.css">
|
||||||
@@ -88,7 +88,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="row pad-day">
|
<div class="row pad-day">
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<div class="form-check"><input class="form-check-input" type="radio" id="scheduleweekly" name="dayselect"><label class="form-check-label" for="scheduleweekly">Weekly</label></div><select class="w-100 input-add form-select" id="weeklyselect">
|
<div class="form-check"><input class="form-check-input" type="radio" id="scheduleweekly" name="dayselect"><label class="form-check-label" for="scheduleweekly">Weekly</label></div><select class="w-100 py-2 input-add form-select" id="weeklyselect">
|
||||||
<optgroup label="This is a group">
|
<optgroup label="This is a group">
|
||||||
<option value="12" selected="">This is item 1</option>
|
<option value="12" selected="">This is item 1</option>
|
||||||
<option value="13">This is item 2</option>
|
<option value="13">This is item 2</option>
|
||||||
@@ -97,7 +97,7 @@
|
|||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row py-2">
|
||||||
<div class="col-7 col-sm-7 col-md-7 col-lg-6 col-xl-6 pad-day">
|
<div class="col-7 col-sm-7 col-md-7 col-lg-6 col-xl-6 pad-day">
|
||||||
<div class="form-check"><input class="form-check-input" type="radio" id="schedulespecialdate" name="dayselect"><label class="form-check-label" for="schedulespecialdate">Special Date</label></div>
|
<div class="form-check"><input class="form-check-input" type="radio" id="schedulespecialdate" name="dayselect"><label class="form-check-label" for="schedulespecialdate">Special Date</label></div>
|
||||||
</div>
|
</div>
|
||||||
@@ -126,7 +126,7 @@
|
|||||||
<div class="col-4 col-sm-4 col-md-4 col-lg-4 col-xl-4">
|
<div class="col-4 col-sm-4 col-md-4 col-lg-4 col-xl-4">
|
||||||
<p class="text-add">Message</p>
|
<p class="text-add">Message</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-8 col-sm-8 col-md-8 col-lg-8 col-xl-8"><select class="w-100 input-add form-select" id="schedulemessage"></select></div>
|
<div class="col-8 col-sm-8 col-md-8 col-lg-8 col-xl-8"><select class="w-100 py-2 input-add form-select" id="schedulemessage"></select></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-4 col-sm-4 col-md-4 col-lg-4 col-xl-4">
|
<div class="col-4 col-sm-4 col-md-4 col-lg-4 col-xl-4">
|
||||||
@@ -160,7 +160,7 @@
|
|||||||
<div class="col-4 col-sm-4 col-md-4 col-lg-4 col-xl-4">
|
<div class="col-4 col-sm-4 col-md-4 col-lg-4 col-xl-4">
|
||||||
<p class="text-add">Broadcast Zones</p>
|
<p class="text-add">Broadcast Zones</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-8 col-sm-8 col-md-8 col-lg-8 col-xl-8 border"><select class="w-100 input-add form-select" id="schedulezones">
|
<div class="col-8 col-sm-8 col-md-8 col-lg-8 col-xl-8"><select class="w-100 input-add form-select" id="schedulezones">
|
||||||
<optgroup label="This is a group">
|
<optgroup label="This is a group">
|
||||||
<option value="12" selected="">This is item 1</option>
|
<option value="12" selected="">This is item 1</option>
|
||||||
<option value="13">This is item 2</option>
|
<option value="13">This is item 2</option>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no">
|
||||||
<title>AAS_NewGen_17OKT25</title>
|
<title>AAS_NewGen_27OKT25</title>
|
||||||
<link rel="stylesheet" href="assets/bootstrap/css/bootstrap.min.css">
|
<link rel="stylesheet" href="assets/bootstrap/css/bootstrap.min.css">
|
||||||
<link rel="stylesheet" href="assets/css/bss-overrides.css">
|
<link rel="stylesheet" href="assets/css/bss-overrides.css">
|
||||||
<link rel="stylesheet" href="assets/css/Login-Form-Basic-icons.css">
|
<link rel="stylesheet" href="assets/css/Login-Form-Basic-icons.css">
|
||||||
@@ -39,7 +39,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="table-responsive">
|
<div class="table-responsive">
|
||||||
<table class="table">
|
<table class="table" id="table_user_management">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th class="class05">No</th>
|
<th class="class05">No</th>
|
||||||
@@ -92,6 +92,12 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-8 col-sm-8 col-md-8 col-lg-8 col-xl-8"><input type="text" id="modallocation" class="input-add form-control"></div>
|
<div class="col-8 col-sm-8 col-md-8 col-lg-8 col-xl-8"><input type="text" id="modallocation" class="input-add form-control"></div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-4 col-sm-4 col-md-4 col-lg-4 col-xl-4">
|
||||||
|
<p class="text-add">City Tags</p>
|
||||||
|
</div>
|
||||||
|
<div class="col-8 col-sm-8 col-md-8 col-lg-8 col-xl-8"><input type="text" id="modalcitytags" class="form-control input-add"></div>
|
||||||
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-4 col-sm-4 col-md-4 col-lg-4 col-xl-4">
|
<div class="col-4 col-sm-4 col-md-4 col-lg-4 col-xl-4">
|
||||||
<p class="text-add">Airline Tags</p>
|
<p class="text-add">Airline Tags</p>
|
||||||
@@ -99,18 +105,7 @@
|
|||||||
<div class="col-8 col-sm-8 col-md-8 col-lg-8 col-xl-8">
|
<div class="col-8 col-sm-8 col-md-8 col-lg-8 col-xl-8">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-8"><input type="text" id="modalairlinetags" class="form-control input-add"></div>
|
<div class="col-8"><input type="text" id="modalairlinetags" class="form-control input-add"></div>
|
||||||
<div class="col-4"><button class="btn w-100 btn-select btn-round-basic color-import" id="btnShowSoundbankModal" type="button">Select</button></div>
|
<div class="col-4"><button class="btn w-100 btn-select btn-round-basic color-import pad-select" id="btnShowSoundbankModal" type="button">Select</button></div>
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-4 col-sm-4 col-md-4 col-lg-4 col-xl-4">
|
|
||||||
<p class="text-add">City Tags</p>
|
|
||||||
</div>
|
|
||||||
<div class="col-8 col-sm-8 col-md-8 col-lg-8 col-xl-8">
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-8"><input type="text" id="modalcitytags" class="form-control input-add"></div>
|
|
||||||
<div class="col-4"></div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -121,7 +116,7 @@
|
|||||||
<div class="col-8 col-sm-8 col-md-8 col-lg-8 col-xl-8">
|
<div class="col-8 col-sm-8 col-md-8 col-lg-8 col-xl-8">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-8"><input type="text" id="modalmessagebank" class="form-control input-add"></div>
|
<div class="col-8"><input type="text" id="modalmessagebank" class="form-control input-add"></div>
|
||||||
<div class="col-4"><button class="btn w-100 btn-round-basic color-import" id="btnShowMessagebankModal" type="button">Select</button></div>
|
<div class="col-4"><button class="btn w-100 btn-round-basic color-import pad-select" id="btnShowMessagebankModal" type="button">Select</button></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -132,7 +127,7 @@
|
|||||||
<div class="col-8 col-sm-8 col-md-8 col-lg-8 col-xl-8">
|
<div class="col-8 col-sm-8 col-md-8 col-lg-8 col-xl-8">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-8 col-sm-8 col-md-8 col-lg-8 col-xl-8"><input type="text" id="modalbroadcastzones" class="form-control input-add" name="modalpath"></div>
|
<div class="col-8 col-sm-8 col-md-8 col-lg-8 col-xl-8"><input type="text" id="modalbroadcastzones" class="form-control input-add" name="modalpath"></div>
|
||||||
<div class="col-4 col-sm-4 col-md-4 col-lg-4 col-xl-4"><button class="btn w-100 btn-round-basic color-import" id="btnShowBroaadcastZoneModal" type="button">Select</button></div>
|
<div class="col-4 col-sm-4 col-md-4 col-lg-4 col-xl-4"><button class="btn w-100 btn-round-basic color-import pad-select" id="btnShowBroaadcastZoneModal" type="button">Select</button></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -33,13 +33,10 @@ lateinit var audioPlayer: AudioPlayer
|
|||||||
val StreamerOutputs: MutableMap<String, BarixConnection> = HashMap()
|
val StreamerOutputs: MutableMap<String, BarixConnection> = HashMap()
|
||||||
lateinit var udpreceiver: UDPReceiver
|
lateinit var udpreceiver: UDPReceiver
|
||||||
lateinit var tcpreceiver: TCPReceiver
|
lateinit var tcpreceiver: TCPReceiver
|
||||||
const val version = "0.0.11 (24/10/2025)"
|
const val version = "0.0.12 (27/10/2025)"
|
||||||
// AAS 64 channels
|
// AAS 64 channels
|
||||||
const val max_channel = 64
|
const val max_channel = 64
|
||||||
|
|
||||||
// dipakai untuk pilih voice type, bisa diganti via web nanti
|
|
||||||
var selected_voice = VoiceType.VOICE_1.name
|
|
||||||
|
|
||||||
// dipakai untuk ambil messagebank berdasarkan id
|
// dipakai untuk ambil messagebank berdasarkan id
|
||||||
val urutan_bahasa = listOf(
|
val urutan_bahasa = listOf(
|
||||||
Language.INDONESIA.name,
|
Language.INDONESIA.name,
|
||||||
@@ -168,8 +165,6 @@ fun main() {
|
|||||||
Logger.error { "Failed to start TCP Receiver on port 5002" }
|
Logger.error { "Failed to start TCP Receiver on port 5002" }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
val androidserver = TCP_Android_Command_Server()
|
val androidserver = TCP_Android_Command_Server()
|
||||||
androidserver.StartTcpServer(5003){
|
androidserver.StartTcpServer(5003){
|
||||||
Logger.info { it }
|
Logger.info { it }
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ import codes.configKeys
|
|||||||
import content.Category
|
import content.Category
|
||||||
import content.Language
|
import content.Language
|
||||||
import content.ScheduleDay
|
import content.ScheduleDay
|
||||||
|
import content.VoiceType
|
||||||
import database.BroadcastZones
|
import database.BroadcastZones
|
||||||
import database.Messagebank
|
import database.Messagebank
|
||||||
import database.QueueTable
|
import database.QueueTable
|
||||||
@@ -137,8 +138,11 @@ class MainExtension01 {
|
|||||||
*/
|
*/
|
||||||
fun Get_MessageBank_by_id(id: Int, languages: List<String> = urutan_bahasa): ArrayList<Messagebank> {
|
fun Get_MessageBank_by_id(id: Int, languages: List<String> = urutan_bahasa): ArrayList<Messagebank> {
|
||||||
val mb_list = ArrayList<Messagebank>()
|
val mb_list = ArrayList<Messagebank>()
|
||||||
|
var selected_voice = config.Get(configKeys.DEFAULT_VOICE_TYPE.key)
|
||||||
|
if (selected_voice.isEmpty()) selected_voice = VoiceType.VOICE_1.name
|
||||||
languages.forEach { lang ->
|
languages.forEach { lang ->
|
||||||
db.messageDB.List.find { mb -> mb.ANN_ID == id.toUInt() && mb.Language.equals(lang, true) && mb.Voice_Type.equals(selected_voice, true) }
|
db.messageDB.List
|
||||||
|
.find { mb -> mb.ANN_ID == id.toUInt() && mb.Language.equals(lang, true) && mb.Voice_Type.equals(selected_voice, true) }
|
||||||
?.let {
|
?.let {
|
||||||
mb_list.add(it)
|
mb_list.add(it)
|
||||||
}
|
}
|
||||||
@@ -656,8 +660,6 @@ class MainExtension01 {
|
|||||||
contentCache.addAudioFile(filenya, afi)
|
contentCache.addAudioFile(filenya, afi)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
val targetfile = SoundbankResult_directory.resolve(
|
val targetfile = SoundbankResult_directory.resolve(
|
||||||
Make_WAV_FileName(
|
Make_WAV_FileName(
|
||||||
@@ -752,7 +754,7 @@ class MainExtension01 {
|
|||||||
val zz = qa.BroadcastZones.split(";")
|
val zz = qa.BroadcastZones.split(";")
|
||||||
if (AllBroadcastZonesValid(zz)){
|
if (AllBroadcastZonesValid(zz)){
|
||||||
val ips = BroadcastZones_to_SoundChannel_IP(zz)
|
val ips = BroadcastZones_to_SoundChannel_IP(zz)
|
||||||
val ann_id = Get_ANN_ID(qa.Message)
|
val ann_id = Get_ANN_ID(qa.SB_TAGS)
|
||||||
if (ann_id>0){
|
if (ann_id>0){
|
||||||
if (AllStreamerOutputIdle(ips)){
|
if (AllStreamerOutputIdle(ips)){
|
||||||
val mblist = Get_MessageBank_by_id(ann_id, qa.Language.split(";"))
|
val mblist = Get_MessageBank_by_id(ann_id, qa.Language.split(";"))
|
||||||
|
|||||||
@@ -118,15 +118,15 @@ class BarixConnection(val index: UInt, var channel: String, val ipaddress: Strin
|
|||||||
udp.send(DatagramPacket(chunk, chunk.size, inet))
|
udp.send(DatagramPacket(chunk, chunk.size, inet))
|
||||||
delay(2)
|
delay(2)
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
cbFail.accept("SendData to $ipaddress:$port failed, message: ${e.message}")
|
cbFail.accept("SendData to $ipaddress failed, message: ${e.message}")
|
||||||
return@launch
|
return@launch
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
cbOK.accept("SendData to $channel ($ipaddress:$port) succeeded, ${data.size} bytes sent")
|
cbOK.accept("SendData to $channel ($ipaddress) succeeded, ${data.size} bytes sent")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} else cbFail.accept("SendData to $ipaddress:$port failed, data is empty")
|
} else cbFail.accept("SendData to $ipaddress failed, data is empty")
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
package codes
|
package codes
|
||||||
|
|
||||||
import codes.Somecodes.Companion.Soundbank_directory
|
|
||||||
import com.fasterxml.jackson.databind.JsonNode
|
import com.fasterxml.jackson.databind.JsonNode
|
||||||
import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper
|
import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper
|
||||||
import content.Category
|
import content.Category
|
||||||
@@ -23,6 +22,7 @@ import java.nio.file.Files
|
|||||||
import java.nio.file.Path
|
import java.nio.file.Path
|
||||||
import java.time.LocalDateTime
|
import java.time.LocalDateTime
|
||||||
import java.time.format.DateTimeFormatter
|
import java.time.format.DateTimeFormatter
|
||||||
|
import java.util.function.BiConsumer
|
||||||
import java.util.function.Consumer
|
import java.util.function.Consumer
|
||||||
import kotlin.io.path.name
|
import kotlin.io.path.name
|
||||||
|
|
||||||
@@ -77,6 +77,110 @@ class Somecodes {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Delete old PagingResult files older than specified days.
|
||||||
|
* If PagingResult directory does not exist, callback with -1,-1.
|
||||||
|
* @param daysOlder Number of days to determine old files, default to 7 days.
|
||||||
|
* @param cb Callback function of Success count and Failed count.
|
||||||
|
*/
|
||||||
|
fun Delete_Old_PagingResult_Files(daysOlder: Int, cb: BiConsumer<Int, Int>){
|
||||||
|
var deleted = 0
|
||||||
|
var failed = 0
|
||||||
|
if (Files.isDirectory(PagingResult_directory)){
|
||||||
|
val cutoffTime = System.currentTimeMillis() - daysOlder.toLong() * 24 * 60 * 60 * 1000
|
||||||
|
Files.list(PagingResult_directory).forEach {
|
||||||
|
try{
|
||||||
|
val fileTime = Files.getLastModifiedTime(it).toMillis()
|
||||||
|
if (fileTime < cutoffTime){
|
||||||
|
Files.delete(it)
|
||||||
|
Logger.info{ "Deleted old PagingResult file ${it.toAbsolutePath()}" }
|
||||||
|
deleted++
|
||||||
|
}
|
||||||
|
} catch (e: Exception){
|
||||||
|
Logger.error { "Failed to delete file ${it.toAbsolutePath()}: ${e.message}" }
|
||||||
|
failed++
|
||||||
|
}
|
||||||
|
}
|
||||||
|
cb.accept(deleted, failed)
|
||||||
|
} else cb.accept(-1,-1)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Clear all files in PagingResult directory.
|
||||||
|
* If PagingResult directory does not exist, callback with -1,-1.
|
||||||
|
* @param cb Callback function of Success count and Failed count.
|
||||||
|
*/
|
||||||
|
fun Clear_PagingResult_Directory(cb : BiConsumer<Int, Int>){
|
||||||
|
var deleted = 0
|
||||||
|
var failed = 0
|
||||||
|
if (Files.isDirectory(PagingResult_directory)){
|
||||||
|
Files.list(PagingResult_directory).forEach {
|
||||||
|
try{
|
||||||
|
Files.delete(it)
|
||||||
|
Logger.info{ "Deleted file ${it.toAbsolutePath()}" }
|
||||||
|
deleted++
|
||||||
|
} catch (e: Exception){
|
||||||
|
Logger.error { "Failed to delete file ${it.toAbsolutePath()}: ${e.message}" }
|
||||||
|
failed++
|
||||||
|
}
|
||||||
|
}
|
||||||
|
cb.accept(deleted, failed)
|
||||||
|
} else cb.accept(-1,-1)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Clear all files in SoundbankResult directory.
|
||||||
|
* If SoundbankResult directory does not exist, callback with -1,-1.
|
||||||
|
* @param cb Callback function of Success count and Failed count.
|
||||||
|
*/
|
||||||
|
fun Clear_SoundbankResult_Directory(cb : BiConsumer<Int, Int>){
|
||||||
|
var deleted = 0
|
||||||
|
var failed = 0
|
||||||
|
if (Files.isDirectory(SoundbankResult_directory)){
|
||||||
|
Files.list(SoundbankResult_directory).forEach {
|
||||||
|
try{
|
||||||
|
Files.delete(it)
|
||||||
|
Logger.info{ "Deleted file ${it.toAbsolutePath()}" }
|
||||||
|
deleted++
|
||||||
|
} catch (e: Exception){
|
||||||
|
Logger.error { "Failed to delete file ${it.toAbsolutePath()}: ${e.message}" }
|
||||||
|
failed++
|
||||||
|
}
|
||||||
|
}
|
||||||
|
cb.accept(deleted, failed)
|
||||||
|
} else cb.accept(-1,-1)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Delete old SoundbankResult files older than specified days.
|
||||||
|
* If SoundbankResult directory does not exist, callback with -1,-1.
|
||||||
|
* @param daysOlder Number of days to determine old files, default to 7 days.
|
||||||
|
* @param cb Callback function of Success count and Failed count.
|
||||||
|
*/
|
||||||
|
fun Delete_Old_SoundbankResult_Files(daysOlder: Int=7, cb: BiConsumer<Int, Int>){
|
||||||
|
var deleted = 0
|
||||||
|
var failed = 0
|
||||||
|
if (Files.isDirectory(SoundbankResult_directory)){
|
||||||
|
val cutoffTime = System.currentTimeMillis() - daysOlder.toLong() * 24 * 60 * 60 * 1000
|
||||||
|
Files.list(SoundbankResult_directory).forEach {
|
||||||
|
try{
|
||||||
|
val fileTime = Files.getLastModifiedTime(it).toMillis()
|
||||||
|
if (fileTime < cutoffTime){
|
||||||
|
Files.delete(it)
|
||||||
|
Logger.info{ "Deleted old SoundbankResult file ${it.toAbsolutePath()}" }
|
||||||
|
deleted++
|
||||||
|
}
|
||||||
|
} catch (e: Exception){
|
||||||
|
Logger.error { "Failed to delete file ${it.toAbsolutePath()}: ${e.message}" }
|
||||||
|
failed++
|
||||||
|
}
|
||||||
|
}
|
||||||
|
cb.accept(deleted, failed)
|
||||||
|
} else cb.accept(-1,-1)
|
||||||
|
}
|
||||||
|
|
||||||
fun ExtractFilesFromClassPath(resourcePath: String, outputDir: Path) {
|
fun ExtractFilesFromClassPath(resourcePath: String, outputDir: Path) {
|
||||||
try {
|
try {
|
||||||
val resource = Somecodes::class.java.getResource(resourcePath)
|
val resource = Somecodes::class.java.getResource(resourcePath)
|
||||||
@@ -357,11 +461,26 @@ class Somecodes {
|
|||||||
*/
|
*/
|
||||||
fun ValidFile(value : String) : Boolean {
|
fun ValidFile(value : String) : Boolean {
|
||||||
if (value.isNotBlank()){
|
if (value.isNotBlank()){
|
||||||
return Files.exists(Path.of(value))
|
return ValidFile(Path.of(value))
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun ValidFile(value : Path) : Boolean {
|
||||||
|
return Files.exists(value) && Files.isRegularFile(value)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun ValidDirectory(value : String) : Boolean {
|
||||||
|
if (value.isNotBlank()){
|
||||||
|
return ValidDirectory(Path.of(value))
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
fun ValidDirectory(value : Path) : Boolean {
|
||||||
|
return Files.exists(value) && Files.isDirectory(value)
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if a string is a valid date in the format "dd/MM/yyyy".
|
* Check if a string is a valid date in the format "dd/MM/yyyy".
|
||||||
* @param value The string to check.
|
* @param value The string to check.
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package codes
|
package codes
|
||||||
|
|
||||||
|
import content.VoiceType
|
||||||
import org.tinylog.Logger
|
import org.tinylog.Logger
|
||||||
import java.nio.file.Files
|
import java.nio.file.Files
|
||||||
import java.nio.file.Paths
|
import java.nio.file.Paths
|
||||||
@@ -66,6 +67,7 @@ class configFile {
|
|||||||
config[configKeys.WEBAPP_VIEWER_USERNAME.key] = "viewer"
|
config[configKeys.WEBAPP_VIEWER_USERNAME.key] = "viewer"
|
||||||
config[configKeys.WEBAPP_VIEWER_PASSWORD.key] = "password"
|
config[configKeys.WEBAPP_VIEWER_PASSWORD.key] = "password"
|
||||||
config[configKeys.WEBAPP_PORT.key] = "3030"
|
config[configKeys.WEBAPP_PORT.key] = "3030"
|
||||||
|
config[configKeys.DEFAULT_VOICE_TYPE.key] = VoiceType.VOICE_1.name
|
||||||
Save()
|
Save()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -11,6 +11,7 @@ enum class configKeys(val key: String) {
|
|||||||
REMARK_GBD("remark.GBD"),
|
REMARK_GBD("remark.GBD"),
|
||||||
REMARK_GFC("remark.GFC"),
|
REMARK_GFC("remark.GFC"),
|
||||||
REMARK_FLD("remark.FLD"),
|
REMARK_FLD("remark.FLD"),
|
||||||
|
DEFAULT_VOICE_TYPE("default.voice.type"),
|
||||||
WEBAPP_ADMIN_USERNAME("webapp.admin.username"),
|
WEBAPP_ADMIN_USERNAME("webapp.admin.username"),
|
||||||
WEBAPP_ADMIN_PASSWORD("webapp.admin.password"),
|
WEBAPP_ADMIN_PASSWORD("webapp.admin.password"),
|
||||||
WEBAPP_VIEWER_USERNAME("webapp.viewer.username"),
|
WEBAPP_VIEWER_USERNAME("webapp.viewer.username"),
|
||||||
|
|||||||
@@ -44,8 +44,8 @@ import java.nio.file.Files
|
|||||||
import java.time.LocalDateTime
|
import java.time.LocalDateTime
|
||||||
import codes.configKeys
|
import codes.configKeys
|
||||||
import org.tinylog.Logger
|
import org.tinylog.Logger
|
||||||
|
import java.io.File
|
||||||
//import com.sun.security.auth.login.ConfigFile
|
import java.nio.file.Path
|
||||||
|
|
||||||
|
|
||||||
@Suppress("unused")
|
@Suppress("unused")
|
||||||
@@ -64,7 +64,7 @@ class WebApp(val listenPort: Int, val userlist: List<Pair<String, String>>, val
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun Start() {
|
fun Start() {
|
||||||
|
Logger.info { "Starting Web Application on port $listenPort" }
|
||||||
app = Javalin.create { config ->
|
app = Javalin.create { config ->
|
||||||
config.useVirtualThreads = true
|
config.useVirtualThreads = true
|
||||||
config.staticFiles.add("/webpage")
|
config.staticFiles.add("/webpage")
|
||||||
@@ -191,8 +191,6 @@ class WebApp(val listenPort: Int, val userlist: List<Pair<String, String>>, val
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
path("soundbank.html") {
|
path("soundbank.html") {
|
||||||
@@ -213,6 +211,27 @@ class WebApp(val listenPort: Int, val userlist: List<Pair<String, String>>, val
|
|||||||
path("timer.html") {
|
path("timer.html") {
|
||||||
before { CheckUsers(it) }
|
before { CheckUsers(it) }
|
||||||
}
|
}
|
||||||
|
path("filemanagement.html") {
|
||||||
|
before { CheckUsers(it) }
|
||||||
|
}
|
||||||
|
path("broadcastzones.html") {
|
||||||
|
before { CheckUsers(it) }
|
||||||
|
}
|
||||||
|
path("overview.html") {
|
||||||
|
before { CheckUsers(it) }
|
||||||
|
}
|
||||||
|
path("setting.html"){
|
||||||
|
before { CheckUsers(it) }
|
||||||
|
}
|
||||||
|
path("streamerstatus.html"){
|
||||||
|
before { CheckUsers(it) }
|
||||||
|
}
|
||||||
|
path("timer.html"){
|
||||||
|
before { CheckUsers(it) }
|
||||||
|
}
|
||||||
|
path("usermanagement.html"){
|
||||||
|
before { CheckUsers(it) }
|
||||||
|
}
|
||||||
path("api") {
|
path("api") {
|
||||||
path("VoiceType") {
|
path("VoiceType") {
|
||||||
get {
|
get {
|
||||||
@@ -315,7 +334,7 @@ class WebApp(val listenPort: Int, val userlist: List<Pair<String, String>>, val
|
|||||||
VoiceType.valueOf(addvalue.VoiceType),
|
VoiceType.valueOf(addvalue.VoiceType),
|
||||||
Category.valueOf(addvalue.Category)
|
Category.valueOf(addvalue.Category)
|
||||||
).resolve(addvalue.Path)
|
).resolve(addvalue.Path)
|
||||||
if (Files.isRegularFile(absolutepath)) {
|
if (ValidFile(absolutepath)) {
|
||||||
addvalue.Path = absolutepath.toAbsolutePath().toString()
|
addvalue.Path = absolutepath.toAbsolutePath().toString()
|
||||||
if (db.soundDB.Add(addvalue)) {
|
if (db.soundDB.Add(addvalue)) {
|
||||||
db.soundDB.Resort()
|
db.soundDB.Resort()
|
||||||
@@ -348,7 +367,8 @@ class WebApp(val listenPort: Int, val userlist: List<Pair<String, String>>, val
|
|||||||
// delete by index
|
// delete by index
|
||||||
val index = it.pathParam("index").toUIntOrNull()
|
val index = it.pathParam("index").toUIntOrNull()
|
||||||
if (index == null) {
|
if (index == null) {
|
||||||
it.status(400).result(objectmapper.writeValueAsString(resultMessage("Invalid index")))
|
it.status(400)
|
||||||
|
.result(objectmapper.writeValueAsString(resultMessage("Invalid index")))
|
||||||
} else {
|
} else {
|
||||||
if (db.soundDB.DeleteByIndex(index.toInt())) {
|
if (db.soundDB.DeleteByIndex(index.toInt())) {
|
||||||
db.soundDB.Resort()
|
db.soundDB.Resort()
|
||||||
@@ -414,7 +434,7 @@ class WebApp(val listenPort: Int, val userlist: List<Pair<String, String>>, val
|
|||||||
newsb.VoiceType,
|
newsb.VoiceType,
|
||||||
newsb.Category
|
newsb.Category
|
||||||
).resolve(newsb.Path)
|
).resolve(newsb.Path)
|
||||||
if (Files.isRegularFile(newpath)) {
|
if (ValidFile(newpath)) {
|
||||||
if (newpath.toAbsolutePath().toString() != sb.Path) {
|
if (newpath.toAbsolutePath().toString() != sb.Path) {
|
||||||
sb.Path = newpath.toAbsolutePath().toString()
|
sb.Path = newpath.toAbsolutePath().toString()
|
||||||
varchanged = true
|
varchanged = true
|
||||||
@@ -550,7 +570,8 @@ class WebApp(val listenPort: Int, val userlist: List<Pair<String, String>>, val
|
|||||||
// delete by index
|
// delete by index
|
||||||
val index = it.pathParam("index").toUIntOrNull()
|
val index = it.pathParam("index").toUIntOrNull()
|
||||||
if (index == null) {
|
if (index == null) {
|
||||||
it.status(400).result(objectmapper.writeValueAsString(resultMessage("Invalid index")))
|
it.status(400)
|
||||||
|
.result(objectmapper.writeValueAsString(resultMessage("Invalid index")))
|
||||||
} else {
|
} else {
|
||||||
if (db.messageDB.DeleteByIndex(index.toInt())) {
|
if (db.messageDB.DeleteByIndex(index.toInt())) {
|
||||||
db.messageDB.Resort()
|
db.messageDB.Resort()
|
||||||
@@ -566,7 +587,8 @@ class WebApp(val listenPort: Int, val userlist: List<Pair<String, String>>, val
|
|||||||
// update messagebank by index
|
// update messagebank by index
|
||||||
val index = it.pathParam("index").toUIntOrNull()
|
val index = it.pathParam("index").toUIntOrNull()
|
||||||
if (index == null) {
|
if (index == null) {
|
||||||
it.status(400).result(objectmapper.writeValueAsString(resultMessage("Invalid index")))
|
it.status(400)
|
||||||
|
.result(objectmapper.writeValueAsString(resultMessage("Invalid index")))
|
||||||
} else {
|
} else {
|
||||||
val mb = db.messageDB.List.find { xx -> xx.index == index }
|
val mb = db.messageDB.List.find { xx -> xx.index == index }
|
||||||
if (mb == null) {
|
if (mb == null) {
|
||||||
@@ -677,7 +699,14 @@ class WebApp(val listenPort: Int, val userlist: List<Pair<String, String>>, val
|
|||||||
val tag = json.get("tag").asText("")
|
val tag = json.get("tag").asText("")
|
||||||
val languages = json.get("language").asText("").split(";")
|
val languages = json.get("language").asText("").split(";")
|
||||||
if (ValidString(tag)) {
|
if (ValidString(tag)) {
|
||||||
if (languages.all { xx -> Language.entries.any { yy -> yy.name.equals(xx, true) } }) {
|
if (languages.all { xx ->
|
||||||
|
Language.entries.any { yy ->
|
||||||
|
yy.name.equals(
|
||||||
|
xx,
|
||||||
|
true
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}) {
|
||||||
if (!db.languageDB.List.any { ll -> ll.TAG.equals(tag, true) }) {
|
if (!db.languageDB.List.any { ll -> ll.TAG.equals(tag, true) }) {
|
||||||
val newvalue = LanguageLink(0u, tag, languages.joinToString(";"))
|
val newvalue = LanguageLink(0u, tag, languages.joinToString(";"))
|
||||||
if (db.languageDB.Add(newvalue)) {
|
if (db.languageDB.Add(newvalue)) {
|
||||||
@@ -714,7 +743,8 @@ class WebApp(val listenPort: Int, val userlist: List<Pair<String, String>>, val
|
|||||||
// delete by index
|
// delete by index
|
||||||
val index = it.pathParam("index").toUIntOrNull()
|
val index = it.pathParam("index").toUIntOrNull()
|
||||||
if (index == null) {
|
if (index == null) {
|
||||||
it.status(400).result(objectmapper.writeValueAsString(resultMessage("Invalid index")))
|
it.status(400)
|
||||||
|
.result(objectmapper.writeValueAsString(resultMessage("Invalid index")))
|
||||||
} else {
|
} else {
|
||||||
if (db.languageDB.DeleteByIndex(index.toInt())) {
|
if (db.languageDB.DeleteByIndex(index.toInt())) {
|
||||||
db.languageDB.Resort()
|
db.languageDB.Resort()
|
||||||
@@ -730,7 +760,8 @@ class WebApp(val listenPort: Int, val userlist: List<Pair<String, String>>, val
|
|||||||
// update by index
|
// update by index
|
||||||
val index = it.pathParam("index").toUIntOrNull()
|
val index = it.pathParam("index").toUIntOrNull()
|
||||||
if (index == null) {
|
if (index == null) {
|
||||||
it.status(400).result(objectmapper.writeValueAsString(resultMessage("Invalid index")))
|
it.status(400)
|
||||||
|
.result(objectmapper.writeValueAsString(resultMessage("Invalid index")))
|
||||||
} else {
|
} else {
|
||||||
val ll = db.languageDB.List.find { xx -> xx.index == index }
|
val ll = db.languageDB.List.find { xx -> xx.index == index }
|
||||||
if (ll == null) {
|
if (ll == null) {
|
||||||
@@ -865,7 +896,11 @@ class WebApp(val listenPort: Int, val userlist: List<Pair<String, String>>, val
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
} else it.status(500)
|
} else it.status(500)
|
||||||
.result(objectmapper.writeValueAsString(resultMessage("Failed to add schedule to database")))
|
.result(
|
||||||
|
objectmapper.writeValueAsString(
|
||||||
|
resultMessage("Failed to add schedule to database")
|
||||||
|
)
|
||||||
|
)
|
||||||
} else it.status(400)
|
} else it.status(400)
|
||||||
.result(objectmapper.writeValueAsString(resultMessage("Invalid Language")))
|
.result(objectmapper.writeValueAsString(resultMessage("Invalid Language")))
|
||||||
} else it.status(400)
|
} else it.status(400)
|
||||||
@@ -887,7 +922,8 @@ class WebApp(val listenPort: Int, val userlist: List<Pair<String, String>>, val
|
|||||||
// delete by index
|
// delete by index
|
||||||
val index = it.pathParam("index").toUIntOrNull()
|
val index = it.pathParam("index").toUIntOrNull()
|
||||||
if (index == null) {
|
if (index == null) {
|
||||||
it.status(400).result(objectmapper.writeValueAsString(resultMessage("Invalid index")))
|
it.status(400)
|
||||||
|
.result(objectmapper.writeValueAsString(resultMessage("Invalid index")))
|
||||||
} else {
|
} else {
|
||||||
if (db.scheduleDB.DeleteByIndex(index.toInt())) {
|
if (db.scheduleDB.DeleteByIndex(index.toInt())) {
|
||||||
db.scheduleDB.Resort()
|
db.scheduleDB.Resort()
|
||||||
@@ -914,18 +950,33 @@ class WebApp(val listenPort: Int, val userlist: List<Pair<String, String>>, val
|
|||||||
val _enable = json.get("Enable").asBoolean()
|
val _enable = json.get("Enable").asBoolean()
|
||||||
val _broadcast_zones = json.get("BroadcastZones").asText("")
|
val _broadcast_zones = json.get("BroadcastZones").asText("")
|
||||||
val _language = json.get("Language").asText("")
|
val _language = json.get("Language").asText("")
|
||||||
val newsb = ScheduleBank(index, _description, _day, _time, _soundpath, _repeat, _enable, _broadcast_zones, _language)
|
val newsb = ScheduleBank(
|
||||||
|
index,
|
||||||
|
_description,
|
||||||
|
_day,
|
||||||
|
_time,
|
||||||
|
_soundpath,
|
||||||
|
_repeat,
|
||||||
|
_enable,
|
||||||
|
_broadcast_zones,
|
||||||
|
_language
|
||||||
|
)
|
||||||
if (newsb.isNotEmpty()) {
|
if (newsb.isNotEmpty()) {
|
||||||
if (!sb.isEqual(newsb)) {
|
if (!sb.isEqual(newsb)) {
|
||||||
if (db.scheduleDB.UpdateByIndex(index.toInt(), newsb)) {
|
if (db.scheduleDB.UpdateByIndex(index.toInt(), newsb)) {
|
||||||
db.scheduleDB.Resort()
|
db.scheduleDB.Resort()
|
||||||
it.result(objectmapper.writeValueAsString(resultMessage("OK")))
|
it.result(objectmapper.writeValueAsString(resultMessage("OK")))
|
||||||
} else it.status(500).result(objectmapper.writeValueAsString(resultMessage("Failed to update schedule with index $index")))
|
} else it.status(500)
|
||||||
} else it.status(400).result(objectmapper.writeValueAsString(resultMessage("Nothing has changed for schedule with index $index")))
|
.result(objectmapper.writeValueAsString(resultMessage("Failed to update schedule with index $index")))
|
||||||
} else it.status(400).result(objectmapper.writeValueAsString(resultMessage("Some fields are empty")))
|
} else it.status(400)
|
||||||
|
.result(objectmapper.writeValueAsString(resultMessage("Nothing has changed for schedule with index $index")))
|
||||||
|
} else it.status(400)
|
||||||
|
.result(objectmapper.writeValueAsString(resultMessage("Some fields are empty")))
|
||||||
|
|
||||||
} else it.status(400).result(objectmapper.writeValueAsString(resultMessage("Schedule with index $index not found")))
|
} else it.status(400)
|
||||||
} else it.status(400).result(objectmapper.writeValueAsString(resultMessage("Invalid index")))
|
.result(objectmapper.writeValueAsString(resultMessage("Schedule with index $index not found")))
|
||||||
|
} else it.status(400)
|
||||||
|
.result(objectmapper.writeValueAsString(resultMessage("Invalid index")))
|
||||||
}
|
}
|
||||||
get("ExportXLSX") {
|
get("ExportXLSX") {
|
||||||
val xlsxdata = db.scheduleDB.Export_XLSX()
|
val xlsxdata = db.scheduleDB.Export_XLSX()
|
||||||
@@ -967,7 +1018,11 @@ class WebApp(val listenPort: Int, val userlist: List<Pair<String, String>>, val
|
|||||||
get("GetMessageAndBroadcastZones") {
|
get("GetMessageAndBroadcastZones") {
|
||||||
val result = object {
|
val result = object {
|
||||||
val messages = db.messageDB.List
|
val messages = db.messageDB.List
|
||||||
.filter { mb -> !mb.Message_Detail.contains("[") && !mb.Message_Detail.contains("]") }
|
.filter { mb ->
|
||||||
|
!mb.Message_Detail.contains("[") && !mb.Message_Detail.contains(
|
||||||
|
"]"
|
||||||
|
)
|
||||||
|
}
|
||||||
.map { mb -> "${mb.Description} [${mb.ANN_ID}]" }
|
.map { mb -> "${mb.Description} [${mb.ANN_ID}]" }
|
||||||
val broadcastzones = db.broadcastDB.List
|
val broadcastzones = db.broadcastDB.List
|
||||||
}
|
}
|
||||||
@@ -1072,7 +1127,8 @@ class WebApp(val listenPort: Int, val userlist: List<Pair<String, String>>, val
|
|||||||
// delete by index
|
// delete by index
|
||||||
val index = it.pathParam("index").toUIntOrNull()
|
val index = it.pathParam("index").toUIntOrNull()
|
||||||
if (index == null) {
|
if (index == null) {
|
||||||
it.status(400).result(objectmapper.writeValueAsString(resultMessage("Invalid index")))
|
it.status(400)
|
||||||
|
.result(objectmapper.writeValueAsString(resultMessage("Invalid index")))
|
||||||
} else {
|
} else {
|
||||||
if (db.userDB.DeleteByIndex(index.toInt())) {
|
if (db.userDB.DeleteByIndex(index.toInt())) {
|
||||||
db.userDB.Resort()
|
db.userDB.Resort()
|
||||||
@@ -1120,7 +1176,8 @@ class WebApp(val listenPort: Int, val userlist: List<Pair<String, String>>, val
|
|||||||
val atags = _airline_tags.split(";").map { it.trim() }
|
val atags = _airline_tags.split(";").map { it.trim() }
|
||||||
.filter { it.isNotEmpty() }.distinct()
|
.filter { it.isNotEmpty() }.distinct()
|
||||||
val ctags =
|
val ctags =
|
||||||
_city_tags.split(";").map { it.trim() }.filter { it.isNotEmpty() }
|
_city_tags.split(";").map { it.trim() }
|
||||||
|
.filter { it.isNotEmpty() }
|
||||||
.distinct()
|
.distinct()
|
||||||
val msgids = _messagebank_ann_id.split(";").map { it.trim() }
|
val msgids = _messagebank_ann_id.split(";").map { it.trim() }
|
||||||
.filter { it.isNotEmpty() }.distinct()
|
.filter { it.isNotEmpty() }.distinct()
|
||||||
@@ -1160,13 +1217,19 @@ class WebApp(val listenPort: Int, val userlist: List<Pair<String, String>>, val
|
|||||||
)
|
)
|
||||||
|
|
||||||
} else ctx.status(500).result(
|
} else ctx.status(500).result(
|
||||||
objectmapper.writeValueAsString(resultMessage("Failed to update user with index $index"))
|
objectmapper.writeValueAsString(
|
||||||
|
resultMessage("Failed to update user with index $index")
|
||||||
|
)
|
||||||
)
|
)
|
||||||
} else ctx.status(400).result(
|
} else ctx.status(400).result(
|
||||||
objectmapper.writeValueAsString(resultMessage("Nothing has changed for user with index $index"))
|
objectmapper.writeValueAsString(resultMessage("Nothing has changed for user with index $index"))
|
||||||
)
|
)
|
||||||
} else ctx.status(400)
|
} else ctx.status(400)
|
||||||
.result(objectmapper.writeValueAsString(resultMessage("Some broadcast zone is not found in Broadcast Zone list")))
|
.result(
|
||||||
|
objectmapper.writeValueAsString(
|
||||||
|
resultMessage("Some broadcast zone is not found in Broadcast Zone list")
|
||||||
|
)
|
||||||
|
)
|
||||||
} else ctx.status(400)
|
} else ctx.status(400)
|
||||||
.result(objectmapper.writeValueAsString(resultMessage("Some ANN_ID not found in Messagebank")))
|
.result(objectmapper.writeValueAsString(resultMessage("Some ANN_ID not found in Messagebank")))
|
||||||
} else ctx.status(400)
|
} else ctx.status(400)
|
||||||
@@ -1307,7 +1370,8 @@ class WebApp(val listenPort: Int, val userlist: List<Pair<String, String>>, val
|
|||||||
if (ValidString(_soundchannel)) {
|
if (ValidString(_soundchannel)) {
|
||||||
if (ValidString(_box)) {
|
if (ValidString(_box)) {
|
||||||
if (ValidString(_relay)) {
|
if (ValidString(_relay)) {
|
||||||
val newbp = BroadcastZones(0u, _description, _soundchannel, _box, _relay)
|
val newbp =
|
||||||
|
BroadcastZones(0u, _description, _soundchannel, _box, _relay)
|
||||||
if (db.broadcastDB.Add(newbp)) {
|
if (db.broadcastDB.Add(newbp)) {
|
||||||
db.broadcastDB.Resort()
|
db.broadcastDB.Resort()
|
||||||
it.result(objectmapper.writeValueAsString(resultMessage("OK")))
|
it.result(objectmapper.writeValueAsString(resultMessage("OK")))
|
||||||
@@ -1326,7 +1390,8 @@ class WebApp(val listenPort: Int, val userlist: List<Pair<String, String>>, val
|
|||||||
// delete by index
|
// delete by index
|
||||||
val index = it.pathParam("index").toUIntOrNull()
|
val index = it.pathParam("index").toUIntOrNull()
|
||||||
if (index == null) {
|
if (index == null) {
|
||||||
it.status(400).result(objectmapper.writeValueAsString(resultMessage("Invalid index")))
|
it.status(400)
|
||||||
|
.result(objectmapper.writeValueAsString(resultMessage("Invalid index")))
|
||||||
} else {
|
} else {
|
||||||
if (db.broadcastDB.DeleteByIndex(index.toInt())) {
|
if (db.broadcastDB.DeleteByIndex(index.toInt())) {
|
||||||
db.broadcastDB.Resort()
|
db.broadcastDB.Resort()
|
||||||
@@ -1342,7 +1407,8 @@ class WebApp(val listenPort: Int, val userlist: List<Pair<String, String>>, val
|
|||||||
// update by index
|
// update by index
|
||||||
val index = it.pathParam("index").toUIntOrNull()
|
val index = it.pathParam("index").toUIntOrNull()
|
||||||
if (index == null) {
|
if (index == null) {
|
||||||
it.status(400).result(objectmapper.writeValueAsString(resultMessage("Invalid index")))
|
it.status(400)
|
||||||
|
.result(objectmapper.writeValueAsString(resultMessage("Invalid index")))
|
||||||
} else {
|
} else {
|
||||||
val bz = db.broadcastDB.List.find { xx -> xx.index == index }
|
val bz = db.broadcastDB.List.find { xx -> xx.index == index }
|
||||||
if (bz == null) {
|
if (bz == null) {
|
||||||
@@ -1448,7 +1514,8 @@ class WebApp(val listenPort: Int, val userlist: List<Pair<String, String>>, val
|
|||||||
|
|
||||||
val index = it.pathParam("index").toUIntOrNull()
|
val index = it.pathParam("index").toUIntOrNull()
|
||||||
if (index == null) {
|
if (index == null) {
|
||||||
it.status(400).result(objectmapper.writeValueAsString(resultMessage("Invalid index")))
|
it.status(400)
|
||||||
|
.result(objectmapper.writeValueAsString(resultMessage("Invalid index")))
|
||||||
} else {
|
} else {
|
||||||
val sc = db.soundchannelDB.List.find { xx -> xx.index == index }
|
val sc = db.soundchannelDB.List.find { xx -> xx.index == index }
|
||||||
if (sc == null) {
|
if (sc == null) {
|
||||||
@@ -1471,7 +1538,8 @@ class WebApp(val listenPort: Int, val userlist: List<Pair<String, String>>, val
|
|||||||
} else {
|
} else {
|
||||||
|
|
||||||
// cek apakah ada soundchannel lain yang pakai ip dan channel yang sama
|
// cek apakah ada soundchannel lain yang pakai ip dan channel yang sama
|
||||||
val othersc = db.soundchannelDB.List.filter { sc -> sc.ip == _ip }
|
val othersc =
|
||||||
|
db.soundchannelDB.List.filter { sc -> sc.ip == _ip }
|
||||||
.filter { sc -> sc.index != index }
|
.filter { sc -> sc.index != index }
|
||||||
if (othersc.isNotEmpty()) {
|
if (othersc.isNotEmpty()) {
|
||||||
it.status(400)
|
it.status(400)
|
||||||
@@ -1481,10 +1549,20 @@ class WebApp(val listenPort: Int, val userlist: List<Pair<String, String>>, val
|
|||||||
val newsc = SoundChannel(0u, _channel, _ip)
|
val newsc = SoundChannel(0u, _channel, _ip)
|
||||||
if (db.soundchannelDB.UpdateByIndex(index.toInt(), newsc)) {
|
if (db.soundchannelDB.UpdateByIndex(index.toInt(), newsc)) {
|
||||||
db.soundchannelDB.Resort()
|
db.soundchannelDB.Resort()
|
||||||
it.result(objectmapper.writeValueAsString(resultMessage("OK")))
|
it.result(
|
||||||
|
objectmapper.writeValueAsString(
|
||||||
|
resultMessage(
|
||||||
|
"OK"
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
} else {
|
} else {
|
||||||
it.status(500)
|
it.status(500)
|
||||||
.result(objectmapper.writeValueAsString(resultMessage("Failed to update sound channel with index $index")))
|
.result(
|
||||||
|
objectmapper.writeValueAsString(
|
||||||
|
resultMessage("Failed to update sound channel with index $index")
|
||||||
|
)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1563,7 +1641,8 @@ class WebApp(val listenPort: Int, val userlist: List<Pair<String, String>>, val
|
|||||||
// delete by index
|
// delete by index
|
||||||
val index = it.pathParam("index").toUIntOrNull()
|
val index = it.pathParam("index").toUIntOrNull()
|
||||||
if (index == null) {
|
if (index == null) {
|
||||||
it.status(400).result(objectmapper.writeValueAsString(resultMessage("Invalid index")))
|
it.status(400)
|
||||||
|
.result(objectmapper.writeValueAsString(resultMessage("Invalid index")))
|
||||||
} else {
|
} else {
|
||||||
if (db.queuepagingDB.DeleteByIndex(index.toInt())) {
|
if (db.queuepagingDB.DeleteByIndex(index.toInt())) {
|
||||||
db.queuepagingDB.Resort()
|
db.queuepagingDB.Resort()
|
||||||
@@ -1577,7 +1656,6 @@ class WebApp(val listenPort: Int, val userlist: List<Pair<String, String>>, val
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
path("QueueTable") {
|
path("QueueTable") {
|
||||||
get("List") {
|
get("List") {
|
||||||
it.result(MariaDB.ArrayListtoString(db.queuetableDB.List))
|
it.result(MariaDB.ArrayListtoString(db.queuetableDB.List))
|
||||||
@@ -1596,7 +1674,8 @@ class WebApp(val listenPort: Int, val userlist: List<Pair<String, String>>, val
|
|||||||
// delete by index
|
// delete by index
|
||||||
val index = it.pathParam("index").toUIntOrNull()
|
val index = it.pathParam("index").toUIntOrNull()
|
||||||
if (index == null) {
|
if (index == null) {
|
||||||
it.status(400).result(objectmapper.writeValueAsString(resultMessage("Invalid index")))
|
it.status(400)
|
||||||
|
.result(objectmapper.writeValueAsString(resultMessage("Invalid index")))
|
||||||
} else {
|
} else {
|
||||||
if (db.queuetableDB.DeleteByIndex(index.toInt())) {
|
if (db.queuetableDB.DeleteByIndex(index.toInt())) {
|
||||||
db.queuetableDB.Resort()
|
db.queuetableDB.Resort()
|
||||||
@@ -1610,107 +1689,104 @@ class WebApp(val listenPort: Int, val userlist: List<Pair<String, String>>, val
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
path("Settings") {
|
path("FileManager") {
|
||||||
|
|
||||||
get("SoundbankDirectory") {
|
|
||||||
val dir = _config.Get(configKeys.SOUNDBANK_DIRECTORY.key)
|
|
||||||
it.result(objectmapper.writeValueAsString(resultMessage(dir)))
|
|
||||||
}
|
|
||||||
post("SoundbankDirectory") {
|
|
||||||
val json: JsonNode = objectmapper.readTree(it.body())
|
|
||||||
val newdir = json.get("directory").asText("")
|
|
||||||
if (ValidString(newdir)) {
|
|
||||||
_config.Set(configKeys.SOUNDBANK_DIRECTORY.key, newdir)
|
|
||||||
_config.Save()
|
|
||||||
Logger.info { "Changed Soundbank Directory to $newdir" }
|
|
||||||
it.result(objectmapper.writeValueAsString(resultMessage("OK")))
|
|
||||||
} else {
|
|
||||||
it.status(400)
|
|
||||||
.result(objectmapper.writeValueAsString(resultMessage("Invalid directory value")))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
get("SoundbankResultList") {
|
|
||||||
it.result(objectmapper.writeValueAsString(ListAudioFiles(Somecodes.SoundbankResult_directory)))
|
|
||||||
}
|
|
||||||
|
|
||||||
get("SoundbankResultFile/{filename}") {
|
|
||||||
|
|
||||||
//TODO recheck bener/gak cara downloadnya
|
|
||||||
val filename = it.pathParam("filename")
|
|
||||||
|
|
||||||
val filepath = Somecodes.SoundbankResult_directory.resolve(filename)
|
|
||||||
if (ValidFile(filename) && Files.isRegularFile(filepath)) {
|
|
||||||
it.header(
|
|
||||||
"Content-Disposition",
|
|
||||||
"attachment; filename=\"$filename\""
|
|
||||||
)
|
|
||||||
it.outputStream().use { out ->
|
|
||||||
Files.newInputStream(filepath).use { inp ->
|
|
||||||
inp.copyTo(out)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
it.status(404).result(objectmapper.writeValueAsString(resultMessage("File not found")))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
get("PagingResultList") {
|
get("PagingResultList") {
|
||||||
it.result(objectmapper.writeValueAsString(ListAudioFiles(Somecodes.PagingResult_directory)))
|
it.result(objectmapper.writeValueAsString(ListAudioFiles(Somecodes.PagingResult_directory)))
|
||||||
}
|
}
|
||||||
|
delete("DeleteOldPagingResultFiles/{days}") {
|
||||||
get("PagingResultFile/{filename}") {
|
// kalau tidak ada, default 7 hari
|
||||||
val filename = it.pathParam("filename")
|
val days = it.pathParam("days").toIntOrNull() ?: 7
|
||||||
val filepath = Somecodes.PagingResult_directory.resolve(filename)
|
Somecodes.Delete_Old_PagingResult_Files(days) { success, failed ->
|
||||||
if (ValidFile(filename) && Files.isRegularFile(filepath)) {
|
it.result(objectmapper.writeValueAsString(resultMessage("Old paging result files deleted. Deleted: $success, Failed: $failed")))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
delete("ClearPagingResultFiles") {
|
||||||
|
Somecodes.Clear_PagingResult_Directory { success, failed ->
|
||||||
|
it.result(objectmapper.writeValueAsString(resultMessage("Paging result files cleared. Deleted: $success, Failed: $failed")))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
post("DownloadPagingResultFile") {
|
||||||
|
val json: JsonNode = objectmapper.readTree(it.body())
|
||||||
|
val filename = json.get("filename").asText("")
|
||||||
|
if (filename.isNotEmpty()) {
|
||||||
|
val p: Path = Somecodes.PagingResult_directory.resolve(filename)
|
||||||
|
if (ValidFile(p)) {
|
||||||
it.header("Content-Disposition", "attachment; filename=\"$filename\"")
|
it.header("Content-Disposition", "attachment; filename=\"$filename\"")
|
||||||
it.outputStream().use { out ->
|
it.outputStream().use { out ->
|
||||||
Files.newInputStream(filepath).use { inp ->
|
Files.newInputStream(p).use { inp ->
|
||||||
inp.copyTo(out)
|
inp.copyTo(out)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else it.status(400)
|
||||||
it.status(404).result(objectmapper.writeValueAsString(resultMessage("File not found")))
|
.result(objectmapper.writeValueAsString(resultMessage("File not found")))
|
||||||
|
} else it.status(400)
|
||||||
|
.result(objectmapper.writeValueAsString(resultMessage("Filename is empty")))
|
||||||
|
}
|
||||||
|
get("SoundbankResultList") {
|
||||||
|
it.result(objectmapper.writeValueAsString(ListAudioFiles(Somecodes.SoundbankResult_directory)))
|
||||||
|
}
|
||||||
|
delete("DeleteOldSoundbankResultFiles/{days}") {
|
||||||
|
// kalau tidak ada, default 7 hari
|
||||||
|
val days = it.pathParam("days").toIntOrNull() ?: 7
|
||||||
|
Somecodes.Delete_Old_SoundbankResult_Files(days) { success, failed ->
|
||||||
|
it.result(objectmapper.writeValueAsString(resultMessage("Old soundbank result files deleted. Deleted: $success, Failed: $failed")))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
delete("ClearSoundbankResultFiles") {
|
||||||
get("FISCode") {
|
Somecodes.Clear_PagingResult_Directory { success, failed ->
|
||||||
//TODO get FIS code
|
it.result(objectmapper.writeValueAsString(resultMessage("Soundbank result files cleared. Deleted: $success, Failed: $failed")))
|
||||||
val value = object {
|
|
||||||
//get from config file
|
|
||||||
val GOP = _config.Get(configKeys.REMARK_GOP.key)
|
|
||||||
val GBD = _config.Get(configKeys.REMARK_GBD.key)
|
|
||||||
val GFC = _config.Get(configKeys.REMARK_GFC.key)
|
|
||||||
val FLD = _config.Get(configKeys.REMARK_FLD.key)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
it.result(objectmapper.writeValueAsString(value))
|
|
||||||
}
|
}
|
||||||
|
post("DownloadSoundbankResultFile") {
|
||||||
post("FISCode") {
|
|
||||||
//TODO set FIS code
|
|
||||||
|
|
||||||
val json: JsonNode = objectmapper.readTree(it.body())
|
val json: JsonNode = objectmapper.readTree(it.body())
|
||||||
val _gop = json.get("GOP").asText("")
|
val filename = json.get("filename").asText("")
|
||||||
val _gbd = json.get("GBD").asText("")
|
if (filename.isNotEmpty()) {
|
||||||
val _gfc = json.get("GFC").asText("")
|
val p: Path = Somecodes.SoundbankResult_directory.resolve(filename)
|
||||||
val _fld = json.get("FLD").asText("")
|
if (ValidFile(p)) {
|
||||||
if (ValidString(_gop) && ValidString(_gbd) && ValidString(_gfc) && ValidString(_fld)) {
|
it.header("Content-Disposition", "attachment; filename=\"$filename\"")
|
||||||
// save to config file
|
it.outputStream().use { out ->
|
||||||
_config.Set(configKeys.REMARK_GOP.key, _gop)
|
Files.newInputStream(p).use { inp ->
|
||||||
_config.Set(configKeys.REMARK_GBD.key, _gbd)
|
inp.copyTo(out)
|
||||||
_config.Set(configKeys.REMARK_GFC.key, _gfc)
|
}
|
||||||
_config.Set(configKeys.REMARK_FLD.key, _fld)
|
}
|
||||||
_config.Save()
|
} else it.status(400)
|
||||||
Logger.info { "Changed FIS Codes" }
|
.result(objectmapper.writeValueAsString(resultMessage("File not found")))
|
||||||
db.Add_Log("AAS", "Save FIS Codes Message: GOP=$_gop, GBD=$_gbd, GFC=$_gfc, FLD=$_fld")
|
} else it.status(400)
|
||||||
it.result(objectmapper.writeValueAsString(resultMessage("OK")))
|
.result(objectmapper.writeValueAsString(resultMessage("Filename is empty")))
|
||||||
|
}
|
||||||
|
get("ListSoundbank/{language}/{voice}/{category}"){
|
||||||
|
val language = it.pathParam("language")
|
||||||
|
val voice = it.pathParam("voice")
|
||||||
|
val category = it.pathParam("category")
|
||||||
|
//println("ListSoundbank called with language=$language, voice=$voice, category=$category")
|
||||||
|
if (ValidString(language) && Language.entries.any { lang -> lang.name == language }) {
|
||||||
|
if (ValidString(voice) && VoiceType.entries.any { vtype -> vtype.name == voice }) {
|
||||||
|
if (ValidString(category) && Category.entries.any { cat -> cat.name == category }) {
|
||||||
|
val targetdir = Somecodes.SoundbankDirectory(
|
||||||
|
Language.valueOf(language),
|
||||||
|
VoiceType.valueOf(voice),
|
||||||
|
Category.valueOf(category)
|
||||||
|
)
|
||||||
|
val result = ListAudioFiles(targetdir).map{ mm ->
|
||||||
|
// just the filename, without path
|
||||||
|
mm.substring(mm.lastIndexOf(File.separator)+1)
|
||||||
|
}
|
||||||
|
//println("ListSoundbank result: $result")
|
||||||
|
it.result(objectmapper.writeValueAsString(result))
|
||||||
} else {
|
} else {
|
||||||
it.status(400)
|
it.status(400)
|
||||||
.result(objectmapper.writeValueAsString(resultMessage("Invalid FIS code value")))
|
.result(objectmapper.writeValueAsString(resultMessage("Category parameter is invalid")))
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
it.status(400)
|
||||||
|
.result(objectmapper.writeValueAsString(resultMessage("VoiceType parameter is invalid")))
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
it.status(400)
|
||||||
|
.result(objectmapper.writeValueAsString(resultMessage("Language parameter is invalid")))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// tested ok
|
||||||
post("UploadSoundbank/{language}/{voice}/{category}") {
|
post("UploadSoundbank/{language}/{voice}/{category}") {
|
||||||
val language = it.pathParam("language")
|
val language = it.pathParam("language")
|
||||||
val voice = it.pathParam("voice")
|
val voice = it.pathParam("voice")
|
||||||
@@ -1729,8 +1805,12 @@ class WebApp(val listenPort: Int, val userlist: List<Pair<String, String>>, val
|
|||||||
if (!Files.isDirectory(targetdir)) Files.createDirectories(targetdir)
|
if (!Files.isDirectory(targetdir)) Files.createDirectories(targetdir)
|
||||||
val successfiles = mutableListOf<String>()
|
val successfiles = mutableListOf<String>()
|
||||||
val failedfiles = mutableListOf<String>()
|
val failedfiles = mutableListOf<String>()
|
||||||
|
val alreadyexists = mutableListOf<String>()
|
||||||
uploaded.forEach { ff ->
|
uploaded.forEach { ff ->
|
||||||
val targetfile = targetdir.resolve(ff.filename())
|
val targetfile = targetdir.resolve(ff.filename())
|
||||||
|
if (Files.exists(targetfile)) {
|
||||||
|
alreadyexists.add(ff.filename())
|
||||||
|
} else {
|
||||||
try {
|
try {
|
||||||
Files.newOutputStream(targetfile).use { out ->
|
Files.newOutputStream(targetfile).use { out ->
|
||||||
ff.content().use { inp ->
|
ff.content().use { inp ->
|
||||||
@@ -1745,28 +1825,115 @@ class WebApp(val listenPort: Int, val userlist: List<Pair<String, String>>, val
|
|||||||
}
|
}
|
||||||
failedfiles.add(ff.filename())
|
failedfiles.add(ff.filename())
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
if (successfiles.size == uploaded.size) {
|
if (successfiles.size == uploaded.size) {
|
||||||
it.result(objectmapper.writeValueAsString(resultMessage("All files uploaded successfully: ${successfiles.joinToString(", ")}")))
|
it.result(
|
||||||
|
objectmapper.writeValueAsString(
|
||||||
|
resultMessage(
|
||||||
|
"All files uploaded successfully: ${
|
||||||
|
successfiles.joinToString(
|
||||||
|
", "
|
||||||
|
)
|
||||||
|
}"
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
} else {
|
} else {
|
||||||
it.result(objectmapper.writeValueAsString(resultMessage("Some files uploaded successfully: ${successfiles.joinToString(", ")}, failed: ${failedfiles.joinToString(", ")}")))
|
it.result(
|
||||||
|
objectmapper.writeValueAsString(
|
||||||
|
resultMessage(
|
||||||
|
"Some files uploaded successfully: ${
|
||||||
|
successfiles.joinToString(
|
||||||
|
", "
|
||||||
|
)
|
||||||
|
}, failed: ${failedfiles.joinToString(", ")}, already exists: ${alreadyexists.joinToString(", ")}"
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
it.status(400)
|
it.status(400)
|
||||||
.result(objectmapper.writeValueAsString(resultMessage("No file uploaded")))
|
.result(objectmapper.writeValueAsString(resultMessage("No file uploaded")))
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
it.status(400).result(objectmapper.writeValueAsString(resultMessage("Category parameter is invalid")))
|
it.status(400)
|
||||||
|
.result(objectmapper.writeValueAsString(resultMessage("Category parameter is invalid")))
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
it.status(400).result(objectmapper.writeValueAsString(resultMessage("VoiceType parameter is invalid")))
|
it.status(400)
|
||||||
|
.result(objectmapper.writeValueAsString(resultMessage("VoiceType parameter is invalid")))
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
it.status(400).result(objectmapper.writeValueAsString(resultMessage("Language parameter is invalid")))
|
it.status(400)
|
||||||
|
.result(objectmapper.writeValueAsString(resultMessage("Language parameter is invalid")))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
path("Settings") {
|
||||||
|
get("SoundbankDirectory") {
|
||||||
|
val dir = _config.Get(configKeys.SOUNDBANK_DIRECTORY.key)
|
||||||
|
it.result(objectmapper.writeValueAsString(resultMessage(dir)))
|
||||||
|
}
|
||||||
|
post("SoundbankDirectory") {
|
||||||
|
val json: JsonNode = objectmapper.readTree(it.body())
|
||||||
|
val newdir = json.get("directory").asText("")
|
||||||
|
if (ValidString(newdir)) {
|
||||||
|
_config.Set(configKeys.SOUNDBANK_DIRECTORY.key, newdir)
|
||||||
|
_config.Save()
|
||||||
|
Logger.info { "Changed Soundbank Directory to $newdir" }
|
||||||
|
it.result(objectmapper.writeValueAsString(resultMessage("OK")))
|
||||||
|
} else {
|
||||||
|
it.status(400)
|
||||||
|
.result(objectmapper.writeValueAsString(resultMessage("Invalid directory value")))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
get("FISCode") {
|
||||||
|
|
||||||
|
val value = object {
|
||||||
|
//get from config file
|
||||||
|
val GOP = _config.Get(configKeys.REMARK_GOP.key)
|
||||||
|
val GBD = _config.Get(configKeys.REMARK_GBD.key)
|
||||||
|
val GFC = _config.Get(configKeys.REMARK_GFC.key)
|
||||||
|
val FLD = _config.Get(configKeys.REMARK_FLD.key)
|
||||||
|
val defaultvoice = _config.Get(configKeys.DEFAULT_VOICE_TYPE.key)
|
||||||
|
}
|
||||||
|
//println("Serving FIS Code request: GOP=${value.GOP}, GBD=${value.GBD}, GFC=${value.GFC}, FLD=${value.FLD}, DefaultVoice=${value.defaultvoice}")
|
||||||
|
it.result(objectmapper.writeValueAsString(value))
|
||||||
|
}
|
||||||
|
|
||||||
|
post("FISCode") {
|
||||||
|
|
||||||
|
val json: JsonNode = objectmapper.readTree(it.body())
|
||||||
|
val _gop = json.get("GOP").asText("")
|
||||||
|
val _gbd = json.get("GBD").asText("")
|
||||||
|
val _gfc = json.get("GFC").asText("")
|
||||||
|
val _fld = json.get("FLD").asText("")
|
||||||
|
val defaultvoice = json.get("defaultvoice").asText("")
|
||||||
|
//println("Received FIS Code update: GOP=$_gop, GBD=$_gbd, GFC=$_gfc, FLD=$_fld, DefaultVoice=$defaultvoice")
|
||||||
|
if (ValidString(_gop) && ValidString(_gbd) && ValidString(_gfc) && ValidString(_fld)) {
|
||||||
|
// save to config file
|
||||||
|
_config.Set(configKeys.REMARK_GOP.key, _gop)
|
||||||
|
_config.Set(configKeys.REMARK_GBD.key, _gbd)
|
||||||
|
_config.Set(configKeys.REMARK_GFC.key, _gfc)
|
||||||
|
_config.Set(configKeys.REMARK_FLD.key, _fld)
|
||||||
|
_config.Set(configKeys.DEFAULT_VOICE_TYPE.key, defaultvoice)
|
||||||
|
_config.Save()
|
||||||
|
Logger.info { "Changed FIS Codes" }
|
||||||
|
db.Add_Log(
|
||||||
|
"AAS",
|
||||||
|
"Save FIS Codes Message: GOP=$_gop, GBD=$_gbd, GFC=$_gfc, FLD=$_fld"
|
||||||
|
)
|
||||||
|
it.result(objectmapper.writeValueAsString(resultMessage("OK")))
|
||||||
|
} else {
|
||||||
|
it.status(400)
|
||||||
|
.result(objectmapper.writeValueAsString(resultMessage("Invalid FIS code value")))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}.start(listenPort)
|
}.start(listenPort)
|
||||||
|
|||||||
Reference in New Issue
Block a user