Spaces:
Sleeping
Sleeping
File size: 3,565 Bytes
7df743a e4cb1f1 7df743a e4cb1f1 7df743a e4cb1f1 7df743a |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Upload Database</title>
<style>
/* Overall dark theme background */
body {
background-color: #1a1a2e;
color: #eaeaea;
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
margin: 0;
padding: 0;
}
.container {
max-width: 800px;
margin: 0 auto;
padding: 20px;
}
header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 20px;
}
h1 {
margin-bottom: 20px;
color: #eaeaea;
}
.upload-btn, .back-btn {
background-color: #007bff;
color: #fff;
padding: 8px 12px;
text-decoration: none;
border-radius: 5px;
}
.upload-btn:hover, .back-btn:hover {
background-color: #0056b3;
}
/* Form container styling */
.form-container {
background-color: #16213e;
border-radius: 8px;
padding: 20px;
}
.form-container h2 {
margin-top: 0;
}
/* Form elements styling */
.form-group {
margin-bottom: 15px;
}
.form-group label {
display: block;
margin-bottom: 5px;
}
.form-group input[type="file"] {
display: block;
padding: 8px;
border-radius: 5px;
border: 1px solid #ccc;
width: 100%;
background-color: #eaeaea;
color: #333;
}
.form-group button {
background-color: #007bff;
color: #fff;
padding: 10px 20px;
border: none;
border-radius: 5px;
cursor: pointer;
font-size: 1rem;
}
.form-group button:hover {
background-color: #0056b3;
}
.alert {
padding: 10px;
margin-bottom: 10px;
border-radius: 5px;
text-align: center;
position: absolute;
position-area: top center;
top: 30px;
align-items: center;
}
.alert-error {
background-color: #D84040;
color: #ffffff;
}
.alert-success {
background-color: #D2DE32;
color: #ffffff;
}
.alert-warning {
background-color: #FFC700;
color: #ffffff;
}
</style>
</head>
<body>
<div class="container-flash">
{% with messages = get_flashed_messages(with_categories=true) %}
{% if messages %}
<div id="flash-message" class="alert alert-{{ messages[0][0] }}">
<strong>{{ messages[0][1] }}</strong>
</div>
{% endif %}
{% endwith %}
</div>
<div class="container">
<header>
<h1>Upload Database</h1>
<!-- Optional: Back link to main chat page -->
<a href="/" class="back-btn">Back to Chat</a>
</header>
<div class="form-container">
<h2>Upload a SQLite DB file</h2>
<form method="POST" action="/upload" enctype="multipart/form-data">
<div class="form-group">
<label for="dbFile">Choose file:</label>
<input type="file" id="dbFile" name="file" accept=".db" required>
</div>
<div class="form-group">
<button type="submit">Upload</button>
</div>
</form>
</div>
</div>
</body>
<script>
const flashMessage = document.getElementById('flash-message');
//for flash message
if (flashMessage) {
setTimeout(function() {
flashMessage.style.display = 'none';
}, 2000); // Hide after 2 seconds
}
</script>
</html>
|