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
2 changed files
with
119 additions
and
0 deletions.
There are no files selected for viewing
50 changes: 50 additions & 0 deletions
50
hawtio-web/src/main/webapp/app/branding/js/brandingPlugin.ts
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,50 @@ | ||
module Branding { | ||
|
||
export var pluginName = 'hawtio-branding'; | ||
|
||
export var propertiesToCheck = ['karaf.version']; | ||
export var wantedStrings = ['redhat', 'fuse']; | ||
|
||
angular.module(pluginName, ['hawtioCore']). | ||
run((jolokia) => { | ||
|
||
jolokia.request({ | ||
type: 'read', | ||
mbean: 'java.lang:type=Runtime', | ||
attribute: 'SystemProperties' | ||
}, { | ||
success: (response) => { | ||
|
||
var found = false; | ||
|
||
var property = propertiesToCheck.find((property) => { return response.value[property]; }); | ||
|
||
if (property) { | ||
var found = wantedStrings.any((item) => { | ||
return response.value[property].has(item); | ||
}) | ||
} | ||
|
||
if (found) { | ||
console.log("enabling branding"); | ||
var link = $("<link>"); | ||
$("head").append(link); | ||
|
||
link.attr({ | ||
rel: 'stylesheet', | ||
type: 'text/css', | ||
href: 'css/site-branding.css' | ||
}); | ||
|
||
} else { | ||
console.log("not enabling branding"); | ||
} | ||
|
||
|
||
} | ||
}); | ||
}); | ||
|
||
hawtioPluginLoader.addModule(pluginName); | ||
|
||
} |
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,69 @@ | ||
#main-nav .navbar-inner { | ||
background-color: #3e4d60; | ||
background-image: none; | ||
border-top: 3px solid #d30c10; | ||
border-bottom: 1px solid #52575C; | ||
} | ||
|
||
#main-nav .navbar-inner .container .brand { | ||
display: block !important; | ||
color: #ffffff; | ||
text-shadow: none; | ||
} | ||
|
||
#main-nav .navbar-inner .container div .nav li a { | ||
color: #ffffff; | ||
text-shadow: none; | ||
} | ||
|
||
#main-nav .navbar-inner .container div .nav li.active a { | ||
color: #ffffff; | ||
text-shadow: none; | ||
background-color: #676D71; | ||
} | ||
|
||
#main.container-fluid { | ||
padding-left: 0px; | ||
padding-right: 0px; | ||
} | ||
|
||
#main.container-fluid div .nav { | ||
border-radius: 0; | ||
line-height: 18px; | ||
padding-left: 5px; | ||
padding-right: 5px; | ||
} | ||
|
||
#main.container-fluid div .nav li { | ||
margin-bottom: 0px; | ||
margin-top: 0px; | ||
} | ||
|
||
#main.container-fluid div .nav li a { | ||
padding-top: 8px; | ||
border-radius: 0; | ||
} | ||
|
||
#main.container-fluid div .nav li a:hover { | ||
padding-top: 8px; | ||
border-radius: 0; | ||
} | ||
|
||
#main.container-fluid div .nav li.active a { | ||
border-radius: 0; | ||
background-color: inherit; | ||
background-image: none; | ||
color: #15B5D9; | ||
box-shadow: none; | ||
border-bottom: 2px solid #15B5D9; | ||
} | ||
|
||
#main.container-fluid div .nav li.active a:hover { | ||
padding-top: 8px; | ||
border-radius: 0; | ||
background-color: inherit; | ||
background-image: none; | ||
color: #15B5D9; | ||
box-shadow: none; | ||
border-bottom: 2px solid #15B5D9; | ||
} |