mirror of
https://github.com/BrenBroZAYT/gameyfin.git
synced 2026-06-16 16:20:04 +00:00
Implement "secret" toggle for plugin config fields
This commit is contained in:
@@ -70,8 +70,9 @@ export default function PluginDetailsModal({plugin, isOpen, onOpenChange, update
|
|||||||
|
|
||||||
<h4 className="text-l font-bold mt-6">Configuration</h4>
|
<h4 className="text-l font-bold mt-6">Configuration</h4>
|
||||||
{(pluginConfigMeta && pluginConfigMeta.length > 0) ?
|
{(pluginConfigMeta && pluginConfigMeta.length > 0) ?
|
||||||
pluginConfigMeta.map((entry: any) => (
|
pluginConfigMeta.map((entry: PluginConfigElement) => (
|
||||||
<Input key={entry.key} name={entry.key} label={entry.name} type="text"/>
|
<Input key={entry.key} name={entry.key} label={entry.name}
|
||||||
|
type={entry.secret ? "password" : "text"}/>
|
||||||
)) : "This plugin has no configuration options."
|
)) : "This plugin has no configuration options."
|
||||||
}
|
}
|
||||||
</ModalBody>
|
</ModalBody>
|
||||||
|
|||||||
@@ -68,12 +68,12 @@ export function PluginManagementCard({plugin, updatePlugin}: {
|
|||||||
<div className="absolute right-0 top-0 flex flex-row">
|
<div className="absolute right-0 top-0 flex flex-row">
|
||||||
<Tooltip content={`${isDisabled(plugin.state) ? "Enable" : "Disable"} plugin`} placement="bottom"
|
<Tooltip content={`${isDisabled(plugin.state) ? "Enable" : "Disable"} plugin`} placement="bottom"
|
||||||
color="foreground">
|
color="foreground">
|
||||||
<Button isIconOnly variant="ghost" onPress={() => togglePluginEnabled()}>
|
<Button isIconOnly variant="light" onPress={() => togglePluginEnabled()}>
|
||||||
<Power/>
|
<Power/>
|
||||||
</Button>
|
</Button>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
<Tooltip content="Configuration" placement="bottom" color="foreground">
|
<Tooltip content="Configuration" placement="bottom" color="foreground">
|
||||||
<Button isIconOnly variant="ghost" onPress={pluginDetailsModal.onOpen}>
|
<Button isIconOnly variant="light" onPress={pluginDetailsModal.onOpen}>
|
||||||
<SlidersHorizontal/>
|
<SlidersHorizontal/>
|
||||||
</Button>
|
</Button>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
|
|||||||
@@ -3,5 +3,6 @@ package de.grimsi.gameyfin.pluginapi.core
|
|||||||
data class PluginConfigElement(
|
data class PluginConfigElement(
|
||||||
val key: String,
|
val key: String,
|
||||||
val name: String,
|
val name: String,
|
||||||
val description: String
|
val description: String,
|
||||||
|
val isSecret: Boolean = false
|
||||||
)
|
)
|
||||||
@@ -18,7 +18,7 @@ class IgdbPlugin(wrapper: PluginWrapper) : GameyfinPlugin(wrapper) {
|
|||||||
|
|
||||||
override val configMetadata: List<PluginConfigElement> = listOf(
|
override val configMetadata: List<PluginConfigElement> = listOf(
|
||||||
PluginConfigElement("clientId", "Twitch client ID", "Your Twitch Client ID"),
|
PluginConfigElement("clientId", "Twitch client ID", "Your Twitch Client ID"),
|
||||||
PluginConfigElement("clientSecret", "Twitch client secret", "Your Twitch Client Secret")
|
PluginConfigElement("clientSecret", "Twitch client secret", "Your Twitch Client Secret", true)
|
||||||
)
|
)
|
||||||
|
|
||||||
override fun validateConfig(config: Map<String, String?>): Boolean {
|
override fun validateConfig(config: Map<String, String?>): Boolean {
|
||||||
|
|||||||
Reference in New Issue
Block a user