Skip to content

Commit

Permalink
add grouping by interface capacity in overview
Browse files Browse the repository at this point in the history
add a nicsBySpeed grouping for overview

change language for nic counts

add deprecation notice to hasGbNic methods
  • Loading branch information
byxorna committed May 20, 2017
1 parent 4691ca5 commit 4284a06
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
3 changes: 3 additions & 0 deletions app/collins/util/LshwRepresentation.scala
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,11 @@ case class LshwRepresentation(
}

def nicCount: Int = nics.size
def nicsBySpeed = nics.groupBy { _.speed }
// NOTE(gabe): these has*GbNic methods are deprecated. Please use nicsBySpeed instead
def hasGbNic: Boolean = nics.find { _.speed.inGigabits == 1 }.map { _ => true }.getOrElse(false)
def has10GbNic: Boolean = nics.find { _.speed.inGigabits == 10 }.map { _ => true }.getOrElse(false)

def macAddresses: Seq[String] = nics.map { _.macAddress }

def toJsValue() = Json.toJson(this)
Expand Down
9 changes: 5 additions & 4 deletions app/views/asset/show_overview.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -257,15 +257,16 @@ <h3>Hardware Summary <small>Summary of system components reported by LSHW</small
</tr>
<tr>
<td></td>
<td>Interfaces</td>
<td>Total Interfaces</td>
<td>@aa.lshw.nicCount</td>
</tr>
@aa.lshw.nicsBySpeed.map { case(speed,nics) =>
<tr>
<td></td>
<td>Has 10Gb Interface</td>
<td>@{if (aa.lshw.has10GbNic) "Yes" else "No"}</td>
<td>@{speed.inGigabits}G Interfaces</td>
<td>@{nics.size}</td>
</tr>

}
<tr>
<th colspan="3">Power</th>
</tr>
Expand Down

0 comments on commit 4284a06

Please sign in to comment.