mirror of
https://github.com/r4sas/py-i2phosts
synced 2025-02-02 09:55:52 +00:00
webinterface: add hosts browsing page
This commit is contained in:
parent
c546f70757
commit
e3025b02e9
@ -15,6 +15,7 @@
|
|||||||
<ul>
|
<ul>
|
||||||
<li><a href=/>Home</a></li>
|
<li><a href=/>Home</a></li>
|
||||||
<li><a href={% url faq %}>FAQ</a></li>
|
<li><a href={% url faq %}>FAQ</a></li>
|
||||||
|
<li><a href={% url browse %}>Browse alive hosts</a></li>
|
||||||
<li><a href={% url pyi2phosts.postkey.views.addkey %}>Register a domain</a></li>
|
<li><a href={% url pyi2phosts.postkey.views.addkey %}>Register a domain</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
11
pyi2phosts/templates/browse.html
Normal file
11
pyi2phosts/templates/browse.html
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
{% extends "base.html" %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<table>
|
||||||
|
<tr><td>Host</td><td>Last seen</td><td>Description</td>
|
||||||
|
{% for host in host_list %}
|
||||||
|
<tr><td>{{ host.name }}</td><td>{{ host.last_seen }}</td><td>
|
||||||
|
{{ host.description }}</td></tr>
|
||||||
|
{% endfor %}
|
||||||
|
</table>
|
||||||
|
{% endblock %}
|
@ -8,6 +8,7 @@ admin.autodiscover()
|
|||||||
|
|
||||||
from pyi2phosts.lib.utils import get_b32
|
from pyi2phosts.lib.utils import get_b32
|
||||||
from pyi2phosts.extsources.models import ExternalSource
|
from pyi2phosts.extsources.models import ExternalSource
|
||||||
|
from pyi2phosts.postkey.models import i2phost
|
||||||
import settings
|
import settings
|
||||||
|
|
||||||
extsources = {
|
extsources = {
|
||||||
@ -19,6 +20,12 @@ extsources = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
browse_hosts = {
|
||||||
|
'queryset': i2phost.objects.filter(activated=True),
|
||||||
|
'template_name': 'browse.html',
|
||||||
|
'template_object_name': 'host',
|
||||||
|
}
|
||||||
|
|
||||||
urlpatterns = patterns('',
|
urlpatterns = patterns('',
|
||||||
url(r'^$', direct_to_template, {
|
url(r'^$', direct_to_template, {
|
||||||
'template': 'index.html',
|
'template': 'index.html',
|
||||||
@ -30,6 +37,7 @@ urlpatterns = patterns('',
|
|||||||
}
|
}
|
||||||
}, name='index'),
|
}, name='index'),
|
||||||
url(r'^faq/$', object_list, extsources, name='faq'),
|
url(r'^faq/$', object_list, extsources, name='faq'),
|
||||||
|
url(r'^browse/$', object_list, browse_hosts, name='browse'),
|
||||||
(r'^postkey/', include('pyi2phosts.postkey.urls')),
|
(r'^postkey/', include('pyi2phosts.postkey.urls')),
|
||||||
(r'^jump/', include('pyi2phosts.jump.urls')),
|
(r'^jump/', include('pyi2phosts.jump.urls')),
|
||||||
# Example:
|
# Example:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user