mirror of
https://github.com/whyour/qinglong.git
synced 2026-07-17 09:34:31 +08:00
修改初始系统状态逻辑已经错误页面
This commit is contained in:
+19
-6
@@ -98,8 +98,7 @@ export default function () {
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log(error);
|
||||
})
|
||||
.finally(() => setInitLoading(false));
|
||||
});
|
||||
};
|
||||
|
||||
const getUser = (needLoading = true) => {
|
||||
@@ -120,6 +119,22 @@ export default function () {
|
||||
});
|
||||
};
|
||||
|
||||
const getHealthStatus = () => {
|
||||
request
|
||||
.get(`${config.apiPrefix}public/health`)
|
||||
.then((res) => {
|
||||
if (res?.data?.status === 1) {
|
||||
getSystemInfo();
|
||||
} else {
|
||||
history.push('/error');
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
history.push('/error');
|
||||
})
|
||||
.finally(() => setInitLoading(false));
|
||||
};
|
||||
|
||||
const reloadUser = (needLoading = false) => {
|
||||
getUser(needLoading);
|
||||
};
|
||||
@@ -131,10 +146,8 @@ export default function () {
|
||||
}, [location.pathname]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!systemInfo) {
|
||||
getSystemInfo();
|
||||
}
|
||||
}, [systemInfo]);
|
||||
getHealthStatus();
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
if (theme === 'vs-dark') {
|
||||
|
||||
@@ -13,7 +13,8 @@
|
||||
.code-box {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
width: 80%;
|
||||
width: 80vw;
|
||||
height: 90vh;
|
||||
margin: 16px;
|
||||
background-color: #ffffff;
|
||||
border: 1px solid rgba(5, 5, 5, 0.06);
|
||||
|
||||
@@ -17,7 +17,7 @@ const Error = () => {
|
||||
needLoading && setLoading(true);
|
||||
request
|
||||
.get(`${config.apiPrefix}public/health`)
|
||||
.then(({ status, error }) => {
|
||||
.then(({ error, status }) => {
|
||||
if (status === 1) {
|
||||
return reloadUser();
|
||||
}
|
||||
@@ -53,10 +53,32 @@ const Error = () => {
|
||||
<div className="browser-markup"></div>
|
||||
<Alert
|
||||
type="error"
|
||||
message="服务启动超时,请检查如下日志或者进入容器执行 ql -l check 后刷新再试"
|
||||
message={
|
||||
<Typography.Title level={5} type="danger">
|
||||
服务启动超时
|
||||
</Typography.Title>
|
||||
}
|
||||
description={
|
||||
<Typography.Text type="danger">
|
||||
<div>
|
||||
请先按如下方式修复,如果无法解决,可结合日志
|
||||
<Typography.Link href="https://github.com/whyour/qinglong/issues/new?assignees=&labels=&template=bug_report.yml">
|
||||
提交 issue
|
||||
</Typography.Link>
|
||||
</div>
|
||||
<div>
|
||||
1. 宿主机执行 docker run --rm -v
|
||||
/var/run/docker.sock:/var/run/docker.sock
|
||||
containrrr/watchtower -cR <容器名>
|
||||
</div>
|
||||
<div>2. 容器内执行 ql -l check、ql -l update</div>
|
||||
</Typography.Text>
|
||||
}
|
||||
banner
|
||||
/>
|
||||
<Typography.Paragraph className="log">{data}</Typography.Paragraph>
|
||||
<Typography.Paragraph code className="log">
|
||||
{data}
|
||||
</Typography.Paragraph>
|
||||
</div>
|
||||
) : (
|
||||
<PageLoading tip="启动中,请稍后..." />
|
||||
|
||||
@@ -219,7 +219,7 @@ const Initialization = () => {
|
||||
<Button
|
||||
type="primary"
|
||||
onClick={() => {
|
||||
history.push('/login');
|
||||
window.location.reload();
|
||||
}}
|
||||
>
|
||||
去登录
|
||||
|
||||
Reference in New Issue
Block a user