mirror of
https://github.com/ParisNeo/lollms-webui.git
synced 2024-12-18 20:17:50 +00:00
no more extensions in lollms
This commit is contained in:
parent
4acc7a5950
commit
3520baedd9
2
app.py
2
app.py
@ -120,7 +120,6 @@ if __name__ == "__main__":
|
||||
from lollms.server.endpoints.lollms_binding_infos import router as lollms_binding_infos_router
|
||||
from lollms.server.endpoints.lollms_models_infos import router as lollms_models_infos_router
|
||||
from lollms.server.endpoints.lollms_personalities_infos import router as lollms_personalities_infos_router
|
||||
from lollms.server.endpoints.lollms_extensions_infos import router as lollms_extensions_infos_router
|
||||
from lollms.server.endpoints.lollms_generator import router as lollms_generator_router
|
||||
from lollms.server.endpoints.lollms_configuration_infos import router as lollms_configuration_infos_router
|
||||
from lollms.server.endpoints.lollms_skills_library import router as lollms_skills_library_router
|
||||
@ -170,7 +169,6 @@ if __name__ == "__main__":
|
||||
app.include_router(lollms_binding_infos_router)
|
||||
app.include_router(lollms_models_infos_router)
|
||||
app.include_router(lollms_personalities_infos_router)
|
||||
app.include_router(lollms_extensions_infos_router)
|
||||
app.include_router(lollms_skills_library_router)
|
||||
|
||||
app.include_router(lollms_webui_infos_router)
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit 423a140296cd1d2f22cd3f8e334822ed2b063f0b
|
||||
Subproject commit 2d0c4e76be93195836ecd0948027e791b8a2626f
|
BIN
web/dist/assets/extension-59119348.png
vendored
BIN
web/dist/assets/extension-59119348.png
vendored
Binary file not shown.
Before Width: | Height: | Size: 235 KiB |
8
web/dist/assets/index-1ba2d604.css
vendored
Normal file
8
web/dist/assets/index-1ba2d604.css
vendored
Normal file
File diff suppressed because one or more lines are too long
8
web/dist/assets/index-c125621e.css
vendored
8
web/dist/assets/index-c125621e.css
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
4
web/dist/index.html
vendored
4
web/dist/index.html
vendored
@ -6,8 +6,8 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>LoLLMS WebUI - Welcome</title>
|
||||
<script type="module" crossorigin src="/assets/index-8093de2b.js"></script>
|
||||
<link rel="stylesheet" href="/assets/index-c125621e.css">
|
||||
<script type="module" crossorigin src="/assets/index-f88bca23.js"></script>
|
||||
<link rel="stylesheet" href="/assets/index-1ba2d604.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
|
@ -3097,168 +3097,7 @@
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- EXTENSIONS ZOO -->
|
||||
<div
|
||||
class="flex flex-col mb-2 rounded-lg bg-bg-light-tone dark:bg-bg-dark-tone hover:bg-bg-light-tone-panel hover:dark:bg-bg-dark-tone-panel duration-150 shadow-lg">
|
||||
<div class="flex flex-row p-3 items-center">
|
||||
<button @click.stop="ezc_collapsed = !ezc_collapsed"
|
||||
class="text-2xl hover:text-primary p-2 -m-2 text-left w-full flex items-center">
|
||||
<div v-show="ezc_collapsed" ><i data-feather='chevron-right'></i></div>
|
||||
<div v-show="!ezc_collapsed" ><i data-feather='chevron-down'></i></div>
|
||||
<h3 class="text-lg font-semibold cursor-pointer select-none mr-2">
|
||||
Extensions zoo</h3>
|
||||
<div v-if="configFile.extensions" class="mr-2">|</div>
|
||||
<div v-if="configFile.extensions"
|
||||
class=" text-base font-semibold cursor-pointer select-none items-center flex flex-row">
|
||||
<!-- LIST -->
|
||||
<div class="flex -space-x-4 items-center " v-if="mountedExtensions.length > 0">
|
||||
<!-- ITEM -->
|
||||
<div class="relative hover:-translate-y-2 duration-300 hover:z-10 shrink-0 "
|
||||
v-for="(item, index) in mountedExtensions" :key="index + '-' + item.name"
|
||||
ref="mountedExtensions">
|
||||
<div class="group items-center flex flex-row">
|
||||
<button>
|
||||
<img :src="bUrl + item.avatar" @error="extensionImgPlacehodler"
|
||||
class="w-8 h-8 rounded-full object-fill text-red-700 border-2 active:scale-90 group-hover:border-secondary "
|
||||
:class="'border-transparent z-0'"
|
||||
:title="item.name">
|
||||
</button>
|
||||
<button @click.stop="unmountExtension (item)">
|
||||
<span
|
||||
class="hidden group-hover:block top-0 left-7 absolute active:scale-90 bg-bg-light dark:bg-bg-dark rounded-full border-2 border-transparent"
|
||||
title="Unmount personality">
|
||||
<!-- UNMOUNT BUTTON -->
|
||||
<svg aria-hidden="true" class="w-4 h-4 text-red-600 hover:text-red-500 "
|
||||
fill="currentColor" viewBox="0 0 20 20"
|
||||
xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd"
|
||||
d="M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z"
|
||||
clip-rule="evenodd"></path>
|
||||
</svg>
|
||||
|
||||
</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</button>
|
||||
</div>
|
||||
<div :class="{ 'hidden': ezc_collapsed }" class="flex flex-col mb-2 px-3 pb-0">
|
||||
<!-- SEARCH BAR -->
|
||||
<div class="mx-2 mb-4">
|
||||
<label for="personality-search"
|
||||
class="mb-2 text-sm font-medium text-gray-900 sr-only dark:text-white">Search</label>
|
||||
<div class="relative">
|
||||
<div class="absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none">
|
||||
<div v-if="searchExtensionInProgress">
|
||||
<!-- SPINNER -->
|
||||
<div role="status">
|
||||
<svg aria-hidden="true"
|
||||
class="inline w-4 h-4 mr-2 text-gray-200 animate-spin dark:text-gray-600 fill-blue-600"
|
||||
viewBox="0 0 100 101" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path
|
||||
d="M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z"
|
||||
fill="currentColor" />
|
||||
<path
|
||||
d="M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z"
|
||||
fill="currentFill" />
|
||||
</svg>
|
||||
<span class="sr-only">Loading...</span>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="!searchExtensionInProgress">
|
||||
<!-- SEARCH -->
|
||||
<svg aria-hidden="true" class="w-5 h-5 text-gray-500 dark:text-gray-400" fill="none"
|
||||
stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
|
||||
d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"></path>
|
||||
</svg>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<input type="search" id="personality-search"
|
||||
class="block w-full p-4 pl-10 text-sm text-gray-900 border border-gray-300 rounded-lg bg-gray-50 focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"
|
||||
placeholder="Search extension..." required v-model="searchExtension"
|
||||
@keyup.stop="searchExtension_func">
|
||||
<button v-if="searchExtension" @click.stop="searchExtension = ''" type="button"
|
||||
class="text-white absolute right-2.5 bottom-2.5 bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-4 py-2 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800">
|
||||
Clear search</button>
|
||||
|
||||
<!-- @input="filterPersonalities()" -->
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="mx-2 mb-4" v-if="!searchExtension">
|
||||
<label for="extCat" class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">
|
||||
Extensions Category: ({{ extCatgArr.length }})
|
||||
</label>
|
||||
<select id="extCat" @change="update_extension_category($event.target.value, refresh)"
|
||||
class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500">
|
||||
|
||||
<option v-for="(item, index) in extCatgArr" :key="index"
|
||||
:selected="item == this.extension_category">{{
|
||||
item
|
||||
}}
|
||||
|
||||
</option>
|
||||
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
<div v-if="extensionsFiltered.length > 0" class="mb-2">
|
||||
<label for="model" class="block ml-2 mb-2 text-sm font-medium text-gray-900 dark:text-white">
|
||||
{{ searchExtension ? 'Search results' : 'Personalities' }}: ({{
|
||||
extensionsFiltered.length
|
||||
}})
|
||||
</label>
|
||||
<div class="overflow-y-auto no-scrollbar p-2 pb-0 grid lg:grid-cols-3 md:grid-cols-2 gap-4"
|
||||
:class="ezl_collapsed ? '' : 'max-h-96'">
|
||||
<ExtensionEntry ref="extensionsZoo" v-for="(ext, index) in extensionsFiltered"
|
||||
:key="'index-' + index + '-' + ext.name"
|
||||
:extension="ext"
|
||||
:select_language="true"
|
||||
:full_path="ext.full_path"
|
||||
:on-mount="mountExtension"
|
||||
:on-un-mount="unmountExtension"
|
||||
:on-remount="remountExtension"
|
||||
:on-reinstall="onExtensionReinstall"
|
||||
:on-settings="onSettingsExtension" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- EXPAND / COLLAPSE BUTTON -->
|
||||
<button v-if="ezc_collapsed"
|
||||
class="text-2xl hover:text-secondary duration-75 flex justify-center hover:bg-bg-light-tone hover:dark:bg-bg-dark-tone rounded-lg "
|
||||
title="Collapse" type="button" @click="ezl_collapsed = !ezl_collapsed">
|
||||
<i data-feather="chevron-up"></i>
|
||||
</button>
|
||||
<button v-else
|
||||
class="text-2xl hover:text-secondary duration-75 flex justify-center hover:bg-bg-light-tone hover:dark:bg-bg-dark-tone rounded-lg "
|
||||
title="Expand" type="button" @click="ezl_collapsed = !ezl_collapsed">
|
||||
<i data-feather="chevron-down"></i>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- EXTENSIONS ZOO -->
|
||||
<div
|
||||
class="flex flex-col mb-2 rounded-lg bg-bg-light-tone dark:bg-bg-dark-tone hover:bg-bg-light-tone-panel hover:dark:bg-bg-dark-tone-panel duration-150 shadow-lg">
|
||||
<div class="flex flex-row p-3 items-center">
|
||||
<button @click.stop="mep_collapsed = !mep_collapsed"
|
||||
class="text-2xl hover:text-primary p-2 -m-2 text-left w-full flex items-center">
|
||||
<div v-show="mep_collapsed" ><i data-feather='chevron-right'></i></div>
|
||||
<div v-show="!mep_collapsed" ><i data-feather='chevron-down'></i></div>
|
||||
<h3 class="text-lg font-semibold cursor-pointer select-none mr-2">
|
||||
Mounted Extensions Priority</h3>
|
||||
</button>
|
||||
</div>
|
||||
<div :class="{ 'hidden': mep_collapsed }" class="flex flex-col mb-2 px-3 pb-0">
|
||||
</div>
|
||||
</div>
|
||||
<!-- MODEL CONFIGURATION -->
|
||||
<div
|
||||
class="flex flex-col mb-2 p-3 rounded-lg bg-bg-light-tone dark:bg-bg-dark-tone hover:bg-bg-light-tone-panel hover:dark:bg-bg-dark-tone-panel duration-150 shadow-lg">
|
||||
@ -3548,7 +3387,6 @@ import socket from '@/services/websocket.js'
|
||||
import defaultModelImgPlaceholder from "../assets/default_model.png"
|
||||
|
||||
import defaultPersonalityImgPlaceholder from "../assets/logo.png"
|
||||
import defaultExtensionImgPlaceholder from "../assets/extension.png"
|
||||
import defaultImgPlaceholder from "../assets/default_model.png"
|
||||
|
||||
import AddModelDialog from "@/components/AddModelDialog.vue";
|
||||
@ -3556,7 +3394,6 @@ import AddModelDialog from "@/components/AddModelDialog.vue";
|
||||
import ChoiceDialog from "@/components/ChoiceDialog.vue";
|
||||
import Card from "@/components/Card.vue"
|
||||
import RadioOptions from '../components/RadioOptions.vue';
|
||||
import ExtensionEntry from "@/components/ExtensionEntry.vue"
|
||||
|
||||
import storeLogo from '@/assets/logo.png'
|
||||
|
||||
@ -3578,7 +3415,6 @@ export default {
|
||||
ChoiceDialog,
|
||||
Card,
|
||||
RadioOptions,
|
||||
ExtensionEntry
|
||||
},
|
||||
data() {
|
||||
|
||||
@ -3642,7 +3478,6 @@ export default {
|
||||
// Loading text
|
||||
loading_text:"",
|
||||
// Current personality category
|
||||
extension_category:"bound_extensions",
|
||||
personality_category:null,
|
||||
// install custom model
|
||||
addModelDialogVisibility: false,
|
||||
@ -3650,7 +3485,6 @@ export default {
|
||||
// Zoo stuff
|
||||
personalitiesFiltered: [],
|
||||
modelsFiltered: [],
|
||||
extensionsFiltered: [],
|
||||
// Accordeon stuff
|
||||
collapsedArr: [],
|
||||
all_collapsed: true,
|
||||
@ -3663,8 +3497,6 @@ export default {
|
||||
mzc_collapsed: true, // models zoo
|
||||
mzdc_collapsed: true, // models zoo download
|
||||
pzc_collapsed: true, // personalities zoo
|
||||
ezc_collapsed: true, // extension zoo
|
||||
mep_collapsed: true, // mounted extensions priority
|
||||
bzc_collapsed: true, // binding zoo
|
||||
pc_collapsed: true,
|
||||
mc_collapsed: true,
|
||||
@ -3686,13 +3518,11 @@ export default {
|
||||
isMounted: false, // Needed to wait for $refs to be rendered
|
||||
bUrl: bUrl, // for personality images
|
||||
searchPersonality: "",
|
||||
searchExtension: "",
|
||||
searchModel: "",
|
||||
searchPersonalityTimer: {},
|
||||
searchPersonalityTimerInterval: 1500, // timeout in ms
|
||||
searchModelTimerInterval: 1500, // timeout in ms
|
||||
searchPersonalityInProgress: false,
|
||||
searchExtensionInProgress: false,
|
||||
searchModelInProgress: false,
|
||||
addModel: {},
|
||||
modelDownlaodInProgress: false,
|
||||
@ -4114,42 +3944,19 @@ export default {
|
||||
|
||||
console.log("category")
|
||||
|
||||
try{
|
||||
this.extCatgArr = await this.api_get_req("list_extensions_categories")
|
||||
this.extension_category = this.extCatgArr[0]
|
||||
console.log(this.extCatgArr)
|
||||
}
|
||||
catch{
|
||||
console.log("Couldn't list catergories")
|
||||
this.extCatgArr = []
|
||||
}
|
||||
try{
|
||||
console.log("Loading extension category content")
|
||||
this.extArr = await this.api_get_req("list_extensions?category="+this.extension_category)
|
||||
console.log(this.extArr)
|
||||
}
|
||||
catch{
|
||||
console.log("Couldn't list extensions")
|
||||
this.extCatgArr = []
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//await this.getPersonalitiesArr()
|
||||
this.personality_category = this.configFile.personality_category
|
||||
this.personalitiesFiltered = this.personalities.filter((item) => item.category === this.configFile.personality_category)
|
||||
// this.personalitiesFiltered.sort()
|
||||
//mountedPersArr
|
||||
this.modelsFiltered = []
|
||||
this.extension_category = this.configFile.extension_category
|
||||
this.extensionsFiltered = this.$store.state.extensionsZoo.filter((item) => item.category === this.configFile.extension_category )
|
||||
|
||||
|
||||
this.updateModelsZoo();
|
||||
|
||||
this.isLoading = false
|
||||
this.isMounted = true
|
||||
this.extension_category = this.configFile.extension_category
|
||||
console.log("READY Stuff")
|
||||
|
||||
},
|
||||
@ -4291,18 +4098,6 @@ export default {
|
||||
console.log(`Listed personalities:\n${response}`)
|
||||
})
|
||||
},
|
||||
fetchExtensions(){
|
||||
this.api_get_req("list_extensions_categories").then(response => {
|
||||
this.extCatgArr = response
|
||||
this.extCatgArr.sort()
|
||||
})
|
||||
|
||||
this.api_get_req("list_extensions").then(response => {
|
||||
this.extArr = response
|
||||
this.extArr.sort()
|
||||
console.log(`Listed extensions:\n${response}`)
|
||||
})
|
||||
},
|
||||
fetchHardwareInfos(){
|
||||
this.$store.dispatch('refreshDiskUsage');
|
||||
this.$store.dispatch('refreshRamUsage');
|
||||
@ -4740,53 +4535,6 @@ export default {
|
||||
return { 'status': false }
|
||||
});
|
||||
},
|
||||
onSettingsExtension(extensionEntry){
|
||||
try {
|
||||
this.isLoading = true
|
||||
axios.get('/get_extension_settings',{name:extensionEntry.name}).then(res => {
|
||||
this.isLoading = false
|
||||
if (res) {
|
||||
|
||||
console.log('ext sett', res)
|
||||
if (res.data && Object.keys(res.data).length > 0) {
|
||||
|
||||
this.$store.state.universalForm.showForm(res.data, "Extension settings - " + extensionEntry.extension.name, "Save changes", "Cancel").then(res => {
|
||||
|
||||
// send new data
|
||||
try {
|
||||
axios.post('/set_extension_settings', {"name":extensionEntry.name,"config":res}).then(response => {
|
||||
|
||||
if (response && response.data) {
|
||||
console.log('extension set with new settings', response.data)
|
||||
this.$store.state.toast.showToast("Extension settings updated successfully!", 4, true)
|
||||
|
||||
} else {
|
||||
this.$store.state.toast.showToast("Did not get Extension settings responses.\n" + response, 4, false)
|
||||
this.isLoading = false
|
||||
}
|
||||
|
||||
|
||||
})
|
||||
} catch (error) {
|
||||
this.$store.state.toast.showToast("Did not get Extension settings responses.\n Endpoint error: " + error.message, 4, false)
|
||||
this.isLoading = false
|
||||
}
|
||||
|
||||
})
|
||||
} else {
|
||||
this.$store.state.toast.showToast("Extension has no settings", 4, false)
|
||||
this.isLoading = false
|
||||
}
|
||||
|
||||
}
|
||||
})
|
||||
|
||||
} catch (error) {
|
||||
this.isLoading = false
|
||||
this.$store.state.toast.showToast("Could not open personality settings. Endpoint error: " + error.message, 4, false)
|
||||
}
|
||||
|
||||
},
|
||||
onSettingsBinding(bindingEntry) {
|
||||
try {
|
||||
this.isLoading = true
|
||||
@ -4921,10 +4669,6 @@ export default {
|
||||
this.personality_category = cat
|
||||
next()
|
||||
},
|
||||
update_extension_category(cat, next){
|
||||
this.extension_category = cat
|
||||
next()
|
||||
},
|
||||
// Refresh stuff
|
||||
refresh() {
|
||||
console.log("Refreshing")
|
||||
@ -4939,18 +4683,6 @@ export default {
|
||||
|
||||
})
|
||||
|
||||
this.api_get_req("list_extensions_categories").then((cats)=>{
|
||||
console.log("cats",cats)
|
||||
this.extCatgArr = cats
|
||||
console.log("this.$store.state.extensionsZoo",this.$store.state.extensionsZoo)
|
||||
console.log("this.extension_category", this.extension_category)
|
||||
this.extensionsFiltered = this.$store.state.extensionsZoo.filter((item) => item.category === this.extension_category)
|
||||
this.extensionsFiltered.sort()
|
||||
console.log("this.extensionsFiltered", this.extensionsFiltered)
|
||||
|
||||
})
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
@ -5304,48 +5036,6 @@ export default {
|
||||
this.isLoading = false
|
||||
|
||||
},
|
||||
async getExtensionsArr() {
|
||||
this.isLoading = true
|
||||
this.extensions = []
|
||||
const dictionary = await this.api_get_req("get_all_extensions")
|
||||
const config = this.$store.state.config
|
||||
//console.log('asdas',config)
|
||||
// console.log("all_extensions")
|
||||
// console.log(dictionary)
|
||||
const catkeys = Object.keys(dictionary); // returns categories folder names
|
||||
for (let j = 0; j < catkeys.length; j++) {
|
||||
const catkey = catkeys[j];
|
||||
const extensionsArray = dictionary[catkey];
|
||||
const modPersArr = extensionsArray.map((item) => {
|
||||
|
||||
const isMounted = config.extensions.includes(catkey + '/' + item.folder)
|
||||
// if (isMounted) {
|
||||
// console.log(item)
|
||||
// }
|
||||
let newItem = {}
|
||||
newItem = item
|
||||
newItem.category = catkey // add new props to items
|
||||
newItem.language = "" // add new props to items
|
||||
newItem.full_path = catkey + '/' + item.folder // add new props to items
|
||||
newItem.isMounted = isMounted // add new props to items
|
||||
return newItem
|
||||
})
|
||||
|
||||
|
||||
if (this.extensions.length == 0) {
|
||||
this.extensions = modPersArr
|
||||
} else {
|
||||
this.extensions = this.extensions.concat(modPersArr)
|
||||
}
|
||||
}
|
||||
|
||||
this.extensions.sort((a, b) => a.name.localeCompare(b.name))
|
||||
this.extensions = this.extensions.filter((item) => item.category === this.configFile.personality_category)
|
||||
this.extensions.sort()
|
||||
console.log('per filtered', this.extensionsFiltered)
|
||||
this.isLoading = false
|
||||
|
||||
},
|
||||
async filterPersonalities() {
|
||||
if (!this.searchPersonality) {
|
||||
this.personalitiesFiltered = this.personalities.filter((item) => item.category === this.configFile.personality_category )
|
||||
@ -5373,34 +5063,6 @@ export default {
|
||||
this.searchPersonalityInProgress = false
|
||||
|
||||
},
|
||||
async filterExtensions() {
|
||||
if (!this.searchExtension) {
|
||||
this.personalitiesFiltered = this.extensions.filter((item) => item.category === this.extension_category )
|
||||
this.personalitiesFiltered.sort()
|
||||
this.searchExtensionInProgress = false
|
||||
return
|
||||
}
|
||||
const searchTerm = this.searchExtension.toLowerCase()
|
||||
const seachedPersonalities = this.personalities.filter((item) => {
|
||||
|
||||
if (item.name && item.name.toLowerCase().includes(searchTerm) || item.description && item.description.toLowerCase().includes(searchTerm) || item.full_path && item.full_path.toLowerCase().includes(searchTerm)) {
|
||||
return item
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
|
||||
|
||||
if (seachedPersonalities.length > 0) {
|
||||
this.personalitiesFiltered = seachedPersonalities.sort()
|
||||
} else {
|
||||
this.personalitiesFiltered = this.personalities.filter((item) => item.category === this.configFile.personality_category)
|
||||
this.personalitiesFiltered.sort()
|
||||
}
|
||||
this.searchExtensionInProgress = false
|
||||
|
||||
},
|
||||
|
||||
async filterModels() {
|
||||
const searchTerm = this.searchModel.toLowerCase()
|
||||
this.is_loading_zoo = true;
|
||||
@ -5506,52 +5168,6 @@ export default {
|
||||
return
|
||||
}
|
||||
|
||||
},
|
||||
async mount_extension(ext) {
|
||||
if (!ext) { return { 'status': false, 'error': 'no extension - mount_extension' } }
|
||||
|
||||
try {
|
||||
const obj = {
|
||||
client_id: this.$store.state.client_id,
|
||||
category: ext.category,
|
||||
folder: ext.folder,
|
||||
}
|
||||
const res = await axios.post('/mount_extension', obj, {headers: this.posts_headers});
|
||||
|
||||
if (res) {
|
||||
|
||||
return res.data
|
||||
|
||||
}
|
||||
} catch (error) {
|
||||
console.log(error.message, 'mount_extension - settings')
|
||||
return
|
||||
}
|
||||
|
||||
},
|
||||
async unmount_extension(ext) {
|
||||
if (!ext) { return { 'status': false, 'error': 'no extension - unmount_extension' } }
|
||||
|
||||
const obj = {
|
||||
client_id: this.$store.state.client_id,
|
||||
language: ext.language,
|
||||
category: ext.category,
|
||||
folder: ext.folder
|
||||
}
|
||||
|
||||
|
||||
try {
|
||||
const res = await axios.post('/unmount_extension', obj, {headers: this.posts_headers});
|
||||
|
||||
if (res) {
|
||||
return res.data
|
||||
|
||||
}
|
||||
} catch (error) {
|
||||
console.log(error.message, 'unmount_extension - settings')
|
||||
return
|
||||
}
|
||||
|
||||
},
|
||||
async mountPersonality(pers) {
|
||||
this.isLoading = true
|
||||
@ -5707,106 +5323,6 @@ export default {
|
||||
await this.mountPersonality(pers);
|
||||
},
|
||||
|
||||
async mountExtension(ext) {
|
||||
this.isLoading = true
|
||||
console.log('mount ext', ext)
|
||||
if (!ext) { return }
|
||||
|
||||
if (this.configFile.personalities.includes(ext.extension.full_path)) {
|
||||
this.isLoading = false
|
||||
this.$store.state.toast.showToast("Extension already mounted", 4, false)
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
const res = await this.mount_extension(ext.extension)
|
||||
console.log('mount_extension res', res)
|
||||
|
||||
if (res && res.status && res.extensions.includes(ext.extension.full_path)) {
|
||||
this.configFile.extensions = res.extensions
|
||||
this.$store.state.toast.showToast("Extension mounted", 4, true)
|
||||
ext.isMounted = true
|
||||
this.$store.dispatch('refreshMountedExtensions');
|
||||
} else {
|
||||
ext.isMounted = false
|
||||
this.$store.state.toast.showToast("Could not mount extension\nError: " + res.error + "\nResponse:\n" + res, 4, false)
|
||||
}
|
||||
this.isLoading = false
|
||||
|
||||
},
|
||||
async unmountExtension(ext) {
|
||||
this.isLoading = true
|
||||
if (!ext) { return }
|
||||
|
||||
const res = await this.p_unmount_extension(ext.extension || ext)
|
||||
|
||||
|
||||
if (res.status) {
|
||||
this.configFile.extensions = res.extensions
|
||||
this.$store.state.toast.showToast("Extension unmounted", 4, true)
|
||||
const extId = this.extensions.findIndex(item => item.full_path == ext.full_path)
|
||||
const persFilteredId = this.extensionsFiltered.findIndex(item => item.full_path == ext.full_path)
|
||||
const extIdZoo = this.$refs.extensionsZoo.findIndex(item => item.full_path == ext.full_path)
|
||||
console.log('ext', this.extensions[extId])
|
||||
|
||||
this.extensions[extId].isMounted = false
|
||||
|
||||
if (persFilteredId > -1) {
|
||||
this.extensionsFiltered[persFilteredId].isMounted = false
|
||||
|
||||
}
|
||||
|
||||
if (extIdZoo > -1) {
|
||||
this.$refs.extensionsZoo[extIdZoo].isMounted = false
|
||||
|
||||
}
|
||||
|
||||
|
||||
//ext.isMounted = false
|
||||
this.$store.dispatch('refreshMountedPersonalities');
|
||||
// Select some other personality
|
||||
const lastPers = this.mountedExtensions[this.mountedExtensions.length - 1]
|
||||
|
||||
console.log(lastPers, this.mountedExtensions.length)
|
||||
|
||||
|
||||
} else {
|
||||
this.$store.state.toast.showToast("Could not unmount extension\nError: " + res.error, 4, false)
|
||||
}
|
||||
|
||||
this.isLoading = false
|
||||
},
|
||||
async remountExtension(ext){
|
||||
await this.unmountExtension(ext);
|
||||
await this.mountExtension(ext);
|
||||
},
|
||||
onExtensionReinstall(extItem){
|
||||
console.log('on reinstall ', extItem)
|
||||
this.isLoading = true
|
||||
console.log(extItem)
|
||||
axios.post('/reinstall_extension', { name: extItem.extension.full_path }).then((res) => {
|
||||
|
||||
if (res) {
|
||||
this.isLoading = false
|
||||
console.log('reinstall_extension', res)
|
||||
if (res.data.status) {
|
||||
this.$store.state.toast.showToast("Extension reinstalled successfully!", 4, true)
|
||||
} else {
|
||||
this.$store.state.toast.showToast("Could not reinstall extension", 4, false)
|
||||
}
|
||||
return res.data;
|
||||
}
|
||||
this.isLoading = false
|
||||
})
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
|
||||
.catch(error => {
|
||||
this.isLoading = false
|
||||
this.$store.state.toast.showToast("Could not reinstall personality\n" + error.message, 4, false)
|
||||
return { 'status': false }
|
||||
});
|
||||
},
|
||||
|
||||
onPersonalityReinstall(persItem){
|
||||
console.log('on reinstall ', persItem)
|
||||
this.isLoading = true
|
||||
@ -5836,9 +5352,6 @@ export default {
|
||||
personalityImgPlacehodler(event) {
|
||||
event.target.src = defaultPersonalityImgPlaceholder
|
||||
},
|
||||
extensionImgPlacehodler(event){
|
||||
event.target.src = defaultExtensionImgPlaceholder
|
||||
},
|
||||
searchPersonality_func() {
|
||||
|
||||
clearTimeout(this.searchPersonalityTimer)
|
||||
@ -6183,15 +5696,6 @@ export default {
|
||||
this.$store.commit('setMountedPers', value);
|
||||
}
|
||||
},
|
||||
mountedExtensions:{
|
||||
get() {
|
||||
console.log("this.$store.state.mountedExtensions:",this.$store.state.mountedExtensions)
|
||||
return this.$store.state.mountedExtensions;
|
||||
},
|
||||
set(value) {
|
||||
this.$store.commit('setActiveExtensions', value);
|
||||
}
|
||||
},
|
||||
bindingsZoo: {
|
||||
get() {
|
||||
return this.$store.state.bindingsZoo;
|
||||
|
Loading…
Reference in New Issue
Block a user