Skip to content

Commit

Permalink
init datatable for base img history
Browse files Browse the repository at this point in the history
  • Loading branch information
rwxzhu committed Mar 6, 2024
1 parent b9c9743 commit dc37a7c
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,6 @@ <h4 class="panel-title pull-left">
Base Images Auto Update History
</h4>
</div>
<div class="panel-body table-responsive">
{% include "clusters/base_images_events.tmpl" %}
</div>
{% include "clusters/base_images_events.tmpl" %}
</div>
{% endblock main %}
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,20 @@
{% load static %}
<div class="panel-body table-responsive">
<table id="baseImageEventsTableId" class="table table-condensed table-striped table-hover">
<tr>
<th></th>
<th class="col-lg-2">Cluster Name</th>
<th class="col-lg-2">From Image</th>
<th class="col-lg-2">To Image</th>
<th class="col-lg-1">Status</th>
<th class="col-lg-2">Create Time</th>
<th class="col-lg-2">Start Time</th>
<th class="col-lg-2">Finish Time</th>
<th class="col-lg-2">Error Message</th>
</tr>
<thead>
<tr>
<th></th>
<th class="col-lg-2">Cluster Name</th>
<th class="col-lg-2">From Image</th>
<th class="col-lg-2">To Image</th>
<th class="col-lg-1">Status</th>
<th class="col-lg-2">Create Time</th>
<th class="col-lg-2">Start Time</th>
<th class="col-lg-2">Finish Time</th>
<th class="col-lg-2">Error Message</th>
</tr>
</thead>
<tbody>
{% for base_images_event in base_images_events %}
<tr>
<td>
Expand Down Expand Up @@ -41,6 +44,7 @@
<td> {{ base_images_event.error_message }} </td>
</tr>
{% endfor %}
</tbody>
</table>
<div class="panel-footer clearfix">
<div class="pull-left">
Expand Down Expand Up @@ -71,9 +75,20 @@
</div>
</div>
</div>

<style>
#baseImageEventsTableId.dataTable.table-condensed .sorting:after,
#baseImageEventsTableId.dataTable.table-condensed .sorting_asc:after,
#baseImageEventsTableId.dataTable.table-condensed .sorting_desc:after {
top: auto;
}
</style>
<script>
var current_cluster_info = {{current_cluster|safe}};
$('#baseImageEventsTableId').dataTable({
columnDefs: [{targets: [0, 4, 8], sortable: false}],
order:[5, 'desc'], // order by create time desc
pageLength: 25,
});
$(function () {
$('#rollbackItButton').click(function () {
$('#rollbackConfirm').modal()
Expand Down

0 comments on commit dc37a7c

Please sign in to comment.