示例#1
0
def domain_add_vform(tpls=[]):
    return pyforms.Form(
        pyforms.Dropdown("tpl_name", tpls, rules.not_null, description=u"模版", required="required", **input_style),
        pyforms.Textbox(
            "domain_code", rules.is_alphanum2(2, 16), description=u"域编码", required="required", **input_style
        ),
        pyforms.Textbox("domain_desc", rules.not_null, description=u"域描述", required="required", **input_style),
        pyforms.Button("submit", type="submit", html=u"<b>提交</b>", **button_style),
        title=u"增加域属性",
        action="/domain/add",
    )
示例#2
0
def oss_add_form():
    return pyforms.Form(
        pyforms.Textbox("name", rules.len_of(1, 32), description=u"OSS服务器名称",required="required", **input_style),
        pyforms.Textbox("auth_url", rules.len_of(1, 255), description=u"OSS服务器认证地址",required="required", **input_style),
        pyforms.Textbox("acct_url", rules.len_of(1, 255), description=u"OSS服务器记账地址",required="required", **input_style),
        pyforms.Textbox("admin_url", rules.len_of(1, 255), description=u"OSS服务器管理地址",required="required", **input_style),
        pyforms.Textbox("secret", rules.is_alphanum2(32, 32), description=u"共享秘钥", required="required",**input_style),
        pyforms.Dropdown("serv_type", args=serv_types.items(),description=u"服务器类型(主|备)", required="required", **input_style),
        pyforms.Button("submit", type="submit", html=u"<b>提交</b>", **button_style),
        title=u"增加OSS服务器信息",
        action="/oss/add",
    )
示例#3
0
bastype = {
    '0'    : u'标准',
    # '9': u'思科',
    # '3041': u'阿尔卡特',
    '2352': u'爱立信',
    '2011': u'华为',
    '25506': u'H3C',
    '3902': u'中兴',
    '10055': u'爱快',
    '14988': u'RouterOS'
}

bas_add_form = pyforms.Form(
    pyforms.Textbox("ip_addr", rules.is_ip, description=u"设备地址", required="required", **input_style),
    pyforms.Textbox("bas_name", rules.len_of(2, 64), description=u"设备名称", required="required", **input_style),
    pyforms.Textbox("bas_secret", rules.is_alphanum2(4, 32), description=u"共享秘钥", required="required", **input_style),
    pyforms.Dropdown("vendor_id", description=u"设备类型", args=bastype.items(), required="required", **input_style),
    pyforms.Dropdown("portal_vendor", description=u"portal协议", args=portaltype.items(), required="required", **input_style),
    pyforms.Dropdown("time_type", description=u"时区类型", args=timetype.items(), required="required", **input_style),
    pyforms.Textbox("ac_port", rules.is_number, description=u"AC端口", default=2000, required="required",**input_style),
    pyforms.Textbox("coa_port", rules.is_number, description=u"CoA端口", default=3799, required="required",**input_style),
    pyforms.Button("submit", type="submit", html=u"<b>提交</b>", **button_style),
    title=u"增加接入设备",
    action="/bas/add"
)

bas_update_form = pyforms.Form(
    pyforms.Hidden("id", description=u"编号"),
    pyforms.Textbox("ip_addr", rules.is_ip, description=u"设备地址", required="required", readonly="readonly", **input_style),
    pyforms.Textbox("bas_name", rules.len_of(2, 64), description=u"设备名称", required="required", **input_style),
    pyforms.Textbox("bas_secret", rules.is_alphanum2(4, 32), description=u"共享秘钥", required="required", **input_style),