def update_graph(request): """ 更新曲线图 :param request: :return: 返回实时的曲线图数据 """ if request.method == 'POST': url_id = request.POST.get('url_id') defaultDomainData, graph_data = get_areas_data(url_id) return HttpResponse(json.dumps(graph_data))
def areas(request,url_id=None): """ :param request: :param url_id: 域名在DomainName表里的id :return: 选择域名按钮的内容 = project_list 数据展示曲线图里的数据 = graph_data 最下面表格的数据 = defaultDomainData """ if request.method == 'GET': project_list = Project.objects.all().order_by('id') defaultDomainData, graph_data = get_areas_data(url_id) if graph_data is None and defaultDomainData is None: return render(request,"error_page.html",{'errorInfo':'还没有域名,请跳转至域名管理页面添加域名'}) return render(request,'webmoni_areas.html',{'project_list':project_list, 'defaultDomainData':defaultDomainData, 'graph_data':graph_data})
def areas(request, url_id=None): """ 区域展示页面 :param request: :param url_id: 域名在DomainName表里的id :return: 选择域名按钮的内容 = project_list 数据展示曲线图里的数据 = graph_data 最下面表格的数据 = defaultDomainData """ if request.method == 'GET': project_list = Project.objects.all().order_by('id') defaultDomainData, graph_data = get_areas_data(url_id) return render( request, 'show_areas.html', { 'project_list': project_list, 'defaultDomainData': defaultDomainData, 'graph_data': graph_data })