aboutsummaryrefslogtreecommitdiffstats
path: root/packages/torouter-web/src/tui/controllers/tor.py
diff options
context:
space:
mode:
Diffstat (limited to 'packages/torouter-web/src/tui/controllers/tor.py')
-rw-r--r--packages/torouter-web/src/tui/controllers/tor.py35
1 files changed, 35 insertions, 0 deletions
diff --git a/packages/torouter-web/src/tui/controllers/tor.py b/packages/torouter-web/src/tui/controllers/tor.py
new file mode 100644
index 0000000..af8678c
--- /dev/null
+++ b/packages/torouter-web/src/tui/controllers/tor.py
@@ -0,0 +1,35 @@
+import web
+import view, config
+from view import render
+from tui.utils import session, parsing
+
+"""
+The main Tor status page
+"""
+class status:
+ def GET(self):
+ trc = parsing.torrc(config.torrc_file)
+ trc.parse()
+ output = trc.html_output()
+ return render.base(render.torstatus(output,config.torrc_file))
+
+ def POST(self):
+ trc = parsing.torrc(config.torrc_file)
+ trc.parse()
+ output = trc.html_output()
+ return render.base(render.torstatus(output,config.torrc_file))
+
+"""
+Tor configuration page
+"""
+class torrc:
+ def update_config(self, data):
+ return True
+
+ def GET(self):
+ return render.base(render.torconfig())
+
+ def POST(self):
+ self.update_config(web.input())
+ return render.base(render.torconfig())
+