mirror of
https://github.com/BrenBroZAYT/gameyfin.git
synced 2026-06-13 16:40:01 +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>
|
||||
{(pluginConfigMeta && pluginConfigMeta.length > 0) ?
|
||||
pluginConfigMeta.map((entry: any) => (
|
||||
<Input key={entry.key} name={entry.key} label={entry.name} type="text"/>
|
||||
pluginConfigMeta.map((entry: PluginConfigElement) => (
|
||||
<Input key={entry.key} name={entry.key} label={entry.name}
|
||||
type={entry.secret ? "password" : "text"}/>
|
||||
)) : "This plugin has no configuration options."
|
||||
}
|
||||
</ModalBody>
|
||||
|
||||
@@ -68,12 +68,12 @@ export function PluginManagementCard({plugin, updatePlugin}: {
|
||||
<div className="absolute right-0 top-0 flex flex-row">
|
||||
<Tooltip content={`${isDisabled(plugin.state) ? "Enable" : "Disable"} plugin`} placement="bottom"
|
||||
color="foreground">
|
||||
<Button isIconOnly variant="ghost" onPress={() => togglePluginEnabled()}>
|
||||
<Button isIconOnly variant="light" onPress={() => togglePluginEnabled()}>
|
||||
<Power/>
|
||||
</Button>
|
||||
</Tooltip>
|
||||
<Tooltip content="Configuration" placement="bottom" color="foreground">
|
||||
<Button isIconOnly variant="ghost" onPress={pluginDetailsModal.onOpen}>
|
||||
<Button isIconOnly variant="light" onPress={pluginDetailsModal.onOpen}>
|
||||
<SlidersHorizontal/>
|
||||
</Button>
|
||||
</Tooltip>
|
||||
|
||||
@@ -3,5 +3,6 @@ package de.grimsi.gameyfin.pluginapi.core
|
||||
data class PluginConfigElement(
|
||||
val key: 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(
|
||||
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 {
|
||||
|
||||
Reference in New Issue
Block a user