This repository has been archived on 2020-12-06. You can view files and clone it, but cannot push or open issues or pull requests.
2013-08-24 17:47:25 +02:00
|
|
|
#!/usr/bin/env python
|
|
|
|
|
2013-08-24 21:06:19 +02:00
|
|
|
from flask import Flask, render_template, redirect, url_for, abort, request
|
2013-08-24 17:47:25 +02:00
|
|
|
import openvpnstatus
|
|
|
|
|
|
|
|
app = Flask(__name__)
|
|
|
|
|
2013-08-24 21:06:19 +02:00
|
|
|
@app.route('/status', methods=['GET', 'POST'])
|
2013-08-24 17:47:25 +02:00
|
|
|
def status():
|
|
|
|
o = openvpnstatus.openvpnstatus()
|
|
|
|
return render_template('status.html', connections = o.connections, routes = o.routes)
|
|
|
|
|
2013-08-24 21:17:52 +02:00
|
|
|
@app.route('/socialnerds')
|
2013-08-24 21:06:19 +02:00
|
|
|
def redir():
|
|
|
|
return redirect('https://www.socialnerds.org')
|
|
|
|
|
|
|
|
@app.route('/form', methods=['GET', 'POST'])
|
|
|
|
def formular():
|
|
|
|
something = "iatren"
|
|
|
|
if request.method == 'POST':
|
|
|
|
value = request.form['textfield']
|
|
|
|
return render_template("footer.html", test=value, test2=value)
|
|
|
|
else:
|
|
|
|
return render_template("form.html")
|
|
|
|
|
|
|
|
|
2013-08-24 17:47:25 +02:00
|
|
|
if __name__ == '__main__':
|
2013-08-24 21:06:19 +02:00
|
|
|
app.run(debug=True)
|