Exemplo n.º 1
0
Arquivo: post.py Projeto: xme/DoFler
def services(db):
    '''
    Returns the running status of the services on the dofler sensor. 
    '''
    if auth(request) and request.method == 'POST':
        parser = request.forms.get('parser') or None
        action = request.forms.get('action') or None
        if action == 'Stop':
            monitor.stop(parser)
        if action == 'Start':
            monitor.start(parser)
        if action == 'Restart':
            monitor.stop(parser)
            monitor.start(parser)
    return jsonify(monitor.parser_status())
Exemplo n.º 2
0
def services(db):
    '''
    Returns the running status of the services on the dofler sensor. 
    '''
    if auth(request) and request.method == 'POST':
        parser = request.forms.get('parser') or None
        action = request.forms.get('action') or None
        if action == 'Stop':
            monitor.stop(parser)
        if action == 'Start':
            monitor.start(parser)
        if action == 'Restart':
            monitor.stop(parser)
            monitor.start(parser)
    return jsonify(monitor.parser_status())
Exemplo n.º 3
0
def services_settings(db):
    '''
    Services Status Page 
    '''
    if auth(request) and request.method == 'POST':
        parser = request.forms.get('parser')
        action = request.forms.get('action')
        if action == 'Stop':
            monitor.stop(parser)
        if action == 'Start':
            monitor.start(parser)
        if action == 'Restart':
            monitor.stop(parser)
            monitor.start(parser)
    return env.get_template('settings_services.html').render(
        auth=auth(request), parsers=monitor.parser_status())
Exemplo n.º 4
0
def services_settings(db):
    '''
    Services Status Page 
    '''
    if auth(request) and request.method == 'POST':
        parser = request.forms.get('parser')
        action = request.forms.get('action')
        if action == 'Stop':
            monitor.stop(parser)
        if action == 'Start':
            monitor.start(parser)
        if action == 'Restart':
            monitor.stop(parser)
            monitor.start(parser)
    return env.get_template('settings_services.html').render(
        auth=auth(request),
        parsers=monitor.parser_status()
    )
Exemplo n.º 5
0
def start_parser(parser, db):
    '''
    Starts the parser specified. 
    '''
    if auth(request):
        monitor.start(parser)
        return env.get_template('parsers.html').render(
            parsers=monitor.parser_status(),
            auth=auth(request), 
            status=monitor.status()
        )
    else:
        return env.get_template('parsers.html').render(
            error='Must be Authenticated to Start Parsers',
            parsers=monitor.parser_status(),
            auth=auth(request), 
            status=monitor.status()
        )