mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-08-01 01:38:39 +00:00
Make suggested changes
This commit is contained in:
parent
df7bb7d356
commit
32acd054f4
7 changed files with 18 additions and 16 deletions
|
@ -57,10 +57,6 @@ public class ResourcesController : ControllerBase
|
|||
{
|
||||
string path = $"png/{hash}.png";
|
||||
|
||||
if (!IOFile.Exists("png"))
|
||||
{
|
||||
FileHelper.EnsureDirectoryCreated(Path.Combine(Environment.CurrentDirectory, "png"));
|
||||
}
|
||||
if (IOFile.Exists(path))
|
||||
{
|
||||
return this.File(IOFile.OpenRead(path), "image/png");
|
||||
|
|
|
@ -11,9 +11,10 @@
|
|||
|
||||
<script>
|
||||
function onSubmit(form) {
|
||||
const passwordHashed = document.getElementById("password");
|
||||
const passwordOriginal = document.getElementById("password-original");
|
||||
passwordHashed.value = sha256(passwordOriginal.value);
|
||||
const passwordInput = document.getElementById("password");
|
||||
const passwordSubmit = document.getElementById("password-submit");
|
||||
|
||||
passwordSubmit.value = sha256(passwordInput);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -43,8 +44,8 @@
|
|||
<div class="field">
|
||||
<label>Password</label>
|
||||
<div class="ui left icon input">
|
||||
<input type="password" id="password-original" placeholder="Password">
|
||||
<input type="hidden" name="password" id="password">
|
||||
<input type="password" id="password" placeholder="Password">
|
||||
<input type="hidden" id="password-submit" name="password">
|
||||
<i class="lock icon"></i>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
#nullable enable
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
@ -27,7 +28,7 @@ public class PhotosPage : BaseLayout
|
|||
public PhotosPage([NotNull] Database database) : base(database)
|
||||
{}
|
||||
|
||||
public async Task<IActionResult> OnGet([FromRoute] int pageNumber, [FromQuery] string name)
|
||||
public async Task<IActionResult> OnGet([FromRoute] int pageNumber, [FromQuery] string? name)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(name)) name = "";
|
||||
|
||||
|
|
|
@ -12,10 +12,10 @@
|
|||
function onSubmit(form) {
|
||||
const passwordInput = document.getElementById("password");
|
||||
const confirmPasswordInput = document.getElementById("confirmPassword");
|
||||
const password = document.getElementById("password-submit");
|
||||
const confirmPassword = document.getElementById("confirm-submit");
|
||||
password.value = sha256(passwordInput.value);
|
||||
confirmPassword.value = sha256(confirmPasswordInput.value);
|
||||
const passwordSubmit = document.getElementById("password-submit");
|
||||
const confirmPasswordSubmit = document.getElementById("confirm-submit");
|
||||
passwordSubmit.value = sha256(passwordInput.value);
|
||||
confirmPasswordSubmit.value = sha256(confirmPasswordInput.value);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
#nullable enable
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
@ -28,7 +29,7 @@ public class SlotsPage : BaseLayout
|
|||
public SlotsPage([NotNull] Database database) : base(database)
|
||||
{}
|
||||
|
||||
public async Task<IActionResult> OnGet([FromRoute] int pageNumber, [FromQuery] string name)
|
||||
public async Task<IActionResult> OnGet([FromRoute] int pageNumber, [FromQuery] string? name)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(name)) name = "";
|
||||
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
#nullable enable
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
@ -26,7 +27,7 @@ public class UsersPage : BaseLayout
|
|||
public UsersPage([NotNull] Database database) : base(database)
|
||||
{}
|
||||
|
||||
public async Task<IActionResult> OnGet([FromRoute] int pageNumber, [FromQuery] string name)
|
||||
public async Task<IActionResult> OnGet([FromRoute] int pageNumber, [FromQuery] string? name)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(name)) name = "";
|
||||
|
||||
|
@ -35,6 +36,7 @@ public class UsersPage : BaseLayout
|
|||
this.SearchValue = name;
|
||||
this.PageNumber = pageNumber;
|
||||
this.PageAmount = Math.Max(1, (int)Math.Ceiling((double)this.UserCount / ServerStatics.PageSize));
|
||||
|
||||
if (this.PageNumber < 0 || this.PageNumber >= this.PageAmount) return this.Redirect($"/users/{Math.Clamp(this.PageNumber, 0, this.PageAmount - 1)}");
|
||||
|
||||
this.Users = await this.Database.Users.Where
|
||||
|
|
|
@ -82,6 +82,7 @@ public static class Program
|
|||
return;
|
||||
}
|
||||
|
||||
FileHelper.EnsureDirectoryCreated(Path.Combine(Environment.CurrentDirectory, "png"));
|
||||
if (Directory.Exists("r"))
|
||||
{
|
||||
Logger.Log
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue