diff --git a/extras/android-event-viewer/.idea/misc.xml b/extras/android-event-viewer/.idea/misc.xml index 38041c7cc6..a4aaf9f97e 100644 --- a/extras/android-event-viewer/.idea/misc.xml +++ b/extras/android-event-viewer/.idea/misc.xml @@ -1,8 +1,5 @@ - - - - - - - - - - - - - - + diff --git a/extras/android-event-viewer/app/build.gradle b/extras/android-event-viewer/app/build.gradle index 92924f93b3..d9a280d817 100644 --- a/extras/android-event-viewer/app/build.gradle +++ b/extras/android-event-viewer/app/build.gradle @@ -2,7 +2,7 @@ apply plugin: 'com.android.application' android { compileSdkVersion 8 - buildToolsVersion "25.0.2" + buildToolsVersion "26.0.2" defaultConfig { applicationId "pandroid_event_viewer.pandorafms" diff --git a/extras/android-event-viewer/app/src/main/java/pandroid_event_viewer/pandorafms/EventList.java b/extras/android-event-viewer/app/src/main/java/pandroid_event_viewer/pandorafms/EventList.java index 15ca771bad..b208855e0b 100644 --- a/extras/android-event-viewer/app/src/main/java/pandroid_event_viewer/pandorafms/EventList.java +++ b/extras/android-event-viewer/app/src/main/java/pandroid_event_viewer/pandorafms/EventList.java @@ -159,8 +159,14 @@ public class EventList extends ListActivity { } }); - - + ImageButton btnSettings = (ImageButton) findViewById(R.id.settings_icon_button_list); + // Open the settings + btnSettings.setOnClickListener(new View.OnClickListener() { + public void onClick(View v) { + startActivity(new Intent(v.getContext(), Options.class)); + } + }); + registerReceiver(onBroadcast, new IntentFilter("eventlist.java")); this.toggleLoadingLayout(); diff --git a/extras/android-event-viewer/app/src/main/java/pandroid_event_viewer/pandorafms/Main.java b/extras/android-event-viewer/app/src/main/java/pandroid_event_viewer/pandorafms/Main.java index 6ab57371e9..2548b8023b 100644 --- a/extras/android-event-viewer/app/src/main/java/pandroid_event_viewer/pandorafms/Main.java +++ b/extras/android-event-viewer/app/src/main/java/pandroid_event_viewer/pandorafms/Main.java @@ -96,10 +96,29 @@ public class Main extends Activity { Activity.MODE_PRIVATE); setContentView(R.layout.main); + final ImageButton btnSettings = (ImageButton) findViewById(R.id.settings_icon_button_main); + final ImageButton btnFilter = (ImageButton) findViewById(R.id.filter_icon_button_main); final Button buttonSetAsFilterWatcher = (Button) findViewById(R.id.button_set_as_filter_watcher); final ImageButton buttonSearch = (ImageButton) findViewById(R.id.refresh_icon_button_main); final ImageButton buttonDeleteProfile = (ImageButton) findViewById(R.id.button_delete_profile); final ImageButton buttonSaveProfile = (ImageButton) findViewById(R.id.button_save_profile); + + // Open the settings + btnSettings.setOnClickListener(new View.OnClickListener() { + public void onClick(View v) { + startActivity(new Intent(v.getContext(), Options.class)); + } + }); + + // Go to the events list + btnFilter.setOnClickListener(new View.OnClickListener() { + public void onClick(View v) { + Activity a = (Activity) v.getContext(); + TabActivity ta = (TabActivity) a.getParent(); + ta.getTabHost().setCurrentTab(1); + } + }); + // Check if the user preferences it is set. if (object.user.length() == 0 || object.password.length() == 0 || object.url.length() == 0) { diff --git a/extras/android-event-viewer/app/src/main/res/layout/list_view_layout.xml b/extras/android-event-viewer/app/src/main/res/layout/list_view_layout.xml index 9b32dfe1dc..b0135b4489 100644 --- a/extras/android-event-viewer/app/src/main/res/layout/list_view_layout.xml +++ b/extras/android-event-viewer/app/src/main/res/layout/list_view_layout.xml @@ -63,8 +63,22 @@ android:layout_weight="0" android:padding="0dp" android:src="@drawable/filter_icon_button" + android:background="@null" /> + + + + + android:tint="@android:color/white" + android:src="@android:drawable/ic_menu_preferences" /> + + + + + + /dev/null diff --git a/pandora_agents/unix/Darwin/pandora_agent.conf b/pandora_agents/unix/Darwin/pandora_agent.conf index 723b17232c..aaf29acb8f 100644 --- a/pandora_agents/unix/Darwin/pandora_agent.conf +++ b/pandora_agents/unix/Darwin/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.714, GNU/Linux +# Version 7.0NG.715, GNU/Linux # Licensed under GPL license v2, # Copyright (c) 2003-2012 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_agents/unix/FreeBSD/pandora_agent.conf b/pandora_agents/unix/FreeBSD/pandora_agent.conf index 8a8ecd3451..817432efa6 100644 --- a/pandora_agents/unix/FreeBSD/pandora_agent.conf +++ b/pandora_agents/unix/FreeBSD/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.714, FreeBSD Version +# Version 7.0NG.715, FreeBSD Version # Licensed under GPL license v2, # Copyright (c) 2003-2016 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_agents/unix/HP-UX/pandora_agent.conf b/pandora_agents/unix/HP-UX/pandora_agent.conf index f31d7e6cd0..d0f28e9943 100644 --- a/pandora_agents/unix/HP-UX/pandora_agent.conf +++ b/pandora_agents/unix/HP-UX/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.714, HP-UX Version +# Version 7.0NG.715, HP-UX Version # Licensed under GPL license v2, # Copyright (c) 2003-2009 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_agents/unix/Linux/pandora_agent.conf b/pandora_agents/unix/Linux/pandora_agent.conf index 59ea7ed59d..d9876734df 100644 --- a/pandora_agents/unix/Linux/pandora_agent.conf +++ b/pandora_agents/unix/Linux/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.714, GNU/Linux +# Version 7.0NG.715, GNU/Linux # Licensed under GPL license v2, # Copyright (c) 2003-2014 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_agents/unix/NT4/pandora_agent.conf b/pandora_agents/unix/NT4/pandora_agent.conf index ee6b7bb18d..c4665aaa94 100644 --- a/pandora_agents/unix/NT4/pandora_agent.conf +++ b/pandora_agents/unix/NT4/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.714, GNU/Linux +# Version 7.0NG.715, GNU/Linux # Licensed under GPL license v2, # Copyright (c) 2003-2009 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_agents/unix/NetBSD/pandora_agent.conf b/pandora_agents/unix/NetBSD/pandora_agent.conf index aa64beba39..8100e76026 100644 --- a/pandora_agents/unix/NetBSD/pandora_agent.conf +++ b/pandora_agents/unix/NetBSD/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.714, NetBSD Version +# Version 7.0NG.715, NetBSD Version # Licensed under GPL license v2, # Copyright (c) 2003-2010 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_agents/unix/SunOS/pandora_agent.conf b/pandora_agents/unix/SunOS/pandora_agent.conf index 3dada142de..9a5432057a 100644 --- a/pandora_agents/unix/SunOS/pandora_agent.conf +++ b/pandora_agents/unix/SunOS/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.714, Solaris Version +# Version 7.0NG.715, Solaris Version # Licensed under GPL license v2, # Copyright (c) 2003-2009 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index 8d48365a14..6364dc674e 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -40,8 +40,8 @@ my $Sem = undef; # Semaphore used to control the number of threads my $ThreadSem = undef; -use constant AGENT_VERSION => '7.0NG.714'; -use constant AGENT_BUILD => '171031'; +use constant AGENT_VERSION => '7.0NG.715'; +use constant AGENT_BUILD => '171115'; # Agent log default file size maximum and instances use constant DEFAULT_MAX_LOG_SIZE => 600000; diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec index a8e50d570d..daea7471cf 100644 --- a/pandora_agents/unix/pandora_agent.redhat.spec +++ b/pandora_agents/unix/pandora_agent.redhat.spec @@ -2,8 +2,8 @@ #Pandora FMS Linux Agent # %define name pandorafms_agent_unix -%define version 7.0NG.714 -%define release 171031 +%define version 7.0NG.715 +%define release 171115 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec index 7c920391e9..a134b074de 100644 --- a/pandora_agents/unix/pandora_agent.spec +++ b/pandora_agents/unix/pandora_agent.spec @@ -2,8 +2,8 @@ #Pandora FMS Linux Agent # %define name pandorafms_agent_unix -%define version 7.0NG.714 -%define release 171031 +%define version 7.0NG.715 +%define release 171115 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent_installer b/pandora_agents/unix/pandora_agent_installer index 2ea278fd66..8c40f93404 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -9,8 +9,8 @@ # Please see http://www.pandorafms.org. This code is licensed under GPL 2.0 license. # ********************************************************************** -PI_VERSION="7.0NG.714" -PI_BUILD="171031" +PI_VERSION="7.0NG.715" +PI_BUILD="171115" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/unix/plugins/route_parser b/pandora_agents/unix/plugins/route_parser index 0c5c5c7fae..40cfcea36f 100644 Binary files a/pandora_agents/unix/plugins/route_parser and b/pandora_agents/unix/plugins/route_parser differ diff --git a/pandora_agents/win32/bin/pandora_agent.conf b/pandora_agents/win32/bin/pandora_agent.conf index c8c32e84d0..90626fedbc 100644 --- a/pandora_agents/win32/bin/pandora_agent.conf +++ b/pandora_agents/win32/bin/pandora_agent.conf @@ -1,6 +1,6 @@ # Base config file for Pandora FMS Windows Agent # (c) 2006-2014 Artica Soluciones Tecnologicas -# Version 7.0NG.714 +# Version 7.0NG.715 # This program is Free Software, you can redistribute it and/or modify it # under the terms of the GNU General Public Licence as published by the Free Software diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 3964a08708..773d2b4c77 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -3,7 +3,7 @@ AllowLanguageSelection {Yes} AppName -{Pandora FMS Windows Agent v7.0NG.714} +{Pandora FMS Windows Agent v7.0NG.715} ApplicationID {17E3D2CF-CA02-406B-8A80-9D31C17BD08F} @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{171031} +{171115} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 10c9f9a9a0..3c34513f8d 100644 --- a/pandora_agents/win32/pandora.cc +++ b/pandora_agents/win32/pandora.cc @@ -30,7 +30,7 @@ using namespace Pandora; using namespace Pandora_Strutils; #define PATH_SIZE _MAX_PATH+1 -#define PANDORA_VERSION ("7.0NG.714(Build 171031)") +#define PANDORA_VERSION ("7.0NG.715(Build 171115)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 59e5f0f15d..dcc5aacebe 100644 --- a/pandora_agents/win32/versioninfo.rc +++ b/pandora_agents/win32/versioninfo.rc @@ -11,7 +11,7 @@ BEGIN VALUE "LegalCopyright", "Artica ST" VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "ProductName", "Pandora FMS Windows Agent" - VALUE "ProductVersion", "(7.0NG.714(Build 171031))" + VALUE "ProductVersion", "(7.0NG.715(Build 171115))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 67a1519e82..ab941d8b0d 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.714-171031 +Version: 7.0NG.715-171115 Architecture: all Priority: optional Section: admin diff --git a/pandora_console/DEBIAN/make_deb_package.sh b/pandora_console/DEBIAN/make_deb_package.sh index 48c5d593d7..7295cd6288 100644 --- a/pandora_console/DEBIAN/make_deb_package.sh +++ b/pandora_console/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="7.0NG.714-171031" +pandora_version="7.0NG.715-171115" package_pear=0 package_pandora=1 diff --git a/pandora_console/extras/mr/8.sql b/pandora_console/extras/mr/8.sql index 977f7989fd..402fb7e82c 100644 --- a/pandora_console/extras/mr/8.sql +++ b/pandora_console/extras/mr/8.sql @@ -1,3 +1,21 @@ START TRANSACTION; ALTER TABLE tusuario ADD COLUMN `time_autorefresh` int(5) unsigned NOT NULL default '30'; +ALTER TABLE treport_content ADD COLUMN lapse_calc tinyint(1) default '0'; +ALTER TABLE treport_content ADD COLUMN lapse int(11) default '300'; +ALTER TABLE treport_content ADD COLUMN visual_format tinyint(1) default '0'; +ALTER TABLE treport_content_template ADD COLUMN lapse_calc tinyint(1) default '0'; +ALTER TABLE treport_content_template ADD COLUMN lapse int(11) default '300'; +ALTER TABLE treport_content_template ADD COLUMN visual_format tinyint(1) default '0'; + +UPDATE `talert_commands` +SET `description` = 'This alert send an email using internal Pandora FMS Server SMTP capabilities (defined in each server, using: _field1_ as destination email address, and _field2_ as subject for message. _field3_ as text of message. _field4_ as content type (text/plain or html/text).', + `fields_descriptions` = '[\"Destination address\",\"Subject\",\"Text\",\"Content Type\",\"\",\"\",\"\",\"\",\"\",\"\"]', + `fields_values` = '[\"\",\"\",\"_html_editor_\",\"_content_type_\",\"\",\"\",\"\",\"\",\"\",\"\"]' +WHERE id=1; + +UPDATE `talert_actions` +SET `field4` = 'text/html', + `field4_recovery` = 'text/html' +WHERE id = 1; + COMMIT; \ No newline at end of file diff --git a/pandora_console/extras/mr/9.sql b/pandora_console/extras/mr/9.sql new file mode 100644 index 0000000000..055b7b36b3 --- /dev/null +++ b/pandora_console/extras/mr/9.sql @@ -0,0 +1,5 @@ +START TRANSACTION; + +ALTER TABLE tagente ADD COLUMN `safe_mode_module` int(10) unsigned NOT NULL default '0'; + +COMMIT; \ No newline at end of file diff --git a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql index 2b9d8c5a5a..8e5047b8db 100644 --- a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql +++ b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql @@ -725,6 +725,9 @@ CREATE TABLE IF NOT EXISTS `treport_content_template` ( `module_free_text` TEXT, `each_agent` tinyint(1) default 1, `historical_db` tinyint(1) UNSIGNED NOT NULL default 0, + `lapse_calc` tinyint(1) UNSIGNED NOT NULL default '0', + `lapse` int(11) UNSIGNED NOT NULL default '300', + `visual_format` tinyint(1) UNSIGNED NOT NULL default '0', PRIMARY KEY(`id_rc`) ) ENGINE = InnoDB DEFAULT CHARSET=utf8; @@ -1134,6 +1137,10 @@ ALTER TABLE talert_actions ADD COLUMN `field15_recovery` TEXT NOT NULL DEFAULT " -- --------------------------------------------------------------------- UPDATE `talert_commands` SET `fields_descriptions` = '[\"Integria IMS API path\",\"Integria IMS API pass\",\"Integria IMS user\",\"Integria IMS user pass\",\"Ticket title\",\"Ticket group ID\",\"Ticket priority\",\"Email copy\",\"Ticket owner\",\"Ticket description\"]', `fields_values` = '[\"\",\"\",\"\",\"\",\"\",\"\",\"10,Maintenance;0,Informative;1,Low;2,Medium;3,Serious;4,Very Serious\",\"\",\"\",\"\"]' WHERE `id` = 11 AND `name` = 'Integria IMS Ticket'; +UPDATE `talert_commands` SET `description` = 'This alert send an email using internal Pandora FMS Server SMTP capabilities (defined in each server, using: _field1_ as destination email address, and _field2_ as subject for message. _field3_ as text of message. _field4_ as content type (text/plain or html/text).', `fields_descriptions` = '[\"Destination address\",\"Subject\",\"Text\",\"Content Type\",\"\",\"\",\"\",\"\",\"\",\"\"]', `fields_values` = '[\"\",\"\",\"_html_editor_\",\"_content_type_\",\"\",\"\",\"\",\"\",\"\",\"\"]' WHERE id=1; + +UPDATE `talert_actions` SET `field4` = 'text/html', `field4_recovery` = 'text/html' WHERE id = 1; + -- --------------------------------------------------------------------- -- Table `tmap` -- --------------------------------------------------------------------- @@ -1150,7 +1157,7 @@ ALTER TABLE titem MODIFY `source_data` int(10) unsigned; INSERT INTO `tconfig` (`token`, `value`) VALUES ('big_operation_step_datos_purge', '100'); INSERT INTO `tconfig` (`token`, `value`) VALUES ('small_operation_step_datos_purge', '1000'); INSERT INTO `tconfig` (`token`, `value`) VALUES ('days_autodisable_deletion', '30'); -INSERT INTO `tconfig` (`token`, `value`) VALUES ('MR', 7); +INSERT INTO `tconfig` (`token`, `value`) VALUES ('MR', 8); UPDATE tconfig SET value = 'https://licensing.artica.es/pandoraupdate7/server.php' WHERE token='url_update_manager'; DELETE FROM `tconfig` WHERE `token` = 'current_package_enterprise'; INSERT INTO `tconfig` (`token`, `value`) VALUES ('current_package_enterprise', '714'); @@ -1219,6 +1226,7 @@ ALTER TABLE tagente ADD `remote` tinyint(1) NOT NULL default 0; ALTER TABLE tagente ADD COLUMN `cascade_protection_module` int(10) unsigned NOT NULL default '0'; ALTER TABLE tagente ADD COLUMN (alias varchar(600) not null default ''); ALTER TABLE tagente ADD `alias_as_name` int(2) unsigned default '0'; +ALTER TABLE tagente ADD COLUMN `safe_mode_module` int(10) unsigned NOT NULL default '0'; UPDATE tagente SET tagente.alias = tagente.nombre; -- --------------------------------------------------------------------- @@ -1232,6 +1240,7 @@ ALTER TABLE tlayout ADD `background_color` varchar(50) NOT NULL default '#FFF'; ALTER TABLE tlayout_data ADD `type_graph` varchar(50) NOT NULL default 'area'; ALTER TABLE tlayout_data ADD `label_position` varchar(50) NOT NULL default 'down'; ALTER TABLE tlayout_data ADD COLUMN `show_statistics` tinyint(2) NOT NULL default '0'; +ALTER TABLE tlayout_data ADD COLUMN `id_layout_linked_weight` int(10) NOT NULL default '0'; -- --------------------------------------------------------------------- -- Table `tagent_custom_fields` @@ -1270,6 +1279,9 @@ UPDATE treport_custom_sql SET `sql` = 'select t1.alias as agent_n -- --------------------------------------------------------------------- ALTER TABLE treport_content ADD COLUMN `historical_db` tinyint(1) NOT NULL DEFAULT '0'; +ALTER TABLE treport_content ADD COLUMN `lapse_calc` tinyint(1) default '0'; +ALTER TABLE treport_content ADD COLUMN `lapse` int(11) default '300'; +ALTER TABLE treport_content ADD COLUMN `visual_format` tinyint(1) default '0'; -- --------------------------------------------------------------------- -- Table `tmodule_relationship` diff --git a/pandora_console/general/header.php b/pandora_console/general/header.php index 49ef936515..e228c1eca4 100644 --- a/pandora_console/general/header.php +++ b/pandora_console/general/header.php @@ -261,7 +261,13 @@ config_check(); if ($check_minor_release_available) { if (users_is_admin($config['id_user'])) { - set_pandora_error_for_header('There are one or more minor releases waiting for update', 'minor release/s available'); + + if($config['language'] == 'es'){ + set_pandora_error_for_header('Hay una o mas revisiones menores en espera para ser actualizadas. '.__('Sobre actualización de revisión menor').'', 'Revisión/es menor/es disponible/s'); + } + else{ + set_pandora_error_for_header('There are one or more minor releases waiting for update. '.__('About minor release update').'', 'minor release/s available'); + } } } echo ''; diff --git a/pandora_console/godmode/agentes/agent_manager.php b/pandora_console/godmode/agentes/agent_manager.php index efee6dc435..42e71093ab 100644 --- a/pandora_console/godmode/agentes/agent_manager.php +++ b/pandora_console/godmode/agentes/agent_manager.php @@ -252,25 +252,6 @@ foreach ($modules as $m) { $modules_values[$m['id_module']] = $m['name']; } -$table->data[3][0] = __('Parent'); -$params = array(); -$params['return'] = true; -$params['show_helptip'] = true; -$params['input_name'] = 'id_parent'; -$params['print_hidden_input_idagent'] = true; -$params['hidden_input_idagent_name'] = 'id_agent_parent'; -$params['hidden_input_idagent_value'] = $id_parent; -$params['value'] = db_get_value ("alias","tagente","id_agente",$id_parent); -$params['selectbox_id'] = 'cascade_protection_module'; -$params['javascript_is_function_select'] = true; -$params['cascade_protection'] = true; - -$table->data[3][1] = ui_print_agent_autocomplete_input($params); - -$table->data[3][1] .= html_print_checkbox ("cascade_protection", 1, $cascade_protection, true).__('Cascade protection'). " " . ui_print_help_icon("cascade_protection", true); - -$table->data[3][1] .= "  " . __('Module') . " " . html_print_select ($modules_values, "cascade_protection_module", $cascade_protection_module, "", "", 0, true); - $table->data[4][0] = __('Group'); $table->data[4][1] = html_print_select_groups(false, "AR", false, 'grupo', $grupo, '', '', 0, true); $table->data[4][1] .= ' '; @@ -320,52 +301,87 @@ $table->class = "databox filters"; $table->head = array (); $table->style = array (); $table->style[0] = 'font-weight: bold; '; -$table->style[2] = 'font-weight: bold;'; +$table->style[4] = 'font-weight: bold;'; $table->data = array (); // Custom ID $table->data[0][0] = __('Custom ID'); $table->data[0][1] = html_print_input_text ('custom_id', $custom_id, '', 16, 255, true); +$table->data[1][0] = __('Parent'); +$params = array(); +$params['return'] = true; +$params['show_helptip'] = true; +$params['input_name'] = 'id_parent'; +$params['print_hidden_input_idagent'] = true; +$params['hidden_input_idagent_name'] = 'id_agent_parent'; +$params['hidden_input_idagent_value'] = $id_parent; +$params['value'] = db_get_value ("alias","tagente","id_agente",$id_parent); +$params['selectbox_id'] = 'cascade_protection_module'; +$params['javascript_is_function_select'] = true; +$params['cascade_protection'] = true; + +$table->data[1][1] = ui_print_agent_autocomplete_input($params); +$table->data[1][1] .= html_print_checkbox ("cascade_protection", 1, $cascade_protection, true).__('Cascade protection'). " " . ui_print_help_icon("cascade_protection", true); +$table->data[1][1] .= "  " . __('Module') . " " . html_print_select ($modules_values, "cascade_protection_module", $cascade_protection_module, "", "", 0, true); + +//safe operation mode +if($id_agente){ + $sql_modules = db_get_all_rows_sql("SELECT id_agente_modulo as id_module, nombre as name FROM tagente_modulo + WHERE id_agente = " . $id_agente); + $safe_mode_modules = array(); + $safe_mode_modules[0] = __('Any'); + foreach ($sql_modules as $m) { + $safe_mode_modules[$m['id_module']] = $m['name']; + } + + $table->data[2][0] = __('Safe operation mode') + . ui_print_help_tip(__('This mode allow Pandora FMS to disable all modules + of this agent while the selected module is on CRITICAL status'), true); + $table->data[2][1] = html_print_checkbox('safe_mode', 1, $safe_mode, true); + $table->data[2][1] .= "  " . __('Module') . " " . html_print_select ($safe_mode_modules, "safe_mode_module", $safe_mode_module, "", "", 0, true); +} + + // Learn mode / Normal mode -$table->data[1][0] = __('Module definition') . +$table->data[3][0] = __('Module definition') . ui_print_help_icon("module_definition", true); -$table->data[1][1] = __('Learning mode') . ' ' . +$table->data[3][1] = __('Learning mode') . ' ' . html_print_radio_button_extended ("modo", 1, '', $modo, false, 'show_modules_not_learning_mode_context_help();', 'style="margin-right: 40px;"', true); -$table->data[1][1] .= __('Normal mode') . ' ' . +$table->data[3][1] .= __('Normal mode') . ' ' . html_print_radio_button_extended ("modo", 0, '', $modo, false, 'show_modules_not_learning_mode_context_help();', 'style="margin-right: 40px;"', true); -$table->data[1][1] .= __('Autodisable mode') . ' ' . +$table->data[3][1] .= __('Autodisable mode') . ' ' . html_print_radio_button_extended ("modo", 2, '', $modo, false, 'show_modules_not_learning_mode_context_help();', 'style="margin-right: 40px;"', true); // Status (Disabled / Enabled) -$table->data[2][0] = __('Status'); -$table->data[2][1] = __('Disabled') . ' ' . +$table->data[4][0] = __('Status'); +$table->data[4][1] = __('Disabled') . ' ' . html_print_radio_button_extended ("disabled", 1, '', $disabled, false, '', 'style="margin-right: 40px;"', true); -$table->data[2][1] .= __('Active') . ' ' . +$table->data[4][1] .= __('Active') . ' ' . html_print_radio_button_extended ("disabled", 0, '', $disabled, false, '', 'style="margin-right: 40px;"', true); // Remote configuration -$table->data[3][0] = __('Remote configuration'); +$table->data[5][0] = __('Remote configuration'); if (!$new_agent) { - $table->data[3][1] = '' . __('Not available') . ''; + $table->data[5][1] = '' . __('Not available') . ''; if (isset($filename)) { if (file_exists ($filename['md5'])) { - $table->data[3][1] = date ("F d Y H:i:s", fileatime ($filename['md5'])); + $table->data[5][1] = date ("F d Y H:i:s", fileatime ($filename['md5'])); // Delete remote configuration - $table->data[3][1] .= ''; - $table->data[3][1] .= html_print_image( + $table->data[5][1] .= html_print_image( "images/cross.png", true, array ('title' => __('Delete remote configuration file'), 'style' => 'vertical-align: middle;')).''; - $table->data[3][1] .= '' . + $table->data[5][1] .= '' . ui_print_help_tip( __('Delete this conf file implies that for restore you must reactive remote config in the local agent.'), true); @@ -373,7 +389,7 @@ if (!$new_agent) { } } else - $table->data[3][1] = '' . __('Not available') . ''; + $table->data[5][1] = '' . __('Not available') . ''; $listIcons = gis_get_array_list_icons(); @@ -411,23 +427,23 @@ $table->data[0][3] = html_print_select($arraySelectIcon, "icon_path", array("id" => "icon_warning", "style" => "display:".$display_icons.";")); if ($config['activate_gis']) { - $table->data[1][2] = __('Ignore new GIS data:'); - $table->data[1][3] = __('Yes') . ' ' . + $table->data[3][2] = __('Ignore new GIS data:'); + $table->data[3][3] = __('Yes') . ' ' . html_print_radio_button_extended ("update_gis_data", 0, '', $update_gis_data, false, '', 'style="margin-right: 40px;"', true); - $table->data[1][3] .= __('No') . ' ' . + $table->data[3][3] .= __('No') . ' ' . html_print_radio_button_extended ("update_gis_data", 1, '', $update_gis_data, false, '', 'style="margin-right: 40px;"', true); } -$table->data[2][2] = __('Url address'); -$table->data[2][3] = html_print_input_text ('url_description', +$table->data[4][2] = __('Url address'); +$table->data[4][3] = html_print_input_text ('url_description', $url_description, '', 45, 255, true); -$table->data[3][2] = __('Quiet'); -$table->data[3][3] = ui_print_help_tip( +$table->data[5][2] = __('Quiet'); +$table->data[5][3] = ui_print_help_tip( __('The agent still runs but the alerts and events will be stop'), true); -$table->data[3][3] .= html_print_checkbox('quiet', 1, $quiet, true); +$table->data[5][3] .= html_print_checkbox('quiet', 1, $quiet, true); ui_toggle(html_print_table ($table, true), __('Advanced options')); unset($table); @@ -582,6 +598,26 @@ ui_require_jquery_file('bgiframe'); $("#cascade_protection_module").attr("disabled", 'disabled'); } }); + + var safe_mode_checked = $("#checkbox-safe_mode").is(":checked"); + if (safe_mode_checked) { + $("#safe_mode_module").removeAttr("disabled"); + } + else { + $("#safe_mode_module").attr("disabled", 'disabled'); + } + + $("#checkbox-safe_mode").change(function () { + var safe_mode_checked = $("#checkbox-safe_mode").is(":checked"); + + if (safe_mode_checked) { + $("#safe_mode_module").removeAttr("disabled"); + } + else { + $("#safe_mode_module").val(0); + $("#safe_mode_module").attr("disabled", 'disabled'); + } + }); paint_qrcode( " $update_gis_data, 'url_address' => $url_description, 'url_address' => $url_description, - 'quiet' => $quiet); + 'quiet' => $quiet, + 'safe_mode_module' => $safe_mode_module); if ($config['metaconsole_agent_cache'] == 1) { $values['update_module_count'] = 1; // Force an update of the agent cache. @@ -900,6 +906,8 @@ if ($id_agente) { $update_gis_data = $agent["update_gis_data"]; $url_description = $agent["url_address"]; $quiet = $agent["quiet"]; + $safe_mode_module = $agent["safe_mode_module"]; + $safe_mode = ($safe_mode_module) ? 1 : 0; } $update_module = (bool) get_parameter ('update_module'); diff --git a/pandora_console/godmode/agentes/modificar_agente.php b/pandora_console/godmode/agentes/modificar_agente.php index 090011dae9..cc5349182e 100644 --- a/pandora_console/godmode/agentes/modificar_agente.php +++ b/pandora_console/godmode/agentes/modificar_agente.php @@ -201,13 +201,13 @@ switch ($sortField) { switch ($sort) { case 'up': $selectRemoteUp = $selected; - $order = array('field' => 'remote ' . $order_collation, + $order = array('field' => 'remote ', 'field2' => 'nombre ' . $order_collation, 'order' => 'ASC'); break; case 'down': $selectRemoteDown = $selected; - $order = array('field' => 'remote ' . $order_collation, + $order = array('field' => 'remote ', 'field2' => 'nombre ' . $order_collation, 'order' => 'DESC'); break; diff --git a/pandora_console/godmode/agentes/module_manager_editor.php b/pandora_console/godmode/agentes/module_manager_editor.php index e2739aee29..921296545d 100644 --- a/pandora_console/godmode/agentes/module_manager_editor.php +++ b/pandora_console/godmode/agentes/module_manager_editor.php @@ -111,12 +111,12 @@ if (is_ajax ()) { else $snmp_community = (string) get_parameter ('snmp_community'); $snmp_version = get_parameter('snmp_version'); - $snmp3_auth_user = get_parameter('snmp3_auth_user'); + $snmp3_auth_user = io_safe_output(get_parameter('snmp3_auth_user')); $snmp3_security_level = get_parameter('snmp3_security_level'); $snmp3_auth_method = get_parameter('snmp3_auth_method'); - $snmp3_auth_pass = get_parameter('snmp3_auth_pass'); + $snmp3_auth_pass = io_safe_output(get_parameter('snmp3_auth_pass')); $snmp3_privacy_method = get_parameter('snmp3_privacy_method'); - $snmp3_privacy_pass = get_parameter('snmp3_privacy_pass'); + $snmp3_privacy_pass = io_safe_output(get_parameter('snmp3_privacy_pass')); $snmp_port = get_parameter('snmp_port'); $snmpwalk = get_snmpwalk($ip_target, $snmp_version, $snmp_community, diff --git a/pandora_console/godmode/agentes/module_manager_editor_network.php b/pandora_console/godmode/agentes/module_manager_editor_network.php index 24d0105d42..b640243cfe 100644 --- a/pandora_console/godmode/agentes/module_manager_editor_network.php +++ b/pandora_console/godmode/agentes/module_manager_editor_network.php @@ -398,12 +398,12 @@ function snmpBrowserWindow () { $('#text-target_ip').val($('#text-ip_target').val()); $('#text-community').val($('#text-snmp_community').val()); $('#snmp_browser_version').val($('#snmp_version').val()); - $('#snmp3_browser_auth_user').val($('#snmp3_auth_user').val()); + $('#text-snmp3_browser_auth_user').val($('#text-snmp3_auth_user').val()); $('#snmp3_browser_security_level').val($('#snmp3_security_level').val()); $('#snmp3_browser_auth_method').val($('#snmp3_auth_method').val()); - $('#snmp3_browser_auth_pass').val($('#snmp3_auth_pass').val()); + $('#password-snmp3_browser_auth_pass').val($('#password-snmp3_auth_pass').val()); $('#snmp3_browser_privacy_method').val($('#snmp3_privacy_method').val()); - $('#snmp3_browser_privacy_pass').val($('#snmp3_privacy_pass').val()); + $('#password-snmp3_browser_privacy_pass').val($('#password-snmp3_privacy_pass').val()); $("#snmp_browser_container").show().dialog ({ title: '', diff --git a/pandora_console/godmode/alerts/alert_commands.php b/pandora_console/godmode/alerts/alert_commands.php index d4106e3460..10edc6bead 100644 --- a/pandora_console/godmode/alerts/alert_commands.php +++ b/pandora_console/godmode/alerts/alert_commands.php @@ -165,8 +165,26 @@ if (is_ajax ()) { $rfield = $editor_type_chkbx; $rfield .= html_print_textarea ('field'.$i.'_recovery_value', 1, 1, '', 'class="fields_recovery"', true); } + elseif(preg_match ("/^_content_type_$/i", $field_value)){ + $editor_type_chkbx = "
"; + $editor_type_chkbx .= __('Text/plain') . ui_print_help_tip (__("For sending emails only text plain"), true); + $editor_type_chkbx .= html_print_radio_button_extended ('field'.$i.'_value', 'text/plain', '', '', false, '', '', true); + $editor_type_chkbx .= "    "; + $editor_type_chkbx .= __('Text/html') . "  "; + $editor_type_chkbx .= html_print_radio_button_extended ('field'.$i.'_value', 'text/html', '', 'text/html', false, '', '', true); + $editor_type_chkbx .= "
"; + $ffield = $editor_type_chkbx; + + $editor_type_chkbx = "
"; + $editor_type_chkbx .= __('Text/plain') . ui_print_help_tip (__("For sending emails only text plain"), true); + $editor_type_chkbx .= html_print_radio_button_extended ('field'.$i.'_recovery_value', 'text/plain', '', '', false, '', '', true); + $editor_type_chkbx .= "    "; + $editor_type_chkbx .= __('Text/html') . "  "; + $editor_type_chkbx .= html_print_radio_button_extended ('field'.$i.'_recovery_value', 'text/html', '', 'text/html', false, '', '', true); + $editor_type_chkbx .= "
"; + $rfield = $editor_type_chkbx; // Select type - else { + }else { $fields_value_select = array(); $fv = explode(';', $field_value); diff --git a/pandora_console/godmode/alerts/configure_alert_action.php b/pandora_console/godmode/alerts/configure_alert_action.php index bef56c026c..990653f19f 100644 --- a/pandora_console/godmode/alerts/configure_alert_action.php +++ b/pandora_console/godmode/alerts/configure_alert_action.php @@ -305,8 +305,33 @@ $(document).ready (function () { // Replace the old column with the new $table_macros_field.replaceWith(field_row); if (old_value != '' || old_recovery_value != '') { - $("[name=field" + i + "_value]").val(old_value); - $("[name=field" + i + "_recovery_value]").val(old_recovery_value); + var inputType = $("[name=field" + i + "_value]").attr('type') + if (inputType == 'radio') { + if(old_value == 'text/plain'){ + if ($("[name=field" + i + "_value]").val() == 'text/plain') { + $("[name=field" + i + "_value]").attr('checked','checked'); + } + } + else{ + if($("[name=field" + i + "_value]").val() == 'text/html') { + $("[name=field" + i + "_value]").attr('checked','checked'); + } + } + if(old_recovery_value == 'text/plain'){ + if ($("[name=field" + i + "_recovery_value]").val() == 'text/plain') { + $("[name=field" + i + "_recovery_value]").attr('checked','checked'); + } + } + else{ + if ($("[name=field" + i + "_recovery_value]").val() == 'text/html') { + $("[name=field" + i + "_recovery_value]").attr('checked','checked'); + } + } + } + else { + $("[name=field" + i + "_value]").val(old_value); + $("[name=field" + i + "_recovery_value]").val(old_recovery_value); + } } else { $("[name=field" + i + "_value]") diff --git a/pandora_console/godmode/modules/manage_network_components.php b/pandora_console/godmode/modules/manage_network_components.php index ec448f0cf4..e2f3cdab26 100644 --- a/pandora_console/godmode/modules/manage_network_components.php +++ b/pandora_console/godmode/modules/manage_network_components.php @@ -129,7 +129,7 @@ else { } $snmp_version = (string) get_parameter('snmp_version'); -$snmp3_auth_user = (string) get_parameter('snmp3_auth_user'); +$snmp3_auth_user = (string) io_safe_output(get_parameter('snmp3_auth_user')); $snmp3_auth_pass = io_input_password((string) get_parameter('snmp3_auth_pass')); $snmp3_auth_method = (string) get_parameter('snmp3_auth_method'); $snmp3_privacy_method = (string) get_parameter('snmp3_privacy_method'); diff --git a/pandora_console/godmode/reporting/reporting_builder.item_editor.php b/pandora_console/godmode/reporting/reporting_builder.item_editor.php index 2651751809..b1dffe8e5b 100755 --- a/pandora_console/godmode/reporting/reporting_builder.item_editor.php +++ b/pandora_console/godmode/reporting/reporting_builder.item_editor.php @@ -112,6 +112,10 @@ $netflow_filter = 0; $max_values = 0; $resolution = 0; +$lapse_calc = 0; +$lapse = 300; +$visual_format = 0; + //Others $filter_search = ""; @@ -148,6 +152,7 @@ switch ($action) { case 'network_interfaces_report': case 'availability': case 'event_report_log': + case 'increment': case 'availability_graph': case 'agent_module': $get_data_editor = true; @@ -195,12 +200,6 @@ switch ($action) { $name = $item['name']; switch ($type) { - case 'avg_value': - $period = $item['period']; - $description = $item['description']; - $idAgentModule = $item['id_agent_module']; - $idAgent = db_get_value_filter('id_agente', 'tagente_modulo', array('id_agente_modulo' => $idAgentModule)); - break; case 'event_report_log': $period = $item['period']; $description = $item['description']; @@ -282,6 +281,13 @@ switch ($action) { $idAgent = db_get_value_filter('id_agente', 'tagente_modulo', array('id_agente_modulo' => $idAgentModule)); break; + case 'increment': + $description = $item['description']; + $idAgentModule = $item['id_agent_module']; + $idAgent = db_get_value_filter('id_agente', 'tagente_modulo', array('id_agente_modulo' => $idAgentModule)); + $period = $item['period']; + break; + case 'SLA_services': $description = $item['description']; $period = $item['period']; @@ -312,6 +318,9 @@ switch ($action) { $idAgent = db_get_value_filter('id_agente', 'tagente_modulo', array('id_agente_modulo' => $idAgentModule)); $idAgentModule = $item['id_agent_module']; $period = $item['period']; + $lapse = $item['lapse']; + $lapse_calc = $item['lapse_calc']; + $visual_format = $item['visual_format']; break; case 'max_value': $description = $item['description']; @@ -319,6 +328,9 @@ switch ($action) { $idAgent = db_get_value_filter('id_agente', 'tagente_modulo', array('id_agente_modulo' => $idAgentModule)); $idAgentModule = $item['id_agent_module']; $period = $item['period']; + $lapse = $item['lapse']; + $lapse_calc = $item['lapse_calc']; + $visual_format = $item['visual_format']; break; case 'min_value': $description = $item['description']; @@ -326,6 +338,9 @@ switch ($action) { $idAgent = db_get_value_filter('id_agente', 'tagente_modulo', array('id_agente_modulo' => $idAgentModule)); $idAgentModule = $item['id_agent_module']; $period = $item['period']; + $lapse = $item['lapse']; + $lapse_calc = $item['lapse_calc']; + $visual_format = $item['visual_format']; break; case 'sumatory': $description = $item['description']; @@ -593,6 +608,7 @@ switch ($action) { case 'MTTR': case 'simple_baseline_graph': case 'event_report_log': + case 'increment': $label = (isset($style['label'])) ? $style['label'] : ''; break; default: @@ -1580,6 +1596,78 @@ You can of course remove the warnings, that's why we include the source and do n ?> + + + + + + + + + + + + + + + + + + + + + + + + + +
'; + html_print_radio_button ('visual_format', 1, '', $visual_format_table,'',!$lapse_calc); + echo (''); + echo __('Graph only').''; + html_print_radio_button ('visual_format', 2, '', $visual_format_graph,'',!$lapse_calc); + echo (''); + echo __('Graph and table').''; + html_print_radio_button ('visual_format', 3, '', $visual_format_both,'',!$lapse_calc); + + ?> + + + + + @@ -2211,6 +2299,19 @@ $(document).ready (function () { } }); + $("#checkbox-lapse_calc").change(function () { + + if($(this).is(":checked")){ + $( "#lapse_select" ).prop( "disabled", false ); + $("[name=visual_format]").prop( "disabled", false ); + } + else{ + $( "#lapse_select" ).prop( "disabled", true ); + $("[name=visual_format]").prop( "disabled", true ); + } + + }); + }); function create_custom_graph() { @@ -2692,6 +2793,9 @@ function chooseType() { $("#row_show_in_two_columns").hide(); $("#row_show_in_same_row").hide(); $("#row_historical_db_check").hide(); + $("#row_lapse_calc").hide(); + $("#row_lapse").hide(); + $("#row_visual_format").hide(); $("#row_show_in_landscape").hide(); $('#row_hide_notinit_agents').hide(); $("#row_module_group").hide(); @@ -2763,6 +2867,13 @@ function chooseType() { $("#row_source").show(); $("#row_historical_db_check").hide(); break; + + case 'increment': + $("#row_description").show(); + $("#row_agent").show(); + $("#row_module").show(); + $("#row_period").show(); + break; case 'simple_graph': $("#row_time_compare_overlapped").show(); @@ -2884,6 +2995,9 @@ function chooseType() { $("#row_module").show(); $("#row_period").show(); $("#row_show_in_two_columns").show(); + $("#row_lapse_calc").show(); + $("#row_lapse").show(); + $("#row_visual_format").show(); $("#row_historical_db_check").hide(); break; @@ -2893,6 +3007,9 @@ function chooseType() { $("#row_module").show(); $("#row_period").show(); $("#row_show_in_two_columns").show(); + $("#row_lapse_calc").show(); + $("#row_lapse").show(); + $("#row_visual_format").show(); $("#row_historical_db_check").hide(); break; @@ -2902,6 +3019,9 @@ function chooseType() { $("#row_module").show(); $("#row_period").show(); $("#row_show_in_two_columns").show(); + $("#row_lapse_calc").show(); + $("#row_lapse").show(); + $("#row_visual_format").show(); $("#row_historical_db_check").hide(); break; diff --git a/pandora_console/godmode/reporting/reporting_builder.php b/pandora_console/godmode/reporting/reporting_builder.php index f2f780b911..e52994b810 100755 --- a/pandora_console/godmode/reporting/reporting_builder.php +++ b/pandora_console/godmode/reporting/reporting_builder.php @@ -1069,6 +1069,15 @@ switch ($action) { $values['period'] = get_parameter('period'); $good_format = true; break; + case 'min_value': + case 'max_value': + case 'avg_value': + $values['period'] = get_parameter('period'); + $values['lapse_calc'] = get_parameter('lapse_calc'); + $values['lapse'] = get_parameter('lapse'); + $values['visual_format'] = get_parameter('visual_format'); + $good_format = true; + break; default: $values['period'] = get_parameter('period'); $values['top_n'] = get_parameter('radiobutton_max_min_avg',0); @@ -1404,6 +1413,15 @@ switch ($action) { $values['period'] = get_parameter('period'); $good_format = true; break; + case 'min_value': + case 'max_value': + case 'avg_value': + $values['period'] = get_parameter('period'); + $values['lapse_calc'] = get_parameter('lapse_calc'); + $values['lapse'] = get_parameter('lapse'); + $values['visual_format'] = get_parameter('visual_format'); + $good_format = true; + break; default: $values['period'] = get_parameter('period'); $values['top_n'] = get_parameter('radiobutton_max_min_avg',0); diff --git a/pandora_console/godmode/reporting/visual_console_builder.editor.js b/pandora_console/godmode/reporting/visual_console_builder.editor.js index dbac5adb4b..a0b4a4bf46 100755 --- a/pandora_console/godmode/reporting/visual_console_builder.editor.js +++ b/pandora_console/godmode/reporting/visual_console_builder.editor.js @@ -32,8 +32,6 @@ var SIZE_GRID = 16; //Const the size (for width and height) of grid. var img_handler_start; var img_handler_end; -var font; - function toggle_advance_options_palette(close) { if ($("#advance_options").css('display') == 'none') { $("#advance_options").css('display', ''); @@ -59,23 +57,6 @@ function visual_map_main() { img_handler_end = data; }); - //Get the actual system font. - parameter = Array(); - parameter.push ({name: "page", value: "include/ajax/visual_console_builder.ajax"}); - parameter.push ({name: "action", value: "get_font"}); - parameter.push ({name: "id_visual_console", - value: id_visual_console}); - jQuery.ajax({ - url: get_url_ajax(), - data: parameter, - type: "POST", - dataType: 'json', - success: function (data) - { - font = data['font']; - } - }); - //Get the list of posible parents parents = Base64.decode($("input[name='parents_load']").val()); parents = eval("(" + parents + ")"); @@ -108,7 +89,7 @@ function visual_map_main() { if($('#process_value').val() != '0'){ $('#period_row').css('display','table-row'); } - } + } else{ $('#data_image_container').css('display','inline'); $('#data_image_check').css('display','inline'); @@ -289,6 +270,157 @@ function update_button_palette_callback() { } break; case 'group_item': + if((values['image'] == '' || values['image'] == 'none') && (values['label'] == '') && (values['show_statistics'] == false)){ + alert('Undefined image'); + return false; + } + + $("#text_" + idItem).html(values['label']); + + if(values['show_statistics'] == 1){ + + if (!$('#image_'+idItem).length) { + + if(values['label_position'] == 'left'){ + + var $image = $('') + .attr('id', 'image_' + idItem) + .attr('class', 'image') + .attr('src', 'images/console/icons/'+values["image"]+".png") + .attr('style','float:right;'); + + } + else if(values['label_position'] == 'right'){ + + var $image = $('') + .attr('id', 'image_' + idItem) + .attr('class', 'image') + .attr('src', 'images/console/icons/'+values["image"]+".png") + .attr('style','float:left;'); + + } + else{ + + var $image = $('') + .attr('id', 'image_' + idItem) + .attr('class', 'image') + .attr('src', 'images/console/icons/'+values["image"]+".png"); + + } + + + $('#'+idItem).append($image); + + } + + if ((values['width'] == 0) || (values['height'] == 0)) { + $("#image_" + idItem).removeAttr('width'); + $("#image_" + idItem).removeAttr('height'); + $("#image_" + idItem).attr('width', 520); + $("#image_" + idItem).attr('height', 80); + $("#image_" + idItem).css('width', '520px'); + $("#image_" + idItem).css('height', '80px'); + $("#image_" + idItem).attr('src', 'images/console/signes/group_status.png'); + + } + else { + $("#image_" + idItem).removeAttr('width'); + $("#image_" + idItem).removeAttr('height'); + $("#image_" + idItem).attr('width', values['width']); + $("#image_" + idItem).attr('height', values['height']); + $("#image_" + idItem).css('width', values['width'] + 'px'); + $("#image_" + idItem).css('height', values['height'] + 'px'); + $("#image_" + idItem).attr('src', 'images/console/signes/group_status.png'); + } + + } + else{ + + if ((values['width'] == 0) || (values['height'] == 0)) { + + if(values['image'] != '' && values['image'] != 'none'){ + + if (!$('#image_'+idItem).length) { + + if(values['label_position'] == 'left'){ + + var $image = $('') + .attr('id', 'image_' + idItem) + .attr('class', 'image') + .attr('src', 'images/console/icons/'+values["image"]+".png") + .attr('style','float:right;'); + + } + else if(values['label_position'] == 'right'){ + + var $image = $('') + .attr('id', 'image_' + idItem) + .attr('class', 'image') + .attr('src', 'images/console/icons/'+values["image"]+".png") + .attr('style','float:left;'); + + } + else{ + + var $image = $('') + .attr('id', 'image_' + idItem) + .attr('class', 'image') + .attr('src', 'images/console/icons/'+values["image"]+".png"); + + } + + + $('#'+idItem).append($image); + + } + + + if($('#preview > img')[0].naturalWidth > 150 || $('#preview > img')[0].naturalHeight > 150){ + $("#image_" + idItem).removeAttr('width'); + $("#image_" + idItem).removeAttr('height'); + $("#image_" + idItem).attr('width', 70); + $("#image_" + idItem).attr('height', 70); + $("#image_" + idItem).css('width', '70px'); + $("#image_" + idItem).css('height', '70px'); + } + else{ + $("#image_" + idItem).removeAttr('width'); + $("#image_" + idItem).removeAttr('height'); + + $("#image_" + idItem).attr('width', $('#preview > img')[0].naturalHeight); + $("#image_" + idItem).attr('height', $('#preview > img')[0].naturalHeight); + $("#image_" + idItem).css('width', $('#preview > img')[0].naturalHeight+'px'); + $("#image_" + idItem).css('height', $('#preview > img')[0].naturalHeight+'px'); + + + } + + } + else{ + $("#image_" + idItem).removeAttr('width'); + $("#image_" + idItem).removeAttr('height'); + $("#image_" + idItem).attr('width', 70); + $("#image_" + idItem).attr('height', 70); + $("#image_" + idItem).css('width', '70px'); + $("#image_" + idItem).css('height', '70px'); + $("#image_" + idItem).remove(); + } + + } + else { + $("#image_" + idItem).removeAttr('width'); + $("#image_" + idItem).removeAttr('height'); + $("#image_" + idItem).attr('width', values['width']); + $("#image_" + idItem).attr('height', values['height']); + $("#image_" + idItem).css('width', values['width'] + 'px'); + $("#image_" + idItem).css('height', values['height'] + 'px'); + } + + } + + + + break; case 'static_graph': if($('input[name=width]').val() == ''){ @@ -299,7 +431,7 @@ function update_button_palette_callback() { alert('Undefined height'); return false; } - if(((values['image'] == '') && (values['show_statistics']) == false)){ + if(((values['image'] == '' || values['image'] == 'none') && (values['label'] == ''))){ alert('Undefined image'); return false; } @@ -333,22 +465,75 @@ function update_button_palette_callback() { else{ if ((values['width'] == 0) || (values['height'] == 0)) { - if($('#preview > img')[0].naturalWidth > 150 || $('#preview > img')[0].naturalHeight > 150){ + + if(values['image'] != '' && values['image'] != 'none'){ + + if (!$('#image_'+idItem).length) { + + if(values['label_position'] == 'left'){ + + var $image = $('') + .attr('id', 'image_' + idItem) + .attr('class', 'image') + .attr('src', 'images/console/icons/'+values["image"]+".png") + .attr('style','float:right;'); + + } + else if(values['label_position'] == 'right'){ + + var $image = $('') + .attr('id', 'image_' + idItem) + .attr('class', 'image') + .attr('src', 'images/console/icons/'+values["image"]+".png") + .attr('style','float:left;'); + + } + else{ + + var $image = $('') + .attr('id', 'image_' + idItem) + .attr('class', 'image') + .attr('src', 'images/console/icons/'+values["image"]+".png"); + + } + + + $('#'+idItem).append($image); + + } + + + if($('#preview > img')[0].naturalWidth > 150 || $('#preview > img')[0].naturalHeight > 150){ + $("#image_" + idItem).removeAttr('width'); + $("#image_" + idItem).removeAttr('height'); + $("#image_" + idItem).attr('width', 70); + $("#image_" + idItem).attr('height', 70); + $("#image_" + idItem).css('width', '70px'); + $("#image_" + idItem).css('height', '70px'); + } + else{ + $("#image_" + idItem).removeAttr('width'); + $("#image_" + idItem).removeAttr('height'); + + $("#image_" + idItem).attr('width', $('#preview > img')[0].naturalHeight); + $("#image_" + idItem).attr('height', $('#preview > img')[0].naturalHeight); + $("#image_" + idItem).css('width', $('#preview > img')[0].naturalHeight+'px'); + $("#image_" + idItem).css('height', $('#preview > img')[0].naturalHeight+'px'); + + + } + + } + else{ $("#image_" + idItem).removeAttr('width'); $("#image_" + idItem).removeAttr('height'); $("#image_" + idItem).attr('width', 70); $("#image_" + idItem).attr('height', 70); $("#image_" + idItem).css('width', '70px'); $("#image_" + idItem).css('height', '70px'); + $("#image_" + idItem).remove(); } - else{ - $("#image_" + idItem).removeAttr('width'); - $("#image_" + idItem).removeAttr('height'); - $("#image_" + idItem).attr('width', $('#preview > img')[0].naturalHeight); - $("#image_" + idItem).attr('height', $('#preview > img')[0].naturalHeight); - $("#image_" + idItem).css('width', $('#preview > img')[0].naturalHeight+'px'); - $("#image_" + idItem).css('height', $('#preview > img')[0].naturalHeight+'px'); - } + } else { $("#image_" + idItem).removeAttr('width'); @@ -430,6 +615,11 @@ function update_button_palette_callback() { alert('Undefined width'); return false; } + + if($('input[name=bars_graph_height]').val() == ''){ + alert('Undefined height'); + return false; + } $("#text_" + idItem).html(values['label']); $("#image_" + idItem).attr("src", "images/spinner.gif"); @@ -457,21 +647,19 @@ function update_button_palette_callback() { break; case 'simple_value': $("#" + idItem).html(values['label']); - if( (values['label'].replace( /<.*?>/g, '' ) != '_VALUE_') - && (values['label'].replace( /<.*?>/g, '' ) != '(_VALUE_)') ){ - + + if($("#data_image_check").html() == "On"){ $("#text_" + idItem).html(''); $("#" + idItem).html(''); } else{ $("#text_" + idItem).html( - '
'+values["label"]+'
' + '
'+values["label"]+'
' ) $("#" + idItem).html( - '
'+values["label"]+'
' + '
'+values["label"]+'
' ) } - setModuleValue(idItem,values['process_simple_value'], values['period'],values['width']); break; case 'label': $("#text_" + idItem).html(values['label']); @@ -485,7 +673,7 @@ function update_button_palette_callback() { alert('Undefined height'); return false; } - if(values['image'] == ''){ + if(values['image'] == '' || values['image'] == 'none'){ alert('Undefined image'); return false; } @@ -559,7 +747,6 @@ function update_button_palette_callback() { $("#" + idItem + ' img').css('margin-top',(parseInt($("#" + idItem).css('height'))/2)-(parseInt($("#" + idItem + " img").css('height'))/2)+'px'); $("#" + idItem + ' > p').remove(); } - else if(values['label_position']=='down'){ $("#" + idItem + ' table').css('float',''); $("#" + idItem + ' img').css('float',''); @@ -567,15 +754,16 @@ function update_button_palette_callback() { $('#' + idItem + ' table').remove(); $('#' + idItem).append(tempoimg); $("#" + idItem + ' table').css('height',''); - $("#" + idItem + ' table').css('width','70'); - $("#" + idItem + ' span').css('width','70'); + if (selectedItem != 'simple_value') { + $("#" + idItem + ' table').css('width','70'); + $("#" + idItem + ' span').css('width','70'); + } + else { + $("#" + idItem + ' table').css('width',''); + $("#" + idItem + ' table').css('text-align','center'); + $("#" + idItem + ' span').css('width',''); + } $("#" + idItem + ' img').css('margin-top',''); - //if(parseInt($("#" + idItem).css('width'))-parseInt($("#" + idItem + " img").css('width'))/2 == 0 || values['height'] == 0 || values['width'] == 0){ - //$("#" + idItem + ' img').css('margin-left',(parseInt($("#" + idItem).css('width'))/2)-(parseInt($("#" + idItem + " img").css('width'))/2)+'px'); - //} - //else{ - //$("#" + idItem + ' img').css('margin-left',''); - //} $("#" + idItem + ' > p').remove(); } @@ -586,19 +774,19 @@ function update_button_palette_callback() { $('#' + idItem + ' img').remove(); $('#' + idItem).append(tempoimg); $("#" + idItem + ' table').css('height',''); - $("#" + idItem + ' table').css('width','70'); - $("#" + idItem + ' span').css('width','70'); + if (selectedItem != 'simple_value') { + $("#" + idItem + ' table').css('width','70'); + $("#" + idItem + ' span').css('width','70'); + } + else { + $("#" + idItem + ' table').css('width',''); + $("#" + idItem + ' table').css('text-align','center'); + $("#" + idItem + ' span').css('width',''); + } $("#" + idItem + ' img').css('margin-top',''); - //if(parseInt($("#" + idItem).css('width'))-parseInt($("#" + idItem + " img").css('width'))/2 == 0 || values['height'] == 0 || values['width'] == 0){ - //$("#" + idItem + ' img').css('margin-left',''); - - //} - //else{ - //$("#" + idItem + ' img').css('margin-left',(parseInt($("#" + idItem).css('width'))/2)-(parseInt($("#" + idItem + " img").css('width'))/2)+'px'); - //} + $("#" + idItem + ' > p').remove(); } - } function readFields() { @@ -617,6 +805,8 @@ function readFields() { values['top'] = $("input[name=top]").val(); values['agent'] = $("input[name=agent]").val(); values['id_agent'] = $("input[name=id_agent]").val(); + values['agent_string'] = $("input[name=agent_string]").val(); + values['id_agent_string'] = $("input[name=id_agent_string]").val(); values['module'] = $("select[name=module]").val(); values['process_simple_value'] = $("select[name=process_value]").val(); values['background'] = $("#background_image").val(); @@ -632,7 +822,9 @@ function readFields() { values['bars_graph_type'] = $("select[name=bars_graph_type]").val(); values['parent'] = $("select[name=parent]").val(); values['map_linked'] = $("select[name=map_linked]").val(); + values['map_linked_weight'] = $("select[name=map_linked_weight]").val(); values['width_percentile'] = $("input[name=width_percentile]").val(); + values['bars_graph_height'] = $("input[name=bars_graph_height]").val(); values['max_percentile'] = parseInt($("input[name=max_percentile]").val()); values['width_module_graph'] = $("input[name=width_module_graph]").val(); values['height_module_graph'] = $("input[name=height_module_graph]").val(); @@ -652,6 +844,8 @@ function readFields() { values['height_box'] = parseInt( $("input[name='height_box']").val()); values['border_color'] = $("input[name='border_color']").val(); + values['resume_color'] = $("input[name='resume_color']").val(); + values['grid_color'] = $("input[name='grid_color']").val(); values['border_width'] = parseInt( $("input[name='border_width']").val()); values['fill_color'] = $("input[name='fill_color']").val(); @@ -697,6 +891,11 @@ function create_button_palette_callback() { } break; case 'group_item': + if((values['image'] == '' || values['image'] == 'none') && (values['label'] == '') && (values['show_statistics'] == false)){ + alert('Undefined images'); + validate = false; + } + break; case 'static_graph': if ((values['width'] == '')) { alert('Undefined width'); @@ -706,10 +905,11 @@ function create_button_palette_callback() { alert('Undefined height'); validate = false; } - if((values['image'] == '') && (values['show_statistics']) == false){ + if((values['image'] == '' || values['image'] == 'none') && (values['label']) == false){ alert('Undefined image'); validate = false; } + break; case 'auto_sla_graph': @@ -719,7 +919,7 @@ function create_button_palette_callback() { } break; case 'donut_graph': - if ((values['agent'] == '')) { + if ((values['agent_string'] == '')) { alert($("#message_alert_no_agent").html()); validate = false; } @@ -739,7 +939,7 @@ function create_button_palette_callback() { alert('Undefined height'); validate = false; } - if ((values['image'] == '')) { + if ((values['image'] == '' || values['image'] == 'none')) { alert($("#message_alert_no_image").html()); validate = false; } @@ -792,7 +992,7 @@ function create_button_palette_callback() { } break; case 'bars_graph': - if ((values['agent'] == '')) { + if ((values['agent_string'] == '')) { alert($("#message_alert_no_agent").html()); validate = false; } @@ -800,6 +1000,14 @@ function create_button_palette_callback() { alert($("#message_alert_no_module").html()); validate = false; } + if ((values['width_percentile'] == '')) { + alert($("#message_alert_no_width_percentile").html()); + validate = false; + } + if ((values['bars_graph_height'] == '')) { + alert($("#message_alert_no_bars_graph_height").html()); + validate = false; + } break; case 'simple_value': if ((values['agent'] == '')) { @@ -1251,11 +1459,16 @@ function loadFieldsFromDB(item) { if (key == 'pos_y') $("input[name=top]").val(val); if (key == 'agent_name') { $("input[name=agent]").val(val); + $("input[name=agent_string]").val(val); //Reload no-sincrone the select of modules } + if (key == 'id_agent') { $("input[name=id_agent]").val(val); } + if (key == 'id_agent_string') { + $("input[name=id_agent_string]").val(val); + } if (key == 'modules_html') { $("select[name=module]").empty().html(val); $("select[name=module]").val(moduleId); @@ -1298,8 +1511,12 @@ function loadFieldsFromDB(item) { $("select[name=parent]").val(val); if (key == 'id_layout_linked') $("select[name=map_linked]").val(val); + if (key == 'id_layout_linked_weight') + $("select[name=map_linked_weight]").val(val); if (key == 'width_percentile') $("input[name=width_percentile]").val(val); + if (key == 'bars_graph_height') + $("input[name=bars_graph_height]").val(val); if (key == 'max_percentile') $("input[name=max_percentile]").val(val); if (key == 'width_module_graph') @@ -1324,14 +1541,7 @@ function loadFieldsFromDB(item) { } if (key == 'value_show') { - if (val == 'percent') { - $("input[name=value_show][value=percent]") - .attr("checked", "checked"); - } - else { - $("input[name=value_show][value=value]") - .attr("checked", "checked"); - } + $("select[name=value_show]").val(val); } if (key == 'id_group') { @@ -1357,6 +1567,16 @@ function loadFieldsFromDB(item) { $("#border_color_row .ColorPickerDivSample") .css('background-color', val); } + if (key == 'grid_color') { + $("input[name='grid_color']").val(val); + $("#grid_color_row .ColorPickerDivSample") + .css('background-color', val); + } + if (key == 'resume_color') { + $("input[name='resume_color']").val(val); + $("#resume_color_row .ColorPickerDivSample") + .css('background-color', val); + } if (key == 'border_width') $("input[name='border_width']").val(val); if (key == 'fill_color') { @@ -1520,6 +1740,9 @@ function hiddenFields(item) { $("#agent_row").css('display', 'none'); $("#agent_row." + item).css('display', ''); + $("#agent_row_string").css('display', 'none'); + $("#agent_row_string." + item).css('display', ''); + $("#module_row").css('display', 'none'); $("#module_row." + item).css('display', ''); @@ -1547,6 +1770,9 @@ function hiddenFields(item) { $("#percentile_bar_row_1").css('display', 'none'); $("#percentile_bar_row_1." + item).css('display', ''); + $("#height_bars_graph_row").css('display', 'none'); + $("#height_bars_graph_row." + item).css('display', ''); + $("#percentile_bar_row_2").css('display', 'none'); $("#percentile_bar_row_2." + item).css('display', ''); @@ -1577,6 +1803,9 @@ function hiddenFields(item) { $("#map_linked_row").css('display', 'none'); $("#map_linked_row." + item).css('display', ''); + $("#map_linked_weight").css('display', 'none'); + $("#map_linked_weight." + item).css('display', ''); + $("#module_graph_size_row").css('display', 'none'); $("#module_graph_size_row." + item).css('display', ''); @@ -1601,6 +1830,12 @@ function hiddenFields(item) { $("#border_color_row").css('display', 'none'); $("#border_color_row." + item).css('display', ''); + $("#grid_color_row").css('display', 'none'); + $("#grid_color_row." + item).css('display', ''); + + $("#resume_color_row").css('display', 'none'); + $("#resume_color_row." + item).css('display', ''); + $("#border_width_row").css('display', 'none'); $("#border_width_row." + item).css('display', ''); @@ -1638,21 +1873,26 @@ function cleanFields(item) { $("input[name=left]").val(0); $("input[name=top]").val(0); $("input[name=agent]").val(''); + $("input[name=agent_string]").val(''); $("select[name=module]").val(''); $("select[name=process_value]").val(0); $("select[name=background_image]").val(''); $("input[name=width_percentile]").val(''); + $("input[name=bars_graph_height]").val(''); $("input[name=max_percentile]").val(''); $("select[name=period]").val(''); $("input[name=width]").val(0); $("input[name=height]").val(0); $("select[name=parent]").val(''); $("select[name=map_linked]").val(''); + $("select[name=map_linked_weight]").val(''); $("input[name=width_module_graph]").val(300); $("input[name=height_module_graph]").val(180); $("input[name='width_box']").val(300); $("input[name='height_box']").val(180); $("input[name='border_color']").val('#000000'); + $("input[name='grid_color']").val('#000000'); + $("input[name='resume_color']").val('#000000'); $("input[name='border_width']").val(3); $("input[name='fill_color']").val('#ffffff'); $("input[name='line_width']").val(3); @@ -1811,12 +2051,13 @@ function setBarsGraph(id_data, values) { } width_percentile = values['width_percentile']; + bars_graph_height = values['bars_graph_height']; parameter = Array(); parameter.push ({name: "page", value: "include/ajax/visual_console_builder.ajax"}); parameter.push ({name: "action", value: "get_module_type_string"}); - parameter.push ({name: "id_agent", value: values['id_agent']}); + parameter.push ({name: "id_agent", value: values['id_agent_string']}); parameter.push ({name: "module", value: values['module']}); parameter.push ({name: "id_element", value: id_data}); parameter.push ({name: "id_visual_console", value: id_visual_console}); @@ -1826,28 +2067,16 @@ function setBarsGraph(id_data, values) { type: "POST", dataType: 'json', success: function (data) { - if (data['no_data'] == true) { - if (values['width_percentile'] == "0") { - $("#" + id_data + " img").attr('src', url_hack_metaconsole + 'images/console/signes/barras-no.png'); - } - else { - $("#" + id_data + " img").attr('src', url_hack_metaconsole + 'images/console/signes/barras-no.png'); - $("#" + id_data + " img").css('width', width_percentile + 'px'); - $("#" + id_data + " img").css('height', width_percentile + 'px'); - } + $("#" + id_data + " img").attr('src', url_hack_metaconsole + 'images/console/signes/barras.png'); + + if (values['width_percentile'] == "0" && values["bars_graph_height"] == "0") { + // Image size } - else { - $("#" + id_data + " img").attr('src', url_hack_metaconsole + 'images/console/signes/barras.png'); - - if (values['width_percentile'] == "0") { - // Image size - } - else{ - $("#" + id_data + " img").css('width', width_percentile+'px'); - $("#" + id_data + " img").css('height', width_percentile+'px'); - } + else{ + $("#" + id_data + " img").css('width', width_percentile + 'px'); + $("#" + id_data + " img").css('height', bars_graph_height + 'px'); } - + if($('#'+id_data+' table').css('float') == 'right' || $('#'+id_data+ ' table').css('float') == 'left'){ $('#'+id_data+ ' img').css('margin-top', parseInt($('#'+id_data).css('height'))/2 - parseInt($('#'+id_data+ ' img').css('height'))/2); } @@ -1951,7 +2180,7 @@ function setModuleGraph(id_data) { } -function setModuleValue(id_data, process_simple_value, period,width_data_image) { +function setModuleValue(id_data, process_simple_value, period, width_data_image) { var parameter = Array(); parameter.push ({name: "page", value: "include/ajax/visual_console_builder.ajax"}); parameter.push ({name: "action", value: "get_module_value"}); @@ -1969,12 +2198,9 @@ function setModuleValue(id_data, process_simple_value, period,width_data_image) type: "POST", dataType: 'json', success: function (data) { + var currentValue = $("#text_" + id_data).html(); - var currentValue = $("#text_" + id_data).html(); - - //currentValue = currentValue.replace(/_VALUE_/gi, data.value); $("#text_" + id_data).html(currentValue); - //$("#text_" + id_data).html('Data value'); } }); } @@ -2027,9 +2253,9 @@ function setPercentileBar(id_data, values) { value_text = module_value + " " + unit_text; } - var img = url_hack_metaconsole + 'include/graphs/fgraph.php?homeurl=../../&graph_type=progressbar&height=15&' + + var img = url_hack_metaconsole + 'include/graphs/fgraph.php?graph_type=progressbar&height=15&' + 'width=' + width_percentile + '&mode=1&progress=' + percentile + - '&font=' + font + '&value_text=' + value_text + '&colorRGB=' + colorRGB; + '&value_text=' + value_text + '&colorRGB=' + colorRGB; $("#"+ id_data).attr('src', img); @@ -2253,7 +2479,7 @@ function setDonutsGraph (id_data, values) { parameter.push ({name: "page", value: "include/ajax/visual_console_builder.ajax"}); parameter.push ({name: "action", value: "get_module_type_string"}); - parameter.push ({name: "id_agent", value: values['id_agent']}); + parameter.push ({name: "id_agent", value: values['id_agent_string']}); parameter.push ({name: "module", value: values['module']}); parameter.push ({name: "id_element", value: id_data}); parameter.push ({name: "id_visual_console", value: id_visual_console}); @@ -2276,7 +2502,7 @@ function setDonutsGraph (id_data, values) { else { $("#" + id_data + " img").attr('src', url_hack_metaconsole + 'images/console/signes/donut-graph.png'); - if($('#text-width').val() == 0 || $('#text-height').val() == 0){ + if($('#text-width_percentile').val() == 0){ // Image size } else{ @@ -2333,9 +2559,9 @@ function setPercentileBubble(id_data, values) { value_text = module_value + " " + unit_text; } - var img = url_hack_metaconsole + 'include/graphs/fgraph.php?homeurl=../../&graph_type=progressbubble&height=' + width_percentile + '&' + + var img = url_hack_metaconsole + 'include/graphs/fgraph.php?graph_type=progressbubble&height=' + width_percentile + '&' + 'width=' + width_percentile + '&mode=1&progress=' + percentile + - '&font=' + font + '&value_text=' + value_text + '&colorRGB=' + colorRGB; + '&value_text=' + value_text + '&colorRGB=' + colorRGB; $("#image_" + id_data).attr('src', img); @@ -2478,6 +2704,262 @@ function createItem(type, values, id_data) { break; case 'group_item': + + switch (type) { + case 'group_item': + class_type = "group_item"; + break; + case 'static_graph': + class_type = "static_graph"; + break; + } + + img_src = "images/spinner.gif"; + + item = $('
') + .attr('id', id_data) + .attr('class', 'item ' + class_type) + .css('text-align', 'left') + .css('position', 'absolute') + .css('display', 'inline-block') + .css('top', values['top'] + 'px') + .css('left', values['left'] + 'px'); + + + + if(values['show_statistics'] != 1){ + if(values['label_position'] == 'left'){ + + var $image = $('') + .attr('id', 'image_' + id_data) + .attr('class', 'image') + .attr('src', 'images/console/signes/group_status.png') + .attr('style','float:right;'); + + } + else if(values['label_position'] == 'right'){ + + var $image = $('') + .attr('id', 'image_' + id_data) + .attr('class', 'image') + .attr('src', 'images/console/signes/group_status.png') + .attr('style','float:left;'); + + } + else{ + + var $image = $('') + .attr('id', 'image_' + id_data) + .attr('class', 'image') + .attr('src', 'images/console/signes/group_status.png'); + + } + } + else{ + if(values['label_position'] == 'left'){ + + var $image = $('') + .attr('id', 'image_' + id_data) + .attr('class', 'image') + .attr('src', img_src) + .attr('style','float:right;'); + + } + else if(values['label_position'] == 'right'){ + + var $image = $('') + .attr('id', 'image_' + id_data) + .attr('class', 'image') + .attr('src', img_src) + .attr('style','float:left;'); + + } + else{ + + var $image = $('') + .attr('id', 'image_' + id_data) + .attr('class', 'image') + .attr('src', img_src); + + } + } + + + + if(values['show_statistics'] != 1){ + + if ((values['width'] == 0) || (values['height'] == 0)) { + // Do none + if(values['image'] != '' && values['image'] != 'none'){ + + if($('#preview > img')[0].naturalWidth > 150 || $('#preview > img')[0].naturalHeight > 150){ + $image.attr('width', '70') + .attr('height', '70'); + } + else{ + $image.attr('width', $('#preview > img')[0].naturalWidth) + .attr('height', $('#preview > img')[0].naturalHeight); + } + + + } + else{ + $image.attr('width', '70') + .attr('height', '70'); + } + + + } + else { + $image.attr('width', values['width']) + .attr('height', values['height']); + } + } + + var $input = $('') + .attr('id', 'hidden-status_' + id_data) + .attr('type', 'hidden') + .attr('value', -1) + .attr('name', 'status_' + id_data); + + if(values['label_position'] == 'up'){ + + if(values['image'] == '' || values['image'] == 'none'){ + item + .append('
'+values['label']+'
') + .append($input); + } + else{ + item + .append('
'+values['label']+'
') + .append($image) + .append($image) + .append($input); + } + + } + else if(values['label_position'] == 'down'){ + + if(values['image'] == '' || values['image'] == 'none'){ + item + .append('
'+values['label']+'
') + .append($input); + + } + else{ + item + .append($image) + .append($image) + .append('
'+values['label']+'
') + .append($input); + } + + } + else if(values['label_position'] == 'left'){ + + if(values['height'] == 0){ + item + .append('
'+values['label']+'
'); + } + else{ + item + .append('
'+values['label']+'
') + } + + if(values['image'] == '' || values['image'] == 'none'){ + item + .append($input); + } + else{ + item + .append($image) + .append($image) + .append($input); + } + + + } + else if(values['label_position'] == 'right'){ + if(values['height'] == 0){ + item + .append('
'+values['label']+'
'); + } + else{ + item + .append('
'+values['label']+'
') + } + + if(values['image'] == '' || values['image'] == 'none'){ + item + .append($input); + } + else{ + item + .append($image) + .append($image) + .append($input); + } + + + + } + + if(values['show_statistics'] != 1){ + set_static_graph_status(id_data, values['image']); + } + else{ + set_static_graph_status(id_data, 'show_statistics'); + } + + if(values['show_statistics'] != 1){ + + if ((values['width'] == 0) || (values['height'] == 0)) { + + if(values['image'] != '' && values['image'] != 'none'){ + // Do none + if($('#preview > img')[0].naturalWidth > 150 || $('#preview > img')[0].naturalHeight > 150){ + $image.attr('width', '70') + .attr('height', '70'); + } + else{ + $image.attr('width', $('#preview > img')[0].naturalWidth) + .attr('height', $('#preview > img')[0].naturalHeight); + } + } + else{ + $image.attr('width', '70') + .attr('height', '70'); + } + } + else { + $image.attr('width', values['width']) + .attr('height', values['height']); + } + } + else{ + if ((values['width'] == 0) || (values['height'] == 0)) { + $("#image_" + idItem).removeAttr('width'); + $("#image_" + idItem).removeAttr('height'); + $("#image_" + idItem).attr('width', 520); + $("#image_" + idItem).attr('height', 80); + $("#image_" + idItem).css('width', '520px'); + $("#image_" + idItem).css('height', '80px'); + $("#image_" + idItem).attr('src', 'images/console/signes/group_status.png'); + + } + else { + $("#image_" + idItem).removeAttr('width'); + $("#image_" + idItem).removeAttr('height'); + $("#image_" + idItem).attr('width', values['width']); + $("#image_" + idItem).attr('height', values['height']); + $("#image_" + idItem).css('width', values['width'] + 'px'); + $("#image_" + idItem).css('height', values['height'] + 'px'); + $("#image_" + idItem).attr('src', 'images/console/signes/group_status.png'); + } + } + + break; + case 'static_graph': switch (type) { case 'group_item': @@ -2532,6 +3014,8 @@ function createItem(type, values, id_data) { if ((values['width'] == 0) || (values['height'] == 0)) { // Do none + if(values['image'] != '' && values['image'] != 'none'){ + if($('#preview > img')[0].naturalWidth > 150 || $('#preview > img')[0].naturalHeight > 150){ $image.attr('width', '70') .attr('height', '70'); @@ -2539,7 +3023,16 @@ function createItem(type, values, id_data) { else{ $image.attr('width', $('#preview > img')[0].naturalWidth) .attr('height', $('#preview > img')[0].naturalHeight); - } + } + + + } + else{ + $image.attr('width', '70') + .attr('height', '70'); + } + + } else { $image.attr('width', values['width']) @@ -2564,19 +3057,37 @@ function createItem(type, values, id_data) { .attr('name', 'status_' + id_data); if(values['label_position'] == 'up'){ - item - .append('
'+values['label']+'
') - .append($image) - .append($image) - .append($input); + + if(values['image'] == '' || values['image'] == 'none'){ + item + .append('
'+values['label']+'
') + .append($input); + } + else{ + item + .append('
'+values['label']+'
') + .append($image) + .append($image) + .append($input); + } } else if(values['label_position'] == 'down'){ - item - .append($image) - .append($image) - .append('
'+values['label']+'
') - .append($input); + + if(values['image'] == '' || values['image'] == 'none'){ + item + .append('
'+values['label']+'
') + .append($input); + + } + else{ + item + .append($image) + .append($image) + .append('
'+values['label']+'
') + .append($input); + } + } else if(values['label_position'] == 'left'){ @@ -2588,10 +3099,19 @@ function createItem(type, values, id_data) { item .append('
'+values['label']+'
') } + + if(values['image'] == '' || values['image'] == 'none'){ + item + .append($input); + } + else{ item .append($image) .append($image) - .append($input); + .append($input); + } + + } else if(values['label_position'] == 'right'){ if(values['height'] == 0){ @@ -2602,10 +3122,20 @@ function createItem(type, values, id_data) { item .append('
'+values['label']+'
') } + + if(values['image'] == '' || values['image'] == 'none'){ + item + .append($input); + } + else{ item .append($image) .append($image) - .append($input); + .append($input); + } + + + } if(values['show_statistics'] != 1){ @@ -2618,15 +3148,22 @@ function createItem(type, values, id_data) { if(values['show_statistics'] != 1){ if ((values['width'] == 0) || (values['height'] == 0)) { + + if(values['image'] != '' && values['image'] != 'none'){ // Do none - if($('#preview > img')[0].naturalWidth > 150 || $('#preview > img')[0].naturalHeight > 150){ - $image.attr('width', '70') - .attr('height', '70'); + if($('#preview > img')[0].naturalWidth > 150 || $('#preview > img')[0].naturalHeight > 150){ + $image.attr('width', '70') + .attr('height', '70'); + } + else{ + $image.attr('width', $('#preview > img')[0].naturalWidth) + .attr('height', $('#preview > img')[0].naturalHeight); + } } else{ - $image.attr('width', $('#preview > img')[0].naturalWidth) - .attr('height', $('#preview > img')[0].naturalHeight); - } + $image.attr('width', '70') + .attr('height', '70'); + } } else { $image.attr('width', values['width']) @@ -2881,7 +3418,6 @@ function createItem(type, values, id_data) { item = $('
' + ' ' + values['label'] + ' ' + '
' ); - setModuleValue(id_data,values.process_simple_value,values.period,values.width_data_image); break; case 'label': item = $('
0){ - $("#data_image_check").css('display','inline'); - $("#data_image_check_label").css('display','inline'); - $('#data_image_container').css('display','inline'); - $("#data_image_check").html('On'); - $('.block_tinymce').remove(); - $('#label_row').append('
'); - $('#process_value_row').css('display','none'); - $('#period_row').css('display','none'); - } - else{ - $("#data_image_check").html('Off'); - $("#data_image_check").css('display','none'); - $("#data_image_check_label").css('display','none'); - $('#data_image_container').css('display','none'); - $('.block_tinymce').remove(); - $('#process_value_row').css('display','table-row'); - if($('#process_value').val() != 0){ - $('#period_row').css('display','table-row'); + + parameter = Array(); + parameter.push ({name: "page", value: "include/ajax/visual_console_builder.ajax"}); + parameter.push ({name: "action", value: "get_image_from_module"}); + parameter.push ({name: "id_element", value: idItem}); + parameter.push ({name: "id_visual_console", value: id_visual_console}); + + jQuery.ajax({ + url: "ajax.php", + data: parameter, + type: "POST", + dataType: "json", + success: function(data) { + if(!data['correct']){ + $("#data_image_check").html('Off'); + $('#data_image_container').css('display','none'); + $('#data_image_check').css('display','none'); + $('#data_image_check_label').css('display','none'); + $('.block_tinymce').remove(); + $('#process_value_row').css('display','table-row'); + if($('#process_value').val() != '0'){ + $('#period_row').css('display','table-row'); + } + } + else{ + $('#data_image_container').css('display','inline'); + $('#data_image_check').css('display','inline'); + $('#data_image_check_label').css('display','inline'); + $("#data_image_check").html('On'); + $('#process_value_row').css('display','none'); + $('#period_row').css('display','none'); + $('#text-label_ifr').contents().find('#tinymce').html('_VALUE_'); + $('.block_tinymce').remove(); + $('#label_row').append('
'); + } } - } + }); } else{ $("#data_image_check").css('display','none'); @@ -4226,7 +4770,7 @@ function showPreviewStaticGraph(staticGraph) { .css('text-align', 'right') .append($spinner); - if(staticGraph == ''){ + if(staticGraph == '' || staticGraph == 'none'){ if (is_metaconsole()) { $spinner.prop("src", "../../images/image_problem_area.png"); @@ -4282,7 +4826,7 @@ function showPreviewIcon(icon) { .append($spinner); - if (icon == '') { + if (icon == '' || icon == 'none') { if (is_metaconsole()) { $spinner.prop("src", "../../images/image_problem_area.png"); } diff --git a/pandora_console/images/groups_small/application_osx_terminal.bad.png b/pandora_console/images/groups_small/application_osx_terminal.bad.png index ccc8f3f04d..3862246d9e 100644 Binary files a/pandora_console/images/groups_small/application_osx_terminal.bad.png and b/pandora_console/images/groups_small/application_osx_terminal.bad.png differ diff --git a/pandora_console/images/groups_small/application_osx_terminal.default.png b/pandora_console/images/groups_small/application_osx_terminal.default.png index 85f0016ce2..7ddaec3117 100644 Binary files a/pandora_console/images/groups_small/application_osx_terminal.default.png and b/pandora_console/images/groups_small/application_osx_terminal.default.png differ diff --git a/pandora_console/images/groups_small/application_osx_terminal.ok.png b/pandora_console/images/groups_small/application_osx_terminal.ok.png index 0678cb09a1..1da9e887bf 100644 Binary files a/pandora_console/images/groups_small/application_osx_terminal.ok.png and b/pandora_console/images/groups_small/application_osx_terminal.ok.png differ diff --git a/pandora_console/images/groups_small/application_osx_terminal.warning.png b/pandora_console/images/groups_small/application_osx_terminal.warning.png index e95f210a5f..41fcb8eaf0 100644 Binary files a/pandora_console/images/groups_small/application_osx_terminal.warning.png and b/pandora_console/images/groups_small/application_osx_terminal.warning.png differ diff --git a/pandora_console/images/groups_small/bricks.bad.png b/pandora_console/images/groups_small/bricks.bad.png index 0a0cd5459f..5f22537353 100644 Binary files a/pandora_console/images/groups_small/bricks.bad.png and b/pandora_console/images/groups_small/bricks.bad.png differ diff --git a/pandora_console/images/groups_small/bricks.default.png b/pandora_console/images/groups_small/bricks.default.png index 14d8bab5ca..1fccda728d 100644 Binary files a/pandora_console/images/groups_small/bricks.default.png and b/pandora_console/images/groups_small/bricks.default.png differ diff --git a/pandora_console/images/groups_small/bricks.ok.png b/pandora_console/images/groups_small/bricks.ok.png index 931d1a389c..304efe93df 100644 Binary files a/pandora_console/images/groups_small/bricks.ok.png and b/pandora_console/images/groups_small/bricks.ok.png differ diff --git a/pandora_console/images/groups_small/bricks.png b/pandora_console/images/groups_small/bricks.png index c234efafb6..d197f3fd56 100644 Binary files a/pandora_console/images/groups_small/bricks.png and b/pandora_console/images/groups_small/bricks.png differ diff --git a/pandora_console/images/groups_small/bricks.warning.png b/pandora_console/images/groups_small/bricks.warning.png index bbfeb0ce3f..0345d612f3 100644 Binary files a/pandora_console/images/groups_small/bricks.warning.png and b/pandora_console/images/groups_small/bricks.warning.png differ diff --git a/pandora_console/images/groups_small/chart_organisation.bad.png b/pandora_console/images/groups_small/chart_organisation.bad.png index 410cd5116c..51771a4664 100644 Binary files a/pandora_console/images/groups_small/chart_organisation.bad.png and b/pandora_console/images/groups_small/chart_organisation.bad.png differ diff --git a/pandora_console/images/groups_small/chart_organisation.default.png b/pandora_console/images/groups_small/chart_organisation.default.png index 53619a608b..597c229fa0 100644 Binary files a/pandora_console/images/groups_small/chart_organisation.default.png and b/pandora_console/images/groups_small/chart_organisation.default.png differ diff --git a/pandora_console/images/groups_small/chart_organisation.ok.png b/pandora_console/images/groups_small/chart_organisation.ok.png index ca7f04061b..5d34f43765 100644 Binary files a/pandora_console/images/groups_small/chart_organisation.ok.png and b/pandora_console/images/groups_small/chart_organisation.ok.png differ diff --git a/pandora_console/images/groups_small/chart_organisation.warning.png b/pandora_console/images/groups_small/chart_organisation.warning.png index c9ba529187..7dac5502fc 100644 Binary files a/pandora_console/images/groups_small/chart_organisation.warning.png and b/pandora_console/images/groups_small/chart_organisation.warning.png differ diff --git a/pandora_console/images/groups_small/clock.bad.png b/pandora_console/images/groups_small/clock.bad.png index f281439c87..c1241ce275 100644 Binary files a/pandora_console/images/groups_small/clock.bad.png and b/pandora_console/images/groups_small/clock.bad.png differ diff --git a/pandora_console/images/groups_small/clock.default.png b/pandora_console/images/groups_small/clock.default.png index 2b7a58aa20..b8d58d6dec 100644 Binary files a/pandora_console/images/groups_small/clock.default.png and b/pandora_console/images/groups_small/clock.default.png differ diff --git a/pandora_console/images/groups_small/clock.ok.png b/pandora_console/images/groups_small/clock.ok.png index a3cb173d9e..1ab3c8383f 100644 Binary files a/pandora_console/images/groups_small/clock.ok.png and b/pandora_console/images/groups_small/clock.ok.png differ diff --git a/pandora_console/images/groups_small/clock.warning.png b/pandora_console/images/groups_small/clock.warning.png index 20880b31df..a06ceda51f 100644 Binary files a/pandora_console/images/groups_small/clock.warning.png and b/pandora_console/images/groups_small/clock.warning.png differ diff --git a/pandora_console/images/groups_small/drive.network.bad.png b/pandora_console/images/groups_small/drive.network.bad.png new file mode 100644 index 0000000000..886ca44d2b Binary files /dev/null and b/pandora_console/images/groups_small/drive.network.bad.png differ diff --git a/pandora_console/images/groups_small/drive_network.default.png b/pandora_console/images/groups_small/drive_network.default.png index 428b2eb2a4..2fd2519029 100644 Binary files a/pandora_console/images/groups_small/drive_network.default.png and b/pandora_console/images/groups_small/drive_network.default.png differ diff --git a/pandora_console/images/groups_small/drive_network.ok.png b/pandora_console/images/groups_small/drive_network.ok.png index dbe58f007c..c84acaa7f4 100644 Binary files a/pandora_console/images/groups_small/drive_network.ok.png and b/pandora_console/images/groups_small/drive_network.ok.png differ diff --git a/pandora_console/images/groups_small/drive_network.warning.png b/pandora_console/images/groups_small/drive_network.warning.png index 0dbdd4b2a5..3abda093e3 100644 Binary files a/pandora_console/images/groups_small/drive_network.warning.png and b/pandora_console/images/groups_small/drive_network.warning.png differ diff --git a/pandora_console/images/groups_small/email.bad.png b/pandora_console/images/groups_small/email.bad.png index 064222d63e..78a2ed0913 100644 Binary files a/pandora_console/images/groups_small/email.bad.png and b/pandora_console/images/groups_small/email.bad.png differ diff --git a/pandora_console/images/groups_small/email.default.png b/pandora_console/images/groups_small/email.default.png index 1486cd82a0..e07d9c3022 100644 Binary files a/pandora_console/images/groups_small/email.default.png and b/pandora_console/images/groups_small/email.default.png differ diff --git a/pandora_console/images/groups_small/email.ok.png b/pandora_console/images/groups_small/email.ok.png index 681fc2ddfa..5d5fca4f0c 100644 Binary files a/pandora_console/images/groups_small/email.ok.png and b/pandora_console/images/groups_small/email.ok.png differ diff --git a/pandora_console/images/groups_small/email.warning.png b/pandora_console/images/groups_small/email.warning.png index b08c99d7c1..10662435e1 100644 Binary files a/pandora_console/images/groups_small/email.warning.png and b/pandora_console/images/groups_small/email.warning.png differ diff --git a/pandora_console/images/groups_small/eye.bad.png b/pandora_console/images/groups_small/eye.bad.png index f8191a1b17..9c08baf0a3 100644 Binary files a/pandora_console/images/groups_small/eye.bad.png and b/pandora_console/images/groups_small/eye.bad.png differ diff --git a/pandora_console/images/groups_small/eye.default.png b/pandora_console/images/groups_small/eye.default.png index cd852b7502..a8dc65e8be 100644 Binary files a/pandora_console/images/groups_small/eye.default.png and b/pandora_console/images/groups_small/eye.default.png differ diff --git a/pandora_console/images/groups_small/eye.ok.png b/pandora_console/images/groups_small/eye.ok.png index 0da4304f71..abf8578709 100644 Binary files a/pandora_console/images/groups_small/eye.ok.png and b/pandora_console/images/groups_small/eye.ok.png differ diff --git a/pandora_console/images/groups_small/eye.warning.png b/pandora_console/images/groups_small/eye.warning.png index 65a5722201..2bd3af45f8 100644 Binary files a/pandora_console/images/groups_small/eye.warning.png and b/pandora_console/images/groups_small/eye.warning.png differ diff --git a/pandora_console/images/groups_small/heart.bad.png b/pandora_console/images/groups_small/heart.bad.png index ff3008fcc4..f9da31b2c5 100644 Binary files a/pandora_console/images/groups_small/heart.bad.png and b/pandora_console/images/groups_small/heart.bad.png differ diff --git a/pandora_console/images/groups_small/heart.default.png b/pandora_console/images/groups_small/heart.default.png index a7cfff0cc3..73a101809a 100644 Binary files a/pandora_console/images/groups_small/heart.default.png and b/pandora_console/images/groups_small/heart.default.png differ diff --git a/pandora_console/images/groups_small/heart.ok.png b/pandora_console/images/groups_small/heart.ok.png index 0f0798523d..0b2b4e0653 100644 Binary files a/pandora_console/images/groups_small/heart.ok.png and b/pandora_console/images/groups_small/heart.ok.png differ diff --git a/pandora_console/images/groups_small/heart.warning.png b/pandora_console/images/groups_small/heart.warning.png index 66b8583393..f97cc1251b 100644 Binary files a/pandora_console/images/groups_small/heart.warning.png and b/pandora_console/images/groups_small/heart.warning.png differ diff --git a/pandora_console/images/groups_small/house.bad.png b/pandora_console/images/groups_small/house.bad.png index 815f719f7c..a7dcd9b6fd 100644 Binary files a/pandora_console/images/groups_small/house.bad.png and b/pandora_console/images/groups_small/house.bad.png differ diff --git a/pandora_console/images/groups_small/house.default.png b/pandora_console/images/groups_small/house.default.png index fac912b267..07b9842b2d 100644 Binary files a/pandora_console/images/groups_small/house.default.png and b/pandora_console/images/groups_small/house.default.png differ diff --git a/pandora_console/images/groups_small/house.ok.png b/pandora_console/images/groups_small/house.ok.png index c3a2e9053e..9190bfd075 100644 Binary files a/pandora_console/images/groups_small/house.ok.png and b/pandora_console/images/groups_small/house.ok.png differ diff --git a/pandora_console/images/groups_small/house.warning.png b/pandora_console/images/groups_small/house.warning.png index cf76552f5f..27ba33bca9 100644 Binary files a/pandora_console/images/groups_small/house.warning.png and b/pandora_console/images/groups_small/house.warning.png differ diff --git a/pandora_console/images/groups_small/images.bad.png b/pandora_console/images/groups_small/images.bad.png index 454b36e1d5..cdcb423d83 100644 Binary files a/pandora_console/images/groups_small/images.bad.png and b/pandora_console/images/groups_small/images.bad.png differ diff --git a/pandora_console/images/groups_small/images.default.png b/pandora_console/images/groups_small/images.default.png index 501a97fe27..04b186e57f 100644 Binary files a/pandora_console/images/groups_small/images.default.png and b/pandora_console/images/groups_small/images.default.png differ diff --git a/pandora_console/images/groups_small/images.ok.png b/pandora_console/images/groups_small/images.ok.png index 530af4f4c4..0936d2f2e0 100644 Binary files a/pandora_console/images/groups_small/images.ok.png and b/pandora_console/images/groups_small/images.ok.png differ diff --git a/pandora_console/images/groups_small/images.warning.png b/pandora_console/images/groups_small/images.warning.png index 46cd29d989..f735403dc8 100644 Binary files a/pandora_console/images/groups_small/images.warning.png and b/pandora_console/images/groups_small/images.warning.png differ diff --git a/pandora_console/images/groups_small/lightning.bad.png b/pandora_console/images/groups_small/lightning.bad.png index a6ec10a2bc..dc4de71df3 100644 Binary files a/pandora_console/images/groups_small/lightning.bad.png and b/pandora_console/images/groups_small/lightning.bad.png differ diff --git a/pandora_console/images/groups_small/lightning.default.png b/pandora_console/images/groups_small/lightning.default.png index 47447d48be..b50d496caa 100644 Binary files a/pandora_console/images/groups_small/lightning.default.png and b/pandora_console/images/groups_small/lightning.default.png differ diff --git a/pandora_console/images/groups_small/lightning.ok.png b/pandora_console/images/groups_small/lightning.ok.png index 7dee1c4a81..7b134afecf 100644 Binary files a/pandora_console/images/groups_small/lightning.ok.png and b/pandora_console/images/groups_small/lightning.ok.png differ diff --git a/pandora_console/images/groups_small/lightning.warning.png b/pandora_console/images/groups_small/lightning.warning.png index 020cfe9ac7..3182a8aa72 100644 Binary files a/pandora_console/images/groups_small/lightning.warning.png and b/pandora_console/images/groups_small/lightning.warning.png differ diff --git a/pandora_console/images/groups_small/lock.bad.png b/pandora_console/images/groups_small/lock.bad.png index 29fecde26d..0f25d5361b 100644 Binary files a/pandora_console/images/groups_small/lock.bad.png and b/pandora_console/images/groups_small/lock.bad.png differ diff --git a/pandora_console/images/groups_small/lock.default.png b/pandora_console/images/groups_small/lock.default.png index d462751473..b3958972ed 100644 Binary files a/pandora_console/images/groups_small/lock.default.png and b/pandora_console/images/groups_small/lock.default.png differ diff --git a/pandora_console/images/groups_small/lock.ok.png b/pandora_console/images/groups_small/lock.ok.png index fb9a8749bd..06e639a7bf 100644 Binary files a/pandora_console/images/groups_small/lock.ok.png and b/pandora_console/images/groups_small/lock.ok.png differ diff --git a/pandora_console/images/groups_small/lock.warning.png b/pandora_console/images/groups_small/lock.warning.png index bfb2826d31..9cd24bc69b 100644 Binary files a/pandora_console/images/groups_small/lock.warning.png and b/pandora_console/images/groups_small/lock.warning.png differ diff --git a/pandora_console/images/groups_small/network.bad.png b/pandora_console/images/groups_small/network.bad.png index f3293d77ac..fec08fa66b 100644 Binary files a/pandora_console/images/groups_small/network.bad.png and b/pandora_console/images/groups_small/network.bad.png differ diff --git a/pandora_console/images/groups_small/network.default.png b/pandora_console/images/groups_small/network.default.png index c330e90893..6b2107017f 100644 Binary files a/pandora_console/images/groups_small/network.default.png and b/pandora_console/images/groups_small/network.default.png differ diff --git a/pandora_console/images/groups_small/network.ok.png b/pandora_console/images/groups_small/network.ok.png index edd8831666..ce767cf880 100644 Binary files a/pandora_console/images/groups_small/network.ok.png and b/pandora_console/images/groups_small/network.ok.png differ diff --git a/pandora_console/images/groups_small/network.warning.png b/pandora_console/images/groups_small/network.warning.png index 6ddd996e56..66a55e22b4 100644 Binary files a/pandora_console/images/groups_small/network.warning.png and b/pandora_console/images/groups_small/network.warning.png differ diff --git a/pandora_console/images/groups_small/old/application_osx_terminal.bad.png b/pandora_console/images/groups_small/old/application_osx_terminal.bad.png new file mode 100644 index 0000000000..ccc8f3f04d Binary files /dev/null and b/pandora_console/images/groups_small/old/application_osx_terminal.bad.png differ diff --git a/pandora_console/images/groups_small/old/application_osx_terminal.default.png b/pandora_console/images/groups_small/old/application_osx_terminal.default.png new file mode 100644 index 0000000000..85f0016ce2 Binary files /dev/null and b/pandora_console/images/groups_small/old/application_osx_terminal.default.png differ diff --git a/pandora_console/images/groups_small/old/application_osx_terminal.ok.png b/pandora_console/images/groups_small/old/application_osx_terminal.ok.png new file mode 100644 index 0000000000..0678cb09a1 Binary files /dev/null and b/pandora_console/images/groups_small/old/application_osx_terminal.ok.png differ diff --git a/pandora_console/images/groups_small/old/application_osx_terminal.warning.png b/pandora_console/images/groups_small/old/application_osx_terminal.warning.png new file mode 100644 index 0000000000..e95f210a5f Binary files /dev/null and b/pandora_console/images/groups_small/old/application_osx_terminal.warning.png differ diff --git a/pandora_console/images/groups_small/applications.bad_old.png b/pandora_console/images/groups_small/old/applications.bad_old.png similarity index 100% rename from pandora_console/images/groups_small/applications.bad_old.png rename to pandora_console/images/groups_small/old/applications.bad_old.png diff --git a/pandora_console/images/groups_small/applications.default_old.png b/pandora_console/images/groups_small/old/applications.default_old.png similarity index 100% rename from pandora_console/images/groups_small/applications.default_old.png rename to pandora_console/images/groups_small/old/applications.default_old.png diff --git a/pandora_console/images/groups_small/applications.ok_old.png b/pandora_console/images/groups_small/old/applications.ok_old.png similarity index 100% rename from pandora_console/images/groups_small/applications.ok_old.png rename to pandora_console/images/groups_small/old/applications.ok_old.png diff --git a/pandora_console/images/groups_small/applications.warning_old.png b/pandora_console/images/groups_small/old/applications.warning_old.png similarity index 100% rename from pandora_console/images/groups_small/applications.warning_old.png rename to pandora_console/images/groups_small/old/applications.warning_old.png diff --git a/pandora_console/images/groups_small/old/bricks.bad.png b/pandora_console/images/groups_small/old/bricks.bad.png new file mode 100644 index 0000000000..0a0cd5459f Binary files /dev/null and b/pandora_console/images/groups_small/old/bricks.bad.png differ diff --git a/pandora_console/images/groups_small/old/bricks.default.png b/pandora_console/images/groups_small/old/bricks.default.png new file mode 100644 index 0000000000..14d8bab5ca Binary files /dev/null and b/pandora_console/images/groups_small/old/bricks.default.png differ diff --git a/pandora_console/images/groups_small/old/bricks.ok.png b/pandora_console/images/groups_small/old/bricks.ok.png new file mode 100644 index 0000000000..931d1a389c Binary files /dev/null and b/pandora_console/images/groups_small/old/bricks.ok.png differ diff --git a/pandora_console/images/groups_small/old/bricks.warning.png b/pandora_console/images/groups_small/old/bricks.warning.png new file mode 100644 index 0000000000..bbfeb0ce3f Binary files /dev/null and b/pandora_console/images/groups_small/old/bricks.warning.png differ diff --git a/pandora_console/images/groups_small/old/chart_organisation.bad.png b/pandora_console/images/groups_small/old/chart_organisation.bad.png new file mode 100644 index 0000000000..410cd5116c Binary files /dev/null and b/pandora_console/images/groups_small/old/chart_organisation.bad.png differ diff --git a/pandora_console/images/groups_small/old/chart_organisation.default.png b/pandora_console/images/groups_small/old/chart_organisation.default.png new file mode 100644 index 0000000000..53619a608b Binary files /dev/null and b/pandora_console/images/groups_small/old/chart_organisation.default.png differ diff --git a/pandora_console/images/groups_small/old/chart_organisation.ok.png b/pandora_console/images/groups_small/old/chart_organisation.ok.png new file mode 100644 index 0000000000..ca7f04061b Binary files /dev/null and b/pandora_console/images/groups_small/old/chart_organisation.ok.png differ diff --git a/pandora_console/images/groups_small/old/chart_organisation.warning.png b/pandora_console/images/groups_small/old/chart_organisation.warning.png new file mode 100644 index 0000000000..c9ba529187 Binary files /dev/null and b/pandora_console/images/groups_small/old/chart_organisation.warning.png differ diff --git a/pandora_console/images/groups_small/old/clock.bad.png b/pandora_console/images/groups_small/old/clock.bad.png new file mode 100644 index 0000000000..f281439c87 Binary files /dev/null and b/pandora_console/images/groups_small/old/clock.bad.png differ diff --git a/pandora_console/images/groups_small/old/clock.default.png b/pandora_console/images/groups_small/old/clock.default.png new file mode 100644 index 0000000000..2b7a58aa20 Binary files /dev/null and b/pandora_console/images/groups_small/old/clock.default.png differ diff --git a/pandora_console/images/groups_small/old/clock.ok.png b/pandora_console/images/groups_small/old/clock.ok.png new file mode 100644 index 0000000000..a3cb173d9e Binary files /dev/null and b/pandora_console/images/groups_small/old/clock.ok.png differ diff --git a/pandora_console/images/groups_small/old/clock.warning.png b/pandora_console/images/groups_small/old/clock.warning.png new file mode 100644 index 0000000000..20880b31df Binary files /dev/null and b/pandora_console/images/groups_small/old/clock.warning.png differ diff --git a/pandora_console/images/groups_small/computer.bad_old.png b/pandora_console/images/groups_small/old/computer.bad_old.png similarity index 100% rename from pandora_console/images/groups_small/computer.bad_old.png rename to pandora_console/images/groups_small/old/computer.bad_old.png diff --git a/pandora_console/images/groups_small/computer.default_old.png b/pandora_console/images/groups_small/old/computer.default_old.png similarity index 100% rename from pandora_console/images/groups_small/computer.default_old.png rename to pandora_console/images/groups_small/old/computer.default_old.png diff --git a/pandora_console/images/groups_small/computer.ok_old.png b/pandora_console/images/groups_small/old/computer.ok_old.png similarity index 100% rename from pandora_console/images/groups_small/computer.ok_old.png rename to pandora_console/images/groups_small/old/computer.ok_old.png diff --git a/pandora_console/images/groups_small/computer.warning_old.png b/pandora_console/images/groups_small/old/computer.warning_old.png similarity index 100% rename from pandora_console/images/groups_small/computer.warning_old.png rename to pandora_console/images/groups_small/old/computer.warning_old.png diff --git a/pandora_console/images/groups_small/database_gear.bad_old.png b/pandora_console/images/groups_small/old/database_gear.bad_old.png similarity index 100% rename from pandora_console/images/groups_small/database_gear.bad_old.png rename to pandora_console/images/groups_small/old/database_gear.bad_old.png diff --git a/pandora_console/images/groups_small/database_gear.default_old.png b/pandora_console/images/groups_small/old/database_gear.default_old.png similarity index 100% rename from pandora_console/images/groups_small/database_gear.default_old.png rename to pandora_console/images/groups_small/old/database_gear.default_old.png diff --git a/pandora_console/images/groups_small/database_gear.ok_old.png b/pandora_console/images/groups_small/old/database_gear.ok_old.png similarity index 100% rename from pandora_console/images/groups_small/database_gear.ok_old.png rename to pandora_console/images/groups_small/old/database_gear.ok_old.png diff --git a/pandora_console/images/groups_small/database_gear.warning_old.png b/pandora_console/images/groups_small/old/database_gear.warning_old.png similarity index 100% rename from pandora_console/images/groups_small/database_gear.warning_old.png rename to pandora_console/images/groups_small/old/database_gear.warning_old.png diff --git a/pandora_console/images/groups_small/drive_network.bad.png b/pandora_console/images/groups_small/old/drive_network.bad.png similarity index 100% rename from pandora_console/images/groups_small/drive_network.bad.png rename to pandora_console/images/groups_small/old/drive_network.bad.png diff --git a/pandora_console/images/groups_small/old/drive_network.default.png b/pandora_console/images/groups_small/old/drive_network.default.png new file mode 100644 index 0000000000..428b2eb2a4 Binary files /dev/null and b/pandora_console/images/groups_small/old/drive_network.default.png differ diff --git a/pandora_console/images/groups_small/old/drive_network.ok.png b/pandora_console/images/groups_small/old/drive_network.ok.png new file mode 100644 index 0000000000..dbe58f007c Binary files /dev/null and b/pandora_console/images/groups_small/old/drive_network.ok.png differ diff --git a/pandora_console/images/groups_small/old/drive_network.png b/pandora_console/images/groups_small/old/drive_network.png new file mode 100644 index 0000000000..952cf5352c Binary files /dev/null and b/pandora_console/images/groups_small/old/drive_network.png differ diff --git a/pandora_console/images/groups_small/old/drive_network.warning.png b/pandora_console/images/groups_small/old/drive_network.warning.png new file mode 100644 index 0000000000..0dbdd4b2a5 Binary files /dev/null and b/pandora_console/images/groups_small/old/drive_network.warning.png differ diff --git a/pandora_console/images/groups_small/old/email.bad.png b/pandora_console/images/groups_small/old/email.bad.png new file mode 100644 index 0000000000..064222d63e Binary files /dev/null and b/pandora_console/images/groups_small/old/email.bad.png differ diff --git a/pandora_console/images/groups_small/old/email.default.png b/pandora_console/images/groups_small/old/email.default.png new file mode 100644 index 0000000000..1486cd82a0 Binary files /dev/null and b/pandora_console/images/groups_small/old/email.default.png differ diff --git a/pandora_console/images/groups_small/old/email.ok.png b/pandora_console/images/groups_small/old/email.ok.png new file mode 100644 index 0000000000..681fc2ddfa Binary files /dev/null and b/pandora_console/images/groups_small/old/email.ok.png differ diff --git a/pandora_console/images/groups_small/old/email.warning.png b/pandora_console/images/groups_small/old/email.warning.png new file mode 100644 index 0000000000..b08c99d7c1 Binary files /dev/null and b/pandora_console/images/groups_small/old/email.warning.png differ diff --git a/pandora_console/images/groups_small/old/eye.bad.png b/pandora_console/images/groups_small/old/eye.bad.png new file mode 100644 index 0000000000..f8191a1b17 Binary files /dev/null and b/pandora_console/images/groups_small/old/eye.bad.png differ diff --git a/pandora_console/images/groups_small/old/eye.default.png b/pandora_console/images/groups_small/old/eye.default.png new file mode 100644 index 0000000000..cd852b7502 Binary files /dev/null and b/pandora_console/images/groups_small/old/eye.default.png differ diff --git a/pandora_console/images/groups_small/old/eye.ok.png b/pandora_console/images/groups_small/old/eye.ok.png new file mode 100644 index 0000000000..0da4304f71 Binary files /dev/null and b/pandora_console/images/groups_small/old/eye.ok.png differ diff --git a/pandora_console/images/groups_small/old/eye.warning.png b/pandora_console/images/groups_small/old/eye.warning.png new file mode 100644 index 0000000000..65a5722201 Binary files /dev/null and b/pandora_console/images/groups_small/old/eye.warning.png differ diff --git a/pandora_console/images/groups_small/firewall.bad_old.png b/pandora_console/images/groups_small/old/firewall.bad_old.png similarity index 100% rename from pandora_console/images/groups_small/firewall.bad_old.png rename to pandora_console/images/groups_small/old/firewall.bad_old.png diff --git a/pandora_console/images/groups_small/firewall.default_old.png b/pandora_console/images/groups_small/old/firewall.default_old.png similarity index 100% rename from pandora_console/images/groups_small/firewall.default_old.png rename to pandora_console/images/groups_small/old/firewall.default_old.png diff --git a/pandora_console/images/groups_small/firewall.ok_old.png b/pandora_console/images/groups_small/old/firewall.ok_old.png similarity index 100% rename from pandora_console/images/groups_small/firewall.ok_old.png rename to pandora_console/images/groups_small/old/firewall.ok_old.png diff --git a/pandora_console/images/groups_small/firewall.warning_old.png b/pandora_console/images/groups_small/old/firewall.warning_old.png similarity index 100% rename from pandora_console/images/groups_small/firewall.warning_old.png rename to pandora_console/images/groups_small/old/firewall.warning_old.png diff --git a/pandora_console/images/groups_small/old/heart.bad.png b/pandora_console/images/groups_small/old/heart.bad.png new file mode 100644 index 0000000000..ff3008fcc4 Binary files /dev/null and b/pandora_console/images/groups_small/old/heart.bad.png differ diff --git a/pandora_console/images/groups_small/old/heart.default.png b/pandora_console/images/groups_small/old/heart.default.png new file mode 100644 index 0000000000..a7cfff0cc3 Binary files /dev/null and b/pandora_console/images/groups_small/old/heart.default.png differ diff --git a/pandora_console/images/groups_small/old/heart.ok.png b/pandora_console/images/groups_small/old/heart.ok.png new file mode 100644 index 0000000000..0f0798523d Binary files /dev/null and b/pandora_console/images/groups_small/old/heart.ok.png differ diff --git a/pandora_console/images/groups_small/old/heart.warning.png b/pandora_console/images/groups_small/old/heart.warning.png new file mode 100644 index 0000000000..66b8583393 Binary files /dev/null and b/pandora_console/images/groups_small/old/heart.warning.png differ diff --git a/pandora_console/images/groups_small/old/house.bad.png b/pandora_console/images/groups_small/old/house.bad.png new file mode 100644 index 0000000000..815f719f7c Binary files /dev/null and b/pandora_console/images/groups_small/old/house.bad.png differ diff --git a/pandora_console/images/groups_small/old/house.default.png b/pandora_console/images/groups_small/old/house.default.png new file mode 100644 index 0000000000..fac912b267 Binary files /dev/null and b/pandora_console/images/groups_small/old/house.default.png differ diff --git a/pandora_console/images/groups_small/old/house.ok.png b/pandora_console/images/groups_small/old/house.ok.png new file mode 100644 index 0000000000..c3a2e9053e Binary files /dev/null and b/pandora_console/images/groups_small/old/house.ok.png differ diff --git a/pandora_console/images/groups_small/old/house.warning.png b/pandora_console/images/groups_small/old/house.warning.png new file mode 100644 index 0000000000..cf76552f5f Binary files /dev/null and b/pandora_console/images/groups_small/old/house.warning.png differ diff --git a/pandora_console/images/groups_small/old/images.bad.png b/pandora_console/images/groups_small/old/images.bad.png new file mode 100644 index 0000000000..454b36e1d5 Binary files /dev/null and b/pandora_console/images/groups_small/old/images.bad.png differ diff --git a/pandora_console/images/groups_small/old/images.default.png b/pandora_console/images/groups_small/old/images.default.png new file mode 100644 index 0000000000..501a97fe27 Binary files /dev/null and b/pandora_console/images/groups_small/old/images.default.png differ diff --git a/pandora_console/images/groups_small/old/images.ok.png b/pandora_console/images/groups_small/old/images.ok.png new file mode 100644 index 0000000000..530af4f4c4 Binary files /dev/null and b/pandora_console/images/groups_small/old/images.ok.png differ diff --git a/pandora_console/images/groups_small/old/images.warning.png b/pandora_console/images/groups_small/old/images.warning.png new file mode 100644 index 0000000000..46cd29d989 Binary files /dev/null and b/pandora_console/images/groups_small/old/images.warning.png differ diff --git a/pandora_console/images/groups_small/old/lightning.bad.png b/pandora_console/images/groups_small/old/lightning.bad.png new file mode 100644 index 0000000000..a6ec10a2bc Binary files /dev/null and b/pandora_console/images/groups_small/old/lightning.bad.png differ diff --git a/pandora_console/images/groups_small/old/lightning.default.png b/pandora_console/images/groups_small/old/lightning.default.png new file mode 100644 index 0000000000..47447d48be Binary files /dev/null and b/pandora_console/images/groups_small/old/lightning.default.png differ diff --git a/pandora_console/images/groups_small/old/lightning.ok.png b/pandora_console/images/groups_small/old/lightning.ok.png new file mode 100644 index 0000000000..7dee1c4a81 Binary files /dev/null and b/pandora_console/images/groups_small/old/lightning.ok.png differ diff --git a/pandora_console/images/groups_small/old/lightning.warning.png b/pandora_console/images/groups_small/old/lightning.warning.png new file mode 100644 index 0000000000..020cfe9ac7 Binary files /dev/null and b/pandora_console/images/groups_small/old/lightning.warning.png differ diff --git a/pandora_console/images/groups_small/old/lock.bad.png b/pandora_console/images/groups_small/old/lock.bad.png new file mode 100644 index 0000000000..29fecde26d Binary files /dev/null and b/pandora_console/images/groups_small/old/lock.bad.png differ diff --git a/pandora_console/images/groups_small/old/lock.default.png b/pandora_console/images/groups_small/old/lock.default.png new file mode 100644 index 0000000000..d462751473 Binary files /dev/null and b/pandora_console/images/groups_small/old/lock.default.png differ diff --git a/pandora_console/images/groups_small/old/lock.ok.png b/pandora_console/images/groups_small/old/lock.ok.png new file mode 100644 index 0000000000..fb9a8749bd Binary files /dev/null and b/pandora_console/images/groups_small/old/lock.ok.png differ diff --git a/pandora_console/images/groups_small/old/lock.warning.png b/pandora_console/images/groups_small/old/lock.warning.png new file mode 100644 index 0000000000..bfb2826d31 Binary files /dev/null and b/pandora_console/images/groups_small/old/lock.warning.png differ diff --git a/pandora_console/images/groups_small/old/network.bad.png b/pandora_console/images/groups_small/old/network.bad.png new file mode 100644 index 0000000000..f3293d77ac Binary files /dev/null and b/pandora_console/images/groups_small/old/network.bad.png differ diff --git a/pandora_console/images/groups_small/old/network.default.png b/pandora_console/images/groups_small/old/network.default.png new file mode 100644 index 0000000000..c330e90893 Binary files /dev/null and b/pandora_console/images/groups_small/old/network.default.png differ diff --git a/pandora_console/images/groups_small/old/network.ok.png b/pandora_console/images/groups_small/old/network.ok.png new file mode 100644 index 0000000000..edd8831666 Binary files /dev/null and b/pandora_console/images/groups_small/old/network.ok.png differ diff --git a/pandora_console/images/groups_small/old/network.warning.png b/pandora_console/images/groups_small/old/network.warning.png new file mode 100644 index 0000000000..6ddd996e56 Binary files /dev/null and b/pandora_console/images/groups_small/old/network.warning.png differ diff --git a/pandora_console/images/groups_small/old/plugin.bad.png b/pandora_console/images/groups_small/old/plugin.bad.png new file mode 100644 index 0000000000..6d156e363f Binary files /dev/null and b/pandora_console/images/groups_small/old/plugin.bad.png differ diff --git a/pandora_console/images/groups_small/old/plugin.default.png b/pandora_console/images/groups_small/old/plugin.default.png new file mode 100644 index 0000000000..d97051dec6 Binary files /dev/null and b/pandora_console/images/groups_small/old/plugin.default.png differ diff --git a/pandora_console/images/groups_small/old/plugin.ok.png b/pandora_console/images/groups_small/old/plugin.ok.png new file mode 100644 index 0000000000..ff830a1475 Binary files /dev/null and b/pandora_console/images/groups_small/old/plugin.ok.png differ diff --git a/pandora_console/images/groups_small/old/plugin.warning.png b/pandora_console/images/groups_small/old/plugin.warning.png new file mode 100644 index 0000000000..58104424a0 Binary files /dev/null and b/pandora_console/images/groups_small/old/plugin.warning.png differ diff --git a/pandora_console/images/groups_small/old/printer.bad.png b/pandora_console/images/groups_small/old/printer.bad.png new file mode 100644 index 0000000000..9b2d285e85 Binary files /dev/null and b/pandora_console/images/groups_small/old/printer.bad.png differ diff --git a/pandora_console/images/groups_small/old/printer.default.png b/pandora_console/images/groups_small/old/printer.default.png new file mode 100644 index 0000000000..859c2474af Binary files /dev/null and b/pandora_console/images/groups_small/old/printer.default.png differ diff --git a/pandora_console/images/groups_small/old/printer.ok.png b/pandora_console/images/groups_small/old/printer.ok.png new file mode 100644 index 0000000000..8f17c7a050 Binary files /dev/null and b/pandora_console/images/groups_small/old/printer.ok.png differ diff --git a/pandora_console/images/groups_small/old/printer.warning.png b/pandora_console/images/groups_small/old/printer.warning.png new file mode 100644 index 0000000000..7eb19cf180 Binary files /dev/null and b/pandora_console/images/groups_small/old/printer.warning.png differ diff --git a/pandora_console/images/groups_small/server_database.bad_old.png b/pandora_console/images/groups_small/old/server_database.bad_old.png similarity index 100% rename from pandora_console/images/groups_small/server_database.bad_old.png rename to pandora_console/images/groups_small/old/server_database.bad_old.png diff --git a/pandora_console/images/groups_small/server_database.default_old.png b/pandora_console/images/groups_small/old/server_database.default_old.png similarity index 100% rename from pandora_console/images/groups_small/server_database.default_old.png rename to pandora_console/images/groups_small/old/server_database.default_old.png diff --git a/pandora_console/images/groups_small/server_database.ok_old.png b/pandora_console/images/groups_small/old/server_database.ok_old.png similarity index 100% rename from pandora_console/images/groups_small/server_database.ok_old.png rename to pandora_console/images/groups_small/old/server_database.ok_old.png diff --git a/pandora_console/images/groups_small/server_database.warning_old.png b/pandora_console/images/groups_small/old/server_database.warning_old.png similarity index 100% rename from pandora_console/images/groups_small/server_database.warning_old.png rename to pandora_console/images/groups_small/old/server_database.warning_old.png diff --git a/pandora_console/images/groups_small/transmit.bad_old.png b/pandora_console/images/groups_small/old/transmit.bad_old.png similarity index 100% rename from pandora_console/images/groups_small/transmit.bad_old.png rename to pandora_console/images/groups_small/old/transmit.bad_old.png diff --git a/pandora_console/images/groups_small/transmit.default_old.png b/pandora_console/images/groups_small/old/transmit.default_old.png similarity index 100% rename from pandora_console/images/groups_small/transmit.default_old.png rename to pandora_console/images/groups_small/old/transmit.default_old.png diff --git a/pandora_console/images/groups_small/transmit.ok_old.png b/pandora_console/images/groups_small/old/transmit.ok_old.png similarity index 100% rename from pandora_console/images/groups_small/transmit.ok_old.png rename to pandora_console/images/groups_small/old/transmit.ok_old.png diff --git a/pandora_console/images/groups_small/transmit.warning_old.png b/pandora_console/images/groups_small/old/transmit.warning_old.png similarity index 100% rename from pandora_console/images/groups_small/transmit.warning_old.png rename to pandora_console/images/groups_small/old/transmit.warning_old.png diff --git a/pandora_console/images/groups_small/without_group.bad_old.png b/pandora_console/images/groups_small/old/without_group.bad_old.png similarity index 100% rename from pandora_console/images/groups_small/without_group.bad_old.png rename to pandora_console/images/groups_small/old/without_group.bad_old.png diff --git a/pandora_console/images/groups_small/without_group.default_old.png b/pandora_console/images/groups_small/old/without_group.default_old.png similarity index 100% rename from pandora_console/images/groups_small/without_group.default_old.png rename to pandora_console/images/groups_small/old/without_group.default_old.png diff --git a/pandora_console/images/groups_small/without_group.ok_old.png b/pandora_console/images/groups_small/old/without_group.ok_old.png similarity index 100% rename from pandora_console/images/groups_small/without_group.ok_old.png rename to pandora_console/images/groups_small/old/without_group.ok_old.png diff --git a/pandora_console/images/groups_small/without_group.warning_old.png b/pandora_console/images/groups_small/old/without_group.warning_old.png similarity index 100% rename from pandora_console/images/groups_small/without_group.warning_old.png rename to pandora_console/images/groups_small/old/without_group.warning_old.png diff --git a/pandora_console/images/groups_small/world.bad_old.png b/pandora_console/images/groups_small/old/world.bad_old.png similarity index 100% rename from pandora_console/images/groups_small/world.bad_old.png rename to pandora_console/images/groups_small/old/world.bad_old.png diff --git a/pandora_console/images/groups_small/world.default_old.png b/pandora_console/images/groups_small/old/world.default_old.png similarity index 100% rename from pandora_console/images/groups_small/world.default_old.png rename to pandora_console/images/groups_small/old/world.default_old.png diff --git a/pandora_console/images/groups_small/world.ok_old.png b/pandora_console/images/groups_small/old/world.ok_old.png similarity index 100% rename from pandora_console/images/groups_small/world.ok_old.png rename to pandora_console/images/groups_small/old/world.ok_old.png diff --git a/pandora_console/images/groups_small/world.warning_old.png b/pandora_console/images/groups_small/old/world.warning_old.png similarity index 100% rename from pandora_console/images/groups_small/world.warning_old.png rename to pandora_console/images/groups_small/old/world.warning_old.png diff --git a/pandora_console/images/groups_small/plugin.bad.png b/pandora_console/images/groups_small/plugin.bad.png index 6d156e363f..7004df6a1e 100644 Binary files a/pandora_console/images/groups_small/plugin.bad.png and b/pandora_console/images/groups_small/plugin.bad.png differ diff --git a/pandora_console/images/groups_small/plugin.default.png b/pandora_console/images/groups_small/plugin.default.png index d97051dec6..d815c117ba 100644 Binary files a/pandora_console/images/groups_small/plugin.default.png and b/pandora_console/images/groups_small/plugin.default.png differ diff --git a/pandora_console/images/groups_small/plugin.ok.png b/pandora_console/images/groups_small/plugin.ok.png index ff830a1475..dfa215c35e 100644 Binary files a/pandora_console/images/groups_small/plugin.ok.png and b/pandora_console/images/groups_small/plugin.ok.png differ diff --git a/pandora_console/images/groups_small/plugin.warning.png b/pandora_console/images/groups_small/plugin.warning.png index 58104424a0..957bedbc15 100644 Binary files a/pandora_console/images/groups_small/plugin.warning.png and b/pandora_console/images/groups_small/plugin.warning.png differ diff --git a/pandora_console/images/groups_small/printer.bad.png b/pandora_console/images/groups_small/printer.bad.png index 9b2d285e85..79ad2126d4 100644 Binary files a/pandora_console/images/groups_small/printer.bad.png and b/pandora_console/images/groups_small/printer.bad.png differ diff --git a/pandora_console/images/groups_small/printer.default.png b/pandora_console/images/groups_small/printer.default.png index 859c2474af..c16416c149 100644 Binary files a/pandora_console/images/groups_small/printer.default.png and b/pandora_console/images/groups_small/printer.default.png differ diff --git a/pandora_console/images/groups_small/printer.ok.png b/pandora_console/images/groups_small/printer.ok.png index 8f17c7a050..4f2cd88e81 100644 Binary files a/pandora_console/images/groups_small/printer.ok.png and b/pandora_console/images/groups_small/printer.ok.png differ diff --git a/pandora_console/images/groups_small/printer.warning.png b/pandora_console/images/groups_small/printer.warning.png index 7eb19cf180..f3aaa8ef07 100644 Binary files a/pandora_console/images/groups_small/printer.warning.png and b/pandora_console/images/groups_small/printer.warning.png differ diff --git a/pandora_console/include/ajax/snmp_browser.ajax.php b/pandora_console/include/ajax/snmp_browser.ajax.php index 3376245093..63053e1919 100644 --- a/pandora_console/include/ajax/snmp_browser.ajax.php +++ b/pandora_console/include/ajax/snmp_browser.ajax.php @@ -25,12 +25,12 @@ if(is_ajax()){ $target_ip = (string) get_parameter ("target_ip", ''); $community = (string) get_parameter ("community", ''); $snmp_version = (string) get_parameter ("snmp_browser_version", ''); - $snmp3_auth_user = get_parameter('snmp3_browser_auth_user'); + $snmp3_auth_user = io_safe_output(get_parameter('snmp3_browser_auth_user')); $snmp3_security_level = get_parameter('snmp3_browser_security_level'); $snmp3_auth_method = get_parameter('snmp3_browser_auth_method'); - $snmp3_auth_pass = get_parameter('snmp3_browser_auth_pass'); + $snmp3_auth_pass = io_safe_output(get_parameter('snmp3_browser_auth_pass')); $snmp3_privacy_method = get_parameter('snmp3_browser_privacy_method'); - $snmp3_privacy_pass = get_parameter('snmp3_browser_privacy_pass'); + $snmp3_privacy_pass = io_safe_output(get_parameter('snmp3_browser_privacy_pass')); $targets_oids = get_parameter ("oids", ""); $targets_oids = explode(",", $targets_oids); diff --git a/pandora_console/include/ajax/visual_console_builder.ajax.php b/pandora_console/include/ajax/visual_console_builder.ajax.php index b4bdc4f0fb..7d8fcadae9 100755 --- a/pandora_console/include/ajax/visual_console_builder.ajax.php +++ b/pandora_console/include/ajax/visual_console_builder.ajax.php @@ -100,7 +100,9 @@ $width = get_parameter('width', null); $height = get_parameter('height', null); $parent = get_parameter('parent', null); $map_linked = get_parameter('map_linked', null); +$map_linked_weight = get_parameter('map_linked_weight', null); $width_percentile = get_parameter('width_percentile', null); +$bars_graph_height = get_parameter('bars_graph_height', null); $max_percentile = get_parameter('max_percentile', null); $height_module_graph = get_parameter('height_module_graph', null); $width_module_graph = get_parameter('width_module_graph', null); @@ -113,14 +115,17 @@ $metaconsole = get_parameter('metaconsole', 0); $server_name = get_parameter('server_name', null); $server_id = (int)get_parameter('server_id', 0); $id_agent = get_parameter('id_agent', null); +$id_agent_string = get_parameter('id_agent_string', null); $id_metaconsole = get_parameter('id_metaconsole', null); $id_group = (int)get_parameter('id_group', 0); $id_custom_graph = get_parameter('id_custom_graph', null); $border_width = (int)get_parameter('border_width', 0); $border_color = get_parameter('border_color', ''); +$grid_color = get_parameter('grid_color', ''); +$resume_color = get_parameter('resume_color', ''); $fill_color = get_parameter('fill_color', ''); $percentile_color = get_parameter('percentile_color', ''); -$percentile_label = get_parameter('percentile_label', ''); +$percentile_label = io_safe_output(get_parameter('percentile_label', '')); $percentile_label_color = get_parameter('percentile_label_color', ''); $width_box = (int)get_parameter('width_box', 0); $height_box = (int)get_parameter('height_box', 0); @@ -145,6 +150,24 @@ switch ($action) { echo json_encode($return); break; + case 'get_image_from_module': + $layoutData = db_get_row_filter('tlayout_data', array('id' => $id_element)); + $sql = 'SELECT datos FROM tagente_estado WHERE id_agente_modulo = '.$layoutData['id_agente_modulo']; + ob_clean(); + $result = db_get_sql($sql); + $image = strpos($result, 'data:image'); + + if($image === false){ + $return['correct'] = false; + } + else{ + $return['correct'] = true; + } + + echo json_encode($return); + + break; + case 'get_module_type_string': $data = array (); @@ -358,7 +381,7 @@ switch ($action) { // Linked to other layout ?? - Only if not module defined if ($layoutData['id_layout_linked'] != 0) { - $status = visual_map_get_layout_status ($layoutData['id_layout_linked']); + $status = visual_map_get_layout_status ($layoutData['id_layout_linked'], $layoutData['id_layout_linked_weight']); // Single object } @@ -489,12 +512,6 @@ switch ($action) { echo (int)$result; break; case 'simple_value': - if ($action == 'update') { - $values['type'] = visual_map_get_simple_value_type( - $process_simple_value); - $values['period'] = $period; - $values['width'] = $width; - } case 'percentile_bar': case 'percentile_item': case 'static_graph': @@ -538,8 +555,6 @@ switch ($action) { break; } - - if (defined('METACONSOLE') && $metaconsole) { if ($server_name !== null) { $values['id_metaconsole'] = db_get_value('id', @@ -554,6 +569,9 @@ switch ($action) { $values['id_agent'] = $id_agent; } } + else if ($id_agent == 0) { + $values['id_agent'] = 0; + } else if (!empty($id_agent)) { $values['id_agent'] = $id_agent; } @@ -570,6 +588,9 @@ switch ($action) { if ($map_linked !== null) { $values['id_layout_linked'] = $map_linked; } + if ($map_linked_weight !== null) { + $values['id_layout_linked_weight'] = $map_linked_weight; + } switch ($type) { // -- line_item ------------------------------------ case 'handler_start': @@ -595,8 +616,9 @@ switch ($action) { $values['width'] = $width_percentile; $values['height'] = $width_percentile; } + $values['border_color'] = $resume_color; $values['type'] = DONUT_GRAPH; - + $values['id_agent'] = $id_agent_string; break; case 'box_item': $values['border_width'] = $border_width; @@ -639,12 +661,19 @@ switch ($action) { if ($width_percentile !== null) { $values['width'] = $width_percentile; } + if ($bars_graph_height !== null) { + $values['height'] = $bars_graph_height; + } if ($bars_graph_type !== null) { $values['type_graph'] = $bars_graph_type; } if ($background_color !== null) { $values['image'] = $background_color; } + if ($grid_color !== null) { + $values['border_color'] = $grid_color; + } + $values['id_agent'] = $id_agent_string; break; case 'percentile_item': case 'percentile_bar': @@ -670,11 +699,7 @@ switch ($action) { $values['type'] = PERCENTILE_BUBBLE; } - //Check the field's value for back compatibility - $values['image'] = 'percent'; - if (($value_show == 'percent') || - ($value_show == 'value')) - $values['image'] = $value_show; + $values['image'] = $value_show; $values['border_color'] = $percentile_color; $values['fill_color'] = $percentile_label_color; @@ -692,6 +717,15 @@ switch ($action) { if ($height !== null) { $values['height'] = $height; } + break; + case 'simple_value': + if ($action == 'update') { + $values['type'] = visual_map_get_simple_value_type( + $process_simple_value); + $values['period'] = $period; + $values['width'] = $width; + } + break; default: if (enterprise_installed()) { @@ -721,6 +755,15 @@ switch ($action) { case 'bars_graph': unset($values['image']); unset($values['type_graph']); + unset($values['border_color']); + unset($values['width']); + unset($values['id_agent']); + unset($values['height']); + break; + case 'donut_graph': + unset($values['border_color']); + unset($values['width']); + unset($values['id_agent']); break; case 'box_item': unset($values['border_width']); @@ -842,11 +885,8 @@ switch ($action) { case 'percentile_bar': $elementFields['width_percentile'] = $elementFields['width']; $elementFields['max_percentile'] = $elementFields['height']; - //Check the field's value for back compatibility - $elementFields['value_show'] = 'percent'; - if (($elementFields['image'] == 'percent') || - ($elementFields['image'] == 'value')) - $elementFields['value_show'] = $elementFields['image']; + + $elementFields['value_show'] = $elementFields['image']; $elementFields['type_percentile'] = 'percentile'; if ($elementFields['type'] == PERCENTILE_BAR) { @@ -867,6 +907,21 @@ switch ($action) { break; case 'donut_graph': $elementFields['width_percentile'] = $elementFields['width']; + $elementFields['resume_color'] = $elementFields['border_color']; + $elementFields['id_agent_string'] = $elementFields['id_agent']; + if (($elementFields['id_agent_string'] != 0) + && ($elementFields['id_layout_linked'] == 0)) { + $modules = agents_get_modules( + $elementFields['id_agent'], false, + array('disabled' => 0, + 'id_agente' => $elementFields['id_agent'], + 'tagente_modulo.id_tipo_modulo IN' => "(17,23,3,10,33)")); + + $elementFields['modules_html'] = ''; + foreach ($modules as $id => $name) { + $elementFields['modules_html'] .= ''; + } + } break; case 'module_graph': @@ -875,7 +930,23 @@ switch ($action) { break; case 'bars_graph': $elementFields['width_percentile'] = $elementFields['width']; + $elementFields['bars_graph_height'] = $elementFields['height']; $elementFields['bars_graph_type'] = $elementFields['type_graph']; + $elementFields['grid_color'] = $elementFields['border_color']; + $elementFields['id_agent_string'] = $elementFields['id_agent']; + if (($elementFields['id_agent_string'] != 0) + && ($elementFields['id_layout_linked'] == 0)) { + $modules = agents_get_modules( + $elementFields['id_agent'], false, + array('disabled' => 0, + 'id_agente' => $elementFields['id_agent'], + 'tagente_modulo.id_tipo_modulo IN' => "(17,23,3,10,33)")); + + $elementFields['modules_html'] = ''; + foreach ($modules as $id => $name) { + $elementFields['modules_html'] .= ''; + } + } break; case 'box_item': $elementFields['width_box'] = $elementFields['width']; @@ -955,6 +1026,7 @@ switch ($action) { } $values['id_agente_modulo'] = $id_module; $values['id_layout_linked'] = $map_linked; + $values['id_layout_linked_weight'] = $map_linked_weight; $values['parent_item'] = $parent; $values['enable_link'] = $enable_link; $values['image'] = $background_color; @@ -983,8 +1055,10 @@ switch ($action) { break; case 'donut_graph': $values['type'] = DONUT_GRAPH; - $values['width'] = $width; - $values['height'] = $height; + $values['width'] = $width_percentile; + $values['height'] = $width_percentile; + $values['border_color'] = $resume_color; + $values['id_agent'] = $id_agent_string; break; case 'module_graph': $values['type'] = MODULE_GRAPH; @@ -1020,14 +1094,12 @@ switch ($action) { break; case 'bars_graph': $values['type'] = BARS_GRAPH; - if ($width_percentile == null) { - $values['width'] = 0; - } - else { - $values['width'] = $width_percentile; - } + $values['width'] = $width_percentile; + $values['height'] = $bars_graph_height; $values['type_graph'] = $bars_graph_type; $values['image'] = $background_color; + $values['border_color'] = $grid_color; + $values['id_agent'] = $id_agent_string; break; case 'auto_sla_graph': $values['type'] = AUTO_SLA_GRAPH; diff --git a/pandora_console/include/auth/mysql.php b/pandora_console/include/auth/mysql.php index 69f31d2bd1..b0dabd2f1d 100644 --- a/pandora_console/include/auth/mysql.php +++ b/pandora_console/include/auth/mysql.php @@ -240,26 +240,19 @@ function process_user_login_remote ($login, $pass, $api = false) { } } } - elseif (($config["auth"] === 'ldap') && - (isset($config['ldap_advanced_config']) && $config['ldap_advanced_config'])) { + elseif ($config["auth"] === 'ldap') { + if ($config['ldap_save_password']) { + $update_credentials = change_local_user_pass_ldap ($login, $pass); - $return = enterprise_hook ('prepare_permissions_groups_of_user_ldap', - array ($login, $pass, false, true, defined('METACONSOLE'))); - - if ($return === "error_permissions") { - $config["auth_error"] = - __("Problems with configuration permissions. Please contact with Administrator"); - return false; - } - else { - if ($return === "permissions_changed") { + if ($update_credentials) { $config["auth_error"] = __("Your permissions have changed. Please, login again."); return false; } } - - change_local_user_pass_ldap ($login, $pass); + else { + delete_user_pass_ldap ($login); + } } return $login; @@ -310,9 +303,7 @@ function process_user_login_remote ($login, $pass, $api = false) { return false; } } - elseif ($config["auth"] === 'ldap' && - (isset($config['ldap_advanced_config']) && - $config['ldap_advanced_config'])) { + elseif ($config["auth"] === 'ldap') { if ( defined('METACONSOLE') ) { enterprise_include_once('include/functions_metaconsole.php'); enterprise_include_once ('meta/include/functions_groups_meta.php'); @@ -693,10 +684,10 @@ function ldap_process_user_login ($login, $password) { } } - $dc = $config["ldap_base_dn"]; + $dc = io_safe_output($config["ldap_base_dn"]); #Search group of this user it belong. - $filter="(" . $config['ldap_login_attr'] . io_safe_output($login) . ")"; + $filter="(" . $config['ldap_login_attr'] . "=" . io_safe_output($login) . ")"; $justthese = array("objectclass=group"); $sr = ldap_search($ds, $dc, $filter, $justthese); @@ -717,7 +708,7 @@ function ldap_process_user_login ($login, $password) { $correct = false; if(!empty($ldap_base_dn)) { - if (strlen($password) != 0 && @ldap_bind($ds, $memberof['dn'], $password) ) { + if (strlen($password) != 0 && @ldap_bind($ds, io_safe_output($memberof['dn']), $password) ) { $correct = true; } } @@ -770,13 +761,23 @@ function is_user_blacklisted ($user) { function change_local_user_pass_ldap ($id_user, $password) { $local_user_pass = db_get_value_filter('password', 'tusuario', array('id_user' => $id_user)); + $return = false; if (md5($password) !== $local_user_pass) { $values_update = array(); $values_update['password'] = md5($password); - db_process_sql_update('tusuario', $values_update, array('id_user' => $id_user)); + $return = db_process_sql_update('tusuario', $values_update, array('id_user' => $id_user)); } + return $return; +} + +function delete_user_pass_ldap ($id_user) { + $values_update = array(); + $values_update['password'] = null; + + $return = db_process_sql_update('tusuario', $values_update, array('id_user' => $id_user)); + return; } diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index aae9bf0736..5b9a98333f 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -22,8 +22,8 @@ /** * Pandora build version and version */ -$build_version = 'PC171031'; -$pandora_version = 'v7.0NG.714'; +$build_version = 'PC171115'; +$pandora_version = 'v7.0NG.715'; // Do not overwrite default timezone set if defined. $script_tz = @date_default_timezone_get(); diff --git a/pandora_console/include/constants.php b/pandora_console/include/constants.php index ba4efa5535..901cff9eeb 100644 --- a/pandora_console/include/constants.php +++ b/pandora_console/include/constants.php @@ -462,7 +462,7 @@ define("STATWIN_DEFAULT_CHART_WIDTH", 555); define("STATWIN_DEFAULT_CHART_HEIGHT", 245); /* Dashboard */ -define("DASHBOARD_DEFAULT_COUNT_CELLS", 4); +define("DASHBOARD_DEFAULT_COUNT_CELLS", 1); define("OPTION_TEXT", 1); define("OPTION_SINGLE_SELECT", 2); diff --git a/pandora_console/include/functions_config.php b/pandora_console/include/functions_config.php index 06f0d090b5..844acb85c5 100644 --- a/pandora_console/include/functions_config.php +++ b/pandora_console/include/functions_config.php @@ -345,7 +345,15 @@ function config_update_config () { $error_update[] = __('Login attribute'); if (!config_update_value ('fallback_local_auth', get_parameter ('fallback_local_auth'))) $error_update[] = __('Fallback to local authentication'); - + + if (isset($config['fallback_local_auth']) && $config['fallback_local_auth'] == 0) { + if (!config_update_value ('ldap_save_password', get_parameter ('ldap_save_password'))) + $error_update[] = __('Save Password'); + } + else if (isset($config['fallback_local_auth']) && $config['fallback_local_auth'] == 1) { + config_update_value ('ldap_save_password', 1); + } + if (!config_update_value ('rpandora_server', get_parameter ('rpandora_server'))) $error_update[] = __('MySQL host'); if (!config_update_value ('rpandora_port', get_parameter ('rpandora_port'))) diff --git a/pandora_console/include/functions_filemanager.php b/pandora_console/include/functions_filemanager.php index 5e0ef6c718..1297ea50b2 100644 --- a/pandora_console/include/functions_filemanager.php +++ b/pandora_console/include/functions_filemanager.php @@ -720,6 +720,17 @@ function filemanager_file_explorer($real_directory, $relative_directory, $hash = md5($relative_path . $config['dbpass']); $data[1] = ''.$fileinfo['name'].''; } + + // Notice that uploaded php files could be dangerous + if (pathinfo($fileinfo['realpath'], PATHINFO_EXTENSION) == 'php' && + (is_readable($fileinfo['realpath']) || is_executable($fileinfo['realpath']))) { + $error_message = __('This file could be executed by any user'); + $error_message .= '. ' . __('Make sure it can\'t perform dangerous tasks'); + $data[1] = '' + . $data[1] + . ''; + } + $data[2] = ui_print_timestamp ($fileinfo['last_modified'], true, array ('prominent' => true)); if ($fileinfo['is_dir']) { diff --git a/pandora_console/include/functions_graph.php b/pandora_console/include/functions_graph.php index 5d33c49a01..ccad237208 100644 --- a/pandora_console/include/functions_graph.php +++ b/pandora_console/include/functions_graph.php @@ -232,8 +232,8 @@ function grafico_modulo_sparse_data_chart (&$chart, &$chart_data_extra, &$long_i $projection, $avg_only = false, $uncompressed_module = false, $show_events = false, $show_alerts = false, $show_unknown = false, $baseline = false, $baseline_data = array(), $events = array(), $series_suffix = '', $start_unknown = false, - $percentil = null, $fullscale = false) { - + $percentil = null, $fullscale = false, $force_interval = false,$time_interval = 300, + $max_only = 0, $min_only = 0) { global $config; global $chart_extra_data; global $series_type; @@ -413,10 +413,17 @@ function grafico_modulo_sparse_data_chart (&$chart, &$chart_data_extra, &$long_i } if ($count > 0) { + if ($avg_only) { $chart[$timestamp]['sum'.$series_suffix] = $total; } - else { + else if($max_only){ + $chart[$timestamp]['max'.$series_suffix] = $interval_max; + } + else if($min_only){ + $chart[$timestamp]['min'.$series_suffix] = $interval_min; + } + else{ $chart[$timestamp]['max'.$series_suffix] = $interval_max; $chart[$timestamp]['sum'.$series_suffix] = $total; $chart[$timestamp]['min'.$series_suffix] = $interval_min; @@ -428,7 +435,13 @@ function grafico_modulo_sparse_data_chart (&$chart, &$chart_data_extra, &$long_i if ($avg_only) { $chart[$timestamp]['sum'.$series_suffix] = 0; } - else { + else if($max_only){ + $chart[$timestamp]['max'.$series_suffix] = 0; + } + else if($min_only){ + $chart[$timestamp]['min'.$series_suffix] = 0; + } + else{ $chart[$timestamp]['max'.$series_suffix] = 0; $chart[$timestamp]['sum'.$series_suffix] = 0; $chart[$timestamp]['min'.$series_suffix] = 0; @@ -438,6 +451,12 @@ function grafico_modulo_sparse_data_chart (&$chart, &$chart_data_extra, &$long_i if ($avg_only) { $chart[$timestamp]['sum'.$series_suffix] = $last_known; } + else if ($max_only) { + $chart[$timestamp]['max'.$series_suffix] = $last_known; + } + else if ($min_only) { + $chart[$timestamp]['min'.$series_suffix] = $last_known; + } else { $chart[$timestamp]['max'.$series_suffix] = $last_known; $chart[$timestamp]['sum'.$series_suffix] = $last_known; @@ -502,8 +521,9 @@ function grafico_modulo_sparse_data ($agent_module_id, $period, $show_events, $baseline = 0, $return_data = 0, $show_title = true, $projection = false, $adapt_key = '', $compare = false, $series_suffix = '', $series_suffix_str = '', $show_unknown = false, $percentil = null, $dashboard = false, $vconsole = false, - $type_graph='area', $fullscale = false, $flash_chart = false) { - + $type_graph='area', $fullscale = false, $flash_chart = false, $force_interval = false,$time_interval = 300, + $max_only = 0, $min_only = 0) { + global $config; global $chart; global $color; @@ -529,8 +549,23 @@ function grafico_modulo_sparse_data ($agent_module_id, $period, $show_events, if ($date == 0) $date = get_system_time(); $datelimit = $date - $period; $search_in_history_db = db_search_in_history_db($datelimit); - $resolution = $config['graph_res'] * 50; //Number of points of the graph - $interval = (int) ($period / $resolution); + + + + if($force_interval){ + $resolution = $period/$time_interval; + } + else{ + $resolution = $config['graph_res'] * 50; //Number of points of the graph + } + + if($force_interval){ + $interval = $time_interval; + } + else{ + $interval = (int) ($period / $resolution); + } + $agent_name = modules_get_agentmodule_agent_name ($agent_module_id); $agent_id = agents_get_agent_id ($agent_name); $module_name = modules_get_agentmodule_name ($agent_module_id); @@ -718,7 +753,8 @@ function grafico_modulo_sparse_data ($agent_module_id, $period, $show_events, $projection, $avg_only, $uncompressed_module, $show_events, $show_alerts, $show_unknown, $baseline, $baseline_data, $events, $series_suffix, $start_unknown, - $percentil, $fullscale); + $percentil, $fullscale, $force_interval, $time_interval, + $max_only, $min_only); } // Return chart data and don't draw @@ -843,6 +879,19 @@ function grafico_modulo_sparse_data ($agent_module_id, $period, $show_events, $legend['percentil'.$series_suffix] = __('Percentile %dº', $percentil) .$series_suffix_str . " (" . $percentil_value . " " . $unit . ") "; $chart_extra_data['legend_percentil'] = $legend['percentil'.$series_suffix_str]; } + + if($force_interval){ + $legend = array(); + if($avg_only){ + $legend['sum'.$series_suffix] = __('Avg'); + } + elseif ($max_only) { + $legend['min'.$series_suffix] = __('Max'); + } + elseif ($min_only) { + $legend['max'.$series_suffix] = __('Min'); + } + } } function grafico_modulo_sparse ($agent_module_id, $period, $show_events, @@ -853,8 +902,10 @@ function grafico_modulo_sparse ($agent_module_id, $period, $show_events, $adapt_key = '', $compare = false, $show_unknown = false, $menu = true, $backgroundColor = 'white', $percentil = null, $dashboard = false, $vconsole = false, $type_graph = 'area', $fullscale = false, - $id_widget_dashboard = false) { - + $id_widget_dashboard = false,$force_interval = 0,$time_interval = 300, + $max_only = 0, $min_only = 0) { + + global $config; global $graphic_type; @@ -884,7 +935,7 @@ function grafico_modulo_sparse ($agent_module_id, $period, $show_events, $return_data, $show_title, $projection, $adapt_key, $compare, $series_suffix, $series_suffix_str, $show_unknown, $percentil, $dashboard, $vconsole,$type_graph, - $fullscale, $flash_chart); + $fullscale, $flash_chart,$force_interval,$time_interval,$max_only,$min_only); switch ($compare) { case 'separated': @@ -917,7 +968,9 @@ function grafico_modulo_sparse ($agent_module_id, $period, $show_events, $show_alerts, $avg_only, $date, $unit, $baseline, $return_data, $show_title, $projection, $adapt_key, $compare, '', '', $show_unknown, - $percentil, $dashboard, $vconsole, $type_graph, $fullscale, $flash_chart); + $percentil, $dashboard, $vconsole, $type_graph, $fullscale,$flash_chart, + $force_interval,$time_interval,$max_only,$min_only); + if ($return_data) { return $data_returned; } @@ -2107,14 +2160,14 @@ function graphic_combined_module ($module_list, $weight_list, $period, $width, $height, $color, $module_name_list, $long_index, ui_get_full_url("images/image_problem_area_small.png", false, false, false), "", "", $water_mark, $config['fontpath'], $fixed_font_size, - "", $ttl, $homeurl, $background_color); + "", $ttl, $homeurl, $background_color, 'black'); break; case CUSTOM_GRAPH_VBARS: return vbar_graph($flash_charts, $graph_values, $width, $height, $color, $module_name_list, $long_index, ui_get_full_url("images/image_problem_area_small.png", false, false, false), "", "", $water_mark, $config['fontpath'], $fixed_font_size, - "", $ttl, $homeurl, $background_color, true); + "", $ttl, $homeurl, $background_color, true, false, "black"); break; case CUSTOM_GRAPH_PIE: return ring_graph($flash_charts, $graph_values, $width, $height, @@ -2457,10 +2510,10 @@ function progress_bar($progress, $width, $height, $title = '', $mode = 1, $value require_once("include_graph_dependencies.php"); include_graphs_dependencies($config['homedir'].'/'); $src = ui_get_full_url( - "/include/graphs/fgraph.php?homeurl=../../&graph_type=progressbar" . - "&width=".$width."&homedir=".$config['homedir']."&height=".$height."&progress=".$progress. + "/include/graphs/fgraph.php?graph_type=progressbar" . + "&width=".$width."&height=".$height."&progress=".$progress. "&mode=" . $mode . "&out_of_lim_str=".$out_of_lim_str . - "&title=".$title."&font=".$config['fontpath']."&value_text=". $value_text . + "&title=".$title."&value_text=". $value_text . "&colorRGB=". $colorRGB, false, false, false ); @@ -2492,10 +2545,10 @@ function progress_bubble($progress, $width, $height, $title = '', $mode = 1, $va include_graphs_dependencies($config['homedir'].'/'); return "" . $title . ""; } @@ -2779,7 +2832,9 @@ function grafico_db_agentes_paquetes($width = 380, $height = 300) { return hbar_graph($config['flash_charts'], $data, $width, $height, array(), $legend, "", "", true, "", $water_mark, - $config['fontpath'], $config['font_size'], false); + $config['fontpath'], $config['font_size'], false, 1, $config['homeurl'], + 'white', + 'black'); } /** @@ -2846,7 +2901,9 @@ function graph_db_agentes_modulos($width, $height) { $data, $width, $height, array(), array(), "", "", true, "", $water_mark, - $config['fontpath'], $config['font_size'], false); + $config['fontpath'], $config['font_size'], false, 1, $config['homeurl'], + 'white', + 'black'); } /** @@ -3621,12 +3678,14 @@ function graph_custom_sql_graph ($id, $width, $height, case 'sql_graph_vbar': // vertical bar return vbar_graph($flash_charts, $data, $width, $height, array(), array(), "", "", $homeurl, $water_mark, - $config['fontpath'], $config['font_size'], false, $ttl); + $config['fontpath'], $config['font_size'], false, $ttl, "", "white", false, false, "black"); break; case 'sql_graph_hbar': // horizontal bar return hbar_graph($flash_charts, $data, $width, $height, array(), array(), "", "", true, $homeurl, $water_mark, - $config['fontpath'], $config['font_size'], false, $ttl); + $config['fontpath'], $config['font_size'], false, $ttl,$config['homeurl'], + 'white', + 'black'); break; case 'sql_graph_pie': // Pie return pie3d_graph($flash_charts, $data, $width, $height, __("other"), $homeurl, diff --git a/pandora_console/include/functions_pandora_networkmap.php b/pandora_console/include/functions_pandora_networkmap.php index 0bbb4dd124..e09a20f3bc 100644 --- a/pandora_console/include/functions_pandora_networkmap.php +++ b/pandora_console/include/functions_pandora_networkmap.php @@ -374,6 +374,7 @@ function networkmap_db_node_to_js_node($node, &$count, &$count_item_holding_area $item['image_width'] = (int)$image_size[0]; $item['image_height'] = (int)$image_size[1]; } + $item['raw_text'] = $node['style']['label']; $item['text'] = io_safe_output($node['style']['label']); $item['shape'] = $node['style']['shape']; switch ($node['type']) { @@ -548,7 +549,7 @@ function networkmap_links_to_js_links($relations, $nodes_graph) { $item['arrow_end'] = 'module'; $item['status_end'] = modules_get_agentmodule_status((int)$id_target_module, false, false, null); $item['id_module_end'] = (int)$id_target_module; - $text_end = io_safe_output(modules_get_agentmodule_name((int)$id_target_module)); + $text_end = modules_get_agentmodule_name((int)$id_target_module); if (preg_match ("/(.+)_ifOperStatus$/" , (string)$text_end, $matches)) { if ($matches[1]) { $item['text_end'] = $matches[1]; @@ -559,7 +560,7 @@ function networkmap_links_to_js_links($relations, $nodes_graph) { $item['arrow_start'] = 'module'; $item['status_start'] = modules_get_agentmodule_status((int)$id_source_module, false, false, null); $item['id_module_start'] = (int)$id_source_module; - $text_start = io_safe_output(modules_get_agentmodule_name((int)$id_source_module)); + $text_start = modules_get_agentmodule_name((int)$id_source_module); if (preg_match ("/(.+)_ifOperStatus$/" , (string)$text_start, $matches)) { if ($matches[1]) { $item['text_start'] = $matches[1]; @@ -874,7 +875,6 @@ function networkmap_loadfile($id = 0, $file = '', modules_get_agentmodule_agent($ids[$node_id]['id_module']); $text = modules_get_agentmodule_name($data['id_module']); - $text = io_safe_output($text); $text = ui_print_truncate_text($text, 'agent_medium', false, true, false, '...', false); @@ -885,7 +885,6 @@ function networkmap_loadfile($id = 0, $file = '', $data['id_agent'] = $ids[$node_id]['id_agent']; $text = agents_get_alias($ids[$node_id]['id_agent']); - $text = io_safe_output($text); $text = ui_print_truncate_text($text, 'agent_medium', false, true, false, '...', false); @@ -975,7 +974,7 @@ function duplicate_networkmap($id) { $values = db_get_row('tmap', 'id', $id); unset($values['id']); $free_name = false; - $values['name'] = io_safe_input(__('Copy of ') . io_safe_output($values['name'])); + $values['name'] = io_safe_input(__('Copy of ')) . $values['name']; $count = 1; while (!$free_name) { $exist = db_get_row_filter('tmap', array('name' => $values['name'])); diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index 72ab847d48..26ea84367a 100644 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -190,6 +190,9 @@ function reporting_make_reporting_data($report = null, $id_report, $items_label['id_agent_module'] = $content['id_agent_module']; $items_label['modules'] = $modules_to_macro; $items_label['agents'] = $agents_to_macro; + $items_label['visual_format'] = $visual_format; + $metaconsole_on = is_metaconsole(); + $server_name = $content['server_name']; //Metaconsole connection if ($metaconsole_on && $server_name != '') { @@ -232,6 +235,12 @@ function reporting_make_reporting_data($report = null, $id_report, $report, $content); break; + case 'increment': + $report['contents'][] = + reporting_increment( + $report, + $content); + break; case 'general': $report['contents'][] = reporting_general( @@ -290,19 +299,19 @@ function reporting_make_reporting_data($report = null, $id_report, $report['contents'][] = reporting_value( $report, $content, - 'max'); + 'max',$pdf); break; case 'avg_value': $report['contents'][] = reporting_value( $report, $content, - 'avg'); + 'avg',$pdf); break; case 'min_value': $report['contents'][] = reporting_value( $report, $content, - 'min'); + 'min',$pdf); break; case 'sumatory': $report['contents'][] = reporting_value( @@ -776,8 +785,8 @@ function reporting_SLA($report, $content, $type = 'dinamic', } $data = array(); - $data['agent'] = modules_get_agentmodule_agent_alias($sla['id_agent_module']); - $data['module'] = modules_get_agentmodule_name($sla['id_agent_module']); + $data['agent'] = io_safe_output(modules_get_agentmodule_agent_alias($sla['id_agent_module'])); + $data['module'] = io_safe_output(modules_get_agentmodule_name($sla['id_agent_module'])); $data['max'] = $sla['sla_max']; $data['min'] = $sla['sla_min']; $data['sla_limit'] = $sla['sla_limit']; @@ -886,8 +895,8 @@ function reporting_SLA($report, $content, $type = 'dinamic', // Slice graphs calculation if ($show_graphs) { $dataslice = array(); - $dataslice['agent'] = modules_get_agentmodule_agent_alias ($sla['id_agent_module']); - $dataslice['module'] = modules_get_agentmodule_name ($sla['id_agent_module']); + $dataslice['agent'] = io_safe_output(modules_get_agentmodule_agent_alias ($sla['id_agent_module'])); + $dataslice['module'] = io_safe_output(modules_get_agentmodule_name ($sla['id_agent_module'])); $dataslice['sla_value'] = $data['sla_value']; $dataslice['order'] = $data['sla_value']; @@ -1295,7 +1304,9 @@ function reporting_event_top_n($report, $content, $type = 'dinamic', $config['font_size'], true, $ttl, - $config['homeurl']); + $config['homeurl'], + 'white', + 'black'); } $return['resume'] = null; @@ -3752,7 +3763,7 @@ function reporting_agent_configuration($report, $content) { return reporting_check_structure_content($return); } -function reporting_value($report, $content, $type) { +function reporting_value($report, $content, $type,$pdf) { global $config; $return = array(); @@ -3837,8 +3848,17 @@ function reporting_value($report, $content, $type) { $return['agent_name'] = $agent_name; $return['module_name'] = $module_name; + html_debug($pdf,true); + html_debug($only_image,true); + + if($pdf){ + $only_image = 1; + } + switch ($type) { case 'max': + if($content['lapse_calc'] == 0){ + $value = reporting_get_agentmodule_data_max( $content['id_agent_module'], $content['period'], $report["datetime"]); if (!$config['simple_module_value']) { @@ -3847,18 +3867,286 @@ function reporting_value($report, $content, $type) { else { $formated_value = format_for_graph($value, $config['graph_precision']) . " " . $unit; } - break; + + } + else{ + + $value = ' + + + + + + + + + +
'; + + if($content['visual_format'] == 1 || $content['visual_format'] == 2 || $content['visual_format'] == 3){ + + $value .= ' + + + + + + + + + + +
+ '.__("Agent").' + + '.__("Module").' + + '.__("Maximum").' +
+ '.$agent_name.' + + '.$module_name.' + + '.format_for_graph(reporting_get_agentmodule_data_max( + $content['id_agent_module'], $content['period'], $report["datetime"]), $config['graph_precision']) . ' ' . $unit.' +
'; + + } + + $value .= ' +
+ '; + + if($content['visual_format'] == 2 || $content['visual_format'] == 3){ + $value .= + grafico_modulo_sparse( + $content['id_agent_module'], + $content['period'], + false, + 600, + 300, + '', + '', + false, + 0, + true, + $report["datetime"], + '', + 0, + 0, + true, + $only_image, + ui_get_full_url(false, false, false, false), + 2, + false, + '', + $time_compare_overlapped, + true, + true, + 'white', + ($content['style']['percentil'] == 1) ? $config['percentil'] : null, + false, + false, + $config['type_module_charts'], + false, + false, + $content['lapse_calc'], + $content['lapse'], + 1); + } + + $value .= ' + +
'; + + if($content['visual_format'] == 1 || $content['visual_format'] == 3){ + + $value .= ' + + + + + + '; + $time_begin = db_get_row_sql('select utimestamp from tagente_datos where id_agente_modulo ='.$content['id_agent_module']); + $date_reference = getdate(); + + for ($i=$date_reference[0]; $i > ($date_reference[0]-$content["period"]); $i -= $content["lapse"]) { + + $value .= ''; + } + else{ + $value .= 'N/A'; + } + + } + + $value .='
+ '.__("Lapse").' + + '.__("Maximum").' +
'. date("Y-m-d H:i:s", ($i-$content["lapse"]+1)).' to '.date("Y-m-d H:i:s",$i).''; + + if($i>$time_begin['utimestamp']){ + $value .= format_for_graph(reporting_get_agentmodule_data_max( + $content['id_agent_module'], $content["lapse"], $i), $config['graph_precision']) . ' ' . $unit.'
'; + } + + $value .= ' + +
'; + + $formated_value = $value; + } + + break; case 'min': - $value = reporting_get_agentmodule_data_min( - $content['id_agent_module'], $content['period'], $report["datetime"]); - if (!$config['simple_module_value']) { + if($content['lapse_calc'] == 0){ + $value = reporting_get_agentmodule_data_min( + $content['id_agent_module'], $content['period'], $report["datetime"]); + + if (!$config['simple_module_value']) { + $formated_value = $value; + } + else { + $formated_value = format_for_graph($value, $config['graph_precision']) . " " . $unit; + } + + } + else{ + + $value = ' + + + + + + + + + +
'; + + if($content['visual_format'] == 1 || $content['visual_format'] == 2 || $content['visual_format'] == 3){ + + $value .= ' + + + + + + + + + + +
+ '.__("Agent").' + + '.__("Module").' + + '.__("Minimum").' +
+ '.$agent_name.' + + '.$module_name.' + + '.format_for_graph(reporting_get_agentmodule_data_min( + $content['id_agent_module'], $content['period'], $report["datetime"]), $config['graph_precision']) . ' ' . $unit.' +
'; + + } + + $value .= ' +
+ '; + + if($content['visual_format'] == 2 || $content['visual_format'] == 3){ + $value .= + grafico_modulo_sparse( + $content['id_agent_module'], + $content['period'], + false, + 600, + 300, + '', + '', + false, + 0, + true, + $report["datetime"], + '', + 0, + 0, + true, + $only_image, + ui_get_full_url(false, false, false, false), + 2, + false, + '', + $time_compare_overlapped, + true, + true, + 'white', + ($content['style']['percentil'] == 1) ? $config['percentil'] : null, + false, + false, + $config['type_module_charts'], + false, + false, + $content['lapse_calc'], + $content['lapse'], + 0, + 1); + } + + $value .= ' + +
'; + + if($content['visual_format'] == 1 || $content['visual_format'] == 3){ + + $value .= ' + + + + + + '; + $time_begin = db_get_row_sql('select utimestamp from tagente_datos where id_agente_modulo ='.$content['id_agent_module']); + $date_reference = getdate(); + + for ($i=$date_reference[0]; $i > ($date_reference[0]-$content["period"]); $i -= $content["lapse"]) { + + $value .= ''; + } + else{ + $value .= 'N/A'; + } + + } + + $value .='
+ '.__("Lapse").' + + '.__("Minimum").' +
'. date("Y-m-d H:i:s", ($i-$content["lapse"]+1)).' to '.date("Y-m-d H:i:s",$i).''; + + if($i>$time_begin['utimestamp']){ + $value .= format_for_graph(reporting_get_agentmodule_data_min( + $content['id_agent_module'], $content["lapse"], $i), $config['graph_precision']) . ' ' . $unit.'
'; + } + + $value .= ' + +
'; + $formated_value = $value; } - else { - $formated_value = format_for_graph($value, $config['graph_precision']) . " " . $unit; - } + break; case 'avg': + if($content['lapse_calc'] == 0){ $value = reporting_get_agentmodule_data_average( $content['id_agent_module'], $content['period'], $report["datetime"]); if (!$config['simple_module_value']) { @@ -3867,7 +4155,138 @@ function reporting_value($report, $content, $type) { else { $formated_value = format_for_graph($value, $config['graph_precision']) . " " . $unit; } - break; + } + else{ + $value = ' + + + + + + + + + +
'; + + if($content['visual_format'] == 1 || $content['visual_format'] == 2 || $content['visual_format'] == 3){ + + $value .= ' + + + + + + + + + + +
+ '.__("Agent").' + + '.__("Module").' + + '.__("Average").' +
+ '.$agent_name.' + + '.$module_name.' + + '.format_for_graph(reporting_get_agentmodule_data_average( + $content['id_agent_module'], $content['period'], $report["datetime"]), $config['graph_precision']) . ' ' . $unit.' +
'; + + } + + $value .= ' +
+ '; + + if($content['visual_format'] == 2 || $content['visual_format'] == 3){ + $value .= + grafico_modulo_sparse( + $content['id_agent_module'], + $content['period'], + false, + 600, + 300, + '', + '', + false, + 1, + true, + $report["datetime"], + '', + 0, + 0, + true, + $only_image, + ui_get_full_url(false, false, false, false), + 2, + false, + '', + $time_compare_overlapped, + true, + true, + 'white', + ($content['style']['percentil'] == 1) ? $config['percentil'] : null, + false, + false, + $config['type_module_charts'], + false, + false, + $content['lapse_calc'], + $content['lapse'] + ); + } + + $value .= ' + +
'; + + if($content['visual_format'] == 1 || $content['visual_format'] == 3){ + + $value .= ' + + + + + + '; + $time_begin = db_get_row_sql('select utimestamp from tagente_datos where id_agente_modulo ='.$content['id_agent_module']); + $date_reference = getdate(); + + for ($i=$date_reference[0]; $i > ($date_reference[0]-$content["period"]); $i -= $content["lapse"]) { + + $value .= ''; + } + else{ + $value .= 'N/A'; + } + + } + + $value .='
+ '.__("Lapse").' + + '.__("Average").' +
'. date("Y-m-d H:i:s", ($i-$content["lapse"]+1)).' to '.date("Y-m-d H:i:s",$i).''; + + if($i>$time_begin['utimestamp']){ + $value .= format_for_graph(reporting_get_agentmodule_data_average( + $content['id_agent_module'], $content["lapse"], $i), $config['graph_precision']) . ' ' . $unit.'
'; + } + + $value .= ' + +
'; + + $formated_value = $value; + + } + break; + case 'sum': $value = reporting_get_agentmodule_data_sum( $content['id_agent_module'], $content['period'], $report["datetime"]); @@ -5571,6 +5990,101 @@ function reporting_availability_graph($report, $content, $pdf=false) { return reporting_check_structure_content($return); } +/** + * reporting_increment + * + * Generates a structure the report. + * + */ +function reporting_increment ($report, $content) { + global $config; + + $return = array(); + $return['type'] = 'increment'; + if (empty($content['name'])) { + $content['name'] = __('Increment'); + } + + $return['title'] = $content['name']; + $return["description"] = $content["description"]; + $return["id_agent_module"] = $content["id_agent_module"]; + $return["id_agent"] = $content["id_agent"]; + + $id_agent_module = $content['id_agent_module']; + $period = (int)$content['period']; + + $return["from"] = time() - $period; + $return["to"] = time(); + + $return["data"] = array(); + + if (defined('METACONSOLE')) { + $sql1 = 'SELECT datos FROM tagente_datos WHERE id_agente_modulo = ' . $id_agent_module . ' + AND utimestamp <= ' . (time() - $period) . ' ORDER BY utimestamp DESC'; + $sql2 = 'SELECT datos FROM tagente_datos WHERE id_agente_modulo = ' . $id_agent_module . ' ORDER BY utimestamp DESC'; + + $servers = db_get_all_rows_sql ('SELECT * + FROM tmetaconsole_setup + WHERE disabled = 0'); + + if ($servers === false) + $servers = array(); + + $result = array(); + $count_modules = 0; + foreach ($servers as $server) { + // If connection was good then retrieve all data server + if (metaconsole_connect($server) == NOERR) + $connection = true; + else + $connection = false; + + $old_data = db_get_value_sql ($sql1); + + $last_data = db_get_value_sql ($sql2); + } + } + else { + $old_data = db_get_value_sql('SELECT datos FROM tagente_datos WHERE id_agente_modulo = ' . $id_agent_module . ' + AND utimestamp <= ' . (time() - $period) . ' ORDER BY utimestamp DESC'); + + $last_data = db_get_value_sql('SELECT datos FROM tagente_datos WHERE id_agente_modulo = ' . $id_agent_module . ' ORDER BY utimestamp DESC'); + } + + if (!defined('METACONSOLE')) { + + } + + if ($old_data === false || $last_data === false) { + $return["data"]['message'] = __('The monitor have no data in this range of dates or monitor type is not numeric'); + $return["data"]['error'] = true; + } + else if (is_numeric($old_data) && is_numeric($last_data)) { + $return["data"]['old'] = $old_data; + $return["data"]['now'] = $last_data; + $increment = $old_data - $last_data; + + if ($increment < 0) { + $return["data"]['inc'] = 'positive'; + $return["data"]["inc_data"] = $last_data - $old_data; + } + else if ($increment == 0) { + $return["data"]['inc'] = 'neutral'; + $return["data"]["inc_data"] = 0; + } + else { + $return["data"]['inc'] = 'negative'; + $return["data"]["inc_data"] = $old_data - $last_data; + } + } + else { + $return["data"]['message'] = __('The monitor type is not numeric'); + $return["data"]['error'] = true; + } + + return reporting_check_structure_content($return); +} + /** * reporting_general * diff --git a/pandora_console/include/functions_reporting_html.php b/pandora_console/include/functions_reporting_html.php index cb29812686..eca001e288 100644 --- a/pandora_console/include/functions_reporting_html.php +++ b/pandora_console/include/functions_reporting_html.php @@ -208,6 +208,9 @@ function reporting_html_print_report($report, $mini = false, $report_info = 1) { case 'avg_value': reporting_html_avg_value($table, $item, $mini); break; + case 'increment': + reporting_html_increment($table, $item); + break; case 'min_value': reporting_html_min_value($table, $item, $mini); break; @@ -2213,6 +2216,69 @@ function reporting_html_value(&$table, $item, $mini, $only_value = false, $check $table->data['data']['cell'] .= '

'; } +function reporting_html_increment(&$table, $item) { + global $config; + + if (isset($item["data"]['error'])) { + $table->colspan['error']['cell'] = 3; + $table->data['error']['cell'] = $item["data"]['message']; + } + else { + $table1 = new stdClass(); + $table1->width = '99%'; + $table1->data = array (); + + $table1->head = array (); + $table1->head[0] = __('Agent'); + $table1->head[1] = __('Module'); + $table1->head[2] = __('From'); + $table1->head[3] = __('To'); + $table1->head[4] = __('From data'); + $table1->head[5] = __('To data'); + $table1->head[6] = __('Increment'); + + $table1->headstyle = array(); + $table1->headstyle[0] = 'text-align: left'; + $table1->headstyle[1] = 'text-align: left'; + $table1->headstyle[2] = 'text-align: left'; + $table1->headstyle[3] = 'text-align: left'; + $table1->headstyle[4] = 'text-align: right'; + $table1->headstyle[5] = 'text-align: right'; + $table1->headstyle[6] = 'text-align: right'; + + $table1->style[0] = 'text-align: left'; + $table1->style[1] = 'text-align: left'; + $table1->style[2] = 'text-align: left'; + $table1->style[3] = 'text-align: left'; + $table1->style[4] = 'text-align: right'; + $table1->style[5] = 'text-align: right'; + $table1->style[6] = 'text-align: right'; + + $table1_row = array(); + $table1_row[0] = agents_get_alias($item['id_agent']); + $table1_row[1] = modules_get_agentmodule_name($item['id_agent_module']); + $table1_row[2] = date("F j, Y, G:i", $item['from']); + $table1_row[3] = date("F j, Y, G:i", $item['to']); + $table1_row[4] = $item["data"]['old']; + $table1_row[5] = $item["data"]['now']; + if ($item["data"]['inc'] == 'negative') { + $table1_row[6] = __('Negative increase: ') . $item["data"]["inc_data"]; + } + else if ($item["data"]['inc'] == 'positive') { + $table1_row[6] = __('Positive increase: ') . $item["data"]["inc_data"]; + } + else { + $table1_row[6] = __('Neutral increase: ') . $item["data"]["inc_data"]; + } + + $table1->data[] = $table1_row; + + $data = array(); + $data[0] = html_print_table($table1, true); + array_push ($table->data, $data); + } +} + function reporting_html_url(&$table, $item, $key) { $table->colspan['data']['cell'] = 3; $table->cellstyle['data']['cell'] = 'text-align: left;'; diff --git a/pandora_console/include/functions_reports.php b/pandora_console/include/functions_reports.php index 9282be345b..dfa3d3d490 100755 --- a/pandora_console/include/functions_reports.php +++ b/pandora_console/include/functions_reports.php @@ -574,7 +574,8 @@ function reports_get_report_types ($template = false, $not_editor = false) { 'name' => __('Summatory')); $types['historical_data'] = array('optgroup' => __('Modules'), 'name' => __('Historical Data')); - + $types['increment'] = array('optgroup' => __('Modules'), + 'name' => __('Increment')); $types['general'] = array('optgroup' => __('Grouped'), diff --git a/pandora_console/include/functions_ui.php b/pandora_console/include/functions_ui.php index de10fcaf91..e76ba9399f 100755 --- a/pandora_console/include/functions_ui.php +++ b/pandora_console/include/functions_ui.php @@ -94,22 +94,27 @@ function ui_print_truncate_text($text, $numChars = GENERIC_SIZE_TEXT, $showTextI } } - $text = io_safe_output($text); - if (mb_strlen($text, "UTF-8") > ($numChars)) { + $text_html_decoded = io_safe_output($text); + $text_has_entities = $text != $text_html_decoded; + + if (mb_strlen($text_html_decoded, "UTF-8") > ($numChars)) { // '/2' because [...] is in the middle of the word. $half_length = intval(($numChars - 3) / 2); // Depending on the strange behavior of mb_strimwidth() itself, // the 3rd parameter is not to be $numChars but the length of // original text (just means 'large enough'). - $truncateText2 = mb_strimwidth($text, - (mb_strlen($text, "UTF-8") - $half_length), - mb_strlen($text, "UTF-8"), "", "UTF-8" ); + $truncateText2 = mb_strimwidth($text_html_decoded, + (mb_strlen($text_html_decoded, "UTF-8") - $half_length), + mb_strlen($text_html_decoded, "UTF-8"), "", "UTF-8" ); - $truncateText = mb_strimwidth($text, 0, - ($numChars - $half_length), "", "UTF-8") . $suffix; + $truncateText = mb_strimwidth($text_html_decoded, 0, + ($numChars - $half_length), "", "UTF-8"); - $truncateText = $truncateText . $truncateText2; + // Recover the html entities to avoid XSS attacks + $truncateText = ($text_has_entities) + ? io_safe_input($truncateText) . $suffix . io_safe_input($truncateText2) + : $truncateText . $suffix . $truncateText2; if ($showTextInTitle) { if ($style === null) { @@ -2968,6 +2973,11 @@ function ui_print_agent_autocomplete_input($parameters) { else $metaconsole_enabled = false; } + + $get_only_string_modules = false; + if (isset($parameters['get_only_string_modules'])) { + $get_only_string_modules = true; + } $spinner_image = html_print_image('images/spinner.gif', true, false, true); if (isset($parameters['spinner_image'])) { @@ -3029,7 +3039,10 @@ function ui_print_agent_autocomplete_input($parameters) { $javascript = $parameters['javascript']; } - + $get_order_json = false; + if (isset($parameters['get_order_json'])) { + $get_order_json = true; + } $javascript_is_function_select = false; //Default value if (isset($parameters['javascript_is_function_select'])) { @@ -3116,6 +3129,14 @@ function ui_print_agent_autocomplete_input($parameters) { if (' . ((int) !$metaconsole_enabled) . ') { inputs.push ("force_local_modules=1"); } + + if (' . ((int) $get_order_json) . ') { + inputs.push ("get_order_json=1"); + } + + if (' . ((int) $get_only_string_modules) . ') { + inputs.push ("get_only_string_modules=1"); + } if (' . ((int)$metaconsole_enabled) . ') { if ((' . ((int)$use_input_server) . ') diff --git a/pandora_console/include/functions_users.php b/pandora_console/include/functions_users.php index 8e3eac823b..957c8c569e 100755 --- a/pandora_console/include/functions_users.php +++ b/pandora_console/include/functions_users.php @@ -152,6 +152,8 @@ function users_get_groups_for_select($id_user, $privilege = "AR", $returnAllGro * @return array A list of the groups the user has certain privileges. */ function users_get_groups ($id_user = false, $privilege = "AR", $returnAllGroup = true, $returnAllColumns = false, $id_groups = null, $keys_field = 'id_grupo') { + static $group_cache = array(); + if (empty ($id_user)) { global $config; diff --git a/pandora_console/include/functions_visual_map.php b/pandora_console/include/functions_visual_map.php index 7cdb64041e..3f607eb0d5 100755 --- a/pandora_console/include/functions_visual_map.php +++ b/pandora_console/include/functions_visual_map.php @@ -1140,224 +1140,180 @@ function visual_map_print_item($mode = "read", $layoutData, if ( (get_parameter('action') == 'edit') || (get_parameter('operation') == 'edit_visualmap') ) { if($width == 0){ - if (($is_string == 17) || ($is_string == 23) || ($is_string == 3) || - ($is_string == 10) || ($is_string == 33)) { - if ($layoutData['id_metaconsole'] != 0) { - $img = ''; - } - else{ - $img = ''; - } + if ($layoutData['id_metaconsole'] != 0) { + $img = ''; } - else { - if ($layoutData['id_metaconsole'] != 0) { - $img = ''; - } - else{ - $img = ''; - } + else{ + $img = ''; } } else{ - if (($is_string == 17) || ($is_string == 23) || ($is_string == 3) || - ($is_string == 10) || ($is_string == 33)) { - if ($layoutData['id_metaconsole'] != 0) { - $img = ''; - } - else{ - $img = ''; - } + if ($layoutData['id_metaconsole'] != 0) { + $img = ''; } - else { - if ($layoutData['id_metaconsole'] != 0) { - $img = ''; - } - else{ - $img = ''; - } + else{ + $img = ''; } } } else { - if (($is_string == 17) || ($is_string == 23) || ($is_string == 3) || - ($is_string == 10) || ($is_string == 33)) { + $color = array(); - $color = array(); - - $color[0] = array('border' => '#000000', - 'color' => $config['graph_color1'], - 'alpha' => CHART_DEFAULT_ALPHA); - $color[1] = array('border' => '#000000', - 'color' => $config['graph_color2'], - 'alpha' => CHART_DEFAULT_ALPHA); - $color[2] = array('border' => '#000000', - 'color' => $config['graph_color3'], - 'alpha' => CHART_DEFAULT_ALPHA); - $color[3] = array('border' => '#000000', - 'color' => $config['graph_color4'], - 'alpha' => CHART_DEFAULT_ALPHA); - $color[4] = array('border' => '#000000', - 'color' => $config['graph_color5'], - 'alpha' => CHART_DEFAULT_ALPHA); - $color[5] = array('border' => '#000000', - 'color' => $config['graph_color6'], - 'alpha' => CHART_DEFAULT_ALPHA); - $color[6] = array('border' => '#000000', - 'color' => $config['graph_color7'], - 'alpha' => CHART_DEFAULT_ALPHA); - $color[7] = array('border' => '#000000', - 'color' => $config['graph_color8'], - 'alpha' => CHART_DEFAULT_ALPHA); - $color[8] = array('border' => '#000000', - 'color' => $config['graph_color9'], - 'alpha' => CHART_DEFAULT_ALPHA); - $color[9] = array('border' => '#000000', - 'color' => $config['graph_color10'], - 'alpha' => CHART_DEFAULT_ALPHA); - $color[11] = array('border' => '#000000', - 'color' => COL_GRAPH9, - 'alpha' => CHART_DEFAULT_ALPHA); - $color[12] = array('border' => '#000000', - 'color' => COL_GRAPH10, - 'alpha' => CHART_DEFAULT_ALPHA); - $color[13] = array('border' => '#000000', - 'color' => COL_GRAPH11, - 'alpha' => CHART_DEFAULT_ALPHA); - $color[14] = array('border' => '#000000', - 'color' => COL_GRAPH12, - 'alpha' => CHART_DEFAULT_ALPHA); - $color[15] = array('border' => '#000000', - 'color' => COL_GRAPH13, - 'alpha' => CHART_DEFAULT_ALPHA); + $color[0] = array('border' => '#000000', + 'color' => $config['graph_color1'], + 'alpha' => CHART_DEFAULT_ALPHA); + $color[1] = array('border' => '#000000', + 'color' => $config['graph_color2'], + 'alpha' => CHART_DEFAULT_ALPHA); + $color[2] = array('border' => '#000000', + 'color' => $config['graph_color3'], + 'alpha' => CHART_DEFAULT_ALPHA); + $color[3] = array('border' => '#000000', + 'color' => $config['graph_color4'], + 'alpha' => CHART_DEFAULT_ALPHA); + $color[4] = array('border' => '#000000', + 'color' => $config['graph_color5'], + 'alpha' => CHART_DEFAULT_ALPHA); + $color[5] = array('border' => '#000000', + 'color' => $config['graph_color6'], + 'alpha' => CHART_DEFAULT_ALPHA); + $color[6] = array('border' => '#000000', + 'color' => $config['graph_color7'], + 'alpha' => CHART_DEFAULT_ALPHA); + $color[7] = array('border' => '#000000', + 'color' => $config['graph_color8'], + 'alpha' => CHART_DEFAULT_ALPHA); + $color[8] = array('border' => '#000000', + 'color' => $config['graph_color9'], + 'alpha' => CHART_DEFAULT_ALPHA); + $color[9] = array('border' => '#000000', + 'color' => $config['graph_color10'], + 'alpha' => CHART_DEFAULT_ALPHA); + $color[11] = array('border' => '#000000', + 'color' => COL_GRAPH9, + 'alpha' => CHART_DEFAULT_ALPHA); + $color[12] = array('border' => '#000000', + 'color' => COL_GRAPH10, + 'alpha' => CHART_DEFAULT_ALPHA); + $color[13] = array('border' => '#000000', + 'color' => COL_GRAPH11, + 'alpha' => CHART_DEFAULT_ALPHA); + $color[14] = array('border' => '#000000', + 'color' => COL_GRAPH12, + 'alpha' => CHART_DEFAULT_ALPHA); + $color[15] = array('border' => '#000000', + 'color' => COL_GRAPH13, + 'alpha' => CHART_DEFAULT_ALPHA); - $module_data = get_bars_module_data($id_module); - $water_mark = array('file' => '/var/www/html/pandora_console/images/logo_vertical_water.png', - 'url' => 'http://localhost/pandora_console/images/logo_vertical_water.png'); - - if ($width == 0) { - if ($layoutData['label_position']=='left') { - if ($layoutData['type_graph'] == 'horizontal') { - $img = '
'. - hbar_graph(true, $module_data, - 400, 400, $color, array(), array(), - ui_get_full_url("images/image_problem.opaque.png", false, false, false), - "", "", $water_mark, $config['fontpath'], 6, - "", 0, $config['homeurl'], $layoutData['image']) . '
'; - } - else { - $img = '
'. - vbar_graph(true, $module_data, - 400, 400, $color, array(), array(), - ui_get_full_url("images/image_problem.opaque.png", false, false, false), - "", "", $water_mark, $config['fontpath'], 6, - "", 0, $config['homeurl'], $layoutData['image'], true) . '
'; - } - } - elseif($layoutData['label_position']=='right') { - if ($layoutData['type_graph'] == 'horizontal') { - $img = '
'. - hbar_graph(true, $module_data, - 400, 400, $color, array(), array(), - ui_get_full_url("images/image_problem.opaque.png", false, false, false), - "", "", $water_mark, $config['fontpath'], 6, - "", 0, $config['homeurl'], $layoutData['image']) . '
'; - } - else { - $img = '
'. - vbar_graph(true, $module_data, - 400, 400, $color, array(), array(), - ui_get_full_url("images/image_problem.opaque.png", false, false, false), - "", "", $water_mark, $config['fontpath'], 6, - "", 0, $config['homeurl'], $layoutData['image'], true) . '
'; - } + $module_data = get_bars_module_data($id_module); + $water_mark = array('file' => '/var/www/html/pandora_console/images/logo_vertical_water.png', + 'url' => 'http://localhost/pandora_console/images/logo_vertical_water.png'); + + if ($width == 0 && $height == 0) { + if ($layoutData['label_position']=='left') { + if ($layoutData['type_graph'] == 'horizontal') { + $img = '
'. + hbar_graph(true, $module_data, + 400, 400, $color, array(), array(), + ui_get_full_url("images/image_problem.opaque.png", false, false, false), + "", "", $water_mark, $config['fontpath'], 6, + "", 0, $config['homeurl'], $layoutData['image'], $layoutData['border_color']) . '
'; } else { - if ($layoutData['type_graph'] == 'horizontal') { - $img = hbar_graph(true, $module_data, - 400, 400, $color, array(), array(), - ui_get_full_url("images/image_problem.opaque.png", false, false, false), - "", "", $water_mark, $config['fontpath'], 6, - "", 0, $config['homeurl'], $layoutData['image']); - } - else { - $img = vbar_graph(true, $module_data, - 400, 400, $color, array(), array(), - ui_get_full_url("images/image_problem.opaque.png", false, false, false), - "", "", $water_mark, $config['fontpath'], 6, - "", 0, $config['homeurl'], $layoutData['image'], true); - } + $img = '
'. + vbar_graph(true, $module_data, + 400, 400, $color, array(), array(), + ui_get_full_url("images/image_problem.opaque.png", false, false, false), + "", "", $water_mark, $config['fontpath'], 6, + "", 0, $config['homeurl'], $layoutData['image'], true, false, $layoutData['border_color']) . '
'; } } - else{ - if ($layoutData['label_position']=='left') { - if ($layoutData['type_graph'] == 'horizontal') { - $img = '
'. - hbar_graph(true, $module_data, - $width, $width, $color, array(), array(), - ui_get_full_url("images/image_problem.opaque.png", false, false, false), - "", "", $water_mark, $config['fontpath'], 6, - "", 0, $config['homeurl'], $layoutData['image']) . '
'; - } - else { - $img = '
'. - vbar_graph(true, $module_data, - $width, $width, $color, array(), array(), - ui_get_full_url("images/image_problem.opaque.png", false, false, false), - "", "", $water_mark, $config['fontpath'], 6, - "", 0, $config['homeurl'], $layoutData['image'], true) . '
'; - } - } - elseif($layoutData['label_position']=='right') { - if ($layoutData['type_graph'] == 'horizontal') { - $img = '
'. - hbar_graph(true, $module_data, - $width, $width, $color, array(), array(), - ui_get_full_url("images/image_problem.opaque.png", false, false, false), - "", "", $water_mark, $config['fontpath'], 6, - "", 0, $config['homeurl'], $layoutData['image']) . '
'; - } - else { - $img = '
'. - vbar_graph(true, $module_data, - $width, $width, $color, array(), array(), - ui_get_full_url("images/image_problem.opaque.png", false, false, false), - "", "", $water_mark, $config['fontpath'], 6, - "", 0, $config['homeurl'], $layoutData['image'], true) . '
'; - } + elseif($layoutData['label_position']=='right') { + if ($layoutData['type_graph'] == 'horizontal') { + $img = '
'. + hbar_graph(true, $module_data, + 400, 400, $color, array(), array(), + ui_get_full_url("images/image_problem.opaque.png", false, false, false), + "", "", $water_mark, $config['fontpath'], 6, + "", 0, $config['homeurl'], $layoutData['image'], $layoutData['border_color']) . '
'; } else { - if ($layoutData['type_graph'] == 'horizontal') { - $img = hbar_graph(true, $module_data, - $width, $width, $color, array(), array(), - ui_get_full_url("images/image_problem.opaque.png", false, false, false), - "", "", $water_mark, $config['fontpath'], 6, - "", 0, $config['homeurl'], $layoutData['image']); - } - else { - $img = vbar_graph(true, $module_data, - $width, $width, $color, array(), array(), - ui_get_full_url("images/image_problem.opaque.png", false, false, false), - "", "", $water_mark, $config['fontpath'], 6, - "", 0, $config['homeurl'], $layoutData['image'], true); - } + $img = '
'. + vbar_graph(true, $module_data, + 400, 400, $color, array(), array(), + ui_get_full_url("images/image_problem.opaque.png", false, false, false), + "", "", $water_mark, $config['fontpath'], 6, + "", 0, $config['homeurl'], $layoutData['image'], true, false, $layoutData['border_color']) . '
'; + } + } + else { + if ($layoutData['type_graph'] == 'horizontal') { + $img = hbar_graph(true, $module_data, + 400, 400, $color, array(), array(), + ui_get_full_url("images/image_problem.opaque.png", false, false, false), + "", "", $water_mark, $config['fontpath'], 6, + "", 0, $config['homeurl'], $layoutData['image'], $layoutData['border_color']); + } + else { + $img = vbar_graph(true, $module_data, + 400, 400, $color, array(), array(), + ui_get_full_url("images/image_problem.opaque.png", false, false, false), + "", "", $water_mark, $config['fontpath'], 6, + "", 0, $config['homeurl'], $layoutData['image'], true, false, $layoutData['border_color']); } } } - else { - if($width == 0){ - if ($layoutData['id_metaconsole'] != 0) { - $img = ''; + else{ + if ($layoutData['label_position']=='left') { + if ($layoutData['type_graph'] == 'horizontal') { + $img = '
'. + hbar_graph(true, $module_data, + $width, $height, $color, array(), array(), + ui_get_full_url("images/image_problem.opaque.png", false, false, false), + "", "", $water_mark, $config['fontpath'], 6, + "", 0, $config['homeurl'], $layoutData['image'], $layoutData['border_color']) . '
'; } - else{ - $img = ''; + else { + $img = '
'. + vbar_graph(true, $module_data, + $width, $height, $color, array(), array(), + ui_get_full_url("images/image_problem.opaque.png", false, false, false), + "", "", $water_mark, $config['fontpath'], 6, + "", 0, $config['homeurl'], $layoutData['image'], true, false, $layoutData['border_color']) . '
'; } } - else{ - if ($layoutData['id_metaconsole'] != 0) { - $img = ''; + elseif($layoutData['label_position']=='right') { + if ($layoutData['type_graph'] == 'horizontal') { + $img = '
'. + hbar_graph(true, $module_data, + $width, $height, $color, array(), array(), + ui_get_full_url("images/image_problem.opaque.png", false, false, false), + "", "", $water_mark, $config['fontpath'], 6, + "", 0, $config['homeurl'], $layoutData['image'], $layoutData['border_color']) . '
'; } - else{ - $img = ''; + else { + $img = '
'. + vbar_graph(true, $module_data, + $width, $height, $color, array(), array(), + ui_get_full_url("images/image_problem.opaque.png", false, false, false), + "", "", $water_mark, $config['fontpath'], 6, + "", 0, $config['homeurl'], $layoutData['image'], true, false, $layoutData['border_color']) . '
'; + } + } + else { + if ($layoutData['type_graph'] == 'horizontal') { + $img = hbar_graph(true, $module_data, + $width, $height, $color, array(), array(), + ui_get_full_url("images/image_problem.opaque.png", false, false, false), + "", "", $water_mark, $config['fontpath'], 6, + "", 0, $config['homeurl'], $layoutData['image'], $layoutData['border_color']); + } + else { + $img = vbar_graph(true, $module_data, + $width, $height, $color, array(), array(), + ui_get_full_url("images/image_problem.opaque.png", false, false, false), + "", "", $water_mark, $config['fontpath'], 6, + "", 0, $config['homeurl'], $layoutData['image'], true, false, $layoutData['border_color']); } } } @@ -1436,10 +1392,10 @@ function visual_map_print_item($mode = "read", $layoutData, } else { if ($width == 0) { - $img = d3_donut_graph ($layoutData['id'], 400, 400, $donut_data); + $img = d3_donut_graph ($layoutData['id'], 300, 300, $donut_data, $layoutData['border_color']); } else{ - $img = d3_donut_graph ($layoutData['id'], $width, $width, $donut_data); + $img = d3_donut_graph ($layoutData['id'], $width, $width, $donut_data, $layoutData['border_color']); } } } @@ -1607,7 +1563,8 @@ function visual_map_print_item($mode = "read", $layoutData, break; case STATIC_GRAPH: case GROUP_ITEM: - if ($layoutData['image'] != null || $layoutData['show_statistics'] == 1) { + + if (($layoutData['image'] != null && $layoutData['image'] != 'none') || $layoutData['show_statistics'] == 1) { $img_style_title = strip_tags($label); @@ -1833,7 +1790,7 @@ function visual_map_print_item($mode = "read", $layoutData, } } else{ - $img = d3_progress_bar($id, $percentile, $width, 50, $border_color, $unit_text, $label, $fill_color); + $img = d3_progress_bar($id, $percentile, $width, 50, $border_color, $unit_text, io_safe_output($label), $fill_color); } echo $img; @@ -1872,10 +1829,10 @@ function visual_map_print_item($mode = "read", $layoutData, } else{ if($width == 0){ - $img = d3_progress_bubble($id, $percentile, 200,200, $border_color, $unit_text, $label, $fill_color); + $img = d3_progress_bubble($id, $percentile, 200,200, $border_color, $unit_text, io_safe_output($label), $fill_color); } else{ - $img = d3_progress_bubble($id, $percentile, $width, $width, $border_color, $unit_text, $label, $fill_color); + $img = d3_progress_bubble($id, $percentile, $width, $width, $border_color, $unit_text, io_safe_output($label), $fill_color); } } @@ -1915,10 +1872,10 @@ function visual_map_print_item($mode = "read", $layoutData, } if($width == 0){ - $img = progress_circular_bar($id, $percentile, 200,200, $border_color, $unit_text, $label, $fill_color); + $img = progress_circular_bar($id, $percentile, 200,200, $border_color, $unit_text, io_safe_output($label), $fill_color); } else{ - $img = progress_circular_bar($id, $percentile, $width, $width, $border_color, $unit_text, $label, $fill_color); + $img = progress_circular_bar($id, $percentile, $width, $width, $border_color, $unit_text, io_safe_output($label), $fill_color); } } @@ -1958,11 +1915,11 @@ function visual_map_print_item($mode = "read", $layoutData, } if($width == 0){ - $img = progress_circular_bar_interior($id, $percentile, 200,200, $border_color, $unit_text, $label, $fill_color); + $img = progress_circular_bar_interior($id, $percentile, 200,200, $border_color, $unit_text, io_safe_output($label), $fill_color); } else{ - $img = progress_circular_bar_interior($id, $percentile, $width, $width, $border_color, $unit_text, $label, $fill_color); + $img = progress_circular_bar_interior($id, $percentile, $width, $width, $border_color, $unit_text, io_safe_output($label), $fill_color); } } @@ -2044,39 +2001,25 @@ function visual_map_print_item($mode = "read", $layoutData, global $config; - if ($type == SIMPLE_VALUE) { - //~ $returnValue_value = explode(' ', $value); - - //~ if ($returnValue_value[1] != "") { - //~ $value = remove_right_zeros(number_format($returnValue_value[0], $config['graph_precision'])) . " " . $returnValue_value[1]; - //~ } - //~ else { - //~ $value = remove_right_zeros(number_format($returnValue_value[0], $config['graph_precision'])); - //~ } - - } - else { - // If the value is a string, dont format it - if (!is_string($value)) { - //~ $value = remove_right_zeros(format_for_graph($value, $config['graph_precision'])); - } - } - - if(get_parameter('action') == 'edit'){ - if( (strip_tags($io_safe_output_text) != '_VALUE_') || (strip_tags($io_safe_output_text) != '(_VALUE_)') ) { + $is_image = get_if_module_is_image($layoutData['id_agente_modulo']); + if(get_parameter('action') == 'edit') { + if(!$is_image) { echo $io_safe_output_text; } else { echo ""; } - } else { - if(strrpos(strip_tags($io_safe_output_text),'(_VALUE_)') !== false || (strip_tags($io_safe_output_text) == '(_VALUE_)')) { - echo str_replace(array("(_VALUE_)","(_value_)"), $value, $io_safe_output_text); + } + else { + if(!$is_image) { + $new_text = str_replace(array("(_VALUE_)","(_value_)"), $value, $io_safe_output_text); + $new_text = str_replace(array('_VALUE_','_value_'), $value, $new_text); + + echo $new_text; } - elseif(strrpos(strip_tags($io_safe_output_text),'_VALUE_') !== false || (strip_tags($io_safe_output_text) == '_VALUE_')) { - echo str_replace(array('_VALUE_','_value_'), $value, $io_safe_output_text); - } else { - echo str_replace('>', ' style="width:'.$layoutData['width'].'px">',$value); + else { + $simple_value_img = str_replace('>', ' style="width:'.$layoutData['width'].'px">', $value); + echo $simple_value_img; } } @@ -2166,6 +2109,20 @@ function visual_map_print_item($mode = "read", $layoutData, } } +function get_if_module_is_image ($id_module) { + $sql = 'SELECT datos FROM tagente_estado WHERE id_agente_modulo = ' . $id_module; + + $result = db_get_sql($sql); + $image = strpos($result, 'data:image'); + + if($image === false){ + return false; + } + else{ + return true; + } +} + function get_bars_module_data ($id_module) { $mod_values = db_get_value_filter('datos', 'tagente_estado', array('id_agente_modulo' => $id_module)); @@ -2181,7 +2138,7 @@ function get_bars_module_data ($id_module) { $color_index = 0; $total = 0; foreach ($values as $val) { - $data = explode(":", $val); + $data = explode(",", $val); $values_to_return[$data[0]] = array('g' =>$data[1]); } @@ -2582,16 +2539,22 @@ function get_donut_module_data ($id_module) { $total = 0; foreach ($values as $val) { if ($index < $max_elements) { - $data = explode(":", $val); - $values_to_return[$index]['tag_name'] = $data[0] . ", " . $data[1]; + $data = explode(",", $val); + if ($data[1] == 0) { + $data[1] = __('No data'); + } + $values_to_return[$index]['tag_name'] = $data[0] . ": " . $data[1]; $values_to_return[$index]['color'] = $colors[$index]; $values_to_return[$index]['value'] = (int)$data[1]; $total += (int)$data[1]; $index++; } else { - $data = explode(":", $val); - $values_to_return[$index]['tag_name'] = __('Others') . ", " . $data[1]; + if ($data[1] == 0) { + $data[1] = __('No data'); + } + $data = explode(",", $val); + $values_to_return[$index]['tag_name'] = __('Others') . ": " . $data[1]; $values_to_return[$index]['color'] = $colors[$index]; $values_to_return[$index]['value'] += (int)$data[1]; $total += (int)$data[1]; @@ -2602,6 +2565,33 @@ function get_donut_module_data ($id_module) { $values_to_return[$ind]['percent'] = ($donut_data['value'] * 100) / $total; } + $new_values_to_return = array(); + while (!empty($values_to_return)) { + $first = true; + $max_elem = 0; + $max_elem_array = array(); + $index_to_del = 0; + foreach ($values_to_return as $i => $val) { + if ($first) { + $max_elem = $val['value']; + $max_elem_array = $val; + $index_to_del = $i; + $first = false; + } + else { + if ($val['value'] > $max_elem) { + $max_elem = $val['value']; + $max_elem_array = $val; + $index_to_del = $i; + } + } + } + + $new_values_to_return[] = $max_elem_array; + unset($values_to_return[$index_to_del]); + } + $values_to_return = $new_values_to_return; + return $values_to_return; } @@ -2922,7 +2912,26 @@ function visual_map_get_status_element($layoutData) { //Linked to other layout ?? - Only if not module defined if ($layoutData['id_layout_linked'] != 0) { - $status = visual_map_get_layout_status ($layoutData['id_layout_linked']); + if ($layoutData['id_layout_linked_weight'] != 0) { + $calculate_weight = true; + } + else { + $calculate_weight = false; + } + $status = visual_map_get_layout_status ($layoutData['id_layout_linked'], 0, 0, $calculate_weight); + + if ($layoutData['id_layout_linked_weight'] > 0) { + $elements_to_compare = db_get_all_rows_sql("SELECT id FROM tlayout_data WHERE type = 0 AND id_layout = " . $layoutData['id_layout_linked']); + + $aux_weight = ($status['elements_in_critical'] / count($elements_to_compare)) * 100; + + if ($aux_weight >= $layoutData['id_layout_linked_weight']) { + $status = $status['temp_total']; + } + else { + $status = VISUAL_MAP_STATUS_NORMAL; + } + } } else { switch ($layoutData["type"]) { @@ -3366,7 +3375,7 @@ function visual_map_get_user_layouts ($id_user = 0, $only_names = false, $filter * * @return bool The status of the given layout. True if it's OK, false if not. */ -function visual_map_get_layout_status ($id_layout = 0, $depth = 0) { +function visual_map_get_layout_status ($id_layout = 0, $depth = 0, $elements_in_critical = 0, $calculate_weight = false) { $temp_status = VISUAL_MAP_STATUS_NORMAL; $temp_total = VISUAL_MAP_STATUS_NORMAL; $depth++; // For recursion depth checking @@ -3386,7 +3395,10 @@ function visual_map_get_layout_status ($id_layout = 0, $depth = 0) { 'parent_item', 'id_layout_linked', 'id_agent', - 'type')); + 'type', + 'id_layout_linked_weight', + 'id', + 'id_layout')); if ($result === false) return VISUAL_MAP_STATUS_NORMAL; @@ -3428,12 +3440,29 @@ function visual_map_get_layout_status ($id_layout = 0, $depth = 0) { // Other Layout (Recursive!) if (($data["id_layout_linked"] != 0) && ($data["id_agente_modulo"] == 0)) { - $status = visual_map_get_layout_status($data["id_layout_linked"], $depth); + if ($data['id_layout_linked_weight'] > 0) { + $calculate_weight_c = true; + } + else { + $calculate_weight_c = false; + } + $status = visual_map_get_layout_status($data["id_layout_linked"], $depth, 0, $calculate_weight_c); + + $elements_in_child = db_get_all_rows_sql("SELECT id FROM tlayout_data WHERE type = 0 AND id_layout = " . $data['id_layout_linked']); + if ($calculate_weight_c) { + $aux_weight = ($status['elements_in_critical'] / count($elements_in_child)) * 100; + + if ($aux_weight >= $data['id_layout_linked_weight']) { + $status = $status['temp_total']; + } + else { + $status = VISUAL_MAP_STATUS_NORMAL; + } + } } // Module elseif ($data["id_agente_modulo"] != 0) { $status = modules_get_agentmodule_status($data["id_agente_modulo"]); - } // Agent else { @@ -3447,11 +3476,23 @@ function visual_map_get_layout_status ($id_layout = 0, $depth = 0) { break; } - if ($status == VISUAL_MAP_STATUS_CRITICAL_BAD) - return VISUAL_MAP_STATUS_CRITICAL_BAD; + if ($calculate_weight) { + if ($status == VISUAL_MAP_STATUS_CRITICAL_BAD || $status == VISUAL_MAP_STATUS_WARNING) { + $elements_in_critical++; + } + } + else { + if ($status == VISUAL_MAP_STATUS_CRITICAL_BAD) { + return VISUAL_MAP_STATUS_CRITICAL_BAD; + } - if ($status > $temp_total) + } + if ($status > $temp_total) { $temp_total = $status; + } + } + if ($calculate_weight) { + return array('elements_in_critical' => $elements_in_critical, 'temp_total' => $temp_total); } return $temp_total; diff --git a/pandora_console/include/functions_visual_map_editor.php b/pandora_console/include/functions_visual_map_editor.php index 1333f5e73a..e909bb0017 100755 --- a/pandora_console/include/functions_visual_map_editor.php +++ b/pandora_console/include/functions_visual_map_editor.php @@ -201,7 +201,7 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) { $form_items['image_row']['html'] = '' . __('Image') . ' ' . - html_print_select ($images_list, 'image', '', 'showPreview(this.value);', 'None', '', true) . + html_print_select ($images_list, 'image', '', 'showPreview(this.value);', 'None', 'none', true) . ''; @@ -246,6 +246,18 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) { 'black' => __('Black'), 'transparent' => __('Transparent')), 'background_color', '', '', 0, 'white', true, false, false) . ''; + + $form_items['grid_color_row'] = array(); + $form_items['grid_color_row']['items'] = array('bars_graph'); + $form_items['grid_color_row']['html'] = + '' . + __('Grid color') . + '' . + '' . + html_print_input_text_extended ('grid_color', + '#000000', 'text-grid_color', '', 7, 7, false, + '', 'class="grid_color"', true) . + ''; $form_items['radio_choice_graph'] = array(); $form_items['radio_choice_graph']['items'] = array( @@ -278,7 +290,7 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) { $form_items['agent_row'] = array(); $form_items['agent_row']['items'] = array('static_graph', 'percentile_bar', 'percentile_item', 'module_graph', - 'simple_value', 'datos', 'auto_sla_graph', 'bars_graph', 'donut_graph'); + 'simple_value', 'datos', 'auto_sla_graph'); $form_items['agent_row']['html'] = '' . __('Agent') . ''; $params = array(); @@ -291,6 +303,7 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) { $params['use_hidden_input_idagent'] = true; $params['print_hidden_input_idagent'] = true; $params['hidden_input_idagent_name'] = 'id_agent'; + $params['get_order_json'] = true; if (defined('METACONSOLE')) { $params['javascript_ajax_page'] = '../../ajax.php'; $params['disabled_javascript_on_blur_function'] = true; @@ -307,6 +320,39 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) { $form_items['agent_row']['html'] .= '' . ui_print_agent_autocomplete_input($params) . ''; + + $form_items['agent_row_string'] = array(); + $form_items['agent_row_string']['items'] = array('donut_graph', 'bars_graph'); + $form_items['agent_row_string']['html'] = '' . + __('Agent') . ''; + $params = array(); + $params['return'] = true; + $params['show_helptip'] = true; + $params['input_name'] = 'agent_string'; + $params['size'] = 30; + $params['selectbox_id'] = 'module'; + $params['javascript_is_function_select'] = true; + $params['use_hidden_input_idagent'] = true; + $params['print_hidden_input_idagent'] = true; + $params['hidden_input_idagent_name'] = 'id_agent_string'; + $params['get_order_json'] = true; + $params['get_only_string_modules'] = true; + if (defined('METACONSOLE')) { + $params['javascript_ajax_page'] = '../../ajax.php'; + $params['disabled_javascript_on_blur_function'] = true; + + $params['print_input_server'] = true; + $params['print_input_id_server'] = true; + $params['input_server_id'] = 'id_server_name'; + $params['input_id_server_name'] = 'id_server_metaconsole'; + $params['input_server_value'] = ''; + $params['use_input_id_server'] = true; + $params['metaconsole_enabled'] = true; + $params['print_hidden_input_idagent'] = true; + } + $form_items['agent_row_string']['html'] .= '' . + ui_print_agent_autocomplete_input($params) . + ''; $form_items['module_row'] = array(); $form_items['module_row']['items'] = array('static_graph', @@ -318,6 +364,18 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) { html_print_select(array(), 'module', '', '', __('Any'), 0, true) . ' '; + $form_items['resume_color_row'] = array(); + $form_items['resume_color_row']['items'] = array('donut_graph'); + $form_items['resume_color_row']['html'] = + '' . + __('Resume data color') . + '' . + '' . + html_print_input_text_extended ('resume_color', + '#000000', 'text-resume_color', '', 7, 7, false, + '', 'class="resume_color"', true) . + ''; + $event_times = array(86400 => __('24h'), 28800 => __('8h'), 7200 => __('2h'), @@ -401,7 +459,12 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) { $form_items['percentile_bar_row_1']['html'] = '' . __('Width') . ' ' . html_print_input_text('width_percentile', 0, '', 3, 5, true) . ''; - + + $form_items['height_bars_graph_row'] = array(); + $form_items['height_bars_graph_row']['items'] = array('bars_graph'); + $form_items['height_bars_graph_row']['html'] = '' . + __('Height') . ' + ' . html_print_input_text('bars_graph_height', 0, '', 3, 5, true) . ''; $form_items['percentile_bar_row_2'] = array(); $form_items['percentile_bar_row_2']['items'] = array('percentile_bar', 'percentile_item', 'datos'); @@ -596,11 +659,37 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) { WHERE id != ' . $visualConsole_id, 'map_linked', '', '', 'None', '0', true) . ''; + $form_items_advance['map_linked_weight'] = array(); + $form_items_advance['map_linked_weight']['items'] = array('static_graph'); + $form_items_advance['map_linked_weight']['html'] = ''. + __('Map linked weight') . '' . + '' . html_print_select(array('10' => '10%', + '20' => '20%', + '30' => '30%', + '40' => '40%', + '50' => '50%', + '60' => '60%', + '70' => '70%', + '80' => '80%', + '90' => '90%', + '100' => '100%'), + 'map_linked_weight', '', '', __('By default'), 0, true) . + ui_print_help_tip ( + __("This percentage value specifies the number of items that must be present in the visual + console for it to transmit its status to the icon linked here. For example, if 20% is + specified and there are five elements in the console, it would be enough if you were in + WARNING or CRITICAL to pass that value to the icon. If it were 40%, you would need at + least two elements to be in CRITICAL or WARNING to go into that status. If it had one + element in critical and another in warning, it would not forward any status to the icon + associated with the visual console. If we had three in warning and one in critical, + it would only convey the warning status. If there were two in warning and two in critical, + it would show the CRITICAL because it is more serious. The same applies to unknown status."), true) . + ''; + $form_items_advance['line_case']['items'] = array('line_item'); $form_items_advance['line_case']['html'] = ' ' . __('Lines haven\'t advanced options') . ''; - //Insert and modify before the buttons to create or update. if (enterprise_installed()) { enterprise_visual_map_editor_modify_form_items_advance_palette($form_items_advance); @@ -644,6 +733,8 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) { $(".line_color").attachColorPicker(); $(".percentile_color").attachColorPicker(); $(".percentile_label_color").attachColorPicker(); + $(".resume_color").attachColorPicker(); + $(".grid_color").attachColorPicker(); $("input[name=radio_choice]").change(function(){ $('#count_items').html(1); @@ -704,7 +795,7 @@ function visual_map_editor_print_toolbox() { visual_map_print_button_editor('static_graph', __('Static Graph'), 'left', false, 'camera_min', true); visual_map_print_button_editor('percentile_item', __('Percentile Item'), 'left', false, 'percentile_item_min', true); visual_map_print_button_editor('module_graph', __('Module Graph'), 'left', false, 'graph_min', true); - visual_map_print_button_editor('donut_graph', __('Donut Graph'), 'left', false, 'donut_graph_min', true); + visual_map_print_button_editor('donut_graph', __('Serialized pie graph'), 'left', false, 'donut_graph_min', true); visual_map_print_button_editor('bars_graph', __('Bars Graph'), 'left', false, 'bars_graph_min', true); visual_map_print_button_editor('auto_sla_graph', __('Auto SLA Graph'), 'left', false, 'auto_sla_graph_min', true); visual_map_print_button_editor('simple_value', __('Simple Value'), 'left', false, 'binary_min', true); @@ -767,6 +858,8 @@ function visual_map_editor_print_hack_translate_strings() { __('No Max value defined.') .''; echo ''; + echo ''; echo ''; echo '