summaryrefslogtreecommitdiff
path: root/frontend/src/components/settings
diff options
context:
space:
mode:
authorJonas Dellinger <jonas@dellinger.dev>2023-05-29 18:29:36 +0200
committerGitHub <noreply@github.com>2023-05-29 09:29:36 -0700
commit010feddf36646fb9695106bd64eab41e47e962fe (patch)
tree4619a5c0fc1b2c9ca475ce644cce18464c77ca3e /frontend/src/components/settings
parent5114bb57112bf8bbad30768ffd26803d464b19a2 (diff)
downloaddecky-loader-010feddf36646fb9695106bd64eab41e47e962fe.tar.gz
decky-loader-010feddf36646fb9695106bd64eab41e47e962fe.zip
Add update all button to plugin list (#466)
Diffstat (limited to 'frontend/src/components/settings')
-rw-r--r--frontend/src/components/settings/pages/plugin_list/index.tsx49
1 files changed, 43 insertions, 6 deletions
diff --git a/frontend/src/components/settings/pages/plugin_list/index.tsx b/frontend/src/components/settings/pages/plugin_list/index.tsx
index d7ff7bd9..ce349393 100644
--- a/frontend/src/components/settings/pages/plugin_list/index.tsx
+++ b/frontend/src/components/settings/pages/plugin_list/index.tsx
@@ -14,7 +14,12 @@ import { useTranslation } from 'react-i18next';
import { FaDownload, FaEllipsisH, FaRecycle } from 'react-icons/fa';
import { InstallType } from '../../../../plugin';
-import { StorePluginVersion, getPluginList, requestPluginInstall } from '../../../../store';
+import {
+ StorePluginVersion,
+ getPluginList,
+ requestMultiplePluginInstalls,
+ requestPluginInstall,
+} from '../../../../store';
import { useSetting } from '../../../../utils/hooks/useSetting';
import { useDeckyState } from '../../../DeckyState';
@@ -67,9 +72,9 @@ function PluginInteractables(props: { entry: ReorderableEntry<PluginData> }) {
onClick={() => requestPluginInstall(pluginName, data?.update as StorePluginVersion, InstallType.UPDATE)}
onOKButton={() => requestPluginInstall(pluginName, data?.update as StorePluginVersion, InstallType.UPDATE)}
>
- <div style={{ display: 'flex', flexDirection: 'row' }}>
+ <div style={{ display: 'flex', minWidth: '180px', justifyContent: 'space-between', alignItems: 'center' }}>
{t('PluginListIndex.update_to', { name: data?.update?.name })}
- <FaDownload style={{ paddingLeft: '2rem' }} />
+ <FaDownload style={{ paddingLeft: '1rem' }} />
</div>
</DialogButton>
) : (
@@ -78,14 +83,22 @@ function PluginInteractables(props: { entry: ReorderableEntry<PluginData> }) {
onClick={() => reinstallPlugin(pluginName, data?.version)}
onOKButton={() => reinstallPlugin(pluginName, data?.version)}
>
- <div style={{ display: 'flex', flexDirection: 'row' }}>
+ <div style={{ display: 'flex', minWidth: '180px', justifyContent: 'space-between', alignItems: 'center' }}>
{t('PluginListIndex.reinstall')}
- <FaRecycle style={{ paddingLeft: '5.3rem' }} />
+ <FaRecycle style={{ paddingLeft: '1rem' }} />
</div>
</DialogButton>
)}
<DialogButton
- style={{ height: '40px', width: '40px', padding: '10px 12px', minWidth: '40px' }}
+ style={{
+ height: '40px',
+ width: '40px',
+ padding: '10px 12px',
+ minWidth: '40px',
+ display: 'flex',
+ flexDirection: 'column',
+ justifyContent: 'center',
+ }}
onClick={showCtxMenu}
onOKButton={showCtxMenu}
>
@@ -146,6 +159,30 @@ export default function PluginList() {
return (
<DialogBody>
+ {updates && updates.size > 0 && (
+ <DialogButton
+ onClick={() =>
+ requestMultiplePluginInstalls(
+ [...updates.entries()].map(([plugin, selectedVer]) => ({
+ installType: InstallType.UPDATE,
+ plugin,
+ selectedVer,
+ })),
+ )
+ }
+ style={{
+ position: 'absolute',
+ top: '57px',
+ right: '2.8vw',
+ width: 'auto',
+ display: 'flex',
+ alignItems: 'center',
+ }}
+ >
+ {t('PluginListIndex.update_all', { count: updates.size })}
+ <FaDownload style={{ paddingLeft: '1rem' }} />
+ </DialogButton>
+ )}
<DialogControlsSection>
<ReorderableList<PluginData> entries={pluginEntries} onSave={onSave} interactables={PluginInteractables} />
</DialogControlsSection>