fixed custom model entry

This commit is contained in:
AndzejsP 2023-06-26 12:55:35 +03:00
parent 3a7ee63976
commit 40da24c8a5
2 changed files with 48 additions and 30 deletions

View File

@ -10,17 +10,32 @@
{{ title }} {{ title }}
</h3> </h3>
</div> </div>
</div>
<div v-if="model.isCustomModel" class="flex items-center flex-row gap-2 my-1">
<!-- CONTROLS -->
<div class="flex grow items-center">
<button type="button" title="Custom model / local model" <button type="button" title="Custom model / local model"
class="font-medium rounded-lg text-sm p-2 text-center inline-flex items-center " @click.stop=""> class="font-medium rounded-lg text-sm p-2 text-center inline-flex items-center " @click.stop="">
<i data-feather="box" class="w-5"></i> <i data-feather="box" class="w-5"></i>
<span class="sr-only">Custom model / local model</span> <span class="sr-only">Custom model / local model</span>
</button> </button>
<button Custom model
class=" hover:text-red-600 duration-75 active:scale-90 font-medium rounded-lg text-sm p-2 text-center inline-flex items-center " </div>
title="Delete file from disk" type="button" @click.stop="toggleInstall"> <div>
<i data-feather="trash" class="w-5"></i> <button v-if="model.isInstalled" title="Delete file from disk" type="button" @click.stop="toggleInstall"
class="inline-flex items-center gap-2 px-3 py-2 text-xs font-medium text-center focus:outline-none text-white bg-red-700 hover:bg-red-800 focus:ring-4 focus:ring-red-300 rounded-lg dark:bg-red-600 dark:hover:bg-red-700 dark:focus:ring-red-900">
Uninstall
<span class="sr-only">Remove</span>
</button> </button>
</div> </div>
</div>
<div v-if="installing" <div v-if="installing"
class="absolute z-10 -m-4 p-5 shadow-md text-center rounded-lg w-full h-full bg-bg-light-tone-panel dark:bg-bg-dark-tone-panel bg-opacity-70 dark:bg-opacity-70 flex justify-center items-center"> class="absolute z-10 -m-4 p-5 shadow-md text-center rounded-lg w-full h-full bg-bg-light-tone-panel dark:bg-bg-dark-tone-panel bg-opacity-70 dark:bg-opacity-70 flex justify-center items-center">
<!-- DOWNLOAD MODEL PANEL SPINNER --> <!-- DOWNLOAD MODEL PANEL SPINNER -->
@ -51,8 +66,10 @@
<div class="bg-blue-600 h-2.5 rounded-full" :style="{ width: progress + '%' }"></div> <div class="bg-blue-600 h-2.5 rounded-full" :style="{ width: progress + '%' }"></div>
</div> </div>
<div class="flex justify-between mb-1"> <div class="flex justify-between mb-1">
<span class="text-base font-medium text-blue-700 dark:text-white">Download speed: {{ speed_computed }}/s</span> <span class="text-base font-medium text-blue-700 dark:text-white">Download speed: {{ speed_computed
<span class="text-sm font-medium text-blue-700 dark:text-white">{{ downloaded_size_computed }}/{{ total_size_computed }}</span> }}/s</span>
<span class="text-sm font-medium text-blue-700 dark:text-white">{{ downloaded_size_computed }}/{{
total_size_computed }}</span>
</div> </div>
</div> </div>
</div> </div>
@ -76,7 +93,7 @@
</div> </div>
</div> </div>
<div > <div v-if="!model.isCustomModel">
<div class="flex flex-row items-center gap-3 "> <div class="flex flex-row items-center gap-3 ">
<img ref="imgElement" :src="getImgUrl()" @error="defaultImg($event)" class="w-10 h-10 rounded-lg object-fill" <img ref="imgElement" :src="getImgUrl()" @error="defaultImg($event)" class="w-10 h-10 rounded-lg object-fill"
@ -142,7 +159,8 @@
Link is not valid Link is not valid
</div> </div>
</div> </div>
<button v-if="!model.isInstalled && !linkNotValid" title="Click to install" type="button" @click.stop="toggleInstall" <button v-if="!model.isInstalled && !linkNotValid" title="Click to install" type="button"
@click.stop="toggleInstall"
class="inline-flex items-center gap-2 px-3 py-2 text-xs font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800"> class="inline-flex items-center gap-2 px-3 py-2 text-xs font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800">
Install Install

View File

@ -1454,7 +1454,7 @@ export default {
this.modelDownlaodInProgress = true this.modelDownlaodInProgress = true
if (this.addModel.progress == 100) { if (this.addModel.progress == 100) {
this.modelDownlaodInProgress = true this.modelDownlaodInProgress = false
console.log("Received succeeded") console.log("Received succeeded")
socket.off('install_progress', progressListener); socket.off('install_progress', progressListener);