#11051 Fix css conflict

This commit is contained in:
miguel angel rasteu 2023-08-21 13:16:53 +02:00
commit 19fb83cd92
8 changed files with 20915 additions and 11 deletions

View File

@ -24,6 +24,14 @@ if (! check_acl($config['id_user'], 0, 'AR')
ui_require_css_file('discovery');
ui_require_javascript_file('pandora_alerts');
ui_include_time_picker();
ui_require_jquery_file('ui.datepicker-'.get_user_language(), 'include/javascript/i18n/');
ui_require_javascript_file('tinymce', 'vendor/tinymce/tinymce/');
ui_require_css_file('main.min', 'include/javascript/fullcalendar/');
ui_require_javascript_file('main.min', 'include/javascript/fullcalendar/');
ui_require_javascript_file('pandora_fullcalendar');
/**
* Mask class names.
@ -204,3 +212,115 @@ if ($classname_selected === null) {
Wizard::printBigButtonsList($wiz_data);
}
$is_management_allowed = is_management_allowed();
$task_id = get_parameter('task', '');
if ($task_id !== '') {
$task = db_get_row_filter(
'tuser_task_scheduled',
['id' => $task_id]
);
$args = unserialize($task['args']);
$event_calendar = io_safe_output($args['weekly_schedule']);
} else {
$event_calendar = '{"monday":[{"start":"00:00:00","end":"00:00:00"}],"tuesday":[{"start":"00:00:00","end":"00:00:00"}],"wednesday":[{"start":"00:00:00","end":"00:00:00"}],"thursday":[{"start":"00:00:00","end":"00:00:00"}],"friday":[{"start":"00:00:00","end":"00:00:00"}],"saturday":[{"start":"00:00:00","end":"00:00:00"}],"sunday":[{"start":"00:00:00","end":"00:00:00"}]}';
}
?>
<script type="text/javascript">
$(document).ready (function () {
$("#table-new-job-3").hide();
var edit = '<?php echo $task_id; ?>';
if (edit != '') {
exec_calendar();
}
$("#scheduled").change(exec_calendar);
function exec_calendar() {
if ($("#scheduled").val() == "weekly") {
var is_management_allowed = parseInt('<?php echo (int) $is_management_allowed; ?>');
var eventsBBDD = '<?php echo $event_calendar; ?>';
var events = loadEventBBDD(eventsBBDD);
var calendarEl = document.getElementById('calendar_map');
var options = {
contentHeight: "auto",
headerToolbar: {
left: "",
center: "",
right: is_management_allowed === 0 ? '' : "timeGridWeek,dayGridWeek"
},
buttonText: {
dayGridWeek: '<?php echo __('Simple'); ?>',
timeGridWeek: '<?php echo __('Detailed'); ?>'
},
dayHeaderFormat: { weekday: "short" },
initialView: "dayGridWeek",
navLinks: false,
selectable: true,
selectMirror: true,
slotDuration: "01:00:00",
slotLabelInterval: "02:00:00",
snapDuration: "01:00:00",
slotMinTime: "00:00:00",
slotMaxTime: "24:00:00",
scrollTime: "01:00:00",
locale: "en-GB",
firstDay: 1,
eventTimeFormat: {
hour: "numeric",
minute: "2-digit",
hour12: false
},
eventColor: "#82b92e",
editable: is_management_allowed === 0 ? false : true,
dayMaxEvents: 3,
dayPopoverFormat: { weekday: "long" },
defaultAllDay: false,
displayEventTime: true,
displayEventEnd: true,
selectOverlap: false,
eventOverlap: false,
allDaySlot: true,
droppable: false,
select: is_management_allowed === 0 ? false : select_alert_template,
selectAllow: is_management_allowed === 0 ? false : selectAllow_alert_template,
eventAllow: is_management_allowed === 0 ? false : eventAllow_alert_template,
eventDrop: is_management_allowed === 0 ? false : eventDrop_alert_template,
eventDragStop: is_management_allowed === 0 ? false : eventDragStop_alert_template,
eventResize: is_management_allowed === 0 ? false : eventResize_alert_template,
eventMouseEnter: is_management_allowed === 0 ? false : eventMouseEnter_alert_template,
eventMouseLeave: is_management_allowed === 0 ? false : eventMouseLeave_alert_template,
eventClick: is_management_allowed === 0 ? false : eventClick_alert_template,
};
var settings = {
timeFormat: '<?php echo TIME_FORMAT_JS; ?>',
timeOnlyTitle: '<?php echo __('Choose time'); ?>',
timeText: '<?php echo __('Time'); ?>',
hourText: '<?php echo __('Hour'); ?>',
minuteText: '<?php echo __('Minute'); ?>',
secondText: '<?php echo __('Second'); ?>',
currentText: '<?php echo __('Now'); ?>',
closeText: '<?php echo __('Close'); ?>',
url: '<?php echo ui_get_full_url('ajax.php', false, false, false); ?>',
removeText: '<?php echo __('Remove'); ?>',
userLanguage: '<?php echo get_user_language(); ?>',
loadingText: '<?php echo __('Loading, this operation might take several minutes...'); ?>',
tooltipText: '<?php echo __('Drag out to remove'); ?>',
alert: '<?php echo __('Alert'); ?>'
}
var calendar = fullCalendarPandora(calendarEl, options, settings, events);
calendar.render();
$("#table-new-job-3").show();
$('.fc-event-title').hide();
$(".fc-button-active" ).trigger( "click" );
} else {
$("#calendar_map").html();
$("#table-new-job-3").hide();
}
}
});
</script>

View File

@ -1444,6 +1444,7 @@ if ($add_comment === true) {
if ($change_status === true) {
$event_ids = get_parameter('event_ids');
$new_status = get_parameter('new_status');
$group_rep = (int) get_parameter('group_rep', 0);
$server_id = 0;
if (is_metaconsole() === true) {
$server_id = (int) get_parameter('server_id');
@ -1457,10 +1458,19 @@ if ($change_status === true) {
$node->connect();
}
$return = events_change_status(
explode(',', $event_ids),
$new_status
);
if ($group_rep !== 3) {
$return = events_change_status(
explode(',', $event_ids),
$new_status
);
} else {
// Update all elements with same extraid.
$return = events_update_status(
$event_ids,
(int) $new_status,
['group_rep' => $group_rep]
);
}
} catch (\Exception $e) {
// Unexistent agent.
if (is_metaconsole() === true

View File

@ -477,7 +477,7 @@ function events_update_status($id_evento, $status, $filter=null)
{
global $config;
if (!$status) {
if (!$status && $status !== 0) {
return false;
}
@ -1762,11 +1762,9 @@ function events_get_all(
}
}
$string_metaconsole_connections = implode(',', $metaconsole_connections);
$explode_metaconsole_connections = explode(',', $string_metaconsole_connections);
$result_meta = Promise\wait(
parallelMap(
$explode_metaconsole_connections,
$metaconsole_connections,
function ($node_int) use ($sql, $history) {
try {
if (is_metaconsole() === true
@ -3540,11 +3538,15 @@ function events_page_responses($event)
);
if ($status_blocked === false) {
if (isset($event['server_id']) === false) {
$event['server_id'] = '0';
}
$data[2] = html_print_button(
__('Update'),
'status_button',
false,
'event_change_status("'.$event['similar_ids'].'",'.$event['server_id'].');',
'event_change_status("'.$event['similar_ids'].'",'.$event['server_id'].', '.$event['group_rep'].');',
[
'icon' => 'next',
'mode' => 'link',

20740
pandora_console/include/javascript/d3.v7.js vendored Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -322,7 +322,7 @@ function perform_response(response, response_id, index = "") {
}
// Change the status of an event to new, in process or validated.
function event_change_status(event_ids, server_id) {
function event_change_status(event_ids, server_id, group_rep) {
var new_status = $("#estado").val();
$("#button-status_button").attr("disabled", "disabled");
@ -334,7 +334,8 @@ function event_change_status(event_ids, server_id) {
change_status: 1,
event_ids: event_ids,
new_status: new_status,
server_id: server_id
server_id: server_id,
group_rep: group_rep
},
type: "POST",
url: getUrlAjax(),

View File

@ -12411,6 +12411,31 @@ tr[id^="network_component-plugin-snmp-fields-dynamicMacroRow-"] input {
vertical-align: middle;
}
/*Horizontal tree*/
.horizontal_tree-icon {
position: absolute;
background: #f4f4f4;
margin-top: 140px;
margin-left: 15px;
transform: rotate(-90deg);
}
.horizontal_tree-icon-sunburst {
position: absolute;
background: #f4f4f4;
margin-top: 40px;
/*margin-left: 15px;*/
transform: rotate(-90deg);
}
.tree-icon {
position: absolute;
background: #f4f4f4;
margin-top: 140px;
margin-left: 15px;
}
.label_agent_service > label {
margin-top: 15px;
}

View File

@ -157,6 +157,10 @@ try {
throw new Exception('Invalid filter. ['.$plain_filter.']');
}
if (key_exists('server_id', $filter) === true && is_array($filter['server_id']) === false) {
$filter['server_id'] = explode(',', $filter['server_id']);
}
$filter['csv_all'] = true;
$names = events_get_column_names($column_names);