-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added flask-monitoringdashboard app #438
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,3 +25,5 @@ hasjob/static/gen | |
*.gz | ||
*.bz2 | ||
hasjob/assets/node_modules | ||
admindash-config.cfg | ||
flask_monitoringdashboard.db | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can't use SQLite in production as there are multiple worker processes competing for control over this file. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. By default it uses sqlite and creates this file. I moved it to postgres. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
[dashboard] | ||
USERNAME=username | ||
PASSWORD=password | ||
CUSTOM_LINK=monitor | ||
GIT=./.git/ |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,7 @@ | |
from flask_rq import RQ | ||
from flask_mail import Mail | ||
from flask_redis import FlaskRedis | ||
import flask_monitoringdashboard as dashboard | ||
from flask_lastuser import Lastuser | ||
from flask_lastuser.sqlalchemy import UserManager | ||
from baseframe import baseframe, assets, Version | ||
|
@@ -59,3 +60,16 @@ | |
redis_store.init_app(app) | ||
lastuser.init_app(app) | ||
lastuser.init_usermanager(UserManager(db, models.User)) | ||
|
||
|
||
def get_user_id(): | ||
from coaster.auth import current_auth | ||
if current_auth.user is not None: | ||
return current_auth.user.username | ||
else: | ||
return 'anon' | ||
|
||
|
||
dashboard.config.get_group_by = get_user_id | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Group by event session, not user. |
||
dashboard.config.init_from(file='admindash-config.cfg') | ||
dashboard.bind(app) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Config should be stored in the
instance
folder.