commit 25/11/2025
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
#Configuration file
|
#Configuration file
|
||||||
#Tue Oct 28 14:18:19 WIB 2025
|
#Tue Nov 25 10:00:19 WIB 2025
|
||||||
auto.delete.result.days=7
|
auto.delete.result.days=7
|
||||||
database.host=localhost
|
database.host=localhost
|
||||||
database.name=aas
|
database.name=aas
|
||||||
|
|||||||
@@ -67,10 +67,48 @@ function load_default_voice(){
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function Get_WebAccessSetting(){
|
||||||
|
fetchAPI("Settings/WebAccess", "GET", {}, null, (okdata) => {
|
||||||
|
let adminpass = okdata.adminpass || "password";
|
||||||
|
let viewerpass = okdata.userpass || "password";
|
||||||
|
$("#adminpassword1").val(adminpass);
|
||||||
|
$("#adminpassword2").val(adminpass);
|
||||||
|
$("#viewerpassword1").val(viewerpass);
|
||||||
|
$("#viewerpassword2").val(viewerpass);
|
||||||
|
}, (errdata) => {
|
||||||
|
alert("Error getting Web Access settings : " + errdata.message);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function Set_WebAccessSetting(){
|
||||||
|
let adminpass1 = $("#adminpassword1").val();
|
||||||
|
let adminpass2 = $("#adminpassword2").val();
|
||||||
|
let viewerpass1 = $("#viewerpassword1").val();
|
||||||
|
let viewerpass2 = $("#viewerpassword2").val();
|
||||||
|
if(adminpass1 !== adminpass2){
|
||||||
|
alert("Admin passwords do not match.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if(viewerpass1 !== viewerpass2){
|
||||||
|
alert("Viewer passwords do not match.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
let data = {
|
||||||
|
adminpass: adminpass1,
|
||||||
|
viewerpass: viewerpass1
|
||||||
|
};
|
||||||
|
fetchAPI("Settings/WebAccess", "POST", {}, data, (okdata) => {
|
||||||
|
alert("Web Access settings updated successfully.");
|
||||||
|
}, (errdata) => {
|
||||||
|
alert("Error updating Web Access settings : " + errdata.message);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
console.log("setting.js loaded");
|
console.log("setting.js loaded");
|
||||||
load_default_voice();
|
load_default_voice();
|
||||||
Get_OldResultDays();
|
Get_OldResultDays();
|
||||||
|
Get_WebAccessSetting();
|
||||||
load_messagebank(() => load_remark_selection());
|
load_messagebank(() => load_remark_selection());
|
||||||
$("#fiscodesave").off('click').on('click', function () {
|
$("#fiscodesave").off('click').on('click', function () {
|
||||||
Set_OldResultDays();
|
Set_OldResultDays();
|
||||||
@@ -97,6 +135,9 @@ $(document).ready(function () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
$("#webaccesssave").off('click').on('click', function () {
|
||||||
|
Set_WebAccessSetting();
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
125
html/webpage/homeadmin.html
Normal file
125
html/webpage/homeadmin.html
Normal file
@@ -0,0 +1,125 @@
|
|||||||
|
<!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 NewGeneration 17092025</title>
|
||||||
|
<link rel="stylesheet" href="assets/bootstrap/css/bootstrap.min.css">
|
||||||
|
<link rel="stylesheet" href="assets/css/Font%20Awesome%205%20Brands.css">
|
||||||
|
<link rel="stylesheet" href="assets/css/Font%20Awesome%205%20Duotone.css">
|
||||||
|
<link rel="stylesheet" href="assets/css/Font%20Awesome%205%20Pro.css">
|
||||||
|
<link rel="stylesheet" href="assets/css/Font%20Awesome%206%20Brands.css">
|
||||||
|
<link rel="stylesheet" href="assets/css/Font%20Awesome%206%20Duotone.css">
|
||||||
|
<link rel="stylesheet" href="assets/css/Font%20Awesome%206%20Pro.css">
|
||||||
|
<link rel="stylesheet" href="assets/css/FontAwesome.css">
|
||||||
|
<link rel="stylesheet" href="assets/css/bss-overrides.css">
|
||||||
|
<link rel="stylesheet" href="assets/css/all.min.css">
|
||||||
|
<link rel="stylesheet" href="assets/css/select2.min.css">
|
||||||
|
<link rel="stylesheet" href="assets/css/Login-Form-Basic-icons.css">
|
||||||
|
<link rel="stylesheet" href="assets/css/styles.css">
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<div class="text-dark bg-light pad-header bg-header" id="header_home">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-2 col-sm-2 col-md-1 col-lg-1 col-xl-1"><button class="btn btn-primary h-100 bread-menu" id="showmenu" type="button"><svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 24 24" width="1em" fill="currentColor" style="width: 32px;height: 32px;">
|
||||||
|
<path d="M0 0h24v24H0z" fill="none"></path>
|
||||||
|
<path d="M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z"></path>
|
||||||
|
</svg></button></div>
|
||||||
|
<div class="col-8 col-sm-8 col-md-10 col-lg-10 col-xl-10 col-xxl-10">
|
||||||
|
<h1 class="text-header" style="text-align: left;">Automatic Announcement System</h1>
|
||||||
|
</div>
|
||||||
|
<div class="col-2 col-sm-2 col-md-1 col-lg-1 col-xl-1 col-xxl-1 offset-xxl-0 align-items-end align-ite"><img id="onlineindicator" class="img-indicator" src="assets/img/red_circle.png" width="24" height="24"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="offcanvas offcanvas-start bg-body" tabindex="-1" data-bs-backdrop="false" id="offcanvas-menu">
|
||||||
|
<div class="offcanvas-header"><a class="link-body-emphasis d-flex align-items-center me-md-auto mb-3 mb-md-0 text-decoration-none" href="/"><img src="assets/img/logogtc-grey.png" width="48" height="48"><span class="fs-4 font-top-menu">AAS v.2 </span></a><button class="btn-close" type="button" aria-label="Close" data-bs-dismiss="offcanvas"></button></div>
|
||||||
|
<div class="offcanvas-body d-flex flex-column justify-content-between pt-0">
|
||||||
|
<div>
|
||||||
|
<hr class="mt-0">
|
||||||
|
<ul class="nav nav-pills flex-column mb-auto">
|
||||||
|
<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>
|
||||||
|
</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 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>
|
||||||
|
</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;">
|
||||||
|
<path d="M0 0h24v24H0z" fill="none"></path>
|
||||||
|
<path d="M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-2 12H6v-2h12v2zm0-3H6V9h12v2zm0-3H6V6h12v2z"></path>
|
||||||
|
</svg> Message Bank</a></li>
|
||||||
|
<li class="nav-item"><a class="nav-link link-body-emphasis text-menu" id="languagelink" 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;">
|
||||||
|
<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>
|
||||||
|
</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 pad-icon-menu" style="font-size: 20px;">
|
||||||
|
<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="M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"></path>
|
||||||
|
</svg> Timer</a></li>
|
||||||
|
<li class="nav-item .icon-menu"><a class="nav-link link-body-emphasis text-menu" id="broadcastzonelink" 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;">
|
||||||
|
<path d="M0 0h24v24H0z" fill="none"></path>
|
||||||
|
<path d="M18.2 1H9.8C8.81 1 8 1.81 8 2.8v14.4c0 .99.81 1.79 1.8 1.79l8.4.01c.99 0 1.8-.81 1.8-1.8V2.8c0-.99-.81-1.8-1.8-1.8zM14 3c1.1 0 2 .89 2 2s-.9 2-2 2-2-.89-2-2 .9-2 2-2zm0 13.5c-2.21 0-4-1.79-4-4s1.79-4 4-4 4 1.79 4 4-1.79 4-4 4z"></path>
|
||||||
|
<circle cx="14" cy="12.5" r="2.5"></circle>
|
||||||
|
<path d="M6 5H4v16c0 1.1.89 2 2 2h10v-2H6V5z"></path>
|
||||||
|
</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 pad-icon-menu" style="font-size: 20px;">
|
||||||
|
<g>
|
||||||
|
<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>
|
||||||
|
</g>
|
||||||
|
</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 pad-icon-menu" style="font-size: 20px;">
|
||||||
|
<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>
|
||||||
|
</svg> User Management</a></li>
|
||||||
|
<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>
|
||||||
|
<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>
|
||||||
|
</g>
|
||||||
|
</svg> Setting</a></li>
|
||||||
|
<li class="nav-item"><a class="nav-link link-body-emphasis text-menu" id="logoutlink" 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;">
|
||||||
|
<path d="M0 0h24v24H0z" fill="none"></path>
|
||||||
|
<path d="M17 7l-1.41 1.41L18.17 11H8v2h10.17l-2.58 2.58L17 17l5-5zM4 5h8V3H4c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h8v-2H4V5z"></path>
|
||||||
|
</svg> Logout</a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col card-status">
|
||||||
|
<p class="w-100 h-100 text-status" id="cpustatus">CPU Status : <br><br></p>
|
||||||
|
</div>
|
||||||
|
<div class="col card-status">
|
||||||
|
<p class="w-100 h-100 text-status" id="ramstatus">RAM Status : <br><br></p>
|
||||||
|
</div>
|
||||||
|
<div class="col card-status">
|
||||||
|
<p class="w-100 h-100 text-status" id="diskstatus">Disk Status : <br><br></p>
|
||||||
|
</div>
|
||||||
|
<div class="col card-status">
|
||||||
|
<p class="w-100 h-100 text-status" id="networkstatus">Network </p>
|
||||||
|
</div>
|
||||||
|
<div class="col card-status">
|
||||||
|
<p class="w-100 h-100 text-status" id="datetimetext">Date and Time </p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="container w-100 pad-container" id="content"></div>
|
||||||
|
<script src="assets/bootstrap/js/bootstrap.min.js"></script>
|
||||||
|
<script src="assets/js/bs-init.js"></script>
|
||||||
|
<script src="assets/js/jquery-3.7.1.min.js"></script>
|
||||||
|
<script src="assets/js/script.js"></script>
|
||||||
|
<script src="assets/js/all.min.js"></script>
|
||||||
|
<script src="assets/js/select2.min.js"></script>
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
||||||
85
html/webpage/homeviewer.html
Normal file
85
html/webpage/homeviewer.html
Normal file
@@ -0,0 +1,85 @@
|
|||||||
|
<!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 NewGeneration 17092025</title>
|
||||||
|
<link rel="stylesheet" href="assets/bootstrap/css/bootstrap.min.css">
|
||||||
|
<link rel="stylesheet" href="assets/css/Font%20Awesome%205%20Brands.css">
|
||||||
|
<link rel="stylesheet" href="assets/css/Font%20Awesome%205%20Duotone.css">
|
||||||
|
<link rel="stylesheet" href="assets/css/Font%20Awesome%205%20Pro.css">
|
||||||
|
<link rel="stylesheet" href="assets/css/Font%20Awesome%206%20Brands.css">
|
||||||
|
<link rel="stylesheet" href="assets/css/Font%20Awesome%206%20Duotone.css">
|
||||||
|
<link rel="stylesheet" href="assets/css/Font%20Awesome%206%20Pro.css">
|
||||||
|
<link rel="stylesheet" href="assets/css/FontAwesome.css">
|
||||||
|
<link rel="stylesheet" href="assets/css/bss-overrides.css">
|
||||||
|
<link rel="stylesheet" href="assets/css/all.min.css">
|
||||||
|
<link rel="stylesheet" href="assets/css/select2.min.css">
|
||||||
|
<link rel="stylesheet" href="assets/css/Login-Form-Basic-icons.css">
|
||||||
|
<link rel="stylesheet" href="assets/css/styles.css">
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<div class="text-dark bg-light pad-header bg-header" id="header_home">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-2 col-sm-2 col-md-1 col-lg-1 col-xl-1"><button class="btn btn-primary h-100 bread-menu" id="showmenu" type="button"><svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 24 24" width="1em" fill="currentColor" style="width: 32px;height: 32px;">
|
||||||
|
<path d="M0 0h24v24H0z" fill="none"></path>
|
||||||
|
<path d="M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z"></path>
|
||||||
|
</svg></button></div>
|
||||||
|
<div class="col-8 col-sm-8 col-md-10 col-lg-10 col-xl-10 col-xxl-10">
|
||||||
|
<h1 class="text-header" style="text-align: left;">Automatic Announcement System</h1>
|
||||||
|
</div>
|
||||||
|
<div class="col-2 col-sm-2 col-md-1 col-lg-1 col-xl-1 col-xxl-1 offset-xxl-0 align-items-end align-ite"><img id="onlineindicator" class="img-indicator" src="assets/img/red_circle.png" width="24" height="24"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="offcanvas offcanvas-start bg-body" tabindex="-1" data-bs-backdrop="false" id="offcanvas-menu">
|
||||||
|
<div class="offcanvas-header"><a class="link-body-emphasis d-flex align-items-center me-md-auto mb-3 mb-md-0 text-decoration-none" href="/"><img src="assets/img/logogtc-grey.png" width="48" height="48"><span class="fs-4 font-top-menu">AAS v.2 </span></a><button class="btn-close" type="button" aria-label="Close" data-bs-dismiss="offcanvas"></button></div>
|
||||||
|
<div class="offcanvas-body d-flex flex-column justify-content-between pt-0">
|
||||||
|
<div>
|
||||||
|
<hr class="mt-0">
|
||||||
|
<ul class="nav nav-pills flex-column mb-auto">
|
||||||
|
<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>
|
||||||
|
</svg> Overview</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 pad-icon-menu" style="font-size: 20px;">
|
||||||
|
<g>
|
||||||
|
<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>
|
||||||
|
</g>
|
||||||
|
</svg> Log</a></li>
|
||||||
|
<li class="nav-item"><a class="nav-link link-body-emphasis text-menu" id="logoutlink" 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;">
|
||||||
|
<path d="M0 0h24v24H0z" fill="none"></path>
|
||||||
|
<path d="M17 7l-1.41 1.41L18.17 11H8v2h10.17l-2.58 2.58L17 17l5-5zM4 5h8V3H4c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h8v-2H4V5z"></path>
|
||||||
|
</svg> Logout</a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col card-status">
|
||||||
|
<p class="w-100 h-100 text-status" id="cpustatus">CPU Status : <br><br></p>
|
||||||
|
</div>
|
||||||
|
<div class="col card-status">
|
||||||
|
<p class="w-100 h-100 text-status" id="ramstatus">RAM Status : <br><br></p>
|
||||||
|
</div>
|
||||||
|
<div class="col card-status">
|
||||||
|
<p class="w-100 h-100 text-status" id="diskstatus">Disk Status : <br><br></p>
|
||||||
|
</div>
|
||||||
|
<div class="col card-status">
|
||||||
|
<p class="w-100 h-100 text-status" id="networkstatus">Network </p>
|
||||||
|
</div>
|
||||||
|
<div class="col card-status">
|
||||||
|
<p class="w-100 h-100 text-status" id="datetimetext">Date and Time </p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="container w-100 pad-container" id="content"></div>
|
||||||
|
<script src="assets/bootstrap/js/bootstrap.min.js"></script>
|
||||||
|
<script src="assets/js/bs-init.js"></script>
|
||||||
|
<script src="assets/js/jquery-3.7.1.min.js"></script>
|
||||||
|
<script src="assets/js/script.js"></script>
|
||||||
|
<script src="assets/js/all.min.js"></script>
|
||||||
|
<script src="assets/js/select2.min.js"></script>
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
||||||
@@ -97,6 +97,31 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col">
|
||||||
|
<div class="card">
|
||||||
|
<div class="card-body">
|
||||||
|
<h4 class="card-title">Web Access Setting</h4>
|
||||||
|
<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="col-sm-3 col-md-3 col-lg-3 col-xl-3"><label class="col-form-label w-100">Admin</label></div>
|
||||||
|
<div class="col"><input class="w-100" type="password" id="adminpassword1" placeholder="password for admin"></div>
|
||||||
|
<div class="col"><input class="w-100" type="password" id="adminpassword2" placeholder="repeat password for admin"></div>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-sm-3 col-md-3 col-lg-3 col-xl-3"><label class="col-form-label w-100">Viewer</label></div>
|
||||||
|
<div class="col"><input class="w-100" type="password" id="viewerpassword1" placeholder="password for viewer"></div>
|
||||||
|
<div class="col"><input class="w-100" type="password" id="viewerpassword2" placeholder="repeat password for viewer"></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="webaccesssave" type="button">Save</button></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<script src="assets/bootstrap/js/bootstrap.min.js"></script>
|
<script src="assets/bootstrap/js/bootstrap.min.js"></script>
|
||||||
<script src="assets/js/bs-init.js"></script>
|
<script src="assets/js/bs-init.js"></script>
|
||||||
<script src="assets/js/setting.js"></script>
|
<script src="assets/js/setting.js"></script>
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ 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.15 (24/11/2025)"
|
const val version = "0.0.16 (25/11/2025)"
|
||||||
// AAS 64 channels
|
// AAS 64 channels
|
||||||
const val max_channel = 64
|
const val max_channel = 64
|
||||||
|
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ import java.util.UUID
|
|||||||
|
|
||||||
|
|
||||||
@Suppress("unused")
|
@Suppress("unused")
|
||||||
class WebApp(val listenPort: Int, val userlist: List<Pair<String, String>>, val _config: configFile) {
|
class WebApp(val listenPort: Int, var userlist: List<Pair<String, String>>, val _config: configFile) {
|
||||||
|
|
||||||
lateinit var app: Javalin
|
lateinit var app: Javalin
|
||||||
lateinit var semiauto: Javalin
|
lateinit var semiauto: Javalin
|
||||||
@@ -119,11 +119,103 @@ class WebApp(val listenPort: Int, val userlist: List<Pair<String, String>>, val
|
|||||||
//it.sessionAttribute("user", user.first)
|
//it.sessionAttribute("user", user.first)
|
||||||
it.cookie("aas-user", user.first)
|
it.cookie("aas-user", user.first)
|
||||||
// Redirect to home page
|
// Redirect to home page
|
||||||
it.redirect("home.html")
|
if (user.first== GetAdminUserFromConfig()){
|
||||||
|
it.redirect("homeadmin.html")
|
||||||
|
} else {
|
||||||
|
it.redirect("homeviewer.html")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// home for admin user
|
||||||
|
path("homeadmin.html") {
|
||||||
|
before { CheckUsers(it) }
|
||||||
|
ws("/ws") { ws ->
|
||||||
|
// WebSocket endpoint for home
|
||||||
|
ws.onConnect {
|
||||||
|
it.enableAutomaticPings()
|
||||||
|
}
|
||||||
|
ws.onMessage { wsMessageContext ->
|
||||||
|
|
||||||
path("home.html") {
|
try {
|
||||||
|
val cmd =
|
||||||
|
objectmapper.readValue(wsMessageContext.message(), WebsocketCommand::class.java)
|
||||||
|
when (cmd.command) {
|
||||||
|
"getSystemTime" -> {
|
||||||
|
val systemtime = LocalDateTime.now().format(datetimeformat1)
|
||||||
|
val uptime = GetUptime()
|
||||||
|
SendReply(
|
||||||
|
wsMessageContext,
|
||||||
|
cmd.command,
|
||||||
|
if (uptime.isNotEmpty()) "Date & Time : $systemtime\nSystem Uptime : $uptime" else "Date & Time : $systemtime"
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
"getCPUStatus" -> {
|
||||||
|
Somecodes.getCPUUsage { vv ->
|
||||||
|
val sv = GetSensorsInfo()
|
||||||
|
if (sv.isNotEmpty()) {
|
||||||
|
SendReply(wsMessageContext, cmd.command, vv + "\n" + sv)
|
||||||
|
} else {
|
||||||
|
SendReply(wsMessageContext, cmd.command, vv)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
"getMemoryStatus" -> {
|
||||||
|
SendReply(wsMessageContext, cmd.command, Somecodes.getMemoryUsage())
|
||||||
|
}
|
||||||
|
|
||||||
|
"getDiskStatus" -> {
|
||||||
|
SendReply(wsMessageContext, cmd.command, Somecodes.getDiskUsage())
|
||||||
|
}
|
||||||
|
|
||||||
|
"getNetworkStatus" -> {
|
||||||
|
Somecodes.GetNetworkStatus { nn ->
|
||||||
|
SendReply(
|
||||||
|
wsMessageContext,
|
||||||
|
cmd.command,
|
||||||
|
objectmapper.writeValueAsString(nn)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
"getPagingQueue" -> {
|
||||||
|
SendReply(
|
||||||
|
wsMessageContext,
|
||||||
|
cmd.command,
|
||||||
|
objectmapper.writeValueAsString(db.queuepagingDB.List)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
"getAASQueue" -> {
|
||||||
|
SendReply(
|
||||||
|
wsMessageContext,
|
||||||
|
cmd.command,
|
||||||
|
objectmapper.writeValueAsString(db.queuetableDB.List)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
"getStreamerOutputs" -> {
|
||||||
|
val reply: List<StreamerOutputData> =
|
||||||
|
StreamerOutputs.map { so -> StreamerOutputData.fromBarixConnection(so.value) }
|
||||||
|
SendReply(wsMessageContext, cmd.command, objectmapper.writeValueAsString(reply))
|
||||||
|
}
|
||||||
|
|
||||||
|
else -> {
|
||||||
|
SendReply(wsMessageContext, cmd.command, "Unknown command")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (e: Exception) {
|
||||||
|
if (e.message != null && (e.message is String) && e.message!!.isNotEmpty()) {
|
||||||
|
Logger.error { "Error processing WebSocket message: ${e.message}" }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// home for viewer user
|
||||||
|
path("homeviewer.html") {
|
||||||
before { CheckUsers(it) }
|
before { CheckUsers(it) }
|
||||||
ws("/ws") { ws ->
|
ws("/ws") { ws ->
|
||||||
// WebSocket endpoint for home
|
// WebSocket endpoint for home
|
||||||
@@ -2137,6 +2229,35 @@ class WebApp(val listenPort: Int, val userlist: List<Pair<String, String>>, val
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
path("WebAccess"){
|
||||||
|
get {
|
||||||
|
val value = object {
|
||||||
|
val adminpass = _config.Get(configKeys.WEBAPP_ADMIN_PASSWORD.key)
|
||||||
|
val viewerpass = _config.Get(configKeys.WEBAPP_VIEWER_PASSWORD.key)
|
||||||
|
}
|
||||||
|
it.result(objectmapper.writeValueAsString(value))
|
||||||
|
}
|
||||||
|
post{
|
||||||
|
val json : JsonNode = objectmapper.readTree(it.body())
|
||||||
|
val adminpass = json.get("adminpass").asText("")
|
||||||
|
val viewerpass = json.get("viewerpass").asText("")
|
||||||
|
if(ValidString(adminpass) && ValidString(viewerpass)){
|
||||||
|
_config.Set(configKeys.WEBAPP_ADMIN_PASSWORD.key, adminpass)
|
||||||
|
_config.Set(configKeys.WEBAPP_VIEWER_PASSWORD.key, viewerpass)
|
||||||
|
_config.Save()
|
||||||
|
Logger.info { "Changed Web Access Passwords" }
|
||||||
|
// update userlist
|
||||||
|
userlist = listOf(
|
||||||
|
Pair(_config.Get(configKeys.WEBAPP_ADMIN_USERNAME.key), _config.Get(configKeys.WEBAPP_ADMIN_PASSWORD.key)),
|
||||||
|
Pair(_config.Get(configKeys.WEBAPP_VIEWER_USERNAME.key), _config.Get(configKeys.WEBAPP_VIEWER_PASSWORD.key))
|
||||||
|
)
|
||||||
|
it.result(objectmapper.writeValueAsString(resultMessage("OK")))
|
||||||
|
} else {
|
||||||
|
it.status(400)
|
||||||
|
.result(objectmapper.writeValueAsString(resultMessage("Password cannot be empty")))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user