mirror of
https://github.com/BetterSEQTA/BetterSEQTA-Plus.git
synced 2026-06-06 03:34:40 +00:00
feat: add global theme toggle
This commit is contained in:
@@ -5,8 +5,8 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>BetterSEQTA+ Settings</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<body class="h-[600px]">
|
||||
<div id="app" style="height: 100%;"></div>
|
||||
<script type="module" src="./index.ts"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -25,6 +25,7 @@
|
||||
interface Plugin {
|
||||
pluginId: string;
|
||||
name: string;
|
||||
description: string;
|
||||
settings: Record<string, PluginSetting>;
|
||||
}
|
||||
|
||||
@@ -78,6 +79,23 @@
|
||||
pluginSettings.forEach(plugin => {
|
||||
if (Object.keys(plugin.settings).length === 0) return;
|
||||
|
||||
// Add enable/disable toggle if plugin has disableToggle set
|
||||
if ((plugin as any).disableToggle) {
|
||||
entries.push({
|
||||
title: `Enable ${plugin.name}`,
|
||||
description: `${plugin.description}`,
|
||||
id: getPluginSettingId(plugin.pluginId, 'enabled'),
|
||||
Component: Switch,
|
||||
props: {
|
||||
state: pluginSettingsValues[plugin.pluginId]?.enabled ?? true,
|
||||
onChange: (value: boolean) => {
|
||||
updatePluginSetting(plugin.pluginId, 'enabled', value);
|
||||
// The plugin manager will handle the actual enabling/disabling
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Object.entries(plugin.settings).forEach(([key, setting]) => {
|
||||
const id = getPluginSettingId(plugin.pluginId, key);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user