Exemplo n.º 1
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")
Exemplo n.º 2
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")
Exemplo n.º 3
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"用户注册")
Exemplo n.º 4
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")
Exemplo n.º 5
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"
    )
Exemplo n.º 6
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",
    )
Exemplo n.º 7
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"
    )
Exemplo n.º 8
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")()
Exemplo n.º 9
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"
    )
Exemplo n.º 10
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")
Exemplo n.º 11
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")