mirror of
https://github.com/whyour/qinglong.git
synced 2026-08-13 04:02:56 +08:00
系统设置增加重启
This commit is contained in:
@@ -77,7 +77,11 @@ const CheckUpdate = ({ systemInfo }: any) => {
|
||||
</div>
|
||||
</>
|
||||
),
|
||||
content: <pre><Ansi>{lastLog}</Ansi></pre>,
|
||||
content: (
|
||||
<pre>
|
||||
<Ansi>{lastLog}</Ansi>
|
||||
</pre>
|
||||
),
|
||||
okText: intl.get('下载更新'),
|
||||
cancelText: intl.get('以后再说'),
|
||||
onOk() {
|
||||
@@ -102,10 +106,41 @@ const CheckUpdate = ({ systemInfo }: any) => {
|
||||
okButtonProps: { disabled: true },
|
||||
title: intl.get('下载更新中...'),
|
||||
centered: true,
|
||||
content: <pre><Ansi>{value}</Ansi></pre>,
|
||||
content: (
|
||||
<pre>
|
||||
<Ansi>{value}</Ansi>
|
||||
</pre>
|
||||
),
|
||||
});
|
||||
};
|
||||
|
||||
const reloadSystem = () => {
|
||||
request
|
||||
.put(`${config.apiPrefix}system/reload`, { type: 'system' })
|
||||
.then((_data: any) => {
|
||||
message.success({
|
||||
content: (
|
||||
<span>
|
||||
{intl.get('系统将在')}
|
||||
<Countdown
|
||||
className="inline-countdown"
|
||||
format="ss"
|
||||
value={Date.now() + 1000 * 30}
|
||||
/>
|
||||
{intl.get('秒后自动刷新')}
|
||||
</span>
|
||||
),
|
||||
duration: 30,
|
||||
});
|
||||
setTimeout(() => {
|
||||
window.location.reload();
|
||||
}, 30000);
|
||||
})
|
||||
.catch((error: any) => {
|
||||
console.log(error);
|
||||
});
|
||||
};
|
||||
|
||||
const showReloadModal = () => {
|
||||
Modal.confirm({
|
||||
width: 600,
|
||||
@@ -115,30 +150,7 @@ const CheckUpdate = ({ systemInfo }: any) => {
|
||||
content: intl.get('系统安装包下载成功,确认重启'),
|
||||
okText: intl.get('重启'),
|
||||
onOk() {
|
||||
request
|
||||
.put(`${config.apiPrefix}system/reload`, { type: 'system' })
|
||||
.then((_data: any) => {
|
||||
message.success({
|
||||
content: (
|
||||
<span>
|
||||
{intl.get('系统将在')}
|
||||
<Countdown
|
||||
className="inline-countdown"
|
||||
format="ss"
|
||||
value={Date.now() + 1000 * 30}
|
||||
/>
|
||||
{intl.get('秒后自动刷新')}
|
||||
</span>
|
||||
),
|
||||
duration: 30,
|
||||
});
|
||||
setTimeout(() => {
|
||||
window.location.reload();
|
||||
}, 30000);
|
||||
})
|
||||
.catch((error: any) => {
|
||||
console.log(error);
|
||||
});
|
||||
reloadSystem();
|
||||
},
|
||||
onCancel() {
|
||||
modalRef.current.update({
|
||||
@@ -206,6 +218,9 @@ const CheckUpdate = ({ systemInfo }: any) => {
|
||||
<Button type="primary" onClick={checkUpgrade}>
|
||||
{intl.get('检查更新')}
|
||||
</Button>
|
||||
<Button type="primary" onClick={reloadSystem} style={{ marginLeft: 8 }}>
|
||||
{intl.get('重新启动')}
|
||||
</Button>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user