|$folders
diff --git a/webui/src/main/kotlin/com/simiacryptus/skyenet/servlet/NewSessionServlet.kt b/webui/src/main/kotlin/com/simiacryptus/skyenet/servlet/NewSessionServlet.kt
index 022fec7f..19d86a56 100644
--- a/webui/src/main/kotlin/com/simiacryptus/skyenet/servlet/NewSessionServlet.kt
+++ b/webui/src/main/kotlin/com/simiacryptus/skyenet/servlet/NewSessionServlet.kt
@@ -10,6 +10,6 @@ class NewSessionServlet : HttpServlet() {
val sessionId = DataStorage.newGlobalID()
resp.contentType = "text/plain"
resp.status = HttpServletResponse.SC_OK
- resp.writer.write(sessionId)
+ resp.writer.write(sessionId.toString())
}
}
\ No newline at end of file
diff --git a/webui/src/main/kotlin/com/simiacryptus/skyenet/servlet/SessionListServlet.kt b/webui/src/main/kotlin/com/simiacryptus/skyenet/servlet/SessionListServlet.kt
index c7c9027f..da47032d 100644
--- a/webui/src/main/kotlin/com/simiacryptus/skyenet/servlet/SessionListServlet.kt
+++ b/webui/src/main/kotlin/com/simiacryptus/skyenet/servlet/SessionListServlet.kt
@@ -3,6 +3,7 @@ package com.simiacryptus.skyenet.servlet
import com.simiacryptus.skyenet.ApplicationBase.Companion.getCookie
import com.simiacryptus.skyenet.platform.ApplicationServices
import com.simiacryptus.skyenet.platform.DataStorage
+import com.simiacryptus.skyenet.platform.Session
import jakarta.servlet.http.HttpServlet
import jakarta.servlet.http.HttpServletRequest
import jakarta.servlet.http.HttpServletResponse
@@ -14,7 +15,7 @@ class SessionListServlet(
override fun doGet(req: HttpServletRequest, resp: HttpServletResponse) {
resp.contentType = "text/html"
resp.status = HttpServletResponse.SC_OK
- val sessions = dataStorage.listSessions(ApplicationServices.authenticationManager.getUser(req.getCookie())?.id)
+ val sessions = dataStorage.listSessions(ApplicationServices.authenticationManager.getUser(req.getCookie()))
resp.writer.write(
"""
@@ -49,7 +50,7 @@ class SessionListServlet(
)
}
- private fun sessionName(req: HttpServletRequest, session: String) = dataStorage.getSessionName(
- ApplicationServices.authenticationManager.getUser(req.getCookie())?.id, session
+ private fun sessionName(req: HttpServletRequest, session: Session) = dataStorage.getSessionName(
+ ApplicationServices.authenticationManager.getUser(req.getCookie()), session
)
}
\ No newline at end of file
diff --git a/webui/src/main/kotlin/com/simiacryptus/skyenet/servlet/SessionSettingsServlet.kt b/webui/src/main/kotlin/com/simiacryptus/skyenet/servlet/SessionSettingsServlet.kt
index 6020fb6d..daf1a631 100644
--- a/webui/src/main/kotlin/com/simiacryptus/skyenet/servlet/SessionSettingsServlet.kt
+++ b/webui/src/main/kotlin/com/simiacryptus/skyenet/servlet/SessionSettingsServlet.kt
@@ -3,6 +3,7 @@ package com.simiacryptus.skyenet.servlet
import com.simiacryptus.skyenet.ApplicationBase
import com.simiacryptus.skyenet.ApplicationBase.Companion.getCookie
import com.simiacryptus.skyenet.platform.ApplicationServices
+import com.simiacryptus.skyenet.platform.Session
import com.simiacryptus.util.JsonUtil
import jakarta.servlet.http.HttpServlet
import jakarta.servlet.http.HttpServletRequest
@@ -14,11 +15,11 @@ class SessionSettingsServlet(
override fun doGet(req: HttpServletRequest, resp: HttpServletResponse) {
resp.contentType = "text/html"
resp.status = HttpServletResponse.SC_OK
- val sessionId = req.getParameter("sessionId")
- if (null != sessionId) {
- val settings = server.getSettings
(sessionId, ApplicationServices.authenticationManager.getUser(
+ if (req.parameterMap.containsKey("sessionId")) {
+ val session = Session(req.getParameter("sessionId"))
+ val settings = server.getSettings(session, ApplicationServices.authenticationManager.getUser(
req.getCookie()
- )?.id)
+ ))
val json = if(settings != null) JsonUtil.toJson(settings) else ""
//language=HTML
resp.writer.write(
@@ -30,7 +31,7 @@ class SessionSettingsServlet(
|
|
|