Skip to content

Commit

Permalink
indicate when no smart attributes found rockstor#997
Browse files Browse the repository at this point in the history
Some drives report no attributes as this is an ATA/SATA
only feature so state non found rather than empty table.
Also reformat related code.
  • Loading branch information
phillxnet committed Jan 2, 2016
1 parent 2152752 commit 352cdad
Showing 1 changed file with 42 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -130,42 +130,48 @@
</div>
</div>

<div id="smartattributes">
<div class="row">
<table id="smartattributes-table" class="table table-condensed table-bordered table-hover table-striped tablesorter" summary="List of S.M.A.R.T attributes">
<thead>
<tr>
<th>Id</th>
<th>Name</th>
<th>Failed</th>
<th>Norm-ed Value</th>
<th>Worst</th>
<th>Threshold</th>
<th>Raw Value</th>
<th>Type</th>
<th>Updated</th>
<th>Flag</th>
</tr>
</thead>
<tbody>
<% attributes.forEach(function(attribute) { %>
<tr>
<td><%= attribute.aid %></td>
<td><%= attribute.name %></td>
<td><%= attribute.failed %></td>
<td><%= attribute.normed_value %></td>
<td><%= attribute.worst %></td>
<td><%= attribute.threshold %></td>
<td><%= attribute.raw_value %></td>
<td><%= attribute.atype %></td>
<td><%= attribute.updated %></td>
<td><%= attribute.flag %></td>
</tr>
<% }); %>
</tbody>
</table>
</div>
</div>
<div id="smartattributes">
<div class="row">
<% if (attributes.length == 0) { %>
<h3>No S.M.A.R.T Attributes found (ATA/SATA only)</h3>
<% } else { %>
<table id="smartattributes-table"
class="table table-condensed table-bordered table-hover table-striped tablesorter"
summary="List of S.M.A.R.T attributes">
<thead>
<tr>
<th>Id</th>
<th>Name</th>
<th>Failed</th>
<th>Norm-ed Value</th>
<th>Worst</th>
<th>Threshold</th>
<th>Raw Value</th>
<th>Type</th>
<th>Updated</th>
<th>Flag</th>
</tr>
</thead>
<tbody>
<% attributes.forEach(function(attribute) { %>
<tr>
<td><%= attribute.aid %></td>
<td><%= attribute.name %></td>
<td><%= attribute.failed %></td>
<td><%= attribute.normed_value %></td>
<td><%= attribute.worst %></td>
<td><%= attribute.threshold %></td>
<td><%= attribute.raw_value %></td>
<td><%= attribute.atype %></td>
<td><%= attribute.updated %></td>
<td><%= attribute.flag %></td>
</tr>
<% }); %> <!-- attributes.forEach -->
</tbody>
</table>
<% } %> <!-- attributes.length -->
</div>
</div>

<div id="smartcapabilities">
<div class="row">
Expand Down

0 comments on commit 352cdad

Please sign in to comment.