diff --git a/pandora_console/include/constants.php b/pandora_console/include/constants.php
index 1d11aad151..54325f28e0 100644
--- a/pandora_console/include/constants.php
+++ b/pandora_console/include/constants.php
@@ -813,6 +813,7 @@ define('AUDIT_LOG_SERVICE_MANAGEMENT', 'Service management');
define('AUDIT_LOG_INCIDENT_MANAGEMENT', 'Incident management');
define('AUDIT_LOG_UMC', 'Warp Manager');
define('AUDIT_LOG_NMS_VIOLATION', 'NMS Violation');
+define('AUDIT_LOG_ENTERPRISE_VIOLATION', 'Enterprise Violation');
// MIMEs.
define(
diff --git a/pandora_console/mobile/include/style/main.css b/pandora_console/mobile/include/style/main.css
index e2d6c868ab..c373aa8d22 100755
--- a/pandora_console/mobile/include/style/main.css
+++ b/pandora_console/mobile/include/style/main.css
@@ -892,14 +892,16 @@ table.event_details td.cell_event_name {
font-size: 12px !important;
}
- table#list_servers tr {
+ table#list_servers tr,
+ table[id^="service-table-"] tr {
display: flex;
flex-direction: row;
flex-wrap: nowrap;
align-items: center;
}
- table#list_servers b.ui-table-cell-label {
+ table#list_servers b.ui-table-cell-label,
+ table[id^="service-table-"] b.ui-table-cell-label {
display: none;
}
@@ -912,9 +914,20 @@ table.event_details td.cell_event_name {
table#list_servers tr td.cell_2 {
width: 80%;
}
+
+ table[id^="service-table-"] tr td.cell_0 {
+ width: 10%;
+ }
+ table[id^="service-table-"] tr td.cell_1 {
+ width: 80%;
+ }
+ table[id^="service-table-"] tr td.cell_2 {
+ width: 10%;
+ }
}
-table#list_servers tr td.cell_0 {
+table#list_servers tr td.cell_0,
+table[id^="service-table-"] td.cell_0 {
border-top: 0px;
}
@@ -1286,12 +1299,26 @@ table.tactical_bars {
background-size: 18px 18px !important;
}
+.ui-icon-server-status {
+ background-image: url(../../../images/server-status.menu.png) !important;
+ background-color: #333 !important;
+ background-size: 18px 18px !important;
+}
+
+.ui-icon-services {
+ background-image: url(../../../images/services.menu.png) !important;
+ background-color: #333 !important;
+ background-size: 18px 18px !important;
+}
+
.ui-icon-tactical_view,
.ui-icon-events,
.ui-icon-groups,
.ui-icon-alerts,
.ui-icon-agents,
.ui-icon-modules,
+.ui-icon-server-status,
+.ui-icon-services,
.ui-icon-network_maps,
.ui-icon-visual_console,
.ui-icon-dashboard {
@@ -1323,6 +1350,8 @@ table.tactical_bars {
.ui-icon-alerts,
.ui-icon-agents,
.ui-icon-modules,
+ .ui-icon-server-status,
+ .ui-icon-services,
.ui-icon-network_maps,
.ui-icon-visual_console,
.ui-icon-dashboard {
@@ -1339,6 +1368,8 @@ table.tactical_bars {
.ui-icon-alerts,
.ui-icon-agents,
.ui-icon-modules,
+ .ui-icon-server-status,
+ .ui-icon-services,
.ui-icon-network_maps,
.ui-icon-visual_console,
.ui-icon-dashboard {
@@ -1776,3 +1807,35 @@ span.agents-counter {
float: right;
margin-right: 15px;
}
+
+span.agents-counter span {
+ padding-left: 1px;
+ padding-right: 1px;
+}
+
+div.border-collapsible
+ > h4.ui-collapsible-heading
+ + div.ui-collapsible-content {
+ border-width: 1px !important;
+ border-top: 0px !important;
+ border-left: 1px solid #ddd;
+ border-right: 1px solid #ddd;
+ border-bottom: 1px solid #ddd;
+}
+
+table[id^="service-table-"] {
+ width: 100%;
+}
+
+table[id^="service-table-"] > tbody > tr:nth-child(even) {
+ background-color: #ebebeb;
+}
+
+table[id^="service-table-"] a strong {
+ color: #000 !important;
+}
+
+.mt15px {
+ margin-top: 15px;
+ margin-bottom: 15px;
+}
diff --git a/pandora_console/mobile/include/system.class.php b/pandora_console/mobile/include/system.class.php
index b8a21d60b1..253885659f 100644
--- a/pandora_console/mobile/include/system.class.php
+++ b/pandora_console/mobile/include/system.class.php
@@ -151,10 +151,35 @@ class System
}
+ public function checkEnterprise($page='')
+ {
+ if ((int) $this->getConfig('enterprise_installed', false) === 1) {
+ return true;
+ } else {
+ if (empty($this->getRequest('page', false)) === false && $page === '') {
+ $page = $this->getRequest('page', false);
+ }
+
+ db_pandora_audit(
+ AUDIT_LOG_ENTERPRISE_VIOLATION,
+ 'Trying to access to Mobile Page: '.$page
+ );
+
+ return false;
+ }
+ }
+
+
public static function getDefaultACLFailText()
{
return __('Access to this page is restricted to authorized users only, please contact your system administrator if you should need help.').'
'.__('Please remember that any attempts to access this page will be recorded on the %s System Database.', get_product_name());
}
+ public static function getDefaultLicenseFailText()
+ {
+ return __('Invalid license, please contact your system administrator if you should need help.').'
'.__('Please remember that any attempts to access this page will be recorded on the %s System Database.', get_product_name());
+ }
+
+
}
diff --git a/pandora_console/mobile/index.php b/pandora_console/mobile/index.php
index dfad2dbebd..401f96ae11 100644
--- a/pandora_console/mobile/index.php
+++ b/pandora_console/mobile/index.php
@@ -44,6 +44,7 @@ require_once 'operation/agent.php';
require_once 'operation/visualmaps.php';
require_once 'operation/visualmap.php';
require_once 'operation/server_status.php';
+require_once 'operation/services.php';
$enterpriseHook = enterprise_include('mobile/include/enterprise.class.php');
$enterpriseHook = enterprise_include('mobile/operation/home.php');
@@ -183,6 +184,11 @@ switch ($action) {
$server_status->ajax($parameter2);
break;
+ case 'services':
+ $services = new Services();
+ $services->ajax($parameter2);
+ break;
+
default:
if (class_exists('Enterprise')) {
$enterprise->enterpriseAjax($parameter1, $parameter2);
@@ -418,6 +424,11 @@ switch ($action) {
$server_status = new ServerStatus();
$server_status->show();
break;
+
+ case 'services':
+ $services = new Services();
+ $services->show();
+ break;
}
break;
}
diff --git a/pandora_console/mobile/operation/home.php b/pandora_console/mobile/operation/home.php
index c0743941bd..06797a1d1b 100644
--- a/pandora_console/mobile/operation/home.php
+++ b/pandora_console/mobile/operation/home.php
@@ -40,7 +40,7 @@ class Home
$items = [];
- // In home
+ // In home.
$items['tactical'] = [
'name' => __('Tactical view'),
'filename' => 'tactical.php',
@@ -95,9 +95,18 @@ class Home
'name' => __('Server status'),
'filename' => 'server_status.php',
'menu_item' => true,
- 'icon' => 'ui-icon- ui-widget-icon-floatbeginning',
+ 'icon' => 'ui-icon-server-status ui-widget-icon-floatbeginning',
];
+ if ((int) $system->getConfig('enterprise_installed', false) === 1) {
+ $items['services'] = [
+ 'name' => __('Services'),
+ 'filename' => 'services.php',
+ 'menu_item' => true,
+ 'icon' => 'ui-icon-services ui-widget-icon-floatbeginning',
+ ];
+ }
+
// Not in home.
$items['agent'] = [
'name' => __('Agent'),
diff --git a/pandora_console/mobile/operation/services.php b/pandora_console/mobile/operation/services.php
new file mode 100644
index 0000000000..b0fae9d354
--- /dev/null
+++ b/pandora_console/mobile/operation/services.php
@@ -0,0 +1,536 @@
+checkACL($this->acl)) {
+ $this->correct_acl = true;
+
+ $this->services = enterprise_hook('services_get_services');
+ } else {
+ $this->correct_acl = false;
+ }
+
+ if ($system->checkEnterprise() === false) {
+ $this->show_fail_enterprise();
+ }
+ }
+
+
+ public function show()
+ {
+ if (!$this->correct_acl) {
+ $this->show_fail_acl();
+ } else {
+ $this->show_services();
+ }
+ }
+
+
+ private function show_fail_acl()
+ {
+ $error['type'] = 'onStart';
+ $error['title_text'] = __('You don\'t have access to this page');
+ $error['content_text'] = System::getDefaultACLFailText();
+ if (class_exists('HomeEnterprise')) {
+ $home = new HomeEnterprise();
+ } else {
+ $home = new Home();
+ }
+
+ $home->show($error);
+ }
+
+
+ private function show_fail_enterprise()
+ {
+ $error['type'] = 'onStart';
+ $error['title_text'] = __('You don\'t have access to this page');
+ $error['content_text'] = System::getDefaultLicenseFailText();
+ if (class_exists('HomeEnterprise')) {
+ $home = new HomeEnterprise();
+ } else {
+ $home = new Home();
+ }
+
+ $home->show($error);
+ }
+
+
+ public function ajax($parameter2=false)
+ {
+ $system = System::getInstance();
+
+ if (!$this->correct_acl) {
+ return;
+ } else {
+ switch ($parameter2) {
+ case 'get_services':
+ $this->serviceId = $system->getRequest('service_id', 0);
+ $rows = $this->getListServices();
+
+ $this->rows = $rows;
+ $table = $this->getTable();
+
+ echo $table;
+ break;
+ }
+ }
+ }
+
+
+ private function show_services()
+ {
+ $ui = Ui::getInstance();
+
+ $ui->createPage();
+ $ui->createDefaultHeader(
+ __('Services'),
+ $ui->createHeaderButton(
+ [
+ 'icon' => 'ui-icon-back',
+ 'pos' => 'left',
+ 'text' => __('Back'),
+ 'href' => 'index.php?page=home',
+ 'class' => 'header-button-left',
+ ]
+ )
+ );
+ $ui->showFooter(false);
+ $ui->beginContent();
+
+ $ui->contentAddHtml('
'.__('Type').' | '; + // $html .= ''.__('Name').' | '; + // $html .= ''.__('Status').' | '; + // $html .= '
---|---|---|
".$cell.' | '; + } + + $html .= '