Skip to content

aaronxiongli/flask-state

 
 

Repository files navigation

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).

Flask-State is an active project, well-tested and complete update roadmap.

Installation

Install and update using pip:

$ pip install Flask-State

Display components can use <script> tag from a CDN, or as a flask-state package on npm.

<script src="https://cdn.jsdelivr.net/gh/yoobool/[email protected]/packages/umd/flask-state.min.js"></script>
npm install flask-state --save

Documentation

To check out live example, and visit tutorials doc.

Usage

Firstly:Bind database address.

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.

import flask_state
flask_state.init_app(app)

Thirdly:Import the view file.

// npm
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
init({dom:document.getElementById('test')});

Learn more about advanced configurations by reading documentation.

Contributing

Welcome to open an issue!

Flask-State follows the Contributor Covenant Code of Conduct.

Community Channel

We're on Gitter ! Please join us.

License

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

About

Display machine state using Python3 with Flask.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 59.7%
  • Python 32.0%
  • CSS 8.3%