upgraded ui

This commit is contained in:
Saifeddine ALOUI
2024-03-24 15:39:42 +01:00
parent fb66c9c179
commit 8aa3c4eb40
7 changed files with 19 additions and 9 deletions

View File

@ -14,7 +14,7 @@ from starlette.responses import StreamingResponse
from lollms.types import MSG_TYPE
from lollms.main_config import BaseConfig
from lollms.utilities import detect_antiprompt, remove_text_from_string, trace_exception, show_yes_no_dialog
from lollms.security import sanitize_path
from lollms.security import sanitize_path, forbid_remote_access
from ascii_colors import ASCIIColors
from lollms.databases.discussions_database import DiscussionsDB
from pathlib import Path
@ -146,6 +146,7 @@ async def open_file(file_path: FilePath):
if not show_yes_no_dialog("Validation","Do you validate the opening of a file?"):
return {"status":False,"error":"User refused the opeining file!"}
forbid_remote_access(lollmsElfServer)
try:
# Validate the 'path' parameter
path = sanitize_path(file_path.path)