Spaces:
Running
Running
Upload 7 files
Browse files- templates/base.html +14 -4
- templates/chat.html +94 -4
- templates/create_db.html +104 -26
- templates/list_dbs.html +121 -15
- templates/modify_db.html +44 -0
- templates/update_db.html +107 -0
templates/base.html
CHANGED
|
@@ -65,9 +65,19 @@
|
|
| 65 |
}
|
| 66 |
|
| 67 |
footer {
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 71 |
}
|
| 72 |
</style>
|
| 73 |
</head>
|
|
@@ -108,7 +118,7 @@
|
|
| 108 |
</div>
|
| 109 |
|
| 110 |
<!-- Footer -->
|
| 111 |
-
<footer>
|
| 112 |
<p>© 2024 Document AI. All rights reserved.</p>
|
| 113 |
</footer>
|
| 114 |
|
|
|
|
| 65 |
}
|
| 66 |
|
| 67 |
footer {
|
| 68 |
+
background-color: #2c2c3e;
|
| 69 |
+
color: #888;
|
| 70 |
+
padding: 10px 0;
|
| 71 |
+
text-align: center;
|
| 72 |
+
position: fixed;
|
| 73 |
+
width: 100%;
|
| 74 |
+
bottom: 0;
|
| 75 |
+
border-top: 2px solid #444;
|
| 76 |
+
}
|
| 77 |
+
|
| 78 |
+
footer p {
|
| 79 |
+
margin: 0;
|
| 80 |
+
font-size: 14px;
|
| 81 |
}
|
| 82 |
</style>
|
| 83 |
</head>
|
|
|
|
| 118 |
</div>
|
| 119 |
|
| 120 |
<!-- Footer -->
|
| 121 |
+
<footer class="fixed-bottom">
|
| 122 |
<p>© 2024 Document AI. All rights reserved.</p>
|
| 123 |
</footer>
|
| 124 |
|
templates/chat.html
CHANGED
|
@@ -2,6 +2,98 @@
|
|
| 2 |
|
| 3 |
{% block content %}
|
| 4 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
<div class="container">
|
| 6 |
<div class="row justify-content-center">
|
| 7 |
<!-- Left Pane -->
|
|
@@ -43,15 +135,12 @@
|
|
| 43 |
<div class="question">
|
| 44 |
<strong>Query:</strong> {{ question }}
|
| 45 |
</div>
|
| 46 |
-
<
|
| 47 |
<div class="answer mt-2">
|
| 48 |
<strong>Answer:</strong> {{ answer }}
|
| 49 |
</div>
|
| 50 |
</div>
|
| 51 |
</div>
|
| 52 |
-
<!-- {% if not loop.last %}
|
| 53 |
-
<hr>
|
| 54 |
-
{% endif %} -->
|
| 55 |
{% endfor %}
|
| 56 |
</div>
|
| 57 |
</div>
|
|
@@ -59,4 +148,5 @@
|
|
| 59 |
</div>
|
| 60 |
</div>
|
| 61 |
</div>
|
|
|
|
| 62 |
{% endblock %}
|
|
|
|
| 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 |
+
.container {
|
| 14 |
+
display: flex;
|
| 15 |
+
height: 50vh; /* Locks the height of the containers */
|
| 16 |
+
margin-top: 50px;
|
| 17 |
+
}
|
| 18 |
+
|
| 19 |
+
/* Styling for left and right panes */
|
| 20 |
+
.card {
|
| 21 |
+
height: 100%; /* Ensures cards fill the container height */
|
| 22 |
+
overflow: hidden; /* Prevents overflow of content */
|
| 23 |
+
}
|
| 24 |
+
|
| 25 |
+
.row {
|
| 26 |
+
height: 100%; /* Ensures the row fills the container */
|
| 27 |
+
margin: auto;
|
| 28 |
+
}
|
| 29 |
+
|
| 30 |
+
.col-md-5 {
|
| 31 |
+
display: flex;
|
| 32 |
+
flex-direction: column;
|
| 33 |
+
gap: 20px; /* Adds space between left and right containers */
|
| 34 |
+
max-height: 100%;
|
| 35 |
+
}
|
| 36 |
+
|
| 37 |
+
.card-body {
|
| 38 |
+
display: flex;
|
| 39 |
+
flex-direction: column;
|
| 40 |
+
height: auto; /* Occupies full height of the card */
|
| 41 |
+
}
|
| 42 |
+
|
| 43 |
+
/* Scrollable left pane's history section */
|
| 44 |
+
.history-section {
|
| 45 |
+
overflow-y: auto; /* Adds vertical scrolling */
|
| 46 |
+
flex: 1; /* Ensures this section takes up remaining space */
|
| 47 |
+
overflow-x: hidden;
|
| 48 |
+
}
|
| 49 |
+
|
| 50 |
+
/* Scrollbar customization */
|
| 51 |
+
.history-section::-webkit-scrollbar {
|
| 52 |
+
width: 8px;
|
| 53 |
+
}
|
| 54 |
+
|
| 55 |
+
.history-section::-webkit-scrollbar-thumb {
|
| 56 |
+
background-color: #888;
|
| 57 |
+
border-radius: 4px;
|
| 58 |
+
}
|
| 59 |
+
|
| 60 |
+
.history-section::-webkit-scrollbar-thumb:hover {
|
| 61 |
+
background-color: #555;
|
| 62 |
+
}
|
| 63 |
+
|
| 64 |
+
.history-section::-webkit-scrollbar-track {
|
| 65 |
+
background-color: #f1f1f1;
|
| 66 |
+
}
|
| 67 |
+
|
| 68 |
+
/* Space between left and right columns */
|
| 69 |
+
.row > .col-md-5:not(:last-child) {
|
| 70 |
+
margin-right: 20px; /* Adds space between left and right pane */
|
| 71 |
+
}
|
| 72 |
+
|
| 73 |
+
/* Form input and button adjustments */
|
| 74 |
+
.form-group input {
|
| 75 |
+
border-radius: 4px;
|
| 76 |
+
}
|
| 77 |
+
|
| 78 |
+
.btn-primary {
|
| 79 |
+
background-color: #007bff;
|
| 80 |
+
border-color: #007bff;
|
| 81 |
+
}
|
| 82 |
+
|
| 83 |
+
.btn-primary:hover {
|
| 84 |
+
background-color: #0056b3;
|
| 85 |
+
border-color: #0056b3;
|
| 86 |
+
}
|
| 87 |
+
|
| 88 |
+
/* Scrollable left section for queries */
|
| 89 |
+
.answer-section {
|
| 90 |
+
background: #2c2c3e;
|
| 91 |
+
padding: 10px;
|
| 92 |
+
border-radius: 4px;
|
| 93 |
+
border: 1px solid #2c2c3e;
|
| 94 |
+
}
|
| 95 |
+
</style>
|
| 96 |
+
|
| 97 |
<div class="container">
|
| 98 |
<div class="row justify-content-center">
|
| 99 |
<!-- Left Pane -->
|
|
|
|
| 135 |
<div class="question">
|
| 136 |
<strong>Query:</strong> {{ question }}
|
| 137 |
</div>
|
| 138 |
+
<hr>
|
| 139 |
<div class="answer mt-2">
|
| 140 |
<strong>Answer:</strong> {{ answer }}
|
| 141 |
</div>
|
| 142 |
</div>
|
| 143 |
</div>
|
|
|
|
|
|
|
|
|
|
| 144 |
{% endfor %}
|
| 145 |
</div>
|
| 146 |
</div>
|
|
|
|
| 148 |
</div>
|
| 149 |
</div>
|
| 150 |
</div>
|
| 151 |
+
|
| 152 |
{% endblock %}
|
templates/create_db.html
CHANGED
|
@@ -1,32 +1,110 @@
|
|
| 1 |
{% extends 'base.html' %}
|
| 2 |
|
| 3 |
{% block content %}
|
| 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 |
</div>
|
| 31 |
</div>
|
|
|
|
| 32 |
{% endblock %}
|
|
|
|
| 1 |
{% extends 'base.html' %}
|
| 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;
|
| 9 |
+
}
|
| 10 |
+
|
| 11 |
+
.container {
|
| 12 |
+
display: flex;
|
| 13 |
+
flex-direction: column;
|
| 14 |
+
height: 50vh; /* Full height of the viewport */
|
| 15 |
+
overflow: hidden; /* Prevent extra scrollbars */
|
| 16 |
+
}
|
| 17 |
+
|
| 18 |
+
.card {
|
| 19 |
+
margin: auto;
|
| 20 |
+
background-color: #2c2c3e;
|
| 21 |
+
color: #f5f5f5;
|
| 22 |
+
border: none;
|
| 23 |
+
width: 50%; /* Centered and appropriately sized */
|
| 24 |
+
max-height: calc(50vh - 50px); /* Adjust to fit within view */
|
| 25 |
+
overflow-y: auto; /* Add scrolling if content overflows */
|
| 26 |
+
}
|
| 27 |
+
|
| 28 |
+
.card-header {
|
| 29 |
+
background-color: #181831;
|
| 30 |
+
border-bottom: 2px solid #444;
|
| 31 |
+
padding: 1rem;
|
| 32 |
+
text-align: center;
|
| 33 |
+
position: sticky; /* Keeps header fixed */
|
| 34 |
+
top: 0;
|
| 35 |
+
z-index: 1000; /* Ensures it stays above scrollable content */
|
| 36 |
+
}
|
| 37 |
+
|
| 38 |
+
.text-muted {
|
| 39 |
+
--bs-text-opacity: 1;
|
| 40 |
+
color: rgb(121 136 151 / 75%) !important;
|
| 41 |
+
}
|
| 42 |
+
|
| 43 |
+
.form-label {
|
| 44 |
+
font-weight: bold;
|
| 45 |
+
color: #cfcfcf;
|
| 46 |
+
}
|
| 47 |
+
|
| 48 |
+
.form-control {
|
| 49 |
+
background-color: #1e1e2f;
|
| 50 |
+
color: #f5f5f5;
|
| 51 |
+
border: 1px solid #444;
|
| 52 |
+
}
|
| 53 |
+
|
| 54 |
+
.form-control:focus {
|
| 55 |
+
background-color: #1e1e2f;
|
| 56 |
+
color: #f5f5f5;
|
| 57 |
+
border-color: #4c4cff;
|
| 58 |
+
box-shadow: 0 0 4px #4c4cff;
|
| 59 |
+
}
|
| 60 |
+
|
| 61 |
+
.btn-primary {
|
| 62 |
+
background-color: #4c4cff;
|
| 63 |
+
border-color: #4c4cff;
|
| 64 |
+
}
|
| 65 |
+
|
| 66 |
+
.btn-primary:hover {
|
| 67 |
+
background-color: #3838e8;
|
| 68 |
+
border-color: #3838e8;
|
| 69 |
+
}
|
| 70 |
+
|
| 71 |
+
/* Custom scrollbar */
|
| 72 |
+
.card::-webkit-scrollbar {
|
| 73 |
+
width: 8px;
|
| 74 |
+
}
|
| 75 |
+
|
| 76 |
+
.card::-webkit-scrollbar-thumb {
|
| 77 |
+
background-color: #444;
|
| 78 |
+
border-radius: 4px;
|
| 79 |
+
}
|
| 80 |
+
</style>
|
| 81 |
+
|
| 82 |
+
<div class="container mt-5">
|
| 83 |
+
<div class="card shadow">
|
| 84 |
+
<div class="card-header">
|
| 85 |
+
<h3>Create a New Vector Database</h3>
|
| 86 |
+
</div>
|
| 87 |
+
<div class="card-body">
|
| 88 |
+
<form method="post" enctype="multipart/form-data">
|
| 89 |
+
<!-- Database Name Input -->
|
| 90 |
+
<div class="form-group">
|
| 91 |
+
<label for="db_name" class="form-label">Database Name</label>
|
| 92 |
+
<input type="text" id="db_name" name="db_name" class="form-control" placeholder="Enter database name" required>
|
| 93 |
+
</div>
|
| 94 |
+
|
| 95 |
+
<!-- Folder Upload Input -->
|
| 96 |
+
<div class="form-group mt-3">
|
| 97 |
+
<label for="folder" class="form-label">Upload Folder</label>
|
| 98 |
+
<input type="file" id="folder" name="folder" class="form-control" webkitdirectory directory multiple required>
|
| 99 |
+
<small class="text-muted">Note: You can upload folder having your documents.</small>
|
| 100 |
+
</div>
|
| 101 |
+
|
| 102 |
+
<!-- Submit Button -->
|
| 103 |
+
<div class="mt-4 text-center">
|
| 104 |
+
<button type="submit" class="btn btn-primary px-5">Create</button>
|
| 105 |
+
</div>
|
| 106 |
+
</form>
|
| 107 |
</div>
|
| 108 |
</div>
|
| 109 |
+
</div>
|
| 110 |
{% endblock %}
|
templates/list_dbs.html
CHANGED
|
@@ -1,24 +1,130 @@
|
|
| 1 |
{% extends 'base.html' %}
|
| 2 |
|
| 3 |
{% block content %}
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
<form method="post" action="{{ url_for('select_db', db_name=db) }}" class="mb-0">
|
| 16 |
<button type="submit" class="btn btn-primary btn-sm">Select</button>
|
| 17 |
</form>
|
| 18 |
-
</
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
</
|
| 22 |
</div>
|
| 23 |
</div>
|
|
|
|
| 24 |
{% endblock %}
|
|
|
|
| 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 |
+
</style>
|
| 104 |
+
|
| 105 |
+
<div class="container">
|
| 106 |
+
<div class="card shadow">
|
| 107 |
+
<div class="card-header">
|
| 108 |
+
<h3>Available Vector Databases</h3>
|
| 109 |
+
</div>
|
| 110 |
+
<div class="card-body">
|
| 111 |
+
<h4 class="text-center mb-4">Select a Vector Database</h4>
|
| 112 |
+
<ul class="list-group">
|
| 113 |
+
{% for db in vector_dbs %}
|
| 114 |
+
<li class="list-group-item">
|
| 115 |
+
<span>{{ db }}</span>
|
| 116 |
+
<div class="button-container">
|
| 117 |
+
<form method="post" action="{{ url_for('update_db', db_name=db) }}" class="mb-0">
|
| 118 |
+
<button type="submit" class="btn btn-primary btn-sm">Update</button>
|
| 119 |
+
</form>
|
| 120 |
<form method="post" action="{{ url_for('select_db', db_name=db) }}" class="mb-0">
|
| 121 |
<button type="submit" class="btn btn-primary btn-sm">Select</button>
|
| 122 |
</form>
|
| 123 |
+
</div>
|
| 124 |
+
</li>
|
| 125 |
+
{% endfor %}
|
| 126 |
+
</ul>
|
| 127 |
</div>
|
| 128 |
</div>
|
| 129 |
+
</div>
|
| 130 |
{% endblock %}
|
templates/modify_db.html
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{% extends 'base.html' %}
|
| 2 |
+
|
| 3 |
+
{% block content %}
|
| 4 |
+
<div class="row justify-content-center">
|
| 5 |
+
<div class="col-md-6">
|
| 6 |
+
<div class="card">
|
| 7 |
+
<div class="card-body">
|
| 8 |
+
<h5 class="card-title">Create a New Database</h5>
|
| 9 |
+
<p class="card-text">Upload your documents and create a vector database for retrieval.</p>
|
| 10 |
+
<a href="/create-db" class="btn btn-primary">Go to Create DB</a>
|
| 11 |
+
</div>
|
| 12 |
+
</div>
|
| 13 |
+
</div>
|
| 14 |
+
<div class="col-md-6">
|
| 15 |
+
<div class="card">
|
| 16 |
+
<div class="card-body">
|
| 17 |
+
<h5 class="card-title">Chat with AI</h5>
|
| 18 |
+
<p class="card-text">Ask questions and get answers based on your vector database.</p>
|
| 19 |
+
<a href="/list-dbs" class="btn btn-primary">Go to List of DB</a>
|
| 20 |
+
</div>
|
| 21 |
+
</div>
|
| 22 |
+
</div>
|
| 23 |
+
</div>
|
| 24 |
+
<div class="row justify-content-center">
|
| 25 |
+
<div class="col-md-6">
|
| 26 |
+
<div class="card">
|
| 27 |
+
<div class="card-body">
|
| 28 |
+
<h5 class="card-title">Create a New Database</h5>
|
| 29 |
+
<p class="card-text">Upload your documents and create a vector database for retrieval.</p>
|
| 30 |
+
<a href="/create-db" class="btn btn-primary">Go to Create DB</a>
|
| 31 |
+
</div>
|
| 32 |
+
</div>
|
| 33 |
+
</div>
|
| 34 |
+
<div class="col-md-6">
|
| 35 |
+
<div class="card">
|
| 36 |
+
<div class="card-body">
|
| 37 |
+
<h5 class="card-title">Chat with AI</h5>
|
| 38 |
+
<p class="card-text">Ask questions and get answers based on your vector database.</p>
|
| 39 |
+
<a href="/list-dbs" class="btn btn-primary">Go to List of DB</a>
|
| 40 |
+
</div>
|
| 41 |
+
</div>
|
| 42 |
+
</div>
|
| 43 |
+
</div>
|
| 44 |
+
{% endblock %}
|
templates/update_db.html
ADDED
|
@@ -0,0 +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 %}
|