Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -295,22 +295,6 @@ def list_dbs():
|
|
295 |
return redirect(url_for('create_db'))
|
296 |
return render_template('list_dbs.html', vector_dbs=vector_dbs)
|
297 |
|
298 |
-
# @app.route('/list-docs/<db_name>/<opts>', methods=['GET','POST'])
|
299 |
-
# def list_docs(db_name,opts):
|
300 |
-
# try:
|
301 |
-
# if opts=='delete':
|
302 |
-
# return redirect(url_for('delete_doc', db_name=db_name))
|
303 |
-
# elif opts=='update':
|
304 |
-
# return redirect(url_for('update_db', db_name=db_name))
|
305 |
-
# else:
|
306 |
-
# return "URL not found",404
|
307 |
-
|
308 |
-
# except Exception as e:
|
309 |
-
# # By this way we can know about the type of error occurring
|
310 |
-
# print("The error is: ",e)
|
311 |
-
# print(f"unexpected error to list the document in the {db_name}")
|
312 |
-
# return redirect(url_for('modify_db', db_name=db_name))
|
313 |
-
|
314 |
@app.route('/select-db/<db_name>', methods=['POST'])
|
315 |
def select_db(db_name):
|
316 |
flash(f"{db_name} Database has been selected", "success")
|
@@ -352,9 +336,9 @@ def update_db(db_name):
|
|
352 |
try:
|
353 |
if db_name and request.method == 'POST':
|
354 |
print(db_name)
|
355 |
-
#vector DB name is db_name
|
|
|
356 |
# Get all files from the uploaded folder
|
357 |
-
# Get uploaded files
|
358 |
files = request.files.getlist('folder') # Folder uploads (multiple files)
|
359 |
single_files = request.files.getlist('file') # Single file uploads
|
360 |
|
|
|
295 |
return redirect(url_for('create_db'))
|
296 |
return render_template('list_dbs.html', vector_dbs=vector_dbs)
|
297 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
298 |
@app.route('/select-db/<db_name>', methods=['POST'])
|
299 |
def select_db(db_name):
|
300 |
flash(f"{db_name} Database has been selected", "success")
|
|
|
336 |
try:
|
337 |
if db_name and request.method == 'POST':
|
338 |
print(db_name)
|
339 |
+
#vector DB name is db_name
|
340 |
+
|
341 |
# Get all files from the uploaded folder
|
|
|
342 |
files = request.files.getlist('folder') # Folder uploads (multiple files)
|
343 |
single_files = request.files.getlist('file') # Single file uploads
|
344 |
|