fix: system info mobile view (#1261)

This commit is contained in:
Chell
2022-11-05 15:46:52 +01:00
committed by GitHub
parent 8d686411ee
commit 07ed834b27

View File

@ -90,18 +90,19 @@ class SystemInfo extends React.Component {
</div> : i18next.t("system:Get Memory Usage Failed") </div> : i18next.t("system:Get Memory Usage Failed")
); );
if (!Setting.isMobile()) {
return ( return (
<Row> <Row>
<Col span={6}></Col> <Col span={6}></Col>
<Col span={12}> <Col span={12}>
<Row gutter={[10, 10]}> <Row gutter={[10, 10]}>
<Col span={12}> <Col span={12}>
<Card title={i18next.t("system:CPU Usage")} bordered={true} style={{textAlign: "center"}}> <Card title={i18next.t("system:CPU Usage")} bordered={true} style={{textAlign: "center", height: "100%"}}>
{this.state.loading ? <Spin size="large" /> : CPUInfo} {this.state.loading ? <Spin size="large" /> : CPUInfo}
</Card> </Card>
</Col> </Col>
<Col span={12}> <Col span={12}>
<Card title={i18next.t("system:Memory Usage")} bordered={true} style={{textAlign: "center"}}> <Card title={i18next.t("system:Memory Usage")} bordered={true} style={{textAlign: "center", height: "100%"}}>
{this.state.loading ? <Spin size="large" /> : MemInfo} {this.state.loading ? <Spin size="large" /> : MemInfo}
</Card> </Card>
</Col> </Col>
@ -121,6 +122,34 @@ class SystemInfo extends React.Component {
<Col span={6}></Col> <Col span={6}></Col>
</Row> </Row>
); );
} else {
return (
<Row gutter={[16, 0]}>
<Col span={24}>
<Card title={i18next.t("system:CPU Usage")} bordered={true} style={{textAlign: "center", width: "100%"}}>
{this.state.loading ? <Spin size="large" /> : CPUInfo}
</Card>
</Col>
<Col span={24}>
<Card title={i18next.t("system:Memory Usage")} bordered={true} style={{textAlign: "center", width: "100%"}}>
{this.state.loading ? <Spin size="large" /> : MemInfo}
</Card>
</Col>
<Col span={24}>
<Card title={i18next.t("system:About Casdoor")} bordered={true} style={{textAlign: "center"}}>
<div>{i18next.t("system:An Identity and Access Management (IAM) / Single-Sign-On (SSO) platform with web UI supporting OAuth 2.0, OIDC, SAML and CAS")}</div>
GitHub: <a href="https://github.com/casdoor/casdoor">casdoor</a>
<br />
{i18next.t("system:Version")}: <a href={this.state.href}>{this.state.latestVersion}</a>
<br />
{i18next.t("system:Official Website")}: <a href="https://casdoor.org/">casdoor.org</a>
<br />
{i18next.t("system:Community")}: <a href="https://casdoor.org/#:~:text=Casdoor%20API-,Community,-GitHub">contact us</a>
</Card>
</Col>
</Row>
);
}
} }
} }