Esempio n. 1
0
def account_open_form(products=[], groups=[]):
    return pyforms.Form(pyforms.Hidden("node_id",
                                       description=u"区域",
                                       **input_style),
                        pyforms.Hidden("member_id", description=u"编号"),
                        pyforms.Textbox("realname",
                                        description=u"用户姓名",
                                        readonly="readonly",
                                        **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.Textbox("address",
                                        description=u"用户地址",
                                        **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/account/open")
Esempio n. 2
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")
Esempio n. 3
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")
Esempio n. 4
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")
Esempio n. 5
0
                                             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(pyforms.Hidden("id", description=u"节点编号"),
                                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/update")
Esempio n. 6
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),