From 3d7b685ac9753f0304f5384120909731a8902c65 Mon Sep 17 00:00:00 2001 From: Filipp Lepalaan Date: Fri, 14 Feb 2014 12:28:10 +0200 Subject: This is dumb --- app.py | 4 ++-- index.html | 11 ++++++----- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/app.py b/app.py index 29ff502..94fdbd9 100644 --- a/app.py +++ b/app.py @@ -30,9 +30,9 @@ class ScanHandler(tornado.web.RequestHandler): commands = ('nmap', 'help', '?', '!',) out = {'results': list()} - cmd = self.get_argument('cmd', '') + cmd = self.get_argument('cmd', 'help') - if cmd not in commands or cmd == 'help': + if cmd == 'help' or cmd not in commands: out['results'].append({'raw': 'Available commands:'}) out['results'].append({'raw': '* nmap - scan your IP'}) out['results'].append({'raw': '* ? - query keyword'}) diff --git a/index.html b/index.html index 5a8b1b6..d906c81 100644 --- a/index.html +++ b/index.html @@ -10,12 +10,13 @@ e.preventDefault(); var args = $('.prompt').val(); $('.prompt').val(''); - $.getJSON('scan/', {'cmd': args}, function(r){ - $(r.results).each(function(i, e){ - $('
  • ').text(e.raw).appendTo('.output'); + $.getJSON('scan/', {'cmd': args}, + function(r){ + $(r.results).each(function(i, e){ + $('
  • ').text(e.raw).appendTo('.output'); + }); + $('
  • ').addClass('divider').appendTo('.output'); }); - $('
  • ').addClass('divider').appendTo('.output'); - }); }); }); -- cgit v1.2.3