溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點(diǎn)擊 登錄注冊 即表示同意《億速云用戶服務(wù)條款》

配置文件更新展示

發(fā)布時間:2020-07-01 15:59:27 來源:網(wǎng)絡(luò) 閱讀:460 作者:krven1983 欄目:開發(fā)技術(shù)

python文件

def nginx_update(request):
    all_server = NginxEThistory.objects.all()
    paginator = Paginator(all_server,20)

    try:
        page = int(request.GET.get('page','1'))
    except ValueError:
        page = 1

    try:
        all_server = paginator.page(page)
    except :
        all_server = paginator.page(paginator.num_pages)
    return render_to_response('nginx_history.html',
                      {'all_host_list': all_server, 'page': page, 'paginator':paginator},context_instance=RequestContext(request))

html文件

{% extends "index.html" %}
{% block title %}OMS{% endblock %}
{% block css %}
<!-- DataTables-->
<link rel="stylesheet" href="/static/plugins/dataTables/css/dataTables.css">
{% endblock %}
{% block content %}
      <div class="row">
            <div class="col-md-12">
                 <div class="panel panel-default">
                      <div class="panel-body">
                           {% if all_host_list %}
                           <table id="example" class="table table-striped table-bordered" cellspacing="0" width="100%">
                               <thead>
                                   <tr>
                                      <th>ID</th>
                                      <th>文件名</th>
                                      <th>回顯</th>
                                   </tr>
                               </thead>
                               <tbody>
                               {% for all_host in all_host_list %}
                                   <tr>
                                      <td>{{ forloop.counter }}</td>
                                      <td>{{ all_host.filename }}</td>
                                      <td>{{ all_host.message }}</td>
                                      <td><a href="http://:8999/nginxbjh/?id={{ all_host.id }}" class="btn btn-info btn-sm">編輯</a>
                                           <a href="{% url 'huixianhistory' id=all_host.id %}" class="btn btn-info btn-sm">回顯展示</a></td>
                                   </tr>
                               {% endfor %}
                               </tbody>
                            </table>
                           {% endif %}
                            <div class="row">
                                 <div class="col-xs-6">
                                       <div class="dataTables_info" id="example_info" role="alert" aria-live="polite" aria-relevant="all"></div>
                                 </div>
                                 <div class="col-xs-6">
                                      <div class="dataTables_paginate paging_simple_numbers" id="exmaple_paginate">
                                           <a href="{% url 'xianip' %}" class="btn btn-info btn-sm" role="button">添加</a>
                                           {% if all_host_list.has_previous %}
                                                <a href="?page={{ all_host_list.previous_page_number }}">上一頁</a>
                                           {% endif %}
                                           <span class="current">
                                                第{{ all_host_list.number }}頁,共{{ all_host_list.paginator.num_pages }}頁
                                           </span>
                                           {% if all_host_list.has_next %}
                                                <a href="?page={{ all_host_list.next_page_number }}">下一頁</a>
                                           {% endif %}
                                      </div>
                                 </div>
                           </div> <!--row end-->
                         </div>
                     </div>
                 </div>
{% endblock %}


向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報,并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI