GUI improvement, add enterprise edition popup - ticket gitlab 49/68

(cherry picked from commit a051243b6458510dcae775055df8314894aa9695)
This commit is contained in:
enriquecd 2016-09-19 16:20:18 +02:00
parent 4846af1049
commit e66a06aac6
13 changed files with 221 additions and 44 deletions

View File

@ -71,7 +71,7 @@ config_check();
$table->width = "100%";
$table->styleTable = 'margin: auto; margin-top: 0px;';
$table->rowclass[0] = '';
$table->data[0][11] = ui_print_help_tip (__("Blank characters are used as AND conditions"), true);
// Search bar
$search_bar = '<form method="get" style="display: inline;" name="quicksearch" action="">';
if (!isset($config['search_keywords'])) {
@ -303,9 +303,9 @@ config_check();
$table->data[0][9] .= html_print_image ("images/header_email.png", true, array ("title" => __('You have %d unread message(s)', $msg_cnt), "id" => "yougotmail", "class" => "bot", 'style' => 'width:24px;'));
$table->data[0][9] .= '</a>';
}
$table->data[0][11] = ui_print_help_tip (__("Blank characters are used as AND conditions"), true);
html_print_table($table);
unset($table);
@ -374,8 +374,8 @@ config_check();
<?php
}
?>
$("#publienterprise").pulsate ();
<?php
if ($_GET["refr"]) {
$_get_refr = strip_tags($_GET["refr"]);

View File

@ -79,9 +79,9 @@ echo '<div id="login_in">';
echo '<table id="login_layout">';
echo'<tr style="height:15px;"><td>';
echo '<div class="login_links">';
echo '<a href="http://wiki.pandorafms.com/" target="_blank">' . __('Help') . '</a>';
echo '<a href="http://wiki.pandorafms.com/" target="_blank">' . __('Docs') . '</a>';
echo ' | ';
echo '<a href="http://forums.pandorafms.com/" target="_blank">' . __('Support') . '</a>';
echo '<a href="https://pandorafms.com/monitoring-services/support/" target="_blank">' . __('Support') . '</a>';
echo '</div>';
echo '</td></tr>';
echo'<tr>
@ -96,15 +96,16 @@ echo '<div id="login_in">';
}
else {
html_print_image ("images/logo_login.png", false, array ("class" => "login_logo", "alt" => "logo", "border" => 0, "title" => $logo_title), false, true);
echo "<br><span style='font-size:120%;color:white;top:10px;position:relative;'>Community edition</span>";
}
echo '</a>';
// This prints the current pandora console version.
// For stable/live function it might be wise to comment it out
/* CUSTOM BRANDING ENDS HERE */
echo '</td><td style="padding-top: 15px; position:absolute;">';
switch ($login_screen) {
case 'login':
if (!empty ($page) && !empty ($sec)) {

View File

@ -205,7 +205,7 @@ $onheader['satellite'] = $satellitetab;
ui_print_page_header(
__('Massive operations') . ' &raquo; '. $options[$option],
"images/gm_massive_operations.png", false, "", true, $onheader);
"images/gm_massive_operations.png", false, "", true, $onheader,true, "massive");
// Checks if the PHP configuration is correctly
if ((get_cfg_var("max_execution_time") != 0)

View File

@ -40,7 +40,7 @@ if (defined('METACONSOLE')) {
else {
ui_print_page_header (__('Module management') . ' &raquo; ' .
__('Network component management'), "", false,
"network_component", true);
"network_component", true,"sell",true,"module");
$sec = 'gmodules';
}

View File

@ -27,7 +27,7 @@ if (! check_acl ($config['id_user'], 0, "PM")) {
}
// Header
ui_print_page_header (__('Module management')." &raquo; ".__('Module template management'), "images/gm_modules.png", false, "template_tab", true);
ui_print_page_header (__('Module management')." &raquo; ".__('Module template management'), "images/gm_modules.png", false, "template_tab", true,"",true,"module");
require_once ('include/functions_network_profiles.php');
@ -180,7 +180,7 @@ $table->class = "databox data";
$table->head = array ();
$table->head[0] = __('Name');
$table->head[1] = __('Description');
$table->head[2] = __('Action') .
$table->head[2] = '<span style="margin-right:7%;">'.__('Action') .'</span>'.
html_print_checkbox('all_delete', 0, false, true, false, 'check_all_checkboxes();');
$table->size = array ();
$table->size[1] = '65%';

View File

@ -620,7 +620,7 @@ $class = 'databox filters';
<td style="">
<?php
if ($action == 'new') {
html_print_select(reports_get_report_types(false, true), 'type', $type, 'chooseType();', '', '');
html_print_select(reports_get_report_types(false, true), 'type', $type, 'chooseType();', '', '','','','','','','','','',true,'reporting');
}
else {
$report_type = reports_get_report_types();

View File

@ -95,27 +95,27 @@ $table = new stdClass();
$table->width = '100%';
$table->class = 'databox filters';
$table->style[0] = 'font-weight: bolder;';
$table->style[0] = 'font-weight: bolder;width:250px';
$table->data[0][0] = __('URL update manager:');
$table->data[0][1] = html_print_input_text('url_update_manager',
$url_update_manager, __('URL update manager'), 40, 60, true);
$url_update_manager, __('URL update manager'), 80, 60, true);
$table->data[1][0] = __('Proxy server:');
$table->data[1][1] = html_print_input_text('update_manager_proxy_server',
$update_manager_proxy_server, __('Proxy server'), 40, 60, true);
$update_manager_proxy_server, __('Proxy server'), 80, 60, true);
$table->data[2][0] = __('Proxy port:');
$table->data[2][1] = html_print_input_text('update_manager_proxy_port',
$update_manager_proxy_port, __('Proxy port'), 40, 60, true);
$update_manager_proxy_port, __('Proxy port'), 80, 60, true);
$table->data[3][0] = __('Proxy user:');
$table->data[3][1] = html_print_input_text('update_manager_proxy_user',
$update_manager_proxy_user, __('Proxy user'), 40, 60, true);
$update_manager_proxy_user, __('Proxy user'), 80, 60, true);
$table->data[4][0] = __('Proxy password:');
$table->data[4][1] = html_print_input_password('update_manager_proxy_password',
$update_manager_proxy_password, __('Proxy password'), 40, 60, true);
$update_manager_proxy_password, __('Proxy password'), 80, 60, true);
if (license_free()) {
$config["identification_reminder"] = isset($config["identification_reminder"]) ? $config["identification_reminder"] : 1;

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@ -429,8 +429,8 @@ function html_print_select_groups($id_user = false, $privilege = "AR",
function html_print_select ($fields, $name, $selected = '', $script = '',
$nothing = '', $nothing_value = 0, $return = false, $multiple = false,
$sort = true, $class = '', $disabled = false, $style = false,
$option_style = false, $size = false) {
$option_style = false, $size = false,$modal=false,$message=''){
$output = "\n";
static $idcounter = array ();
@ -543,7 +543,11 @@ function html_print_select ($fields, $name, $selected = '', $script = '',
}
$output .= "</select>";
if ($modal){
$output .= "
<div id='publienterprise' class='".$message."' title='Community version' style='display:inline;position:relative;top:10px;left:0px;margin-top: -2px !important; margin-left: 2px !important;'><img data-title='Enterprise version' class='img_help forced_title' data-use_title_for_force_title='1' src='images/alert_enterprise.png'></div>
";
}
if ($return)
return $output;

View File

@ -2381,7 +2381,7 @@ function ui_get_full_url ($url = '', $no_proxy = false, $add_name_php_file = fal
* @return string Header HTML
*/
function ui_print_page_header ($title, $icon = "", $return = false, $help = "", $godmode = false, $options = "") {
function ui_print_page_header ($title, $icon = "", $return = false, $help = "", $godmode = false, $options = "",$modal = false, $message = "") {
$title = io_safe_input_html($title);
if (($icon == "") && ($godmode == true)) {
$icon = "images/gm_setup.png";
@ -2409,6 +2409,12 @@ function ui_print_page_header ($title, $icon = "", $return = false, $help = "",
$buffer .= '<ul class="mn"><li class="' . $type . '">&nbsp;' . '&nbsp; ';
$buffer .= '<span style="">' .
ui_print_truncate_text($title, 38);
if ($modal){
$buffer .= "
<div id='publienterprise' class='".$message."' title='Community version' style='float: right;margin-top: -2px !important; margin-left: 2px !important;'><img data-title='Enterprise version' class='img_help forced_title' data-use_title_for_force_title='1' src='images/alert_enterprise.png'></div>
";
}
if ($help != "")
$buffer .= "<div class='head_help' style='float: right; margin-top: -2px !important; margin-left: 2px !important;'>" .
ui_print_help_icon ($help, true, '', 'images/help_w.png') . "</div>";

View File

@ -83,7 +83,40 @@ $(document).ready (function () {
);
return false;
});
$("#publienterprise").click (function () {
jQuery.get ("ajax.php",
{
"page": "general/alert_enterprise",
"message":$(this).attr("class")},
function (data, status) {
$("#alert_messages").hide ()
.empty ()
.append (data)
.dialog ({
title: $("#publienterprise").attr ("title"),
resizable: true,
draggable: true,
modal: true,
open: function (event, ui) {
$(this).css({'overflow': 'hidden','text-align': 'center','padding-right':'25px','padding-bottom':'25px'}); //this line does the actual hiding
},
overlay: {
opacity: 0.5,
background: "black"
},
width: 600
})
.show ();
},
"html"
);
return false;
});
if ($('#license_error_msg_dialog').length) {
if (typeof(process_login_ok) == "undefined")
process_login_ok = 0;

View File

@ -400,7 +400,7 @@ if ($config["pure"] == 0 || $meta) {
if (! defined ('METACONSOLE')) {
unset($onheader['history']);
ui_print_page_header (__("Events"), "images/op_events.png",
false, "eventview", false, $onheader);
false, "eventview", false, $onheader,true, "events");
}
else {
unset($onheader['rss']);

View File

@ -101,6 +101,7 @@ if (isset ($_GET["modified"]) && !$view_mode) {
$upd_info["comments"] = get_parameter_post ("comments", $user_info["comments"]);
$upd_info["language"] = get_parameter_post ("language", $user_info["language"]);
$upd_info["id_skin"] = get_parameter ("skin", $user_info["id_skin"]);
$upd_info["id_filter"] = get_parameter ("event_filter",NULL);
$upd_info["block_size"] = get_parameter ("block_size", $config["block_size"]);
$upd_info["firstname"] = get_parameter ("newsletter_reminder", $user_info["first_name"]);
$default_block_size = get_parameter ("default_block_size", 0);
@ -114,7 +115,16 @@ if (isset ($_GET["modified"]) && !$view_mode) {
$upd_info["data_section"] = get_parameter ("data_section", '');
$dashboard = get_parameter('dashboard', '');
$visual_console = get_parameter('visual_console', '');
//save autorefresh list
$autorefresh_list = get_parameter_post ("autorefresh_list");
if(($autorefresh_list[0] === '') || ($autorefresh_list[0] === '0')){
db_process_sql("UPDATE tconfig SET value ='' WHERE token='autorefresh_white_list'");
}else{
db_process_sql("UPDATE tconfig SET value ='".json_encode($autorefresh_list)."' WHERE token='autorefresh_white_list'");
}
$is_admin = db_get_value('is_admin', 'tusuario', 'id_user', $id);
$section = io_safe_output($upd_info["section"]);
@ -191,13 +201,14 @@ if (defined('METACONSOLE')) {
$table->head_colspan[0] = 5;
$table->headstyle[0] = 'text-align: center';
}
$table->style[0] = 'width: 500px;';
$table->style[2] = 'width: 200px;';
$data = array();
$data[0] = '<b>' . __('User ID') . '</b>';
$data[0] .= $jump . '<span style="font-weight: normal;">' . $id . '</span>';
$data[0] .= '<div style="position:absolute;left:200px;display:inline;">'.$jump . '<span style="font-weight: normal;">' . $id . '</span></div>';
$data[1] = '<b>' . __('Full (display) name') . '</b>';
$data[1] .= $jump . html_print_input_text_extended ("fullname", $user_info["fullname"], '', '', 40, 100, $view_mode, '', 'class="input"', true);
$data[1] .= '<div style="position:absolute;left:700px;display:inline;">'.$jump . html_print_input_text_extended ("fullname", $user_info["fullname"], '', '', 40, 100, $view_mode, '', 'class="input"', true).'</div>';
// Show "Picture" (in future versions, why not, allow users to upload it's own avatar here.
if (is_user_admin ($id)) {
@ -219,9 +230,9 @@ $table->data[] = $data;
$data = array();
$data[0] = __('E-mail');
$data[0] .= $jump . html_print_input_text_extended ("email", $user_info["email"], '', '', '40', '100', $view_mode, '', 'class="input"', true);
$data[0] .= '<div style="position:absolute;left:200px;display:inline;">'.$jump . html_print_input_text_extended ("email", $user_info["email"], '', '', '40', '100', $view_mode, '', 'class="input"', true).'</div>';
$data[1] = __('Phone number');
$data[1] .= $jump . html_print_input_text_extended ("phone", $user_info["phone"], '', '', '40', '30', $view_mode, '', 'class="input"', true);
$data[1] .= '<div style="position:absolute;left:700px;display:inline;">'.$jump . html_print_input_text_extended ("phone", $user_info["phone"], '', '', '40', '30', $view_mode, '', 'class="input"', true).'</div>';
$table->rowclass[] = '';
$table->rowstyle[] = 'font-weight: bold;';
$table->data[] = $data;
@ -230,9 +241,9 @@ if ($view_mode === false) {
if ($config["user_can_update_password"]) {
$data = array();
$data[0] = __('New Password');
$data[0] .= $jump . html_print_input_text_extended ("password_new", "", '', '', '40', '45', $view_mode, '', 'class="input"', true, true);
$data[0] .= '<div style="position:absolute;left:200px;display:inline;">'.$jump . html_print_input_text_extended ("password_new", "", '', '', '40', '45', $view_mode, '', 'class="input"', true, true).'</div>';
$data[1] = __('Password confirmation');
$data[1] .= $jump . html_print_input_text_extended ("password_conf", "", '', '', '40', '45', $view_mode, '', 'class="input"', true, true);
$data[1] .= '<div style="position:absolute;left:700px;display:inline;">'.$jump . html_print_input_text_extended ("password_conf", "", '', '', '40', '45', $view_mode, '', 'class="input"', true, true).'</div>';
$table->rowclass[] = '';
$table->rowstyle[] = 'font-weight: bold;';
$table->data[] = $data;
@ -262,7 +273,7 @@ $data[0] .= __('Default').' ('.$config["global_block_size"].')';
$values = array(-1 => __('Default'),1 => __('Yes'),0 => __('No'));
$data[1] = __('Interactive charts') . ui_print_help_tip(__('Whether to use Javascript or static PNG graphs'), true);
$data[1] .= $jump . html_print_select($values, 'flash_charts', $user_info["flash_chart"], '', '', -1, true, false, false);
$data[1] .= '<div style="position:absolute;left:700px;display:inline;">'.$jump . html_print_select($values, 'flash_charts', $user_info["flash_chart"], '', '', -1, true, false, false).'</div>';
$data[2] = __('Language');
@ -285,8 +296,8 @@ $id_usr = $config['id_user'];
if (!$meta) {
$data = array();
$data[0] = __('Shortcut bar') . ui_print_help_tip(__('This will activate a shortcut bar with alerts, events, messages... information'), true);
$data[0] .= $jump . html_print_checkbox('shortcut_bar', 1, $user_info["shortcut"], true);
$data[0] .= '<div style="position:absolute;left:200px;display:inline;">'.$jump . html_print_checkbox('shortcut_bar', 1, $user_info["shortcut"], true).'</div>';
$data[1] = __('Home screen'). ui_print_help_tip(__('User can customize the home page. By default, will display \'Agent Detail\'. Example: Select \'Other\' and type sec=estado&sec2=operation/agentes/estado_agente to show agent detail view'), true);
$values = array (
'Default' =>__('Default'),
@ -299,9 +310,9 @@ if (!$meta) {
if (enterprise_installed()) {
$values['Dashboard'] = __('Dashboard');
}
$data[1] .= $jump . html_print_select($values, 'section', io_safe_output($user_info["section"]), 'show_data_section();', '', -1, true, false, false);
$data[1] .= '<div style="position:absolute;left:700px;display:inline;">'.$jump . html_print_select($values, 'section', io_safe_output($user_info["section"]), 'show_data_section();', '', -1, true, false, false).'</div>';
if (enterprise_installed()) {
$dashboards = get_user_dashboards ($config['id_user']);
$dashboards_aux = array();
@ -348,8 +359,8 @@ if (!$meta) {
$double_auth_enabled = (bool) db_get_value('id', 'tuser_double_auth', 'id_user', $config['id_user']);
$data = array();
$data[0] = __('Double authentication');
$data[0] .= $jump;
$data[0] .= html_print_checkbox('double_auth', 1, $double_auth_enabled, true);
$data[0] .= '<div style="position:absolute;left:200px;display:inline;">'.$jump;
$data[0] .= html_print_checkbox('double_auth', 1, $double_auth_enabled, true).'</span>';
if ($double_auth_enabled) {
$data[0] .= $jump;
$data[0] .= html_print_button(__('Show information'), 'show_info', false, 'javascript:show_double_auth_info();', '', true);
@ -357,8 +368,12 @@ if ($double_auth_enabled) {
// Dialog
$data[0] .= "<div id=\"dialog-double_auth\"><div id=\"dialog-double_auth-container\"></div></div>";
// Newsletter
if (license_free()) {
if (check_acl ($config['id_user'], 0, "ER")){
$data[1] = __('Event filter');
$data[1] .= $jump . html_print_select_from_sql ('SELECT id_filter, id_name FROM tevent_filter',
'event_filter', $user_info["id_filter"], '', __('None'), NULL, true);
}// Newsletter
else if (license_free()) {
$data[1] = __('Newsletter Subscribed') . ':';
if ($user_info["middlename"]) {
$data[1] .= $jump . '<span style="font-weight:initial;">' . __('Already subscribed to Pandora FMS newsletter') . "</span>";
@ -376,6 +391,85 @@ if (license_free()) {
$table->rowclass[] = '';
$table->rowstyle[] = 'font-weight: bold;';
$table->data[] = $data;
$data = array();
$autorefresh_list_out = array();
$autorefresh_list_out['operation/agentes/tactical'] = "tactical";
$autorefresh_list_out['operation/agentes/group_view'] = "group_view";
$autorefresh_list_out['operation/agentes/estado_agente'] = "agent_status";
$autorefresh_list_out['operation/agentes/alerts_status'] = "alerts_status";
$autorefresh_list_out['operation/agentes/status_monitor'] = "status_monitor";
$autorefresh_list_out['enterprise/operation/services/services'] = "services";
$autorefresh_list_out['enterprise/dashboard/main_dashboard'] = "main_dashboard";
$autorefresh_list_out['operation/reporting/graph_viewer'] = "graph_viewer";
$autorefresh_list_out['operation/snmpconsole/snmp_view'] = "snmp_view";
$autorefresh_list_out['operation/agentes/networkmap'] = "networkmap";
$autorefresh_list_out['operation/visual_console/render_view'] = "render_view";
$autorefresh_list_out['operation/events/events'] = "events";
if(!isset($autorefresh_list)){
$select = db_process_sql("SELECT value FROM tconfig WHERE token='autorefresh_white_list'");
$autorefresh_list = json_decode($select[0]['value']);
if($autorefresh_list === null){
$autorefresh_list[0] = __('None');
}else{
$aux = array();
for ($i =0;$i < count($autorefresh_list);$i++){
$aux[$autorefresh_list[$i]] = $autorefresh_list_out[$autorefresh_list[$i]];
unset($autorefresh_list_out[$autorefresh_list[$i]]);
$autorefresh_list[$i] = $aux;
}
$autorefresh_list = $aux;
}
}else{
if(($autorefresh_list[0] === '') || ($autorefresh_list[0] === '0')){
$autorefresh_list[0] = __('None');
}else{
$aux = array();
for ($i =0;$i < count($autorefresh_list);$i++){
$aux[$autorefresh_list[$i]] = $autorefresh_list_out[$autorefresh_list[$i]];
unset($autorefresh_list_out[$autorefresh_list[$i]]);
$autorefresh_list[$i] = $aux;
}
$autorefresh_list = $aux;
}
}
$data[0] = _('Autorefresh') . ui_print_help_tip(__('This will activate autorefresh in selected pages'), true);
$select_out = html_print_select ($autorefresh_list_out, 'autorefresh_list_out[]', '', '', '', '', true, true, true, '', false, 'width:200px');
$arrows = " ";
$select_in = html_print_select ($autorefresh_list, 'autorefresh_list[]', '', '', '', '', true, true, true, '', false, 'width:200px');
$table_ichanges = '<table>
<tr>
<td>' . __('Full list of pages') . '</td>
<td></td>
<td>' . __('List of pages with autorefresh') . '</td>
</tr>
<tr>
<td>' . $select_out . '</td>
<td>
<a href="javascript:">'.
html_print_image('images/darrowright.png', true, array('id' => 'right_autorefreshlist', 'alt' => __('Push selected pages into autorefresh list'), 'title' => __('Push selected pages into autorefresh list'))).
'</a>
<br><br>
<a href="javascript:">'.
html_print_image('images/darrowleft.png', true, array('id' => 'left_autorefreshlist', 'alt' => __('Pop selected pages out of autorefresh list'), 'title' => __('Pop selected pages out of autorefresh list'))).
'</a>
</td>
<td>'. $select_in .'</td>
</tr>
</table>';
$data[0] .= $table_ichanges;
$table->rowclass[] = '';
$table->colspan[count($table->data)][0] = 3;
$table->rowstyle[] = 'font-weight: bold;';
$table->data[] = $data;
$data = array();
$data[0] = __('Comments');
@ -479,6 +573,45 @@ enterprise_hook('close_meta_frame');
<script language="javascript" type="text/javascript">
$(document).ready (function () {
$("#right_autorefreshlist").click (function () {
jQuery.each($("select[name='autorefresh_list_out[]'] option:selected"), function (key, value) {
imodule_name = $(value).html();
if (imodule_name != <?php echo "'".__('None')."'"; ?>) {
id_imodule = $(value).attr('value');
$("select[name='autorefresh_list[]']").append($("<option></option>").val(id_imodule).html('<i>' + imodule_name + '</i>'));
$("#autorefresh_list_out").find("option[value='" + id_imodule + "']").remove();
$("#autorefresh_list").find("option[value='']").remove();
$("#autorefresh_list").find("option[value='0']").remove();
if($("#autorefresh_list_out option").length == 0) {
$("select[name='autorefresh_list_out[]']").append($("<option></option>").val('').html('<i><?php echo __('None'); ?></i>'));
}
}
});
});
$("#left_autorefreshlist").click (function () {
jQuery.each($("select[name='autorefresh_list[]'] option:selected"), function (key, value) {
imodule_name = $(value).html();
if (imodule_name != <?php echo "'".__('None')."'"; ?>) {
id_imodule = $(value).attr('value');
$("#autorefresh_list").find("option[value='" + id_imodule + "']").remove();
$("#autorefresh_list_out").find("option[value='']").remove();
$("select[name='autorefresh_list_out[]']").append($("<option><option>").val(id_imodule).html('<i>' + imodule_name + '</i>'));
$("#autorefresh_list_out option").last().remove();
if($("#autorefresh_list option").length == 0) {
$("select[name='autorefresh_list[]']").append($("<option></option>").val('').html('<i><?php echo __('None'); ?></i>'));
}
}
});
});
$("#submit-uptbutton").click (function () {
if($("#autorefresh_list option").length > 0) {
$('#autorefresh_list option').prop('selected', true);
}
});
check_default_block_size()
$("#checkbox-default_block_size").change(function() {
check_default_block_size();