mirror of
https://github.com/ParisNeo/lollms-webui.git
synced 2025-04-24 04:55:44 +00:00
Added folders links
This commit is contained in:
parent
a4b79372ea
commit
9f76c54b96
@ -800,3 +800,42 @@ async def get_available_voices():
|
||||
return JSONResponse(content={"voices": voices})
|
||||
except Exception as e:
|
||||
return JSONResponse(content={"error": str(e)}, status_code=500)
|
||||
|
||||
|
||||
|
||||
|
||||
class PersonalFolderRequest(BaseModel):
|
||||
client_id: str = Field(...)
|
||||
folder:str = Field(...)
|
||||
|
||||
@router.post("/open_personal_folder")
|
||||
async def open_personality_folder(request: PersonalFolderRequest):
|
||||
"""
|
||||
Opens a personal data folder.
|
||||
|
||||
:param request: The HTTP request object.
|
||||
:return: A JSON response with the status of the operation.
|
||||
"""
|
||||
client = check_access(lollmsElfServer, request.client_id)
|
||||
if(request.folder=="custom-personalities"):
|
||||
root_folder = lollmsElfServer.lollms_paths.custom_personalities_path
|
||||
elif(request.folder=="custom-function-calls"):
|
||||
root_folder = lollmsElfServer.lollms_paths.custom_function_calls_path
|
||||
elif(request.folder=="configurations"):
|
||||
root_folder = lollmsElfServer.lollms_paths.personal_configuration_path
|
||||
elif(request.folder=="ai-outputs"):
|
||||
root_folder = lollmsElfServer.lollms_paths.personal_outputs_path
|
||||
elif(request.folder=="discussions"):
|
||||
root_folder = lollmsElfServer.lollms_paths.personal_discussions_path
|
||||
else:
|
||||
return JSONResponse(content={"error": "Unknown folder"})
|
||||
|
||||
|
||||
if platform.system() == "Windows":
|
||||
subprocess.Popen(f'explorer "{root_folder}"')
|
||||
elif platform.system() == "Linux":
|
||||
subprocess.run(["xdg-open", str(root_folder)], check=True)
|
||||
elif platform.system() == "Darwin":
|
||||
subprocess.run(["open", str(root_folder)], check=True)
|
||||
return {"status": True, "execution_time": 0}
|
||||
|
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
4
web/dist/index.html
vendored
4
web/dist/index.html
vendored
@ -6,8 +6,8 @@
|
||||
<script src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-svg.js"></script>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>LoLLMS WebUI</title>
|
||||
<script type="module" crossorigin src="/assets/index-D1iX16Nx.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/index-B3U3p_X4.css">
|
||||
<script type="module" crossorigin src="/assets/index-D7nFglZa.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/index-DU4gMD8c.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user