添加ql -l update

This commit is contained in:
hanhh
2021-10-13 23:45:46 +08:00
parent 7335e2c299
commit ec0deeff06
2 changed files with 35 additions and 22 deletions
+18 -19
View File
@@ -106,6 +106,24 @@ const CheckUpdate = ({ ws }: any) => {
useEffect(() => {
ws.onmessage = (e) => {
setValue(value + e.data);
modalRef.current.update({
content: (
<div style={{ height: '60vh', overflowY: 'auto' }}>
<pre
style={{
wordBreak: 'break-all',
whiteSpace: 'pre-wrap',
paddingTop: 15,
fontSize: 12,
fontWeight: 400,
}}
>
{value + e.data}
</pre>
</div>
),
});
if (e.data.includes('重启面板')) {
message.warning({
content: (
@@ -124,25 +142,6 @@ const CheckUpdate = ({ ws }: any) => {
setTimeout(() => {
window.location.reload();
}, 10000);
} else {
modalRef.current.update({
content: (
<div style={{ height: '60vh', overflowY: 'auto' }}>
<pre
style={{
wordBreak: 'break-all',
whiteSpace: 'pre-wrap',
paddingTop: 15,
fontSize: 12,
fontWeight: 400,
}}
>
{value + e.data}
</pre>
</div>
),
});
setValue(e.data);
}
};
}, []);