fix: [UI] Feed preview index and event

pull/8416/head
Jakub Onderka 2022-05-29 13:26:31 +02:00
parent 6f238403ae
commit feee069c32
2 changed files with 20 additions and 31 deletions

View File

@ -35,10 +35,6 @@ $tableData[] = [
'key' => __('Distribution'),
'value' => $distributionText
];
$tableData[] = [
'key' => __('Info'),
'value' => $event['Event']['info']
];
$tableData[] = [
'key' => __('Published'),
'class' => $event['Event']['published'] == 0 ? 'background-red bold not-published' : 'published',
@ -51,17 +47,12 @@ $tableData[] = [
];
?>
<div class="events view">
<?php
$title = $event['Event']['info'];
if (strlen($title) > 58) $title = substr($title, 0, 55) . '...';
?>
<h4 class="visibleDL notPublished" ><?= __('You are currently viewing an event from a feed (%s by %s)', h($feed['Feed']['name']), h($feed['Feed']['provider']));?></h4>
<div class="row-fluid">
<div class="span8">
<h2><?php echo nl2br(h($title)); ?></h2>
<?= $this->element('genericElements/viewMetaTable', array('table_data' => $tableData)); ?>
</div>
<div class="span8">
<h2 class="overflow"><?= nl2br(h($event['Event']['info']), false); ?></h2>
<?= $this->element('genericElements/viewMetaTable', array('table_data' => $tableData)); ?>
</div>
<?php if (!empty($event['RelatedEvent'])):?>
<div class="related span4">
<h3><?php echo __('Related Events');?></h3>
@ -91,7 +82,7 @@ $tableData[] = [
</div>
</div>
<?= $this->element('/genericElements/SideMenu/side_menu', array('menuList' => 'feeds', 'menuItem' => 'previewEvent', 'id' => $event['Event']['uuid'])); ?>
<script type="text/javascript">
<script>
// tooltips
$(function () {
$("th, td, dt, div, span, li").tooltip({

View File

@ -1,5 +1,5 @@
<div class="events index">
<h4 class="visibleDL notPublished" ><?php echo __('You are currently viewing the event index of a feed (%s by %s).', h($feed['Feed']['name']),h($feed['Feed']['provider']));?></h4>
<h4 class="visibleDL notPublished"><?php echo __('You are currently viewing the event index of a feed (%s by %s).', h($feed['Feed']['name']), h($feed['Feed']['provider']));?></h4>
<div class="pagination">
<ul>
<?php
@ -39,34 +39,33 @@
<th class="filter"><?php echo $this->Paginator->sort('info');?></th>
<th class="filter"><?php echo $this->Paginator->sort('timestamp', __('Timestamp'), array('direction' => 'desc'));?></th>
<th class="actions"><?php echo __('Actions');?></th>
</tr>
<?php if (!empty($events)) foreach ($events as $uuid => $event): ?>
<tr>
<td class="short" ondblclick="document.location.href ='<?php echo $eventViewURL . h($uuid);?>'"><?php echo h($event['Orgc']['name']); ?></td>
<td style = "max-width: 200px;width:10px;">
<td class="short dblclickElement"><?php echo h($event['Orgc']['name']); ?></td>
<td style="max-width: 200px;width:10px;">
<?php foreach ($event['Tag'] as $tag): ?>
<span class=tag style="margin-bottom:3px;background-color:<?php echo isset($tag['colour']) ? h($tag['colour']) : 'red';?>;color:<?php echo $this->TextColour->getTextColour(isset($tag['colour']) ? h($tag['colour']) : 'red');?>;" title="<?php echo h($tag['name']); ?>"><?php echo h($tag['name']); ?></span>
<?php endforeach; ?>
</td>
<td class="short" ondblclick="document.location.href ='<?php echo $eventViewURL . h($uuid);?>'">
<?php echo h($event['date']); ?>&nbsp;
<td class="short dblclickElement">
<?php echo h($event['date']); ?>
</td>
<td class="short" ondblclick="document.location.href ='<?php echo $eventViewURL . h($uuid);?>'">
<td class="short dblclickElement">
<?php
echo h($threatLevels[isset($event['threat_level_id']) ? $event['threat_level_id'] : (Configure::read('MISP.default_event_threat_level') ? Configure::read('MISP.default_event_threat_level') : 4)]);
?>
</td>
<td class="short" ondblclick="document.location.href ='<?php echo $eventViewURL . h($uuid);?>'">
<?php echo $analysisLevels[$event['analysis']]; ?>&nbsp;
<td class="short dblclickElement">
<?php echo $analysisLevels[$event['analysis']]; ?>
</td>
<td ondblclick="document.location.href ='<?php echo $eventViewURL . h($uuid);?>'">
<?php echo nl2br(h($event['info'])); ?>&nbsp;
<td class="dblclickElement">
<?php echo nl2br(h($event['info']), false); ?>
</td>
<td ondblclick="document.location.href ='<?php echo $eventViewURL . h($uuid);?>'" class="short"><?php echo h($event['timestamp']); ?></td>
<td class="short dblclickElement"><?= $this->Time->time($event['timestamp']); ?></td>
<td class="short action-links">
<?php if ($feed['Feed']['enabled'] && $isSiteAdmin) echo $this->Form->postLink('', $baseurl . '/feeds/getEvent/' . $id . '/' . $uuid, array('class' => 'fa fa-arrow-circle-down', 'title' => __('Fetch the event')), __('Are you sure you want to fetch and save this event on your instance?', $this->Form->value('Feed.id'))); ?>
<a href='<?php echo $eventViewURL . h($uuid);?>' class = "fa fa-eye" title = "<?php echo __('View');?>" aria-label = "<?php echo __('View');?>"></a>
<a href='<?php echo $eventViewURL . h($uuid);?>' class="fa fa-eye dblclickActionElement" title = "<?php echo __('View');?>" aria-label = "<?php echo __('View');?>"></a>
</td>
</tr>
<?php endforeach; ?>
@ -89,13 +88,12 @@
</ul>
</div>
</div>
<script type="text/javascript">
<script>
var passedArgsArray = <?php echo $passedArgs; ?>;
$(document).ready(function() {
$(function() {
$('#quickFilterButton').click(function() {
runIndexQuickFilter('<?php echo '/' . h($feed['Feed']['id']);?>');
});
});
</script>
<?php
echo $this->element('/genericElements/SideMenu/side_menu', array('menuList' => 'feeds', 'menuItem' => 'previewIndex', 'id' => $id));
<?= $this->element('/genericElements/SideMenu/side_menu', array('menuList' => 'feeds', 'menuItem' => 'previewIndex', 'id' => $id));