Merge branch 'master' of https://gitea.rdkartono.my.id/rdkartono/AAS_NewGeneration into feature-webapp
This commit is contained in:
@@ -50,9 +50,12 @@ function getCardByIndex(index) {
|
|||||||
*/
|
*/
|
||||||
function UpdateStreamerCard(values) {
|
function UpdateStreamerCard(values) {
|
||||||
if (!Array.isArray(values) || values.length === 0) return;
|
if (!Array.isArray(values) || values.length === 0) return;
|
||||||
function setProgress($bar, value, max = 100) {
|
|
||||||
|
function setProgress(index, $bar, value, max = 100) {
|
||||||
const v = Number(value ?? 0);
|
const v = Number(value ?? 0);
|
||||||
const pct = Math.max(0, Math.min(100, Math.round((v / max) * 100)));
|
const pct = Math.max(0, Math.min(100, Math.round((v / max) * 100)));
|
||||||
|
//if (index!==1) return; // only update index 1 for testing
|
||||||
|
//console.log(`setProgress: index=${index}, value=${v}, pct=${pct}`);
|
||||||
$bar
|
$bar
|
||||||
.attr('aria-valuenow', v) // semantic value
|
.attr('aria-valuenow', v) // semantic value
|
||||||
.css('width', pct + '%') // visual width
|
.css('width', pct + '%') // visual width
|
||||||
@@ -68,7 +71,7 @@ function UpdateStreamerCard(values) {
|
|||||||
if (card.buffer) card.buffer.text(`Buffer: ${vv.bufferRemain !== undefined && vv.bufferRemain !== null ? vv.bufferRemain.toString() : 'N/A'}`);
|
if (card.buffer) card.buffer.text(`Buffer: ${vv.bufferRemain !== undefined && vv.bufferRemain !== null ? vv.bufferRemain.toString() : 'N/A'}`);
|
||||||
if (card.status) card.status.text(`Status: ${vv.isPlaying ? 'Playing' : 'Stopped'}`);
|
if (card.status) card.status.text(`Status: ${vv.isPlaying ? 'Playing' : 'Stopped'}`);
|
||||||
if (card.vu) {
|
if (card.vu) {
|
||||||
setProgress(card.vu, vv.vu, 100);
|
setProgress(i, card.vu, vv.vu, 100);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// no value for this index, disable the card
|
// no value for this index, disable the card
|
||||||
@@ -77,7 +80,7 @@ function UpdateStreamerCard(values) {
|
|||||||
if (card.buffer) card.buffer.text(`Buffer: N/A`);
|
if (card.buffer) card.buffer.text(`Buffer: N/A`);
|
||||||
if (card.status) card.status.text(`Status: Disconnected`);
|
if (card.status) card.status.text(`Status: Disconnected`);
|
||||||
if (card.vu) {
|
if (card.vu) {
|
||||||
setProgress(card.vu, 0, 100);
|
setProgress(i, card.vu, 0, 100);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -124,10 +127,13 @@ function fill_pagingqueuetablebody(vv) {
|
|||||||
if (!Array.isArray(vv) || vv.length === 0) return;
|
if (!Array.isArray(vv) || vv.length === 0) return;
|
||||||
vv.forEach(item => {
|
vv.forEach(item => {
|
||||||
// fill index and description columns using item properties
|
// fill index and description columns using item properties
|
||||||
let description = `${item.Date_Time}_${item.Source}_${item.Type}_${item.Message}_${item.BroadcastZones}`;
|
|
||||||
$('#pagingqueuetable').append(`<tr>
|
$('#pagingqueuetable').append(`<tr>
|
||||||
<td>${item.index}</td>
|
<td>${item.index}</td>
|
||||||
<td>${description}</td>
|
<td>${item.date_Time}</td>
|
||||||
|
<td>${item.source}</td>
|
||||||
|
<td>${item.type}</td>
|
||||||
|
<td>${item.message}</td>
|
||||||
|
<td>${item.broadcastZones}</td>
|
||||||
</tr>`);
|
</tr>`);
|
||||||
let $addedrow = $('#pagingqueuetable tr:last');
|
let $addedrow = $('#pagingqueuetable tr:last');
|
||||||
$addedrow.off('click').on('click', function () {
|
$addedrow.off('click').on('click', function () {
|
||||||
@@ -156,10 +162,14 @@ function fill_automaticqueuetablebody(vv) {
|
|||||||
if (!Array.isArray(vv) || vv.length === 0) return;
|
if (!Array.isArray(vv) || vv.length === 0) return;
|
||||||
vv.forEach(item => {
|
vv.forEach(item => {
|
||||||
// fill index and description columns using item properties
|
// fill index and description columns using item properties
|
||||||
let description = `${item.Date_Time}_${item.Source}_${item.Type}_${item.Message}_${item.BroadcastZones}`;
|
//console.log("fill_automaticqueuetablebody: item", item);
|
||||||
$('#automaticqueuetable').append(`<tr>
|
$('#automaticqueuetable').append(`<tr>
|
||||||
<td>${item.index}</td>
|
<td>${item.index}</td>
|
||||||
<td>${description}</td>
|
<td>${item.date_Time}</td>
|
||||||
|
<td>${item.source}</td>
|
||||||
|
<td>${item.type}</td>
|
||||||
|
<td>${item.message}</td>
|
||||||
|
<td>${item.broadcastZones}</td>
|
||||||
</tr>`);
|
</tr>`);
|
||||||
let $addedrow = $('#automaticqueuetable tr:last');
|
let $addedrow = $('#automaticqueuetable tr:last');
|
||||||
$addedrow.off('click').on('click', function () {
|
$addedrow.off('click').on('click', function () {
|
||||||
@@ -277,14 +287,18 @@ $(document).ready(function () {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
let intervaljob = null;
|
let intervaljob1 = null;
|
||||||
|
let intervaljob2 = null;
|
||||||
function runIntervalJob() {
|
function runIntervalJob() {
|
||||||
if (intervaljob) clearInterval(intervaljob);
|
if (intervaljob1) clearInterval(intervaljob1);
|
||||||
intervaljob = setInterval(() => {
|
intervaljob1 = setInterval(() => {
|
||||||
|
sendCommand("getStreamerOutputs", "");
|
||||||
|
}, 100);
|
||||||
|
if (intervaljob2) clearInterval(intervaljob2);
|
||||||
|
intervaljob2 = setInterval(() => {
|
||||||
sendCommand("getPagingQueue", "");
|
sendCommand("getPagingQueue", "");
|
||||||
sendCommand("getAASQueue", "");
|
sendCommand("getAASQueue", "");
|
||||||
sendCommand("getStreamerOutputs", "");
|
}, 2000);
|
||||||
}, 1000);
|
|
||||||
console.log("overview.js interval job started");
|
console.log("overview.js interval job started");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -309,22 +323,20 @@ $(document).ready(function () {
|
|||||||
case "getPagingQueue":
|
case "getPagingQueue":
|
||||||
let pq = JSON.parse(data);
|
let pq = JSON.parse(data);
|
||||||
//console.log("getPagingQueue:", pq);
|
//console.log("getPagingQueue:", pq);
|
||||||
|
window.PagingQueue = [];
|
||||||
if (Array.isArray(pq) && pq.length > 0) {
|
if (Array.isArray(pq) && pq.length > 0) {
|
||||||
window.PagingQueue = [];
|
|
||||||
window.PagingQueue.push(...pq);
|
window.PagingQueue.push(...pq);
|
||||||
console.log(`PagingQueue length: ${window.PagingQueue.length}`);
|
|
||||||
fill_pagingqueuetablebody(window.PagingQueue);
|
|
||||||
}
|
}
|
||||||
|
fill_pagingqueuetablebody(window.PagingQueue);
|
||||||
break;
|
break;
|
||||||
case "getAASQueue":
|
case "getAASQueue":
|
||||||
let aq = JSON.parse(data);
|
let aq = JSON.parse(data);
|
||||||
//console.log("getAASQueue:", aq);
|
//console.log("getAASQueue:", aq);
|
||||||
|
window.QueueTable = [];
|
||||||
if (Array.isArray(aq) && aq.length > 0) {
|
if (Array.isArray(aq) && aq.length > 0) {
|
||||||
window.QueueTable = [];
|
|
||||||
window.QueueTable.push(...aq);
|
window.QueueTable.push(...aq);
|
||||||
console.log(`QueueTable length: ${window.QueueTable.length}`);
|
|
||||||
fill_automaticqueuetablebody(window.QueueTable);
|
|
||||||
}
|
}
|
||||||
|
fill_automaticqueuetablebody(window.QueueTable);
|
||||||
break;
|
break;
|
||||||
case "getStreamerOutputs":
|
case "getStreamerOutputs":
|
||||||
/**
|
/**
|
||||||
@@ -337,13 +349,11 @@ $(document).ready(function () {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$(window).on('beforeunload', function () {
|
$(window).on('beforeunload', function () {
|
||||||
console.log("overview.js beforeunload event triggered");
|
console.log("overview.js beforeunload event triggered");
|
||||||
clearInterval(intervaljob);
|
clearInterval(intervaljob1);
|
||||||
intervaljob = null;
|
clearInterval(intervaljob2);
|
||||||
|
intervaljob1 = null;
|
||||||
|
intervaljob2 = null;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -19,8 +19,8 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="accordion" role="tablist" id="accordion-1">
|
<div class="accordion" role="tablist" id="accordion-1">
|
||||||
<div class="accordion-item pad-accordion">
|
<div class="accordion-item pad-accordion">
|
||||||
<h2 class="accordion-header" role="tab"><button class="accordion-button bg-heading1" type="button" data-bs-toggle="collapse" data-bs-target="#accordion-1 .item-1" aria-expanded="true" aria-controls="accordion-1 .item-1">Channel Status</button></h2>
|
<h2 class="accordion-header" role="tab"><button class="accordion-button collapsed bg-heading1" type="button" data-bs-toggle="collapse" data-bs-target="#accordion-1 .item-1" aria-expanded="false" aria-controls="accordion-1 .item-1">Channel Status</button></h2>
|
||||||
<div class="accordion-collapse collapse show item-1 bg-accordion" role="tabpanel" data-bs-parent="#accordion-1">
|
<div class="accordion-collapse collapse item-1 bg-accordion" role="tabpanel" data-bs-parent="#accordion-1">
|
||||||
<div class="accordion-body">
|
<div class="accordion-body">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-12 col-sm-6 col-md-3 col-lg-3 col-xl-3 pad-card">
|
<div class="col-12 col-sm-6 col-md-3 col-lg-3 col-xl-3 pad-card">
|
||||||
@@ -1263,7 +1263,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<p class="card-text" id="streamerstatus64">Status : Idle</p>
|
<p class="card-text" id="streamerstatus64">Status : Idle</p>
|
||||||
<div class="progress" id="streamervu-63">
|
<div class="progress" id="streamervu64">
|
||||||
<div class="progress-bar" aria-valuenow="50" aria-valuemin="0" aria-valuemax="100" style="width: 50%;">50%</div>
|
<div class="progress-bar" aria-valuenow="50" aria-valuemin="0" aria-valuemax="100" style="width: 50%;">50%</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -1274,16 +1274,20 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="accordion-item pad-accordion pad-2">
|
<div class="accordion-item pad-accordion pad-2">
|
||||||
<h2 class="accordion-header" role="tab"><button class="accordion-button collapsed bg-heading2" type="button" data-bs-toggle="collapse" data-bs-target="#accordion-1 .item-2" aria-expanded="false" aria-controls="accordion-1 .item-2">Paging Queue</button></h2>
|
<h2 class="accordion-header" role="tab"><button class="accordion-button bg-heading2" type="button" data-bs-toggle="collapse" data-bs-target="#accordion-1 .item-2" aria-expanded="true" aria-controls="accordion-1 .item-2">Paging Queue</button></h2>
|
||||||
<div class="accordion-collapse collapse item-2 pad-2" role="tabpanel" data-bs-parent="#accordion-1">
|
<div class="accordion-collapse collapse show item-2 pad-2" role="tabpanel" data-bs-parent="#accordion-1">
|
||||||
<div class="accordion-body">
|
<div class="accordion-body">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="table-responsive">
|
<div class="table-responsive">
|
||||||
<table class="table">
|
<table class="table">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Index</th>
|
<th class="col-sm-1">Index</th>
|
||||||
<th>Description</th>
|
<th class="col-sm-2">Date Time</th>
|
||||||
|
<th class="col-sm-1">Source</th>
|
||||||
|
<th class="col-sm-1">Type</th>
|
||||||
|
<th class="col-sm-3">Message</th>
|
||||||
|
<th class="col-sm-4">Broadcast Zones</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody id="pagingqueuetable"></tbody>
|
<tbody id="pagingqueuetable"></tbody>
|
||||||
@@ -1306,8 +1310,12 @@
|
|||||||
<table class="table">
|
<table class="table">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Index</th>
|
<th class="col-sm-1">Index</th>
|
||||||
<th>Description</th>
|
<th class="col-sm-2">Date Time</th>
|
||||||
|
<th class="col-sm-1">Source</th>
|
||||||
|
<th class="col-sm-1">Type</th>
|
||||||
|
<th class="col-sm-3">Message</th>
|
||||||
|
<th class="col-sm-4">Broadcast Zones</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody id="automaticqueuetable"></tbody>
|
<tbody id="automaticqueuetable"></tbody>
|
||||||
|
|||||||
@@ -31,7 +31,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.7 (15/10/2025)"
|
const val version = "0.0.8 (16/10/2025)"
|
||||||
// AAS 64 channels
|
// AAS 64 channels
|
||||||
const val max_channel = 64
|
const val max_channel = 64
|
||||||
|
|
||||||
@@ -167,7 +167,6 @@ fun main() {
|
|||||||
|
|
||||||
val barixserver = TCP_Barix_Command_Server()
|
val barixserver = TCP_Barix_Command_Server()
|
||||||
barixserver.StartTcpServer { cmd ->
|
barixserver.StartTcpServer { cmd ->
|
||||||
//Logger.info { cmd }
|
|
||||||
val _tcp = barixserver.getSocket(cmd.ipaddress)
|
val _tcp = barixserver.getSocket(cmd.ipaddress)
|
||||||
val _streamer = StreamerOutputs[cmd.ipaddress]
|
val _streamer = StreamerOutputs[cmd.ipaddress]
|
||||||
val _sc = db.soundchannelDB.List.find { it.ip == cmd.ipaddress }
|
val _sc = db.soundchannelDB.List.find { it.ip == cmd.ipaddress }
|
||||||
@@ -177,7 +176,8 @@ fun main() {
|
|||||||
if (_sc != null) {
|
if (_sc != null) {
|
||||||
|
|
||||||
val _bc = BarixConnection(_sc.index, _sc.channel, cmd.ipaddress)
|
val _bc = BarixConnection(_sc.index, _sc.channel, cmd.ipaddress)
|
||||||
_bc.vu = cmd.vu
|
// cmd.vu 0 - 32767, kita convert ke 0 - 100
|
||||||
|
_bc.vu = ((1.0 * cmd.vu / 32767.0)* 100.0).toInt()
|
||||||
_bc.bufferRemain = cmd.buffremain
|
_bc.bufferRemain = cmd.buffremain
|
||||||
_bc.statusData = cmd.statusdata
|
_bc.statusData = cmd.statusdata
|
||||||
_bc.commandsocket = _tcp
|
_bc.commandsocket = _tcp
|
||||||
@@ -191,7 +191,8 @@ fun main() {
|
|||||||
if (_sc != null && _sc.channel != _streamer.channel) {
|
if (_sc != null && _sc.channel != _streamer.channel) {
|
||||||
_streamer.channel = _sc.channel
|
_streamer.channel = _sc.channel
|
||||||
}
|
}
|
||||||
_streamer.vu = cmd.vu
|
// cmd.vu 0 - 32767, kita convert ke 0 - 100
|
||||||
|
_streamer.vu = ((1.0 * cmd.vu / 32767.0)* 100.0).toInt()
|
||||||
_streamer.bufferRemain = cmd.buffremain
|
_streamer.bufferRemain = cmd.buffremain
|
||||||
_streamer.statusData = cmd.statusdata
|
_streamer.statusData = cmd.statusdata
|
||||||
|
|
||||||
|
|||||||
@@ -561,7 +561,7 @@ class MainExtension01 {
|
|||||||
.filter { it.Type=="PAGING" }
|
.filter { it.Type=="PAGING" }
|
||||||
|
|
||||||
list.forEach { qp ->
|
list.forEach { qp ->
|
||||||
println("Processing $qp")
|
//println("Processing $qp")
|
||||||
if (qp.BroadcastZones.isNotBlank()){
|
if (qp.BroadcastZones.isNotBlank()){
|
||||||
if (ValidFile(qp.Message)){
|
if (ValidFile(qp.Message)){
|
||||||
val zz = qp.BroadcastZones.split(";")
|
val zz = qp.BroadcastZones.split(";")
|
||||||
@@ -883,7 +883,7 @@ class MainExtension01 {
|
|||||||
db.queuetableDB.Get()
|
db.queuetableDB.Get()
|
||||||
val list = db.queuetableDB.List.filter { it.Type=="SOUNDBANK" }
|
val list = db.queuetableDB.List.filter { it.Type=="SOUNDBANK" }
|
||||||
list.forEach { qa ->
|
list.forEach { qa ->
|
||||||
println("Processing $qa")
|
//println("Processing $qa")
|
||||||
if (qa.BroadcastZones.isNotEmpty()){
|
if (qa.BroadcastZones.isNotEmpty()){
|
||||||
val zz = qa.BroadcastZones.split(";")
|
val zz = qa.BroadcastZones.split(";")
|
||||||
if (AllBroadcastZonesValid(zz)){
|
if (AllBroadcastZonesValid(zz)){
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ class TCP_Android_Command_Server {
|
|||||||
din.read(bb)
|
din.read(bb)
|
||||||
// B4A format, 4 bytes di depan adalah size
|
// B4A format, 4 bytes di depan adalah size
|
||||||
val str = String(bb, 4, bb.size - 4)
|
val str = String(bb, 4, bb.size - 4)
|
||||||
println("Received command from $key : $str")
|
//println("Received command from $key : $str")
|
||||||
str.split("@").map { it.trim() }.filter { ValidString(it) }
|
str.split("@").map { it.trim() }.filter { ValidString(it) }
|
||||||
.forEach {
|
.forEach {
|
||||||
process_command(key,it) { reply ->
|
process_command(key,it) { reply ->
|
||||||
@@ -308,7 +308,7 @@ class TCP_Android_Command_Server {
|
|||||||
if (userlogin != null){
|
if (userlogin != null){
|
||||||
val userdb = db.userDB.List.find { it.username == username }
|
val userdb = db.userDB.List.find { it.username == username }
|
||||||
if (userdb != null){
|
if (userdb != null){
|
||||||
println("Sending initialization data to $key with username $username")
|
//println("Sending initialization data to $key with username $username")
|
||||||
val result = StringBuilder()
|
val result = StringBuilder()
|
||||||
// kirim Zone
|
// kirim Zone
|
||||||
result.append("ZONE")
|
result.append("ZONE")
|
||||||
|
|||||||
@@ -1411,9 +1411,9 @@ class MariaDB(
|
|||||||
// use a temporary table to reorder the index
|
// use a temporary table to reorder the index
|
||||||
statement?.executeUpdate("CREATE TABLE IF NOT EXISTS $tempdb_name LIKE ${super.dbName}")
|
statement?.executeUpdate("CREATE TABLE IF NOT EXISTS $tempdb_name LIKE ${super.dbName}")
|
||||||
statement?.executeUpdate("TRUNCATE TABLE $tempdb_name")
|
statement?.executeUpdate("TRUNCATE TABLE $tempdb_name")
|
||||||
statement?.executeUpdate("INSERT INTO $tempdb_name (Date_Time, Source, Type, Message, SB_TAGS) SELECT Date_Time, Source, Type, Message, SB_TAGS FROM ${super.dbName} ORDER BY `index` ")
|
statement?.executeUpdate("INSERT INTO $tempdb_name (Date_Time, Source, Type, Message, BroadcastZones) SELECT Date_Time, Source, Type, Message, BroadcastZones FROM ${super.dbName} ")
|
||||||
statement?.executeUpdate("TRUNCATE TABLE ${super.dbName}")
|
statement?.executeUpdate("TRUNCATE TABLE ${super.dbName}")
|
||||||
statement?.executeUpdate("INSERT INTO ${super.dbName} (Date_Time, Source, Type, Message, SB_TAGS) SELECT Date_Time, Source, Type, Message, SB_TAGS FROM $tempdb_name")
|
statement?.executeUpdate("INSERT INTO ${super.dbName} (Date_Time, Source, Type, Message, BroadcastZones) SELECT Date_Time, Source, Type, Message, BroadcastZones FROM $tempdb_name")
|
||||||
statement?.executeUpdate("DROP TABLE $tempdb_name")
|
statement?.executeUpdate("DROP TABLE $tempdb_name")
|
||||||
Logger.info("${super.dbName} table resorted by index" as Any)
|
Logger.info("${super.dbName} table resorted by index" as Any)
|
||||||
// reload the local list
|
// reload the local list
|
||||||
@@ -1436,7 +1436,7 @@ class MariaDB(
|
|||||||
val workbook = XSSFWorkbook()
|
val workbook = XSSFWorkbook()
|
||||||
val sheet = workbook.createSheet("QueuePaging")
|
val sheet = workbook.createSheet("QueuePaging")
|
||||||
val headerRow = sheet.createRow(0)
|
val headerRow = sheet.createRow(0)
|
||||||
val headers = arrayOf("Index", "Date_Time", "Source", "Type", "Message", "SB_TAGS")
|
val headers = arrayOf("Index", "Date_Time", "Source", "Type", "Message", "BroadcastZones")
|
||||||
for ((colIndex, header) in headers.withIndex()) {
|
for ((colIndex, header) in headers.withIndex()) {
|
||||||
val cell = headerRow.createCell(colIndex)
|
val cell = headerRow.createCell(colIndex)
|
||||||
cell.setCellValue(header)
|
cell.setCellValue(header)
|
||||||
@@ -1449,7 +1449,7 @@ class MariaDB(
|
|||||||
row.createCell(2).setCellValue(resultSet.getString("Source"))
|
row.createCell(2).setCellValue(resultSet.getString("Source"))
|
||||||
row.createCell(3).setCellValue(resultSet.getString("Type"))
|
row.createCell(3).setCellValue(resultSet.getString("Type"))
|
||||||
row.createCell(4).setCellValue(resultSet.getString("Message"))
|
row.createCell(4).setCellValue(resultSet.getString("Message"))
|
||||||
row.createCell(5).setCellValue(resultSet.getString("SB_TAGS"))
|
row.createCell(5).setCellValue(resultSet.getString("BroadcastZones"))
|
||||||
}
|
}
|
||||||
for (i in headers.indices) {
|
for (i in headers.indices) {
|
||||||
sheet.autoSizeColumn(i)
|
sheet.autoSizeColumn(i)
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ class WebApp(val listenPort: Int, val userlist: List<Pair<String, String>>) {
|
|||||||
}
|
}
|
||||||
// Set user session
|
// Set user session
|
||||||
it.sessionAttribute("user", user.first)
|
it.sessionAttribute("user", user.first)
|
||||||
println("User ${user.first} logged in")
|
//println("User ${user.first} logged in")
|
||||||
// Redirect to home page
|
// Redirect to home page
|
||||||
it.redirect("home.html")
|
it.redirect("home.html")
|
||||||
}
|
}
|
||||||
@@ -98,10 +98,7 @@ class WebApp(val listenPort: Int, val userlist: List<Pair<String, String>>) {
|
|||||||
before { CheckUsers(it) }
|
before { CheckUsers(it) }
|
||||||
ws("/ws") { ws ->
|
ws("/ws") { ws ->
|
||||||
// WebSocket endpoint for home
|
// WebSocket endpoint for home
|
||||||
ws.onClose { wsCloseContext ->
|
//
|
||||||
// TODO Handle WebSocket close event
|
|
||||||
println("WebSocket closed: ${wsCloseContext.session.remoteAddress}")
|
|
||||||
}
|
|
||||||
ws.onMessage { wsMessageContext ->
|
ws.onMessage { wsMessageContext ->
|
||||||
try {
|
try {
|
||||||
val cmd =
|
val cmd =
|
||||||
@@ -157,10 +154,9 @@ class WebApp(val listenPort: Int, val userlist: List<Pair<String, String>>) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
ws.onConnect { wsConnectContext ->
|
// ws.onConnect { wsConnectContext ->
|
||||||
// TODO Handle WebSocket connect event
|
// println("WebSocket connected: ${wsConnectContext.session.remoteAddress}")
|
||||||
println("WebSocket connected: ${wsConnectContext.session.remoteAddress}")
|
// }
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user