From dc74e1573c9ee7d042fdc51d2e87590c4f34adb2 Mon Sep 17 00:00:00 2001 From: dev-claw <53543762+dev-claw@users.noreply.github.com> Date: Sat, 11 Oct 2025 16:22:48 +0100 Subject: [PATCH] bug fixes --- .../{package.yml => release-manual.yml} | 0 Dockerfile | 2 +- .../components/fragments/SessionFragment.kt | 2 -- .../vripper/gui/components/views/AppView.kt | 15 --------- .../gui/components/views/LoadingView.kt | 31 +++++++++---------- .../gui/components/views/LogTableView.kt | 2 ++ .../gui/components/views/PostsTabView.kt | 1 + .../gui/components/views/PostsTableView.kt | 2 ++ .../gui/components/views/StatusBarView.kt | 1 + .../gui/components/views/ThreadTableView.kt | 2 ++ 10 files changed, 23 insertions(+), 35 deletions(-) rename .github/workflows/{package.yml => release-manual.yml} (100%) diff --git a/.github/workflows/package.yml b/.github/workflows/release-manual.yml similarity index 100% rename from .github/workflows/package.yml rename to .github/workflows/release-manual.yml diff --git a/Dockerfile b/Dockerfile index 76873f8..fe5e2b3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM eclipse-temurin:25-jre +FROM azul/zulu-openjdk:25-latest WORKDIR /opt/vripper-web ENTRYPOINT ["java", "-jar", "vripper-web.jar"] ADD vripper-web.jar /opt/vripper-web/vripper-web.jar diff --git a/vripper-gui/src/main/kotlin/me/vripper/gui/components/fragments/SessionFragment.kt b/vripper-gui/src/main/kotlin/me/vripper/gui/components/fragments/SessionFragment.kt index 265e644..116ee0e 100644 --- a/vripper-gui/src/main/kotlin/me/vripper/gui/components/fragments/SessionFragment.kt +++ b/vripper-gui/src/main/kotlin/me/vripper/gui/components/fragments/SessionFragment.kt @@ -13,13 +13,11 @@ import me.vripper.gui.components.views.AppView import me.vripper.gui.components.views.LoadingView import me.vripper.gui.controller.WidgetsController import me.vripper.gui.event.GuiEventBus -import me.vripper.gui.services.GrpcEndpointService import tornadofx.* class SessionFragment : Fragment("Change Session") { private val widgetsController: WidgetsController by inject() - private val grpcEndpointService: GrpcEndpointService by di("remoteAppEndpointService") private val toggleGroup = ToggleGroup() override val root = VBox().apply { alignment = Pos.CENTER diff --git a/vripper-gui/src/main/kotlin/me/vripper/gui/components/views/AppView.kt b/vripper-gui/src/main/kotlin/me/vripper/gui/components/views/AppView.kt index dea03c1..45ff3d8 100644 --- a/vripper-gui/src/main/kotlin/me/vripper/gui/components/views/AppView.kt +++ b/vripper-gui/src/main/kotlin/me/vripper/gui/components/views/AppView.kt @@ -2,13 +2,10 @@ package me.vripper.gui.components.views import atlantafx.base.theme.* import javafx.application.Application.setUserAgentStylesheet -import kotlinx.coroutines.runBlocking import me.vripper.gui.controller.MainController import me.vripper.gui.controller.WidgetsController -import me.vripper.gui.event.GuiEventBus import tornadofx.View import tornadofx.onChange -import tornadofx.runLater import tornadofx.vbox class AppView : View() { @@ -63,17 +60,5 @@ class AppView : View() { else -> setUserAgentStylesheet(CupertinoLight().userAgentStylesheet) } } - - runLater { - if (widgetsController.currentSettings.localSession) { - runBlocking { - GuiEventBus.publishEvent(GuiEventBus.LocalSession) - } - } else { - runBlocking { - GuiEventBus.publishEvent(GuiEventBus.RemoteSession) - } - } - } } } \ No newline at end of file diff --git a/vripper-gui/src/main/kotlin/me/vripper/gui/components/views/LoadingView.kt b/vripper-gui/src/main/kotlin/me/vripper/gui/components/views/LoadingView.kt index 5577a45..97fd03e 100644 --- a/vripper-gui/src/main/kotlin/me/vripper/gui/components/views/LoadingView.kt +++ b/vripper-gui/src/main/kotlin/me/vripper/gui/components/views/LoadingView.kt @@ -6,11 +6,8 @@ import javafx.scene.effect.DropShadow import javafx.scene.input.KeyCode import javafx.scene.input.KeyCodeCombination import javafx.scene.input.KeyCombination -import kotlinx.coroutines.CoroutineScope -import kotlinx.coroutines.Dispatchers -import kotlinx.coroutines.SupervisorJob +import kotlinx.coroutines.* import kotlinx.coroutines.flow.filterIsInstance -import kotlinx.coroutines.launch import me.vripper.gui.VripperGuiApplication import me.vripper.gui.components.fragments.SessionFragment import me.vripper.gui.controller.WidgetsController @@ -42,19 +39,12 @@ class LoadingView : View("VRipper") { message.set("") AppManager.stop() grpcEndpointService.disconnect() - if (widgetsController.currentSettings.localSession) { - AppEndpointManager.set(GuiEventBus.LocalSession) - GuiEventBus.publishEvent(GuiEventBus.LocalSession) - AppManager.start() - } else { - AppEndpointManager.set(GuiEventBus.RemoteSession) - GuiEventBus.publishEvent(GuiEventBus.RemoteSession) + if (!widgetsController.currentSettings.localSession) { grpcEndpointService.connect( widgetsController.currentSettings.remoteSessionModel.host, widgetsController.currentSettings.remoteSessionModel.port, widgetsController.currentSettings.remoteSessionModel.passcode, ) - val check = grpcEndpointService.versionCheck() if (check == null) { message.set("Unable to connect to ${widgetsController.currentSettings.remoteSessionModel.host}:${widgetsController.currentSettings.remoteSessionModel.port}") @@ -67,7 +57,19 @@ class LoadingView : View("VRipper") { } runLater { replaceWith(find()) + val sessionType = if (widgetsController.currentSettings.localSession) { + AppManager.start() + GuiEventBus.LocalSession + } else { + GuiEventBus.RemoteSession + } + AppEndpointManager.set(sessionType) + runBlocking { + println("Publishing $sessionType") + GuiEventBus.publishEvent(sessionType) + } } + if (it.args.isNotEmpty()) { Watcher.notify(it.args[0]) } @@ -107,9 +109,4 @@ class LoadingView : View("VRipper") { effect = DropShadow() } } - -// override fun onUndock() { -// println("Undowking") -// coroutineScope.cancel() -// } } \ No newline at end of file diff --git a/vripper-gui/src/main/kotlin/me/vripper/gui/components/views/LogTableView.kt b/vripper-gui/src/main/kotlin/me/vripper/gui/components/views/LogTableView.kt index ae06d73..8c3ac3d 100644 --- a/vripper-gui/src/main/kotlin/me/vripper/gui/components/views/LogTableView.kt +++ b/vripper-gui/src/main/kotlin/me/vripper/gui/components/views/LogTableView.kt @@ -159,6 +159,7 @@ class LogTableView : View() { GuiEventBus.events.collect { when (it) { GuiEventBus.LocalSession, GuiEventBus.RemoteSession -> { + println("Collecting $it from LogTableView") while (isActive) { val result = runCatching { logController.getMaxEventLog() } if (result.isSuccess) { @@ -203,6 +204,7 @@ class LogTableView : View() { } } } + println("${this.javaClass.name} init") } private fun openLog(item: LogModel) { diff --git a/vripper-gui/src/main/kotlin/me/vripper/gui/components/views/PostsTabView.kt b/vripper-gui/src/main/kotlin/me/vripper/gui/components/views/PostsTabView.kt index 6c88bd5..2bcac5e 100644 --- a/vripper-gui/src/main/kotlin/me/vripper/gui/components/views/PostsTabView.kt +++ b/vripper-gui/src/main/kotlin/me/vripper/gui/components/views/PostsTabView.kt @@ -64,5 +64,6 @@ class PostsTabView : View() { delay(1_000) } } + println("${this.javaClass.name} init") } } \ No newline at end of file diff --git a/vripper-gui/src/main/kotlin/me/vripper/gui/components/views/PostsTableView.kt b/vripper-gui/src/main/kotlin/me/vripper/gui/components/views/PostsTableView.kt index 22668aa..2423765 100644 --- a/vripper-gui/src/main/kotlin/me/vripper/gui/components/views/PostsTableView.kt +++ b/vripper-gui/src/main/kotlin/me/vripper/gui/components/views/PostsTableView.kt @@ -411,6 +411,7 @@ class PostsTableView : View() { GuiEventBus.events.collect { when (it) { GuiEventBus.LocalSession, GuiEventBus.RemoteSession -> { + println("Collecting $it from PostsTableView") val postModelList = postController.findAllPosts().toList() val queueState = postController.getQueueState() runLater { @@ -485,6 +486,7 @@ class PostsTableView : View() { } } } + println("${this.javaClass.name} init") } private fun updateQueueState(queueState: QueueState) { diff --git a/vripper-gui/src/main/kotlin/me/vripper/gui/components/views/StatusBarView.kt b/vripper-gui/src/main/kotlin/me/vripper/gui/components/views/StatusBarView.kt index 5e10f6e..e3a0c4f 100644 --- a/vripper-gui/src/main/kotlin/me/vripper/gui/components/views/StatusBarView.kt +++ b/vripper-gui/src/main/kotlin/me/vripper/gui/components/views/StatusBarView.kt @@ -29,6 +29,7 @@ class StatusBarView : View("Status bar") { GuiEventBus.events.collect { when (it) { GuiEventBus.LocalSession, GuiEventBus.RemoteSession -> { + println("Collecting $it from StatusBarView") while (isActive) { val result = runCatching { statusBarController.loggedInUser() } if (result.isSuccess) { diff --git a/vripper-gui/src/main/kotlin/me/vripper/gui/components/views/ThreadTableView.kt b/vripper-gui/src/main/kotlin/me/vripper/gui/components/views/ThreadTableView.kt index 300d071..10c4e32 100644 --- a/vripper-gui/src/main/kotlin/me/vripper/gui/components/views/ThreadTableView.kt +++ b/vripper-gui/src/main/kotlin/me/vripper/gui/components/views/ThreadTableView.kt @@ -162,6 +162,7 @@ class ThreadTableView : View() { GuiEventBus.events.collect { when (it) { GuiEventBus.LocalSession, GuiEventBus.RemoteSession -> { + println("Collecting $it from ThreadTableView") val list = threadController.findAll().toList() runLater { items.clear() @@ -214,6 +215,7 @@ class ThreadTableView : View() { } } } + println("${this.javaClass.name} init") } private fun isCurrentTab(): Boolean = mainView.root.selectionModel.selectedItem.id == "thread-tab"