mirror of
https://github.com/ParisNeo/lollms-webui.git
synced 2025-06-22 08:50:08 +00:00
added official python bindings
This commit is contained in:
@ -1,43 +1,55 @@
|
||||
<template>
|
||||
<div class="flex items-center p-4 hover:bg-primary-light rounded-lg mb-2 shadow-lg">
|
||||
|
||||
|
||||
|
||||
<div class="flex-shrink-0">
|
||||
<i :class="`fas ${icon} text-xl`"></i>
|
||||
</div>
|
||||
<div class="flex-1">
|
||||
<h3 class="font-bold text-lg">{{ title }}</h3>
|
||||
<p class="opacity-80">{{ description }}</p>
|
||||
</div>
|
||||
<div class="flex-shrink-0">
|
||||
<button
|
||||
class="px-4 py-2 rounded-md text-white font-bold transition-colors duration-300"
|
||||
:class="[isInstalled ? 'bg-red-500 hover:bg-red-600' : 'bg-green-500 hover:bg-green-600']"
|
||||
@click="toggleInstall"
|
||||
>
|
||||
{{ isInstalled ? 'Uninstall' : 'Install' }}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div
|
||||
class="flex items-center p-4 hover:bg-primary-light rounded-lg mb-2 shadow-lg"
|
||||
:class="{ 'bg-primary-light': selected }"
|
||||
>
|
||||
<div class="flex-shrink-0">
|
||||
<i :class="`fas ${icon} text-xl`"></i>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
title: String,
|
||||
icon: String,
|
||||
path: String,
|
||||
description: String,
|
||||
isInstalled: Boolean,
|
||||
onToggleInstall: Function,
|
||||
<div class="flex-1">
|
||||
<h3 class="font-bold text-lg">
|
||||
<input
|
||||
type="radio"
|
||||
:checked="selected"
|
||||
:disabled="!isInstalled" <!-- Disable radio button if not installed -->
|
||||
@change="handleSelection"
|
||||
/>
|
||||
{{ title }}
|
||||
</h3>
|
||||
<p class="opacity-80">{{ description }}</p>
|
||||
</div>
|
||||
<div class="flex-shrink-0">
|
||||
<button
|
||||
class="px-4 py-2 rounded-md text-white font-bold transition-colors duration-300"
|
||||
:class="[isInstalled ? 'bg-red-500 hover:bg-red-600' : 'bg-green-500 hover:bg-green-600']"
|
||||
@click="toggleInstall"
|
||||
>
|
||||
{{ isInstalled ? 'Uninstall' : 'Install' }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
title: String,
|
||||
icon: String,
|
||||
path: String,
|
||||
description: String,
|
||||
isInstalled: Boolean,
|
||||
onToggleInstall: Function,
|
||||
selected: Boolean // Use a boolean selected prop
|
||||
},
|
||||
methods: {
|
||||
toggleInstall() {
|
||||
this.onToggleInstall(this.isInstalled, this.path);
|
||||
},
|
||||
methods: {
|
||||
toggleInstall() {
|
||||
this.onToggleInstall(this.isInstalled, this.path);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
handleSelection() {
|
||||
if (this.isInstalled && !this.selected) { // Only emit event if installed and not already selected
|
||||
this.$emit('update:selected', true);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
Reference in New Issue
Block a user