Exemple #1
0
    def post(self):
        form = nas_forms.bas_update_form()
        if not form.validates(source=self.get_params()):
            self.render("base_form.html", form=form)
            return
        bas = self.db.query(models.TraBas).get(form.d.id)
        bas.bas_name = form.d.bas_name
        bas.time_type = form.d.time_type
        bas.vendor_id = form.d.vendor_id
        bas.portal_vendor = form.d.portal_vendor
        bas.bas_secret = form.d.bas_secret
        bas.coa_port = form.d.coa_port
        bas.ac_port = form.d.ac_port

        ops_log = models.TraOperateLog()
        ops_log.operator_name = self.get_secure_cookie("tra_user")
        ops_log.operate_ip = self.get_secure_cookie("tra_login_ip")
        ops_log.operate_time = utils.get_currtime()
        ops_log.operate_desc = u'操作员(%s)修改BAS信息:%s' % (ops_log.operator_name, bas.ip_addr)
        self.db.add(ops_log)

        self.db.commit()

        self.redirect("/bas",permanent=False)
Exemple #2
0
 def get(self):
     bas_id = self.get_argument("bas_id")
     form = nas_forms.bas_update_form()
     form.fill(self.db.query(models.TraBas).get(bas_id))
     return self.render("base_form.html", form=form)