mirror of
https://github.com/Suwayomi/Tachidesk.git
synced 2025-12-20 19:42:37 +01:00
Improve GQL Playground (#558)
This commit is contained in:
@@ -7,6 +7,7 @@
|
|||||||
|
|
||||||
package suwayomi.tachidesk.graphql.controller
|
package suwayomi.tachidesk.graphql.controller
|
||||||
|
|
||||||
|
import io.javalin.http.ContentType
|
||||||
import io.javalin.http.Context
|
import io.javalin.http.Context
|
||||||
import io.javalin.websocket.WsConfig
|
import io.javalin.websocket.WsConfig
|
||||||
import suwayomi.tachidesk.graphql.server.TachideskGraphQLServer
|
import suwayomi.tachidesk.graphql.server.TachideskGraphQLServer
|
||||||
@@ -25,10 +26,8 @@ object GraphQLController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun playground(ctx: Context) {
|
fun playground(ctx: Context) {
|
||||||
val body = javaClass.getResourceAsStream("/graphql-playground.html")!!.bufferedReader().use { reader ->
|
ctx.contentType(ContentType.TEXT_HTML)
|
||||||
reader.readText()
|
ctx.result(javaClass.getResourceAsStream("/graphql-playground.html")!!)
|
||||||
}
|
|
||||||
ctx.html(body)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun webSocket(ws: WsConfig) {
|
fun webSocket(ws: WsConfig) {
|
||||||
|
|||||||
@@ -41,6 +41,22 @@
|
|||||||
<link href="https://unpkg.com/graphiql/graphiql.min.css" rel="stylesheet"/>
|
<link href="https://unpkg.com/graphiql/graphiql.min.css" rel="stylesheet"/>
|
||||||
<link href="https://unpkg.com/@graphiql/plugin-explorer/dist/style.min.css" rel="stylesheet"/>
|
<link href="https://unpkg.com/@graphiql/plugin-explorer/dist/style.min.css" rel="stylesheet"/>
|
||||||
<style>
|
<style>
|
||||||
|
.docExplorerWrap {
|
||||||
|
width: 100% !important;
|
||||||
|
padding-bottom: 20px;
|
||||||
|
}
|
||||||
|
.docExplorerHide {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*noinspection CssUnresolvedCustomProperty*/
|
||||||
|
.doc-explorer-title {
|
||||||
|
font-weight: var(--font-weight-medium);
|
||||||
|
font-size: var(--font-size-h2);
|
||||||
|
overflow-x: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
.doc-explorer-contents {
|
.doc-explorer-contents {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
padding-bottom: 40px;
|
padding-bottom: 40px;
|
||||||
|
|||||||
Reference in New Issue
Block a user