Exemplo n.º 1
0
Arquivo: views.py Projeto: malazay/ASM
def ajax(request):
    data = collections.OrderedDict()
    cpu_count = percore_cpu()
    coredata = collections.OrderedDict()
    for core in cpu_count:
        coredata[core[0]] = core[1]
    data = coredata
    return HttpResponse(json.dumps(data), content_type="application/json")
Exemplo n.º 2
0
Arquivo: views.py Projeto: malazay/ASM
def monitor(request):
    cpu_count = percore_cpu()
    server_list = Server.objects.all()
    context = {'server_list': server_list, 'cpu_count': cpu_count}
    return render(request, 'dashboard/monitor.html', context)