pandorafms/pandora_console/include/javascript/jquery.pandora.js

229 lines
4.9 KiB
JavaScript
Raw Normal View History

2009-04-20 Esteban Sanchez <estebans@artica.es> * godmode/agentes/module_manager_editor.php, godmode/agentes/module_manager_editor_common.php, godmode/agentes/module_manager_editor_data.php, godmode/agentes/module_manager_editor_network.php, godmode/agentes/module_manager_editor_plugin.php, godmode/agentes/module_manager_editor_prediction.php, godmode/agentes/module_manager_editor_wmi.php, godmode/agentes/module_manager.php: Some fixes to allow form reutilization. * include/javascript/jquery.pandora.controls.js: Fixed a typo. Added pandoraSelectGroup control. * include/javascript/jquery.pandora.js: Separate between auto executed code and document ready function. * include/javascript/pandora_modules.js: Added to repository. Functions to use on module editors. * include/functions_agents.php: Added get_agents(). * include/functions_db.php: Added get_user_first_group(). Changed user_access_to_agent() parameters order. * include/functions_reporting.php: Style corrections. * include/functions_ui.php: Added doc to print_status_image(). Added print_ui_agents_list() to print a list of agents with a search form and a lot of configuration options easily. * include/functions_ui_renders.php: Added to repository. New API for renders on UI components. * operation/agentes/estado_agente.php: Make table wider. * godmode/reporting/reporting_builder.php: Replaced exit with return. Use pandoraSelectGroup control. * godmode/servers/manage_recontask_form.php: Style corrections to fit Pandora styles. * godmode/servers/modificar_server.php: Removed a notice from a typo. * godmode/setup/setup.php: Fixed table data indexes. Removed javascript code from visual setup. * godmode/setup/setup_visuals.php: Some strings changed. Style correction. * godmode/menu.php: Added policies enterprise menu option. * images/policies.png: Added to repository. * godmode/agentes/modificar_agente.php: Style correction by using pandora functions. * godmode/agentes/massive_operations.php: Fixed tab styles that was showing wrong the . * godmode/agentes/manage_config_remote.php: Changes in user_access_to_agent() * general/ui/agents_list.php: Added to repository. Reusable render for an agent list. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1632 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-04-20 16:00:27 +02:00
(function($) {
$.fn.check = function () {
return this.each (function () {
this.checked = true;
});};
$.fn.uncheck = function () {
return this.each (function () {
this.checked = false;
});};
2009-02-09 19:41:54 +01:00
$.fn.enable = function () {
return $(this).removeAttr ("disabled");
};
2009-02-09 19:41:54 +01:00
$.fn.disable = function () {
return $(this).attr ("disabled", "disabled");
};
2009-02-09 19:41:54 +01:00
$.fn.pulsate = function () {
var i = 0;
for (i = 0; i <= 2; i++) {
$(this).fadeOut ("slow").fadeIn ("slow");
2009-02-19 Evi Vanoost <vanooste@rcbi.rochester.edu> * pandoradb_migrate_20_to_21.sql, pandora_db.sql: Altered tmensajes for unixtime * general/header.php: New messages function added flashing acknowledgment in case of new messages * general/logon_ok.php: Since messages are now in header, they don't need to be there per se * images/close.png, images/transparent.png: Background and close button for overlays. * include/javascript/jquery.pandora.js: Used for loop for flashing thing and added overlay function * include/javascript/jquery.overlay.js: You'll need this for overlay * include/functions_messages.php: Message functions are here. Messages are fully abstracted so they can be drop-in replaced with something else * include/functions_ui.php: Small fixes. Not necessary to load en language files for javascript since they're empty, it only adds to load/interpret * include/functions_db.php: Added get_group_users and get_db_array. Useful * include/functions_html.php: Small doc fixes and fixed table heads * include/styles/pandora.css: Added Overlay classes * ajax.php: We need to call safe_url_extraclean for cross scripting * operation/messages/message.php: Rebuilt to use new functions * operation/menu.php: New message link instead of group link * operation/visual_console/render_view.php: Fixed conflict with timer * index.php: Added div for overlay (not in pure mode) and fixed erroneous div in pure mode. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1469 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-02-19 22:34:27 +01:00
}
};
2009-02-11 Esteban Sanchez <estebans@artica.es> * general/main_menu.php, include/styles/menu.css: Selected menu style is done with a CSS classs. Slide effect removed. Submenus have now white background. * godmode/agentes/alert_manager.php: Allow creation of alerts without actions which have sense in compound alerts. * include/javascript/jquery.pandora.js: Added showMessage() function. * godmode/agentes/module_manager_editor.php: Use new showMessage() jQuery function. * godmode/alerts/configure_alert_compound.php: Added to repository. New compound alert editor interface. * godmode/alerts/alert_compounds.php: Added to repository. Compound alert list. * godmode/alerts/configure_alert_template.php: Better style for steps of the editor. * godmode/menu.php: Added compound alerts option. Changed default page on Manage alerts. * include/styles/pandora.css: Added style for editor steps. Added new generic classes. * include/functions.php: Added a new line when creating script list. * include/functions_agents.php: Fixed alert tables fields. Renamed get_agent_alerts_compound() and improved the returning value of get_agent_alerts(). * include/functions_alerts.php: Added new functions to manage compound alerts. Avoid SQL errors when using process_sql functions. * include/functions_reporting.php: Temporary disabled compound alert reports. * include/functions_ui.php: Fixed format_alert_row() to fit compound alerts. * operation/agentes/alerts_status.php: Allow compound alert validation. Removed effect of cluetip. * pandoradb.sql, pandoradb_migrate_20_to_21.sql: New compound alert tables (talert_compound, talert_compound_elements and talert_compound_actions). * godmode/alerts/alert_list.php: Added to repository. Shows a list of all the alerts defined. Would be improved in the future to allow sorting and filtering. * index.php, godmode/snmpconsole/snmp_alert.php, include/functions_db.php: Code style correction. * godmode/agentes/configurar_agente.php: Removed old compound alerts code git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1443 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-02-11 17:55:04 +01:00
$.fn.showMessage = function (msg) {
return $(this).hide ().empty ()
.text (msg)
.slideDown ();
};
2009-04-20 Esteban Sanchez <estebans@artica.es> * godmode/agentes/module_manager_editor.php, godmode/agentes/module_manager_editor_common.php, godmode/agentes/module_manager_editor_data.php, godmode/agentes/module_manager_editor_network.php, godmode/agentes/module_manager_editor_plugin.php, godmode/agentes/module_manager_editor_prediction.php, godmode/agentes/module_manager_editor_wmi.php, godmode/agentes/module_manager.php: Some fixes to allow form reutilization. * include/javascript/jquery.pandora.controls.js: Fixed a typo. Added pandoraSelectGroup control. * include/javascript/jquery.pandora.js: Separate between auto executed code and document ready function. * include/javascript/pandora_modules.js: Added to repository. Functions to use on module editors. * include/functions_agents.php: Added get_agents(). * include/functions_db.php: Added get_user_first_group(). Changed user_access_to_agent() parameters order. * include/functions_reporting.php: Style corrections. * include/functions_ui.php: Added doc to print_status_image(). Added print_ui_agents_list() to print a list of agents with a search form and a lot of configuration options easily. * include/functions_ui_renders.php: Added to repository. New API for renders on UI components. * operation/agentes/estado_agente.php: Make table wider. * godmode/reporting/reporting_builder.php: Replaced exit with return. Use pandoraSelectGroup control. * godmode/servers/manage_recontask_form.php: Style corrections to fit Pandora styles. * godmode/servers/modificar_server.php: Removed a notice from a typo. * godmode/setup/setup.php: Fixed table data indexes. Removed javascript code from visual setup. * godmode/setup/setup_visuals.php: Some strings changed. Style correction. * godmode/menu.php: Added policies enterprise menu option. * images/policies.png: Added to repository. * godmode/agentes/modificar_agente.php: Style correction by using pandora functions. * godmode/agentes/massive_operations.php: Fixed tab styles that was showing wrong the . * godmode/agentes/manage_config_remote.php: Changes in user_access_to_agent() * general/ui/agents_list.php: Added to repository. Reusable render for an agent list. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1632 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-04-20 16:00:27 +02:00
}) (jQuery);
$(document).ready (function () {
$("a#show_messages_dialog").click (function () {
jQuery.get ("ajax.php",
{"page": "operation/messages/message_list"},
function (data, status) {
$("#dialog_messages").hide ()
.empty ()
.append (data)
.dialog ({
title: $("a#show_messages_dialog").attr ("title"),
resizable: false,
modal: true,
overlay: {
opacity: 0.5,
background: "black"
},
width: 700,
height: 300
})
.show ();
},
"html"
);
2009-02-19 Evi Vanoost <vanooste@rcbi.rochester.edu> * pandoradb_migrate_20_to_21.sql, pandora_db.sql: Altered tmensajes for unixtime * general/header.php: New messages function added flashing acknowledgment in case of new messages * general/logon_ok.php: Since messages are now in header, they don't need to be there per se * images/close.png, images/transparent.png: Background and close button for overlays. * include/javascript/jquery.pandora.js: Used for loop for flashing thing and added overlay function * include/javascript/jquery.overlay.js: You'll need this for overlay * include/functions_messages.php: Message functions are here. Messages are fully abstracted so they can be drop-in replaced with something else * include/functions_ui.php: Small fixes. Not necessary to load en language files for javascript since they're empty, it only adds to load/interpret * include/functions_db.php: Added get_group_users and get_db_array. Useful * include/functions_html.php: Small doc fixes and fixed table heads * include/styles/pandora.css: Added Overlay classes * ajax.php: We need to call safe_url_extraclean for cross scripting * operation/messages/message.php: Rebuilt to use new functions * operation/menu.php: New message link instead of group link * operation/visual_console/render_view.php: Fixed conflict with timer * index.php: Added div for overlay (not in pure mode) and fixed erroneous div in pure mode. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1469 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-02-19 22:34:27 +01:00
return false;
2009-02-19 Evi Vanoost <vanooste@rcbi.rochester.edu> * pandoradb_migrate_20_to_21.sql, pandora_db.sql: Altered tmensajes for unixtime * general/header.php: New messages function added flashing acknowledgment in case of new messages * general/logon_ok.php: Since messages are now in header, they don't need to be there per se * images/close.png, images/transparent.png: Background and close button for overlays. * include/javascript/jquery.pandora.js: Used for loop for flashing thing and added overlay function * include/javascript/jquery.overlay.js: You'll need this for overlay * include/functions_messages.php: Message functions are here. Messages are fully abstracted so they can be drop-in replaced with something else * include/functions_ui.php: Small fixes. Not necessary to load en language files for javascript since they're empty, it only adds to load/interpret * include/functions_db.php: Added get_group_users and get_db_array. Useful * include/functions_html.php: Small doc fixes and fixed table heads * include/styles/pandora.css: Added Overlay classes * ajax.php: We need to call safe_url_extraclean for cross scripting * operation/messages/message.php: Rebuilt to use new functions * operation/menu.php: New message link instead of group link * operation/visual_console/render_view.php: Fixed conflict with timer * index.php: Added div for overlay (not in pure mode) and fixed erroneous div in pure mode. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1469 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-02-19 22:34:27 +01:00
});
$("a#show_systemalert_dialog").click (function () {
jQuery.get ("ajax.php",
{"page": "operation/system_alert"},
function (data, status) {
$("#alert_messages").hide ()
.empty ()
.append (data)
.dialog ({
title: $("a#show_systemalert_dialog").attr ("title"),
resizable: true,
draggable: true,
modal: true,
overlay: {
opacity: 0.5,
background: "black"
},
width: 700,
height: 300
})
.show ();
},
"html"
);
return false;
});
if ($('#license_error_msg_dialog').length) {
$( "#license_error_msg_dialog" ).dialog({
resizable: true,
draggable: true,
modal: true,
height: 280,
width: 600,
overlay: {
opacity: 0.5,
background: "black"
}
});
$("#submit-hide-license-error-msg").click (function () {
$("#license_error_msg_dialog" ).dialog('close')
});
}
$("a#dialog_license_info").click (function () {
var ajax_doc = "ajax.php";
if($('#hidden-metaconsole_activated').val() == 1) {
ajax_doc = "../../" + ajax_doc;
}
jQuery.get (ajax_doc,
{"page": "extensions/update_manager",
"get_license_info": "1"},
function (data, status) {
$("#dialog_show_license").hide ()
.empty ()
.append (data)
.dialog ({
title: $("a#dialog_license_info").attr ("title"),
resizable: false,
draggable: true,
modal: true,
overlay: {
opacity: 0.5,
background: "black"
},
width: 500,
height: 190
})
.show ();
},
"html"
);
return false;
});
if ($('#msg_change_password').length) {
$( "#msg_change_password" ).dialog({
resizable: true,
draggable: true,
modal: true,
height: 260,
width: 590,
overlay: {
opacity: 0.5,
background: "black"
}
});
}
if ($('#login_blocked').length) {
$( "#login_blocked" ).dialog({
resizable: true,
draggable: true,
modal: true,
height: 180,
width: 400,
overlay: {
opacity: 0.5,
background: "black"
}
});
}
// Forced title code
$('IMG.forced_title').hover(function() {
///////////////////////////////////////////
// Get info of the image
///////////////////////////////////////////
var img_top = $(this).offset().top;
var img_width = $(this).width();
var img_height = $(this).height();
var img_id = $(this).attr('id');
var img_left_mid = $(this).offset().left + (img_width / 2);
///////////////////////////////////////////
// Put title in the layer
///////////////////////////////////////////
var title = $('#forced_title_'+img_id).html();
$('#forced_title_layer').html(title);
///////////////////////////////////////////
// Get info of the layer
///////////////////////////////////////////
var layer_width = $('#forced_title_layer').width();
var layer_height = $('#forced_title_layer').height();
///////////////////////////////////////////
// Obtain the new position of the layer
///////////////////////////////////////////
// Jquery doesnt know the padding of the layer
var layer_padding = 4;
// Deduct padding of both sides
var layer_top = img_top - layer_height - (layer_padding * 2);
if(layer_top < 0) {
layer_top = img_top + img_height + (layer_padding * 2);
}
// Deduct padding of one side
var layer_left = img_left_mid - (layer_width / 2) - layer_padding;
if(layer_left < 0) {
layer_left = 0;
}
///////////////////////////////////////////
// Set the layer position and show
///////////////////////////////////////////
$('#forced_title_layer').css('left', layer_left);
$('#forced_title_layer').css('top', layer_top);
$('#forced_title_layer').show();
},
function () {
$('#forced_title_layer').hide().empty();
});
});