def account_open_form(products=[]): return pyforms.Form(pyforms.Textbox("recharge_card", description=u"充值卡号", required="required", **input_style), pyforms.Password("recharge_pwd", description=u"充值卡密码", required="required", **input_style), pyforms.Textbox("account_number", description=u"用户账号", required="required", **input_style), pyforms.Password("password", description=u"认证密码", required="required", **input_style), pyforms.Dropdown("product_id", args=products, description=u"资费", required="required", **input_style), pyforms.Button("submit", type="submit", html=u"<b>提交</b>", **button_style), title=u"用户自助开户", action="/open")
def member_update_form(): return pyforms.Form( pyforms.Textbox("realname", description=u"用户姓名", readonly="readonly", **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("email", rules.len_of(0, 128), 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="/user/update")
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"用户注册")
def opr_add_form(nodes=[]): return pyforms.Form( pyforms.Textbox("operator_name", rules.len_of(2,32), description=u"操作员名称",required="required",**input_style), pyforms.Textbox("operator_desc", rules.len_of(0,255),description=u"操作员姓名",**input_style), pyforms.Password("operator_pass", rules.len_of(6, 128), description=u"操作员密码", required="required",**input_style), pyforms.Dropdown("operator_status", description=u"操作员状态", args=opr_status_dict.items(), required="required",**input_style), pyforms.Dropdown("operator_nodes", description=u"关联区域(多选)",args=nodes, required="required",multiple="multiple",size=4,**input_style), pyforms.Button("submit", type="submit", html=u"<b>提交</b>", **button_style), title=u"增加操作员", action="/opr/add" )
def member_update_form(nodes=[]): return pyforms.Form( pyforms.Hidden("account_number", description=u"用户账号"), 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("email", rules.len_of(0,128), 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" )
description=u"拒绝延迟时间(秒)(0-9)", **input_style), # pyforms.Textbox("portal_secret", description=u"portal登陆密钥", **input_style), pyforms.Button("submit", type="submit", html=u"<b>更新</b>", **button_style), title=u"参数配置管理", action="/param/update") 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"管理密码更新",
from toughradius.console.libs.pyforms import rules from toughradius.console.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,
html=u"<b>更新</b>", **button_style), title=u"radiusd自助服务配置管理", action="/config/customer/update") control_form = pyforms.Form(pyforms.Textbox("host", description=u"radius系统控制监听地址", readonly="readonly", **input_style), pyforms.Textbox("port", description=u"系统控制监听端口", **input_style), pyforms.Textbox("logfile", description=u"日志文件", readonly="readonly", **input_style), pyforms.Textbox("user", description=u"管理员名", **input_style), pyforms.Password("passwd", description=u"管理密码", autocomplete="off", help=u"留空则不修改", **input_style), pyforms.Button("submit", type="submit", html=u"<b>更新</b>", **button_style), title=u"radiusd系统控制配置管理", action="/config/control/update")