diff --git a/komga/build.gradle.kts b/komga/build.gradle.kts index bc69bd11..92b559ef 100644 --- a/komga/build.gradle.kts +++ b/komga/build.gradle.kts @@ -219,9 +219,18 @@ tasks { } } + register("copyWebDistNext") { + group = "web" + from("$nextui/dist/") + into("$projectDir/src/main/resources/public/") + excludes.add("index.html") //will be copied by 'prepareThymeLeafNext' + mustRunAfter(getByName("copyWebDist")) + } + // modifies index.html to inject ThymeLeaf th: tags register("prepareThymeLeafNext") { group = "web" + dependsOn("copyWebDistNext") from("$nextui/dist/index.html") into("$projectDir/src/main/resources/public/") filter { line -> @@ -229,13 +238,14 @@ tasks { it.groups[0]?.value + " th:" + it.groups[1]?.value + "@{" + it.groups[2]?.value?.prefixIfNot("/") + "}" + it.groups[3]?.value } } + rename("index.html", "index-next.html") } withType { filesMatching("application*.yml") { expand(project.properties) } - mustRunAfter(getByName("prepareThymeLeaf")) + mustRunAfter(getByName("prepareThymeLeaf"), getByName("prepareThymeLeafNext")) } register("benchmark") { diff --git a/komga/src/main/kotlin/org/gotson/komga/infrastructure/web/WebMvcConfiguration.kt b/komga/src/main/kotlin/org/gotson/komga/infrastructure/web/WebMvcConfiguration.kt index d09aad8c..ed9ff39d 100644 --- a/komga/src/main/kotlin/org/gotson/komga/infrastructure/web/WebMvcConfiguration.kt +++ b/komga/src/main/kotlin/org/gotson/komga/infrastructure/web/WebMvcConfiguration.kt @@ -27,6 +27,7 @@ class WebMvcConfiguration : WebMvcConfigurer { registry .addResourceHandler( "/index.html", + "/index-next.html", "/favicon.ico", "/favicon-16x16.png", "/favicon-32x32.png", diff --git a/komga/src/main/kotlin/org/gotson/komga/interfaces/mvc/IndexController.kt b/komga/src/main/kotlin/org/gotson/komga/interfaces/mvc/IndexController.kt index 5f94bb98..610c7d75 100644 --- a/komga/src/main/kotlin/org/gotson/komga/interfaces/mvc/IndexController.kt +++ b/komga/src/main/kotlin/org/gotson/komga/interfaces/mvc/IndexController.kt @@ -16,4 +16,10 @@ class IndexController( model.addAttribute("baseUrl", baseUrl) return "index" } + + @GetMapping("/next") + fun indexNext(model: Model): String { + model.addAttribute("baseUrl", baseUrl) + return "index-next" + } } diff --git a/next-ui/src/pages/startup.vue b/next-ui/src/pages/startup.vue index d5ef83e7..12e1f1f1 100644 --- a/next-ui/src/pages/startup.vue +++ b/next-ui/src/pages/startup.vue @@ -12,6 +12,8 @@ import { useCurrentUser } from '@/colada/users' import { useClaimStatus } from '@/colada/claim' +definePage({ alias: '/next' }) + async function checkAuthenticated() { const router = useRouter() const route = useRoute()