コード例 #1
0
ファイル: forms.py プロジェクト: shenhzou654321/ToughRADIUS
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")
コード例 #2
0
def issues_add_form(oprs=[]):
    return pyforms.Form(pyforms.Textbox("account_number",
                                        rules.len_of(1, 32),
                                        description=u"用户账号",
                                        required="required",
                                        **input_style),
                        pyforms.Dropdown("issues_type",
                                         description=u"工单类型",
                                         args=issues_types.items(),
                                         **input_style),
                        pyforms.Textarea("content",
                                         rules.len_of(1, 1024),
                                         description=u"工单内容",
                                         rows=6,
                                         required="required",
                                         **input_style),
                        pyforms.Dropdown("assign_operator",
                                         description=u"指派操作员",
                                         args=oprs,
                                         required="required",
                                         **input_style),
                        pyforms.Button("submit",
                                       type="submit",
                                       html=u"<b> 提交 </b>",
                                       **button_style),
                        action="/issues/add",
                        title=u"创建用户工单")()
コード例 #3
0
ファイル: cmanager_forms.py プロジェクト: ywysee/ToughRADIUS
def cmanage_add_form(oprs=[]):
    return pyforms.Form(pyforms.Textbox("manager_code",
                                        rules.len_of(1, 32),
                                        description=u"客户经理工号",
                                        required="required",
                                        **input_style),
                        pyforms.Textbox("manager_name",
                                        rules.len_of(1, 64),
                                        description=u"客户经理姓名",
                                        required="required",
                                        **input_style),
                        pyforms.Textbox("manager_mobile",
                                        rules.len_of(1, 32),
                                        description=u"客户经理电话",
                                        required="required",
                                        **input_style),
                        pyforms.Textbox("manager_email",
                                        rules.len_of(1, 255),
                                        description=u"客户经理邮箱",
                                        **input_style),
                        pyforms.Dropdown("operator_name",
                                         description=u"关联操作员",
                                         args=oprs,
                                         **input_style),
                        pyforms.Button("submit",
                                       type="submit",
                                       html=u"<b> 提交 </b>",
                                       **button_style),
                        title=u"创建客户经理资料")()
コード例 #4
0
ファイル: forms.py プロジェクト: shenhzou654321/ToughRADIUS
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"用户注册")
コード例 #5
0
ファイル: issues_forms.py プロジェクト: shtrend/ToughRADIUS
def issues_process_form():
    return pyforms.Form(
        pyforms.Hidden("issues_id", rules.len_of(1, 32), description=u"工单id", required="required", **input_style),
        pyforms.Textarea("accept_result", rules.len_of(1, 1024), description=u"处理描述", rows=6, required="required",**input_style),
        pyforms.Dropdown("accept_status", description=u"处理结果", args=process_status.items(), required="required", **input_style),
        pyforms.Button("submit", type="submit", html=u"<b> 处理用户工单 </b>", **button_style),
        action="/issues/process",
        title=u"处理用户工单"
    )()
コード例 #6
0
def cmanage_add_form():
    return pyforms.Form(
        pyforms.Textbox("manager_code", rules.len_of(1, 32), description=u"客户经理工号",required="required",**input_style),
        pyforms.Textbox("manager_name", rules.len_of(1, 64), description=u"客户经理姓名",required="required",**input_style),
        pyforms.Textbox("manager_mobile",rules.len_of(1, 32), description=u"客户经理电话",required="required",**input_style),
        pyforms.Textbox("manager_email",rules.len_of(1, 255), description=u"客户经理邮箱",**input_style),
        pyforms.Textbox("active_code",rules.len_of(6, 32),description=u"激活验证码",required="required",**input_style),
        pyforms.Button("submit", type="submit", html=u"<b> 提交 </b>", **button_style),
        title=u"创建客户经理资料"
    )()
コード例 #7
0
def cmanage_update_form():
    return pyforms.Form(
        pyforms.Hidden("id",description=u"客户经理id"),
        pyforms.Textbox("manager_code", rules.len_of(1, 32), description=u"客户经理工号",readonly="readonly",**input_style),
        pyforms.Textbox("manager_name", rules.len_of(1, 64), description=u"客户经理姓名",required="required",**input_style),
        pyforms.Textbox("manager_mobile",rules.len_of(1, 32), description=u"客户经理电话",required="required",**input_style),
        pyforms.Textbox("manager_email",rules.len_of(1, 255), description=u"客户经理邮箱",**input_style),
        pyforms.Button("submit", type="submit", html=u"<b> 提交 </b>", **button_style),
        title=u"更新客户经理资料"
    )()
コード例 #8
0
ファイル: issues_forms.py プロジェクト: shtrend/ToughRADIUS
def issues_add_form(oprs=[]):
    return pyforms.Form(
        pyforms.Textbox("account_number", rules.len_of(1, 32), description=u"用户账号",required="required",**input_style),
        pyforms.Dropdown("issues_type", description=u"工单类型", args=issues_types.items(), **input_style),
        pyforms.Textarea("content", rules.len_of(1, 1024), description=u"工单内容", rows=6, required="required",**input_style),
        pyforms.Dropdown("assign_operator",  description=u"指派操作员",args=oprs, required="required", **input_style),
        pyforms.Button("submit", type="submit", html=u"<b> 提交 </b>", **button_style),
        action="/issues/add",
        title=u"创建用户工单"
    )()
コード例 #9
0
ファイル: cmanager_forms.py プロジェクト: shtrend/ToughRADIUS
def cmanage_add_form(oprs=[]):
    return pyforms.Form(
        pyforms.Textbox("manager_code", rules.len_of(1, 32), description=u"客户经理工号",required="required",**input_style),
        pyforms.Textbox("manager_name", rules.len_of(1, 64), description=u"客户经理姓名",required="required",**input_style),
        pyforms.Textbox("manager_mobile",rules.len_of(1, 32), description=u"客户经理电话",required="required",**input_style),
        pyforms.Textbox("manager_email",rules.len_of(1, 255), description=u"客户经理邮箱",**input_style),
        pyforms.Dropdown("operator_name", description=u"关联操作员",args=oprs,**input_style),
        pyforms.Button("submit", type="submit", html=u"<b> 提交 </b>", **button_style),
        title=u"创建客户经理资料"
    )()
コード例 #10
0
ファイル: forms.py プロジェクト: shenhzou654321/ToughRADIUS
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"
    )  
コード例 #11
0
ファイル: forms.py プロジェクト: shtrend/ToughRADIUS
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"
    )
コード例 #12
0
ファイル: opr_forms.py プロジェクト: shtrend/ToughRADIUS
def opr_update_form(nodes=[], products=[]):
    return pyforms.Form(
        pyforms.Hidden("id", description=u"编号"),
        pyforms.Textbox("operator_name", description=u"操作员名称", readonly="readonly", **input_style),
        pyforms.Textbox("operator_desc", rules.len_of(0, 255), description=u"操作员姓名", **input_style),
        pyforms.Password("operator_pass", rules.len_of(0, 128), description=u"操作员密码(留空不修改)", autocomplete="off",**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.Dropdown("operator_products", description=u"关联资费(多选)", args=products, required="required",multiple="multiple", size=6, **input_style),
        pyforms.Button("submit", type="submit", html=u"<b>提交</b>", **button_style),
        title=u"修改操作员",
        action="/opr/update"
    )
コード例 #13
0
ファイル: forms.py プロジェクト: shenhzou654321/ToughRADIUS
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"
    )
コード例 #14
0
ファイル: forms.py プロジェクト: shtrend/ToughRADIUS
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"用户注册"
    )
コード例 #15
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"买断授权月数", value=0, **input_style),
        pyforms.Textbox("fee_times", rules.is_number3, description=u"买断时长(小时)", value=0, **input_style),
        pyforms.Textbox("fee_flows", rules.is_number3, description=u"买断流量(MB)", value=0, **input_style),
        pyforms.Textbox("fee_price", rules.is_rmb, description=u"资费价格(元)", required="required", **input_style),
        pyforms.Hidden("fee_period", rules.is_period, description=u"开放认证时段", **input_style),
        pyforms.Textbox(
            "concur_number", rules.is_number, description=u"并发数控制(0表示不限制)", required="required", **input_style
        ),
        pyforms.Dropdown("bind_mac", args=boolean.items(), description=u"是否绑定MAC", required="required", **input_style),
        pyforms.Dropdown(
            "bind_vlan", args=boolean.items(), description=u"是否绑定VLAN", required="required", **input_style
        ),
        pyforms.Textbox(
            "input_max_limit", rules.is_number3, description=u"最大上行速率(Mbps)", required="required", **input_style
        ),
        pyforms.Textbox(
            "output_max_limit", rules.is_number3, description=u"最大下行速率(Mbps)", required="required", **input_style
        ),
        pyforms.Button("submit", type="submit", html=u"<b>更新</b>", **button_style),
        title=u"修改资费",
        action="/product/update",
    )
コード例 #16
0
ファイル: forms.py プロジェクト: shenhzou654321/ToughRADIUS
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.Checkbox("is_samename",description=u"启用独立的自助服务用户名", checked=""),
        pyforms.Textbox("member_name", rules.len_of(0,64), description=u"自助服务用户名", **input_style),
        pyforms.Textbox("member_password", 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.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",value=1, description=u"用户状态",  **input_style),
        pyforms.Button("submit",  type="submit", html=u"<b>提交</b>", **button_style),
        title=u"用户开户",
        action="/bus/member/open"
    )
コード例 #17
0
def account_change_form(products=[]):
    return pyforms.Form(pyforms.Hidden("account_number",
                                       description=u"用户账号",
                                       required="required",
                                       **input_style),
                        pyforms.Dropdown("product_id",
                                         args=products,
                                         description=u"资费",
                                         required="required",
                                         **input_style),
                        pyforms.Textbox("add_value",
                                        rules.is_rmb,
                                        description=u"缴费金额",
                                        required="required",
                                        value="0",
                                        **input_style),
                        pyforms.Textbox("back_value",
                                        rules.is_rmb,
                                        description=u"退费金额",
                                        required="required",
                                        value="0",
                                        **input_style),
                        pyforms.Textbox("expire_date",
                                        rules.is_date,
                                        description=u"过期日期",
                                        value="0000-00-00",
                                        **input_style),
                        pyforms.Textbox("balance",
                                        rules.is_rmb,
                                        description=u"用户变更后余额",
                                        value="0.00",
                                        **input_style),
                        pyforms.Textbox("time_length",
                                        description=u"用户时长(小时)",
                                        value="0.00",
                                        **input_style),
                        pyforms.Textbox("flow_length",
                                        description=u"用户流量(MB)",
                                        value="0",
                                        **input_style),
                        pyforms.Textarea("operate_desc",
                                         rules.len_of(0, 512),
                                         description=u"操作描述",
                                         rows=4,
                                         **input_style),
                        pyforms.Button("submit",
                                       type="submit",
                                       html=u"<b>提交</b>",
                                       **button_style),
                        title=u"用户资费变更",
                        action="/account/change")
コード例 #18
0
def issues_process_form():
    return pyforms.Form(pyforms.Hidden("issues_id",
                                       rules.len_of(1, 32),
                                       description=u"工单id",
                                       required="required",
                                       **input_style),
                        pyforms.Textarea("accept_result",
                                         rules.len_of(1, 1024),
                                         description=u"处理描述",
                                         rows=6,
                                         required="required",
                                         **input_style),
                        pyforms.Dropdown("accept_status",
                                         description=u"处理结果",
                                         args=process_status.items(),
                                         required="required",
                                         **input_style),
                        pyforms.Button("submit",
                                       type="submit",
                                       html=u"<b> 处理用户工单 </b>",
                                       **button_style),
                        action="/issues/process",
                        title=u"处理用户工单")()
コード例 #19
0
ファイル: account_forms.py プロジェクト: shtrend/ToughRADIUS
def account_change_form(products=[]):
    return pyforms.Form(
        pyforms.Hidden("account_number", description=u"用户账号", required="required", **input_style),
        pyforms.Dropdown("product_id", args=products, description=u"资费", required="required", **input_style),
        pyforms.Textbox("add_value", rules.is_rmb, description=u"缴费金额", required="required", value="0", **input_style),
        pyforms.Textbox("back_value", rules.is_rmb, description=u"退费金额", required="required", value="0", **input_style),
        pyforms.Textbox("expire_date", rules.is_date, description=u"过期日期", value="0000-00-00", **input_style),
        pyforms.Textbox("balance", rules.is_rmb, description=u"用户变更后余额", value="0.00", **input_style),
        pyforms.Textbox("time_length", description=u"用户时长(小时)", value="0.00", **input_style),
        pyforms.Textbox("flow_length", description=u"用户流量(MB)", value="0", **input_style),
        pyforms.Textarea("operate_desc", rules.len_of(0, 512),description=u"操作描述", rows=4, **input_style),
        pyforms.Button("submit", type="submit", html=u"<b>提交</b>", **button_style),
        title=u"用户资费变更",
        action="/account/change"
    )
コード例 #20
0
ファイル: forms.py プロジェクト: shenhzou654321/ToughRADIUS
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"买断授权月数",value=0, **input_style),
        pyforms.Textbox("fee_times", rules.is_number, description=u"买断时长(小时)",value=0, **input_style),
        pyforms.Textbox("fee_flows", rules.is_number, description=u"买断流量(MB)",value=0, **input_style),
        pyforms.Textbox("fee_price", rules.is_rmb, description=u"资费价格(元)", required="required", **input_style),
        pyforms.Hidden("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_number3,description=u"最大上行速率(Mbps)",required="required", **input_style),
        pyforms.Textbox("output_max_limit",  rules.is_number3,description=u"最大下行速率(Mbps)",required="required",**input_style),
        pyforms.Dropdown("product_status", args=product_status_dict.items(),description=u"资费状态", required="required", **input_style),
        pyforms.Button("submit", type="submit",id="submit",html=u"<b>提交</b>", **button_style),
        title=u"增加资费",
        action="/product/add"
    )
コード例 #21
0
ファイル: bas_forms.py プロジェクト: shtrend/ToughRADIUS
timetype = {0: u"标准时区,北京时间", 1: u"时区和时间同区"}
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"BAS地址", required="required", **input_style),
    pyforms.Textbox("bas_name", rules.len_of(2, 64), description=u"BAS名称", 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"BAS类型", args=bastype.items(), required="required", **input_style),
    pyforms.Textbox("coa_port", rules.is_number, description=u"CoA端口", default=3799, required="required",**input_style),
    pyforms.Dropdown("time_type", description=u"时间类型", args=timetype.items(), required="required", **input_style),
    pyforms.Button("submit", type="submit", html=u"<b>提交</b>", **button_style),
    title=u"增加BAS",
    action="/bas/add"
)

bas_update_form = pyforms.Form(
    pyforms.Hidden("id", description=u"编号"),
    pyforms.Textbox("ip_addr", rules.is_ip, description=u"BAS地址", readonly="readonly", **input_style),
    pyforms.Textbox("bas_name", rules.len_of(2, 64), description=u"BAS名称", 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"BAS类型", args=bastype.items(), required="required", **input_style),
コード例 #22
0
                                                 value=0,
                                                 required="required",
                                                 **input_style),
                                 pyforms.Textbox("fee_value",
                                                 rules.is_rmb,
                                                 description=u"缴费金额",
                                                 value=0,
                                                 required="required",
                                                 **input_style),
                                 pyforms.Textbox("expire_date",
                                                 rules.is_date,
                                                 description=u"过期日期",
                                                 required="required",
                                                 **input_style),
                                 pyforms.Textarea("operate_desc",
                                                  rules.len_of(0, 512),
                                                  description=u"操作描述",
                                                  rows=4,
                                                  **input_style),
                                 pyforms.Button("submit",
                                                type="submit",
                                                html=u"<b>提交</b>",
                                                **button_style),
                                 title=u"用户续费",
                                 action="/account/next")

account_charge_form = pyforms.Form(pyforms.Hidden("account_number",
                                                  description=u"用户账号",
                                                  required="required",
                                                  **input_style),
                                   pyforms.Textbox("fee_value",
コード例 #23
0
ファイル: forms.py プロジェクト: shenhzou654321/ToughRADIUS
#coding:utf-8
from toughradius.console.libs import pyforms
from toughradius.console.libs.pyforms import dataform
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"用户登陆")

コード例 #24
0
                                     description=u"用户数据文件",
                                     required="required",
                                     **input_style),
                        pyforms.Button("submit",
                                       type="submit",
                                       html=u"<b>立即导入</b>",
                                       **button_style),
                        title=u"用户数据导入",
                        action="/member/import")


user_import_vform = dataform.Form(dataform.Item("realname",
                                                rules.not_null,
                                                description=u"用户姓名"),
                                  dataform.Item("idcard",
                                                rules.len_of(0, 32),
                                                description=u"证件号码"),
                                  dataform.Item("mobile",
                                                rules.len_of(0, 32),
                                                description=u"用户手机号码"),
                                  dataform.Item("address",
                                                description=u"用户地址"),
                                  dataform.Item("account_number",
                                                rules.not_null,
                                                description=u"用户账号"),
                                  dataform.Item("password",
                                                rules.not_null,
                                                description=u"用户密码"),
                                  dataform.Item("begin_date",
                                                rules.is_date,
                                                description=u"开通日期"),
コード例 #25
0
ファイル: forms.py プロジェクト: shtrend/ToughRADIUS
    pyforms.Dropdown("allow_show_pwd", args=booleans.items(),description=u"是否允许查询用户密码", **input_style),
    pyforms.Textbox("radiusd_address", description=u"Radius服务IP地址",**input_style),
    pyforms.Textbox("radiusd_admin_port",rules.is_number, description=u"Radius服务管理端口",**input_style),
    pyforms.Textbox("acct_interim_intelval",rules.is_number, description=u"Radius记账间隔(秒)",**input_style),
    pyforms.Textbox("max_session_timeout",rules.is_number, description=u"Radius最大会话时长(秒)", **input_style),
    pyforms.Textbox("reject_delay",rules.is_number, 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"管理密码更新",
    action="/passwd"
)



    





コード例 #26
0
ファイル: account_forms.py プロジェクト: shtrend/ToughRADIUS
        pyforms.Textarea("account_desc", description=u"用户描述", rows=4, **input_style),
        pyforms.Button("submit", type="submit", html=u"<b>提交</b>", **button_style),
        title=u"用户变更资料",
        action="/account/update"
    )


account_next_form = pyforms.Form(
        pyforms.Hidden("product_id", description=u"资费"),
        pyforms.Hidden("old_expire", description=u""),
        pyforms.Hidden("account_number", description=u"用户账号"),
        pyforms.Textbox("months", rules.is_number, description=u"月数(包月有效)", value=0, required="required",
                        **input_style),
        pyforms.Textbox("fee_value", rules.is_rmb, description=u"缴费金额", value=0, required="required", **input_style),
        pyforms.Textbox("expire_date", rules.is_date, description=u"过期日期", required="required", **input_style),
        pyforms.Textarea("operate_desc", rules.len_of(0,512), description=u"操作描述", rows=4, **input_style),
        pyforms.Button("submit", type="submit", html=u"<b>提交</b>", **button_style),
        title=u"用户续费",
        action="/account/next"
    )


account_charge_form = pyforms.Form(
    pyforms.Hidden("account_number", description=u"用户账号", required="required", **input_style),
    pyforms.Textbox("fee_value", rules.is_rmb, description=u"缴费金额", value=0, required="required", **input_style),
    pyforms.Textarea("operate_desc", rules.len_of(0, 512),description=u"操作描述", rows=4, **input_style),
    pyforms.Button("submit", type="submit", html=u"<b>提交</b>", **button_style),
    title=u"用户充值",
    action="/account/charge"
)
コード例 #27
0
ファイル: forms.py プロジェクト: shenhzou654321/ToughRADIUS
    pyforms.Textbox("is_debug", description=u"DEBUG模式(0|1)",**input_style),
    pyforms.Textbox("radiusd_address", description=u"Radius服务IP地址",**input_style),
    pyforms.Textbox("radiusd_admin_port",rules.is_number, description=u"Radius服务管理端口",**input_style),
    pyforms.Textbox("acct_interim_intelval",rules.is_number, description=u"Radius记账间隔(秒)",**input_style),
    pyforms.Textbox("max_session_timeout",rules.is_number, description=u"Radius最大会话时长(秒)", **input_style),
    pyforms.Textbox("reject_delay",rules.is_number, 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"管理密码更新",
    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(
コード例 #28
0
ファイル: forms.py プロジェクト: travislee8964/ToughRADIUS
#coding:utf-8
from toughradius.console.libs import pyforms
from toughradius.console.libs.pyforms import dataform
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="/auth/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),
コード例 #29
0
ファイル: bas_forms.py プロジェクト: zhangbinglxf/ToughRADIUS
    '25506': u'H3C',
    '3902': u'中兴',
    '10055': u'爱快',
    '14988': u'RouterOS'
}

bas_add_form = pyforms.Form(
    pyforms.Textbox(
        "ip_addr",
        rules.is_ip,
        description=u"BAS地址",
        required="required",
        **input_style),
    pyforms.Textbox(
        "bas_name",
        rules.len_of(2, 64),
        description=u"BAS名称",
        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"BAS类型",
        args=bastype.items(),
        required="required",
        **input_style),
コード例 #30
0
ファイル: member_forms.py プロジェクト: shtrend/ToughRADIUS

def user_import_form(nodes=[], products=[]):
    return pyforms.Form(
        pyforms.Dropdown("node_id", description=u"用户区域", args=nodes, **input_style),
        pyforms.Dropdown("product_id", args=products, description=u"用户资费", required="required", **input_style),
        pyforms.File("import_file", description=u"用户数据文件", required="required", **input_style),
        pyforms.Button("submit", type="submit", html=u"<b>立即导入</b>", **button_style),
        title=u"用户数据导入",
        action="/member/import"
    )


user_import_vform = dataform.Form(
    dataform.Item("realname", rules.not_null, description=u"用户姓名"),
    dataform.Item("idcard", rules.len_of(0, 32), description=u"证件号码"),
    dataform.Item("mobile", rules.len_of(0, 32), description=u"用户手机号码"),
    dataform.Item("address", description=u"用户地址"),
    dataform.Item("account_number", rules.not_null, description=u"用户账号"),
    dataform.Item("password", rules.not_null, description=u"用户密码"),
    dataform.Item("begin_date", rules.is_date, description=u"开通日期"),
    dataform.Item("expire_date", rules.is_date, description=u"过期日期"),
    dataform.Item("balance", rules.is_rmb, description=u"用户余额"),
    dataform.Item("time_length", description=u"用户时长"),
    dataform.Item("flow_length", description=u"用户流量"),
    title="import"
)


def member_update_form(nodes=[]):
    return pyforms.Form(
コード例 #31
0
        pyforms.Textbox(
            "input_max_limit", rules.is_number3, description=u"最大上行速率(Mbps)", required="required", **input_style
        ),
        pyforms.Textbox(
            "output_max_limit", rules.is_number3, description=u"最大下行速率(Mbps)", required="required", **input_style
        ),
        pyforms.Button("submit", type="submit", html=u"<b>更新</b>", **button_style),
        title=u"修改资费",
        action="/product/update",
    )


product_attr_add_form = pyforms.Form(
    pyforms.Hidden("product_id", description=u"资费编号"),
    pyforms.Textbox(
        "attr_name", rules.len_of(1, 255), description=u"策略名称", required="required", help=u"策略参考", **input_style
    ),
    pyforms.Textbox("attr_value", rules.len_of(1, 255), description=u"策略值", required="required", **input_style),
    pyforms.Textbox("attr_desc", rules.len_of(1, 255), description=u"策略描述", required="required", **input_style),
    pyforms.Button("submit", type="submit", html=u"<b>提交</b>", **button_style),
    title=u"增加策略属性",
    action="/product/attr/add",
)

product_attr_update_form = pyforms.Form(
    pyforms.Hidden("id", description=u"编号"),
    pyforms.Hidden("product_id", description=u"资费编号"),
    pyforms.Textbox("attr_name", rules.len_of(1, 255), description=u"策略名称", readonly="required", **input_style),
    pyforms.Textbox("attr_value", rules.len_of(1, 255), description=u"策略值", required="required", **input_style),
    pyforms.Textbox("attr_desc", rules.len_of(1, 255), description=u"策略描述", required="required", **input_style),
    pyforms.Button("submit", type="submit", html=u"<b>更新</b>", **button_style),
コード例 #32
0
ファイル: forms.py プロジェクト: ywysee/ToughRADIUS
    pyforms.Textbox("reject_delay",
                    rules.is_number,
                    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>",
コード例 #33
0
ファイル: bas_forms.py プロジェクト: ywysee/ToughRADIUS
    '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"BAS地址",
                                            required="required",
                                            **input_style),
                            pyforms.Textbox("bas_name",
                                            rules.len_of(2, 64),
                                            description=u"BAS名称",
                                            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"BAS类型",
                                             args=bastype.items(),
                                             required="required",
                                             **input_style),
                            pyforms.Textbox("coa_port",
                                            rules.is_number,
コード例 #34
0
ファイル: product_forms.py プロジェクト: ywysee/ToughRADIUS
                                        rules.is_number3,
                                        description=u"最大下行速率(Mbps)",
                                        required="required",
                                        **input_style),
                        pyforms.Button("submit",
                                       type="submit",
                                       html=u"<b>更新</b>",
                                       **button_style),
                        title=u"修改资费",
                        action="/product/update")


product_attr_add_form = pyforms.Form(pyforms.Hidden("product_id",
                                                    description=u"资费编号"),
                                     pyforms.Textbox("attr_name",
                                                     rules.len_of(1, 255),
                                                     description=u"策略名称",
                                                     required="required",
                                                     help=u"策略参考",
                                                     **input_style),
                                     pyforms.Textbox("attr_value",
                                                     rules.len_of(1, 255),
                                                     description=u"策略值",
                                                     required="required",
                                                     **input_style),
                                     pyforms.Textbox("attr_desc",
                                                     rules.len_of(1, 255),
                                                     description=u"策略描述",
                                                     required="required",
                                                     **input_style),
                                     pyforms.Button("submit",
コード例 #35
0
#!/usr/bin/env python
#coding=utf-8

from toughradius.console.libs import pyforms
from toughradius.console.libs.pyforms import dataform
from toughradius.console.libs.pyforms import rules
from toughradius.console.libs.pyforms.rules import button_style, input_style

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

node_add_form = pyforms.Form(
    pyforms.Textbox("node_name", rules.len_of(2, 32), description=u"区域名称", required="required", **input_style),
    pyforms.Textbox("node_desc", rules.len_of(2, 128), description=u"区域描述", required="required", **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.Textbox("node_desc", rules.len_of(2, 128), description=u"区域描述", required="required", **input_style),
    pyforms.Button("submit", type="submit", html=u"<b>更新</b>", **button_style),
    title=u"修改区域",
    action="/node/update"
)