commit 17/10/2025

TODO lanjutin menu Timer Modal
This commit is contained in:
2025-10-17 15:59:32 +07:00
parent bc3f5c5691
commit 2dfc095f04
19 changed files with 754 additions and 203 deletions

View File

@@ -2,6 +2,8 @@ package web
import StreamerOutputs
import codes.Somecodes
import codes.Somecodes.Companion.GetSensorsInfo
import codes.Somecodes.Companion.GetUptime
import codes.Somecodes.Companion.ListAudioFiles
import codes.Somecodes.Companion.ValiDateForLogHtml
import codes.Somecodes.Companion.ValidFile
@@ -104,16 +106,23 @@ class WebApp(val listenPort: Int, val userlist: List<Pair<String, String>>) {
objectmapper.readValue(wsMessageContext.message(), WebsocketCommand::class.java)
when (cmd.command) {
"getSystemTime" -> {
val systemtime = LocalDateTime.now().format(Somecodes.datetimeformat1)
val uptime = GetUptime()
SendReply(
wsMessageContext,
cmd.command,
LocalDateTime.now().format(Somecodes.datetimeformat1)
if (uptime.isNotEmpty()) "Date & Time : $systemtime\nSystem Uptime : $uptime" else "Date & Time : $systemtime"
)
}
"getCPUStatus" -> {
Somecodes.getCPUUsage { vv ->
SendReply(wsMessageContext, cmd.command, vv)
val sv = GetSensorsInfo()
if (sv.isNotEmpty()){
SendReply(wsMessageContext, cmd.command, vv+"\n"+sv)
} else {
SendReply(wsMessageContext, cmd.command, vv)
}
}
}