Skip to content

Commit

Permalink
Merge pull request #1111 from ShokoAnime/update-webui-install
Browse files Browse the repository at this point in the history
Update Web UI Token and Add Note.
  • Loading branch information
ElementalCrisis authored Mar 20, 2024
2 parents fbe0353 + 1b80352 commit 322a123
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 25 deletions.
4 changes: 2 additions & 2 deletions Shoko.Server/API/v2/Modules/Webui.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.Collections.Generic;
using System.Collections.Generic;
using System.IO;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
Expand Down Expand Up @@ -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");
Expand Down
2 changes: 1 addition & 1 deletion Shoko.Server/API/v3/Controllers/WebUIController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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.");
}
Expand Down
51 changes: 29 additions & 22 deletions Shoko.Server/webui/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,30 +11,37 @@
<body class="flex justify-center items-center h-screen"
style="background-image: url('https://shokoanime.com/assets/images/banners/Banner-3.jpg'); background-size: cover; background-position: center;">

<!-- Overlay -->
<div class="absolute inset-0 bg-[#282E38] opacity-90"></div>
<!-- Overlay -->
<div class="absolute inset-0 bg-[#282E38] opacity-90"></div>

<!-- Panel -->
<div class="flex flex-col relative z-10 bg-[#282E38] bg-opacity-90 rounded-lg p-6 w-[50rem] gap-y-8 text-[#CFD8E3] border border-[#21242B]">
<div class="flex justify-center text-3xl">Shoko Server Is Running</div>
<div class="text-base">
However, it appears that the Web UI has not been properly installed. Not to worry though, simply click the
"Install Web UI" button below, and Shoko will take care of automatically installing it for you.
<!-- Panel -->
<!-- Make sure to always include the ID "install-web-ui" since it is the required token for Web UI installation.' -->
<div class="flex flex-col relative z-10 bg-[#282E38] bg-opacity-90 rounded-lg p-6 w-[50rem] gap-y-8 text-[#CFD8E3] border border-[#21242B]">
<div class="flex justify-center text-3xl" id="install-web-ui">Shoko Server Is Running</div>
<div class="text-base">
However, it appears that the Web UI has not been properly installed. Not to worry though, simply click the
"Install Web UI" button below, and Shoko will take care of automatically installing it for you.
</div>
<div class="text-base">
Make sure to follow the instructions provided during the installation process. If you encounter any issues or
need further assistance, don't hesitate to check out the resources available in Shoko Docs or join our Discord
Server for additional support.
</div>
<div class='flex gap-x-4 justify-center'>
<a href="/api/webui/install" class="bg-[#44A3FF] text-[#21242B] px-4 py-3 rounded-lg font-semibold">
Install Web
UI
</a>
<a href="https://docs.shokoanime.com/" class="bg-[#353D4A] text-[#CFD8E3] px-4 py-3 rounded-lg font-semibold">
Shoko
Docs
</a>
<a href="https://discord.gg/vpeHDsg" class="bg-[#353D4A] text-[#CFD8E3] px-4 py-3 rounded-lg font-semibold">
Shoko
Discord
</a>
</div>
</div>
<div class="text-base">
Make sure to follow the instructions provided during the installation process. If you encounter any issues or
need further assistance, don't hesitate to check out the resources available in Shoko Docs or join our Discord
Server for additional support.
</div>
<div class='flex gap-x-4 justify-center'>
<a href="/api/webui/install" class="bg-[#44A3FF] text-[#21242B] px-4 py-3 rounded-lg font-semibold">Install Web
UI</a>
<a href="https://docs.shokoanime.com/" class="bg-[#353D4A] text-[#CFD8E3] px-4 py-3 rounded-lg font-semibold">Shoko
Docs</a>
<a href="https://discord.gg/vpeHDsg" class="bg-[#353D4A] text-[#CFD8E3] px-4 py-3 rounded-lg font-semibold">Shoko
Discord</a>
</div>
</div>

</body>
</html>

0 comments on commit 322a123

Please sign in to comment.