Fix custom welcome for ODFE 1.10.1

This commit is contained in:
Manuel Gutierrez
2020-10-02 17:09:11 +02:00
parent 9c94c43d65
commit cc20d98ae5
4 changed files with 4368 additions and 137 deletions
File diff suppressed because it is too large Load Diff
@@ -1,118 +0,0 @@
#security-login-app .content {
background: url(./wazuh_wazuh_bg.svg) !important;
width: 100% !important;
height: 100% !important;
background-size: cover !important;
}
.app-wrapper {
left: 0;
}
.global-nav.is-global-nav-open+.app-wrapper {
left: 0;
}
.btn-default {
background-color: #00a9e5!important;
border-color: #00a0e5!important;
color: #ffffff;
padding: 8px;
}
.btn-default:hover {
background-color: #00a9e5!important;
border-color: #00a0e5!important;
color: #ffffff;
}
.brand-image-container {
text-align: center;
}
.brand-image {
display: none;
}
.login-wrapper {
position: absolute;
width: 430px;
top: 55px;
border-radius: 1px;
padding: 1em;
}
.login-wrapper .login-title {
text-align: center;
padding-bottom: 10px;
color: #ffffff !important;
font-size: 35px !important;
font-weight: 300;
}
.login-wrapper .login-subtitle {
text-align: center;
padding-bottom: 15px;
color: #ffffff !important;
font-size: 16px !important;
}
.login-wrapper .login-form {
padding: 16px;
box-shadow: 0 2px 2px -1px rgba(152, 162, 179, 0.3), 0 1px 5px -2px rgba(152, 162, 179, 0.3);
background-color: #FFF;
border: 1px solid #D3DAE6;
border-radius: 4px;
-webkit-box-flex: 1;
-ms-flex-positive: 1;
flex-grow: 1;
margin-top: 32px;
}
.login-wrapper .login-form .input-group {
margin-bottom: 1em;
}
.login-wrapper .login-form .kuiTextInput {
cursor: initial;
}
.login-wrapper .login-form .kuiTextInput:invalid:not(.ng-touched) {
border-color: #D9D9D9;
}
.login-wrapper .login-form .kuiTextInput.has-error {
border-color: #A30000;
}
.login-wrapper .login-form .btn-login {
width: 100%;
}
.login-wrapper .error-message {
color: #b4251d;
font-size: 14px;
margin-top: 16px;
margin-bottom: 0;
background-color: #f8e9e9;
padding: 8px;
font-weight: 400;
border-left: 2px solid #BD271E;
}
.loginWelcome__logo {
display: inline-block;
width: 80px;
height: 80px;
line-height: 80px;
text-align: center;
background-color: #FFF;
border-radius: 100%;
padding: 16px;
box-shadow: 0 6px 12px -1px rgba(152, 162, 179, 0.2), 0 4px 4px -1px rgba(152, 162, 179, 0.2), 0 2px 2px 0 rgba(152, 162, 179, 0.2);
margin-bottom: 32px;
}
.loginWelcome__logo {
background: url(./wazuh_logo_circle.svg) center center no-repeat !important;
}
@@ -1,7 +1,8 @@
var kbnCsp = JSON.parse(document.querySelector('kbn-csp').getAttribute('data'));
window.__kbnStrictCsp__ = kbnCsp.strictCsp;
window.__kbnDarkMode__ = {{darkMode}};
window.__kbnThemeTag__ = "{{themeTag}}";
window.__kbnPublicPath__ = {{publicPathMap}};
window.__kbnBundles__ = {{kbnBundlesLoaderSource}}
if (window.__kbnStrictCsp__ && window.__kbnCspNotEnforced__) {
var legacyBrowserError = document.getElementById('kbn_legacy_browser_error');
@@ -14,20 +15,24 @@ if (window.__kbnStrictCsp__ && window.__kbnCspNotEnforced__) {
loadingMessage.style.display = 'flex';
window.onload = function () {
//WAZUH
//WAZUH
var interval = setInterval(() => {
var title = document.getElementsByClassName('login-title');
if ((title || []).length) {
var title = document.querySelector("#kibana-body > div > div.app-wrapper.hidden-chrome > div > div.application > div > ul > div.euiText.euiText--medium > div")
if (!!title) {
clearInterval(interval);
title[0].textContent = "Welcome to Wazuh";
var subtitle = document.getElementsByClassName('login-subtitle');
subtitle[0].textContent = "The Open Source Security Platform";
var logo = document.getElementsByClassName('brand-image-container');
$(logo).append('<span class="loginWelcome__logo"></span>');
var content = document.querySelector("#kibana-body > div");
content.classList.add("wz-login")
title.textContent = "Welcome to Wazuh";
var subtitle = document.querySelector("#kibana-body > div > div.app-wrapper.hidden-chrome > div > div.application > div > ul > div.euiText.euiText--small > div")
subtitle.textContent = "The Open Source Security Platform";
var logo = document.querySelector("#kibana-body > div > div.app-wrapper.hidden-chrome > div > div.application > div > ul > figure");
logo.remove();
var logoContainer = document.querySelector("#kibana-body > div > div.app-wrapper.hidden-chrome > div > div.application > div > ul");
$(logoContainer).prepend('<span class="loginWelcome__logo"></span>');
}
})
//
function failure() {
// make subsequent calls to failure() noop
failure = function () {};
@@ -43,7 +48,7 @@ if (window.__kbnStrictCsp__ && window.__kbnCspNotEnforced__) {
document.body.innerHTML = err.outerHTML;
}
var stylesheetTarget = document.querySelector('head meta[name="add-styles-here"]')
var stylesheetTarget = document.querySelector('head meta[name="add-styles-here"]')
function loadStyleSheet(url, cb) {
var dom = document.createElement('link');
dom.rel = 'stylesheet';
@@ -91,12 +96,7 @@ var stylesheetTarget = document.querySelector('head meta[name="add-styles-here"]
{{/each}}
], function () {
{{#unless legacyBundlePath}}
if (!__kbnBundles__ || !__kbnBundles__['entry/core'] || typeof __kbnBundles__['entry/core'].__kbnBootstrap__ !== 'function') {
console.error('entry/core bundle did not load correctly');
failure();
} else {
__kbnBundles__['entry/core'].__kbnBootstrap__()
}
__kbnBundles__.get('entry/core/public').__kbnBootstrap__();
{{/unless}}
load([
@@ -109,4 +109,4 @@ var stylesheetTarget = document.querySelector('head meta[name="add-styles-here"]
]);
});
}
}
}
+1 -1
View File
@@ -8,7 +8,7 @@ then
echo "Set custom welcome styles"
cp -f /tmp/custom_welcome/template.js.hbs /usr/share/kibana/src/legacy/ui/ui_render/bootstrap/template.js.hbs
cp -f /tmp/custom_welcome/security-login.style.css /usr/share/kibana/optimize/bundles/security-login.style.css
cp -f /tmp/custom_welcome/light_theme.style.css /usr/share/kibana/optimize/bundles/light_theme.style.css
cp -f /tmp/custom_welcome/*svg /usr/share/kibana/optimize/bundles/
fi