-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
33 changed files
with
386 additions
and
500 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
//= require datatables/jquery.dataTables | ||
//= require datatables/dataTables.bootstrap4 | ||
|
||
// Global settings and initializer for all datatables | ||
$.extend( $.fn.dataTable.defaults, { | ||
// https://datatables.net/reference/option/responsive | ||
responsive: true, | ||
// https://datatables.net/reference/option/pagingType | ||
pagingType: 'simple_numbers' | ||
// https://datatables.net/reference/option/dom | ||
//dom: | ||
// "<'row'<'col-sm-4 text-left'f><'right-action col-sm-8 text-right'<'buttons'B> <'select-info'> >>" + | ||
// "<'row'<'dttb col-12 px-0'tr>>" + | ||
// "<'row'<'col-sm-12 table-footer'lip>>" | ||
}); | ||
|
||
// Initialization on turbolinks load | ||
$(document).on('turbolinks:load', function() { | ||
if (!$.fn.DataTable.isDataTable('table[data-toggle="datatable"]')) { | ||
$('table[data-toggle="datatable"]').DataTable(); | ||
} | ||
}); | ||
|
||
// Turbolinks cache fix | ||
// https://stackoverflow.com/questions/41070556 | ||
$(document).on('turbolinks:before-cache', function() { | ||
$($.fn.dataTable.tables(true)).DataTable().destroy(); | ||
}); | ||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,27 @@ | ||
<h1 class="float-left">Hosts</h1> | ||
<h1>Hosts</h1> | ||
|
||
<input class="filter-box float-left ml-3 mt-2" type="text" id="filter" onkeyup="filterTable('filter', 'hosts')" placeholder="Search hosts"> | ||
|
||
<table data-toggle="table" class="table" id="hosts"> | ||
<table class="table" id="hosts" data-toggle="datatable"> | ||
<thead> | ||
<tr> | ||
<th scope="col" data-sortable="true" class="bg-primary text-white rounded-left">Name</th> | ||
<th scope="col" data-sortable="true" class="bg-primary text-white">Vendor</th> | ||
<th scope="col" data-sortable="true" class="bg-primary text-white">Model</th> | ||
<th scope="col" data-sortable="true" class="bg-primary text-white rounded-right">Status</th> | ||
</tr> | ||
<tr> | ||
<th>Name</th> | ||
<th>Vendor</th> | ||
<th>Model</th> | ||
<th>Status</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<% @hosts.each do |host| %> | ||
<tr> | ||
<td class="table-active"> | ||
<%= link_to host.name, {controller: :hosts, action: 'show', id: host.name}, method: :get %> | ||
</td> | ||
<td class="table-active"><%= host.vendor %></td> | ||
<td class="table-active"><%= host.model %></td> | ||
<td class="table-active align-middle"> | ||
<div class="round | ||
<%= host.connection_state == 'connected' ? 'bg-success' : 'bg-warning' %>" | ||
title="<%= host.connection_state %>"> | ||
</div> | ||
<td><%= link_to host.name, host_path(host.name) %></td> | ||
<td><%= host.vendor %></td> | ||
<td><%= host.model %></td> | ||
<td data-order="<%= host.connection_state %>" data-search="<%= host.connection_state %>"> | ||
<%= content_tag :div, nil, | ||
title: host.connection_state, | ||
:data => { toggle: 'tooltip', placement: 'right' }, | ||
class: "round #{host.connection_state == 'connected' ? 'bg-success' : 'bg-warning'}" %> | ||
</td> | ||
</tr> | ||
<% end %> | ||
<% end %> <%# @hosts.each %> | ||
</tbody> | ||
</table> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.