MurphyAdam / flask-state

Display machine state using Python3 with Flask.

Home Page:https://flask-state.herokuapp.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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/flask-state@v1.0.5/packages/umd/flask-state.min.js"></script>
npm install flask-state --save

Usage

After the Flask-State is installed, you also need to import JavaScript file and CSS file to bind a convention ID value for your element. In some configurations, you can also choose to modify them.

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 some configurations by reading its documentation.

Contributing

See the planning document for a roadmap and existing feature requests.

Flask-State follows the Contributor Covenant Code of Conduct.

Alternatives

Looking for something else? Try another monitor project:

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.

https://flask-state.herokuapp.com

License:BSD 3-Clause "New" or "Revised" License


Languages

Language:JavaScript 59.4%Language:Python 36.3%Language:CSS 4.2%