13373-Create ad view in Monitoring->Views->Agent details->Pandora RC

This commit is contained in:
Pablo Aragon 2024-05-08 10:49:25 +02:00
parent 25d17fb990
commit 76ba7aed8a
13 changed files with 1056 additions and 11 deletions

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 478 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 13 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 558 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 350 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 1.0 MiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 49 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 111 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 525 KiB

View File

@ -0,0 +1,130 @@
/**
*
* Name: Pandora RC styles
*
* @category Stylesheet
* @package Pandora FMS
* @subpackage Community
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2023 Pandora FMS
* Please see https://pandorafms.com for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
div#main {
margin-bottom: 25px;
}
.rc-ad-view-main {
width: 100%;
/* height: calc(100vh - 158px); */
box-sizing: border-box;
padding: 63px 125px;
border: 1px solid var(--border-color-4);
border-radius: 25px;
background-color: var(--secondary-color);
background-image: url(../../images/ehorus/ad/background.svg);
background-repeat: no-repeat;
background-size: contain;
background-position-x: center;
}
.rc-ad-view-first-row {
width: 100%;
height: 255px;
display: flex;
flex-direction: row;
flex-wrap: nowrap;
justify-content: space-between;
align-items: center;
gap: 60px;
}
.rc-ad-view-first-row > div {
width: 450px;
height: 100%;
color: var(--text-color-2);
font-family: "lato-bold";
font-size: 40px;
line-height: 48px;
display: flex;
flex-direction: column;
flex-wrap: nowrap;
justify-content: space-between;
}
.rc-ad-view-first-row > div * {
background-color: var(--pandora-rc-color);
width: 221px;
height: 42px;
border: 0;
border-radius: 8px;
font-family: "lato-bold";
font-size: 15px;
line-height: 20px;
text-align: center;
cursor: pointer;
}
.rc-ad-view-first-row > div button:hover {
opacity: 0.9;
}
.rc-ad-view-first-row > img {
width: calc(100% - 480px);
max-height: 255px;
}
.rc-ad-view-main > p {
margin-top: 60px;
color: var(--text-color-3);
font-size: 18px;
line-height: 22px;
}
.rc-ad-view-second-row {
display: flex;
flex-direction: row;
flex-wrap: nowrap;
align-items: flex-start;
gap: 20px;
}
.rc-ad-view-second-row > div {
display: flex;
flex-direction: column;
flex-wrap: nowrap;
align-items: center;
border: 1px solid var(--border-color-4);
border-radius: 10px;
padding: 20px;
width: calc((100% - 100px) / 5);
}
.rc-ad-view-second-row > div > img {
max-width: 100%;
}
.rc-ad-view-second-row > div > span {
margin-top: 20px;
color: var(--text-color-2);
font-family: "lato-bold";
font-size: 20px;
line-height: 24px;
text-align: center;
}

View File

@ -31,6 +31,7 @@
--primary-color: #14524f;
--primary-color-hover: #318280;
--secondary-color: #ffffff;
--pandora-rc-color: #34cc9d;
--text-color: #333;
--text-color-2: #161628;

View File

@ -2132,3 +2132,14 @@ select option:checked {
.content-widget .flot-base {
background-color: unset;
}
div.rc-ad-view-main {
background-image: url(../../images/ehorus/ad/background-dark.svg);
background-size: cover;
border: 0;
}
div.rc-ad-view-second-row > div {
border: 0;
background-color: #525282;
}

View File

@ -16,7 +16,10 @@
// Load global vars
global $config;
ui_require_css_file('pandora-rc', 'include/styles/');
if (!$config['ehorus_enabled']) {
echo rc_ad_view();
return;
}
@ -214,6 +217,58 @@ $query_data = [
$query = http_build_query($query_data);
$client_url = $config['homeurl'].'operation/agentes/ehorus_client.php?'.$query;
function rc_ad_view()
{
$title = __('Forget about distances').':';
$title2 = __('operate up to 5 devices for free, as if they were at your side!');
$onclick = 'onclick="window.location.href=\'index.php?sec=gsetup&sec2=godmode/setup/setup&section=pandorarc\'"';
$output = '
<div class="rc-ad-view-main">
<div class="rc-ad-view-first-row">
<div>
'.$title.'<br>'.$title2.'
<button '.$onclick.'>'.__('Enable Pandora RC for free').'</button>
</div>
'.html_print_image('images/ehorus/ad/sample.svg', true).'
</div>
<p>'.__('Pandora RC is not currently enabled, heres what your missing out').':</p>
<div class="rc-ad-view-second-row">
<div>
'.html_print_image('images/ehorus/ad/desktop.svg', true).'
<span>'.__('Remote access to the servers Desktop').'.</span>
</div>
<div>
'.html_print_image('images/ehorus/ad/cli.svg', true).'
<span>'.__('Run commands directly with native CLI').'.</span>
</div>
<div>
'.html_print_image('images/ehorus/ad/files.svg', true).'
<span>'.__('Upload and manage your files').'.</span>
</div>
<div>
'.html_print_image('images/ehorus/ad/multiplatform.svg', true).'
<span>'.__('Compatible with all major OS platforms').'.</span>
</div>
<div>
'.html_print_image('images/ehorus/ad/process-services.svg', true).'
<span>'.__('Manage all your processes and services').'.</span>
</div>
</div>
</div>
';
return $output;
}
?>
<script type="text/javascript">

View File

@ -1812,6 +1812,17 @@ if (enterprise_installed() === true && (bool) $config['log_collector'] === true)
}
// EHorus tab.
$tab_url = 'index.php?sec=estado&sec2=operation/agentes/ver_agente&tab=ehorus&id_agente='.$id_agente;
$ehorus_tab['text'] = '<a href="'.$tab_url.'" class="ehorus_tab">'.html_print_image(
'images/RC.png',
true,
[
'title' => __('Pandora RC'),
'class' => 'invert_filter',
]
).'</a>';
$ehorus_tab['active'] = $tab == 'ehorus';
if ((bool) $config['ehorus_enabled'] === true && empty($config['ehorus_custom_field'] === false)
&& (check_acl_one_of_groups(
$config['id_user'],
@ -1824,16 +1835,8 @@ if ((bool) $config['ehorus_enabled'] === true && empty($config['ehorus_custom_fi
// If ehorus user configuration is enabled, and userr acces level is disabled do not show eHorus tab.
} else {
$ehorus_agent_id = agents_get_agent_custom_field($id_agente, $config['ehorus_custom_field']);
if (empty($ehorus_agent_id) === false) {
$tab_url = 'index.php?sec=estado&sec2=operation/agentes/ver_agente&tab=ehorus&id_agente='.$id_agente;
$ehorus_tab['text'] = '<a href="'.$tab_url.'" class="ehorus_tab">'.html_print_image(
'images/RC.png',
true,
[
'title' => __('Pandora RC'),
'class' => 'invert_filter',
]
).'</a>';
$menu_tab_url = '<a href="index.php?sec=estado&sec2=operation/agentes/ver_agente&tab=ehorus&id_agente='.$id_agente.'">'.__('Pandora RC').'</a>';
array_push($menu_tabs, $menu_tab_url);
@ -1895,8 +1898,6 @@ if ((bool) $config['ehorus_enabled'] === true && empty($config['ehorus_custom_fi
$ehorus_tab['sub_menu'] .= '</li>';
$ehorus_tab['sub_menu'] .= '</a>';
$ehorus_tab['sub_menu'] .= '</ul>';
$ehorus_tab['active'] = $tab == 'ehorus';
}
}
}