Example #1
0
def pps(req):
    username= req.session.get("username")
    if(req.is_ajax()):
        print "pps ajax"
        rest_call = RestCall("127.0.0.1","/wm/flowstatistics/pps")
        str = rest_call.get()
        ret = json.loads(str)
        ret.get("pipps")
        content = {"username": username, "pipps": ret.get("pipps"),"piops":ret.get("piops"), "pktpps":ret.get("pktpps") ,"pktops": ret.get("pktops")}
        return JsonResponse(content)
    return render_to_response("pps.html")
Example #2
0
def activeflow(req):

    username= req.session.get("username")
    if(req.is_ajax()):
        print  "activeflow ajax"
        host = "127.0.0.1"
        url = "/wm/flowstatistics/json"
        rest_call = RestCall(host,url)
        str = rest_call.get()
        ret = json.loads(str)
        ret.get("data")
        #print ret
        content = {"username": username, "data": ret.get("data")}
        return JsonResponse(content)

    return render_to_response("active_flow.html")