commit 17/10/2025
TODO lanjutin menu Timer Modal
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user