mirror of
https://github.com/ParisNeo/lollms-webui.git
synced 2025-02-11 13:05:22 +00:00
Fixed apps zoo
This commit is contained in:
parent
019a69fb01
commit
dd0c3888cb
@ -24,9 +24,10 @@ class AuthRequest(BaseModel):
|
|||||||
client_id: str
|
client_id: str
|
||||||
|
|
||||||
class AppInfo:
|
class AppInfo:
|
||||||
def __init__(self, uid: str, name: str, icon: str, category:str, description: str, author:str, version:str, model_name:str, disclaimer:str):
|
def __init__(self, uid: str, name: str, folder_name: str, icon: str, category:str, description: str, author:str, version:str, model_name:str, disclaimer:str, installed: bool):
|
||||||
self.uid = uid
|
self.uid = uid
|
||||||
self.name = name
|
self.name = name
|
||||||
|
self.folder_name = folder_name
|
||||||
self.icon = icon
|
self.icon = icon
|
||||||
self.category = category
|
self.category = category
|
||||||
self.description = description
|
self.description = description
|
||||||
@ -34,6 +35,7 @@ class AppInfo:
|
|||||||
self.version = version
|
self.version = version
|
||||||
self.model_name = model_name
|
self.model_name = model_name
|
||||||
self.disclaimer = disclaimer
|
self.disclaimer = disclaimer
|
||||||
|
self.installed = installed
|
||||||
|
|
||||||
@router.get("/apps")
|
@router.get("/apps")
|
||||||
async def list_apps():
|
async def list_apps():
|
||||||
@ -60,19 +62,24 @@ async def list_apps():
|
|||||||
version = data.get('version', '')
|
version = data.get('version', '')
|
||||||
model_name = data.get('model_name', '')
|
model_name = data.get('model_name', '')
|
||||||
disclaimer = data.get('disclaimer', 'No disclaimer provided.')
|
disclaimer = data.get('disclaimer', 'No disclaimer provided.')
|
||||||
|
installed = True
|
||||||
|
else:
|
||||||
|
installed = False
|
||||||
|
|
||||||
if icon_path.exists():
|
if icon_path.exists():
|
||||||
uid = str(uuid.uuid4())
|
uid = str(uuid.uuid4())
|
||||||
apps.append(AppInfo(
|
apps.append(AppInfo(
|
||||||
uid=uid,
|
uid=uid,
|
||||||
name=application_name,
|
name=application_name,
|
||||||
|
folder_name = app_name.name,
|
||||||
icon=f"/apps/{app_name.name}/icon",
|
icon=f"/apps/{app_name.name}/icon",
|
||||||
category=category,
|
category=category,
|
||||||
description=description,
|
description=description,
|
||||||
author=author,
|
author=author,
|
||||||
version=version,
|
version=version,
|
||||||
model_name=model_name,
|
model_name=model_name,
|
||||||
disclaimer=disclaimer
|
disclaimer=disclaimer,
|
||||||
|
installed=installed
|
||||||
))
|
))
|
||||||
|
|
||||||
return apps
|
return apps
|
||||||
@ -205,14 +212,16 @@ def load_apps_data():
|
|||||||
description_data = yaml.safe_load(file)
|
description_data = yaml.safe_load(file)
|
||||||
apps.append(AppInfo(
|
apps.append(AppInfo(
|
||||||
uid=str(uuid.uuid4()),
|
uid=str(uuid.uuid4()),
|
||||||
name=item,
|
name=description_data.get("name",item),
|
||||||
|
folder_name=item,
|
||||||
icon=icon_url,
|
icon=icon_url,
|
||||||
category=description_data.get('category', 'generic'),
|
category=description_data.get('category', 'generic'),
|
||||||
description=description_data.get('description', ''),
|
description=description_data.get('description', ''),
|
||||||
author=description_data.get('author', ''),
|
author=description_data.get('author', ''),
|
||||||
version=description_data.get('version', ''),
|
version=description_data.get('version', ''),
|
||||||
model_name=description_data.get('model_name', ''),
|
model_name=description_data.get('model_name', ''),
|
||||||
disclaimer=description_data.get('disclaimer', 'No disclaimer provided.')
|
disclaimer=description_data.get('disclaimer', 'No disclaimer provided.'),
|
||||||
|
installed=True
|
||||||
))
|
))
|
||||||
return apps
|
return apps
|
||||||
|
|
||||||
|
File diff suppressed because one or more lines are too long
2
web/dist/index.html
vendored
2
web/dist/index.html
vendored
@ -6,7 +6,7 @@
|
|||||||
<script src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-svg.js"></script>
|
<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">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<title>LoLLMS WebUI</title>
|
<title>LoLLMS WebUI</title>
|
||||||
<script type="module" crossorigin src="/assets/index-c8b4e1bc.js"></script>
|
<script type="module" crossorigin src="/assets/index-6a853d50.js"></script>
|
||||||
<link rel="stylesheet" href="/assets/index-5b307d27.css">
|
<link rel="stylesheet" href="/assets/index-5b307d27.css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
@ -192,12 +192,12 @@ export default {
|
|||||||
async handleAppClick(app) {
|
async handleAppClick(app) {
|
||||||
if (app.installed) {
|
if (app.installed) {
|
||||||
this.selectedApp = app;
|
this.selectedApp = app;
|
||||||
const response = await axios.post(`/apps/${app.name}/code`, {
|
const response = await axios.post(`/apps/${app.folder_name}/code`, {
|
||||||
client_id: this.$store.state.client_id,
|
client_id: this.$store.state.client_id,
|
||||||
});
|
});
|
||||||
this.appCode = response.data;
|
this.appCode = response.data;
|
||||||
} else {
|
} else {
|
||||||
this.showMessage(`Please install ${app.name} to view its code.`, false);
|
this.showMessage(`Please install ${app.folder_name} to view its code.`, false);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
backToZoo() {
|
backToZoo() {
|
||||||
@ -252,7 +252,7 @@ export default {
|
|||||||
try {
|
try {
|
||||||
const response = await axios.post('/open_app_in_vscode', {
|
const response = await axios.post('/open_app_in_vscode', {
|
||||||
client_id: this.$store.state.client_id,
|
client_id: this.$store.state.client_id,
|
||||||
app_name: app.name,
|
app_name: app.folder_name,
|
||||||
});
|
});
|
||||||
this.showMessage(response.data.message, true);
|
this.showMessage(response.data.message, true);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user