Beispiel #1
0
def operator_add_form(nodes=[], products=[]):
    return btforms.Form(
        btforms.Textbox("operator_name", rules.len_of(2, 32), description=u"操作员名称", required="required", **input_style),
        btforms.Textbox("operator_desc", rules.len_of(0, 255), description=u"操作员姓名", **input_style),
        btforms.Password("operator_pass", rules.len_of(6, 128), description=u"操作员密码", required="required",**input_style),
        btforms.Dropdown("operator_status", description=u"操作员状态", args=opr_status_dict.items(), required="required",**input_style),
        btforms.Dropdown("operator_nodes", description=u"关联区域(多选)", args=nodes, required="required",multiple="multiple", size=4, **input_style),
        btforms.Dropdown("operator_products", description=u"关联资费(多选)", args=products, required="required",multiple="multiple", size=6, **input_style),
        btforms.Button("submit", type="submit", html=u"<b>提交</b>", **button_style),
        title=u"增加操作员",
        action="/admin/operator/add"
    )
Beispiel #2
0
def operator_update_form(nodes=[], products=[]):
    return btforms.Form(
        btforms.Hidden("id", description=u"编号"),
        btforms.Textbox("operator_name", description=u"操作员名称", readonly="readonly", **input_style),
        btforms.Textbox("operator_desc", rules.len_of(0, 255), description=u"操作员姓名", **input_style),
        btforms.Password("operator_pass", rules.len_of(0, 128), description=u"操作员密码(留空不修改)", autocomplete="off",**input_style),
        btforms.Dropdown("operator_status", description=u"操作员状态", args=opr_status_dict.items(), required="required",**input_style),
        btforms.Dropdown("operator_nodes", description=u"关联区域(多选)", args=nodes, required="required",multiple="multiple", size=4, **input_style),
        btforms.Dropdown("operator_products", description=u"关联资费(多选)", args=products, required="required",multiple="multiple", size=6, **input_style),
        btforms.Button("submit", type="submit", html=u"<b>提交</b>", **button_style),
        title=u"修改操作员",
        action="/admin/operator/update"
    )
Beispiel #3
0
def customer_update_form(nodes=[]):
    return btforms.Form(
        btforms.Hidden("account_number", description=u"用户账号"),
        btforms.Hidden("customer_id", description=u"mid", required="required", **input_style),
        btforms.Textbox("realname", rules.len_of(2, 32), description=u"用户姓名", required="required", **input_style),
        btforms.Textbox("customer_name", description=u"自助服务用户名", readonly="readonly", autocomplete="off", **input_style),
        btforms.Password("new_password", rules.len_of(0, 128), value="", description=u"自助服务密码(留空不修改)", **input_style),
        btforms.Textbox("email", rules.len_of(0, 128), description=u"电子邮箱", **input_style),
        btforms.Textbox("idcard", rules.len_of(0, 32), description=u"证件号码", **input_style),
        btforms.Textbox("mobile", rules.len_of(0, 32), description=u"用户手机号码", **input_style),
        btforms.Textbox("address", description=u"用户地址", hr=True, **input_style),
        btforms.Textarea("customer_desc", description=u"用户描述", rows=4, **input_style),
        btforms.Button("submit", type="submit", html=u"<b>提交</b>", **button_style),
        title=u"用户基本信息修改",
        action="/admin/customer/update"
    )
Beispiel #4
0
def customer_open_form(nodes=[], products=[]):
    return btforms.Form(
        btforms.Dropdown("node_id", description=u"区域", args=nodes, required="required", **input_style),
        btforms.Textbox("realname", rules.len_of(2, 32), description=u"用户姓名", required="required", **input_style),
        btforms.Textbox("idcard", rules.len_of(1, 32), description=u"证件号码", **input_style),
        btforms.Textbox("mobile", rules.len_of(1, 32), description=u"用户手机号码", **input_style),
        btforms.Textbox("address",rules.len_of(1, 32), description=u"用户地址", hr=True, required="required", **input_style),
        btforms.Textbox("account_number", description=u"用户账号", required="required", **input_style),
        btforms.Textbox("password", description=u"认证密码", required="required", **input_style),
        btforms.Button("button", type="button", onclick="reBuildAccount();", html=u"<b>重新生成账号密码</b>", **_btn_style),
        btforms.Textbox("ip_address", description=u"用户IP地址", **input_style),
        btforms.Dropdown("product_id", args=products, description=u"资费", required="required", **input_style),
        btforms.Textbox("months", rules.is_number, description=u"月数(包月有效)", required="required", **input_style),
        btforms.Textbox("giftdays", rules.is_number, description=u"赠送天数", value=0, required="required", **input_style),
        btforms.Textbox("fee_value", rules.is_rmb, description=u"缴费金额", required="required", **input_style),
        btforms.Textbox("expire_date", rules.is_date, description=u"过期日期", readonly="readonly", **input_style),
        btforms.Hidden("status", value=1, description=u"用户状态", **input_style),
        btforms.Textarea("customer_desc", description=u"用户描述", rows=4, **input_style),
        btforms.Button("submit", type="submit", html=u"<b>提交</b>", **button_style),
        title=u"用户开户",
        action="/admin/customer/open"
    )
Beispiel #5
0
def account_change_form(products=[]):
    return btforms.Form(
        btforms.Hidden("account_number", description=u"用户账号", required="required", **input_style),
        btforms.Dropdown("product_id", args=products, description=u"资费", required="required", **input_style),
        btforms.Textbox("add_value", rules.is_rmb, description=u"缴费金额", required="required", value="0", **input_style),
        btforms.Textbox("back_value", rules.is_rmb, description=u"退费金额", required="required", value="0", **input_style),
        btforms.Textbox("expire_date", rules.is_date, description=u"过期日期", value="0000-00-00", **input_style),
        btforms.Textbox("balance", rules.is_rmb, description=u"用户变更后余额", value="0.00", **input_style),
        btforms.Textbox("time_length", description=u"用户时长(小时)", value="0.00", **input_style),
        btforms.Textbox("flow_length", description=u"用户流量(MB)", value="0", **input_style),
        btforms.Textarea("operate_desc", rules.len_of(0, 512),description=u"操作描述", rows=4, **input_style),
        btforms.Button("submit", type="submit", html=u"<b>提交</b>", **button_style),
        title=u"用户资费变更",
        action="/admin/account/change"
    )
Beispiel #6
0

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


customer_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 customer_update_form(nodes=[]):
    return btforms.Form(
Beispiel #7
0
#!/usr/bin/env python
# coding=utf-8

from radiuslib import btforms
from radiuslib.btforms import rules
from radiuslib.btforms.rules import button_style, input_style

password_update_form = btforms.Form(btforms.Textbox("tr_user",
                                                    description=u"管理员名",
                                                    size=32,
                                                    readonly="readonly",
                                                    **input_style),
                                    btforms.Password("tr_user_pass",
                                                     rules.len_of(6, 32),
                                                     description=u"管理员新密码",
                                                     size=32,
                                                     value="",
                                                     required="required",
                                                     **input_style),
                                    btforms.Password("tr_user_pass_chk",
                                                     rules.len_of(6, 32),
                                                     description=u"确认管理员新密码",
                                                     size=32,
                                                     value="",
                                                     required="required",
                                                     **input_style),
                                    btforms.Button("submit",
                                                   type="submit",
                                                   html=u"<b>更新</b>",
                                                   **button_style),
                                    title=u"管理密码更新",
Beispiel #8
0
from radiuslib.permit import permit
from toughradius.manage.api.apibase import ApiHandler
from toughradius.manage import models
from toughradius.manage.settings import *
from hashlib import md5
""" 客户新开户
"""

customer_add_vform = dataform.Form(dataform.Item("realname",
                                                 rules.not_null,
                                                 description=u"用户姓名"),
                                   dataform.Item("node_id",
                                                 rules.not_null,
                                                 description=u"区域id"),
                                   dataform.Item("idcard",
                                                 rules.len_of(0, 32),
                                                 description=u"证件号码"),
                                   dataform.Item("mobile",
                                                 rules.len_of(0, 32),
                                                 description=u"用户手机号码"),
                                   dataform.Item("email",
                                                 rules.is_email,
                                                 description=u"用户Email"),
                                   dataform.Item("address",
                                                 description=u"用户地址"),
                                   dataform.Item("customer_name",
                                                 description=u"客户自助服务账号"),
                                   dataform.Item("account_number",
                                                 rules.not_null,
                                                 description=u"用户认证账号"),
                                   dataform.Item("product_id",
Beispiel #9
0
    '0': u'标准',
    '3041': u'阿尔卡特',
    '2352': u'爱立信',
    '2011': u'华为',
    '25506': u'H3C',
    '3902': u'中兴',
    '10055': u'爱快',
    '14988': u'RouterOS'
}

bas_add_form = btforms.Form(btforms.Textbox("ip_addr",
                                            rules.is_ip,
                                            description=u"接入设备地址",
                                            **input_style),
                            btforms.Textbox("dns_name",
                                            rules.len_of(1, 128),
                                            description=u"DNS域名",
                                            help=u"动态IP专用",
                                            **input_style),
                            btforms.Textbox("bas_name",
                                            rules.len_of(2, 64),
                                            description=u"接入设备名称",
                                            required="required",
                                            **input_style),
                            btforms.Textbox("bas_secret",
                                            rules.is_alphanum2(4, 32),
                                            description=u"共享秘钥",
                                            required="required",
                                            **input_style),
                            btforms.Dropdown("vendor_id",
                                             description=u"接入设备类型",
Beispiel #10
0
def product_update_form():
    return btforms.Form(
        btforms.Hidden("id", description=u"编号"),
        btforms.Hidden("product_policy", description=u""),
        btforms.Textbox("product_name",
                        rules.len_of(4, 32),
                        description=u"资费名称",
                        required="required",
                        **input_style),
        btforms.Textbox("product_policy_name",
                        description=u"资费策略",
                        readonly="readonly",
                        required="required",
                        **input_style),
        btforms.Dropdown("product_status",
                         args=product_status_dict.items(),
                         description=u"资费状态",
                         required="required",
                         **input_style),
        btforms.Textbox("fee_months",
                        rules.is_number,
                        description=u"买断授权月数",
                        value=0,
                        **input_style),
        btforms.Textbox("fee_times",
                        rules.is_number3,
                        description=u"买断时长(小时)",
                        value=0,
                        **input_style),
        btforms.Textbox("fee_flows",
                        rules.is_number3,
                        description=u"买断流量(MB)",
                        value=0,
                        **input_style),
        btforms.Textbox("fee_price",
                        rules.is_rmb,
                        description=u"资费价格(元)",
                        required="required",
                        **input_style),
        # btforms.Hidden("fee_period", rules.is_period, description=u"开放认证时段", **input_style),
        btforms.Textbox("concur_number",
                        rules.is_number,
                        description=u"并发数控制(0表示不限制)",
                        required="required",
                        **input_style),
        btforms.Dropdown("bind_mac",
                         args=boolean.items(),
                         description=u"是否绑定MAC",
                         required="required",
                         **input_style),
        btforms.Dropdown("bind_vlan",
                         args=boolean.items(),
                         description=u"是否绑定VLAN",
                         required="required",
                         **input_style),
        btforms.Textbox("input_max_limit",
                        rules.is_number3,
                        description=u"最大上行速率(Mbps)",
                        required="required",
                        **input_style),
        btforms.Textbox("output_max_limit",
                        rules.is_number3,
                        description=u"最大下行速率(Mbps)",
                        required="required",
                        **input_style),
        btforms.Button("submit",
                       type="submit",
                       html=u"<b>更新</b>",
                       **button_style),
        title=u"修改资费",
        action="/admin/product/update")
Beispiel #11
0
                        rules.is_number3,
                        description=u"最大下行速率(Mbps)",
                        required="required",
                        **input_style),
        btforms.Button("submit",
                       type="submit",
                       html=u"<b>更新</b>",
                       **button_style),
        title=u"修改资费",
        action="/admin/product/update")


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

from radiuslib import btforms
from radiuslib.btforms import dataform
from radiuslib.btforms import rules
from radiuslib.btforms.rules import button_style, input_style

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

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

node_update_form = btforms.Form(btforms.Hidden("id", description=u"区域ID"),
                                btforms.Textbox("node_name",
                                                rules.len_of(2, 32),
                                                description=u"区域名称",
Beispiel #13
0
        btforms.Button("submit", type="submit", html=u"<b>提交</b>", **button_style),
        title=u"用户策略修改",
        action="/admin/account/update"
    )


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


account_charge_form = btforms.Form(
    btforms.Hidden("account_number", description=u"用户账号", required="required", **input_style),
    btforms.Textbox("fee_value", rules.is_rmb, description=u"缴费金额", value=0, required="required", **input_style),
    btforms.Textarea("operate_desc", rules.len_of(0, 512),description=u"操作描述", rows=4, **input_style),
    btforms.Button("submit", type="submit", html=u"<b>提交</b>", **button_style),
    title=u"用户充值",
    action="/admin/account/charge"
)