Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 46 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,80 +1,92 @@
![](https://cdn.jsdelivr.net/gh/yoobool/flask-state@1.0.5/src/flask_state/static/flask_state.png)
![Project Logo](https://cdn.jsdelivr.net/gh/yoobool/flask-state@1.0.5/src/flask_state/static/flask_state.png)


[![](https://img.shields.io/badge/Contributions-Welcome-0059b3)](https://github.com/yoobool/flask-state/tree/master/.github/ISSUE_TEMPLATE)
[![](https://img.shields.io/badge/Chat-Gitter-ff69b4.svg?label=Chat&logo=gitter)](https://gitter.im/flaskstate/community)
[![](https://img.shields.io/npm/v/flask-state)](https://www.npmjs.com/package/flask-state)
[![](https://img.shields.io/badge/license-BSD-green)](https://github.com/yoobool/flask-state/blob/master/LICENSE)
[![](https://img.shields.io/badge/python-3.5%20%7C%203.6%20%7C%203.7%20%7C%203.8%20%7C%203.9-blue)](https://pypi.org/project/Flask-State/)
[![Contributor Badge](https://img.shields.io/badge/Contributions-Welcome-0059b3)](https://github.com/yoobool/flask-state/tree/master/.github/ISSUE_TEMPLATE)
[![Gitter Badge](https://img.shields.io/badge/Chat-Gitter-ff69b4.svg?label=Chat&logo=gitter)](https://gitter.im/flaskstate/community)
[![NPM Badge](https://img.shields.io/npm/v/flask-state)](https://www.npmjs.com/package/flask-state)
[![License Badge](https://img.shields.io/badge/license-BSD-green)](https://github.com/yoobool/flask-state/blob/master/LICENSE)
[![Python Badge](https://img.shields.io/badge/python-3.5%20%7C%203.6%20%7C%203.7%20%7C%203.8%20%7C%203.9-blue)](https://pypi.org/project/Flask-State/)

# Flask-State

Flask-State is a lightweight chart plugin to show machine state.

* **Monitoring indicators:** CPU, Memory, Disk usage, LoadAVG, Boot time.
* **Extensible:** It has rich options for extended functions, including redis monitoring, user authentication, custom logging, i18n and etc.
* **Stable:** Lightweight dependencies, meanwhile solving multi-progress concurrency problems (if you use [gunicorn](https://gunicorn.org/)).
Flask-State is a lightweight chart plugin for displaying machine state data in your web application.

Flask-State is an active project, well-tested and complete update roadmap.
* **Monitored Metric:** CPU, memory, disk usage, LoadAVG and boot time.
* **Extensible:** Offers rich customization options, including redis monitoring, user authentication,
custom logging, i18n and etc.
* **Stable:** Solves multiprocessing concurrency problems (if you use [gunicorn](https://gunicorn.org/))
built on top of lightweight dependencies.

###

![](https://cdn.jsdelivr.net/gh/yoobool/flask-state@1.0.5/examples/static/flask_state.png)
This project is in active development and thoroughly tested to ensure that Flask-State
stays up-to-date with its project roadmap.

![Screenshot](https://cdn.jsdelivr.net/gh/yoobool/flask-state@1.0.5/examples/static/flask_state.png)

## Documentation
To check out [live example](https://flask-state.herokuapp.com/), and visit [tutorials doc](https://github.com/yoobool/flask-state/wiki/Tutorials).

Check out the [live demo](https://flask-state.herokuapp.com/), or head over to the
[tutorial](https://github.com/yoobool/flask-state/wiki/Tutorials) for more instructions.

## Installation
Install and update using [pip](https://pip.pypa.io/en/stable/quickstart/):
```
$ pip install Flask-State

Get this plugin from [PyPI](https://pip.pypa.io/en/stable/quickstart/):

```bash
pip install Flask-State
```

Display components can use ```<script>``` tag from a CDN, or as a flask-state package on npm.
Alternatively, install Flask-State via NPM or include this script tag to the head
section of your HTML document:

```html
<script src="https://cdn.jsdelivr.net/gh/yoobool/flask-state@v1.0.5/packages/umd/flask-state.min.js"></script>
```
```

```bash
npm install flask-state --save
```


## Usage

### Firstly:Bind database address.
### 1. Bind Database Address

```python
from flask_state import DEFAULT_BIND_SQLITE
app.config['SQLALCHEMY_BINDS'] = {DEFAULT_BIND_SQLITE: 'sqlite:///path'}
```

### Secondly:Call the init_app method of the flask-state to initialize the configuration.
### 2. Configure Flask-State

```python
import flask_state
flask_state.init_app(app)
```

### Thirdly:Import the view file.
### 3. Include Imports to Views

```javascript
// npm
// Need to introduce Echarts module
// requires echarts module
import 'echarts';
import 'flask-state/flask-state.min.css';
import {init} from 'flask-state';
// Create a DOM node with ID 'test'. After init() binds the node, click to open the listening window
// Create a DOM node with ID 'test'. After init() binds the node,
// click to open the listening window
init({dom:document.getElementById('test')});
```

**Learn more about advanced configurations by reading** [documentation](https://github.com/yoobool/flask-state/wiki/Configuration).
**Learn more about advanced configurations in the**
[documentation](https://github.com/yoobool/flask-state/wiki/Configuration).

## Contributing
Welcome to [open an issue](https://github.com/yoobool/flask-state/issues/new)!

Flask-State follows the [Contributor Covenant](https://www.contributor-covenant.org/version/1/3/0/code-of-conduct/) Code of Conduct.
You're welcome to [open a new issue](https://github.com/yoobool/flask-state/issues/new)!
Flask-State follows the [Contributor Covenant](https://www.contributor-covenant.org/version/1/3/0/code-of-conduct/)
Code of Conduct.

## Community Channel
We're on [Gitter](https://gitter.im/flaskstate/community) ! Please join us.

We're on [Gitter](https://gitter.im/flaskstate/community)! Join the conversation
for more questions and inquiries about this project.

## License
Flask-State is available under the BSD-3-Clause License.

Flask-State is available under the BSD-3-Clause License.