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,37 +90,66 @@ class SystemInfo extends React.Component {
</div> : i18next.t("system:Get Memory Usage Failed") </div> : i18next.t("system:Get Memory Usage Failed")
); );
return ( if (!Setting.isMobile()) {
<Row> return (
<Col span={6}></Col> <Row>
<Col span={12}> <Col span={6}></Col>
<Row gutter={[10, 10]}> <Col span={12}>
<Col span={12}> <Row gutter={[10, 10]}>
<Card title={i18next.t("system:CPU Usage")} bordered={true} style={{textAlign: "center"}}> <Col span={12}>
{this.state.loading ? <Spin size="large" /> : CPUInfo} <Card title={i18next.t("system:CPU Usage")} bordered={true} style={{textAlign: "center", height: "100%"}}>
</Card> {this.state.loading ? <Spin size="large" /> : CPUInfo}
</Col> </Card>
<Col span={12}> </Col>
<Card title={i18next.t("system:Memory Usage")} bordered={true} style={{textAlign: "center"}}> <Col span={12}>
{this.state.loading ? <Spin size="large" /> : MemInfo} <Card title={i18next.t("system:Memory Usage")} bordered={true} style={{textAlign: "center", height: "100%"}}>
</Card> {this.state.loading ? <Spin size="large" /> : MemInfo}
</Col> </Card>
</Row> </Col>
<Divider /> </Row>
<Card title={i18next.t("system:About Casdoor")} bordered={true} style={{textAlign: "center"}}> <Divider />
<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> <Card title={i18next.t("system:About Casdoor")} bordered={true} style={{textAlign: "center"}}>
GitHub: <a href="https://github.com/casdoor/casdoor">casdoor</a> <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>
<br /> GitHub: <a href="https://github.com/casdoor/casdoor">casdoor</a>
{i18next.t("system:Version")}: <a href={this.state.href}>{this.state.latestVersion}</a> <br />
<br /> {i18next.t("system:Version")}: <a href={this.state.href}>{this.state.latestVersion}</a>
{i18next.t("system:Official Website")}: <a href="https://casdoor.org/">casdoor.org</a> <br />
<br /> {i18next.t("system:Official Website")}: <a href="https://casdoor.org/">casdoor.org</a>
{i18next.t("system:Community")}: <a href="https://casdoor.org/#:~:text=Casdoor%20API-,Community,-GitHub">contact us</a> <br />
</Card> {i18next.t("system:Community")}: <a href="https://casdoor.org/#:~:text=Casdoor%20API-,Community,-GitHub">contact us</a>
</Col> </Card>
<Col span={6}></Col> </Col>
</Row> <Col span={6}></Col>
); </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>
);
}
} }
} }