Source

HackersEdge / he_one / urls.py

Full commit
Kevin Veroneau 8d6c3a4 



































from django.conf.urls import patterns, url, include
from he_one.views import HostDetail, MailboxDetail, delete_message, boot_host,\
    FileDetail, TaskList, WebIndex, WebFile
from django.views.generic.base import TemplateView
from he_one.admin_views import ResolveDNS, ShowDomain, UserInfo, MissionList,\
    MissionDetail

host_patterns = patterns('',
    url(r'^$', HostDetail.as_view(), name='host-detail'),
    url(r'^:Mailbox/(?P<pk>\d+)$', MailboxDetail.as_view(), name='mailbox-detail'),
    url(r'^:Web$', WebIndex.as_view(), name='web-index'),
    url(r'^:Web/(?P<filename>[A-Za-z]{1,8}).(?P<file_type>[A-Za-z]{1,3})$', WebFile.as_view(), name='pcfile-web'),
    url(r'^:File/(?P<filename>[A-Za-z]{1,8}).(?P<file_type>[A-Za-z]{1,3})$', FileDetail.as_view(), name='pcfile-detail'),
    url(r'^:Boot$', boot_host, name='host-boot'),
)

admin_mission_patterns = patterns('he_one.admin_views',
    url(r'^$', MissionList.as_view()),
    url(r'^(?P<pk>[0-9]+)/$', MissionDetail.as_view(), name='admin-mission'),
)

admin_patterns = patterns('he_one.admin_views',
    url('^bulk_create_hosts/(?P<network>[\d]+.[\d]+.[\d]+):(?P<low_range>[\d]+)-(?P<high_range>[\d]+)$', 'bulk_create_hosts'),
    url('^Missions/', include(admin_mission_patterns)),
    url('^Host:(?P<ip>[\d]+.[\d]+.[\d]+.[\d]+)$', 'admin_host'),
    url('^DNS:(?P<domain>[a-z]+.[a-z]+)$', ShowDomain.as_view()),
    url('^DNS:(?P<hostname>[a-z]+).(?P<domain>[a-z]+.[a-z]+)$', ResolveDNS.as_view()),
    url('^User:(?P<username>[a-z]+)$', UserInfo.as_view()),
)

urlpatterns = patterns('',
    url(r'^$', TemplateView.as_view(template_name='he_one/home.html'), name='overview'),
    url(r'^Tasks$', TaskList.as_view(), name='running-tasks'),
    url(r'^admin/', include(admin_patterns)),
    url(r'^(?P<ip>[\d]+.[\d]+.[\d]+.[\d]+)', include(host_patterns)),
    url(r'^Message/(?P<message_id>\d+)$', delete_message, name='message-delete'),
)