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() )
def status_page(db): ''' Parser Status Page. ''' return env.get_template('parsers.html').render( parsers=monitor.parser_status(), auth=auth(request), status=monitor.status() )
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 parsers_settings(db): ''' Parser Configuration Settings Page ''' if auth(request) and request.method == 'POST': settings = {} for item in request.forms: settings[item] = request.forms[item] update_settings(settings) parsers = {} for item in monitor.parser_status(): parsers[item] = { 'enabled': setting('%s_enabled' % item).boolvalue, 'command': setting('%s_command' % item).value, } return env.get_template('settings_parsers.html').render( auth=auth(request), parsers=parsers, autostart=setting('autostart').boolvalue, listen_interface=setting('listen_interface').value)
def parsers_settings(db): ''' Parser Configuration Settings Page ''' if auth(request) and request.method == 'POST': settings = {} for item in request.forms: settings[item] = request.forms[item] update_settings(settings) parsers = {} for item in monitor.parser_status(): parsers[item] = { 'enabled': setting('%s_enabled' % item).boolvalue, 'command': setting('%s_command' % item).value, } return env.get_template('settings_parsers.html').render( auth=auth(request), parsers=parsers, autostart=setting('autostart').boolvalue, listen_interface=setting('listen_interface').value )