mirror of
https://github.com/FranP-code/ChatGPT.git
synced 2025-10-13 00:13:25 +00:00
chore: dashboard
This commit is contained in:
89
src/view/settings/General.tsx
vendored
89
src/view/settings/General.tsx
vendored
@@ -6,6 +6,49 @@ import { platform } from '@tauri-apps/api/os';
|
||||
import useInit from '@/hooks/useInit';
|
||||
import { DISABLE_AUTO_COMPLETE } from '@/utils';
|
||||
|
||||
export default function General() {
|
||||
const [platformInfo, setPlatform] = useState('');
|
||||
|
||||
useInit(async () => {
|
||||
setPlatform(await platform());
|
||||
});
|
||||
|
||||
return (
|
||||
<>
|
||||
<Form.Item label="Stay On Top" name="stay_on_top" valuePropName="checked">
|
||||
<Switch />
|
||||
</Form.Item>
|
||||
{platformInfo === 'darwin' && (
|
||||
<Form.Item label="Titlebar" name="titlebar" valuePropName="checked">
|
||||
<Switch />
|
||||
</Form.Item>
|
||||
)}
|
||||
{platformInfo === 'darwin' && (
|
||||
<Form.Item label="Hide Dock Icon" name="hide_dock_icon" valuePropName="checked">
|
||||
<Switch />
|
||||
</Form.Item>
|
||||
)}
|
||||
<Form.Item label="Theme" name="theme">
|
||||
<Radio.Group>
|
||||
<Radio value="Light">Light</Radio>
|
||||
<Radio value="Dark">Dark</Radio>
|
||||
{['darwin', 'windows'].includes(platformInfo) && <Radio value="System">System</Radio>}
|
||||
</Radio.Group>
|
||||
</Form.Item>
|
||||
<Form.Item label={<AutoUpdateLabel />} name="auto_update">
|
||||
<Radio.Group>
|
||||
<Radio value="Prompt">Prompt</Radio>
|
||||
<Radio value="Silent">Silent</Radio>
|
||||
{/*<Radio value="Disable">Disable</Radio>*/}
|
||||
</Radio.Group>
|
||||
</Form.Item>
|
||||
<Form.Item label={<GlobalShortcutLabel />} name="global_shortcut">
|
||||
<Input placeholder="CmdOrCtrl+Shift+O" {...DISABLE_AUTO_COMPLETE} />
|
||||
</Form.Item>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
const AutoUpdateLabel = () => {
|
||||
return (
|
||||
<span>
|
||||
@@ -50,49 +93,3 @@ const GlobalShortcutLabel = () => {
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default function General() {
|
||||
const [platformInfo, setPlatform] = useState('');
|
||||
|
||||
useInit(async () => {
|
||||
setPlatform(await platform());
|
||||
});
|
||||
|
||||
return (
|
||||
<>
|
||||
<Form.Item label="Dashboard" name="dashboard" valuePropName="checked">
|
||||
<Switch />
|
||||
</Form.Item>
|
||||
<Form.Item label="Stay On Top" name="stay_on_top" valuePropName="checked">
|
||||
<Switch />
|
||||
</Form.Item>
|
||||
{platformInfo === 'darwin' && (
|
||||
<Form.Item label="Titlebar" name="titlebar" valuePropName="checked">
|
||||
<Switch />
|
||||
</Form.Item>
|
||||
)}
|
||||
{platformInfo === 'darwin' && (
|
||||
<Form.Item label="Hide Dock Icon" name="hide_dock_icon" valuePropName="checked">
|
||||
<Switch />
|
||||
</Form.Item>
|
||||
)}
|
||||
<Form.Item label="Theme" name="theme">
|
||||
<Radio.Group>
|
||||
<Radio value="Light">Light</Radio>
|
||||
<Radio value="Dark">Dark</Radio>
|
||||
{['darwin', 'windows'].includes(platformInfo) && <Radio value="System">System</Radio>}
|
||||
</Radio.Group>
|
||||
</Form.Item>
|
||||
<Form.Item label={<AutoUpdateLabel />} name="auto_update">
|
||||
<Radio.Group>
|
||||
<Radio value="Prompt">Prompt</Radio>
|
||||
<Radio value="Silent">Silent</Radio>
|
||||
{/*<Radio value="Disable">Disable</Radio>*/}
|
||||
</Radio.Group>
|
||||
</Form.Item>
|
||||
<Form.Item label={<GlobalShortcutLabel />} name="global_shortcut">
|
||||
<Input placeholder="CmdOrCtrl+Shift+O" {...DISABLE_AUTO_COMPLETE} />
|
||||
</Form.Item>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
2
src/view/settings/MainWindow.tsx
vendored
2
src/view/settings/MainWindow.tsx
vendored
@@ -36,7 +36,7 @@ export default function General() {
|
||||
<Form.Item label={<PopupSearchLabel />} name="popup_search" valuePropName="checked">
|
||||
<Switch />
|
||||
</Form.Item>
|
||||
<SwitchOrigin name="origin" />
|
||||
<SwitchOrigin name="main" />
|
||||
<Form.Item label="User Agent (Main)" name="ua_window">
|
||||
<Input.TextArea
|
||||
autoSize={{ minRows: 4, maxRows: 4 }}
|
||||
|
||||
2
src/view/settings/TrayWindow.tsx
vendored
2
src/view/settings/TrayWindow.tsx
vendored
@@ -23,7 +23,7 @@ export default function General() {
|
||||
<Form.Item label="Enable SystemTray" name="tray" valuePropName="checked">
|
||||
<Switch />
|
||||
</Form.Item>
|
||||
<SwitchOrigin name="tray_origin" />
|
||||
<SwitchOrigin name="tray" />
|
||||
<Form.Item label={<UALabel />} name="ua_tray">
|
||||
<Input.TextArea
|
||||
autoSize={{ minRows: 4, maxRows: 4 }}
|
||||
|
||||
Reference in New Issue
Block a user