Create templates/index.html
Browse files- templates/index.html +36 -0
templates/index.html
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!doctype html>
|
| 2 |
+
<html lang="en">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="utf-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
| 6 |
+
<title>Triflix Realtime Backup</title>
|
| 7 |
+
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
|
| 8 |
+
</head>
|
| 9 |
+
<body class="bg-light">
|
| 10 |
+
<div class="container py-5">
|
| 11 |
+
<h1 class="mb-4">Upload a File for Realtime Backup</h1>
|
| 12 |
+
<form id="uploadForm" enctype="multipart/form-data">
|
| 13 |
+
<div class="mb-3">
|
| 14 |
+
<input class="form-control" type="file" name="file" required>
|
| 15 |
+
</div>
|
| 16 |
+
<button type="submit" class="btn btn-primary">Upload & Push</button>
|
| 17 |
+
</form>
|
| 18 |
+
<div id="status" class="mt-3"></div>
|
| 19 |
+
</div>
|
| 20 |
+
|
| 21 |
+
<script>
|
| 22 |
+
document.getElementById('uploadForm').addEventListener('submit', async (e) => {
|
| 23 |
+
e.preventDefault();
|
| 24 |
+
const formData = new FormData(e.target);
|
| 25 |
+
const statusDiv = document.getElementById('status');
|
| 26 |
+
try {
|
| 27 |
+
const res = await fetch('/upload', { method: 'POST', body: formData });
|
| 28 |
+
const json = await res.json();
|
| 29 |
+
statusDiv.innerText = json.status + ": " + json.path;
|
| 30 |
+
} catch(err) {
|
| 31 |
+
statusDiv.innerText = "Error: " + err;
|
| 32 |
+
}
|
| 33 |
+
});
|
| 34 |
+
</script>
|
| 35 |
+
</body>
|
| 36 |
+
</html>
|