Ejemplo n.º 1
0
def operator_update_form():
    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.Button("submit",
                                       type="submit",
                                       html=u"<b>提交</b>",
                                       **button_style),
                        title=u"修改操作员",
                        action="/operator/update")
Ejemplo n.º 2
0
def isp_add_form():
    return btforms.Form(btforms.Textbox("isp_code",
                                        rules.len_of(4, 8),
                                        description=u"服务商编码",
                                        required="required",
                                        **input_style),
                        btforms.Textbox("isp_name",
                                        rules.len_of(4, 64),
                                        description=u"服务商名称",
                                        required="required",
                                        **input_style),
                        btforms.Textbox("isp_email",
                                        rules.len_of(0, 64),
                                        description=u"服务商Email",
                                        **input_style),
                        btforms.Textbox("isp_phone",
                                        rules.len_of(0, 64),
                                        description=u"服务商电话",
                                        **input_style),
                        btforms.Textbox("isp_idcard",
                                        rules.len_of(0, 32),
                                        description=u"服务商证件号码",
                                        **input_style),
                        btforms.Textbox("isp_desc",
                                        description=u"服务商描述",
                                        **input_style),
                        btforms.Button("submit",
                                       type="submit",
                                       id="submit",
                                       html=u"<b>提交</b>",
                                       **button_style),
                        title=u"增加服务商",
                        action="/isp/add")
Ejemplo n.º 3
0
def customer_update_form():
    return btforms.Form(
        btforms.Textbox("realname",
                        description=u"用户姓名",
                        readonly="readonly",
                        **input_style),
        btforms.Textbox("customer_name",
                        description=u"用户登陆名",
                        readonly="readonly",
                        **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.Button("submit",
                       type="submit",
                       html=u"<b>提交</b>",
                       **button_style),
        title=u"用户基本信息修改",
        action="/customer/user/update")
Ejemplo n.º 4
0
def account_open_form(products=[]):
    return btforms.Form(btforms.Textbox("recharge_card",
                                        description=u"充值卡号",
                                        required="required",
                                        **input_style),
                        btforms.Password("recharge_pwd",
                                         description=u"充值卡密码",
                                         required="required",
                                         **input_style),
                        btforms.Textbox("account_number",
                                        description=u"用户账号",
                                        required="required",
                                        **input_style),
                        btforms.Password("password",
                                         description=u"认证密码",
                                         required="required",
                                         **input_style),
                        btforms.Dropdown("product_id",
                                         args=products,
                                         description=u"资费",
                                         required="required",
                                         **input_style),
                        btforms.Button("submit",
                                       type="submit",
                                       html=u"<b>提交</b>",
                                       **button_style),
                        title=u"用户自助开户",
                        action="/customer/open")
Ejemplo n.º 5
0
def operator_add_form():
    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.Button("submit",
                                       type="submit",
                                       html=u"<b>提交</b>",
                                       **button_style),
                        title=u"增加操作员",
                        action="/operator/add")
Ejemplo n.º 6
0
def isp_update_form():
    return btforms.Form(btforms.Textbox("isp_code",
                                        rules.len_of(4, 8),
                                        description=u"服务商编码",
                                        readonly="readonly",
                                        **input_style),
                        btforms.Textbox("isp_name",
                                        rules.len_of(4, 64),
                                        description=u"服务商名称",
                                        **input_style),
                        btforms.Textbox("isp_email",
                                        rules.len_of(0, 64),
                                        description=u"服务商Email",
                                        **input_style),
                        btforms.Textbox("isp_phone",
                                        rules.len_of(0, 64),
                                        description=u"服务商电话",
                                        **input_style),
                        btforms.Textbox("isp_idcard",
                                        rules.len_of(0, 32),
                                        description=u"服务商证件号码",
                                        **input_style),
                        btforms.Textbox("isp_desc",
                                        description=u"服务商描述",
                                        **input_style),
                        btforms.Button("submit",
                                       type="submit",
                                       html=u"<b>更新</b>",
                                       **button_style),
                        title=u"修改服务商",
                        action="/isp/update")
Ejemplo n.º 7
0
def contact_add_form(groups=[]):
    return btforms.Form(btforms.Dropdown("contactgroup_name",
                                         description=u"联系人组",
                                         args=groups,
                                         required="required",
                                         **input_style),
                        btforms.Textbox("contact_name",
                                        rules.len_of(1, 128),
                                        description=u"联系人名称",
                                        required="required",
                                        **input_style),
                        btforms.Textbox("alias",
                                        rules.len_of(1, 128),
                                        description=u"联系人描述",
                                        required="required",
                                        **input_style),
                        btforms.Textbox("email",
                                        rules.len_of(1, 128),
                                        description=u"电子邮件",
                                        required="required",
                                        **input_style),
                        btforms.Textbox("pager",
                                        rules.len_of(1, 128),
                                        description=u"手机号码",
                                        required="required",
                                        **input_style),
                        btforms.Button("submit",
                                       type="submit",
                                       html=u"<b>提交</b>",
                                       **button_style),
                        title=u"联系人增加",
                        action="/contact/add")()
Ejemplo n.º 8
0
def bas_add_form(isps=[]):
    return btforms.Form(btforms.Dropdown("isp_code",
                                         isps,
                                         description=u"服务商",
                                         required="required",
                                         **input_style),
                        btforms.Textbox("ip_addr",
                                        rules.is_ip,
                                        description=u"设备地址",
                                        required="required",
                                        **input_style),
                        btforms.Textbox("bas_name",
                                        rules.len_of(2, 64),
                                        description=u"设备名称",
                                        required="required",
                                        **input_style),
                        btforms.Textbox("dns_name",
                                        rules.len_of(1, 128),
                                        description=u"DNS域名",
                                        help=u"动态IP专用",
                                        **input_style),
                        btforms.Textbox("bas_secret",
                                        rules.is_alphanum2(4, 32),
                                        description=u"共享秘钥",
                                        required="required",
                                        **input_style),
                        btforms.Dropdown("vendor_id",
                                         description=u"设备类型",
                                         args=bastype.items(),
                                         required="required",
                                         **input_style),
                        btforms.Dropdown("portal_vendor",
                                         description=u"portal协议",
                                         args=portaltype.items(),
                                         required="required",
                                         **input_style),
                        btforms.Dropdown("time_type",
                                         description=u"时区类型",
                                         args=timetype.items(),
                                         required="required",
                                         **input_style),
                        btforms.Textbox("ac_port",
                                        rules.is_number,
                                        description=u"AC端口",
                                        default=2000,
                                        required="required",
                                        **input_style),
                        btforms.Textbox("coa_port",
                                        rules.is_number,
                                        description=u"CoA端口",
                                        default=3799,
                                        required="required",
                                        **input_style),
                        btforms.Button("submit",
                                       type="submit",
                                       html=u"<b>提交</b>",
                                       **button_style),
                        title=u"增加接入设备",
                        action="/bas/add")
Ejemplo n.º 9
0
def customer_join_form(nodes=[]):
    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.Dropdown("sex",
                                         description=u"性别",
                                         args=sexopt.items(),
                                         required="required",
                                         **input_style),
                        btforms.Textbox("age",
                                        rules.is_number,
                                        description=u"年龄(必填)",
                                        size=3,
                                        required="required",
                                        **input_style),
                        btforms.Textbox("username",
                                        rules.is_alphanum3(6, 32),
                                        description=u"用户名(必填)",
                                        size=32,
                                        required="required",
                                        **input_style),
                        btforms.Password("password",
                                         rules.len_of(6, 32),
                                         description=u"登录密码(必填)",
                                         size=32,
                                         required="required",
                                         **input_style),
                        btforms.Textbox("email",
                                        rules.is_email,
                                        description=u"电子邮箱(必填)",
                                        size=64,
                                        required="required",
                                        **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.Button("submit",
                                       type="submit",
                                       html=u"<b>注册</b>",
                                       **button_style),
                        action="/customer/join",
                        title=u"用户注册")
Ejemplo n.º 10
0
def account_open_form(products=[]):
    return btforms.Form(btforms.Hidden("node_id",
                                       description=u"区域",
                                       **input_style),
                        btforms.Hidden("customer_id", description=u"编号"),
                        btforms.Textbox("realname",
                                        description=u"用户姓名",
                                        readonly="readonly",
                                        **input_style),
                        btforms.Textbox("account_number",
                                        description=u"用户账号",
                                        required="required",
                                        **input_style),
                        btforms.Textbox("password",
                                        description=u"认证密码",
                                        required="required",
                                        **input_style),
                        btforms.Textbox("ip_address",
                                        description=u"用户IP地址",
                                        **input_style),
                        btforms.Textbox("address",
                                        description=u"用户装机地址",
                                        required="required",
                                        **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("fee_value",
                                        rules.is_rmb,
                                        description=u"缴费金额",
                                        required="required",
                                        **input_style),
                        btforms.Textbox("expire_date",
                                        rules.is_date,
                                        description=u"过期日期",
                                        required="required",
                                        **input_style),
                        btforms.Hidden("status",
                                       value=1,
                                       description=u"用户状态",
                                       **input_style),
                        btforms.Textarea("account_desc",
                                         description=u"用户描述",
                                         rows=4,
                                         **input_style),
                        btforms.Button("submit",
                                       type="submit",
                                       html=u"<b>提交</b>",
                                       **button_style),
                        title=u"用户新开账号",
                        action="/admin/account/open")
Ejemplo n.º 11
0
def domain_add_vform(tpls=[],isps=[]):
    return btforms.Form(
        btforms.Dropdown("isp_code", isps, description=u"服务商", required="required", **input_style),
        btforms.Dropdown("tpl_name", tpls, rules.not_null, description=u"模版", required="required", **input_style),
        btforms.Textbox("domain_code", rules.is_alphanum2(2,16), description=u"域编码",required="required", **input_style),
        btforms.Textbox("domain_desc", rules.not_null, description=u"域描述",required="required", **input_style),
        btforms.Button("submit", type="submit", html=u"<b>提交</b>", **button_style),
        title=u"增加域属性",
        action="/domain/add"
    )
Ejemplo n.º 12
0
def ssid_add_form():
    return btforms.Form(
        btforms.Hidden("domain_code", description=u"域编码"),
        btforms.Hidden("isp_code", description=u"isp编码"),
        btforms.Textbox("ssid", rules.not_null, description=u"ssid",required="required", **input_style),
        btforms.Textbox("ssid_desc", rules.not_null, description=u"ssid描述",required="required", **input_style),
        btforms.Button("submit", type="submit", html=u"<b>提交</b>", **button_style),
        title=u"增加SSID",
        action="/domain/ssid/add",
    )
Ejemplo n.º 13
0
def domain_update_vform(tpls=[],isps=[]):
    return btforms.Form(
        btforms.Hidden("id", description=u"编号"),
        btforms.Dropdown("isp_code", isps, description=u"服务商", required="required", **input_style),
        btforms.Dropdown("tpl_name", tpls, rules.not_null, description=u"模版", required="required", **input_style),
        btforms.Textbox("domain_code", rules.not_null, readonly="readonly", description=u"域编码",required="required", **input_style),
        btforms.Textbox("domain_desc", rules.not_null, description=u"域描述",required="required", **input_style),
        btforms.Button("submit", type="submit", html=u"<b>提交</b>", **button_style),
        title=u"修改域属性",
        action="/domain/update"
    )
Ejemplo n.º 14
0
def service_update_form():
    return btforms.Form(btforms.Dropdown("use",
                                         description=u"服务类型",
                                         args=service_uses.items(),
                                         required="required",
                                         **input_style),
                        btforms.Textbox("host_name",
                                        description=u"主机名称",
                                        readonly="readonly",
                                        **input_style),
                        btforms.Textbox("service_description",
                                        rules.len_of(1, 128),
                                        description=u"服务描述",
                                        required="required",
                                        **input_style),
                        btforms.Textbox("check_command",
                                        rules.len_of(1, 512),
                                        description=u"检测命令",
                                        required="required",
                                        help=u"命令参考",
                                        **input_style),
                        btforms.Textbox("max_check_attempts",
                                        rules.is_number,
                                        description=u"最大重试次数",
                                        required="required",
                                        **input_style),
                        btforms.Textbox("normal_check_interval",
                                        rules.is_number,
                                        description=u"检测间隔时间(分)",
                                        value=5,
                                        required="required",
                                        **input_style),
                        btforms.Textbox("retry_check_interval",
                                        rules.is_number,
                                        description=u"重试间隔时间(分)",
                                        value=1,
                                        required="required",
                                        **input_style),
                        btforms.Dropdown("notifications_enabled",
                                         args=state.items(),
                                         description=u"启动通知",
                                         **input_style),
                        btforms.Dropdown("process_perf_data",
                                         args=state.items(),
                                         description=u"启动性能统计",
                                         **input_style),
                        btforms.Button("submit",
                                       type="submit",
                                       html=u"<b>提交</b>",
                                       **button_style),
                        btforms.Hidden("service_id",
                                       description=u"service_id"),
                        title=u"服务修改",
                        action="/service/update")()
Ejemplo n.º 15
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"
    )
Ejemplo n.º 16
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")
Ejemplo n.º 17
0
def account_update_form():
    return btforms.Form(
        btforms.Textbox("account_number", description=u"用户账号", readonly="readonly", **input_style),
        btforms.Textbox("ip_address", description=u"用户IP地址", **input_style),
        btforms.Hidden("install_address", description=u"用户安装地址", **input_style),
        btforms.Textbox("new_password", description=u"认证密码(留空不修改)", **input_style),
        btforms.Textbox("user_concur_number", rules.is_number, description=u"用户并发数", required="required", **input_style),
        btforms.Dropdown("bind_mac", args=boolean.items(), description=u"是否绑定MAC", **input_style),
        btforms.Dropdown("bind_vlan", args=boolean.items(), description=u"是否绑定VLAN", **input_style),
        btforms.Textarea("account_desc", description=u"用户描述", rows=4, **input_style),
        btforms.Button("submit", type="submit", html=u"<b>提交</b>", **button_style),
        title=u"用户策略修改",
        action="/admin/account/update"
    )
Ejemplo n.º 18
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")
Ejemplo n.º 19
0
def tpl_add_form():
    return btforms.Form(btforms.Textbox("tpl_name",
                                        rules.len_of(4, 64),
                                        description=u"模版名称",
                                        required="required",
                                        **input_style),
                        btforms.Textarea("tpl_desc",
                                         description=u"模版描述",
                                         rows=4,
                                         **input_style),
                        btforms.Button("submit",
                                       type="submit",
                                       id="submit",
                                       html=u"<b>提交</b>",
                                       **button_style),
                        title=u"增加模版",
                        action="/template/add")
Ejemplo n.º 20
0
def tpl_update_form():
    return btforms.Form(btforms.Hidden("id", description=u"编号"),
                        btforms.Textbox("tpl_name",
                                        rules.len_of(4, 64),
                                        description=u"模版名称",
                                        readonly="readonly",
                                        **input_style),
                        btforms.Textarea("tpl_desc",
                                         description=u"模版描述",
                                         rows=4,
                                         **input_style),
                        btforms.Button("submit",
                                       type="submit",
                                       html=u"<b>更新</b>",
                                       **button_style),
                        title=u"修改模版",
                        action="/template/update")
Ejemplo n.º 21
0
def product_add_form():
    return btforms.Form(
        btforms.Textbox("product_name", rules.len_of(4, 64), description=u"资费名称", required="required", **input_style),
        btforms.Dropdown("product_policy", args=product_policy.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_numberOboveZore, description=u"并发数控制(0表示不限制)", value="0",**input_style),
        btforms.Dropdown("bind_mac", args=boolean.items(), description=u"是否绑定MAC ", **input_style),
        btforms.Dropdown("bind_vlan", args=boolean.items(), description=u"是否绑定VLAN ", **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.Dropdown("product_status", args=product_status_dict.items(), description=u"资费状态", required="required",**input_style),
        btforms.Button("submit", type="submit", id="submit", html=u"<b>提交</b>", **button_style),
        title=u"增加资费",
        action="/admin/product/add"
    )
Ejemplo n.º 22
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")
Ejemplo n.º 23
0
loglevels = {'INFO': u"一般", 'DEBUG': u"调试", 'WARNING': u"警告", 'ERROR': u"错误"}

system_form = btforms.Form(
    btforms.Dropdown("debug",
                     args=boolean.items(),
                     description=u"开启DEBUG",
                     help=u"开启此项,可以获取更多的系统日志纪录",
                     **input_style),
    btforms.Dropdown("tz",
                     args=timezones.items(),
                     description=u"时区",
                     **input_style),
    btforms.Textbox("secret", description=u"安全密钥", **input_style),
    # btforms.Button("regen_secret", type="button", onclick="update_secret();", html=u"<b>重新生成安全密钥</b>"),
    btforms.Button("submit", type="submit", html=u"<b>更新</b>", **button_style),
    title=u"系统配置管理",
    action="/admin/config/system/update")

dbtypes = {'mysql': u"mysql", 'sqlite': u"sqlite"}

database_form = btforms.Form(
    btforms.Dropdown("echo",
                     args=boolean.items(),
                     description=u"开启数据库DEBUG",
                     help=u"开启此项,可以在控制台打印SQL语句",
                     **input_style),
    btforms.Textbox("dbtype",
                    description=u"数据库类型",
                    readonly="readonly",
                    **input_style),
Ejemplo n.º 24
0
boolean = {0: u"否", 1: u"是"}
booleans = {'0': u"否", '1': u"是"}
mailmodes = {'toughcloud': u"硬派云邮件服务", 'smtp': u"SMTP服务"}
bool_bypass = {'0': u"免密码认证", '1': u"强制密码认证"}
button_style_link = {"class": "btn btn-sm btn-link"}

sys_form = btforms.Form(btforms.Textbox("system_name",
                                        description=u"管理系统名称",
                                        help=u"管理系统名称,可以根据你的实际情况进行定制",
                                        **input_style),
                        btforms.Textbox("system_ticket_expire_days",
                                        description=u"上网日志保留天数",
                                        **input_style),
                        btforms.Button("submit",
                                       type="submit",
                                       html=u"<b>更新</b>",
                                       **button_style),
                        title=u"参数配置管理",
                        action="/admin/param/update?active=syscfg")

toughcloud_form = btforms.Form(
    btforms.Textarea(
        "toughcloud_license",
        description=u"硬派云服务授权码",
        help=u"硬派云服务授权码是用来接入硬派云的凭证,请妥善保管,泄露授权码会给您带来安全隐患。如果授权码泄露,请尽快申请新的授权码。",
        rows=3,
        **input_style),
    btforms.Textbox("toughcloud_service_mail",
                    description=u"服务联系邮件",
                    help=u"如果启用硬派云邮件服务,该邮件可以作为发送地址和用户回复地址",
                    **input_style),
Ejemplo n.º 25
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.Checkbox("is_samename",
                                         description=u"启用独立的自助服务用户名",
                                         checked=""),
                        btforms.Textbox("customer_name",
                                        rules.len_of(0, 64),
                                        description=u"自助服务用户名",
                                        **input_style),
                        btforms.Textbox("customer_password",
                                        rules.len_of(0, 128),
                                        description=u"自助服务用户密码",
                                        **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.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("fee_value",
                                        rules.is_rmb,
                                        description=u"缴费金额",
                                        required="required",
                                        **input_style),
                        btforms.Textbox("expire_date",
                                        rules.is_date,
                                        description=u"过期日期",
                                        required="required",
                                        **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")
Ejemplo n.º 26
0
sexopt = {1: u"男", 0: u"女"}

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


def customer_join_form(nodes=[]):
    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"用户姓名(必填)",
Ejemplo n.º 27
0
default_form = btforms.Form(btforms.Dropdown("debug",
                                             args=booleans.items(),
                                             description=u"开启DEBUG",
                                             help=u"开启此项,可以获取更多的系统日志纪录",
                                             **input_style),
                            btforms.Dropdown("tz",
                                             args=timezones.items(),
                                             description=u"时区",
                                             **input_style),
                            btforms.Textbox("secret",
                                            description=u"安全密钥",
                                            readonly="readonly",
                                            **input_style),
                            btforms.Button("regen_secret",
                                           type="button",
                                           onclick="update_secret();",
                                           html=u"<b>重新生成安全密钥</b>"),
                            btforms.Button("submit",
                                           type="submit",
                                           html=u"<b>更新</b>",
                                           **button_style),
                            title=u"系统配置管理",
                            action="/config/default/update")

dbtypes = {'mysql': u"mysql", 'sqlite': u"sqlite"}

database_form = btforms.Form(btforms.Dropdown("echo",
                                              args=booleans.items(),
                                              description=u"开启数据库DEBUG",
                                              help=u"开启此项,可以在控制台打印SQL语句",
                                              **input_style),
Ejemplo n.º 28
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")