2024-02-18 23:05:15 +00:00
|
|
|
import variables from 'config/variables';
|
2023-03-21 19:59:16 +00:00
|
|
|
import { useState, memo } from 'react';
|
2024-03-22 21:33:11 +00:00
|
|
|
import { Checkbox, Slider } from 'components/Form/Settings';
|
|
|
|
import { Button } from 'components/Elements';
|
2022-04-11 21:57:07 +00:00
|
|
|
import { TextField } from '@mui/material';
|
2021-08-15 21:28:37 +00:00
|
|
|
|
2024-02-19 09:42:59 +00:00
|
|
|
import EventBus from 'utils/eventbus';
|
|
|
|
import values from 'utils/data/slider_values.json';
|
2024-02-09 22:22:11 +00:00
|
|
|
|
2024-03-22 21:33:11 +00:00
|
|
|
import { Row, Content, Action } from 'components/Layout/Settings/Item/SettingsItem';
|
2021-03-31 20:54:16 +00:00
|
|
|
|
2024-03-01 21:24:42 +00:00
|
|
|
function ExperimentalOptions() {
|
2021-11-14 14:44:16 +00:00
|
|
|
const [eventType, setEventType] = useState();
|
|
|
|
const [eventName, setEventName] = useState();
|
2021-03-31 20:54:16 +00:00
|
|
|
|
2021-02-28 20:30:57 +00:00
|
|
|
return (
|
2021-03-22 22:17:52 +00:00
|
|
|
<>
|
2022-08-16 15:38:22 +00:00
|
|
|
<span className="mainTitle">
|
2022-08-26 09:45:32 +00:00
|
|
|
{variables.getMessage('modals.main.settings.sections.experimental.title')}
|
2022-08-16 15:38:22 +00:00
|
|
|
</span>
|
|
|
|
<span className="subtitle">
|
2022-08-26 09:45:32 +00:00
|
|
|
{variables.getMessage('modals.main.settings.sections.experimental.warning')}
|
2022-08-16 15:38:22 +00:00
|
|
|
</span>
|
2024-02-09 22:22:11 +00:00
|
|
|
<Row>
|
|
|
|
<Content
|
|
|
|
title={variables.getMessage('modals.main.settings.sections.experimental.developer')}
|
2022-08-16 15:38:22 +00:00
|
|
|
/>
|
2024-02-09 22:22:11 +00:00
|
|
|
<Action>
|
|
|
|
<Checkbox name="debug" text="Debug hotkey (Ctrl + #)" element=".other" />
|
|
|
|
<Slider
|
|
|
|
title="Debug timeout"
|
|
|
|
name="debugtimeout"
|
|
|
|
min="0"
|
|
|
|
max="5000"
|
|
|
|
default="0"
|
|
|
|
step="100"
|
2024-02-19 09:42:59 +00:00
|
|
|
marks={values.experimental}
|
2024-02-09 22:22:11 +00:00
|
|
|
element=".other"
|
|
|
|
/>
|
|
|
|
<p style={{ textAlign: 'left' }}>Send Event</p>
|
|
|
|
<TextField
|
|
|
|
label={'Type'}
|
|
|
|
value={eventType}
|
|
|
|
onChange={(e) => setEventType(e.target.value)}
|
|
|
|
spellCheck={false}
|
|
|
|
varient="outlined"
|
|
|
|
InputLabelProps={{ shrink: true }}
|
|
|
|
/>
|
|
|
|
<TextField
|
|
|
|
label={'Name'}
|
|
|
|
value={eventName}
|
|
|
|
onChange={(e) => setEventName(e.target.value)}
|
|
|
|
spellCheck={false}
|
|
|
|
varient="outlined"
|
|
|
|
InputLabelProps={{ shrink: true }}
|
|
|
|
/>
|
2024-03-22 21:33:11 +00:00
|
|
|
<Button
|
|
|
|
type="settings"
|
|
|
|
onClick={() => EventBus.emit(eventType, eventName)}
|
|
|
|
label="send"
|
|
|
|
/>
|
2024-02-09 22:22:11 +00:00
|
|
|
</Action>
|
|
|
|
</Row>
|
|
|
|
<Row final={true}>
|
|
|
|
<Content title="Data" />
|
|
|
|
<Action>
|
2024-03-22 21:33:11 +00:00
|
|
|
<Button type="settings" onClick={() => localStorage.clear()} label="Clear LocalStorage" />
|
2024-02-09 22:22:11 +00:00
|
|
|
</Action>
|
|
|
|
</Row>
|
2021-03-22 22:17:52 +00:00
|
|
|
</>
|
2021-02-28 20:30:57 +00:00
|
|
|
);
|
2021-03-17 13:01:53 +00:00
|
|
|
}
|
2022-10-30 16:56:26 +00:00
|
|
|
|
2024-03-01 21:24:42 +00:00
|
|
|
const MemoizedExperimentalOptions = memo(ExperimentalOptions);
|
|
|
|
export {
|
|
|
|
MemoizedExperimentalOptions as default,
|
|
|
|
MemoizedExperimentalOptions as ExperimentalOptions,
|
|
|
|
};
|