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())
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())
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() )
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() )