auto update policy

This commit is contained in:
tk103331
2023-01-05 10:39:46 +08:00
parent aa98d7dd2a
commit f646684f4d
8 changed files with 105 additions and 21 deletions

View File

@@ -23,7 +23,7 @@ const ChatLayout: FC<ChatLayoutProps> = ({ children }) => {
const go = useNavigate();
const checkAppUpdate = async () => {
await invoke('run_check_update');
await invoke('run_check_update', {silent: false});
}
return (

19
src/view/General.tsx vendored
View File

@@ -10,10 +10,17 @@ import { clone, omit, isEqual } from 'lodash';
import useInit from '@/hooks/useInit';
import { DISABLE_AUTO_COMPLETE, chatRoot } from '@/utils';
const CheckUpdateLabel = () => {
const AutoUpdateLabel = () => {
return (
<span>
Auto Check Update <Tooltip title={`check update on start`}><QuestionCircleOutlined style={{ color: '#1677ff' }} /></Tooltip>
Auto Update <Tooltip title={(
<div>
<div>Auto Update Policy</div>
<span><strong>Prompt</strong>: prompt to install</span><br/>
<span><strong>Silent</strong>: install silently</span><br/>
{/*<span><strong>Disable</strong>: disable auto update</span><br/>*/}
</div>
)}><QuestionCircleOutlined style={{ color: '#1677ff' }} /></Tooltip>
</span>
)
}
@@ -121,8 +128,12 @@ export default function General() {
<Form.Item label="Stay On Top" name="stay_on_top" valuePropName="checked">
<Switch />
</Form.Item>
<Form.Item label={<CheckUpdateLabel />} name="auto_check_update" valuePropName="checked">
<Switch />
<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={<GlobalShortcut />} name="global_shortcut">
<Input placeholder="CmdOrCtrl+Shift+O" {...DISABLE_AUTO_COMPLETE} />