Skip to content

Commit

Permalink
Merge pull request #306 from flask-dashboard/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
mircealungu committed Mar 18, 2020
2 parents b396888 + 76795e3 commit 0404b05
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 6 deletions.
1 change: 1 addition & 0 deletions Procfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
web: pip install gunicorn && gunicorn flask_monitoringdashboard.main:app --log-file=-
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ Adding the extension to your Flask app is simple:
dashboard.bind(app)

## Live Demo
To view a live deployment of the Flask-MonitoringDashboard, check [this site](https://flask-monitoringdashboard.herokuapp.com/).
To view a live deployment of the Flask-MonitoringDashboard, check [this site](https://fmd-master.herokuapp.com/).
Use the credentials u:`admin`, p:`admin` to log in.

## Feedback
Expand Down
9 changes: 8 additions & 1 deletion docs/developing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ responsible for setting up the project, and installing the following pre-commit
- `Black`_: for automatic formatting the code. Note that we use a width-length of 100 characters.
- `Flake8`_: for checking style error.
- Auto increase the Python version. This can either be a major, minor, or patch version increase. For more info, see
the Versions-section below.
the Versions-section below.

Architecture
--------------
Expand Down Expand Up @@ -131,6 +131,13 @@ The following tools are used for helping the development of the Dashboard:
corresponding feature has been merged into the development branch. It is recommended to often
merge development into this branch, to keep the feature branch up to date.

- **Heroku deployment**: The following branches are automatically deployed to Heroku. This is useful for quickly
testing, without running any code locally.

- **Master**: The master branch is deployed at: `<https://fmd-master.herokuapp.com>`_.
- **Development**: The development is deployed at: `<https://fmd-development.herokuapp.com>`_.
- **Pull requests**: Pull requests are also automatically build with a unique URL.

- **Unit testing**: The code is tested before a Pull Request is accepted. If you want to run the unit
tests locally, you can use the following command from the root of Flask-MonitoringDashboard
directory:
Expand Down
2 changes: 1 addition & 1 deletion flask_monitoringdashboard/constants.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "3.0.8",
"version": "3.0.9",
"author": "Patrick Vogel, Bogdan Petre",
"email": "flask.monitoringdashboard@gmail.com"
}
7 changes: 6 additions & 1 deletion flask_monitoringdashboard/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import time
from random import random, randint

from flask import Flask
from flask import Flask, redirect, url_for

import flask_monitoringdashboard as dashboard

Expand Down Expand Up @@ -38,6 +38,11 @@ def every_ten_seconds():
dashboard.bind(app)


@app.route('/')
def to_dashboard():
return redirect(url_for('dashboard.login'))


@app.route('/endpoint')
def endpoint():
# if session_scope is imported at the top of the file, the database config won't take effect
Expand Down
15 changes: 13 additions & 2 deletions flask_monitoringdashboard/static/js/controllers/overview.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,20 @@ function OverviewController($scope, $http, $location, DTOptionsBuilder, menuServ

$http.get('api/deploy_details').then(function (response) {
$scope.dashboard_version = response.data['dashboard-version'];
$scope.alertShow = $scope.pypi_version !== $scope.dashboard_version;
$scope.alertShow = !isNewestVersion($scope.pypi_version, $scope.dashboard_version);
})
});


}
}

function isNewestVersion(pypi_version, dashboard_version ){
let pypi_version_array = pypi_version.split('.');
let dashboard_version_array = dashboard_version.split('.');
for(let i=0; i<3; i++){
if (pypi_version_array[i] > dashboard_version_array[i]){
return false;
}
}
return true;
}

0 comments on commit 0404b05

Please sign in to comment.