Example #1
0
File: post.py Project: 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())
Example #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())
Example #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())
Example #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()
    )
Example #5
0
def stop_parser(parser, db):
    '''
    Stops the parser specified. 
    '''
    if auth(request):
        monitor.stop(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 Stop Parsers',
            parsers=monitor.parser_status(),
            auth=auth(request), 
            status=monitor.status()
        )