a5f8943c72
- Aggiunta validazione percorsi file prima del salvataggio profili - Implementati metodi di lettura file CSV e Excel per schedulazioni - Supporto doppia modalità: caricamento browser (preview) e percorso manuale (schedulazione) - Gestione completa deletion sync anche per file CSV/Excel - Rilevamento automatico separatori CSV (virgola, punto e virgola, tab, pipe) - Supporto formati Excel legacy (.xls) e moderni (.xlsx) - Abilitati profili file nella UI di schedulazione - Logging dettagliato per troubleshooting - Documentazione completa in CSV_SCHEDULING_IMPLEMENTATION.md - Aggiornati README.md e copilot-instructions.md con nuove feature - Rimosso testo 'TEST' dalla pagina di login
182 lines
4.3 KiB
Plaintext
182 lines
4.3 KiB
Plaintext
@page "/login"
|
|
@using Data_Coupler.Services
|
|
@using Microsoft.AspNetCore.Components.Forms
|
|
@inject IAuthenticationService AuthService
|
|
@inject NavigationManager NavigationManager
|
|
|
|
<div class="login-container">
|
|
<div class="login-card">
|
|
<div class="login-header">
|
|
<h2>Data Coupler</h2>
|
|
<p>Accedi per continuare</p>
|
|
</div>
|
|
|
|
<div class="login-body">
|
|
<EditForm Model="@loginModel" OnValidSubmit="@HandleLogin">
|
|
<DataAnnotationsValidator />
|
|
|
|
<div class="form-group">
|
|
<label for="password">Password</label>
|
|
<InputText type="password"
|
|
class="form-control"
|
|
id="password"
|
|
@bind-Value="loginModel.Password"
|
|
placeholder="Inserisci la password"
|
|
autocomplete="current-password" />
|
|
</div>
|
|
|
|
@if (!string.IsNullOrEmpty(errorMessage))
|
|
{
|
|
<div class="alert alert-danger" role="alert">
|
|
@errorMessage
|
|
</div>
|
|
}
|
|
|
|
<button type="submit" class="btn btn-primary btn-block">
|
|
<i class="oi oi-account-login"></i> Accedi
|
|
</button>
|
|
</EditForm>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<style>
|
|
.login-container {
|
|
display: flex;
|
|
justify-content: center;
|
|
align-items: center;
|
|
min-height: 100vh;
|
|
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
|
}
|
|
|
|
.login-card {
|
|
background: white;
|
|
border-radius: 10px;
|
|
box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
|
|
width: 100%;
|
|
max-width: 400px;
|
|
overflow: hidden;
|
|
}
|
|
|
|
.login-header {
|
|
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
|
color: white;
|
|
padding: 30px;
|
|
text-align: center;
|
|
}
|
|
|
|
.login-header h2 {
|
|
margin: 0;
|
|
font-size: 28px;
|
|
font-weight: 600;
|
|
}
|
|
|
|
.login-header p {
|
|
margin: 10px 0 0 0;
|
|
opacity: 0.9;
|
|
}
|
|
|
|
.login-body {
|
|
padding: 30px;
|
|
}
|
|
|
|
.form-group {
|
|
margin-bottom: 20px;
|
|
}
|
|
|
|
.form-group label {
|
|
display: block;
|
|
margin-bottom: 8px;
|
|
font-weight: 500;
|
|
color: #333;
|
|
}
|
|
|
|
.form-control {
|
|
width: 100%;
|
|
padding: 12px;
|
|
border: 1px solid #ddd;
|
|
border-radius: 5px;
|
|
font-size: 14px;
|
|
transition: border-color 0.3s;
|
|
}
|
|
|
|
.form-control:focus {
|
|
outline: none;
|
|
border-color: #667eea;
|
|
box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
|
|
}
|
|
|
|
.btn-block {
|
|
width: 100%;
|
|
padding: 12px;
|
|
font-size: 16px;
|
|
font-weight: 500;
|
|
border: none;
|
|
border-radius: 5px;
|
|
cursor: pointer;
|
|
transition: all 0.3s;
|
|
}
|
|
|
|
.btn-primary {
|
|
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
|
color: white;
|
|
}
|
|
|
|
.btn-primary:hover {
|
|
transform: translateY(-2px);
|
|
box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
|
|
}
|
|
|
|
.alert {
|
|
padding: 12px;
|
|
border-radius: 5px;
|
|
margin-bottom: 20px;
|
|
}
|
|
|
|
.alert-danger {
|
|
background-color: #fee;
|
|
border: 1px solid #fcc;
|
|
color: #c33;
|
|
}
|
|
</style>
|
|
|
|
@code {
|
|
private LoginModel loginModel = new LoginModel();
|
|
private string errorMessage = string.Empty;
|
|
|
|
protected override void OnInitialized()
|
|
{
|
|
// Se l'utente è già autenticato, reindirizza alla home
|
|
if (AuthService.IsAuthenticated)
|
|
{
|
|
NavigationManager.NavigateTo("/");
|
|
}
|
|
}
|
|
|
|
private void HandleLogin()
|
|
{
|
|
errorMessage = string.Empty;
|
|
|
|
if (string.IsNullOrWhiteSpace(loginModel.Password))
|
|
{
|
|
errorMessage = "Inserisci la password";
|
|
return;
|
|
}
|
|
|
|
if (AuthService.Login(loginModel.Password))
|
|
{
|
|
NavigationManager.NavigateTo("/");
|
|
}
|
|
else
|
|
{
|
|
errorMessage = "Password non corretta";
|
|
loginModel.Password = string.Empty;
|
|
}
|
|
}
|
|
|
|
private class LoginModel
|
|
{
|
|
public string Password { get; set; } = string.Empty;
|
|
}
|
|
}
|