From 9f3d85981795f9c641db7e14ae1146d2e75d00a5 Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 30 May 2023 20:55:09 +0000 Subject: [PATCH 1/2] Lint Code [skip actions] --- src/handbook/src/backend/types.ts | 6 +++--- src/handbook/src/utils.ts | 9 +++------ 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/src/handbook/src/backend/types.ts b/src/handbook/src/backend/types.ts index df08d4e73..dafce45a9 100644 --- a/src/handbook/src/backend/types.ts +++ b/src/handbook/src/backend/types.ts @@ -136,9 +136,9 @@ export type CommandResponse = { }; export type WindowDetails = { - address: string, - port: number, - disable: boolean + address: string; + port: number; + disable: boolean; }; /** diff --git a/src/handbook/src/utils.ts b/src/handbook/src/utils.ts index 559783a8b..d20dff55f 100644 --- a/src/handbook/src/utils.ts +++ b/src/handbook/src/utils.ts @@ -174,11 +174,8 @@ export function getWindowDetails(): WindowDetails { const { address, port, disable } = details; return { - address: address == "{{DETAILS_ADDRESS}}" ? - "127.0.0.1" : address, - port: port == "{{DETAILS_PORT}}" ? - 443 : parseInt(port), - disable: disable == "{{DETAILS_DISABLE}}" ? - false : disable == "true" + address: address == "{{DETAILS_ADDRESS}}" ? "127.0.0.1" : address, + port: port == "{{DETAILS_PORT}}" ? 443 : parseInt(port), + disable: disable == "{{DETAILS_DISABLE}}" ? false : disable == "true" }; } From bdbfb733a0cb37bd7467195199cd694df9fb66d3 Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 30 May 2023 20:55:44 +0000 Subject: [PATCH 2/2] Format code [skip actions] --- .../server/http/documentation/HandbookHandler.java | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/main/java/emu/grasscutter/server/http/documentation/HandbookHandler.java b/src/main/java/emu/grasscutter/server/http/documentation/HandbookHandler.java index e65878670..b7a43ba19 100644 --- a/src/main/java/emu/grasscutter/server/http/documentation/HandbookHandler.java +++ b/src/main/java/emu/grasscutter/server/http/documentation/HandbookHandler.java @@ -28,10 +28,11 @@ public final class HandbookHandler implements Router { var server = HANDBOOK.server; if (this.serve && server.enforced) { - this.handbook = this.handbook - .replace("{{DETAILS_ADDRESS}}", server.address) - .replace("{{DETAILS_PORT}}", String.valueOf(server.port)) - .replace("{{DETAILS_DISABLE}}", Boolean.toString(server.canChange)); + this.handbook = + this.handbook + .replace("{{DETAILS_ADDRESS}}", server.address) + .replace("{{DETAILS_PORT}}", String.valueOf(server.port)) + .replace("{{DETAILS_DISABLE}}", Boolean.toString(server.canChange)); } } @@ -69,9 +70,7 @@ public final class HandbookHandler implements Router { if (!this.serve) { ctx.status(500).result("Handbook not found."); } else { - ctx - .contentType(ContentType.TEXT_HTML) - .result(this.handbook); + ctx.contentType(ContentType.TEXT_HTML).result(this.handbook); } }