Support boolean config fields in plugins

Part-of: <https://dev.funkwhale.audio/funkwhale/funkwhale/-/merge_requests/2334>
environments/review-docs-poetr-umn39l/deployments/16928
Philipp Wolfer 2023-01-21 17:40:50 +01:00 zatwierdzone przez Marge
rodzic f4241241dc
commit 993fb426ee
3 zmienionych plików z 16 dodań i 2 usunięć

Wyświetl plik

@ -0,0 +1 @@
Support boolean config fields in plugins

Wyświetl plik

@ -188,6 +188,19 @@ const submitAndScan = async () => {
:html="useMarkdownRaw(field.help)"
/>
</div>
<div
v-if="field.type === 'boolean'"
class="field"
>
<div class="ui toggle checkbox">
<input
:id="`plugin-${field.name}`"
v-model="values[field.name]"
type="checkbox"
>
<label :for="`plugin-${field.name}`">{{ field.label || field.name }}</label>
</div>
</div>
</template>
</template>
<button

Wyświetl plik

@ -390,11 +390,11 @@ export interface Plugin {
enabled: boolean
description?: string
source?: string
values?: Record<string, string>
values?: Record<string, any>
conf?: {
name: string
label: string
type: 'text' | 'long_text' | 'url' | 'password'
type: 'text' | 'long_text' | 'url' | 'password' | 'boolean'
help?: string
}[]
}