-
Notifications
You must be signed in to change notification settings - Fork 4
/
views.py
57 lines (39 loc) · 1.31 KB
/
views.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
from flask import Blueprint, jsonify, render_template
from extensions import db
from models import build_model, build_clients
from models import Client, Onboard
bp = Blueprint('bp', __name__)
@bp.route('/')
def index():
return render_template('index.html')
@bp.route('/compliance')
def compliance():
return render_template('compliance.html', clients = Client.list_all_with_compliance_status())
@bp.route('/funnel')
def funnel():
return render_template('funnel.html')
@bp.route('/gap_analysis')
def gap_analysis():
return render_template('gap_analysis.html', clients = Client.list_all_with_document_status())
@bp.route('/kpi')
def kpi():
return render_template('kpi.html', average_ttc = Onboard.compute_average())
@bp.route('/client_metric')
def client_metric():
return render_template('client_metric.html')
@bp.route('/impact_analysis')
def impact_analysis():
return render_template('impact_analysis.html')
@bp.route('/provenance')
def provenance():
return render_template('provenance.html')
@bp.route('/build')
def build():
db.graph.run("MATCH (n) DETACH DELETE n")
m = build_model()
return jsonify({'status': m})
@bp.route('/create_clients')
def create_clients():
db.graph.run("match (n) detach delete n")
m = build_clients()
return jsonify({'status': m})