mirror of https://github.com/jumpserver/jumpserver
fix group list bug
parent
3260584f90
commit
a8bdc37780
|
@ -63,7 +63,7 @@ def group_list(request):
|
||||||
if keyword:
|
if keyword:
|
||||||
user_group_list = user_group_list.filter(Q(name__icontains=keyword) | Q(comment__icontains=keyword))
|
user_group_list = user_group_list.filter(Q(name__icontains=keyword) | Q(comment__icontains=keyword))
|
||||||
|
|
||||||
if id:
|
if group_id:
|
||||||
user_group_list = user_group_list.filter(id=int(group_id))
|
user_group_list = user_group_list.filter(id=int(group_id))
|
||||||
|
|
||||||
user_group_list, p, user_groups, page_range, current_page, show_first, show_end = pages(user_group_list, request)
|
user_group_list, p, user_groups, page_range, current_page, show_first, show_end = pages(user_group_list, request)
|
||||||
|
|
|
@ -116,25 +116,6 @@ def file_monitor(path='.', client=None):
|
||||||
break
|
break
|
||||||
|
|
||||||
|
|
||||||
class Application(tornado.web.Application):
|
|
||||||
def __init__(self):
|
|
||||||
handlers = [
|
|
||||||
(r'/monitor', MonitorHandler),
|
|
||||||
(r'/terminal', WebTerminalHandler),
|
|
||||||
(r'/kill', WebTerminalKillHandler),
|
|
||||||
(r'/exec', ExecHandler),
|
|
||||||
]
|
|
||||||
|
|
||||||
setting = {
|
|
||||||
'cookie_secret': 'DFksdfsasdfkasdfFKwlwfsdfsa1204mx',
|
|
||||||
'template_path': os.path.join(os.path.dirname(__file__), 'templates'),
|
|
||||||
'static_path': os.path.join(os.path.dirname(__file__), 'static'),
|
|
||||||
'debug': True,
|
|
||||||
}
|
|
||||||
|
|
||||||
tornado.web.Application.__init__(self, handlers, **setting)
|
|
||||||
|
|
||||||
|
|
||||||
class MonitorHandler(tornado.websocket.WebSocketHandler):
|
class MonitorHandler(tornado.websocket.WebSocketHandler):
|
||||||
clients = []
|
clients = []
|
||||||
threads = []
|
threads = []
|
||||||
|
@ -415,12 +396,32 @@ class WebTerminalHandler(tornado.websocket.WebSocketHandler):
|
||||||
except IndexError:
|
except IndexError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
class Application(tornado.web.Application):
|
||||||
|
def __init__(self):
|
||||||
|
handlers = [
|
||||||
|
(r'/monitor', MonitorHandler),
|
||||||
|
(r'/terminal', WebTerminalHandler),
|
||||||
|
(r'/kill', WebTerminalKillHandler),
|
||||||
|
(r'/exec', ExecHandler),
|
||||||
|
]
|
||||||
|
|
||||||
|
setting = {
|
||||||
|
'cookie_secret': 'DFksdfsasdfkasdfFKwlwfsdfsa1204mx',
|
||||||
|
'template_path': os.path.join(os.path.dirname(__file__), 'templates'),
|
||||||
|
'static_path': os.path.join(os.path.dirname(__file__), 'static'),
|
||||||
|
'debug': False,
|
||||||
|
}
|
||||||
|
|
||||||
|
tornado.web.Application.__init__(self, handlers, **setting)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
tornado.options.parse_command_line()
|
tornado.options.parse_command_line()
|
||||||
app = Application()
|
app = Application()
|
||||||
server = tornado.httpserver.HTTPServer(app)
|
server = tornado.httpserver.HTTPServer(app)
|
||||||
server.bind(options.port, options.host)
|
server.bind(options.port, options.host)
|
||||||
# server.listen(options.port)
|
#server.listen(options.port)
|
||||||
server.start(num_processes=1)
|
server.start(num_processes=10)
|
||||||
print "Run server on %s:%s" % (options.host, options.port)
|
print "Run server on %s:%s" % (options.host, options.port)
|
||||||
tornado.ioloop.IOLoop.instance().start()
|
tornado.ioloop.IOLoop.instance().start()
|
||||||
|
|
|
@ -144,7 +144,6 @@
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</table>
|
</table>
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue