Spaces:
Running
Running
Upload 7 files
Browse files- templates/chat.html +181 -151
- templates/create_db.html +198 -215
- templates/list_dbs.html +157 -130
- templates/update_db.html +107 -107
templates/chat.html
CHANGED
|
@@ -1,152 +1,182 @@
|
|
| 1 |
-
{% extends 'base.html' %}
|
| 2 |
-
|
| 3 |
-
{% block content %}
|
| 4 |
-
|
| 5 |
-
<style>
|
| 6 |
-
/* Ensure full-page setup */
|
| 7 |
-
html, body {
|
| 8 |
-
height: 100%;
|
| 9 |
-
margin: 0;
|
| 10 |
-
padding: 0;
|
| 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 |
-
border-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
border:
|
| 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 |
-
|
| 151 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 152 |
{% endblock %}
|
|
|
|
| 1 |
+
{% extends 'base.html' %}
|
| 2 |
+
|
| 3 |
+
{% block content %}
|
| 4 |
+
|
| 5 |
+
<style>
|
| 6 |
+
/* Ensure full-page setup */
|
| 7 |
+
html, body {
|
| 8 |
+
height: 100%;
|
| 9 |
+
margin: 0;
|
| 10 |
+
padding: 0;
|
| 11 |
+
background-color: #1e1e2e;
|
| 12 |
+
color: white;
|
| 13 |
+
font-family: Arial, sans-serif;
|
| 14 |
+
}
|
| 15 |
+
|
| 16 |
+
.container {
|
| 17 |
+
display: flex;
|
| 18 |
+
height: 80vh;
|
| 19 |
+
margin-top: 40px;
|
| 20 |
+
align-items: center;
|
| 21 |
+
justify-content: center;
|
| 22 |
+
gap: 30px;
|
| 23 |
+
}
|
| 24 |
+
|
| 25 |
+
.card {
|
| 26 |
+
background: #2c2c3e;
|
| 27 |
+
border-radius: 10px;
|
| 28 |
+
box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.5);
|
| 29 |
+
padding: 20px;
|
| 30 |
+
width: 45%;
|
| 31 |
+
height: 100%;
|
| 32 |
+
}
|
| 33 |
+
|
| 34 |
+
.card-title {
|
| 35 |
+
font-size: 20px;
|
| 36 |
+
font-weight: bold;
|
| 37 |
+
text-align: center;
|
| 38 |
+
}
|
| 39 |
+
|
| 40 |
+
.form-group input {
|
| 41 |
+
border-radius: 6px;
|
| 42 |
+
padding: 10px;
|
| 43 |
+
}
|
| 44 |
+
|
| 45 |
+
.btn-primary {
|
| 46 |
+
background-color: #007bff;
|
| 47 |
+
border-color: #007bff;
|
| 48 |
+
width: 100%;
|
| 49 |
+
padding: 10px;
|
| 50 |
+
border-radius: 6px;
|
| 51 |
+
}
|
| 52 |
+
|
| 53 |
+
.btn-primary:hover {
|
| 54 |
+
background-color: #0056b3;
|
| 55 |
+
border-color: #0056b3;
|
| 56 |
+
}
|
| 57 |
+
|
| 58 |
+
/* Loader */
|
| 59 |
+
.loader {
|
| 60 |
+
display: none;
|
| 61 |
+
border: 4px solid rgba(255, 255, 255, 0.3);
|
| 62 |
+
border-top: 4px solid #007bff;
|
| 63 |
+
border-radius: 50%;
|
| 64 |
+
width: 30px;
|
| 65 |
+
height: 30px;
|
| 66 |
+
animation: spin 1s linear infinite;
|
| 67 |
+
margin: auto;
|
| 68 |
+
}
|
| 69 |
+
|
| 70 |
+
@keyframes spin {
|
| 71 |
+
0% { transform: rotate(0deg); }
|
| 72 |
+
100% { transform: rotate(360deg); }
|
| 73 |
+
}
|
| 74 |
+
|
| 75 |
+
/* Answer Section */
|
| 76 |
+
.answer-section{
|
| 77 |
+
overflow-y: auto;
|
| 78 |
+
max-height: 70vh;
|
| 79 |
+
padding: 10px;
|
| 80 |
+
border-radius: 6px;
|
| 81 |
+
background: #2c2c3e;
|
| 82 |
+
}
|
| 83 |
+
|
| 84 |
+
.answer-section h6 {
|
| 85 |
+
color: #ffffff;
|
| 86 |
+
font-weight: bold;
|
| 87 |
+
text-align: center;
|
| 88 |
+
}
|
| 89 |
+
|
| 90 |
+
.answer-item {
|
| 91 |
+
background: #1a1a2e;
|
| 92 |
+
padding: 10px;
|
| 93 |
+
border-radius: 6px;
|
| 94 |
+
margin-bottom: 10px;
|
| 95 |
+
}
|
| 96 |
+
|
| 97 |
+
/* History Section */
|
| 98 |
+
.history-section {
|
| 99 |
+
overflow-y: auto;
|
| 100 |
+
max-height: 70vh;
|
| 101 |
+
padding: 10px;
|
| 102 |
+
border-radius: 6px;
|
| 103 |
+
background: #2c2c3e;
|
| 104 |
+
}
|
| 105 |
+
|
| 106 |
+
.history-item {
|
| 107 |
+
background: #1a1a2e;
|
| 108 |
+
padding: 10px;
|
| 109 |
+
border-radius: 6px;
|
| 110 |
+
margin-bottom: 10px;
|
| 111 |
+
}
|
| 112 |
+
|
| 113 |
+
.alert-error {
|
| 114 |
+
background-color: #ff4d4d;
|
| 115 |
+
color: white;
|
| 116 |
+
}
|
| 117 |
+
|
| 118 |
+
.alert-table_selected {
|
| 119 |
+
background-color: #4dff74;
|
| 120 |
+
color: white;
|
| 121 |
+
}
|
| 122 |
+
|
| 123 |
+
</style>
|
| 124 |
+
|
| 125 |
+
<div class="container">
|
| 126 |
+
<!-- Left Pane -->
|
| 127 |
+
<div class="card">
|
| 128 |
+
<h5 class="card-title">Document AI</h5>
|
| 129 |
+
<p>Enter a query and get an answer based on stored context.</p>
|
| 130 |
+
|
| 131 |
+
<form method="POST" action="{{ url_for('chat') }}" onsubmit="showLoader()">
|
| 132 |
+
<div class="form-group">
|
| 133 |
+
<input type="text" name="query_text" placeholder="Enter your query" value="{{ query_text }}" required class="form-control">
|
| 134 |
+
</div>
|
| 135 |
+
<div class="form-group mt-2">
|
| 136 |
+
<button type="submit" class="btn btn-primary">Submit</button>
|
| 137 |
+
</div>
|
| 138 |
+
</form>
|
| 139 |
+
|
| 140 |
+
<div class="loader" id="loader"></div>
|
| 141 |
+
|
| 142 |
+
{% if answer %}
|
| 143 |
+
<div class="answer-section">
|
| 144 |
+
<div class="answer-item">
|
| 145 |
+
<h6><strong>Answer:</strong></h6>
|
| 146 |
+
<hr>
|
| 147 |
+
{{ answer }}
|
| 148 |
+
</div>
|
| 149 |
+
</div>
|
| 150 |
+
{% endif %}
|
| 151 |
+
</div>
|
| 152 |
+
|
| 153 |
+
<!-- Right Pane -->
|
| 154 |
+
<div class="card">
|
| 155 |
+
<h5 class="card-title">Previous Queries</h5>
|
| 156 |
+
<div class="history-section">
|
| 157 |
+
{% for question, answer in history %}
|
| 158 |
+
<div class="history-item">
|
| 159 |
+
<div><strong>Query:</strong> {{ question }}</div>
|
| 160 |
+
<hr>
|
| 161 |
+
<div><strong>Answer:</strong> {{ answer }}</div>
|
| 162 |
+
</div>
|
| 163 |
+
{% endfor %}
|
| 164 |
+
</div>
|
| 165 |
+
</div>
|
| 166 |
+
</div>
|
| 167 |
+
|
| 168 |
+
<script>
|
| 169 |
+
function showLoader() {
|
| 170 |
+
document.getElementById('loader').style.display = 'block';
|
| 171 |
+
document.querySelector('.answer-section')?.classList.add('d-none');
|
| 172 |
+
}
|
| 173 |
+
|
| 174 |
+
// Ensure the answer section is visible when an answer is displayed
|
| 175 |
+
window.onload = function() {
|
| 176 |
+
if (document.querySelector('.answer-section')) {
|
| 177 |
+
document.querySelector('.answer-section').classList.remove('d-none');
|
| 178 |
+
}
|
| 179 |
+
};
|
| 180 |
+
</script>
|
| 181 |
+
|
| 182 |
{% endblock %}
|
templates/create_db.html
CHANGED
|
@@ -1,215 +1,198 @@
|
|
| 1 |
-
{% extends 'base.html' %}
|
| 2 |
-
|
| 3 |
-
{% block content %}
|
| 4 |
-
<style>
|
| 5 |
-
html, body {
|
| 6 |
-
height:
|
| 7 |
-
margin: 0;
|
| 8 |
-
}
|
| 9 |
-
|
| 10 |
-
.container {
|
| 11 |
-
display: flex;
|
| 12 |
-
flex-direction: column;
|
| 13 |
-
height: 80vh; /* Fill the viewport height */
|
| 14 |
-
}
|
| 15 |
-
|
| 16 |
-
.card {
|
| 17 |
-
margin: auto;
|
| 18 |
-
background-color: #2c2c3e;
|
| 19 |
-
color: #f5f5f5;
|
| 20 |
-
border: none;
|
| 21 |
-
width: 50%;
|
| 22 |
-
height: 70%; /* Fixed height for the card */
|
| 23 |
-
display: flex;
|
| 24 |
-
flex-direction: column;
|
| 25 |
-
justify-content: space-between;
|
| 26 |
-
padding: 1rem;
|
| 27 |
-
}
|
| 28 |
-
|
| 29 |
-
.card-header {
|
| 30 |
-
background-color: #181831;
|
| 31 |
-
border-bottom: 2px solid #444;
|
| 32 |
-
padding: 1rem;
|
| 33 |
-
text-align: center;
|
| 34 |
-
}
|
| 35 |
-
|
| 36 |
-
.form-label {
|
| 37 |
-
font-weight: bold;
|
| 38 |
-
color: #cfcfcf;
|
| 39 |
-
}
|
| 40 |
-
|
| 41 |
-
.form-control {
|
| 42 |
-
background-color: #1e1e2f;
|
| 43 |
-
color: #f5f5f5;
|
| 44 |
-
border: 1px solid #444;
|
| 45 |
-
}
|
| 46 |
-
|
| 47 |
-
.form-control:focus {
|
| 48 |
-
background-color: #1e1e2f;
|
| 49 |
-
color: #f5f5f5;
|
| 50 |
-
border-color: #4c4cff;
|
| 51 |
-
box-shadow: 0 0 4px #4c4cff;
|
| 52 |
-
}
|
| 53 |
-
|
| 54 |
-
.
|
| 55 |
-
|
| 56 |
-
border
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
display:
|
| 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 |
-
<div class="card-
|
| 137 |
-
<
|
| 138 |
-
|
| 139 |
-
|
| 140 |
-
|
| 141 |
-
|
| 142 |
-
|
| 143 |
-
|
| 144 |
-
|
| 145 |
-
|
| 146 |
-
|
| 147 |
-
|
| 148 |
-
|
| 149 |
-
|
| 150 |
-
|
| 151 |
-
|
| 152 |
-
|
| 153 |
-
|
| 154 |
-
|
| 155 |
-
|
| 156 |
-
|
| 157 |
-
|
| 158 |
-
|
| 159 |
-
|
| 160 |
-
|
| 161 |
-
|
| 162 |
-
|
| 163 |
-
|
| 164 |
-
|
| 165 |
-
|
| 166 |
-
|
| 167 |
-
|
| 168 |
-
|
| 169 |
-
|
| 170 |
-
|
| 171 |
-
|
| 172 |
-
|
| 173 |
-
|
| 174 |
-
|
| 175 |
-
|
| 176 |
-
|
| 177 |
-
|
| 178 |
-
|
| 179 |
-
|
| 180 |
-
const
|
| 181 |
-
|
| 182 |
-
|
| 183 |
-
|
| 184 |
-
|
| 185 |
-
|
| 186 |
-
|
| 187 |
-
|
| 188 |
-
|
| 189 |
-
|
| 190 |
-
|
| 191 |
-
|
| 192 |
-
|
| 193 |
-
|
| 194 |
-
|
| 195 |
-
|
| 196 |
-
|
| 197 |
-
|
| 198 |
-
|
| 199 |
-
folderUpload.classList.add('hidden');
|
| 200 |
-
});
|
| 201 |
-
|
| 202 |
-
// Handle form submission
|
| 203 |
-
document.getElementById('db-form').addEventListener('submit', function(event) {
|
| 204 |
-
event.preventDefault(); // Prevent form submission for demonstration
|
| 205 |
-
submitButton.classList.add('btn-loading');
|
| 206 |
-
// Simulate loading
|
| 207 |
-
setTimeout(() => {
|
| 208 |
-
// After form is "submitted" and loading is complete
|
| 209 |
-
submitButton.classList.remove('btn-loading');
|
| 210 |
-
alert("Form submitted successfully!"); // Simulate success
|
| 211 |
-
}, 2000); // 2 seconds for loading simulation
|
| 212 |
-
});
|
| 213 |
-
</script>
|
| 214 |
-
|
| 215 |
-
{% endblock %}
|
|
|
|
| 1 |
+
{% extends 'base.html' %}
|
| 2 |
+
|
| 3 |
+
{% block content %}
|
| 4 |
+
<style>
|
| 5 |
+
html, body {
|
| 6 |
+
height: 50%;
|
| 7 |
+
margin: 0;
|
| 8 |
+
}
|
| 9 |
+
|
| 10 |
+
.container {
|
| 11 |
+
display: flex;
|
| 12 |
+
flex-direction: column;
|
| 13 |
+
height: 80vh; /* Fill the viewport height */
|
| 14 |
+
}
|
| 15 |
+
|
| 16 |
+
.card {
|
| 17 |
+
margin: auto;
|
| 18 |
+
background-color: #2c2c3e;
|
| 19 |
+
color: #f5f5f5;
|
| 20 |
+
border: none;
|
| 21 |
+
width: 50%;
|
| 22 |
+
height: 70%; /* Fixed height for the card */
|
| 23 |
+
display: flex;
|
| 24 |
+
flex-direction: column;
|
| 25 |
+
justify-content: space-between;
|
| 26 |
+
padding: 1rem;
|
| 27 |
+
}
|
| 28 |
+
|
| 29 |
+
.card-header {
|
| 30 |
+
background-color: #181831;
|
| 31 |
+
border-bottom: 2px solid #444;
|
| 32 |
+
padding: 1rem;
|
| 33 |
+
text-align: center;
|
| 34 |
+
}
|
| 35 |
+
|
| 36 |
+
.form-label {
|
| 37 |
+
font-weight: bold;
|
| 38 |
+
color: #cfcfcf;
|
| 39 |
+
}
|
| 40 |
+
|
| 41 |
+
.form-control {
|
| 42 |
+
background-color: #1e1e2f;
|
| 43 |
+
color: #f5f5f5;
|
| 44 |
+
border: 1px solid #444;
|
| 45 |
+
}
|
| 46 |
+
|
| 47 |
+
.form-control:focus {
|
| 48 |
+
background-color: #1e1e2f;
|
| 49 |
+
color: #f5f5f5;
|
| 50 |
+
border-color: #4c4cff;
|
| 51 |
+
box-shadow: 0 0 4px #4c4cff;
|
| 52 |
+
}
|
| 53 |
+
|
| 54 |
+
.button-spinner {
|
| 55 |
+
display: none;
|
| 56 |
+
border: 2px solid #f5f5f5;
|
| 57 |
+
border-radius: 50%;
|
| 58 |
+
border-top: 2px solid #4c4cff;
|
| 59 |
+
width: 24px;
|
| 60 |
+
height: 24px;
|
| 61 |
+
animation: spin 1s linear infinite;
|
| 62 |
+
}
|
| 63 |
+
|
| 64 |
+
@keyframes spin {
|
| 65 |
+
0% { transform: rotate(0deg); }
|
| 66 |
+
100% { transform: rotate(360deg); }
|
| 67 |
+
}
|
| 68 |
+
|
| 69 |
+
.btn:active .button-spinner {
|
| 70 |
+
display: block;
|
| 71 |
+
}
|
| 72 |
+
|
| 73 |
+
|
| 74 |
+
.btn-primary {
|
| 75 |
+
background-color: #4c4cff;
|
| 76 |
+
border-color: #4c4cff;
|
| 77 |
+
display: flex;
|
| 78 |
+
justify-content: center;
|
| 79 |
+
align-items: center;
|
| 80 |
+
}
|
| 81 |
+
|
| 82 |
+
.btn-primary:hover {
|
| 83 |
+
background-color: #3838e8;
|
| 84 |
+
border-color: #3838e8;
|
| 85 |
+
}
|
| 86 |
+
|
| 87 |
+
.toggle-switch {
|
| 88 |
+
margin: 1rem 0;
|
| 89 |
+
display: flex;
|
| 90 |
+
justify-content: center;
|
| 91 |
+
align-items: center;
|
| 92 |
+
}
|
| 93 |
+
|
| 94 |
+
.toggle-switch input {
|
| 95 |
+
display: none;
|
| 96 |
+
}
|
| 97 |
+
|
| 98 |
+
.toggle-label {
|
| 99 |
+
background-color: #444;
|
| 100 |
+
color: #cfcfcf;
|
| 101 |
+
padding: 0.5rem 1.5rem;
|
| 102 |
+
border: 1px solid #555;
|
| 103 |
+
cursor: pointer;
|
| 104 |
+
margin-right: 1rem;
|
| 105 |
+
text-align: center;
|
| 106 |
+
border-radius: 4px;
|
| 107 |
+
}
|
| 108 |
+
|
| 109 |
+
.toggle-label.active {
|
| 110 |
+
background-color: #4c4cff;
|
| 111 |
+
color: #fff;
|
| 112 |
+
}
|
| 113 |
+
|
| 114 |
+
.toggle-label:hover {
|
| 115 |
+
background-color: #3838e8;
|
| 116 |
+
color: #fff;
|
| 117 |
+
}
|
| 118 |
+
|
| 119 |
+
.hidden {
|
| 120 |
+
display: none;
|
| 121 |
+
}
|
| 122 |
+
|
| 123 |
+
.text-center.d-flex {
|
| 124 |
+
display: flex;
|
| 125 |
+
justify-content: center;
|
| 126 |
+
align-items: center;
|
| 127 |
+
height: 100px;
|
| 128 |
+
}
|
| 129 |
+
</style>
|
| 130 |
+
|
| 131 |
+
<div class="container mt-5">
|
| 132 |
+
<div class="card shadow">
|
| 133 |
+
<div class="card-header">
|
| 134 |
+
<h3>Create a New Vector Database</h3>
|
| 135 |
+
</div>
|
| 136 |
+
<div class="card-body">
|
| 137 |
+
<form id="db-form" method="post" enctype="multipart/form-data">
|
| 138 |
+
<!-- Database Name Input -->
|
| 139 |
+
<div class="form-group">
|
| 140 |
+
<label for="db_name" class="form-label">Database Name</label>
|
| 141 |
+
<input type="text" id="db_name" name="db_name" class="form-control" placeholder="Enter database name" required>
|
| 142 |
+
</div>
|
| 143 |
+
|
| 144 |
+
<!-- Toggle Upload Mode -->
|
| 145 |
+
<div class="toggle-switch">
|
| 146 |
+
<label class="toggle-label active" id="folder-label" for="folder">Upload Folder</label>
|
| 147 |
+
<label class="toggle-label" id="file-label" for="file">Upload Files</label>
|
| 148 |
+
</div>
|
| 149 |
+
|
| 150 |
+
<!-- Folder Upload Input -->
|
| 151 |
+
<div id="folder-upload" class="form-group mt-3 hidden">
|
| 152 |
+
<label for="folder" class="form-label">Upload Folder</label>
|
| 153 |
+
<input type="file" id="folder" name="folder" class="form-control" webkitdirectory directory multiple>
|
| 154 |
+
<small class="text-muted">Note: You can upload a folder containing multiple files.</small>
|
| 155 |
+
</div>
|
| 156 |
+
|
| 157 |
+
<!-- Single File Upload Input -->
|
| 158 |
+
<div id="file-upload" class="form-group mt-3 hidden">
|
| 159 |
+
<label for="file" class="form-label">Upload Files</label>
|
| 160 |
+
<input type="file" id="file" name="file" class="form-control" multiple >
|
| 161 |
+
<small class="text-muted">Note: You can upload one or more files.</small>
|
| 162 |
+
</div>
|
| 163 |
+
|
| 164 |
+
<!-- Submit Button -->
|
| 165 |
+
<div class="mt-4 text-center d-flex justify-content-center align-items-center">
|
| 166 |
+
<button type="submit" class="btn btn-primary px-5">
|
| 167 |
+
<span class="btn-text">Create</span>
|
| 168 |
+
<div class="button-spinner"></div>
|
| 169 |
+
</button>
|
| 170 |
+
</div>
|
| 171 |
+
</form>
|
| 172 |
+
</div>
|
| 173 |
+
</div>
|
| 174 |
+
</div>
|
| 175 |
+
|
| 176 |
+
<script>
|
| 177 |
+
const folderLabel = document.getElementById('folder-label');
|
| 178 |
+
const fileLabel = document.getElementById('file-label');
|
| 179 |
+
const folderUpload = document.getElementById('folder-upload');
|
| 180 |
+
const fileUpload = document.getElementById('file-upload');
|
| 181 |
+
|
| 182 |
+
// Toggle upload mode
|
| 183 |
+
folderLabel.addEventListener('click', () => {
|
| 184 |
+
folderLabel.classList.add('active');
|
| 185 |
+
fileLabel.classList.remove('active');
|
| 186 |
+
folderUpload.classList.remove('hidden');
|
| 187 |
+
fileUpload.classList.add('hidden');
|
| 188 |
+
});
|
| 189 |
+
|
| 190 |
+
fileLabel.addEventListener('click', () => {
|
| 191 |
+
fileLabel.classList.add('active');
|
| 192 |
+
folderLabel.classList.remove('active');
|
| 193 |
+
fileUpload.classList.remove('hidden');
|
| 194 |
+
folderUpload.classList.add('hidden');
|
| 195 |
+
});
|
| 196 |
+
</script>
|
| 197 |
+
|
| 198 |
+
{% endblock %}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
templates/list_dbs.html
CHANGED
|
@@ -1,130 +1,157 @@
|
|
| 1 |
-
{% extends 'base.html' %}
|
| 2 |
-
|
| 3 |
-
{% block content %}
|
| 4 |
-
<style>
|
| 5 |
-
/* Full-page setup */
|
| 6 |
-
html, body {
|
| 7 |
-
height: 100%;
|
| 8 |
-
margin: 0;
|
| 9 |
-
}
|
| 10 |
-
|
| 11 |
-
.container {
|
| 12 |
-
display: flex;
|
| 13 |
-
flex-direction: column;
|
| 14 |
-
height: 50vh; /* Full viewport height */
|
| 15 |
-
justify-content: center;
|
| 16 |
-
align-items: center;
|
| 17 |
-
}
|
| 18 |
-
|
| 19 |
-
/* Card styling */
|
| 20 |
-
.card {
|
| 21 |
-
margin: auto;
|
| 22 |
-
background-color: #2c2c3e;
|
| 23 |
-
color: #f5f5f5;
|
| 24 |
-
border: none;
|
| 25 |
-
width: 50%;
|
| 26 |
-
box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2); /* Refined shadow effect */
|
| 27 |
-
max-height: calc(50vh - 50px); /* Adjust to fit within view */
|
| 28 |
-
overflow: hidden; /* Ensures no overflow from child elements */
|
| 29 |
-
}
|
| 30 |
-
|
| 31 |
-
/* Fixed header */
|
| 32 |
-
.card-header {
|
| 33 |
-
background-color: #181831;
|
| 34 |
-
border-bottom: 2px solid #444;
|
| 35 |
-
padding: 1rem;
|
| 36 |
-
text-align: center;
|
| 37 |
-
position: sticky; /* Keeps header fixed */
|
| 38 |
-
top: 0;
|
| 39 |
-
z-index: 1000; /* Ensures it stays above scrollable content */
|
| 40 |
-
}
|
| 41 |
-
|
| 42 |
-
.card-body {
|
| 43 |
-
max-height: 60vh; /* Limits height of scrollable area */
|
| 44 |
-
overflow-y: auto; /* Adds vertical scrolling */
|
| 45 |
-
}
|
| 46 |
-
|
| 47 |
-
/* Scrollbar customization */
|
| 48 |
-
.card-body::-webkit-scrollbar {
|
| 49 |
-
width: 8px;
|
| 50 |
-
}
|
| 51 |
-
|
| 52 |
-
.card-body::-webkit-scrollbar-thumb {
|
| 53 |
-
background-color: #444; /* Thumb color */
|
| 54 |
-
border-radius: 4px; /* Rounded scrollbar edges */
|
| 55 |
-
}
|
| 56 |
-
|
| 57 |
-
.card-body::-webkit-scrollbar-thumb:hover {
|
| 58 |
-
background-color: #555; /* Thumb hover color */
|
| 59 |
-
}
|
| 60 |
-
|
| 61 |
-
.card-body::-webkit-scrollbar-track {
|
| 62 |
-
background-color: #2c2c3e; /* Track background */
|
| 63 |
-
}
|
| 64 |
-
|
| 65 |
-
/* List group items */
|
| 66 |
-
.list-group-item {
|
| 67 |
-
background-color: #2c2c3e;
|
| 68 |
-
color: #f5f5f5;
|
| 69 |
-
border: 1px solid #444;
|
| 70 |
-
transition: background-color 0.3s ease;
|
| 71 |
-
}
|
| 72 |
-
|
| 73 |
-
.list-group-item:hover {
|
| 74 |
-
background-color: #383850;
|
| 75 |
-
}
|
| 76 |
-
|
| 77 |
-
/* Button styling */
|
| 78 |
-
.btn-primary {
|
| 79 |
-
background-color: #4c4cff;
|
| 80 |
-
border-color: #4c4cff;
|
| 81 |
-
}
|
| 82 |
-
|
| 83 |
-
.btn-primary:hover {
|
| 84 |
-
background-color: #3838e8;
|
| 85 |
-
border-color: #3838e8;
|
| 86 |
-
}
|
| 87 |
-
/* Align buttons side-by-side */
|
| 88 |
-
.button-container {
|
| 89 |
-
display: flex;
|
| 90 |
-
gap: 0.5rem; /* Adds space between buttons */
|
| 91 |
-
}
|
| 92 |
-
|
| 93 |
-
.btn-primary {
|
| 94 |
-
flex: 1; /* Ensures buttons have the same width */
|
| 95 |
-
}
|
| 96 |
-
|
| 97 |
-
/* Optional: Adjust margin and padding for better spacing */
|
| 98 |
-
.list-group-item {
|
| 99 |
-
display: flex;
|
| 100 |
-
justify-content: space-between;
|
| 101 |
-
align-items: center;
|
| 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 |
-
{%
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{% extends 'base.html' %}
|
| 2 |
+
|
| 3 |
+
{% block content %}
|
| 4 |
+
<style>
|
| 5 |
+
/* Full-page setup */
|
| 6 |
+
html, body {
|
| 7 |
+
height: 100%;
|
| 8 |
+
margin: 0;
|
| 9 |
+
}
|
| 10 |
+
|
| 11 |
+
.container {
|
| 12 |
+
display: flex;
|
| 13 |
+
flex-direction: column;
|
| 14 |
+
height: 50vh; /* Full viewport height */
|
| 15 |
+
justify-content: center;
|
| 16 |
+
align-items: center;
|
| 17 |
+
}
|
| 18 |
+
|
| 19 |
+
/* Card styling */
|
| 20 |
+
.card {
|
| 21 |
+
margin: auto;
|
| 22 |
+
background-color: #2c2c3e;
|
| 23 |
+
color: #f5f5f5;
|
| 24 |
+
border: none;
|
| 25 |
+
width: 50%;
|
| 26 |
+
box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2); /* Refined shadow effect */
|
| 27 |
+
max-height: calc(50vh - 50px); /* Adjust to fit within view */
|
| 28 |
+
overflow: hidden; /* Ensures no overflow from child elements */
|
| 29 |
+
}
|
| 30 |
+
|
| 31 |
+
/* Fixed header */
|
| 32 |
+
.card-header {
|
| 33 |
+
background-color: #181831;
|
| 34 |
+
border-bottom: 2px solid #444;
|
| 35 |
+
padding: 1rem;
|
| 36 |
+
text-align: center;
|
| 37 |
+
position: sticky; /* Keeps header fixed */
|
| 38 |
+
top: 0;
|
| 39 |
+
z-index: 1000; /* Ensures it stays above scrollable content */
|
| 40 |
+
}
|
| 41 |
+
|
| 42 |
+
.card-body {
|
| 43 |
+
max-height: 60vh; /* Limits height of scrollable area */
|
| 44 |
+
overflow-y: auto; /* Adds vertical scrolling */
|
| 45 |
+
}
|
| 46 |
+
|
| 47 |
+
/* Scrollbar customization */
|
| 48 |
+
.card-body::-webkit-scrollbar {
|
| 49 |
+
width: 8px;
|
| 50 |
+
}
|
| 51 |
+
|
| 52 |
+
.card-body::-webkit-scrollbar-thumb {
|
| 53 |
+
background-color: #444; /* Thumb color */
|
| 54 |
+
border-radius: 4px; /* Rounded scrollbar edges */
|
| 55 |
+
}
|
| 56 |
+
|
| 57 |
+
.card-body::-webkit-scrollbar-thumb:hover {
|
| 58 |
+
background-color: #555; /* Thumb hover color */
|
| 59 |
+
}
|
| 60 |
+
|
| 61 |
+
.card-body::-webkit-scrollbar-track {
|
| 62 |
+
background-color: #2c2c3e; /* Track background */
|
| 63 |
+
}
|
| 64 |
+
|
| 65 |
+
/* List group items */
|
| 66 |
+
.list-group-item {
|
| 67 |
+
background-color: #2c2c3e;
|
| 68 |
+
color: #f5f5f5;
|
| 69 |
+
border: 1px solid #444;
|
| 70 |
+
transition: background-color 0.3s ease;
|
| 71 |
+
}
|
| 72 |
+
|
| 73 |
+
.list-group-item:hover {
|
| 74 |
+
background-color: #383850;
|
| 75 |
+
}
|
| 76 |
+
|
| 77 |
+
/* Button styling */
|
| 78 |
+
.btn-primary {
|
| 79 |
+
background-color: #4c4cff;
|
| 80 |
+
border-color: #4c4cff;
|
| 81 |
+
}
|
| 82 |
+
|
| 83 |
+
.btn-primary:hover {
|
| 84 |
+
background-color: #3838e8;
|
| 85 |
+
border-color: #3838e8;
|
| 86 |
+
}
|
| 87 |
+
/* Align buttons side-by-side */
|
| 88 |
+
.button-container {
|
| 89 |
+
display: flex;
|
| 90 |
+
gap: 0.5rem; /* Adds space between buttons */
|
| 91 |
+
}
|
| 92 |
+
|
| 93 |
+
.btn-primary {
|
| 94 |
+
flex: 1; /* Ensures buttons have the same width */
|
| 95 |
+
}
|
| 96 |
+
|
| 97 |
+
/* Optional: Adjust margin and padding for better spacing */
|
| 98 |
+
.list-group-item {
|
| 99 |
+
display: flex;
|
| 100 |
+
justify-content: space-between;
|
| 101 |
+
align-items: center;
|
| 102 |
+
}
|
| 103 |
+
|
| 104 |
+
.alert {
|
| 105 |
+
padding: 10px;
|
| 106 |
+
margin-bottom: 10px;
|
| 107 |
+
border-radius: 5px;
|
| 108 |
+
text-align: center;
|
| 109 |
+
}
|
| 110 |
+
|
| 111 |
+
.alert-error {
|
| 112 |
+
background-color: #ff4d4d;
|
| 113 |
+
color: white;
|
| 114 |
+
}
|
| 115 |
+
|
| 116 |
+
.alert-table_selected {
|
| 117 |
+
background-color: #4dff74;
|
| 118 |
+
color: white;
|
| 119 |
+
}
|
| 120 |
+
</style>
|
| 121 |
+
|
| 122 |
+
{% with messages = get_flashed_messages(with_categories=true) %}
|
| 123 |
+
{% if messages %}
|
| 124 |
+
{% for category, message in messages %}
|
| 125 |
+
<div class="alert alert-{{ category }}">
|
| 126 |
+
{{ message }}
|
| 127 |
+
</div>
|
| 128 |
+
{% endfor %}
|
| 129 |
+
{% endif %}
|
| 130 |
+
{% endwith %}
|
| 131 |
+
|
| 132 |
+
<div class="container">
|
| 133 |
+
<div class="card shadow">
|
| 134 |
+
<div class="card-header">
|
| 135 |
+
<h3>Available Vector Databases</h3>
|
| 136 |
+
</div>
|
| 137 |
+
<div class="card-body">
|
| 138 |
+
<h4 class="text-center mb-4">Select a Vector Database</h4>
|
| 139 |
+
<ul class="list-group">
|
| 140 |
+
{% for db in vector_dbs %}
|
| 141 |
+
<li class="list-group-item">
|
| 142 |
+
<span>{{ db }}</span>
|
| 143 |
+
<div class="button-container">
|
| 144 |
+
<!-- <form method="post" action="{{ url_for('update_db', db_name=db) }}" class="mb-0">
|
| 145 |
+
<button type="submit" class="btn btn-primary btn-sm">Update</button>
|
| 146 |
+
</form> -->
|
| 147 |
+
<form method="post" action="{{ url_for('select_db', db_name=db) }}" class="mb-0">
|
| 148 |
+
<button type="submit" class="btn btn-primary btn-sm">Select</button>
|
| 149 |
+
</form>
|
| 150 |
+
</div>
|
| 151 |
+
</li>
|
| 152 |
+
{% endfor %}
|
| 153 |
+
</ul>
|
| 154 |
+
</div>
|
| 155 |
+
</div>
|
| 156 |
+
</div>
|
| 157 |
+
{% endblock %}
|
templates/update_db.html
CHANGED
|
@@ -1,107 +1,107 @@
|
|
| 1 |
-
{% extends 'base.html' %}
|
| 2 |
-
|
| 3 |
-
{% block content %}
|
| 4 |
-
<style>
|
| 5 |
-
html, body {
|
| 6 |
-
height: 100%;
|
| 7 |
-
margin: 0;
|
| 8 |
-
}
|
| 9 |
-
|
| 10 |
-
.container {
|
| 11 |
-
display: flex;
|
| 12 |
-
flex-direction: column;
|
| 13 |
-
height: 50vh;
|
| 14 |
-
overflow: hidden;
|
| 15 |
-
}
|
| 16 |
-
|
| 17 |
-
.card {
|
| 18 |
-
margin: auto;
|
| 19 |
-
background-color: #2c2c3e;
|
| 20 |
-
color: #f5f5f5;
|
| 21 |
-
border: none;
|
| 22 |
-
width: 50%;
|
| 23 |
-
max-height: calc(50vh - 50px);
|
| 24 |
-
overflow-y: auto;
|
| 25 |
-
}
|
| 26 |
-
|
| 27 |
-
.card-header {
|
| 28 |
-
background-color: #181831;
|
| 29 |
-
border-bottom: 2px solid #444;
|
| 30 |
-
padding: 1rem;
|
| 31 |
-
text-align: center;
|
| 32 |
-
position: sticky;
|
| 33 |
-
top: 0;
|
| 34 |
-
z-index: 1000;
|
| 35 |
-
}
|
| 36 |
-
|
| 37 |
-
.text-muted {
|
| 38 |
-
color: rgb(121 136 151 / 75%) !important;
|
| 39 |
-
}
|
| 40 |
-
|
| 41 |
-
.form-label {
|
| 42 |
-
font-weight: bold;
|
| 43 |
-
color: #cfcfcf;
|
| 44 |
-
}
|
| 45 |
-
|
| 46 |
-
.form-control {
|
| 47 |
-
background-color: #1e1e2f;
|
| 48 |
-
color: #f5f5f5;
|
| 49 |
-
border: 1px solid #444;
|
| 50 |
-
}
|
| 51 |
-
|
| 52 |
-
.form-control:focus {
|
| 53 |
-
background-color: #1e1e2f;
|
| 54 |
-
color: #f5f5f5;
|
| 55 |
-
border-color: #4c4cff;
|
| 56 |
-
box-shadow: 0 0 4px #4c4cff;
|
| 57 |
-
}
|
| 58 |
-
|
| 59 |
-
.btn-primary {
|
| 60 |
-
background-color: #4c4cff;
|
| 61 |
-
border-color: #4c4cff;
|
| 62 |
-
}
|
| 63 |
-
|
| 64 |
-
.btn-primary:hover {
|
| 65 |
-
background-color: #3838e8;
|
| 66 |
-
border-color: #3838e8;
|
| 67 |
-
}
|
| 68 |
-
|
| 69 |
-
.card::-webkit-scrollbar {
|
| 70 |
-
width: 8px;
|
| 71 |
-
}
|
| 72 |
-
|
| 73 |
-
.card::-webkit-scrollbar-thumb {
|
| 74 |
-
background-color: #444;
|
| 75 |
-
border-radius: 4px;
|
| 76 |
-
}
|
| 77 |
-
</style>
|
| 78 |
-
|
| 79 |
-
<div class="container mt-5">
|
| 80 |
-
<div class="card shadow">
|
| 81 |
-
<div class="card-header">
|
| 82 |
-
<h3>Update the Vector Database</h3>
|
| 83 |
-
</div>
|
| 84 |
-
<div class="card-body">
|
| 85 |
-
<form method="post" enctype="multipart/form-data">
|
| 86 |
-
<!-- Database Name Display -->
|
| 87 |
-
<div class="form-group">
|
| 88 |
-
<label for="db_name" class="form-label">Database Name</label>
|
| 89 |
-
<input type="text" id="db_name" name="db_name" class="form-control" value="{{ db_name }}" readonly>
|
| 90 |
-
</div>
|
| 91 |
-
|
| 92 |
-
<!-- File or Folder Upload -->
|
| 93 |
-
<div class="form-group mt-3">
|
| 94 |
-
<label for="files" class="form-label">Upload Files or Folder</label>
|
| 95 |
-
<input type="file" id="files" name="files" class="form-control" webkitdirectory directory multiple>
|
| 96 |
-
<small class="text-muted">Note: You can upload multiple files, a folder, or a single file.</small>
|
| 97 |
-
</div>
|
| 98 |
-
|
| 99 |
-
<!-- Submit Button -->
|
| 100 |
-
<div class="mt-4 text-center">
|
| 101 |
-
<button type="submit" class="btn btn-primary px-5">Update</button>
|
| 102 |
-
</div>
|
| 103 |
-
</form>
|
| 104 |
-
</div>
|
| 105 |
-
</div>
|
| 106 |
-
</div>
|
| 107 |
-
{% endblock %}
|
|
|
|
| 1 |
+
{% extends 'base.html' %}
|
| 2 |
+
|
| 3 |
+
{% block content %}
|
| 4 |
+
<style>
|
| 5 |
+
html, body {
|
| 6 |
+
height: 100%;
|
| 7 |
+
margin: 0;
|
| 8 |
+
}
|
| 9 |
+
|
| 10 |
+
.container {
|
| 11 |
+
display: flex;
|
| 12 |
+
flex-direction: column;
|
| 13 |
+
height: 50vh;
|
| 14 |
+
overflow: hidden;
|
| 15 |
+
}
|
| 16 |
+
|
| 17 |
+
.card {
|
| 18 |
+
margin: auto;
|
| 19 |
+
background-color: #2c2c3e;
|
| 20 |
+
color: #f5f5f5;
|
| 21 |
+
border: none;
|
| 22 |
+
width: 50%;
|
| 23 |
+
max-height: calc(50vh - 50px);
|
| 24 |
+
overflow-y: auto;
|
| 25 |
+
}
|
| 26 |
+
|
| 27 |
+
.card-header {
|
| 28 |
+
background-color: #181831;
|
| 29 |
+
border-bottom: 2px solid #444;
|
| 30 |
+
padding: 1rem;
|
| 31 |
+
text-align: center;
|
| 32 |
+
position: sticky;
|
| 33 |
+
top: 0;
|
| 34 |
+
z-index: 1000;
|
| 35 |
+
}
|
| 36 |
+
|
| 37 |
+
.text-muted {
|
| 38 |
+
color: rgb(121 136 151 / 75%) !important;
|
| 39 |
+
}
|
| 40 |
+
|
| 41 |
+
.form-label {
|
| 42 |
+
font-weight: bold;
|
| 43 |
+
color: #cfcfcf;
|
| 44 |
+
}
|
| 45 |
+
|
| 46 |
+
.form-control {
|
| 47 |
+
background-color: #1e1e2f;
|
| 48 |
+
color: #f5f5f5;
|
| 49 |
+
border: 1px solid #444;
|
| 50 |
+
}
|
| 51 |
+
|
| 52 |
+
.form-control:focus {
|
| 53 |
+
background-color: #1e1e2f;
|
| 54 |
+
color: #f5f5f5;
|
| 55 |
+
border-color: #4c4cff;
|
| 56 |
+
box-shadow: 0 0 4px #4c4cff;
|
| 57 |
+
}
|
| 58 |
+
|
| 59 |
+
.btn-primary {
|
| 60 |
+
background-color: #4c4cff;
|
| 61 |
+
border-color: #4c4cff;
|
| 62 |
+
}
|
| 63 |
+
|
| 64 |
+
.btn-primary:hover {
|
| 65 |
+
background-color: #3838e8;
|
| 66 |
+
border-color: #3838e8;
|
| 67 |
+
}
|
| 68 |
+
|
| 69 |
+
.card::-webkit-scrollbar {
|
| 70 |
+
width: 8px;
|
| 71 |
+
}
|
| 72 |
+
|
| 73 |
+
.card::-webkit-scrollbar-thumb {
|
| 74 |
+
background-color: #444;
|
| 75 |
+
border-radius: 4px;
|
| 76 |
+
}
|
| 77 |
+
</style>
|
| 78 |
+
|
| 79 |
+
<div class="container mt-5">
|
| 80 |
+
<div class="card shadow">
|
| 81 |
+
<div class="card-header">
|
| 82 |
+
<h3>Update the Vector Database</h3>
|
| 83 |
+
</div>
|
| 84 |
+
<div class="card-body">
|
| 85 |
+
<form method="post" enctype="multipart/form-data">
|
| 86 |
+
<!-- Database Name Display -->
|
| 87 |
+
<div class="form-group">
|
| 88 |
+
<label for="db_name" class="form-label">Database Name</label>
|
| 89 |
+
<input type="text" id="db_name" name="db_name" class="form-control" value="{{ db_name }}" readonly>
|
| 90 |
+
</div>
|
| 91 |
+
|
| 92 |
+
<!-- File or Folder Upload -->
|
| 93 |
+
<div class="form-group mt-3">
|
| 94 |
+
<label for="files" class="form-label">Upload Files or Folder</label>
|
| 95 |
+
<input type="file" id="files" name="files" class="form-control" webkitdirectory directory multiple>
|
| 96 |
+
<small class="text-muted">Note: You can upload multiple files, a folder, or a single file.</small>
|
| 97 |
+
</div>
|
| 98 |
+
|
| 99 |
+
<!-- Submit Button -->
|
| 100 |
+
<div class="mt-4 text-center">
|
| 101 |
+
<button type="submit" class="btn btn-primary px-5">Update</button>
|
| 102 |
+
</div>
|
| 103 |
+
</form>
|
| 104 |
+
</div>
|
| 105 |
+
</div>
|
| 106 |
+
</div>
|
| 107 |
+
{% endblock %}
|