配置文件更新展示
python文件
defnginx_update(request):all_server=NginxEThistory.objects.all()paginator=Paginator(all_server,20)try:page=int(request.GET.get('page','1'))exceptValueError:page=1try:all_server=paginator.page(page)except:all_server=paginator.page(paginator.num_pages)returnrender_to_response('nginx_history.html',{'all_host_list':all_server,'page':page,'paginator':paginator},context_instance=RequestContext(request))
html文件
{%extends"index.html"%}{%blocktitle%}OMS{%endblock%}{%blockcss%}<!--DataTables--><linkrel="stylesheet"href="/static/plugins/dataTables/css/dataTables.css">{%endblock%}{%blockcontent%}<divclass="row"><divclass="col-md-12"><divclass="panelpanel-default"><divclass="panel-body">{%ifall_host_list%}<tableid="example"class="tabletable-stripedtable-bordered"cellspacing="0"width="100%"><thead><tr><th>ID</th><th>文件名</th><th>回显</th></tr></thead><tbody>{%forall_hostinall_host_list%}<tr><td>{{forloop.counter}}</td><td>{{all_host.filename}}</td><td>{{all_host.message}}</td><td><ahref="http://:8999/nginxbjh/?id={{all_host.id}}"class="btnbtn-infobtn-sm">编辑</a><ahref="{%url'huixianhistory'id=all_host.id%}"class="btnbtn-infobtn-sm">回显展示</a></td></tr>{%endfor%}</tbody></table>{%endif%}<divclass="row"><divclass="col-xs-6"><divclass="dataTables_info"id="example_info"role="alert"aria-live="polite"aria-relevant="all"></div></div><divclass="col-xs-6"><divclass="dataTables_paginatepaging_simple_numbers"id="exmaple_paginate"><ahref="{%url'xianip'%}"class="btnbtn-infobtn-sm"role="button">添加</a>{%ifall_host_list.has_previous%}<ahref="?page={{all_host_list.previous_page_number}}">上一页</a>{%endif%}<spanclass="current">第{{all_host_list.number}}页,共{{all_host_list.paginator.num_pages}}页</span>{%ifall_host_list.has_next%}<ahref="?page={{all_host_list.next_page_number}}">下一页</a>{%endif%}</div></div></div><!--rowend--></div></div></div>{%endblock%}
声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若本站内容侵犯了原著者的合法权益,可联系本站删除。