示例#1
0
文件: ajax.py 项目: mpars0ns/WhoDat
def metadata(request, version = None):
    results = handler.metadata(version)

    if results['success'] == False:
        return __renderErrorJSON__(results['message'])

    return HttpResponse(json.dumps(results), content_type='application/json')
示例#2
0
文件: ajax.py 项目: LubyRuffy/WhoDat
def metadata(request, version = None):
    results = handler.metadata(version)

    if results['success'] == False:
        return __renderErrorJSON__(results['message'])

    return HttpResponse(json.dumps(results), content_type='application/json')
示例#3
0
文件: views.py 项目: LubyRuffy/WhoDat
def stats(request):
    stats = handler.cluster_stats()
    allversions = handler.metadata()
    if allversions['success']:
        lastimport = allversions['data'][-1]
        lastten = allversions['data'][-10:]
    else:
        #XXX TODO returne error
        pass

    if lastten[0]['metadata'] == 0:
        lastten = lastten[1:]

    context = __createRequestContext__(request, data = {'domainStats': stats['domainStats'], 
                                                        'histogram': stats['histogram'],
                                                        'lastten': lastten,
                                                        'lastimport': lastimport})
    return render_to_response('stats.html', context)
示例#4
0
def stats(request):
    stats = handler.cluster_stats()
    allversions = handler.metadata()
    if allversions['success']:
        lastimport = allversions['data'][-1]
        lastten = allversions['data'][-10:]
    else:
        #XXX TODO returne error
        pass

    if lastten[0]['metadata'] == 0:
        lastten = lastten[1:]

    context = __createRequestContext__(request,
                                       data={
                                           'domainStats': stats['domainStats'],
                                           'histogram': stats['histogram'],
                                           'lastten': lastten,
                                           'lastimport': lastimport
                                       })
    return render_to_response('stats.html', context)