t
This commit is contained in:
commit
c3fcce1527
48
FlowAnalyserMain.py
Normal file
48
FlowAnalyserMain.py
Normal file
@ -0,0 +1,48 @@
|
||||
from env import *
|
||||
from flask import Flask, render_template
|
||||
import os
|
||||
import FlowTest
|
||||
from sysjobs import *
|
||||
import sysjob2html
|
||||
import pandas as pd
|
||||
|
||||
def create_app(test_config=None):
|
||||
# create and configure the app
|
||||
FlowAnalyserMain = Flask(__name__, instance_relative_config=True)
|
||||
#app.config.from_mapping(
|
||||
## SECRET_KEY='dev',
|
||||
# DATABASE=os.path.join(app.instance_path, 'flaskr.sqlite'),
|
||||
#)
|
||||
if test_config is None:
|
||||
# load the instance config, if it exists, when not testing
|
||||
FlowAnalyserMain.config.from_pyfile('config.py', silent=True)
|
||||
else:
|
||||
# load the test config if passed in
|
||||
FlowAnalyserMain.config.from_mapping(test_config)
|
||||
|
||||
# ensure the instance folder exists
|
||||
try:
|
||||
os.makedirs(FlowAnalyserMain.instance_path)
|
||||
except OSError:
|
||||
pass
|
||||
|
||||
# a simple page that says hello
|
||||
@FlowAnalyserMain.route('/hello')
|
||||
def hello():
|
||||
return FlowTest.test()
|
||||
@FlowAnalyserMain.route('/test')
|
||||
def test():
|
||||
return render_template('index.html', test=html)
|
||||
@FlowAnalyserMain.route('/test2')
|
||||
def test():
|
||||
return render_template('index2.html', test2=data2)
|
||||
if __name__ == '__main__':
|
||||
FlowAnalyserMain.run()
|
||||
return FlowAnalyserMain
|
||||
|
||||
engine=inn.getEngine("msdb")
|
||||
with Session(engine) as session:
|
||||
sysjobs=(Sysjobs.getNattensKoersel(session))
|
||||
html=''
|
||||
data2=[b for b in sysjobs]
|
||||
FlowAnalyserMain=create_app()
|
||||
14
templates/index2.html
Normal file
14
templates/index2.html
Normal file
@ -0,0 +1,14 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Gantt Chart Example 1</title>
|
||||
<link type="text/css" href="http://mbostock.github.io/d3/style.css" rel="stylesheet" />
|
||||
<link type="text/css" href="example.css" rel="stylesheet" />
|
||||
</head>
|
||||
<body>
|
||||
<a id="forkme_banner" href="http://dk8996.github.io/Gantt-Chart/" target="_blank">View on GitHub</a>
|
||||
<script type="text/javascript" src="http://d3js.org/d3.v3.min.js"></script>
|
||||
<script type="text/javascript" src="http://static.mentful.com/gantt-chart-d3v2.js"></script>
|
||||
<script type="text/javascript" src="example.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
Loading…
x
Reference in New Issue
Block a user