-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
74 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,13 @@ | ||
# Copyright: (c) OpenSpug Organization. https://github.com/openspug/spug | ||
# Copyright: (c) <[email protected]> | ||
# Released under the MIT License. | ||
import django | ||
from django.views.generic import View | ||
from django.conf import settings | ||
from libs import JsonParser, Argument, json_response | ||
from apps.setting.utils import AppSetting | ||
from apps.setting.models import Setting | ||
import platform | ||
import ldap | ||
|
||
|
||
|
@@ -41,5 +44,13 @@ def ldap_test(request): | |
return json_response(error=error) | ||
|
||
|
||
def get_about(request): | ||
return json_response({ | ||
'python_version': platform.python_version(), | ||
'system_version': platform.platform(), | ||
'spug_version': settings.SPUG_VERSION, | ||
'django_version': django.get_version() | ||
}) | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/** | ||
* Copyright (c) OpenSpug Organization. https://github.com/openspug/spug | ||
* Copyright (c) <[email protected]> | ||
* Released under the MIT License. | ||
*/ | ||
import React from 'react'; | ||
import styles from './index.module.css'; | ||
import { Descriptions, Spin } from "antd"; | ||
import { observer } from 'mobx-react' | ||
import { http } from 'libs'; | ||
|
||
|
||
@observer | ||
class About extends React.Component { | ||
constructor(props) { | ||
super(props); | ||
this.state = { | ||
fetching: true, | ||
info: {} | ||
} | ||
} | ||
|
||
componentDidMount() { | ||
http.get('/api/setting/about/') | ||
.then(res => this.setState({info: res})) | ||
.finally(() => this.setState({fetching: false})) | ||
} | ||
|
||
|
||
render() { | ||
const {info, fetching} = this.state; | ||
return ( | ||
<Spin spinning={fetching}> | ||
<div className={styles.title}>关于</div> | ||
<Descriptions column={1}> | ||
<Descriptions.Item label="操作系统">{info['system_version']}</Descriptions.Item> | ||
<Descriptions.Item label="Python版本">{info['python_version']}</Descriptions.Item> | ||
<Descriptions.Item label="Django版本">{info['django_version']}</Descriptions.Item> | ||
<Descriptions.Item label="Spug版本">{info['spug_version']}</Descriptions.Item> | ||
<Descriptions.Item label="官网文档"> | ||
<a href="https://spug.dev" target="_blank">https://spug.dev</a> | ||
</Descriptions.Item> | ||
</Descriptions> | ||
</Spin> | ||
) | ||
} | ||
} | ||
|
||
export default About |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters