summaryrefslogtreecommitdiff
path: root/frontend/src/components/settings/pages
diff options
context:
space:
mode:
Diffstat (limited to 'frontend/src/components/settings/pages')
-rw-r--r--frontend/src/components/settings/pages/developer/index.tsx24
-rw-r--r--frontend/src/components/settings/pages/plugin_list/index.tsx18
2 files changed, 40 insertions, 2 deletions
diff --git a/frontend/src/components/settings/pages/developer/index.tsx b/frontend/src/components/settings/pages/developer/index.tsx
index 774bb449..200f13ab 100644
--- a/frontend/src/components/settings/pages/developer/index.tsx
+++ b/frontend/src/components/settings/pages/developer/index.tsx
@@ -4,12 +4,13 @@ import {
DialogControlsSection,
DialogControlsSectionHeader,
Field,
+ Navigation,
TextField,
Toggle,
} from 'decky-frontend-lib';
import { useRef, useState } from 'react';
import { useTranslation } from 'react-i18next';
-import { FaFileArchive, FaLink, FaReact, FaSteamSymbol } from 'react-icons/fa';
+import { FaFileArchive, FaLink, FaReact, FaSteamSymbol, FaTerminal } from 'react-icons/fa';
import { setShouldConnectToReactDevTools, setShowValveInternal } from '../../../../developer';
import { installFromURL } from '../../../../store';
@@ -75,6 +76,27 @@ export default function DeveloperSettings() {
</DialogControlsSection>
<DialogControlsSection>
<DialogControlsSectionHeader>{t('SettingsDeveloperIndex.header')}</DialogControlsSectionHeader>
+ <Field
+ label={t('SettingsDeveloperIndex.cef_console.label')}
+ description={<span style={{ whiteSpace: 'pre-line' }}>{t('SettingsDeveloperIndex.cef_console.desc')}</span>}
+ icon={<FaTerminal style={{ display: 'block' }} />}
+ >
+ <DialogButton
+ onClick={async () => {
+ let res = await window.DeckyPluginLoader.callServerMethod('get_tab_id', { name: 'SharedJSContext' });
+ if (res.success) {
+ Navigation.NavigateToExternalWeb(
+ 'localhost:8080/devtools/inspector.html?ws=localhost:8080/devtools/page/' + res.result,
+ );
+ } else {
+ console.error('Unable to find ID for SharedJSContext tab ', res.result);
+ Navigation.NavigateToExternalWeb('localhost:8080');
+ }
+ }}
+ >
+ {t('SettingsDeveloperIndex.cef_console.button')}
+ </DialogButton>
+ </Field>
<RemoteDebuggingSettings />
<Field
label={t('SettingsDeveloperIndex.valve_internal.label')}
diff --git a/frontend/src/components/settings/pages/plugin_list/index.tsx b/frontend/src/components/settings/pages/plugin_list/index.tsx
index 17f6d99d..fab8ec2b 100644
--- a/frontend/src/components/settings/pages/plugin_list/index.tsx
+++ b/frontend/src/components/settings/pages/plugin_list/index.tsx
@@ -44,7 +44,23 @@ function PluginInteractables(props: { entry: ReorderableEntry<PluginData> }) {
const showCtxMenu = (e: MouseEvent | GamepadEvent) => {
showContextMenu(
<Menu label={t('PluginListIndex.plugin_actions')}>
- <MenuItem onSelected={() => window.DeckyPluginLoader.importPlugin(pluginName, data?.version)}>
+ <MenuItem
+ onSelected={() => {
+ try {
+ fetch(`http://127.0.0.1:1337/plugins/${pluginName}/reload`, {
+ method: 'POST',
+ credentials: 'include',
+ headers: {
+ Authentication: window.deckyAuthToken,
+ },
+ });
+ } catch (err) {
+ console.error('Error Reloading Plugin Backend', err);
+ }
+
+ window.DeckyPluginLoader.importPlugin(pluginName, data?.version);
+ }}
+ >
{t('PluginListIndex.reload')}
</MenuItem>
<MenuItem