diff options
-rw-r--r-- | app.py | 4 | ||||
-rw-r--r-- | index.html | 11 |
2 files changed, 8 insertions, 7 deletions
@@ -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': '* ?<keyword> - query keyword'}) @@ -10,12 +10,13 @@ e.preventDefault(); var args = $('.prompt').val(); $('.prompt').val(''); - $.getJSON('scan/', {'cmd': args}, function(r){ - $(r.results).each(function(i, e){ - $('<li/>').text(e.raw).appendTo('.output'); + $.getJSON('scan/', {'cmd': args}, + function(r){ + $(r.results).each(function(i, e){ + $('<li/>').text(e.raw).appendTo('.output'); + }); + $('<li/>').addClass('divider').appendTo('.output'); }); - $('<li/>').addClass('divider').appendTo('.output'); - }); }); }); </script> |