mirror of
https://github.com/exo-explore/exo.git
synced 2025-10-23 02:57:14 +03:00
Add toggle to show only models downloaded locally
This commit is contained in:
@@ -43,6 +43,12 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<h2 class="megrim-regular" style="margin-bottom: 20px;">Models</h2>
|
<h2 class="megrim-regular" style="margin-bottom: 20px;">Models</h2>
|
||||||
|
<div style="display: flex; align-items: center; margin-bottom: 10px;">
|
||||||
|
<label style="margin-right: 5px;">
|
||||||
|
<input type="checkbox" x-model="showDownloadedOnly" style="margin-right: 5px;">
|
||||||
|
Downloaded only
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
<!-- Loading indicator -->
|
<!-- Loading indicator -->
|
||||||
<div class="loading-container" x-show="Object.keys(models).length === 0">
|
<div class="loading-container" x-show="Object.keys(models).length === 0">
|
||||||
|
|||||||
@@ -39,6 +39,9 @@ document.addEventListener("alpine:init", () => {
|
|||||||
// Add models state alongside existing state
|
// Add models state alongside existing state
|
||||||
models: {},
|
models: {},
|
||||||
|
|
||||||
|
// Show only models available locally
|
||||||
|
showDownloadedOnly: false,
|
||||||
|
|
||||||
topology: null,
|
topology: null,
|
||||||
topologyInterval: null,
|
topologyInterval: null,
|
||||||
|
|
||||||
@@ -686,7 +689,11 @@ document.addEventListener("alpine:init", () => {
|
|||||||
// Update the existing groupModelsByPrefix method to include counts
|
// Update the existing groupModelsByPrefix method to include counts
|
||||||
groupModelsByPrefix(models) {
|
groupModelsByPrefix(models) {
|
||||||
const groups = {};
|
const groups = {};
|
||||||
Object.entries(models).forEach(([key, model]) => {
|
const filteredModels = this.showDownloadedOnly ?
|
||||||
|
Object.fromEntries(Object.entries(models).filter(([, model]) => model.downloaded)) :
|
||||||
|
models;
|
||||||
|
|
||||||
|
Object.entries(filteredModels).forEach(([key, model]) => {
|
||||||
const parts = key.split('-');
|
const parts = key.split('-');
|
||||||
const mainPrefix = parts[0].toUpperCase();
|
const mainPrefix = parts[0].toUpperCase();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user