parent
e121cc8920
commit
4037dc7b78
@ -0,0 +1,14 @@
|
||||
.PHONY: format help
|
||||
|
||||
# Help system from https://marmelab.com/blog/2016/02/29/auto-documented-makefile.html
|
||||
.DEFAULT_GOAL := help
|
||||
|
||||
help:
|
||||
@grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
|
||||
|
||||
setup: ## Establish local environment with dependencies installed
|
||||
python3 -m venv .venv
|
||||
.venv/bin/pip install -r requirements.txt
|
||||
|
||||
up: ## Run Grafana container
|
||||
docker-compose up -d
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,13 +0,0 @@
|
||||
apiVersion: 1
|
||||
|
||||
providers:
|
||||
- name: 'default'
|
||||
orgId: 1
|
||||
folder: ''
|
||||
type: file
|
||||
disableDeletion: true
|
||||
editable: true
|
||||
updateIntervalSeconds: 60
|
||||
allowUiUpdates: true
|
||||
options:
|
||||
path: /var/lib/grafana/dashboards
|
@ -1,9 +0,0 @@
|
||||
apiVersion: 1
|
||||
|
||||
datasources:
|
||||
- name: PostgreSQL
|
||||
type: postgresql
|
||||
url: http://prometheus:9090
|
||||
access: proxy
|
||||
isDefault: true
|
||||
timeInterval: 10s
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,4 +1,5 @@
|
||||
requests
|
||||
peewee
|
||||
psycopg2-binary
|
||||
python-dotenv
|
||||
hypercorn
|
||||
quart
|
@ -0,0 +1,7 @@
|
||||
from totrader.factory import create_app
|
||||
|
||||
|
||||
app = create_app()
|
||||
|
||||
if __name__ == '__main__':
|
||||
app.run()
|
Before Width: | Height: | Size: 404 KiB |
Before Width: | Height: | Size: 692 KiB |
@ -0,0 +1 @@
|
||||
from totrader.factory import create_app
|
@ -0,0 +1,16 @@
|
||||
import quart.flask_patch
|
||||
from quart import Quart
|
||||
|
||||
|
||||
def create_app():
|
||||
app = Quart(__name__)
|
||||
app.config.from_envvar('FLASK_SECRETS', 'config.py')
|
||||
|
||||
@app.before_serving
|
||||
async def startup():
|
||||
from totrader.routes import meta
|
||||
from totrader import filters
|
||||
app.register_blueprint(meta.bp)
|
||||
app.register_blueprint(filters.bp)
|
||||
|
||||
return app
|
@ -0,0 +1,15 @@
|
||||
from datetime import datetime
|
||||
|
||||
from quart import Blueprint
|
||||
|
||||
|
||||
bp = Blueprint('filters', 'filters')
|
||||
|
||||
|
||||
@bp.app_template_filter('ts')
|
||||
def from_ts(v):
|
||||
return datetime.fromtimestamp(v)
|
||||
|
||||
@bp.app_template_filter('xmr_block_explorer')
|
||||
def xmr_block_explorer(v):
|
||||
return f'https://www.exploremonero.com/transaction/{v}'
|
@ -0,0 +1,9 @@
|
||||
|
||||
from quart import Blueprint, render_template
|
||||
|
||||
|
||||
bp = Blueprint('meta', 'meta')
|
||||
|
||||
@bp.route('/')
|
||||
async def index():
|
||||
return await render_template('index.html')
|
@ -0,0 +1 @@
|
||||
hello
|
Reference in new issue