added web/ with some html and updated go.mod and go.sum to use gin

This commit is contained in:
2025-09-20 13:04:32 -03:00
parent 910cad2734
commit ac236342b6
19 changed files with 1819 additions and 7 deletions

173
web/templates/upload.html Normal file
View File

@@ -0,0 +1,173 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Packets Custom Package Manager</title>
<style>
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
font-family: Arial, sans-serif;
line-height: 1.6;
background: #fefefe;
color: #222;
padding: 20px;
}
header {
text-align: center;
margin-bottom: 20px;
}
header h1 {
font-size: 2.2em;
color: #333;
}
header p {
font-size: 1.1em;
color: #555;
}
nav {
text-align: center;
margin: 15px 0;
}
nav a {
margin: 0 10px;
text-decoration: none;
color: #0066cc;
font-weight: bold;
}
main {
max-width: 900px;
margin: auto;
}
section {
margin-bottom: 30px;
padding-bottom: 10px;
border-bottom: 1px solid #ddd;
}
h2 {
color: #222;
margin-bottom: 10px;
}
pre {
background: #f4f4f4;
padding: 10px;
border-radius: 5px;
overflow-x: auto;
}
form {
background: #f9f9f9;
padding: 15px;
border: 1px solid #ccc;
border-radius: 5px;
}
form label {
display: block;
margin-bottom: 5px;
font-weight: bold;
}
form input, form textarea, form select, form button {
width: 100%;
padding: 8px;
margin-bottom: 10px;
font-size: 1rem;
border: 1px solid #ccc;
border-radius: 4px;
font-family: inherit;
transition: border-color 0.2s, box-shadow 0.2s;
}
form input:focus, form textarea:focus, form select:focus {
outline: none;
border-color: #0066cc;
box-shadow: 0 0 5px rgba(0, 102, 204, 0.5);
}
form button {
background: #0066cc;
color: white;
border: none;
cursor: pointer;
font-weight: bold;
}
form button:hover {
background: #004999;
}
hr {
border: none;
height: 1px;
background: linear-gradient(to right, transparent, #ccc, transparent);
margin: 20px 0;
}
@media (max-width: 600px) {
header h1 {
font-size: 1.8em;
}
nav a {
display: block;
margin: 5px 0;
}
}
</style>
</head>
<body>
<header>
<h1>📦 Packets</h1>
<p>Fast, lightweight and compatible</p>
</header>
<nav>
<a href="#download">Download</a>
<a href="/package">Packages</a>
<a href="/upload">Upload</a>
<a href="/account">Account</a>
</nav>
<hr>
<main>
<section id="upload">
<h2>Upload a package</h2>
<form>
<label for="name">Query Name</label>
<input type="text" id="name" name="name" v-model="name" required>
<label for="file">Package link (.tar.zst)</label>
<input type="link" id="file" name="file" v-model="file" placeholder="ex: https://github.com/roboogg133/packets/raw/refs/heads/main/go1.24.5.pkt.tar.zst" required>
<label for="family">Family</label>
<select name="family" id="family" v-model="family">
<option value="New">New</option>
{{range .Families}}
<option value="{{.}}">{{.}}</option>
{{end}}
</select>
<label for="arch">Architecture</label>
<select name="arch" id="arch" v-model="arch">
<option value="x86_64">x86_64</option>
<option value="arm64">Arm64</option>
<option value="i386">i386</option>
</select>
<label for="operating">Operating System</label>
<select name="operating" id="operating" v-model="operating">
<option value="Linux">Linux</option>
<option value="Windows">Windows</option>
<option value="MacOS">MacOS</option>
</select>
<label for="signature">File signature (ed25519)</label>
<input type="file" name="signature" id="signature">
<label for="public_key">Public key (ed25519)</label>
<input type="file" name="public_key" id="public_key">
<button type="submit">Submit</button>
</form>
</section>
</main>
</body>
</html>
<script src="/static/js/refresh.js"></script>