mirror of
https://github.com/dev-claw/vripper-project.git
synced 2026-08-19 08:35:41 +02:00
bug fixes
This commit is contained in:
+1
-1
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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<AppView>())
|
||||
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()
|
||||
// }
|
||||
}
|
||||
@@ -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) {
|
||||
|
||||
@@ -64,5 +64,6 @@ class PostsTabView : View() {
|
||||
delay(1_000)
|
||||
}
|
||||
}
|
||||
println("${this.javaClass.name} init")
|
||||
}
|
||||
}
|
||||
@@ -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) {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user