From 554520b2858786656b24fb9926672b2b67408dd9 Mon Sep 17 00:00:00 2001 From: Graham Date: Sun, 14 Feb 2021 10:50:58 +0000 Subject: [PATCH] Add initial Bootstrap style Signed-off-by: Graham --- archive/build.gradle.kts | 2 + .../org/openrs2/archive/web/WebServer.kt | 3 + .../archive/templates/caches/index.html | 66 ++++++++++--------- buildSrc/src/main/kotlin/Versions.kt | 1 + 4 files changed, 42 insertions(+), 30 deletions(-) diff --git a/archive/build.gradle.kts b/archive/build.gradle.kts index 3229fb68..960a7c07 100644 --- a/archive/build.gradle.kts +++ b/archive/build.gradle.kts @@ -24,11 +24,13 @@ dependencies { implementation("io.ktor:ktor-jackson:${Versions.ktor}") implementation("io.ktor:ktor-server-netty:${Versions.ktor}") implementation("io.ktor:ktor-thymeleaf:${Versions.ktor}") + implementation("io.ktor:ktor-webjars:${Versions.ktor}") implementation("org.flywaydb:flyway-core:${Versions.flyway}") implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:${Versions.kotlinCoroutines}") implementation("org.postgresql:postgresql:${Versions.postgres}") implementation("org.thymeleaf:thymeleaf:${Versions.thymeleaf}") implementation("org.thymeleaf.extras:thymeleaf-extras-java8time:${Versions.thymeleafJava8Time}") + implementation("org.webjars:bootstrap:${Versions.bootstrap}") } publishing { diff --git a/archive/src/main/kotlin/org/openrs2/archive/web/WebServer.kt b/archive/src/main/kotlin/org/openrs2/archive/web/WebServer.kt index 4504b920..33321d80 100644 --- a/archive/src/main/kotlin/org/openrs2/archive/web/WebServer.kt +++ b/archive/src/main/kotlin/org/openrs2/archive/web/WebServer.kt @@ -11,6 +11,7 @@ import io.ktor.routing.routing import io.ktor.server.engine.embeddedServer import io.ktor.server.netty.Netty import io.ktor.thymeleaf.Thymeleaf +import io.ktor.webjars.Webjars import org.openrs2.json.Json import org.thymeleaf.extras.java8time.dialect.Java8TimeDialect import org.thymeleaf.templatemode.TemplateMode @@ -38,6 +39,8 @@ public class WebServer @Inject constructor( }) } + install(Webjars) + routing { get("/caches") { cachesController.index(call) } get("/caches/{id}.zip") { cachesController.export(call) } diff --git a/archive/src/main/resources/org/openrs2/archive/templates/caches/index.html b/archive/src/main/resources/org/openrs2/archive/templates/caches/index.html index 2cbdcaaf..e68c9184 100644 --- a/archive/src/main/resources/org/openrs2/archive/templates/caches/index.html +++ b/archive/src/main/resources/org/openrs2/archive/templates/caches/index.html @@ -1,35 +1,41 @@ + + OpenRS2 Archive + + - - - - - - - - - - - - - - - - - - - - - - - - - - -
GameBuildTimestampNameIndexesGroupsKeysDownload
runescape550Calculating...Calculating...Calculating... - Cache - Keys -
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
GameBuildTimestampNameIndexesGroupsKeysDownload
runescape550Calculating...Calculating...Calculating... + Cache + Keys +
+
diff --git a/buildSrc/src/main/kotlin/Versions.kt b/buildSrc/src/main/kotlin/Versions.kt index c4438b61..a2547843 100644 --- a/buildSrc/src/main/kotlin/Versions.kt +++ b/buildSrc/src/main/kotlin/Versions.kt @@ -1,5 +1,6 @@ object Versions { const val asm = "9.1" + const val bootstrap = "4.6.0" const val bouncyCastlePkix = "1.68" const val bouncyCastleProvider = "1.68" const val clikt = "3.1.0"