Esempio n. 1
0
    def definitions(self, *args, **kwargs):

        plugins = []
        for k in cherrypy.request.app.config['plugins']:
            plugins.append(k)

        settings = {}
        #Whether to display 'zone' on the 'edit connection' page
        settings['firewalld_disabled'] = Root._firewalld_disabled
        settings['session_timeout'] = SystemSettingsManage.get_session_timeout(
        )

        return {
            'SDCERR': weblcm_def.WEBLCM_ERRORS.get('SDCERR_SUCCESS'),
            'InfoMsg': '',
            'Definitions': {
                'SDCERR': weblcm_def.WEBLCM_ERRORS,
                'PERMISSIONS': weblcm_def.USER_PERMISSION_TYPES,
                'DEVICE_TYPES': weblcm_def.WEBLCM_DEVTYPE_TEXT,
                'DEVICE_STATES': weblcm_def.WEBLCM_STATE_TEXT,
                'PLUGINS': plugins,
                'SETTINGS': settings,
            }
        }
Esempio n. 2
0
    webapp.firmware = SWUpdate()

    webapp.reboot = Reboot()
    webapp.factoryReset = FactoryReset()
    webapp.datetime = DateTimeSetting()

    webapp.positioningSwitch = PositioningSwitch()
    webapp.positioning = Positioning()

    if Bluetooth is not None:
        webapp.bluetooth = Bluetooth()

    webapp.fips = Fips()

    setup_http_server()

    logging.getLogger("cherrypy").propagate = False

    cherrypy.request.hooks.attach('before_handler', force_session_checking)

    #Server config
    cherrypy.config.update({
        'tools.sessions.timeout':
        SystemSettingsManage.get_session_timeout(),
    })

    cherrypy.quickstart(webapp,
                        '/',
                        config=weblcm_def.WEBLCM_PYTHON_SERVER_CONF_FILE)