Support boolean config fields in plugins
Part-of: <https://dev.funkwhale.audio/funkwhale/funkwhale/-/merge_requests/2334>
This commit is contained in:
parent
f4241241dc
commit
993fb426ee
|
@ -0,0 +1 @@
|
||||||
|
Support boolean config fields in plugins
|
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
}[]
|
}[]
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue