added uninstyalled apps selection

This commit is contained in:
Saifeddine ALOUI 2024-10-01 23:21:12 +02:00
parent 09de3b4e4a
commit 2b49ec2cd0
6 changed files with 62 additions and 35 deletions

View File

@ -225,6 +225,17 @@ async def get_app_file(app_name: str, file: str):
raise HTTPException(status_code=404, detail="App file not found")
return FileResponse(app_path)
@router.get("/apps/{app_name}/{subfolder}/{file}")
async def get_app_file(app_name: str, subfolder: str, file: str):
app_name=sanitize_path(app_name)
subfolder=sanitize_path(subfolder)
file=sanitize_path(file)
app_path = lollmsElfServer.lollms_paths.apps_zoo_path / app_name / subfolder / file
if not app_path.exists():
raise HTTPException(status_code=404, detail="App file not found")
return FileResponse(app_path)
class AppNameInput(BaseModel):
client_id: str
app_name: str

@ -1 +1 @@
Subproject commit 295d4a9d00fc1b02d1359fc13794828bb56ee22d
Subproject commit 2fcdb883964218ab33e454b29be89084e47e1722

File diff suppressed because one or more lines are too long

2
web/dist/index.html vendored
View File

@ -6,7 +6,7 @@
<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-TXQPtYpQ.js"></script>
<script type="module" crossorigin src="/assets/index-svgg6vOM.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-Cnmm4GFs.css">
</head>
<body>

View File

@ -67,6 +67,15 @@
>
Show only installed apps
</label>
<label for="installed-only" class="font-semibold">
<input
id="uninstalled-only"
type="checkbox"
v-model="showOnlyUnInstalled"
class="mr-2"
>
Show only non installed apps
</label>
</div>
<div class="flex items-center space-x-4">
<label for="sort-select" class="font-semibold">Sort by:</label>
@ -176,6 +185,7 @@ export default {
sortBy: 'update',
sortOrder: 'desc',
showOnlyInstalled: false,
showOnlyUnInstalled: false,
};
},
computed: {
@ -199,14 +209,20 @@ export default {
},
filteredApps() {
return this.combinedApps.filter(app => {
const matchesSearch = app.name.toLowerCase().includes(this.searchQuery.toLowerCase()) ||
const matchesSearch = app.name.toLowerCase().includes(this.toLowerCase()) ||
app.description.toLowerCase().includes(this.searchQuery.toLowerCase()) ||
app.author.toLowerCase().includes(this.searchQuery.toLowerCase());
const matchesCategory = this.selectedCategory === 'all' || app.category === this.selectedCategory;
const matchesInstalled = !this.showOnlyInstalled || app.installed;
// Adjusting the installed logic to account for both showOnlyInstalled and showOnlyUnInstalled
const matchesInstalled = (this.showOnlyInstalled && app.installed) ||
(this.showOnlyUnInstalled && !app.installed) ||
(!this.showOnlyInstalled && !this.showOnlyUnInstalled);
return matchesSearch && matchesCategory && matchesInstalled;
});
},
sortedAndFilteredApps() {
return this.filteredApps.sort((a, b) => {
let comparison = 0;

@ -1 +1 @@
Subproject commit 302416341efe683e9134549ee9771147c21194dd
Subproject commit 43ae22ec9c0207a4e7de1303ca34483dce10b8f4