2025-12-05 05:34:16 +00:00
|
|
|
{{define "index"}}
|
2025-12-05 04:25:21 +00:00
|
|
|
<!DOCTYPE html>
|
|
|
|
|
<html>
|
|
|
|
|
<head>
|
|
|
|
|
<meta charset="utf-8">
|
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
|
|
|
<title>FileServer</title>
|
|
|
|
|
<link rel="stylesheet" href="/assets/bulma.min.css">
|
|
|
|
|
<script src="https://kit.fontawesome.com/2effe35473.js" crossorigin="anonymous"></script>
|
|
|
|
|
</head>
|
|
|
|
|
<body>
|
|
|
|
|
<section class="section">
|
|
|
|
|
<div class="container">
|
2025-12-05 05:47:51 +00:00
|
|
|
<h1 class="title is-1">Hébergement de fichiers</h1>
|
2025-12-05 04:25:21 +00:00
|
|
|
<p class="subtitle">
|
|
|
|
|
Enfin une solution simple que vous gérez vous même
|
|
|
|
|
</p>
|
|
|
|
|
|
|
|
|
|
<form action="/admin/upload" method="post" enctype="multipart/form-data">
|
|
|
|
|
<div id="file-js-example" class="file has-name is-boxed">
|
|
|
|
|
<label class="file-label">
|
|
|
|
|
<input class="file-input" type="file" name="file" />
|
|
|
|
|
<span class="file-cta">
|
|
|
|
|
<span class="file-icon">
|
|
|
|
|
<i class="fas fa-upload"></i>
|
|
|
|
|
</span>
|
|
|
|
|
<span class="file-label"> Choose a file… </span>
|
|
|
|
|
</span>
|
|
|
|
|
<span class="file-name"> No file selected </span>
|
|
|
|
|
</label>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="field is-grouped">
|
|
|
|
|
<div class="control">
|
2025-12-05 05:47:51 +00:00
|
|
|
<input type="submit" value="Uploader" class="button is-link"/>
|
2025-12-05 04:25:21 +00:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</form>
|
|
|
|
|
</div>
|
|
|
|
|
</section>
|
2025-12-05 05:34:16 +00:00
|
|
|
|
|
|
|
|
<section class="section">
|
|
|
|
|
<div class="container">
|
|
|
|
|
<h1 class="title is-4">Liste des fichiers</h1>
|
|
|
|
|
<table class="table is-striped is-hoverable is-fullwidth">
|
|
|
|
|
<thead>
|
|
|
|
|
<tr>
|
|
|
|
|
<th>Nom de fichier</th>
|
|
|
|
|
<th>URL</th>
|
|
|
|
|
<th>Actions</th>
|
|
|
|
|
</tr>
|
|
|
|
|
</thead>
|
|
|
|
|
<tbody>
|
|
|
|
|
{{ range .Files }}
|
|
|
|
|
<tr>
|
|
|
|
|
<th>{{ .Filename }}</th>
|
|
|
|
|
<td><a href="{{ .URL }}">{{ .URL }}</a></td>
|
2025-12-05 05:47:51 +00:00
|
|
|
<td>
|
|
|
|
|
<form action="/admin/remove" method="get" enctype="multipart/form-data" onsubmit="return confirm('Êtes-vous certain ? Cette action est irréversible');">
|
|
|
|
|
<input type="hidden" name="Filename" value="{{ .Filename }}"/>
|
|
|
|
|
<div class="field is-grouped">
|
|
|
|
|
<div class="control">
|
|
|
|
|
<input type="submit" value="Supprimer" class="button is-danger is-small"/>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</form>
|
|
|
|
|
</td>
|
2025-12-05 05:34:16 +00:00
|
|
|
</tr>
|
|
|
|
|
{{ end }}
|
|
|
|
|
</tbody>
|
|
|
|
|
</table>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
</section>
|
2025-12-05 04:25:21 +00:00
|
|
|
</body>
|
|
|
|
|
<script>
|
|
|
|
|
const fileInput = document.querySelector("#file-js-example input[type=file]");
|
|
|
|
|
fileInput.onchange = () => {
|
|
|
|
|
if (fileInput.files.length > 0) {
|
|
|
|
|
const fileName = document.querySelector("#file-js-example .file-name");
|
|
|
|
|
fileName.textContent = fileInput.files[0].name;
|
|
|
|
|
}
|
|
|
|
|
};
|
2025-12-05 05:34:16 +00:00
|
|
|
</script>
|
2025-12-05 04:25:21 +00:00
|
|
|
</html>
|
2025-12-05 05:34:16 +00:00
|
|
|
{{end}}
|