60 lines
1.8 KiB
Text
60 lines
1.8 KiB
Text
|
|
@page "/login"
|
||
|
|
@layout Layout.EmptyLayout
|
||
|
|
@inject IWebHostEnvironment Env
|
||
|
|
|
||
|
|
<PageTitle>Anmelden</PageTitle>
|
||
|
|
|
||
|
|
<div class="login-container">
|
||
|
|
<!-- Hintergrundbild -->
|
||
|
|
@if (_imageExists)
|
||
|
|
{
|
||
|
|
<img src="/start-image/start.jpg" alt="Startbild" class="login-background" />
|
||
|
|
}
|
||
|
|
else
|
||
|
|
{
|
||
|
|
<div class="login-background login-background-placeholder">
|
||
|
|
<div class="text-center text-white">
|
||
|
|
<i class="bi bi-image display-1"></i>
|
||
|
|
<p class="mt-3">Bitte lege eine Datei namens <code>start.jpg</code> im Root-Verzeichnis der App ab.</p>
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
}
|
||
|
|
|
||
|
|
<!-- Login-Formular unten mittig -->
|
||
|
|
<div class="login-form-wrapper">
|
||
|
|
<div class="login-form-card">
|
||
|
|
<h4 class="mb-3 text-white">Ghost Image Manager</h4>
|
||
|
|
<form method="post" action="/auth/login">
|
||
|
|
<div class="mb-3">
|
||
|
|
<label class="form-label text-white">Passwort</label>
|
||
|
|
<input type="password" name="password" class="form-control" placeholder="Passwort eingeben" required />
|
||
|
|
</div>
|
||
|
|
|
||
|
|
@if (!string.IsNullOrEmpty(ErrorMessage))
|
||
|
|
{
|
||
|
|
<div class="alert alert-danger">@ErrorMessage</div>
|
||
|
|
}
|
||
|
|
|
||
|
|
<input type="hidden" name="returnUrl" value="@ReturnUrl" />
|
||
|
|
<button type="submit" class="btn btn-primary w-100">Anmelden</button>
|
||
|
|
</form>
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
@code {
|
||
|
|
[SupplyParameterFromQuery]
|
||
|
|
public string? ReturnUrl { get; set; }
|
||
|
|
|
||
|
|
[SupplyParameterFromQuery]
|
||
|
|
public string? ErrorMessage { get; set; }
|
||
|
|
|
||
|
|
private bool _imageExists;
|
||
|
|
|
||
|
|
protected override void OnInitialized()
|
||
|
|
{
|
||
|
|
var imagePath = Path.Combine(Env.ContentRootPath, "start.jpg");
|
||
|
|
_imageExists = File.Exists(imagePath);
|
||
|
|
}
|
||
|
|
}
|