Skip to content

Commit

Permalink
Work in progress
Browse files Browse the repository at this point in the history
  • Loading branch information
RaphaelGauthier committed Mar 8, 2017
1 parent fa0d4b9 commit dff784c
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -175,15 +175,31 @@ object DisplayDirectiveTree extends Loggable {
)
}
}

def isDeprecated = {
activeTechnique.techniques.values.forall { t => t.deprecrationInfo.isDefined }
}
def deprecatedIcon = {
if(isDeprecated){
<span class="fa fa-info-circle icon-info"></span>
}else{
NodeSeq.Empty
}
}
def deprecatedInfo = {
if(isDeprecated){
<div class="deprecated-info">{deprecatedIcon}All versions of this technique are deprecated.</div>
}else{
NodeSeq.Empty
}
}
override def body = {
val tooltipId = Helpers.nextFuncName

//display information (name, etc) relative to last technique version

val xml = activeTechnique.newestAvailableTechnique match {
case Some(technique) =>
<span class="treeActiveTechniqueName tooltipable" tooltipid={tooltipId} title="">{technique.name}
<span class="treeActiveTechniqueName tooltipable" tooltipid={tooltipId} title="">
{technique.name}
</span>
<div class="tooltipContent" id={tooltipId}>
<h3>{technique.name}</h3>
Expand Down Expand Up @@ -244,7 +260,7 @@ object DisplayDirectiveTree extends Loggable {
val deprecated = technique.flatMap(_.deprecrationInfo) match {
case Some(info) =>
val tooltipId = Helpers.nextFuncName
<span class="fa fa-exclamation text-danger deprecatedTechniqueIcon tooltipable" style="padding-left:5px" tooltipid={tooltipId} title=""></span>
<img src="/images/f.svg" class="deprecation-icon" tooltipid={tooltipId} title=""/>
<div class="tooltipContent" id={tooltipId}>
<div>Deprecated: {info.message}</div>
</div>
Expand All @@ -264,15 +280,15 @@ object DisplayDirectiveTree extends Loggable {
}

val tooltipId = Helpers.nextFuncName
<span class="treeDirective tooltipable" tooltipid={tooltipId} title="" ><span id={"badge-apm-"+tooltipId}>[BADGE]</span>[{directive.techniqueVersion.toString}] {directive.name}
{

if(isAssignedTo <= 0) {
<span style="padding-left:5px" class="fa fa-warning text-warning-rudder"></span>
} else {
NodeSeq.Empty
}
}
<span class="treeDirective tooltipable" tooltipid={tooltipId} title="" >
<span id={"badge-apm-"+tooltipId}>[BADGE]</span>
[{directive.techniqueVersion.toString}]
{directive.name}
{if(isAssignedTo <= 0) {
<span style="padding-left:5px" class="fa fa-warning text-warning-rudder"></span>
} else {
NodeSeq.Empty
}}
</span> ++
Script(JsRaw(s"""$$('#badge-apm-${tooltipId}').replaceWith(createBadgeAgentPolicyMode('directive',"${policyMode}", "${explanation.toString()}"))""")) ++
deprecated ++
Expand All @@ -282,7 +298,7 @@ object DisplayDirectiveTree extends Loggable {
<div>{directive.shortDescription}</div>
<div>Technique version: {directive.techniqueVersion.toString}</div>
<div>{s"Used in ${isAssignedTo} rules" }</div>
{ if(!directive.isEnabled) <div>Disable</div> }
{if(!directive.isEnabled) <div>Disable</div>}
</div>

}
Expand Down
15 changes: 14 additions & 1 deletion rudder-web/src/main/webapp/style/rudder/rudder-directives.css
Original file line number Diff line number Diff line change
Expand Up @@ -116,5 +116,18 @@
padding:0 0 0 15px;
}
.version-group select.form-control{
margin-right:5px;
margin-right:5px;
}

.deprecated-info{
margin-top:5px;
color: #337ab7;
}
.deprecated-info .icon-info{
margin-left:3px;
}
.deprecation-icon{
height:14px;
position:relative;
top:-2px;
}
5 changes: 4 additions & 1 deletion rudder-web/src/main/webapp/style/rudder/rudder-menu.css
Original file line number Diff line number Diff line change
Expand Up @@ -1149,6 +1149,9 @@ table > tbody > tr > td.action{
.ui-widget.ui-tooltip li b{
color : #f08004;
}
.text-grey-rudder{
color:#555;
}
.text-warning-rudder{
color: #f08004;
}
Expand Down Expand Up @@ -1376,7 +1379,7 @@ form .tooltip-content p {
float: left;
font-family: Verdana,Arial,sans-serif;
}
.tw-bs label > .icon-info{
.icon-info{
margin-left: 5px;
color: #337ab7;
cursor:help;
Expand Down

0 comments on commit dff784c

Please sign in to comment.