v. 1.2.0
Upgrade knob interaction logic and dependency versions. Reworked knob value adjustment to use precise mouse coordinates via `setValueByMouseCoords`. Improved user interaction by enhancing activation handling and CSS styling. Updated project dependencies, removed unused packages, and set version to 1.2.0 for compatibility and feature stability.
This commit is contained in:
@@ -7,7 +7,7 @@ import io.undertow.server.handlers.PathHandler
|
||||
import io.undertow.server.handlers.resource.PathResourceManager
|
||||
import io.undertow.server.handlers.resource.ResourceHandler
|
||||
import io.undertow.server.session.Session
|
||||
import io.undertow.server.session.SessionConfig
|
||||
import io.undertow.server.session.SessionCookieConfig
|
||||
import io.undertow.server.session.SessionManager
|
||||
import io.undertow.util.Headers
|
||||
import io.undertow.websockets.WebSocketConnectionCallback
|
||||
@@ -22,6 +22,14 @@ import nl.astraeus.vst.base.db.PatchDao
|
||||
import nl.astraeus.vst.base.db.PatchEntity
|
||||
import java.nio.file.Paths
|
||||
|
||||
object VstSessionConfig {
|
||||
val config = SessionCookieConfig()
|
||||
|
||||
init {
|
||||
config.setCookieName("VstCookie")
|
||||
}
|
||||
}
|
||||
|
||||
class WebsocketHandler(
|
||||
val session: Session?
|
||||
) : AbstractReceiveListener(), WebSocketConnectionCallback {
|
||||
@@ -81,9 +89,8 @@ class WebsocketHandler(
|
||||
object WebsocketConnectHandler : HttpHandler {
|
||||
override fun handleRequest(exchange: HttpServerExchange) {
|
||||
val sessionManager = exchange.getAttachment(SessionManager.ATTACHMENT_KEY)
|
||||
val sessionConfig = exchange.getAttachment(SessionConfig.ATTACHMENT_KEY)
|
||||
|
||||
val httpSession: Session? = sessionManager.getSession(exchange, sessionConfig)
|
||||
val httpSession: Session? = sessionManager.getSession(exchange, VstSessionConfig.config)
|
||||
|
||||
websocket(WebsocketHandler(httpSession)).handleRequest(exchange)
|
||||
}
|
||||
@@ -98,11 +105,10 @@ class PatchHandler(
|
||||
if (exchange.requestPath.startsWith("/patch/")) {
|
||||
val patchId = exchange.requestPath.substring(7)
|
||||
val sessionManager = exchange.getAttachment(SessionManager.ATTACHMENT_KEY)
|
||||
val sessionConfig = exchange.getAttachment(SessionConfig.ATTACHMENT_KEY)
|
||||
var httpSession: Session? = sessionManager.getSession(exchange, sessionConfig)
|
||||
var httpSession: Session? = sessionManager.getSession(exchange, VstSessionConfig.config)
|
||||
|
||||
if (httpSession == null) {
|
||||
httpSession = sessionManager.createSession(exchange, sessionConfig)
|
||||
httpSession = sessionManager.createSession(exchange, VstSessionConfig.config)
|
||||
}
|
||||
httpSession?.setAttribute("html-session", VstSession(patchId))
|
||||
|
||||
|
||||
@@ -32,4 +32,4 @@ object UndertowServer {
|
||||
server?.start()
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user