示例#1
0
def AddPOC():
    pocname = ""
    rule = ""
    expression = ""
    buggrade = ""
    redispool.hset('bugtype', pocname, buggrade)
    poc = POC(name=pocname, rule=rule, expression=expression)
    db.session.add(poc)
    db.session.commit()
示例#2
0
def POCmanage():
    bugbit, bugtype = core.GetBit()
    poclist = POC.query.order_by(POC.id.desc()).all()
    if request.method == 'GET':
        return render_template('pocmanage.html', bugbit=bugbit, bugtype=bugtype, poclist=poclist)
    else:
        pocname = request.form.get('pocname')
        rule = request.form.get('rule')
        expression = request.form.get('expression')
        buggrade = request.form.get('buggrade')
        redispool.hset('bugtype', pocname, buggrade)
        poc = POC(name=pocname, rule=rule, expression=expression)
        redispool.pfadd("poc", pocname)
        db.session.add(poc)
        db.session.commit()
        poclist = POC.query.order_by(POC.id.desc()).all()
        return render_template('pocmanage.html', bugbit=bugbit, bugtype=bugtype, poclist=poclist)