Spaces:
Running
Running
Update templates/update_db.html
Browse files- templates/update_db.html +22 -63
templates/update_db.html
CHANGED
@@ -2,7 +2,6 @@
|
|
2 |
|
3 |
{% block content %}
|
4 |
<style>
|
5 |
-
/* Ensure the body takes full height for proper layout */
|
6 |
html, body {
|
7 |
height: 100%;
|
8 |
margin: 0;
|
@@ -11,8 +10,8 @@
|
|
11 |
.container {
|
12 |
display: flex;
|
13 |
flex-direction: column;
|
14 |
-
height: 50vh;
|
15 |
-
overflow: hidden;
|
16 |
}
|
17 |
|
18 |
.card {
|
@@ -20,9 +19,9 @@
|
|
20 |
background-color: #2c2c3e;
|
21 |
color: #f5f5f5;
|
22 |
border: none;
|
23 |
-
width: 50%;
|
24 |
-
max-height: calc(50vh - 50px);
|
25 |
-
overflow-y: auto;
|
26 |
}
|
27 |
|
28 |
.card-header {
|
@@ -30,13 +29,12 @@
|
|
30 |
border-bottom: 2px solid #444;
|
31 |
padding: 1rem;
|
32 |
text-align: center;
|
33 |
-
position: sticky;
|
34 |
top: 0;
|
35 |
-
z-index: 1000;
|
36 |
}
|
37 |
|
38 |
.text-muted {
|
39 |
-
--bs-text-opacity: 1;
|
40 |
color: rgb(121 136 151 / 75%) !important;
|
41 |
}
|
42 |
|
@@ -61,10 +59,6 @@
|
|
61 |
.btn-primary {
|
62 |
background-color: #4c4cff;
|
63 |
border-color: #4c4cff;
|
64 |
-
display: flex;
|
65 |
-
justify-content: center;
|
66 |
-
align-items: center;
|
67 |
-
position: relative;
|
68 |
}
|
69 |
|
70 |
.btn-primary:hover {
|
@@ -72,77 +66,42 @@
|
|
72 |
border-color: #3838e8;
|
73 |
}
|
74 |
|
75 |
-
|
76 |
-
|
77 |
-
display: none; /* Hidden by default */
|
78 |
-
width: 20px;
|
79 |
-
height: 20px;
|
80 |
-
border: 3px solid #f3f3f3;
|
81 |
-
border-top: 3px solid #ffffff;
|
82 |
-
border-radius: 50%;
|
83 |
-
animation: spin 1s linear infinite;
|
84 |
-
margin-left: 10px; /* Space between button text and loader */
|
85 |
-
}
|
86 |
-
|
87 |
-
.btn-loading .button-spinner {
|
88 |
-
display: inline-block; /* Show spinner when loading */
|
89 |
-
}
|
90 |
-
|
91 |
-
@keyframes spin {
|
92 |
-
0% {
|
93 |
-
transform: rotate(0deg);
|
94 |
-
}
|
95 |
-
100% {
|
96 |
-
transform: rotate(360deg);
|
97 |
-
}
|
98 |
}
|
99 |
|
100 |
-
.
|
101 |
-
|
|
|
102 |
}
|
103 |
</style>
|
104 |
|
105 |
<div class="container mt-5">
|
106 |
<div class="card shadow">
|
107 |
<div class="card-header">
|
108 |
-
<h3>
|
109 |
</div>
|
110 |
<div class="card-body">
|
111 |
-
<form
|
112 |
-
<!-- Database Name
|
113 |
<div class="form-group">
|
114 |
<label for="db_name" class="form-label">Database Name</label>
|
115 |
-
<input type="text" id="db_name" name="db_name" class="form-control"
|
116 |
</div>
|
117 |
|
118 |
-
<!-- Folder Upload
|
119 |
<div class="form-group mt-3">
|
120 |
-
<label for="
|
121 |
-
<input type="file" id="
|
122 |
-
<small class="text-muted">Note: You can upload folder
|
123 |
</div>
|
124 |
|
125 |
<!-- Submit Button -->
|
126 |
<div class="mt-4 text-center">
|
127 |
-
<button type="submit" class="btn btn-primary px-5">
|
128 |
-
<span class="btn-text">Create</span>
|
129 |
-
<div class="button-spinner"></div>
|
130 |
-
</button>
|
131 |
</div>
|
132 |
</form>
|
133 |
</div>
|
134 |
</div>
|
135 |
</div>
|
136 |
-
|
137 |
-
<script>
|
138 |
-
// Show loader on button click
|
139 |
-
const form = document.getElementById('db-form');
|
140 |
-
const submitButton = document.querySelector('.btn-primary');
|
141 |
-
|
142 |
-
form.addEventListener('submit', function (event) {
|
143 |
-
submitButton.classList.add('btn-loading'); // Add loading class
|
144 |
-
submitButton.disabled = true; // Disable button to prevent multiple clicks
|
145 |
-
});
|
146 |
-
</script>
|
147 |
-
|
148 |
-
{% endblock %}
|
|
|
2 |
|
3 |
{% block content %}
|
4 |
<style>
|
|
|
5 |
html, body {
|
6 |
height: 100%;
|
7 |
margin: 0;
|
|
|
10 |
.container {
|
11 |
display: flex;
|
12 |
flex-direction: column;
|
13 |
+
height: 50vh;
|
14 |
+
overflow: hidden;
|
15 |
}
|
16 |
|
17 |
.card {
|
|
|
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 {
|
|
|
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 |
|
|
|
59 |
.btn-primary {
|
60 |
background-color: #4c4cff;
|
61 |
border-color: #4c4cff;
|
|
|
|
|
|
|
|
|
62 |
}
|
63 |
|
64 |
.btn-primary:hover {
|
|
|
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 %}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|