def setup(self, app, action, **kwargs): ''' show the setup page ''' host_app = cherrypy.request.path_info.split('/')[3] user = cherrypy.session['user']['name'] if not self.is_app_admin(host_app, user): raise cherrypy.HTTPRedirect( self._redirect(host_app, app, 'unauthorized')) mon = MonitorInput.all() mon = mon.filter_by_app(app) cannon = EventLogCannon.all() cannon = cannon.order_by('importance', sort_dir='asc') win = WinEventLogInput.all() win = win.search('name=localhost') system = (sys.platform.startswith("win")) optimize = bool(self.get_distsearch(host_app)) return self.render_template( '/%s:/templates/setup_show.html' % host_app, dict(system=system, mon=mon, win=win, cannon=cannon, optimize=optimize, app=app))
def save(self, app, action, **params): ''' save the posted setup content ''' host_app = cherrypy.request.path_info.split('/')[3] user = cherrypy.session['user']['name'] win = WinEventLogInput.get(WinEventLogInput.build_id('localhost', host_app, user)) evt_logs = params.get('winevtlogs') if evt_logs: win.logs = evt_logs if normBool(win.disabled): win.enable() try: win.edit() except Exception, ex: logger.exception(ex) raise cherrypy.HTTPRedirect(self._redirect(host_app, app, 'failure'))
def save(self, app, action, **params): ''' save the posted setup content ''' host_app = cherrypy.request.path_info.split('/')[3] user = cherrypy.session['user']['name'] win = WinEventLogInput.get( WinEventLogInput.build_id('localhost', host_app, user)) evt_logs = params.get('winevtlogs') if evt_logs: win.logs = evt_logs if normBool(win.disabled): win.enable() try: win.edit() except Exception, ex: logger.exception(ex) raise cherrypy.HTTPRedirect( self._redirect(host_app, app, 'failure'))
def setup(self, app, action, **kwargs): ''' show the setup page ''' host_app = cherrypy.request.path_info.split('/')[3] user = cherrypy.session['user']['name'] if not self.is_app_admin(host_app, user): raise cherrypy.HTTPRedirect(self._redirect(host_app, app, 'unauthorized')) mon = MonitorInput.all() mon = mon.filter_by_app(app) cannon = EventLogCannon.all() cannon = cannon.order_by('importance', sort_dir='asc') win = WinEventLogInput.all() win = win.search('name=localhost') system = (sys.platform.startswith("win")) optimize = bool(self.get_distsearch(host_app)) return self.render_template('/%s:/templates/setup_show.html' % host_app, dict(system=system, mon=mon, win=win, cannon=cannon, optimize=optimize, app=app))