-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathapp.py
76 lines (62 loc) · 2.18 KB
/
app.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
from flask import Flask, render_template, request
import subprocess
app = Flask(__name__)
@app.route("/")
def start():
return render_template("home.html")
@app.route("/about.html")
def about():
return render_template("about.html")
@app.route("/home.html")
def home():
return render_template("home.html")
@app.route("/contact.html")
def contact():
return render_template("contact.html")
@app.route("/faq.html")
def faq():
return render_template("faq.html")
@app.route("/direct.html")
def direct():
return render_template("direct.html")
@app.route("/onprem.html")
def onprem():
return render_template("onprem.html")
@app.route("/proxy.html")
def proxy():
return render_template("proxy.html")
@app.route("/slr.html")
def slr():
return render_template("slr.html")
@app.route('/register', methods=['GET', 'POST'])
def run_script_direct():
file = request.form.get("direct")
print(file)
result = subprocess.check_output("python ez_register_direct.py " + "~/"+file, shell=True, stderr=subprocess.STDOUT)
print(result)
result = result.decode("utf-8")
return render_template("direct.html", result=result)
@app.route('/register', methods=['GET', 'POST'])
def run_script_onprem():
file = request.form.get("onprem")
print(file)
result = subprocess.check_output("python ez_register_onprem.py " + "~/"+file, shell=True, stderr=subprocess.STDOUT)
print(result)
result = result.decode("utf-8")
return render_template("onprem.html", result=result)
@app.route('/register', methods=['GET', 'POST'])
def run_script_proxy():
file = request.form.get("proxy")
print(file)
result = subprocess.check_output("python ez_register_proxy.py " + "~/"+file, shell=True, stderr=subprocess.STDOUT)
print(result)
result = result.decode("utf-8")
return render_template("proxy.html", result=result)
@app.route('/register', methods=['GET', 'POST'])
def run_script_slr():
file = request.form.get("slr")
print(file)
result = subprocess.check_output("python ez_register_slr.py " + "~/"+file, shell=True, stderr=subprocess.STDOUT)
print(result)
result = result.decode("utf-8")
return render_template("slr.html", result=result)