Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Ref #2581 Display new inventories, search on json fields are working

  • Loading branch information...
commit 4482d02de42ca1ad75d4bc6ad08810b802f0055e 1 parent 7ec950e
@VinceMacBuche VinceMacBuche authored
View
25 rudder-core/src/main/scala/com/normation/rudder/domain/queries/CmdbQuery.scala
@@ -53,6 +53,7 @@ import net.liftweb.json._
import JsonDSL._
import com.normation.exceptions.TechnicalException
import com.normation.utils.HashcodeCaching
+import com.unboundid.ldap.sdk.Filter
sealed trait CriterionComparator {
val id:String
@@ -276,6 +277,7 @@ case object OstypeComparator extends CriterionType {
}
}
+
override def toForm(value: String, func: String => Any, attrs: (String, String)*) : Elem =
SHtml.select(
(osTypes map (e => (e,e))).toSeq,
@@ -398,6 +400,29 @@ case object GroupOfDnsComparator extends CriterionType {
override def toLDAP(value:String) = Full(value)
}
*/
+case class JsonComparator(key:String) extends TStringComparator {
+ override val comparators = BaseComparators.comparators
+
+ def JsonQueryfromkeyvalues (values:List[(String,String)], key:String): Filter =
+ values match {
+ case (attribute,value)::Nil => SUB(key,null,Array("\"%s\":\"%s\"".format(attribute,value)) ,null)
+ case (attribute,value)::tail if !tail.isEmpty => AND(SUB(key,null,Array("\"%s\":\"%s\"".format(attribute,value)) ,null),JsonQueryfromkeyvalues(tail,key))
+ case Nil => HAS(key)
+ }
+
+ override def buildFilter(attributeName:String,comparator:CriterionComparator,value:String) : Filter = {
+ val splittedattribute = attributeName.split("/")
+ val splittedvalue = value.split(":")
+ val keyvalue = (splittedattribute.toList,splittedvalue.toList).zipped map( (attribute,value) => (attribute,value))
+ comparator match {
+ case Equals => JsonQueryfromkeyvalues(keyvalue,key)
+ case NotEquals => NOT(JsonQueryfromkeyvalues(keyvalue,key))
+ case NotExists => NOT(HAS(key))
+ case Regex => HAS(key) //"default, non interpreted regex
+ case _ => HAS(key) //default to Exists
+ }
+ }
+}
case class Criterion(val name:String, val cType:CriterionType) extends HashcodeCaching {
View
84 rudder-core/src/main/scala/com/normation/rudder/domain/queries/DitQueryData.scala
@@ -42,6 +42,7 @@ import BuildFilter._
import scala.collection.{SortedMap,SortedSet}
import com.normation.rudder.services.queries.SpecialFilter
import com.normation.utils.HashcodeCaching
+import com.normation.rudder.domain.queries.JsonComparator
/*
@@ -71,8 +72,8 @@ case object QuerySoftwareDn extends DnType
class DitQueryData(dit:InventoryDit) {
private val peObjectCriterion = ObjectCriterion(OC_PE, Seq(
-// Criterion(A_MACHINE_UUID, StringComparator),
-// Criterion(A_MACHINE_DN, StringComparator), //we don't want to search on that
+// Criterion(A_MACHINE_UUID, StringComparator),
+// Criterion(A_MACHINE_DN, StringComparator), //we don't want to search on that
Criterion(A_DESCRIPTION, StringComparator),
Criterion(A_MODEL, StringComparator),
Criterion(A_SERIAL_NUMBER, StringComparator),
@@ -84,9 +85,9 @@ class DitQueryData(dit:InventoryDit) {
))
private val leObjectCriterion = ObjectCriterion(OC_LE, Seq(
-// Criterion(A_NODE_UUID, StringComparator),
-// Criterion(A_NODE_DN, StringComparator),
-// Criterion(A_NAME, StringComparator),
+// Criterion(A_NODE_UUID, StringComparator),
+// Criterion(A_NODE_DN, StringComparator),
+// Criterion(A_NAME, StringComparator),
Criterion(A_DESCRIPTION, StringComparator)
))
@@ -135,7 +136,10 @@ class DitQueryData(dit:InventoryDit) {
Criterion(A_PROCESSOR_NAME, StringComparator),
Criterion(A_PROCESSOR_SPEED, LongComparator),
Criterion(A_PROCESSOR_STEPPING, StringComparator),
- Criterion(A_PROCESSOR_FAMILLY, StringComparator)
+ Criterion(A_PROCESSOR_FAMILLY, StringComparator),
+ Criterion(A_PROCESSOR_FAMILY_NAME, StringComparator),
+ Criterion(A_THREAD, StringComparator),
+ Criterion(A_CORE, StringComparator)
)),
ObjectCriterion(OC_SLOT, peObjectCriterion.criteria++ Seq(
Criterion(A_SLOT_NAME, StringComparator)
@@ -152,34 +156,34 @@ class DitQueryData(dit:InventoryDit) {
ObjectCriterion(OC_NODE, Seq(
Criterion("OS",OstypeComparator),
Criterion(A_OS_NAME,OsNameComparator),
- Criterion(A_OS_VERSION, OrderedStringComparator),
- Criterion(A_OS_SERVICE_PACK, OrderedStringComparator),
- Criterion(A_OS_KERNEL_VERSION , OrderedStringComparator),
- Criterion(A_NODE_UUID, StringComparator),
+ Criterion(A_OS_VERSION, OrderedStringComparator),
+ Criterion(A_OS_SERVICE_PACK, OrderedStringComparator),
+ Criterion(A_OS_KERNEL_VERSION , OrderedStringComparator),
+ Criterion(A_NODE_UUID, StringComparator),
Criterion(A_HOSTNAME, StringComparator),
//Criterion(A_DESCRIPTION, StringComparator),
- Criterion(A_OS_RAM, MemoryComparator),
- Criterion(A_OS_SWAP, MemoryComparator),
+ Criterion(A_OS_RAM, MemoryComparator),
+ Criterion(A_OS_SWAP, MemoryComparator),
Criterion(A_AGENTS_NAME, AgentComparator),
Criterion(A_ACCOUNT, StringComparator),
Criterion(A_LIST_OF_IP, StringComparator),
Criterion(A_ROOT_USER, StringComparator),
Criterion(A_INVENTORY_DATE, DateComparator),
Criterion(A_POLICY_SERVER_UUID, StringComparator)
-// Criterion(A_PKEYS, StringComparator)
-// Criterion(A_SOFTWARE_DN, StringComparator),
-// Criterion(A_CONTAINER_DN, StringComparator),
-// Criterion(A_HOSTED_VM_DN, StringComparator)
+// Criterion(A_PKEYS, StringComparator)
+// Criterion(A_SOFTWARE_DN, StringComparator),
+// Criterion(A_CONTAINER_DN, StringComparator),
+// Criterion(A_HOSTED_VM_DN, StringComparator)
)),
ObjectCriterion(OC_SOFTWARE, Seq(
Criterion(A_NAME, StringComparator),
Criterion(A_DESCRIPTION, StringComparator),
- Criterion(A_SOFT_VERSION, StringComparator),
- Criterion(A_RELEASE_DATE, DateComparator),
+ Criterion(A_SOFT_VERSION, StringComparator),
+ Criterion(A_RELEASE_DATE, DateComparator),
Criterion(A_EDITOR, EditorComparator)) ++
licenseObjectCriterion.criteria
),
- ObjectCriterion(OC_NET_IF, leObjectCriterion.criteria ++ Seq(
+ ObjectCriterion(OC_NET_IF, leObjectCriterion.criteria ++ Seq(
Criterion(A_NETWORK_NAME, StringComparator),
Criterion(A_NETIF_ADDRESS, StringComparator),
Criterion(A_NETIF_DHCP, StringComparator),
@@ -190,15 +194,39 @@ class DitQueryData(dit:InventoryDit) {
Criterion(A_NETIF_TYPE, StringComparator),
Criterion(A_NETIF_TYPE_MIB, StringComparator)
)),
- ObjectCriterion(OC_FS, leObjectCriterion.criteria ++ Seq(
+ ObjectCriterion(OC_FS, leObjectCriterion.criteria ++ Seq(
Criterion(A_MOUNT_POINT, StringComparator),
Criterion(A_FILE_COUNT, StringComparator),
Criterion(A_FREE_SPACE, MemoryComparator),
Criterion(A_TOTAL_SPACE, MemoryComparator)
+ )),
+ ObjectCriterion(A_PROCESS, Seq(
+ Criterion("commandName", JsonComparator(A_PROCESS)),
+ Criterion("cpuUsage", JsonComparator(A_PROCESS)),
+ Criterion("memoryUsage", JsonComparator(A_PROCESS)),
+ Criterion("processUser", JsonComparator(A_PROCESS))
+ /*Some other criterion
+val A_PID = "processID"
+val A_PROC_START = "start"
+val A_TTY = "tty"
+val A_VIRTUAL_MEMORY = "virtualMemory"*/
+ )),
+ ObjectCriterion(OC_VM_INFO, leObjectCriterion.criteria ++ Seq(
+ Criterion(A_VM_TYPE, StringComparator),
+ Criterion(A_VM_OWNER, StringComparator),
+ Criterion(A_VM_STATUS, StringComparator),
+ Criterion(A_VM_CPU, StringComparator)
+ )),
+ ObjectCriterion(A_EV, Seq(
+ Criterion("name/value", JsonComparator(A_EV) )
))/*,
- ObjectCriterion(OC_GROUP_OF_DNS,Seq(
- Criterion(A_NAME,GroupOfDnsComparator)
- ))*/ // Hidding a code difficult to import
+val A_VM_ID = "virtualMachineUuid"
+val A_VM_SUBSYSTEM = "subsystem"
+val A_VM_NAME = "vmName"
+val A_VM_MEMORY = "vmMemory"
+ObjectCriterion(OC_GROUP_OF_DNS,Seq(
+Criterion(A_NAME,GroupOfDnsComparator)
+))*/ // Hidding a code difficult to import
)
val criteriaMap : SortedMap[String,ObjectCriterion] = SortedMap[String,ObjectCriterion]() ++ (criteriaSet map { crit => (crit.objectType,crit) })
@@ -246,6 +274,9 @@ case class LDAPObjectType(
"software" -> LDAPObjectType(dit.SOFTWARE.dn, One, ALL, DNJoin),
"node" -> LDAPObjectType(dit.NODES.dn, One, ALL, DNJoin),
"networkInterfaceLogicalElement" -> LDAPObjectType(dit.NODES.dn, Sub, IS(OC_NET_IF), ParentDNJoin),
+ "process" -> LDAPObjectType(dit.NODES.dn, One, ALL, DNJoin),
+ "virtualMachineLogicalElement" -> LDAPObjectType(dit.NODES.dn, Sub, IS(OC_VM_INFO), ParentDNJoin),
+ "environmentVariable" -> LDAPObjectType(dit.NODES.dn, One, ALL, DNJoin),
"fileSystemLogicalElement" -> LDAPObjectType(dit.NODES.dn, Sub, IS(OC_FS), ParentDNJoin),
"machine" -> LDAPObjectType(dit.MACHINES.dn, One, ALL, DNJoin),
"processorPhysicalElement" -> LDAPObjectType(dit.MACHINES.dn, Sub, IS(OC_PROCESSOR), ParentDNJoin),
@@ -266,6 +297,9 @@ case class LDAPObjectType(
"node" -> QueryNodeDn,
"networkInterfaceLogicalElement" -> QueryNodeDn,
"fileSystemLogicalElement" -> QueryNodeDn,
+ "process" -> QueryNodeDn,
+ "virtualMachineLogicalElement" -> QueryNodeDn,
+ "environmentVariable" -> QueryNodeDn,
"machine" -> QueryMachineDn,
"processorPhysicalElement" -> QueryMachineDn,
"memoryPhysicalElement" -> QueryMachineDn,
@@ -288,6 +322,10 @@ case class LDAPObjectType(
"node" -> DNJoin,
"networkInterfaceLogicalElement" -> ParentDNJoin,
"fileSystemLogicalElement" -> ParentDNJoin,
+
+ "process" -> DNJoin,
+ "virtualMachineLogicalElement" -> ParentDNJoin,
+ "environmentVariable" -> DNJoin,
"machine" -> DNJoin,
"processorPhysicalElement" -> ParentDNJoin,
"memoryPhysicalElement" -> ParentDNJoin,
View
24 rudder-web/src/main/resources/ldapObjectAndAttributes.properties
@@ -40,18 +40,18 @@
ldap.comp.exists = Is defined
ldap.comp.notExists = Is not defined
ldap.comp.eq = =
-#
+#\u2260
ldap.comp.notEq = \u2260
ldap.comp.gt = >
ldap.comp.lt = <
-#
+#\u2265
ldap.comp.gteq = \u2265
-#
+#\u2264
ldap.comp.lteq = \u2264
ldap.comp.regex = Regex
# Object
ldap.object.machine = Hardware
-ldap.object.physicalMachine = Physical machine
+ldap.object.physicalMachine = Physical machine
ldap.object.virtualMachine = Virtual machine
ldap.object.physicalElement = Physical component
ldap.object.memoryPhysicalElement = Memories
@@ -69,6 +69,9 @@ ldap.object.unixNode = Unix
ldap.object.linuxNode = Linux
ldap.object.logicalElement = Logical element
ldap.object.fileSystemLogicalElement = File systems
+ldap.object.process = Processes
+ldap.object.virtualMachineLogicalElement = VM
+ldap.object.environmentVariable = Environment Variable
ldap.object.networkInterfaceLogicalElement = Network interfaces
ldap.object.software = Software
ldap.object.groupOfDns = Nodes Group
@@ -166,12 +169,23 @@ ldap.attr.memoryType = Type
ldap.attr.videoChipset = Chipset
ldap.attr.videoResolution = Resolution
ldap.attr.windowsUserDomain = User domain
-ldap.attr.windowsRegistrationCompany = Registred Company
+ldap.attr.windowsRegistrationCompany = Registered Company
ldap.attr.windowsVersion = Version
ldap.attr.windowsKey = Windows Key
ldap.attr.windowsId = Windows ID
ldap.attr.linuxKernelVersion = Kernel version
ldap.attr.linuxDistribution = Distribution
ldap.attr.linuxDistributionVersion = Distribution version
+ldap.attr.vmType = Type
+ldap.attr.vmOwner = Owner
+ldap.attr.virtualMachineUuid = Id
+ldap.attr.vmStatus = Status
+ldap.attr.vmCpu = Cpu
+ldap.attr.commandName = Command name
+ldap.attr.memoryUsage = Memory usage
+ldap.attr.processUser = User
+ldap.attr.cpuUsage = Cpu Usage
+ldap.attr.name/value = Name:Value
+
View
5 rudder-web/src/main/scala/com/normation/rudder/web/components/SearchNodeComponent.scala
@@ -454,7 +454,10 @@ object SearchNodeComponent {
add(OC_NODE)
add(OC_NET_IF, " ├─ ")
- add(OC_FS, " └─ ")
+ add(OC_FS, " ├─ ")
+ add(A_PROCESS, " ├─ ")
+ add(OC_VM_INFO," ├─ ")
+ add(A_EV, " └─ ")
add(OC_MACHINE)
add(OC_BIOS, " ├─ ")
add(OC_CONTROLLER, " ├─ ")
View
127 rudder-web/src/main/scala/com/normation/rudder/web/services/DisplayNode.scala
@@ -95,9 +95,9 @@ object DisplayNode extends Loggable {
private def loadSoftware(jsId:JsNodeId, softIds:Seq[SoftwareUuid])(nodeId:String):JsCmd = {
//id is not used anymore ?
(for {
- seq <- getSoftwareService.getSoftware(softIds)
- val gridDataId = htmlId(jsId,"soft_grid_data_")
- val gridId = htmlId(jsId,"soft_grid_")
+ seq <- getSoftwareService.getSoftware(softIds)
+ val gridDataId = htmlId(jsId,"soft_grid_data_")
+ val gridId = htmlId(jsId,"soft_grid_")
} yield SetExp(JsVar(gridDataId),JsArray(seq.map { x => JsArray(
Str(x.name.getOrElse("")),
Str(x.version.map(_.value).getOrElse("")),
@@ -115,32 +115,38 @@ object DisplayNode extends Loggable {
def head() = chooseTemplate("serverdetails","head",template)
- def jsInit(nodeId:NodeId, softIds:Seq[SoftwareUuid], salt:String="", tabContainer : Option[String] = None):JsCmd = {
- val jsId = JsNodeId(nodeId,salt)
- val detailsId = htmlId(jsId,"details_")
+def jsInit(nodeId:NodeId, softIds:Seq[SoftwareUuid], salt:String="", tabContainer : Option[String] = None):JsCmd = {
+ val jsId = JsNodeId(nodeId,salt)
+ val detailsId = htmlId(jsId,"details_")
val softGridDataId = htmlId(jsId,"soft_grid_data_")
- val softGridId = htmlId(jsId,"soft_grid_")
- val softPanelId = htmlId(jsId,"sd_soft_")
- val eltIds = List("fs", "net","bios", "controllers", "memories", "ports", "processors", "slots", "sounds", "storages", "videos").
+ val softGridId = htmlId(jsId,"soft_grid_")
+ val softPanelId = htmlId(jsId,"sd_soft_")
+ var eltIdswidth = List( ("process",List("50","50","50","60","50","50","100","850")),("var",List("200","800"))).map(x => (htmlId(jsId, x._1+ "_grid_"),x._2.map("""{"sWidth": "%spx"}""".format(_))))
+ val eltIds = List( "vm", "fs", "net","bios", "controllers", "memories", "ports", "processors", "slots", "sounds", "storages", "videos").
map(x => htmlId(jsId, x+ "_grid_"))
- JsRaw("var "+softGridDataId +"= null") &
+ JsRaw("var "+softGridDataId +"= null") &
OnLoad(
- JsRaw("$('#"+detailsId+"').tabs()") &
- { eltIds.map { i =>
- JsRaw("""$('#%s').dataTable({"bJQueryUI": false,"bFilter": false,"asStripClasses": [ 'color1', 'color2' ],"bPaginate": false, "bInfo":false});
- | """.stripMargin('|').format(i,i)):JsCmd
+ JsRaw("$('#"+detailsId+"').tabs()") &
+ { eltIds.map { i =>
+ JsRaw("""$('#%s').dataTable({"bJQueryUI": false,"bRetrieve": true,"bFilter": false,"asStripClasses": [ 'color1', 'color2' ],"bPaginate": false, "bAutoWidth": false, "bInfo":false});moveFilterAndPaginateArea('#%s');
+ | """.stripMargin('|').format(i,i)):JsCmd
}.reduceLeft( (i,acc) => acc & i )
} &
+ { eltIdswidth.map { i =>
+ JsRaw("""$('#%s').dataTable({"bJQueryUI": false,"bRetrieve": true,"bFilter": true,"asStripClasses": [ 'color1', 'color2' ],"bPaginate": true,"aoColumns": %s ,"bLengthChange": false, "bAutoWidth": false, "bInfo":true});moveFilterAndPaginateArea('#%s');
+ | """.stripMargin('|').format(i._1,i._2.mkString("[",",","]"),i._1)):JsCmd
+ }
+ } &
JsRaw("roundTabs()") &
// for the software tab, we check for the panel id, and the firstChild id
// if the firstChild.id == softGridId, then it hasn't been loaded, otherwise it is softGridId_wrapper
JsRaw("""
- | $("#%s").bind( "tabsshow", function(event, ui) {
- | if(ui.panel.id== '%s' && ui.panel.firstChild.id == '%s') { %s; }
- | });
- """.stripMargin('|').format(tabContainer.getOrElse(detailsId),
- softPanelId,softGridId,
+| $("#%s").bind( "tabsshow", function(event, ui) {
+| if(ui.panel.id== '%s' && ui.panel.firstChild.id == '%s') { %s; }
+| });
+""".stripMargin('|').format(tabContainer.getOrElse(detailsId),
+ softPanelId,softGridId,
SHtml.ajaxCall(JsRaw("'"+nodeId.value+"'"), loadSoftware(jsId, softIds) )._2.toJsCmd)
)
)
@@ -160,10 +166,10 @@ object DisplayNode extends Loggable {
def show(sm:FullInventory, showExtraFields : Boolean = true, salt:String = "") : NodeSeq = {
val jsId = JsNodeId(sm.node.main.id,salt)
val mainTabDeclaration : List[NodeSeq] =
- { if (showExtraFields) <li><a href={htmlId_#(jsId,"sd_fs_")}>File systems</a></li> else NodeSeq.Empty } ::
+ /* { if (showExtraFields) <li><a href={htmlId_#(jsId,"sd_fs_")}>File systems</a></li> else NodeSeq.Empty } ::
{ if (showExtraFields) <li><a href={htmlId_#(jsId,"sd_net_")}>Network interfaces</a></li> else NodeSeq.Empty } ::
{ if (showExtraFields) <li><a href={htmlId_#(jsId,"sd_soft_")}>Software</a></li> else NodeSeq.Empty } ::
- //
+ */
<li><a href={htmlId_#(jsId,"sd_bios_")}>Bios</a></li> ::
<li><a href={htmlId_#(jsId,"sd_controllers_")}>Controllers</a></li> ::
<li><a href={htmlId_#(jsId,"sd_memories_")}>Memories</a></li> ::
@@ -198,25 +204,32 @@ object DisplayNode extends Loggable {
}
/**
- * show the extra tabs header part
- */
- def showExtraHeader(sm:FullInventory, salt:String = "") : NodeSeq = {
+ * show the extra tabs header part
+ */
+ def showExtraHeader(sm:FullInventory, salt:String = "") : NodeSeq = {
val jsId = JsNodeId(sm.node.main.id,salt)
<xml:group>
<li><a href={htmlId_#(jsId,"sd_fs_")}>File systems</a></li>
<li><a href={htmlId_#(jsId,"sd_net_")}>Network interfaces</a></li>
<li><a href={htmlId_#(jsId,"sd_soft_")}>Software</a></li>
+ <li><a href={htmlId_#(jsId,"sd_var_")}>Environment Variable</a></li>
+ <li><a href={htmlId_#(jsId,"sd_process_")}>Processes</a></li>
+ <li><a href={htmlId_#(jsId,"sd_vm_")}>VIrtual Machines</a></li>
</xml:group>
}
/**
- * show the extra part
- */
+ * show the extra part
+ */
def showExtraContent(sm:FullInventory, salt:String = "") : NodeSeq = {
val jsId = JsNodeId(sm.node.main.id,salt)
displayTabFilesystems(jsId, sm) ++
displayTabNetworks(jsId, sm) ++
+ displayTabVariable(jsId, sm) ++
+ displayTabProcess(jsId, sm) ++
+ displayTabVM(jsId, sm) ++
displayTabSoftware(jsId)
+
}
/**
@@ -279,7 +292,7 @@ object DisplayNode extends Loggable {
<h4 class="tablemargin">Rudder information</h4>
<div class="tablepadding">
- <b>Agent name:</b> {sm.node.agentNames.map(_.toString).mkString(";")}<br/>
+ <b>Agent name:</b> {sm.node.agentNames.map(_.fullname()).mkString(";")}<br/>
<b>Rudder ID:</b> {sm.node.main.id.value}<br/>
<b>Date inventory last received:</b> {sm.node.inventoryDate.map(DateFormaterService.getFormatedDate(_)).getOrElse("Unknown")}<br/>
{creationDate.map { creation =>
@@ -340,14 +353,6 @@ object DisplayNode extends Loggable {
}
//show a comma separated list with description in tooltip
- private def displayPolicies(node:NodeInventory) : NodeSeq = {
- <b>Applied Directives: </b> ++ {Text{if(node.techniques.isEmpty) {
- "None"
- } else {
- node.techniques.mkString(", ")
- }}
- }
- }
private def displayAccounts(node:NodeInventory) : NodeSeq = {
Text{if(node.accounts.isEmpty) {
@@ -419,6 +424,39 @@ object DisplayNode extends Loggable {
("File count", {x:FileSystem => ?(x.fileCount.map(_.toString))}) ::
Nil
}
+
+ private def displayTabVariable(jsId:JsNodeId,sm:FullInventory) : NodeSeq =
+ displayTabGrid(jsId)("var", Full(sm.node.environmentVariables)){
+ ("Name", {x:EnvironmentVariable => Text(x.name)}) ::
+ ("Value", {x:EnvironmentVariable => Text(x.value.getOrElse("Unspecified"))}) ::
+ Nil
+ }
+
+ private def displayTabProcess(jsId:JsNodeId,sm:FullInventory) : NodeSeq =
+ displayTabGrid(jsId)("process", Full(sm.node.processes)){
+ ("User", {x:Process => ?(x.user)}) ::
+ ("PID", {x:Process => Text(x.pid.toString())}) ::
+ ("% CPU", {x:Process => ?(x.cpuUsage.map(_.toString()))}) ::
+ ("% Memory", {x:Process => ?(x.memory.map(_.toString()))}) ::
+ ("Virtual Memory", {x:Process => ?(x.virtualMemory.map(_.toString()))}) ::
+ ("TTY", {x:Process => ?(x.tty)}) ::
+ ("Started on", {x:Process => ?(x.started.map(DateFormaterService.getFormatedDate(_)).orElse(Some("Bad format")))}) ::
+ ("Command", { x:Process => ?(x.commandName) }) ::
+ Nil
+ }
+
+ private def displayTabVM(jsId:JsNodeId,sm:FullInventory) : NodeSeq =
+ displayTabGrid(jsId)("vm", Full(sm.node.vms)){
+ ("Name", {x:VirtualMachine => ?(x.name)}) ::
+ ("Type", {x:VirtualMachine => ?(x.vmtype)}) ::
+ ("SubSystem", {x:VirtualMachine => ?(x.subsystem)}) ::
+ ("UUID", {x:VirtualMachine => Text(x.uuid.value)}) ::
+ ("Status", {x:VirtualMachine => ?(x.status)}) ::
+ ("Owner", {x:VirtualMachine => ?(x.owner)}) ::
+ ("CPUs", {x:VirtualMachine => ?(x.vcpu.map(_.toString()))}) ::
+ ("Memory", { x:VirtualMachine => ?(x.memory) }) ::
+ Nil
+ }
private def displayTabBios(jsId:JsNodeId,sm:FullInventory) : NodeSeq =
displayTabGrid(jsId)("bios", sm.machine.map(fm => fm.bios)){
@@ -459,15 +497,20 @@ object DisplayNode extends Loggable {
Nil
}
- private def displayTabProcessors(jsId:JsNodeId,sm:FullInventory) : NodeSeq =
+ private def displayTabProcessors(jsId:JsNodeId,sm:FullInventory) : NodeSeq =
displayTabGrid(jsId)("processors", sm.machine.map(fm => fm.processors)){
("Name", {x:Processor => Text(x.name)}) ::
- ("Speed", {x:Processor => ?(x.speed.map(_.toString))}) ::
- ("Model", {x:Processor => ?(x.model)}) ::
- ("Family", {x:Processor => ?(x.family)}) ::
- ("Manufacturer", {x:Processor => ?(x.manufacturer.map(_.name))}) ::
- ("Stepping", {x:Processor => ?(x.stepping.map(_.toString))}) ::
- ("Quantity", {x:Processor => Text(x.quantity.toString)}) ::
+ ("Speed", {x:Processor => ?(x.speed.map(_.toString))}) ::
+ ("Model", {x:Processor => ?(x.model.map(_.toString()))}) ::
+ ("Family", {x:Processor => ?(x.family.map(_.toString()))}) ::
+ ("Family Name", {x:Processor => ?(x.familyName)}) ::
+ ("Manufacturer", {x:Processor => ?(x.manufacturer.map(_.name))}) ::
+ ("Thread", {x:Processor => ?(x.thread.map(_.toString()))}) ::
+ ("Core", {x:Processor => ?(x.core.map(_.toString()))}) ::
+ ("CPUID", {x:Processor => ?(x.cpuid)}) ::
+ ("Architecture", {x:Processor => ?(x.arch)}) ::
+ ("Stepping", {x:Processor => ?(x.stepping.map(_.toString))}) ::
+ ("Quantity", {x:Processor => Text(x.quantity.toString)}) ::
Nil
}
Please sign in to comment.
Something went wrong with that request. Please try again.