From 1b803527f28e7f77185b31ad96b02455e5a5886f Mon Sep 17 00:00:00 2001 From: ElementalCrisis <9443295+ElementalCrisis@users.noreply.github.com> Date: Tue, 19 Mar 2024 18:56:18 -0700 Subject: [PATCH] Update Web UI Token and Add Note. --- Shoko.Server/API/v2/Modules/Webui.cs | 4 +- .../API/v3/Controllers/WebUIController.cs | 2 +- Shoko.Server/webui/index.html | 51 +++++++++++-------- 3 files changed, 32 insertions(+), 25 deletions(-) diff --git a/Shoko.Server/API/v2/Modules/Webui.cs b/Shoko.Server/API/v2/Modules/Webui.cs index 9fdbf6555..68889a2e7 100644 --- a/Shoko.Server/API/v2/Modules/Webui.cs +++ b/Shoko.Server/API/v2/Modules/Webui.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using System.IO; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; @@ -32,7 +32,7 @@ public ActionResult InstallWebUI() if (System.IO.File.Exists(indexLocation)) { var index = System.IO.File.ReadAllText(indexLocation); - var token = "Web UI was not properly installed"; + var token = "install-web-ui"; if (!index.Contains(token)) { return Unauthorized("If trying to update, use api/webui/update"); diff --git a/Shoko.Server/API/v3/Controllers/WebUIController.cs b/Shoko.Server/API/v3/Controllers/WebUIController.cs index dbc9085b9..f792669d4 100644 --- a/Shoko.Server/API/v3/Controllers/WebUIController.cs +++ b/Shoko.Server/API/v3/Controllers/WebUIController.cs @@ -324,7 +324,7 @@ public ActionResult InstallWebUI([FromQuery] ReleaseChannel channel = ReleaseCha if (System.IO.File.Exists(indexLocation)) { var index = System.IO.File.ReadAllText(indexLocation); - var token = "Web UI was not properly installed"; + var token = "install-web-ui"; if (!index.Contains(token)) return BadRequest("Unable to install web UI when a web UI is already installed."); } diff --git a/Shoko.Server/webui/index.html b/Shoko.Server/webui/index.html index 3fdd1b21c..e43bbbf5d 100644 --- a/Shoko.Server/webui/index.html +++ b/Shoko.Server/webui/index.html @@ -11,30 +11,37 @@
- - + + - -