mirror of
https://github.com/SteamDeckHomebrew/decky-loader.git
synced 2026-06-17 08:47:49 +00:00
Add CEF Remote Debugging toggle (#129)
* feat: add CEF Remote Debugging toggle * feat: disable remote debugger on startup * refactor: stop debugger instead of disable * feat: add option to allow remote debugging by default Co-authored-by: TrainDoctor <traindoctor@protonmail.com>
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
import { Field, ToggleField } from 'decky-frontend-lib';
|
||||
import { useEffect, useState } from 'react';
|
||||
import { FaBug } from 'react-icons/fa';
|
||||
|
||||
export default function RemoteDebuggingSettings() {
|
||||
const [allowRemoteDebugging, setAllowRemoteDebugging] = useState<boolean>(false);
|
||||
useEffect(() => {
|
||||
(async () => {
|
||||
const res = (await window.DeckyPluginLoader.callServerMethod('remote_debugging_allowed')) as { result: boolean };
|
||||
setAllowRemoteDebugging(res.result);
|
||||
})();
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<Field
|
||||
label="Allow Remote CEF Debugging"
|
||||
description={
|
||||
<span style={{ whiteSpace: 'pre-line' }}>
|
||||
Allow unauthenticated access to the CEF debugger to anyone in your network
|
||||
</span>
|
||||
}
|
||||
icon={<FaBug style={{ display: 'block' }} />}
|
||||
>
|
||||
<ToggleField
|
||||
checked={allowRemoteDebugging}
|
||||
onChange={(toggleValue) => {
|
||||
setAllowRemoteDebugging(toggleValue);
|
||||
if (toggleValue) window.DeckyPluginLoader.callServerMethod('allow_remote_debugging');
|
||||
else window.DeckyPluginLoader.callServerMethod('disallow_remote_debugging');
|
||||
}}
|
||||
/>
|
||||
</Field>
|
||||
);
|
||||
}
|
||||
@@ -3,6 +3,7 @@ import { useState } from 'react';
|
||||
import { FaShapes } from 'react-icons/fa';
|
||||
|
||||
import { installFromURL } from '../../../store/Store';
|
||||
import RemoteDebuggingSettings from './RemoteDebugging';
|
||||
import UpdaterSettings from './Updater';
|
||||
|
||||
export default function GeneralSettings() {
|
||||
@@ -20,6 +21,7 @@ export default function GeneralSettings() {
|
||||
/>
|
||||
</Field> */}
|
||||
<UpdaterSettings />
|
||||
<RemoteDebuggingSettings />
|
||||
<Field
|
||||
label="Manual plugin install"
|
||||
description={<TextField label={'URL'} value={pluginURL} onChange={(e) => setPluginURL(e?.target.value)} />}
|
||||
|
||||
Reference in New Issue
Block a user