From 968c8b113c4ec52d121520aac7879a31c2856446 Mon Sep 17 00:00:00 2001 From: marios Date: Tue, 7 Oct 2025 02:40:41 +0300 Subject: working plugin disable, not tested extensively --- .../settings/pages/plugin_list/PluginListLabel.tsx | 19 ++++++++++++++++-- .../settings/pages/plugin_list/index.tsx | 13 +++++++----- frontend/src/plugin-loader.tsx | 23 ++++++++++++++++++---- 3 files changed, 44 insertions(+), 11 deletions(-) (limited to 'frontend/src') diff --git a/frontend/src/components/settings/pages/plugin_list/PluginListLabel.tsx b/frontend/src/components/settings/pages/plugin_list/PluginListLabel.tsx index fec03e56..416d693e 100644 --- a/frontend/src/components/settings/pages/plugin_list/PluginListLabel.tsx +++ b/frontend/src/components/settings/pages/plugin_list/PluginListLabel.tsx @@ -1,15 +1,16 @@ import { FC } from 'react'; import { useTranslation } from 'react-i18next'; -import { FaEyeSlash, FaLock } from 'react-icons/fa'; +import { FaEyeSlash, FaLock, FaMoon } from 'react-icons/fa'; interface PluginListLabelProps { frozen: boolean; hidden: boolean; + disabled: boolean; name: string; version?: string; } -const PluginListLabel: FC = ({ name, frozen, hidden, version }) => { +const PluginListLabel: FC = ({ name, frozen, hidden, version, disabled }) => { const { t } = useTranslation(); return (
@@ -43,6 +44,20 @@ const PluginListLabel: FC = ({ name, frozen, hidden, versi {t('PluginListLabel.hidden')}
)} + {disabled && ( +
+ + {t('PluginListLabel.disabled')} +
+ )} ); }; diff --git a/frontend/src/components/settings/pages/plugin_list/index.tsx b/frontend/src/components/settings/pages/plugin_list/index.tsx index da70f4ca..b21e4933 100644 --- a/frontend/src/components/settings/pages/plugin_list/index.tsx +++ b/frontend/src/components/settings/pages/plugin_list/index.tsx @@ -13,7 +13,7 @@ import { useEffect, useState } from 'react'; import { useTranslation } from 'react-i18next'; import { FaDownload, FaEllipsisH, FaRecycle } from 'react-icons/fa'; -import { InstallType } from '../../../../plugin'; +import { enablePlugin, InstallType } from '../../../../plugin'; import { StorePluginVersion, getPluginList, @@ -84,9 +84,11 @@ function PluginInteractables(props: { entry: ReorderableEntry } {t('PluginListIndex.uninstall')} {disabled ? - // implement enabler - <> - : + enablePlugin(name)} + > + {t('PluginListIndex.plugin_enable')} + : DeckyPluginLoader.disablePlugin( @@ -188,7 +190,8 @@ export default function PluginList({ isDeveloper }: { isDeveloper: boolean }) { const hidden = hiddenPlugins.includes(name); return { - label: