295 lines
7.6 KiB
HTML
295 lines
7.6 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Config Module</title>
|
|
<script src="https://cdn.tailwindcss.com"></script>
|
|
<link rel="icon" type="image/x-icon" href="/static/favicon.ico">
|
|
|
|
<style>
|
|
* { border-radius: 0 !important; }
|
|
body {
|
|
font-family: ui-monospace, 'Cascadia Code', 'Source Code Pro', monospace;
|
|
background: #fff;
|
|
color: #000;
|
|
padding: 20px;
|
|
}
|
|
|
|
.box { border: 3px solid #000; background: #fff; padding: 20px; }
|
|
|
|
.section-title {
|
|
font-size: 18px;
|
|
font-weight: 900;
|
|
text-transform: uppercase;
|
|
border-bottom: 3px solid #000;
|
|
margin-bottom: 16px;
|
|
padding-bottom: 4px;
|
|
}
|
|
|
|
.row {
|
|
display: grid;
|
|
grid-template-columns: 300px 1fr;
|
|
gap: 10px;
|
|
margin-bottom: 12px;
|
|
align-items: center;
|
|
}
|
|
|
|
label {
|
|
font-weight: 900;
|
|
text-transform: uppercase;
|
|
font-size: 12px;
|
|
}
|
|
|
|
input {
|
|
border: 2px solid #000;
|
|
padding: 6px 8px;
|
|
font-size: 13px;
|
|
width: 100%;
|
|
}
|
|
|
|
.hint {
|
|
font-size: 11px;
|
|
font-style: italic;
|
|
margin-top: 4px;
|
|
border-left: 4px solid #000;
|
|
padding-left: 6px;
|
|
}
|
|
|
|
button, .button {
|
|
border: 2px solid #000;
|
|
background: #fff;
|
|
padding: 6px 12px;
|
|
cursor: pointer;
|
|
font-size: 11px;
|
|
font-weight: 900;
|
|
text-transform: uppercase;
|
|
box-shadow: 3px 3px 0px #000;
|
|
}
|
|
|
|
button:hover, .button:hover {
|
|
background: #000;
|
|
color: #fff;
|
|
box-shadow: none;
|
|
transform: translate(2px, 2px);
|
|
}
|
|
|
|
button:active {
|
|
background: #ff0000;
|
|
color: #fff;
|
|
}
|
|
|
|
.nav-link {
|
|
font-weight: 900;
|
|
text-decoration: underline;
|
|
text-transform: uppercase;
|
|
font-size: 12px;
|
|
}
|
|
|
|
.nav-link:hover {
|
|
background: #000;
|
|
color: #fff;
|
|
}
|
|
|
|
.ok {
|
|
border: 3px solid #000;
|
|
background: #00ff00;
|
|
padding: 10px;
|
|
font-weight: 900;
|
|
text-transform: uppercase;
|
|
}
|
|
|
|
.err {
|
|
border: 3px solid #000;
|
|
background: #ff0000;
|
|
color: #fff;
|
|
padding: 10px;
|
|
font-weight: 900;
|
|
text-transform: uppercase;
|
|
}
|
|
</style>
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<div class="max-w-4xl mx-auto">
|
|
|
|
<!-- HEADER -->
|
|
<header class="mb-6 border-b-8 border-black pb-4 flex justify-between items-start">
|
|
<h1 class="text-4xl font-black uppercase tracking-tighter leading-none">
|
|
Config_Settings
|
|
</h1>
|
|
|
|
<div class="flex flex-col items-end gap-2">
|
|
<a href="/admin" class="nav-link">Admin_Panel</a>
|
|
<a href="/config" class="nav-link">Reload_Config</a>
|
|
<a href="/logout" class="nav-link text-red-600">Logout</a>
|
|
</div>
|
|
</header>
|
|
|
|
<!-- STATUS -->
|
|
{{if .Success}}
|
|
<div class="ok mb-4">CONFIG_SAVED_SUCCESSFULLY</div>
|
|
{{end}}
|
|
|
|
{{if .Error}}
|
|
<div class="err mb-4">{{.Error}}</div>
|
|
{{end}}
|
|
|
|
<form method="POST" action="/config">
|
|
|
|
<div class="box mb-6">
|
|
<div class="section-title">General_Settings</div>
|
|
|
|
<div class="row">
|
|
<label>Site_MODT</label>
|
|
<input type="text" name="site_modt" value="{{.MODT}}">
|
|
</div>
|
|
</div>
|
|
|
|
<!-- UPLOAD SETTINGS -->
|
|
<div class="box mb-6">
|
|
<div class="section-title">Upload_Control</div>
|
|
|
|
<div class="row">
|
|
<label>Max_File_Size_MB</label>
|
|
<div class="flex flex-col gap-1">
|
|
<div class="flex gap-2 items-center">
|
|
<input id="fileSizeMB" type="number" min="1" name="upload_max_file_size_mb" value="{{.UploadMaxFileSizeMB}}">
|
|
|
|
<input id="fileSizeGB" type="text" readonly placeholder="GB"
|
|
class="w-24 bg-gray-100 cursor-not-allowed">
|
|
</div>
|
|
|
|
<div class="hint">Hard limit enforced by upload endpoints</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="row">
|
|
<label>Multi_Upload_Limit</label>
|
|
<div>
|
|
<input type="number" min="1" name="upload_multi_max_files" value="{{.UploadMultiMaxFiles}}">
|
|
<div class="hint">Max files per multi-upload request</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="row">
|
|
<label>Max_Expiry_Hours</label>
|
|
<div class="flex flex-col gap-1">
|
|
<div class="flex gap-2 items-center">
|
|
<input id="hoursInput" type="number" min="1" name="upload_max_hours" value="{{.UploadMaxHours}}">
|
|
|
|
<input id="daysOutput" type="text" readonly placeholder="Days" class="w-24 bg-gray-100 cursor-not-allowed">
|
|
</div>
|
|
|
|
<div class="hint">User duration capped to this value</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- RATE LIMITS -->
|
|
<div class="box mb-6">
|
|
<div class="section-title">Rate_Limits_(Static)</div>
|
|
|
|
<div class="hint mb-4">
|
|
Changes require server restart to take effect
|
|
</div>
|
|
|
|
<div class="row">
|
|
<label>Login_Per_Minute</label>
|
|
<input type="number" min="1" name="ratelimit_login_per_minute" value="{{.RateLimitLoginPerMinute}}">
|
|
</div>
|
|
|
|
<div class="row">
|
|
<label>Login_Burst</label>
|
|
<input type="number" min="1" name="ratelimit_login_burst" value="{{.RateLimitLoginBurst}}">
|
|
</div>
|
|
|
|
<div class="row">
|
|
<label>API_Per_Minute</label>
|
|
<input type="number" min="1" name="ratelimit_api_per_minute" value="{{.RateLimitApiPerMinute}}">
|
|
</div>
|
|
|
|
<div class="row">
|
|
<label>API_Burst</label>
|
|
<input type="number" min="1" name="ratelimit_api_burst" value="{{.RateLimitApiBurst}}">
|
|
</div>
|
|
</div>
|
|
|
|
<div class="box mb-6">
|
|
<div class="section-title">NTFY_Settings</div>
|
|
|
|
<div class="row">
|
|
<label>Use_NTFY</label>
|
|
<input type="checkbox" id="ntfy_use_seen" {{if .NtfyUse}}checked{{end}}>
|
|
<input type="hidden" name="ntfy_use" id="ntfy_use_hidden" value="{{if .NtfyUse}}true{{else}}false{{end}}">
|
|
</div>
|
|
|
|
<div class="row">
|
|
<label>NTFY_Url</label>
|
|
<input type="text" name="ntfy_url" value="{{.NtfyUrl}}">
|
|
</div>
|
|
|
|
<div class="row">
|
|
<label>NTFY_Topic</label>
|
|
<input type="text" name="ntfy_topic" value="{{.NtfyTopic}}">
|
|
</div>
|
|
</div>
|
|
|
|
<!-- ACTIONS -->
|
|
<div class="flex justify-between items-center border-t-8 border-black pt-4">
|
|
<button type="submit">SAVE</button>
|
|
</div>
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
<a href="/change-password" class="fixed bottom-1 left-1 text-[10px] underline">
|
|
CHANGE_PASSWORD
|
|
</a>
|
|
|
|
<script>
|
|
function formatNumber(num) {
|
|
return parseFloat(num.toFixed(2));
|
|
}
|
|
|
|
function updateConversions() {
|
|
const mb = parseFloat(document.getElementById('fileSizeMB')?.value);
|
|
const gbField = document.getElementById('fileSizeGB');
|
|
|
|
if (!isNaN(mb) && gbField) {
|
|
gbField.value = formatNumber(mb / 1024) + " GB";
|
|
} else if (gbField) {
|
|
gbField.value = "";
|
|
}
|
|
|
|
const hours = parseFloat(document.getElementById('hoursInput')?.value);
|
|
const daysField = document.getElementById('daysOutput');
|
|
|
|
if (!isNaN(hours) && daysField) {
|
|
daysField.value = formatNumber(hours / 24) + " days";
|
|
} else if (daysField) {
|
|
daysField.value = "";
|
|
}
|
|
}
|
|
|
|
// Run on load
|
|
window.addEventListener('DOMContentLoaded', updateConversions);
|
|
|
|
// Listen for changes
|
|
document.addEventListener('input', updateConversions);
|
|
|
|
const checkbox = document.getElementById('ntfy_use_seen');
|
|
const hidden = document.getElementById('ntfy_use_hidden');
|
|
|
|
if (checkbox && hidden) {
|
|
// Update hidden input whenever checkbox changes
|
|
checkbox.addEventListener('change', () => {
|
|
hidden.value = checkbox.checked ? "true" : "false";
|
|
});
|
|
}
|
|
</script>
|
|
|
|
</body>
|
|
</html> |