Add custom welcome

This commit is contained in:
Manuel Gutierrez
2020-08-19 16:19:49 +02:00
parent 746cffc549
commit 9547305061
4 changed files with 232 additions and 0 deletions

View File

@@ -0,0 +1,118 @@
#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;
}

View File

@@ -0,0 +1,112 @@
var kbnCsp = JSON.parse(document.querySelector('kbn-csp').getAttribute('data'));
window.__kbnStrictCsp__ = kbnCsp.strictCsp;
window.__kbnDarkMode__ = {{darkMode}};
window.__kbnPublicPath__ = {{publicPathMap}};
if (window.__kbnStrictCsp__ && window.__kbnCspNotEnforced__) {
var legacyBrowserError = document.getElementById('kbn_legacy_browser_error');
legacyBrowserError.style.display = 'flex';
} else {
if (!window.__kbnCspNotEnforced__ && window.console) {
window.console.log("^ A single error about an inline script not firing due to content security policy is expected!");
}
var loadingMessage = document.getElementById('kbn_loading_message');
loadingMessage.style.display = 'flex';
window.onload = function () {
//WAZUH
var interval = setInterval(() => {
var title = document.getElementsByClassName('login-title');
if ((title || []).length) {
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>');
}
})
//
function failure() {
// make subsequent calls to failure() noop
failure = function () {};
var err = document.createElement('h1');
err.style['color'] = 'white';
err.style['font-family'] = 'monospace';
err.style['text-align'] = 'center';
err.style['background'] = '#F44336';
err.style['padding'] = '25px';
err.innerText = document.querySelector('[data-error-message]').dataset.errorMessage;
document.body.innerHTML = err.outerHTML;
}
var stylesheetTarget = document.querySelector('head meta[name="add-styles-here"]')
function loadStyleSheet(url, cb) {
var dom = document.createElement('link');
dom.rel = 'stylesheet';
dom.type = 'text/css';
dom.href = url;
dom.addEventListener('error', failure);
dom.addEventListener('load', cb);
document.head.insertBefore(dom, stylesheetTarget);
}
var scriptsTarget = document.querySelector('head meta[name="add-scripts-here"]')
function loadScript(url, cb) {
var dom = document.createElement('script');
{{!-- NOTE: async = false is used to trigger async-download/ordered-execution as outlined here: https://www.html5rocks.com/en/tutorials/speed/script-loading/ --}}
dom.async = false;
dom.src = url;
dom.addEventListener('error', failure);
dom.addEventListener('load', cb);
document.head.insertBefore(dom, scriptsTarget);
}
function load(urls, cb) {
var pending = urls.length;
urls.forEach(function (url) {
var innerCb = function () {
pending = pending - 1;
if (pending === 0 && typeof cb === 'function') {
cb();
}
}
if (typeof url !== 'string') {
load(url, innerCb);
} else if (url.slice(-4) === '.css') {
loadStyleSheet(url, innerCb);
} else {
loadScript(url, innerCb);
}
});
}
load([
{{#each jsDependencyPaths}}
'{{this}}',
{{/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__()
}
{{/unless}}
load([
{{#if legacyBundlePath}}
'{{legacyBundlePath}}',
{{/if}}
{{#each styleSheetPaths}}
'{{this}}',
{{/each}}
]);
});
}
}

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 84.67 84.67"><defs><style>.a{fill:#fff;}.b{fill:#00a9e5;}</style></defs><title>wazuh_logo_circle</title><circle class="a" cx="42.34" cy="42.34" r="42.34"/><path class="b" d="M58.13,9.2,50,26.32H35.07L26.16,9.2,20,31l-8.53,9.72,19.18,17.6,7.47,17.21h8.53l7-16.91L73.24,40.83l-8.73-9.57ZM48.58,55.13a1.79,1.79,0,0,1-.74.62,2.49,2.49,0,0,1-1,.2,2.52,2.52,0,0,1-1-.2,1.84,1.84,0,0,1-.71-.62l-2.88-4.36-2.9,4.36a1.87,1.87,0,0,1-.72.62,2.48,2.48,0,0,1-.95.2,1.94,1.94,0,0,1-1.7-.82L21.3,41.37h4.09L37.87,52.3l2.49-3.89h3.93L47,52.3,59.63,40.9h3.74Z"/></svg>

After

Width:  |  Height:  |  Size: 604 B

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 32 KiB