mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-02-02 08:19:42 +00:00
Update PluginManager to singleton, update PluginContext, support prompt object in plugin extension
This commit is contained in:
parent
a762e6ca03
commit
50e84fc2d5
14 changed files with 121 additions and 45 deletions
|
|
@ -12,10 +12,14 @@
|
|||
<span class="material-symbols text-xl w-5 text-gray-200">help_outline</span>
|
||||
</a>
|
||||
</ui-tooltip>
|
||||
|
||||
<div class="flex-grow" />
|
||||
|
||||
<a v-if="repositoryUrl" :href="repositoryUrl" target="_blank" class="abs-btn outline-none rounded-md shadow-md relative border border-gray-600 text-center bg-primary text-white px-4 py-1 text-sm inline-flex items-center space-x-2"><span>Source</span><span class="material-symbols text-base">open_in_new</span> </a>
|
||||
</template>
|
||||
|
||||
<div class="py-4">
|
||||
<p class="mb-4">{{ configDescription }}</p>
|
||||
<p v-if="configDescription" class="mb-4">{{ configDescription }}</p>
|
||||
|
||||
<form v-if="configFormFields.length" @submit.prevent="handleFormSubmit">
|
||||
<template v-for="field in configFormFields">
|
||||
|
|
@ -46,7 +50,7 @@ export default {
|
|||
console.error('Failed to get plugin config', error)
|
||||
return null
|
||||
})
|
||||
if (!pluginConfigData?.config) {
|
||||
if (!pluginConfigData) {
|
||||
redirect('/config/plugins')
|
||||
}
|
||||
const pluginManifest = store.state.plugins.find((plugin) => plugin.id === params.id)
|
||||
|
|
@ -84,6 +88,9 @@ export default {
|
|||
},
|
||||
configFormFields() {
|
||||
return this.pluginManifestConfig.formFields || []
|
||||
},
|
||||
repositoryUrl() {
|
||||
return this.pluginManifest.repositoryUrl
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
|
@ -123,6 +130,7 @@ export default {
|
|||
})
|
||||
},
|
||||
initializeForm() {
|
||||
if (!this.pluginConfig) return
|
||||
this.configFormFields.forEach((field) => {
|
||||
if (this.pluginConfig[field.name] === undefined) {
|
||||
return
|
||||
|
|
|
|||
|
|
@ -12,11 +12,13 @@
|
|||
<p v-if="!plugins.length" class="text-gray-300">No plugins installed</p>
|
||||
|
||||
<template v-for="plugin in plugins">
|
||||
<nuxt-link :key="plugin.id" :to="`/config/plugins/${plugin.id}`" class="flex items-center bg-primary rounded-md shadow-sm p-4 my-4 space-x-4">
|
||||
<p class="text-lg">{{ plugin.name }}</p>
|
||||
<p class="text-sm text-gray-300">{{ plugin.description }}</p>
|
||||
<div class="flex-grow" />
|
||||
<span class="material-symbols text-4xl">chevron_right</span>
|
||||
<nuxt-link :key="plugin.id" :to="`/config/plugins/${plugin.id}`" class="block w-full rounded bg-primary/40 hover:bg-primary/60 text-gray-300 hover:text-white p-4 my-2">
|
||||
<div class="flex items-center space-x-4">
|
||||
<p class="text-lg">{{ plugin.name }}</p>
|
||||
<p class="text-sm text-gray-300">{{ plugin.description }}</p>
|
||||
<div class="flex-grow" />
|
||||
<span class="material-symbols">arrow_forward</span>
|
||||
</div>
|
||||
</nuxt-link>
|
||||
</template>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue