예제 #1
0
def fw(req, name, params):

    location = 'admin:fw'

    # get current config

    config = vsutil.fw_get_config(name)['CURRENT']

    body_tmpl = _tmpl_path('fw_body.html')

    mode = config['mode']
    if mode == 'block':
        rules = config['open']
    else:
        rules = config['close']

    body_vars = {'mode': mode,
                 'rules': rules}

    vars = {'global_menu': _global_menu(req, name, location),
            'body':psp.PSP(req, body_tmpl, vars=body_vars),
            'name':name}
            
    p = psp.PSP(req, _tmpl_path('main_frame.html'),
                vars=vars)

    p.run()

    return apache.OK
예제 #2
0
def fw(req, name, params):

    location = 'admin:fw'

    # get current config

    config = vsutil.fw_get_config(name)['CURRENT']

    body_tmpl = _tmpl_path('fw_body.html')

    mode = config['mode']
    if mode == 'block':
        rules = config['open']
    else:
        rules = config['close']

    body_vars = {'mode': mode, 'rules': rules}

    vars = {
        'global_menu': _global_menu(req, name, location),
        'body': psp.PSP(req, body_tmpl, vars=body_vars),
        'name': name
    }

    p = psp.PSP(req, _tmpl_path('main_frame.html'), vars=vars)

    p.run()

    return apache.OK
예제 #3
0
def block(req, name, params):

    location = 'admin:block'

    # get current config

    ips = vsutil.fw_get_config(name)['BLOCK']

    body_tmpl = _tmpl_path('block_body.html')

    body_vars = {'ips': ' '.join(ips)}

    vars = {'global_menu': _global_menu(req, name, location),
            'body':psp.PSP(req, body_tmpl, vars=body_vars),
            'name':name}
            
    p = psp.PSP(req, _tmpl_path('main_frame.html'),
                vars=vars)

    p.run()

    return apache.OK
예제 #4
0
def block(req, name, params):

    location = 'admin:block'

    # get current config

    ips = vsutil.fw_get_config(name)['BLOCK']

    body_tmpl = _tmpl_path('block_body.html')

    body_vars = {'ips': ' '.join(ips)}

    vars = {
        'global_menu': _global_menu(req, name, location),
        'body': psp.PSP(req, body_tmpl, vars=body_vars),
        'name': name
    }

    p = psp.PSP(req, _tmpl_path('main_frame.html'), vars=vars)

    p.run()

    return apache.OK