- Add Tauri commands to inspect and adopt the gateway repo root - Retry locked vault commands by prompting for unlock - Improve mobile layout, editor mode toggles, and settings UI
118 lines
4.2 KiB
C#
118 lines
4.2 KiB
C#
namespace Journal.WebGateway.Infrastructure;
|
|
|
|
public static class LoginPage
|
|
{
|
|
public static string GetHtml() => @"
|
|
<!DOCTYPE html>
|
|
<html lang=""en"">
|
|
<head>
|
|
<meta charset=""UTF-8"">
|
|
<meta name=""viewport"" content=""width=device-width, initial-scale=1.0"">
|
|
<title>Journal Gateway | Login</title>
|
|
<link href=""https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap"" rel=""stylesheet"">
|
|
<style>
|
|
:root {
|
|
--bg: #0a0a0b;
|
|
--surface: #141416;
|
|
--primary: #6366f1;
|
|
--primary-hover: #4f46e5;
|
|
--text: #ffffff;
|
|
--text-dim: #9ca3af;
|
|
--error: #ef4444;
|
|
}
|
|
* { box-sizing: border-box; margin: 0; padding: 0; }
|
|
body {
|
|
font-family: 'Inter', sans-serif;
|
|
background-color: var(--bg);
|
|
color: var(--text);
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
height: 100vh;
|
|
overflow: hidden;
|
|
}
|
|
.login-card {
|
|
background: var(--surface);
|
|
padding: 2.5rem;
|
|
border-radius: 1rem;
|
|
width: 100%;
|
|
max-width: 400px;
|
|
box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
|
|
border: 1px solid rgba(255, 255, 255, 0.05);
|
|
text-align: center;
|
|
animation: fadeIn 0.5s ease-out;
|
|
}
|
|
@keyframes fadeIn {
|
|
from { opacity: 0; transform: translateY(10px); }
|
|
to { opacity: 1; transform: translateY(0); }
|
|
}
|
|
h1 { font-size: 1.5rem; margin-bottom: 0.5rem; font-weight: 600; letter-spacing: -0.025em; }
|
|
p { color: var(--text-dim); margin-bottom: 2rem; font-size: 0.875rem; }
|
|
.form-group { text-align: left; margin-bottom: 1.5rem; }
|
|
label { display: block; font-size: 0.75rem; font-weight: 500; color: var(--text-dim); margin-bottom: 0.5rem; text-transform: uppercase; letter-spacing: 0.05em; }
|
|
input {
|
|
width: 100%;
|
|
padding: 0.75rem 1rem;
|
|
background: #000;
|
|
border: 1px solid rgba(255, 255, 255, 0.1);
|
|
border-radius: 0.5rem;
|
|
color: var(--text);
|
|
font-size: 1rem;
|
|
transition: all 0.2s;
|
|
}
|
|
input:focus {
|
|
outline: none;
|
|
border-color: var(--primary);
|
|
box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
|
|
}
|
|
button {
|
|
width: 100%;
|
|
padding: 0.75rem;
|
|
background: var(--primary);
|
|
color: white;
|
|
border: none;
|
|
border-radius: 0.5rem;
|
|
font-size: 0.875rem;
|
|
font-weight: 600;
|
|
cursor: pointer;
|
|
transition: background 0.2s;
|
|
}
|
|
button:hover { background: var(--primary-hover); }
|
|
.error-msg {
|
|
color: var(--error);
|
|
font-size: 0.75rem;
|
|
margin-top: 1rem;
|
|
padding: 0.5rem;
|
|
background: rgba(239, 68, 68, 0.1);
|
|
border-radius: 0.25rem;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class=""login-card"">
|
|
<h1>Journal Gateway</h1>
|
|
<p>Enter your access password to continue.</p>
|
|
<form action=""/gateway/login"" method=""POST"">
|
|
<div class=""form-group"">
|
|
<label for=""password"">Password</label>
|
|
<input type=""password"" id=""password"" name=""password"" required autofocus placeholder=""••••••••"">
|
|
</div>
|
|
<button type=""submit"">Sign In</button>
|
|
<div id=""error"" class=""error-msg"" style=""display:none""></div>
|
|
</form>
|
|
</div>
|
|
<script>
|
|
const urlParams = new URLSearchParams(window.location.search);
|
|
const errorEl = document.getElementById('error');
|
|
if (urlParams.has('error')) {
|
|
const error = urlParams.get('error');
|
|
errorEl.textContent = error === 'config'
|
|
? 'Gateway password hash is not configured. Set Security:AccessPasswordHash before signing in.'
|
|
: 'Invalid password. Please try again.';
|
|
errorEl.style.display = 'block';
|
|
}
|
|
</script>
|
|
</body>
|
|
</html>";
|
|
}
|