Skip to content

Commit 68879c3

Browse files
author
tangtanglove
committed
fix bug
1 parent fb4fb88 commit 68879c3

File tree

1 file changed

+57
-51
lines changed

1 file changed

+57
-51
lines changed

src/pages/Quark/components/Upgrade.tsx

Lines changed: 57 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -121,57 +121,63 @@ const Upgrade: React.FC<any> = props => {
121121
</Tooltip>
122122
}
123123
</Affix>
124-
<Modal
125-
title={'当前版本'+upgradeInfo.app_version}
126-
visible={upgradeModalVisible}
127-
onOk={() => setUpgradeModalVisible(false)}
128-
onCancel={() => setUpgradeModalVisible(false)}
129-
footer={null}
130-
width={350}
131-
>
132-
<div>
133-
<div>{upgradeInfo.next_package.version} 更新日志:</div>
134-
<pre style={{minHeight:250}}>
135-
{upgradeInfo.next_package.description}
136-
</pre>
137-
<div style={{textAlign:'center'}}>
138-
<Space>
139-
<Popconfirm
140-
title="已经对系统进行了备份?"
141-
onConfirm={showModal}
142-
okText="是"
143-
cancelText="否"
144-
>
145-
<Button type="primary">立即升级</Button>
146-
</Popconfirm>
147-
<Button onClick={() => setUpgradeModalVisible(false)}>暂不升级</Button>
148-
</Space>
149-
</div>
150-
</div>
151-
</Modal>
152-
<Modal
153-
title="系统升级"
154-
visible={upgradingModalVisible}
155-
width={'860px'}
156-
footer={false}
157-
closable={false}
158-
>
159-
<div>正在进行 {upgradeInfo.next_package.version} 版本升级,此过程将会持续几分钟,请您耐心等待。</div>
160-
<div style={{marginTop:20}}>
161-
<Steps size="small" current={currentStep}>
162-
{steps.map((step:any,key:any) => {
163-
return <Steps.Step key={step.key} title={step.title} icon={(currentStep==key+1) ? <LoadingOutlined /> : false} />
164-
})}
165-
</Steps>
166-
</div>
167-
<div style={{ textAlign: 'center',marginTop:20 }}>
168-
<Progress type="circle" percent={steps[currentStep-1]['percent']} />
169-
</div>
170-
<div style={{ textAlign: 'center',marginTop:20 }}>
171-
{steps[currentStep-1]['tip']}
172-
<span><span style={{ color: '#cf1322' }}>系统升级中,请勿关闭本页面</span></span>
173-
</div>
174-
</Modal>
124+
{canUpgrade ?
125+
<>
126+
<Modal
127+
title={'当前版本'+upgradeInfo.app_version}
128+
visible={upgradeModalVisible}
129+
onOk={() => setUpgradeModalVisible(false)}
130+
onCancel={() => setUpgradeModalVisible(false)}
131+
footer={null}
132+
width={350}
133+
>
134+
<div>
135+
<div>{upgradeInfo.next_package.version} 更新日志:</div>
136+
<pre style={{minHeight:250}}>
137+
{upgradeInfo.next_package.description}
138+
</pre>
139+
<div style={{textAlign:'center'}}>
140+
<Space>
141+
<Popconfirm
142+
title="已经对系统进行了备份?"
143+
onConfirm={showModal}
144+
okText="是"
145+
cancelText="否"
146+
>
147+
<Button type="primary">立即升级</Button>
148+
</Popconfirm>
149+
<Button onClick={() => setUpgradeModalVisible(false)}>暂不升级</Button>
150+
</Space>
151+
</div>
152+
</div>
153+
</Modal>
154+
<Modal
155+
title="系统升级"
156+
visible={upgradingModalVisible}
157+
width={'860px'}
158+
footer={false}
159+
closable={false}
160+
>
161+
<div>正在进行 {upgradeInfo.next_package.version} 版本升级,此过程将会持续几分钟,请您耐心等待。</div>
162+
<div style={{marginTop:20}}>
163+
<Steps size="small" current={currentStep}>
164+
{steps.map((step:any,key:any) => {
165+
return <Steps.Step key={step.key} title={step.title} icon={(currentStep==key+1) ? <LoadingOutlined /> : false} />
166+
})}
167+
</Steps>
168+
</div>
169+
<div style={{ textAlign: 'center',marginTop:20 }}>
170+
<Progress type="circle" percent={steps[currentStep-1]['percent']} />
171+
</div>
172+
<div style={{ textAlign: 'center',marginTop:20 }}>
173+
{steps[currentStep-1]['tip']}
174+
<span><span style={{ color: '#cf1322' }}>系统升级中,请勿关闭本页面</span></span>
175+
</div>
176+
</Modal>
177+
</>
178+
:
179+
null
180+
}
175181
</>
176182
);
177183
};

0 commit comments

Comments
 (0)