diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 9d87093584..d48173512f 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.769-230306 +Version: 7.0NG.769-230307 Architecture: all Priority: optional Section: admin diff --git a/pandora_agents/unix/DEBIAN/make_deb_package.sh b/pandora_agents/unix/DEBIAN/make_deb_package.sh index e30ef809b8..cb6b963504 100644 --- a/pandora_agents/unix/DEBIAN/make_deb_package.sh +++ b/pandora_agents/unix/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.769-230306" +pandora_version="7.0NG.769-230307" echo "Test if you has the tools for to make the packages." whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index 2376f66ea0..012a228cd2 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -1023,7 +1023,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.769'; -use constant AGENT_BUILD => '230306'; +use constant AGENT_BUILD => '230307'; # 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 2fe2b071e4..26931473af 100644 --- a/pandora_agents/unix/pandora_agent.redhat.spec +++ b/pandora_agents/unix/pandora_agent.redhat.spec @@ -4,7 +4,7 @@ %global __os_install_post %{nil} %define name pandorafms_agent_linux %define version 7.0NG.769 -%define release 230306 +%define release 230307 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 cf54a0a5bb..329768dfa7 100644 --- a/pandora_agents/unix/pandora_agent.spec +++ b/pandora_agents/unix/pandora_agent.spec @@ -4,7 +4,7 @@ %global __os_install_post %{nil} %define name pandorafms_agent_linux %define version 7.0NG.769 -%define release 230306 +%define release 230307 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 9b77363457..1a32864bd8 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.769" -PI_BUILD="230306" +PI_BUILD="230307" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index ef28e5b8d7..48912e2ff3 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{230306} +{230307} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 15de30d4ea..11a3383389 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.769 Build 230306") +#define PANDORA_VERSION ("7.0NG.769 Build 230307") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index bf6685685a..3c842ed958 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.769(Build 230306))" + VALUE "ProductVersion", "(7.0NG.769(Build 230307))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index fc04649747..d71a8ffb94 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.769-230306 +Version: 7.0NG.769-230307 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 ce174aea69..ecb6a40251 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.769-230306" +pandora_version="7.0NG.769-230307" package_pear=0 package_pandora=1 diff --git a/pandora_console/extensions/agents_modules.php b/pandora_console/extensions/agents_modules.php index a99087e85d..44d4bc64b6 100644 --- a/pandora_console/extensions/agents_modules.php +++ b/pandora_console/extensions/agents_modules.php @@ -838,7 +838,7 @@ function mainAgentsModules() echo ''; - echo "".__('Agents').' / '.__('Modules').''; + echo "".__('Agents').' / '.__('Modules').''; if ($hor_offset > 0) { $new_hor_offset = ($hor_offset - $block); diff --git a/pandora_console/extensions/realtime_graphs.php b/pandora_console/extensions/realtime_graphs.php index eae6253d59..133af5b3f8 100644 --- a/pandora_console/extensions/realtime_graphs.php +++ b/pandora_console/extensions/realtime_graphs.php @@ -258,8 +258,15 @@ function pandora_realtime_graphs() $canvas .= grafico_modulo_sparse($params); $canvas .= ''; - echo $canvas; + html_print_div( + [ + 'class' => 'white_box', + 'content' => $canvas, + ] + ); + + // echo $canvas; // Define a custom action to save // the OID selected in the SNMP browser to the form. html_print_input_hidden( diff --git a/pandora_console/general/login_page.php b/pandora_console/general/login_page.php index 3307f86367..8517b1c46c 100755 --- a/pandora_console/general/login_page.php +++ b/pandora_console/general/login_page.php @@ -561,9 +561,36 @@ if (isset($correct_reset_pass_process)) { } if (isset($login_failed)) { - $nick = get_parameter_post('nick'); - $fails = db_get_value('failed_attempt', 'tusuario', 'id_user', $nick); + $nick = io_safe_input(get_parameter_post('nick')); + $user_in_db = db_get_row_filter( + 'tusuario', + ['id_user' => $nick], + '*' + ); + $fails = $user_in_db['failed_attempt']; + // If user not exist, and attempts its enable, lets make array and fails attemps. + if ($fails == false && $config['enable_pass_policy'] && $user_in_db === false) { + $nick_array_error = json_decode(base64_decode($config['nicks_error']), true); + $nick = strtolower($nick); + if (isset($nick_array_error[$nick]) !== false) { + $nick_array_error[$nick] += 1; + } else { + $nick_array_error[$nick] = 1; + } + + $fails = $nick_array_error[$nick]; + // Save or update the array. + if ($config['nicks_error']) { + config_update_value('nicks_error', base64_encode(json_encode($nick_array_error))); + } else { + config_create_value('nicks_error', base64_encode(json_encode($nick_array_error))); + } + } else { + $fails = ++$fails; + } + $attemps = ($config['number_attempts'] - $fails); + $attemps = ($attemps < 0) ? 0 : $attemps; echo '
'; echo '
'; echo '
'; @@ -576,7 +603,12 @@ if (isset($login_failed)) { echo '
'; if ($config['enable_pass_policy']) { echo '
'; - echo '

Remaining attempts: '.$attemps.'

'; + if ($attemps !== 0 && $user_in_db['login_blocked'] == 0) { + echo '

'.__('Remaining attempts: ').$attemps.'

'; + } else { + echo '

'.__('User is blocked').'

'; + } + echo '
'; } @@ -873,7 +905,8 @@ html_print_div(['id' => 'forced_title_layer', 'class' => 'forced_title_layer', ' resizable: true, draggable: true, modal: true, - width: 528, + height: 230, + width: 530, overlay: { opacity: 0.5, background: "black" @@ -886,7 +919,6 @@ html_print_div(['id' => 'forced_title_layer', 'class' => 'forced_title_layer', ' $("#login_correct_pass").dialog('close'); }); }); - $('#nick').focus(); break; } diff --git a/pandora_console/godmode/modules/manage_network_components_form.php b/pandora_console/godmode/modules/manage_network_components_form.php index 74c28201a7..f4c7d3776a 100644 --- a/pandora_console/godmode/modules/manage_network_components_form.php +++ b/pandora_console/godmode/modules/manage_network_components_form.php @@ -390,7 +390,10 @@ html_print_div( 'go_back', false, '', - ['icon' => 'back'], + [ + 'icon' => 'back', + 'mode' => 'secondary', + ], true ).html_print_submit_button( $buttonCaption, diff --git a/pandora_console/godmode/reporting/visual_console_favorite.php b/pandora_console/godmode/reporting/visual_console_favorite.php index 1724a241a9..c3b13c8ef4 100644 --- a/pandora_console/godmode/reporting/visual_console_favorite.php +++ b/pandora_console/godmode/reporting/visual_console_favorite.php @@ -250,7 +250,7 @@ if ($favorite_array == false) { echo "
  • "; echo "
    "; echo html_print_image( - 'images/'.groups_get_icon($favourite_v['id_group']).'.png', + 'images/'.groups_get_icon($favourite_v['id_group']), true, ['style' => ''] ); diff --git a/pandora_console/godmode/servers/discovery.php b/pandora_console/godmode/servers/discovery.php index 5ae4f2fcfd..3df3342f52 100755 --- a/pandora_console/godmode/servers/discovery.php +++ b/pandora_console/godmode/servers/discovery.php @@ -55,17 +55,19 @@ function get_wiz_class($str) default: // Main, show header. - ui_print_page_header( + ui_print_standard_header( __('Discovery'), '', false, '', true, - '', - false, - '', - GENERIC_SIZE_TEXT, - '' + [], + [ + [ + 'link' => '', + 'label' => __('Discovery'), + ], + ] ); return null; } diff --git a/pandora_console/godmode/servers/plugin.php b/pandora_console/godmode/servers/plugin.php index d931f5268b..43fad7d3be 100644 --- a/pandora_console/godmode/servers/plugin.php +++ b/pandora_console/godmode/servers/plugin.php @@ -454,22 +454,6 @@ if (empty($create) === false || empty($view) === false) { $data[0] = html_print_textarea('form_description', 4, 50, $form_description, '', true, 'w100p'); $table->colspan['plugin_desc_inputs'][0] = 3; $table->data['plugin_desc_inputs'] = $data; - /* - if (is_metaconsole() === true) { - $table->head[0] = __('General'); - $table->head_colspan[0] = 4; - $table->headstyle[0] = 'text-align: center'; - html_print_table($table); - } else { - echo '
    '.__('General').''; - html_print_table($table); - echo '
    '; - } - - html_print_table($table); - - $table->data = []; - */ // Command title. $commandTitleContent = []; @@ -528,20 +512,6 @@ if (empty($create) === false || empty($view) === false) { $data[0] = html_print_div(['id' => 'command_preview', 'class' => 'mono'], true); $table->data['plugin_preview_inputs'] = $data; $table->colspan['plugin_preview_inputs'][0] = 2; - /* - $table->width = '100%'; - $table->class = 'databox filters'; - if (is_metaconsole() === true) { - $table->head[0] = __('Command'); - $table->head_colspan[0] = 4; - $table->headstyle[0] = 'text-align: center'; - html_print_table($table); - } else { - echo '
    '.__('Command').''; - html_print_table($table); - echo '
    '; - } - */ // Parameters macros title. $macrosTitleContent = []; @@ -696,11 +666,27 @@ if (empty($create) === false || empty($view) === false) { echo ''; if ($create != '') { - echo ""; + $button = html_print_submit_button( + __('Create'), + 'crtbutton', + false, + [ 'icon' => 'wand' ], + true + ); } else { - echo ""; + $button = html_print_submit_button( + __('Update'), + 'uptbutton', + false, + [ 'icon' => 'upd' ], + true + ); } + html_print_action_buttons( + $button + ); + echo ''; if (defined('METACONSOLE')) { diff --git a/pandora_console/godmode/servers/plugin_registration.php b/pandora_console/godmode/servers/plugin_registration.php index 7e669579c9..296a29a510 100644 --- a/pandora_console/godmode/servers/plugin_registration.php +++ b/pandora_console/godmode/servers/plugin_registration.php @@ -60,12 +60,23 @@ if (is_metaconsole() === true) { return; } } else { - ui_print_page_header( + ui_print_standard_header( __('PLUGIN REGISTRATION'), 'images/gm_servers.png', false, '', - true + true, + [], + [ + [ + 'link' => '', + 'label' => __('Servers'), + ], + [ + 'link' => '', + 'label' => __('Register plugin'), + ], + ] ); $management_allowed = is_management_allowed(); diff --git a/pandora_console/godmode/wizards/DiscoveryTaskList.class.php b/pandora_console/godmode/wizards/DiscoveryTaskList.class.php index b942bba283..9372ffe144 100644 --- a/pandora_console/godmode/wizards/DiscoveryTaskList.class.php +++ b/pandora_console/godmode/wizards/DiscoveryTaskList.class.php @@ -175,6 +175,7 @@ class DiscoveryTaskList extends HTML 'action' => ui_get_full_url( 'index.php?sec=gservers&sec2=godmode/servers/discovery' ), + 'class' => 'flex_center', ], 'inputs' => [ [ @@ -182,25 +183,27 @@ class DiscoveryTaskList extends HTML 'name' => 'submit', 'label' => __('Go back'), 'type' => 'submit', - 'attributes' => [ 'icon' => 'cancel' ], + 'attributes' => [ + 'icon' => 'back', + 'mode' => 'secondary', + ], 'return' => true, ], ], [ - 'class' => 'action-buttons rule-builder-actions', 'arguments' => [ 'name' => 'refresh', 'label' => __('Refresh'), 'type' => 'button', 'attributes' => [ 'icon' => 'cog'], 'return' => true, - 'script' => 'location.href = \''.$this->url.'\';', + 'script' => 'location.href = "'.$this->url.'";', ], ], ], ]; - $this->printForm($form); + html_print_action_buttons($this->printForm($form, true)); } return $ret; diff --git a/pandora_console/godmode/wizards/HostDevices.class.php b/pandora_console/godmode/wizards/HostDevices.class.php index 7d9e9acf8c..2f7c5cd692 100755 --- a/pandora_console/godmode/wizards/HostDevices.class.php +++ b/pandora_console/godmode/wizards/HostDevices.class.php @@ -635,6 +635,7 @@ class HostDevices extends Wizard 'form' => [ 'method' => 'POST', 'action' => $this->url.'&mode=netscan&page='.($this->page - 1).'&task='.$this->task['id_rt'], + 'class' => 'flex_center', ], 'inputs' => [ [ @@ -649,7 +650,10 @@ class HostDevices extends Wizard 'name' => 'submit', 'label' => __('Go back'), 'type' => 'submit', - 'attributes' => ['icon' => 'cancel'], + 'attributes' => [ + 'icon' => 'back', + 'mode' => 'secondary', + ], 'return' => true, ], ], @@ -667,7 +671,7 @@ class HostDevices extends Wizard $form['form']['action'] = $this->url.'&mode=netscan&page='.($this->page - 1); } - $this->printForm($form); + html_print_action_buttons($this->printForm($form, true)); return null; } @@ -734,6 +738,7 @@ class HostDevices extends Wizard 'form' => [ 'method' => 'POST', 'action' => $this->url.'&mode=netscan&page=0', + 'class' => 'flex_center', ], 'inputs' => [ [ @@ -748,14 +753,17 @@ class HostDevices extends Wizard 'name' => 'submit', 'label' => __('Go back'), 'type' => 'submit', - 'attributes' => ['icon' => 'cancel'], + 'attributes' => [ + 'icon' => 'back', + 'mode' => 'secondary', + ], 'return' => true, ], ], ], ]; - $this->printForm($form); + html_print_action_buttons($this->printForm($form, true)); return null; } @@ -786,15 +794,6 @@ class HostDevices extends Wizard 'width' => '30%', 'style' => 'padding: 9px;min-width: 250px;', 'inputs' => [ - '0' => [ - 'arguments' => [ - 'name' => 'submit', - 'label' => $str, - 'type' => 'submit', - 'attributes' => 'class="sub next"', - 'return' => true, - ], - ], '1' => '
    '.html_print_image('images/wizard/netscan_green.png', true, ['title' => __('Close')], false).'
    ', '2' => [ 'label' => ''.__('Interval').':'.ui_print_help_tip( @@ -982,6 +981,7 @@ class HostDevices extends Wizard 'method' => 'POST', 'enctype' => 'multipart/form-data', 'action' => $this->url.'&mode=netscan&page='.($this->page + 1).$task_url, + 'id' => 'form-netscan-definition', ]; // Default. @@ -1021,7 +1021,24 @@ class HostDevices extends Wizard '; $this->printFormAsGrid($form); - $this->printGoBackButton($this->url.'&page='.($this->page - 1)); + + $output_form = $this->printInput( + [ + 'name' => 'submit', + 'label' => $str, + 'type' => 'submit', + 'attributes' => [ + 'icon' => 'next', + 'form' => 'form-netscan-definition', + ], + 'return' => true, + 'width' => 'initial', + ] + ); + + $output_form .= $this->printGoBackButton($this->url.'&page='.($this->page - 1), true); + + html_print_action_buttons($output_form); } } @@ -1586,24 +1603,31 @@ class HostDevices extends Wizard } } - // Submit button. - $form['inputs'][] = [ - 'arguments' => [ - 'name' => 'submit-finish', - 'label' => __('Finish'), - 'type' => 'submit', - 'attributes' => 'class="sub next"', - 'return' => true, - ], - ]; - $form['form'] = [ 'method' => 'POST', 'action' => $this->url.'&mode=netscan&page='.($this->page + 1).'&task='.$this->task['id_rt'], + 'id' => 'form-netscan-feature', ]; $this->printFormAsList($form); - $this->printGoBackButton($this->url.'&mode=netscan&task='.$this->task['id_rt'].'&page='.($this->page - 1)); + + $output_form = $this->printInput( + [ + 'name' => 'submit-finish', + 'label' => __('Finish'), + 'type' => 'submit', + 'attributes' => [ + 'icon' => 'next', + 'form' => 'form-netscan-feature', + ], + 'return' => true, + 'width' => 'initial', + ] + ); + + $output_form .= $this->printGoBackButton($this->url.'&mode=netscan&task='.$this->task['id_rt'].'&page='.($this->page - 1), true); + + html_print_action_buttons($output_form); } if ($this->page == 2) { diff --git a/pandora_console/godmode/wizards/Wizard.main.php b/pandora_console/godmode/wizards/Wizard.main.php index 22521c0af0..4cfcbe7056 100644 --- a/pandora_console/godmode/wizards/Wizard.main.php +++ b/pandora_console/godmode/wizards/Wizard.main.php @@ -395,7 +395,7 @@ class Wizard * * @return void */ - public function printGoBackButton($url=null) + public function printGoBackButton($url=null, $return=false) { if (isset($url) === false) { $url = ui_get_full_url( @@ -415,14 +415,21 @@ class Wizard 'name' => 'submit', 'label' => __('Go back'), 'type' => 'submit', - 'attributes' => ['icon' => 'cancel'], + 'attributes' => [ + 'icon' => 'back', + 'mode' => 'secondary', + ], 'return' => true, ], ], ], ]; - $this->printForm($form); + if ($return === true) { + return $this->printForm($form, $return); + } + + $this->printForm($form, $return); } diff --git a/pandora_console/images/networkmap/HP@os.svg b/pandora_console/images/networkmap/HP@os.svg new file mode 100644 index 0000000000..03173da459 --- /dev/null +++ b/pandora_console/images/networkmap/HP@os.svg @@ -0,0 +1,9 @@ + + + + Dark / 20 / HP@svg + Created with Sketch. + + + + \ No newline at end of file diff --git a/pandora_console/images/networkmap/aix@os.svg b/pandora_console/images/networkmap/aix@os.svg new file mode 100644 index 0000000000..2e3dae7c33 --- /dev/null +++ b/pandora_console/images/networkmap/aix@os.svg @@ -0,0 +1,9 @@ + + + + Dark / 20 / aix@svg + Created with Sketch. + + + + \ No newline at end of file diff --git a/pandora_console/images/networkmap/android@os.svg b/pandora_console/images/networkmap/android@os.svg new file mode 100644 index 0000000000..f7b100b697 --- /dev/null +++ b/pandora_console/images/networkmap/android@os.svg @@ -0,0 +1,9 @@ + + + + Dark / 20 / android@svg + Created with Sketch. + + + + \ No newline at end of file diff --git a/pandora_console/images/networkmap/apple@os.svg b/pandora_console/images/networkmap/apple@os.svg new file mode 100644 index 0000000000..2924d1bbba --- /dev/null +++ b/pandora_console/images/networkmap/apple@os.svg @@ -0,0 +1,9 @@ + + + + Dark / 20 / apple@svg + Created with Sketch. + + + + \ No newline at end of file diff --git a/pandora_console/images/networkmap/cisco@os.svg b/pandora_console/images/networkmap/cisco@os.svg new file mode 100644 index 0000000000..488432fc32 --- /dev/null +++ b/pandora_console/images/networkmap/cisco@os.svg @@ -0,0 +1,9 @@ + + + + Dark / 20 / cisco@svg + Created with Sketch. + + + + \ No newline at end of file diff --git a/pandora_console/images/networkmap/cluster@os.svg b/pandora_console/images/networkmap/cluster@os.svg new file mode 100644 index 0000000000..5560537ab9 --- /dev/null +++ b/pandora_console/images/networkmap/cluster@os.svg @@ -0,0 +1,9 @@ + + + + Dark / 20 / cluster@svg + Created with Sketch. + + + + \ No newline at end of file diff --git a/pandora_console/images/networkmap/embedded@os.svg b/pandora_console/images/networkmap/embedded@os.svg new file mode 100644 index 0000000000..c73d953548 --- /dev/null +++ b/pandora_console/images/networkmap/embedded@os.svg @@ -0,0 +1,9 @@ + + + + Dark / 20 / embedded@svg + Created with Sketch. + + + + \ No newline at end of file diff --git a/pandora_console/images/networkmap/freebsd@os.svg b/pandora_console/images/networkmap/freebsd@os.svg new file mode 100644 index 0000000000..effa9ded77 --- /dev/null +++ b/pandora_console/images/networkmap/freebsd@os.svg @@ -0,0 +1,9 @@ + + + + Dark / 20 / freebsd@svg + Created with Sketch. + + + + \ No newline at end of file diff --git a/pandora_console/images/networkmap/linux@os.svg b/pandora_console/images/networkmap/linux@os.svg new file mode 100644 index 0000000000..6de3c7ac76 --- /dev/null +++ b/pandora_console/images/networkmap/linux@os.svg @@ -0,0 +1,9 @@ + + + + Dark / 20 / linux@svg + Created with Sketch. + + + + \ No newline at end of file diff --git a/pandora_console/images/networkmap/mainframe@os.svg b/pandora_console/images/networkmap/mainframe@os.svg new file mode 100644 index 0000000000..0ff480167c --- /dev/null +++ b/pandora_console/images/networkmap/mainframe@os.svg @@ -0,0 +1,9 @@ + + + + Dark / 20 / mainframe@svg + Created with Sketch. + + + + \ No newline at end of file diff --git a/pandora_console/images/networkmap/network-server@os.svg b/pandora_console/images/networkmap/network-server@os.svg new file mode 100644 index 0000000000..6bd340b987 --- /dev/null +++ b/pandora_console/images/networkmap/network-server@os.svg @@ -0,0 +1,9 @@ + + + + Dark / 20 / network-server@svg + Created with Sketch. + + + + \ No newline at end of file diff --git a/pandora_console/images/networkmap/other-OS@os.svg b/pandora_console/images/networkmap/other-OS@os.svg new file mode 100644 index 0000000000..2bdffdbdd3 --- /dev/null +++ b/pandora_console/images/networkmap/other-OS@os.svg @@ -0,0 +1,9 @@ + + + + Dark / 20 / other-OS@svg + Created with Sketch. + + + + \ No newline at end of file diff --git a/pandora_console/images/networkmap/routers@os.svg b/pandora_console/images/networkmap/routers@os.svg new file mode 100644 index 0000000000..1ba7f611f4 --- /dev/null +++ b/pandora_console/images/networkmap/routers@os.svg @@ -0,0 +1,9 @@ + + + + Dark / 20 / routers@svg + Created with Sketch. + + + + \ No newline at end of file diff --git a/pandora_console/images/networkmap/satellite@os.svg b/pandora_console/images/networkmap/satellite@os.svg new file mode 100644 index 0000000000..a260dc0f6d --- /dev/null +++ b/pandora_console/images/networkmap/satellite@os.svg @@ -0,0 +1,9 @@ + + + + Dark / 20 / satellite@svg + Created with Sketch. + + + + \ No newline at end of file diff --git a/pandora_console/images/networkmap/solaris@os.svg b/pandora_console/images/networkmap/solaris@os.svg new file mode 100644 index 0000000000..de89b4123c --- /dev/null +++ b/pandora_console/images/networkmap/solaris@os.svg @@ -0,0 +1,9 @@ + + + + Dark / 20 / solaris@svg + Created with Sketch. + + + + \ No newline at end of file diff --git a/pandora_console/images/networkmap/switch@os.svg b/pandora_console/images/networkmap/switch@os.svg new file mode 100644 index 0000000000..63280d0a76 --- /dev/null +++ b/pandora_console/images/networkmap/switch@os.svg @@ -0,0 +1,9 @@ + + + + Dark / 20 / switch@svg + Created with Sketch. + + + + \ No newline at end of file diff --git a/pandora_console/images/networkmap/vmware@os.svg b/pandora_console/images/networkmap/vmware@os.svg new file mode 100644 index 0000000000..cdfcd0f047 --- /dev/null +++ b/pandora_console/images/networkmap/vmware@os.svg @@ -0,0 +1,9 @@ + + + + Dark / 20 / vmware@svg + Created with Sketch. + + + + \ No newline at end of file diff --git a/pandora_console/images/networkmap/windows@os.svg b/pandora_console/images/networkmap/windows@os.svg new file mode 100644 index 0000000000..76c0ec7108 --- /dev/null +++ b/pandora_console/images/networkmap/windows@os.svg @@ -0,0 +1,9 @@ + + + + Dark / 20 / windows@svg + Created with Sketch. + + + + \ No newline at end of file diff --git a/pandora_console/include/class/ConfigPEN.class.php b/pandora_console/include/class/ConfigPEN.class.php index 6f6b93cd5a..03638df6f2 100644 --- a/pandora_console/include/class/ConfigPEN.class.php +++ b/pandora_console/include/class/ConfigPEN.class.php @@ -240,17 +240,17 @@ class ConfigPEN extends HTML $tmp->description = io_safe_output($tmp->description); $tmp->manufacturer = io_safe_output($tmp->manufacturer); - $tmp->options = ''; + $tmp->options = '
    '; - $tmp->options = ''; $tmp->options .= html_print_image( - 'images/operation.png', + 'images/edit.svg', true, [ 'title' => __('Show'), - 'class' => 'invert_filter', + 'class' => 'main_menu_icon invert_filter', ] ); $tmp->options .= ''; @@ -258,15 +258,17 @@ class ConfigPEN extends HTML $tmp->options .= $tmp->pen; $tmp->options .= '\')" >'; $tmp->options .= html_print_image( - 'images/cross.png', + 'images/delete.svg', true, [ 'title' => __('Delete'), - 'class' => 'invert_filter', + 'class' => 'main_menu_icon invert_filter', ] ); $tmp->options .= ''; + $tmp->options .= '
    '; + $carry[] = $tmp; return $carry; } @@ -406,7 +408,7 @@ class ConfigPEN extends HTML 'action' => '#', 'id' => 'modal_form', 'onsubmit' => 'return false;', - 'class' => '', + 'class' => 'filter-list-adv', ]; $inputs = []; @@ -420,7 +422,7 @@ class ConfigPEN extends HTML 'size' => 50, ]; - if ((bool) $values['pen']) { + if ((bool) $values['pen'] === true) { $arguments['disabled'] = true; } @@ -599,18 +601,18 @@ class ConfigPEN extends HTML __('Description'), [ 'text' => __('Options'), - 'class' => 'table_action_buttons', + 'class' => 'table_action_buttons align_right', ], ]; - $this->tableId = 'keystore'; + $tableId = 'keystore'; // Load datatables user interface. $output .= ui_print_datatable( [ - 'id' => $this->tableId, + 'id' => $tableId, 'return' => true, 'class' => 'info_table', - 'style' => 'width: 100%', + 'style' => 'width: 99%', 'columns' => $columns, 'column_names' => $column_names, 'ajax_url' => $this->ajaxController, @@ -621,6 +623,7 @@ class ConfigPEN extends HTML 'direction' => 'asc', ], 'search_button_class' => 'sub filter float-right', + 'filter_main_class' => 'box-flat white_table_graph fixed_filter_bar', 'form' => [ 'inputs' => [ [ @@ -643,15 +646,18 @@ class ConfigPEN extends HTML $output .= ''; $output .= ''; - // Create button. - $output .= parent::printInput( - [ - 'type' => 'submit', - 'name' => 'create', - 'label' => __('Register manufacturer'), - 'attributes' => 'class="sub next"', - 'return' => true, - ] + $output .= html_print_action_buttons( + parent::printInput( + [ + 'type' => 'submit', + 'name' => 'create', + 'label' => __('Register manufacturer'), + 'attributes' => ['icon' => 'next'], + 'return' => true, + ] + ), + ['type' => 'form_action'], + true ); ob_start(); diff --git a/pandora_console/include/class/CustomNetScan.class.php b/pandora_console/include/class/CustomNetScan.class.php index 6a73481ac3..d2d8cd4700 100644 --- a/pandora_console/include/class/CustomNetScan.class.php +++ b/pandora_console/include/class/CustomNetScan.class.php @@ -313,7 +313,10 @@ class CustomNetScan extends Wizard 'name' => 'submit', 'label' => __('Go back'), 'type' => 'submit', - 'attributes' => ['icon' => 'cancel'], + 'attributes' => [ + 'icon' => 'cancel', + 'mode' => 'secondary', + ], 'return' => true, ], ], @@ -421,7 +424,10 @@ class CustomNetScan extends Wizard 'name' => 'submit', 'label' => __('Go back'), 'type' => 'submit', - 'attributes' => ['icon' => 'cancel'], + 'attributes' => [ + 'icon' => 'cancel', + 'mode' => 'secondary', + ], 'return' => true, ], ], @@ -553,17 +559,6 @@ class CustomNetScan extends Wizard $str = __('Update and continue'); } - // Submit button. - $form['inputs'][] = [ - 'arguments' => [ - 'name' => 'submit', - 'label' => $str, - 'type' => 'submit', - 'attributes' => [ 'icon' => 'next' ], - 'return' => true, - ], - ]; - $task_url = ''; if (isset($this->task['id_rt'])) { $task_url = '&task='.$this->task['id_rt']; @@ -572,6 +567,7 @@ class CustomNetScan extends Wizard $form['form'] = [ 'method' => 'POST', 'action' => $this->url.'&mode=customnetscan&page='.($this->page + 1).$task_url, + 'id' => 'form-netscan-custom-definition', ]; // Default. @@ -602,6 +598,22 @@ class CustomNetScan extends Wizard // XXX: Could be improved validating inputs before continue (JS) // Print NetScan page 0. $this->printFormAsList($form); + + html_print_action_buttons( + $this->printInput( + [ + 'name' => 'submit', + 'label' => $str, + 'type' => 'submit', + 'attributes' => [ + 'icon' => 'next', + 'form' => 'form-netscan-custom-definition', + ], + 'return' => true, + 'width' => 'initial', + ] + ) + ); } } @@ -717,20 +729,10 @@ class CustomNetScan extends Wizard } } - // Submit button. - $form['inputs'][] = [ - 'arguments' => [ - 'name' => 'submit', - 'label' => __('Finish'), - 'type' => 'submit', - 'attributes' => ['icon' => 'update'], - 'return' => true, - ], - ]; - $form['form'] = [ 'method' => 'POST', 'action' => $this->url.'&mode=customnetscan&page='.($this->page + 1).'&task='.$this->task['id_rt'], + 'id' => 'form-netscan-custom-script', ]; $id_task = (isset($this->task['id_rt']) === true) ? $this->task['id_rt'] : 0; @@ -748,6 +750,22 @@ class CustomNetScan extends Wizard })'.$change; $this->printFormAsList($form); + + html_print_action_buttons( + $this->printInput( + [ + 'name' => 'submit', + 'label' => __('Finish'), + 'type' => 'submit', + 'attributes' => [ + 'icon' => 'update', + 'form' => 'form-netscan-custom-script', + ], + 'return' => true, + 'width' => 'initial', + ] + ) + ); } if (isset($this->page) === true && $this->page === 2) { diff --git a/pandora_console/include/class/HTML.class.php b/pandora_console/include/class/HTML.class.php index d3bf4f4f3d..a8f7c54985 100644 --- a/pandora_console/include/class/HTML.class.php +++ b/pandora_console/include/class/HTML.class.php @@ -398,7 +398,7 @@ class HTML * * @return void */ - public static function printGoBackButton($url=null) + public static function printGoBackButton($url=null, $return=false) { if (isset($url) === false) { $url = ui_get_full_url( @@ -418,14 +418,21 @@ class HTML 'name' => 'submit', 'label' => __('Go back'), 'type' => 'submit', - 'attributes' => [ 'icon' => 'cancel' ], + 'attributes' => [ + 'icon' => 'back', + 'mode' => 'secondary', + ], 'return' => true, ], ], ], ]; - self::printForm($form); + if ($return === true) { + return self::printForm($form, $return); + } + + self::printForm($form, $return); } @@ -803,11 +810,13 @@ class HTML $output_head .= 'id="'.$form['id'].'" '; } - $output_head .= 'class="max_floating_element_size " '; + $output_head .= 'class="max_floating_element_size '; if (isset($form['class']) === true) { - $output_head .= 'class="discovery '.$form['class'].'" '; + $output_head .= 'discovery '.$form['class'].' '; } + $output_head .= '"'; + if (isset($form['onsubmit']) === true) { $output_head .= 'onsubmit="'.$form['onsubmit'].'" '; } @@ -1078,7 +1087,7 @@ class HTML $cb_function = $data['cb_function']; $cb_args = $data['cb_args']; - $output_head = '
    '; if ($return === false) { diff --git a/pandora_console/include/class/ManageNetScanScripts.class.php b/pandora_console/include/class/ManageNetScanScripts.class.php index 15c475f35a..a65f728ef1 100644 --- a/pandora_console/include/class/ManageNetScanScripts.class.php +++ b/pandora_console/include/class/ManageNetScanScripts.class.php @@ -451,13 +451,13 @@ class ManageNetScanScripts extends Wizard ); echo html_print_input_image( 'delete', - 'images/cross.png', + 'images/delete.svg', 1, - '', + 'width:40px;', true, [ 'title' => __('Delete Script'), - 'class' => 'invert_filter', + 'class' => 'invert_filter main_menu_icon', ] ); echo '
    '; @@ -527,7 +527,7 @@ class ManageNetScanScripts extends Wizard $url .= '&wiz=hd&mode=managenetscanscripts'; if ($id_script !== 0) { - echo '
    '; + echo ''; echo html_print_input_hidden('page', 0, true); echo html_print_input_hidden( 'operation_scp', @@ -535,7 +535,7 @@ class ManageNetScanScripts extends Wizard true ); } else { - echo ''; + echo ''; echo html_print_input_hidden('page', 0, true); echo html_print_input_hidden( 'operation_scp', @@ -547,11 +547,7 @@ class ManageNetScanScripts extends Wizard $table = new stdClass(); $table->width = '100%'; $table->id = 'table-form'; - $table->class = 'databox filters'; - $table->style = []; - $table->style[0] = 'font-weight: bold'; - $table->style[2] = 'font-weight: bold'; - $table->data = []; + $table->class = 'databox filter-table-adv'; $data = []; $data[0] = __('Name'); @@ -778,17 +774,20 @@ class ManageNetScanScripts extends Wizard $buttonIcon = 'update'; } - html_print_div( - [ - 'class' => 'action-buttons', - 'content' => html_print_submit_button( - $buttonCaption, - $buttonName, - false, - [ 'icon' => $buttonIcon ], - true - ), - ] + html_print_action_buttons( + html_print_div( + [ + 'class' => 'action-buttons', + 'content' => html_print_submit_button( + $buttonCaption, + $buttonName, + false, + [ 'icon' => $buttonIcon ], + true + ), + ], + true + ) ); echo '
    '; diff --git a/pandora_console/include/class/ModuleTemplates.class.php b/pandora_console/include/class/ModuleTemplates.class.php index c1371afa81..fb1a496246 100644 --- a/pandora_console/include/class/ModuleTemplates.class.php +++ b/pandora_console/include/class/ModuleTemplates.class.php @@ -836,7 +836,15 @@ class ModuleTemplates extends HTML ] ); - ui_pagination($countModuleTemplates, $this->baseUrl, $this->offset); + $tablePagination = ui_pagination( + $countModuleTemplates, + $this->baseUrl, + $this->offset, + 0, + true, + 'offset', + false + ); // Create the table with Module Block list. $table = new StdClasS(); $table->class = 'databox data '; @@ -874,13 +882,13 @@ class ModuleTemplates extends HTML $table->cellclass[][3] = 'table_action_buttons'; $data[3] = html_print_input_image( 'delete_profile', - 'images/cross.png', + 'images/delete.svg', $row['id_np'], - '', + 'width:40px', true, [ 'onclick' => 'if (!confirm(\''.__('Are you sure?').'\')) return false;', - 'class' => 'invert_filter', + 'class' => 'invert_filter main_menu_icon', ] ); $data[3] .= html_print_input_image( @@ -891,23 +899,40 @@ class ModuleTemplates extends HTML true, [ 'title' => 'Export tdaso CSV', - 'class' => 'invert_filter', + 'class' => 'invert_filter main_menu_icon', ] ); - $data[3] = ''.html_print_image('images/cross.png', true, ['title' => __('Delete'), 'class' => 'invert_filter']).''; - $data[3] .= ''.html_print_image('images/csv.png', true, ['title' => __('Export to CSV'), 'class' => 'invert_filter']).''; + $data[3] = ''; + $data[3] .= html_print_image( + 'images/delete.svg', + true, + [ + 'title' => __('Delete'), + 'class' => 'invert_filter main_menu_icon', + ] + ); + $data[3] .= ''; + $data[3] .= ''; + $data[3] .= html_print_image( + 'images/csv.png', + true, + [ + 'title' => __('Export to CSV'), + 'class' => 'invert_filter main_menu_icon', + ] + ); + $data[3] .= ''; array_push($table->data, $data); } html_print_table($table); - $output = '
    '; - $form = [ 'method' => 'POST', 'action' => $this->baseUrl, 'id' => 'main_management_form', + 'class' => 'flex_center', ]; $inputs[] = [ @@ -934,22 +959,29 @@ class ModuleTemplates extends HTML 'label' => __('Delete selected'), 'name' => 'erase', 'type' => 'button', - 'attributes' => ['icon' => 'cancel'], + 'attributes' => [ + 'icon' => 'delete', + 'mode' => 'secondary', + ], 'return' => true, ], ]; - $output .= $this->printForm( + html_print_action_buttons( + $this->printForm( + [ + 'form' => $form, + 'inputs' => $inputs, + ], + true + ), [ - 'form' => $form, - 'inputs' => $inputs, - ], - true + 'type' => 'data_table', + 'class' => 'fixed_action_buttons', + 'right_content' => $tablePagination, + ] ); - $output .= '
    '; - - echo $output; } @@ -1056,42 +1088,38 @@ class ModuleTemplates extends HTML ], ]; - $availableButtons = []; + // Required for PEN field. + ui_require_jquery_file('tag-editor'); + ui_require_css_file('jquery.tag-editor'); - $availableButtons[] = [ - 'arguments' => [ + $buttons = $this->printInput( + [ 'name' => 'action_button', 'label' => $formButtonLabel, 'type' => 'submit', - 'attributes' => [ 'icon' => $formButtonClass ], + 'attributes' => [ + 'icon' => $formButtonClass, + 'form' => 'module_template_form', + ], 'return' => true, - ], - ]; + 'width' => 'initial', + ] + ); if ($createNewTemplate === false) { - $availableButtons[] = [ - 'arguments' => [ + $buttons .= $this->printInput( + [ 'name' => 'add_components_button', 'label' => __('Add components'), 'type' => 'button', 'attributes' => [ 'icon' => 'cog' ], 'script' => 'showAddComponent();', 'return' => true, - ], - ]; + 'width' => 'initial', + ] + ); } - $inputs[] = [ - 'class' => 'action_button_list', - 'direct' => false, - 'wrapper' => 'div', - 'block_content' => $availableButtons, - ]; - - // Required for PEN field. - ui_require_jquery_file('tag-editor'); - ui_require_css_file('jquery.tag-editor'); - if ($createNewTemplate === false) { // Get the data. $sql = sprintf( @@ -1142,13 +1170,13 @@ class ModuleTemplates extends HTML $blockTitle .= '
    '; $blockTitle .= html_print_input_image( 'del_block_'.$id_group.'_', - 'images/cross.png', + 'images/delete.svg', 1, - false, + 'width: 40px', true, [ 'title' => __('Delete this block'), - 'class' => 'invert_filter', + 'class' => 'invert_filter main_menu_icon', 'onclick' => 'if(confirm(\''.__('Do you want delete this block?').'\')){deleteModuleTemplate(\'block\',\''.$blockComponentList.'\')};return false;', ] ); @@ -1196,7 +1224,7 @@ class ModuleTemplates extends HTML true, [ 'title' => __('Network module'), - 'class' => 'invert_filter', + 'class' => 'invert_filter main_menu_icon', ] ); break; @@ -1207,7 +1235,7 @@ class ModuleTemplates extends HTML true, [ 'title' => __('WMI module'), - 'class' => 'invert_filter', + 'class' => 'invert_filter main_menu_icon', ] ); break; @@ -1218,7 +1246,7 @@ class ModuleTemplates extends HTML true, [ 'title' => __('Plug-in module'), - 'class' => 'invert_filter', + 'class' => 'invert_filter main_menu_icon', ] ); break; @@ -1239,13 +1267,13 @@ class ModuleTemplates extends HTML $data[3] = mb_strimwidth(io_safe_output($module['description']), 0, 150, '...'); $data[4] = html_print_input_image( 'del_module_'.$module['component_id'].'_', - 'images/cross.png', + 'images/delete.svg', 1, - '', + 'width:40px;', true, [ 'title' => __('Delete this module'), - 'class' => 'invert_filter', + 'class' => 'invert_filter main_menu_icon', 'onclick' => 'if(confirm(\''.__('Do you want delete this module?').'\')){deleteModuleTemplate(\'module\','.$module['component_id'].')};return false;', ] ); @@ -1277,7 +1305,9 @@ class ModuleTemplates extends HTML echo ''; } - $this->printGoBackButton($this->baseUrl); + $buttons .= $this->printGoBackButton($this->baseUrl, true); + + html_print_action_buttons($buttons); } @@ -1459,30 +1489,31 @@ class ModuleTemplates extends HTML var listValidPens = $("#hidden-valid-pen").val(); try { - listValidPens = listValidPens.split(','); + if(listValidPens != undefined) { + listValidPens = listValidPens.split(','); + //Adding tagEditor for PEN management. + $("#text-pen").tagEditor({ + beforeTagSave: function(field, editor, tags, tag, val) { + if (listValidPens.indexOf(val) == -1) { + return false; + } + }, + autocomplete: { + source: penRefs); ?> + + } + }); + } } catch (e) { console.error(e); return; } - //Adding tagEditor for PEN management. - $("#text-pen").tagEditor({ - beforeTagSave: function(field, editor, tags, tag, val) { - if (listValidPens.indexOf(val) == -1) { - return false; - } - }, - autocomplete: { - source: penRefs); ?> - - } - }); //Values for add. $("#add-modules-components").change(function() { var valores = $("#add-modules-components") .val() .join(","); - //$("#hidden-add-modules-components-values").val(valores); }); }); diff --git a/pandora_console/include/class/NetworkMap.class.php b/pandora_console/include/class/NetworkMap.class.php index 596f4e7451..b1c5e84763 100644 --- a/pandora_console/include/class/NetworkMap.class.php +++ b/pandora_console/include/class/NetworkMap.class.php @@ -2569,7 +2569,7 @@ class NetworkMap false, true, true, - true, + false, true, true ); @@ -3151,28 +3151,6 @@ class NetworkMap ['icon' => 'next'], true ); - /* - $table->data['fictional_node_networkmap_link'][0] = __('Networkmap to link'); - $table->data['fictional_node_networkmap_link'][1] = html_print_select( - $list_networkmaps, - 'edit_networkmap_to_link', - '', - '', - '', - 0, - true - ); - - $table->data['fictional_node_update_button'][0] = ''; - $table->data['fictional_node_update_button'][1] = html_print_button( - __('Update fictional node'), - '', - false, - 'add_fictional_node();', - ['icon' => 'next'], - true - ); - */ $buttons[] = html_print_button( __('Update node'), @@ -3298,6 +3276,7 @@ class NetworkMap $table = new stdClass(); $table->id = 'interface_link_table'; + $table->class = 'info_table'; $table->width = '100%'; $table->head['node_source_interface'] = __('Node source'); $table->head['interface_source_select'] = __('Interface source'); @@ -3340,27 +3319,31 @@ class NetworkMap $output .= '
    '; - $table->data['interface_row']['interface_link_button'] = html_print_button( - __('Add interface link'), - '', - false, - 'add_interface_link_js();', - 'class="sub"', + $output .= html_print_table($table, true); + $output .= html_print_div( + [ + 'class' => 'action-buttons', + 'content' => html_print_button( + __('Add interface link'), + '', + false, + 'add_interface_link_js();', + [ + 'icon' => 'wand', + 'mode' => 'mini', + ], + true + ), + ], true ); - $output .= html_print_table($table, true); $output .= '
    '; $output .= '