mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-05-27 10:44:33 +00:00
Created new Learn handler.
This commit is contained in:
parent
8870af39f3
commit
b6b1736f43
@ -147,6 +147,7 @@ class Monitor(santiago.SantiagoMonitor):
|
||||
('/consuming/:host/:service', ConsumedService(self.santiago)),
|
||||
('/consuming/:host', ConsumedHost(self.santiago)),
|
||||
('/consuming', Consuming(self.santiago)),
|
||||
('/learn/:host/:service', Learn(self.santiago)),
|
||||
("/stop", Stop(self.santiago)),
|
||||
("/freedombuddy", root),
|
||||
)
|
||||
@ -390,3 +391,10 @@ class Stop(RestMonitor):
|
||||
@cherrypy.tools.ip_filter()
|
||||
def GET(self, **kwargs):
|
||||
self.POST() # FIXME cause it's late and I'm tired.
|
||||
|
||||
class Learn(RestMonitor, santiago.SantiagoListener):
|
||||
@cherrypy.tools.ip_filter()
|
||||
def POST(self, host, service, **kwargs):
|
||||
super(Learn, self).learn(host, service)
|
||||
|
||||
raise cherrypy.HTTPRedirect("/consuming/%s/%s" % (host, service))
|
||||
|
||||
@ -12,6 +12,9 @@
|
||||
<body>
|
||||
<p>You are <a href="/consuming">consuming</a> $service from
|
||||
<a href="/consuming/$host">$host</a> at:</p>
|
||||
<form method="post" action="/learn/$host/$service">
|
||||
<input type="submit" value="Learn More Locations?" />
|
||||
</form>
|
||||
#if $locations
|
||||
<ul>
|
||||
#for $location in $locations
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user