Exemplo n.º 1
0
def detail(request, host=""):
    # detail is a dict
    details = Host.get_detail(host)
    ip = details['ip']
    cpu = details['cpu']
    disk_per = details['disk_per']
    mem = details['mem']
    net = details['net_bandwidth']
    times = json.dumps(details['time'])
    return render_to_response("host_detail.html", {"host":host, "ip":ip, "cpu":cpu, "disk_per":disk_per, "mem":mem, "net":net, 
                                                   "time":times, "details":details, "breadcrumb": [{"name": "Host", "url": "/"}, {"name": host}]})
Exemplo n.º 2
0
def hosts(request):
    # host is a list
    hosts = Host.get_all()
    return render_to_response("hosts.html", {"hosts":hosts, "breadcrumb": [{"name": "Hosts"}]})