Beispiel #1
0
def member_join_form(nodes=[]):
    return pyforms.Form(pyforms.Dropdown("node_id",
                                         description=u"区域",
                                         args=nodes,
                                         required="required",
                                         **input_style),
                        pyforms.Textbox("realname",
                                        rules.len_of(2, 32),
                                        description=u"用户姓名(必填)",
                                        required="required",
                                        **input_style),
                        pyforms.Dropdown("sex",
                                         description=u"性别",
                                         args=sexopt.items(),
                                         required="required",
                                         **input_style),
                        pyforms.Textbox("age",
                                        rules.is_number,
                                        description=u"年龄(必填)",
                                        size=3,
                                        required="required",
                                        **input_style),
                        pyforms.Textbox("username",
                                        rules.is_alphanum3(6, 32),
                                        description=u"用户名(必填)",
                                        size=32,
                                        required="required",
                                        **input_style),
                        pyforms.Password("password",
                                         rules.len_of(6, 32),
                                         description=u"登录密码(必填)",
                                         size=32,
                                         required="required",
                                         **input_style),
                        pyforms.Textbox("email",
                                        rules.is_email,
                                        description=u"电子邮箱(必填)",
                                        size=64,
                                        required="required",
                                        **input_style),
                        pyforms.Textbox("idcard",
                                        rules.len_of(0, 32),
                                        description=u"证件号码",
                                        **input_style),
                        pyforms.Textbox("mobile",
                                        rules.len_of(0, 32),
                                        description=u"用户手机号码",
                                        **input_style),
                        pyforms.Textbox("address",
                                        description=u"用户地址",
                                        hr=True,
                                        **input_style),
                        pyforms.Button("submit",
                                       type="submit",
                                       html=u"<b>注册</b>",
                                       **button_style),
                        action="/join",
                        title=u"用户注册")
Beispiel #2
0
def member_update_form(nodes=[]):
    return pyforms.Form(
        pyforms.Hidden("member_id", description=u"mid",  required="required", **input_style),
        pyforms.Textbox("realname", rules.len_of(2,32), description=u"用户姓名", required="required",**input_style),
        pyforms.Textbox("member_name", description=u"用户登陆名", readonly="readonly",**input_style),
        pyforms.Password("new_password", rules.len_of(0,128),value="", description=u"用户登陆密码(留空不修改)", **input_style),
        pyforms.Textbox("idcard", rules.len_of(0,32), description=u"证件号码", **input_style),
        pyforms.Textbox("mobile", rules.len_of(0,32),description=u"用户手机号码", **input_style),
        pyforms.Textbox("address", description=u"用户地址",hr=True, **input_style),
        pyforms.Button("submit",  type="submit", html=u"<b>提交</b>", **button_style),
        title=u"用户基本信息修改",
        action="/bus/member/update"
    )
Beispiel #3
0
def member_join_form(nodes=[]): 
    return pyforms.Form(
        pyforms.Dropdown("node_id", description=u"区域", args=nodes,required="required", **input_style),
        pyforms.Textbox("realname", rules.len_of(2,32), description=u"用户姓名(必填)", required="required",**input_style),
        pyforms.Dropdown("sex", description=u"性别", args=sexopt.items(),required="required", **input_style),
        pyforms.Textbox("age", rules.is_number, description=u"年龄(必填)", size=3,required="required",**input_style),
        pyforms.Textbox("username", rules.is_alphanum3(6, 32), description=u"用户名(必填)", size=32,required="required",**input_style),
        pyforms.Password("password", rules.len_of(6,32), description=u"登录密码(必填)", size=32, required="required",**input_style),
        pyforms.Textbox("email", rules.is_email, description=u"电子邮箱(必填)", size=64,required="required",**input_style),
        pyforms.Textbox("idcard", rules.len_of(0,32), description=u"证件号码", **input_style),
        pyforms.Textbox("mobile", rules.len_of(0,32),description=u"用户手机号码", **input_style),
        pyforms.Textbox("address", description=u"用户地址",hr=True, **input_style),
        pyforms.Button("submit", type="submit", html=u"<b>注册</b>", **button_style),
        action="/join",
        title=u"用户注册"
    )
Beispiel #4
0
def product_update_form():
    return pyforms.Form(pyforms.Hidden("id", description=u"编号"),
                        pyforms.Hidden("product_policy", description=u""),
                        pyforms.Textbox("product_name",
                                        rules.len_of(4, 32),
                                        description=u"资费名称",
                                        required="required",
                                        **input_style),
                        pyforms.Textbox("product_policy_name",
                                        description=u"资费策略",
                                        readonly="readonly",
                                        required="required",
                                        **input_style),
                        pyforms.Dropdown("product_status",
                                         args=product_status_dict.items(),
                                         description=u"资费状态",
                                         required="required",
                                         **input_style),
                        pyforms.Textbox("fee_months",
                                        rules.is_number,
                                        description=u"买断月数",
                                        **input_style),
                        pyforms.Textbox("fee_price",
                                        rules.is_rmb,
                                        description=u"资费价格(包月价/小时价/买断价)(元)",
                                        required="required",
                                        **input_style),
                        pyforms.Textbox("fee_period",
                                        rules.is_period,
                                        description=u"开放认证时段",
                                        **input_style),
                        pyforms.Textbox("concur_number",
                                        rules.is_number,
                                        description=u"并发数控制(0表示不限制)",
                                        **input_style),
                        pyforms.Dropdown("bind_mac",
                                         args=boolean.items(),
                                         description=u"是否绑定MAC",
                                         **input_style),
                        pyforms.Dropdown("bind_vlan",
                                         args=boolean.items(),
                                         description=u"是否绑定VLAN",
                                         **input_style),
                        pyforms.Textbox("input_max_limit",
                                        rules.is_number,
                                        description=u"最大上行速率",
                                        **input_style),
                        pyforms.Textbox("output_max_limit",
                                        rules.is_number,
                                        description=u"最大下行速率",
                                        **input_style),
                        pyforms.Button("submit",
                                       type="submit",
                                       html=u"<b>更新</b>",
                                       **button_style),
                        title=u"修改资费",
                        action="/product/update")
Beispiel #5
0
def product_add_form():
    return pyforms.Form(pyforms.Textbox("product_name",
                                        rules.len_of(4, 64),
                                        description=u"资费名称",
                                        required="required",
                                        **input_style),
                        pyforms.Dropdown("product_policy",
                                         args=product_policy.items(),
                                         description=u"计费策略",
                                         required="required",
                                         **input_style),
                        pyforms.Textbox("fee_months",
                                        rules.is_number,
                                        description=u"买断月数",
                                        **input_style),
                        pyforms.Textbox("fee_price",
                                        rules.is_rmb,
                                        description=u"资费价格(包月价/小时价/买断价)(元)",
                                        required="required",
                                        **input_style),
                        pyforms.Textbox("fee_period",
                                        rules.is_period,
                                        description=u"开放认证时段",
                                        **input_style),
                        pyforms.Textbox("concur_number",
                                        rules.is_numberOboveZore,
                                        description=u"并发数控制(0表示不限制)",
                                        value="0",
                                        **input_style),
                        pyforms.Dropdown("bind_mac",
                                         args=boolean.items(),
                                         description=u"是否绑定MAC ",
                                         **input_style),
                        pyforms.Dropdown("bind_vlan",
                                         args=boolean.items(),
                                         description=u"是否绑定VLAN ",
                                         **input_style),
                        pyforms.Textbox("input_max_limit",
                                        rules.is_number,
                                        description=u"最大上行速率 ",
                                        **input_style),
                        pyforms.Textbox("output_max_limit",
                                        rules.is_number,
                                        description=u"最大下行速率 ",
                                        **input_style),
                        pyforms.Dropdown("product_status",
                                         args=product_status_dict.items(),
                                         description=u"资费状态",
                                         required="required",
                                         **input_style),
                        pyforms.Button("submit",
                                       type="submit",
                                       html=u"<b>提交</b>",
                                       **button_style),
                        title=u"增加资费",
                        action="/product/add")
Beispiel #6
0
def user_open_form(nodes=[],products=[]):
    return pyforms.Form(
        pyforms.Dropdown("node_id", description=u"区域", args=nodes,required="required", **input_style),
        pyforms.Textbox("realname", rules.len_of(2,32), description=u"用户姓名", required="required",**input_style),
        pyforms.Textbox("member_name", rules.len_of(6,64), description=u"用户登陆名", required="required",**input_style),
        pyforms.Textbox("member_password", rules.len_of(6,128), description=u"用户登陆密码", required="required",**input_style),
        pyforms.Textbox("idcard", rules.len_of(0,32), description=u"证件号码", **input_style),
        pyforms.Textbox("mobile", rules.len_of(0,32),description=u"用户手机号码", **input_style),
        pyforms.Textbox("address", description=u"用户地址",hr=True, **input_style),
        pyforms.Textbox("account_number", description=u"用户上网账号",  required="required", **input_style),
        pyforms.Textbox("password", description=u"上网密码", required="required", **input_style),
        pyforms.Textbox("ip_address", description=u"用户IP地址",**input_style),
        pyforms.Dropdown("product_id",args=products, description=u"上网资费",  required="required", **input_style),
        pyforms.Textbox("months",rules.is_number, description=u"月数(包月有效)", required="required", **input_style),
        pyforms.Textbox("fee_value",rules.is_rmb, description=u"缴费金额",  required="required", **input_style),
        pyforms.Textbox("expire_date", rules.is_date,description=u"过期日期",  required="required", **input_style),
        pyforms.Hidden("status", args=userreg_state.items(),value=1, description=u"用户状态",  **input_style),
        pyforms.Button("submit",  type="submit", html=u"<b>提交</b>", **button_style),
        title=u"用户开户",
        action="/bus/member/open"
    )
Beispiel #7
0
def member_update_form(nodes=[]):
    return pyforms.Form(pyforms.Hidden("member_id",
                                       description=u"mid",
                                       required="required",
                                       **input_style),
                        pyforms.Textbox("realname",
                                        rules.len_of(2, 32),
                                        description=u"用户姓名",
                                        required="required",
                                        **input_style),
                        pyforms.Textbox("member_name",
                                        description=u"用户登陆名",
                                        readonly="readonly",
                                        **input_style),
                        pyforms.Password("new_password",
                                         rules.len_of(0, 128),
                                         value="",
                                         description=u"用户登陆密码(留空不修改)",
                                         **input_style),
                        pyforms.Textbox("idcard",
                                        rules.len_of(0, 32),
                                        description=u"证件号码",
                                        **input_style),
                        pyforms.Textbox("mobile",
                                        rules.len_of(0, 32),
                                        description=u"用户手机号码",
                                        **input_style),
                        pyforms.Textbox("address",
                                        description=u"用户地址",
                                        hr=True,
                                        **input_style),
                        pyforms.Button("submit",
                                       type="submit",
                                       html=u"<b>提交</b>",
                                       **button_style),
                        title=u"用户基本信息修改",
                        action="/bus/member/update")
Beispiel #8
0
def product_add_form():
    return pyforms.Form(
        pyforms.Textbox("product_name", rules.len_of(4, 64), description=u"资费名称",  required="required",**input_style),
        pyforms.Dropdown("product_policy", args=product_policy.items(), description=u"计费策略", required="required",**input_style),
        pyforms.Textbox("fee_months", rules.is_number, description=u"买断月数", **input_style),
        pyforms.Textbox("fee_price", rules.is_rmb, description=u"资费价格(包月价/小时价/买断价)(元)", required="required", **input_style),
        pyforms.Textbox("fee_period",rules.is_period,description=u"开放认证时段",**input_style),
        pyforms.Textbox("concur_number", rules.is_numberOboveZore,description=u"并发数控制(0表示不限制)",value="0", **input_style),
        pyforms.Dropdown("bind_mac",  args=boolean.items(), description=u"是否绑定MAC ",**input_style),
        pyforms.Dropdown("bind_vlan",  args=boolean.items(),description=u"是否绑定VLAN ",**input_style),
        pyforms.Textbox("input_max_limit",  rules.is_number,description=u"最大上行速率(1M=1048576)bps", **input_style),
        pyforms.Textbox("output_max_limit",  rules.is_number,description=u"最大下行速率(1M=1048576)bps",**input_style),
        pyforms.Dropdown("product_status", args=product_status_dict.items(),description=u"资费状态", required="required", **input_style),
        pyforms.Button("submit", type="submit", html=u"<b>提交</b>", **button_style),
        title=u"增加资费",
        action="/product/add"
    )
Beispiel #9
0
def user_open_form(nodes=[], products=[], groups=[]):
    return pyforms.Form(pyforms.Dropdown("node_id",
                                         description=u"区域",
                                         args=nodes,
                                         required="required",
                                         **input_style),
                        pyforms.Textbox("realname",
                                        rules.len_of(2, 32),
                                        description=u"用户姓名",
                                        required="required",
                                        **input_style),
                        pyforms.Textbox("member_name",
                                        rules.len_of(6, 64),
                                        description=u"用户登陆名",
                                        required="required",
                                        **input_style),
                        pyforms.Textbox("member_password",
                                        rules.len_of(6, 128),
                                        description=u"用户登陆密码",
                                        required="required",
                                        **input_style),
                        pyforms.Textbox("idcard",
                                        rules.len_of(0, 32),
                                        description=u"证件号码",
                                        **input_style),
                        pyforms.Textbox("mobile",
                                        rules.len_of(0, 32),
                                        description=u"用户手机号码",
                                        **input_style),
                        pyforms.Textbox("address",
                                        description=u"用户地址",
                                        hr=True,
                                        **input_style),
                        pyforms.Textbox("account_number",
                                        description=u"用户上网账号",
                                        required="required",
                                        **input_style),
                        pyforms.Dropdown("group_id",
                                         args=groups,
                                         description=u"用户组",
                                         **input_style),
                        pyforms.Textbox("ip_address",
                                        description=u"用户IP地址",
                                        **input_style),
                        pyforms.Dropdown("product_id",
                                         args=products,
                                         description=u"上网资费",
                                         required="required",
                                         **input_style),
                        pyforms.Textbox("months",
                                        rules.is_number,
                                        description=u"月数(包月有效)",
                                        required="required",
                                        **input_style),
                        pyforms.Textbox("password",
                                        description=u"上网密码",
                                        required="required",
                                        **input_style),
                        pyforms.Textbox("fee_value",
                                        rules.is_rmb,
                                        description=u"缴费金额",
                                        required="required",
                                        **input_style),
                        pyforms.Textbox("expire_date",
                                        rules.is_date,
                                        description=u"过期日期",
                                        required="required",
                                        **input_style),
                        pyforms.Hidden("status",
                                       args=userreg_state.items(),
                                       value=1,
                                       description=u"用户状态",
                                       **input_style),
                        pyforms.Button("submit",
                                       type="submit",
                                       html=u"<b>提交</b>",
                                       **button_style),
                        title=u"用户开户",
                        action="/bus/member/open")
Beispiel #10
0
        inputs.append(_input)
    inputs.append(
        pyforms.Button("submit",
                       type="submit",
                       html=u"<b>提交</b>",
                       **button_style))
    return pyforms.Form(*inputs, title=u"参数管理", action="/param")


passwd_update_form = pyforms.Form(pyforms.Textbox("operator_name",
                                                  description=u"管理员名",
                                                  size=32,
                                                  readonly="readonly",
                                                  **input_style),
                                  pyforms.Password("operator_pass",
                                                   rules.len_of(6, 32),
                                                   description=u"管理员新密码",
                                                   size=32,
                                                   value="",
                                                   required="required",
                                                   **input_style),
                                  pyforms.Password("operator_pass_chk",
                                                   rules.len_of(6, 32),
                                                   description=u"确认管理员新密码",
                                                   size=32,
                                                   value="",
                                                   required="required",
                                                   **input_style),
                                  pyforms.Button("submit",
                                                 type="submit",
                                                 html=u"<b>更新</b>",
Beispiel #11
0
#coding:utf-8
from libs import pyforms
from libs.pyforms import dataform
from libs.pyforms import rules
from libs.pyforms.rules import button_style,input_style

boolean = {0:u"否", 1:u"是"}

sexopt = {1:u"男",0:u"女"}

member_login_form = pyforms.Form(
    pyforms.Textbox("username", rules.len_of(1, 32), description=u"用户名", size=32,required="required",**input_style),
    pyforms.Password("password", rules.len_of(1,32), description=u"登录密码", size=32, required="required",**input_style),
    pyforms.Button("submit", type="submit", html=u"<b>登陆</b>", **button_style),
    pyforms.Hidden("next",value="/"),
    action="/login",
    title=u"用户登陆"
)

def member_join_form(nodes=[]): 
    return pyforms.Form(
        pyforms.Dropdown("node_id", description=u"区域", args=nodes,required="required", **input_style),
        pyforms.Textbox("realname", rules.len_of(2,32), description=u"用户姓名(必填)", required="required",**input_style),
        pyforms.Dropdown("sex", description=u"性别", args=sexopt.items(),required="required", **input_style),
        pyforms.Textbox("age", rules.is_number, description=u"年龄(必填)", size=3,required="required",**input_style),
        pyforms.Textbox("username", rules.is_alphanum3(6, 32), description=u"用户名(必填)", size=32,required="required",**input_style),
        pyforms.Password("password", rules.len_of(6,32), description=u"登录密码(必填)", size=32, required="required",**input_style),
        pyforms.Textbox("email", rules.is_email, description=u"电子邮箱(必填)", size=64,required="required",**input_style),
        pyforms.Textbox("idcard", rules.len_of(0,32), description=u"证件号码", **input_style),
        pyforms.Textbox("mobile", rules.len_of(0,32),description=u"用户手机号码", **input_style),
        pyforms.Textbox("address", description=u"用户地址",hr=True, **input_style),
Beispiel #12
0
#coding:utf-8
from libs import pyforms
from libs.pyforms import dataform
from libs.pyforms import rules
from libs.pyforms.rules import button_style,input_style

boolean = {0:u"否", 1:u"是"}

sexopt = {1:u"男",0:u"女"}

member_login_form = pyforms.Form(
    pyforms.Textbox("username", rules.len_of(1, 32), description=u"用户名", size=32,required="required",**input_style),
    pyforms.Password("password", rules.len_of(1,32), description=u"登录密码", size=32, required="required",**input_style),
    pyforms.Button("submit", type="submit", html=u"<b>登陆</b>", **button_style),
    pyforms.Hidden("next",value="/"),
    action="/login",
    title=u"用户登陆"
)

def member_join_form(nodes=[]): 
    return pyforms.Form(
        pyforms.Dropdown("node_id", description=u"区域", args=nodes,required="required", **input_style),
        pyforms.Textbox("realname", rules.len_of(2,32), description=u"用户姓名(必填)", required="required",**input_style),
        pyforms.Dropdown("sex", description=u"性别", args=sexopt.items(),required="required", **input_style),
        pyforms.Textbox("age", rules.is_number, description=u"年龄(必填)", size=3,required="required",**input_style),
        pyforms.Textbox("username", rules.is_alphanum3(6, 32), description=u"用户名(必填)", size=32,required="required",**input_style),
        pyforms.Password("password", rules.len_of(6,32), description=u"登录密码(必填)", size=32, required="required",**input_style),
        pyforms.Textbox("email", rules.is_email, description=u"电子邮箱(必填)", size=64,required="required",**input_style),
        pyforms.Textbox("idcard", rules.len_of(0,32), description=u"证件号码", **input_style),
        pyforms.Textbox("mobile", rules.len_of(0,32),description=u"用户手机号码", **input_style),
        pyforms.Textbox("address", description=u"用户地址",hr=True, **input_style),
Beispiel #13
0
from libs.pyforms import rules
from libs.pyforms.rules import button_style,input_style

boolean = {0:u"否", 1:u"是"}

def param_form(params=[]):
    inputs = []
    for param in params:
        _input = pyforms.Textbox(param.param_name, description=param.param_desc,value=param.param_value, **input_style)
        inputs.append(_input)
    inputs.append(pyforms.Button("submit", type="submit", html=u"<b>提交</b>",**button_style))
    return pyforms.Form(*inputs,title=u"参数管理",action="/param")

passwd_update_form = pyforms.Form(
    pyforms.Textbox("operator_name", description=u"管理员名", size=32, readonly="readonly", **input_style),
    pyforms.Password("operator_pass", rules.len_of(6, 32), description=u"管理员新密码", size=32,value="", required="required", **input_style),
    pyforms.Password("operator_pass_chk", rules.len_of(6, 32), description=u"确认管理员新密码", size=32,value="", required="required", **input_style),
    pyforms.Button("submit", type="submit", html=u"<b>更新</b>", **button_style),
    title=u"管理密码更新",
    action="/passwd"
)

node_add_form = pyforms.Form(
    pyforms.Textbox("node_name", rules.len_of(2,32), description=u"节点名称",required="required",**input_style),
    pyforms.Textarea("node_desc", rules.len_of(0, 128), description=u"节点描述",**input_style),
    pyforms.Button("submit", type="submit", html=u"<b>提交</b>",**button_style),
    title=u"增加节点",
    action="/node/add"
)

node_update_form = pyforms.Form(
Beispiel #14
0
#coding:utf-8
from libs import pyforms
from libs.pyforms import dataform
from libs.pyforms import rules
from libs.pyforms.rules import button_style, input_style

boolean = {0: u"否", 1: u"是"}

sexopt = {1: u"男", 0: u"女"}

member_login_form = pyforms.Form(pyforms.Textbox("username",
                                                 rules.len_of(1, 32),
                                                 description=u"用户名",
                                                 size=32,
                                                 required="required",
                                                 **input_style),
                                 pyforms.Password("password",
                                                  rules.len_of(1, 32),
                                                  description=u"登录密码",
                                                  size=32,
                                                  required="required",
                                                  **input_style),
                                 pyforms.Button("submit",
                                                type="submit",
                                                html=u"<b>登陆</b>",
                                                **button_style),
                                 pyforms.Hidden("next", value="/"),
                                 action="/login",
                                 title=u"用户登陆")