コード例 #1
0
ファイル: common.py プロジェクト: zevenet/cherokee
    def __init__(self, key, **kwargs):
        Handler.PluginHandler.__init__(self, key, **kwargs)
        Handler.PluginHandler.AddCommon(self)

        table = CTK.PropsTable()
        table.Add(
            _('Allow PathInfo'),
            CTK.CheckCfgText('%s!allow_pathinfo' % (key), False, _('Allow')),
            _(NOTE_PATHINFO))
        table.Add(
            _('Allow Directory Listing'),
            CTK.CheckCfgText('%s!allow_dirlist' % (key), True, _('Allow')),
            _(NOTE_DIRLIST))

        submit = CTK.Submitter(URL_APPLY)
        submit += table

        self += CTK.RawHTML('<h2>%s</h2>' % (_('Parsing')))
        self += CTK.Indenter(submit)
        self += instance_plugin('file',
                                key,
                                show_document_root=False,
                                symlinks=False)
        self += instance_plugin('dirlist',
                                key,
                                show_document_root=False,
                                symlinks=True)
コード例 #2
0
ファイル: common.py プロジェクト: 304471720/webserver
    def __init__ (self, key, **kwargs):
        Handler.PluginHandler.__init__ (self, key, **kwargs)
        Handler.PluginHandler.AddCommon (self)

        table = CTK.PropsTable()
        table.Add (_('Allow PathInfo'),          CTK.CheckCfgText('%s!allow_pathinfo'%(key), False, _('Allow')), _(NOTE_PATHINFO))
        table.Add (_('Allow Directory Listing'), CTK.CheckCfgText('%s!allow_dirlist'%(key),  True,  _('Allow')), _(NOTE_DIRLIST))

        submit = CTK.Submitter (URL_APPLY)
        submit += table

        self += CTK.RawHTML ('<h2>%s</h2>' %(_('Parsing')))
        self += CTK.Indenter (submit)
        self += instance_plugin('file',    key, show_document_root=False, symlinks=False)
        self += instance_plugin('dirlist', key, show_document_root=False, symlinks=True)
コード例 #3
0
ファイル: secdownload.py プロジェクト: zevenet/cherokee
    def __init__(self, key, **kwargs):
        Handler.PluginHandler.__init__(self, key, **kwargs)
        Handler.PluginHandler.AddCommon(self)

        table = CTK.PropsTable()
        table.Add(_('Secret'), CTK.TextCfg('%s!secret' % (key), False),
                  _(NOTE_SECRET))
        table.Add(_('Timeout'), CTK.TextCfg('%s!timeout' % (key), True),
                  _(NOTE_TIMEOUT))

        submit = CTK.Submitter(URL_APPLY)
        submit += table

        # Streaming
        self += CTK.RawHTML('<h2>%s</h2>' % (_('Covering Parameters')))
        self += CTK.Indenter(submit)

        # File
        self += instance_plugin('file', key, show_document_root=False)

        # Publish
        VALS = [("%s!secret" % (key), validations.is_not_empty),
                ("%s!timeout" % (key), validations.is_number_gt_0)]

        CTK.publish('^%s' % (URL_APPLY),
                    CTK.cfg_apply_post,
                    validation=VALS,
                    method="POST")
コード例 #4
0
ファイル: streaming.py プロジェクト: Daniel15/webserver
    def __init__ (self, key, **kwargs):
        Handler.PluginHandler.__init__ (self, key, **kwargs)
        Handler.PluginHandler.AddCommon (self)

        rate = CTK.CheckCfgText("%s!rate"%(key), True, _('Enabled'))

        table = CTK.PropsTable()
        table.Add (_("Auto Rate"), rate, _(NOTE_RATE))
        table.Add (_("Speedup Factor"), CTK.TextCfg("%s!rate_factor"%(key), True), _(NOTE_RATE_FACTOR))
        table.Add (_("Initial Boost"),  CTK.TextCfg("%s!rate_boost"%(key), True), _(NOTE_RATE_BOOST))

        rate.bind ('change',
                  """if ($('#%(rate)s :checkbox')[0].checked) {
                           $('#%(row1)s').show();
                           $('#%(row2)s').show();
                     } else {
                           $('#%(row1)s').hide();
                           $('#%(row2)s').hide();
                  }""" %({'rate': rate.id, 'row1': table[1].id, 'row2': table[2].id}))

        submit = CTK.Submitter (URL_APPLY)
        submit += table

        # Streaming
        self += CTK.RawHTML ('<h2>%s</h2>' %(_('Audio/Video Streaming')))
        self += CTK.Indenter (submit)

        # File
        self += instance_plugin('file',    key, show_document_root=False)

        # Publish
        VALS = [("%s!rate_factor"%(key), validations.is_float),
                ("%s!rate_boost"%(key),  validations.is_number_gt_0)]

        CTK.publish ('^%s'%(URL_APPLY), CTK.cfg_apply_post, validation=VALS, method="POST")
コード例 #5
0
    def __init__ (self, key, **kwargs):
        Handler.PluginHandler.__init__ (self, key, **kwargs)
        Handler.PluginHandler.AddCommon (self)

        rate = CTK.CheckCfgText("%s!rate"%(key), True, _('Enabled'))

        table = CTK.PropsTable()
        table.Add (_("Auto Rate"), rate, _(NOTE_RATE))
        table.Add (_("Speedup Factor"), CTK.TextCfg("%s!rate_factor"%(key), True), _(NOTE_RATE_FACTOR))
        table.Add (_("Initial Boost"),  CTK.TextCfg("%s!rate_boost"%(key), True), _(NOTE_RATE_BOOST))

        rate.bind ('change',
                  """if ($('#%(rate)s :checkbox')[0].checked) {
                           $('#%(row1)s').show();
                           $('#%(row2)s').show();
                     } else {
                           $('#%(row1)s').hide();
                           $('#%(row2)s').hide();
                  }""" %({'rate': rate.id, 'row1': table[1].id, 'row2': table[2].id}))

        submit = CTK.Submitter (URL_APPLY)
        submit += table

        # Streaming
        self += CTK.RawHTML ('<h2>%s</h2>' %(_('Audio/Video Streaming')))
        self += CTK.Indenter (submit)

        # File
        self += instance_plugin('file',    key, show_document_root=False)

        # Publish
        VALS = [("%s!rate_factor"%(key), validations.is_float),
                ("%s!rate_boost"%(key),  validations.is_number_gt_0)]

        CTK.publish ('^%s$'%(URL_APPLY), CTK.cfg_apply_post, validation=VALS, method="POST")
コード例 #6
0
    def __init__ (self, key, **kwargs):
        Handler.PluginHandler.__init__ (self, key, **kwargs)
        Handler.PluginHandler.AddCommon (self)

        table = CTK.PropsTable()
        table.Add (_('Secret'),  CTK.TextCfg('%s!secret'%(key), False), _(NOTE_SECRET))
        table.Add (_('Timeout'), CTK.TextCfg('%s!timeout'%(key), True), _(NOTE_TIMEOUT))

        submit = CTK.Submitter (URL_APPLY)
        submit += table

        # Streaming
        self += CTK.RawHTML ('<h2>%s</h2>' %(_('Covering Parameters')))
        self += CTK.Indenter (submit)

        # File
        self += instance_plugin('file', key, show_document_root=False)

        # Publish
        VALS = [("%s!secret"%(key),  validations.is_not_empty),
                ("%s!timeout"%(key), validations.is_number_gt_0)]

        CTK.publish ('^%s$'%(URL_APPLY), CTK.cfg_apply_post, validation=VALS, method="POST")