Small tidy-up.

This commit is contained in:
Chris Rankin 2017-01-30 14:17:58 +00:00
parent 02323e8207
commit 10061107df
2 changed files with 4 additions and 3 deletions

View File

@ -5,6 +5,7 @@ import org.h2.tools.Server
import org.h2.util.JdbcUtils
import org.slf4j.LoggerFactory
import java.util.concurrent.Executors
import kotlin.reflect.jvm.jvmName
class DBViewer : AutoCloseable {
@ -22,14 +23,14 @@ class DBViewer : AutoCloseable {
fun openBrowser(h2Port: Int) {
val conn = JdbcUtils.getConnection(
"org.h2.Driver",
org.h2.Driver::class.jvmName,
"jdbc:h2:tcp://localhost:%d/node".format(h2Port),
"sa",
""
)
val url = (webServer.service as LocalWebServer).addSession(conn)
log.info("URL: {}", url)
log.info("Session: {}", url)
pool.execute {
Server.openBrowser(url)

View File

@ -32,7 +32,7 @@ class NodeTerminalView : Fragment() {
private val viewDatabaseButton by fxid<Button>()
private val launchExplorerButton by fxid<Button>()
var viewer : DBViewer = DBViewer()
var viewer = DBViewer()
var pty : R3Pty? = null
fun open(config: NodeConfig) {