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)" :html="useMarkdownRaw(field.help)"
/> />
</div> </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>
</template> </template>
<button <button

Wyświetl plik

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