Merge pull request #6479 from JakubOnderka/event-ui-vol5-small

Event ui vol5 small
pull/6484/head
Jakub Onderka 2020-10-21 21:56:32 +02:00 committed by GitHub
commit 8db2c4b574
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 46 additions and 67 deletions

View File

@ -89,7 +89,7 @@ class ObjectsController extends AppController
if (isset($this->request->data['Attribute'])) {
foreach ($this->request->data['Attribute'] as &$attribute) {
$validation = $this->MispObject->Attribute->validateAttribute($attribute);
$validation = $this->MispObject->Attribute->validateAttribute($attribute, false);
if ($validation !== true) {
$attribute['validation'] = $validation;
}

View File

@ -3703,7 +3703,7 @@ class Attribute extends AppModel
}
/**
* @param $attribute
* @param array $attribute
* @param bool $context
* @return array|true
*/
@ -3713,6 +3713,7 @@ class Attribute extends AppModel
if (!$context) {
unset($this->validate['event_id']);
unset($this->validate['value']['uniqueValue']);
unset($this->validate['uuid']['unique']);
}
if ($this->validates()) {
return true;

View File

@ -14,7 +14,7 @@ $event['Related' . $scope][$object['id']] = array_values($event['Related' . $sco
$count = count($event['Related' . $scope][$object['id']]);
foreach ($event['Related' . $scope][$object['id']] as $relatedAttribute) {
if ($i == 4 && $count > 5) {
$expandButton = __('Show ') . ($count - 4) . __(' more...');
$expandButton = __('Show %s more...', $count - 4);
echo sprintf(
'<li class="no-side-padding correlation-expand-button useCursorPointer linkButton %s">%s</li>',
$linkColour,
@ -24,12 +24,12 @@ foreach ($event['Related' . $scope][$object['id']] as $relatedAttribute) {
$relatedData = array(
'Orgc' => !empty($orgTable[$relatedAttribute['org_id']]) ? $orgTable[$relatedAttribute['org_id']] : 'N/A',
'Date' => isset($relatedAttribute['date']) ? $relatedAttribute['date'] : 'N/A',
'Info' => $relatedAttribute['info'],
'Event' => $relatedAttribute['info'],
'Correlating Value' => $relatedAttribute['value']
);
$popover = '';
foreach ($relatedData as $k => $v) {
$popover .= '<span class=\'bold black\'>' . h($k) . '</span>: <span class="blue">' . h($v) . '</span><br />';
$popover .= '<span class="bold black">' . h($k) . '</span>: <span class="blue">' . h($v) . '</span><br>';
}
$link = $this->Html->link(
$relatedAttribute['id'],
@ -53,4 +53,3 @@ if ($i > 5) {
__('Collapse…')
);
}
?>

View File

@ -202,17 +202,17 @@ $quickEdit = function($fieldName) use ($editScope, $object, $event) {
>
</td>
<td class="shortish">
<ul class="inline" style="margin:0">
<?php
if (!empty($event['RelatedAttribute'][$object['id']])) {
echo $this->element('Events/View/attribute_correlations', array(
'scope' => 'Attribute',
'object' => $object,
'event' => $event,
));
echo '<ul class="inline" style="margin:0">';
echo $this->element('Events/View/attribute_correlations', array(
'scope' => 'Attribute',
'object' => $object,
'event' => $event,
));
echo '</ul>';
}
?>
</ul>
</td>
<td class="shortish">
<ul class="inline" style="margin:0">
@ -226,15 +226,15 @@ $quickEdit = function($fieldName) use ($editScope, $object, $event) {
foreach ($v as $k2 => $v2) {
$v[$k2] = h($v2);
}
$v = implode('<br />', $v);
$v = implode('<br>', $v);
} else {
$v = h($v);
}
$popover .= '<span class=\'bold black\'>' . Inflector::humanize(h($k)) . '</span>: <span class="blue">' . $v . '</span><br />';
$popover .= '<span class="bold black">' . Inflector::humanize(h($k)) . '</span>: <span class="blue">' . $v . '</span><br>';
}
$liContents = '';
if ($isSiteAdmin || $hostOrgUser) {
if ($feed['source_format'] == 'misp') {
if ($feed['source_format'] === 'misp') {
$liContents .= sprintf(
'<form action="%s/feeds/previewIndex/%s" method="post" style="margin:0;line-height:auto;">%s%s</form>',
$baseurl,
@ -251,14 +251,11 @@ $quickEdit = function($fieldName) use ($editScope, $object, $event) {
);
} else {
$liContents .= sprintf(
'<form>%s</form>',
sprintf(
'<a href="%s/feeds/previewIndex/%s" style="margin-right:3px;" data-toggle="popover" data-content="%s" data-trigger="hover">%s</a>',
$baseurl,
h($feed['id']),
h($popover),
h($feed['id'])
)
'<a href="%s/feeds/previewIndex/%s" style="margin-right:3px;" data-toggle="popover" data-content="%s" data-trigger="hover">%s</a>',
$baseurl,
h($feed['id']),
h($popover),
h($feed['id'])
);
}
} else {

View File

@ -4,6 +4,4 @@
<i style="display: block; text-align: center;" class="fas fa-arrow-down"></i>
<div><?php echo $object['last_seen'] != null ? h($object['last_seen']) : '<span style="display: block; text-align:center;">_</span>'; ?></div>
</div>
<?php else: ?>
<div></div>
<?php endif; ?>
<?php endif ?>

View File

@ -37,7 +37,7 @@
echo $this->Form->input('Attribute.' . $k . '.type', $formSettings);
echo '<span class="bold">' . Inflector::humanize(h($element['object_relation'])) . '</span>';
if (!empty($template['ObjectTemplate']['requirements']['required']) && in_array($element['object_relation'], $template['ObjectTemplate']['requirements']['required'])) {
echo '<span class="bold red">' . '(*)' . '</span>';
echo '<span class="red" style="vertical-align: super;font-size: 8px;margin-left: 2px;" title="' . __('Required') . '"><i class="fas fa-asterisk"></i></span>';
}
echo ' :: ' . h($element['type']) . '';
?>

View File

@ -1,19 +0,0 @@
<?php
echo $this->Form->create('Event', array('class' => 'inline-form inline-field-form', 'url' => $baseurl . '/events/quickEdit/' . $event['Event']['id'] . '/' . $field));
?>
<div class='inline-input inline-input-container'>
<div class="inline-input-accept inline-input-button inline-input-passive"><span class = "icon-ok" title="<?php echo __('Accept');?>" role="button" tabindex="0" aria-label="<?php echo __('Accept');?>"></span></div>
<div class="inline-input-decline inline-input-button inline-input-passive"><span class = "icon-remove" title="<?php echo __('Cancel');?>" role="button" tabindex="0" aria-label="<?php echo __('Cancel');?>"></span></div>
<?php
echo $this->Form->input('category', array(
'options' => array(array_combine($typeCategory[$object['type']], $typeCategory[$object['type']])),
'label' => false,
'selected' => $object['category'],
'error' => array('escape' => false),
'class' => 'inline-input',
'id' => 'Attribute_' . $object['id'] . '_category_field',
'div' => false
));
echo $this->Form->end();
?>
</div>

View File

@ -19,7 +19,7 @@
if ($fieldData === 'Tag') {
echo '<div><span class="blue bold">Tags</span>: ';
if (!empty($event['EventTag'])) {
echo '<span>' . $this->element('ajaxTags', array('event' => $event, 'tags' => $event['EventTag'], 'tagAccess' => false)) . '</span>';
echo '<span>' . $this->element('ajaxTags', array('event' => $event, 'tags' => $event['EventTag'], 'static_tags_only' => true)) . '</span>';
}
echo '</div>';
} else {

View File

@ -122,11 +122,11 @@
<tr>
<th><?php echo __('Save');?></th>
<th><?php echo __('Name :: type');?></th>
<th><?php echo __('Description');?></th>
<th><?php echo __('Description');?></th>
<th><?php echo __('Category');?></th>
<th><?php echo __('Value');?></th>
<th><?php echo __('IDS');?></th>
<th><?php echo __('Disable Correlation');?></th>
<th><?php echo __('Disable Correlation');?></th>
<th><?php echo __('Distribution');?></th>
<th><?php echo __('Comment');?></th>
</tr>
@ -139,8 +139,8 @@
array(
'element' => $element,
'k' => $k,
'action' => $action,
'enabledRows' => $enabledRows
'action' => $action,
'enabledRows' => $enabledRows
)
);
if ($element['multiple']):

View File

@ -1,9 +1,9 @@
<?php
echo $this->Form->create('Object', array('class' => 'inline-form inline-field-form', 'id' => 'Object_' . $object['id'] . '_comment_form', 'url' => $baseurl . '/objects/editField/' . $object['id']));
?>
<div class='inline-input inline-input-container'>
<div class="inline-input-accept inline-input-button inline-input-passive"><span class = "icon-ok" role="button" tabindex="0" aria-label="<?php echo __('Accept change'); ?>"></span></div>
<div class="inline-input-decline inline-input-button inline-input-passive"><span class = "icon-remove" role="button" tabindex="0" aria-label="<?php echo __('Discard change'); ?>"></span></div>
<div class="inline-input inline-input-container">
<div class="inline-input-accept inline-input-button inline-input-passive"><span class="fas fa-check" role="button" tabindex="0" aria-label="<?php echo __('Accept change'); ?>"></span></div>
<div class="inline-input-decline inline-input-button inline-input-passive"><span class="fas fa-times" role="button" tabindex="0" aria-label="<?php echo __('Discard change'); ?>"></span></div>
<?php
echo $this->Form->input('comment', array(
'type' => 'textarea',
@ -17,6 +17,3 @@
echo $this->Form->end();
?>
</div>
<?php
echo $this->Form->end();
?>

View File

@ -1,9 +1,9 @@
<?php
echo $this->Form->create('Object', array('class' => 'inline-form inline-field-form', 'id' => 'Object_' . $object['id'] . '_distribution_form', 'url' => '/objects/editField/' . $object['id']));
?>
<div class='inline-input inline-input-container'>
<div class="inline-input-accept inline-input-button inline-input-passive"><span class = "icon-ok" role="button" tabindex="0" aria-label="<?php echo __('Accept change'); ?>"></span></div>
<div class="inline-input-decline inline-input-button inline-input-passive"><span class = "icon-remove" role="button" tabindex="0" aria-label="<?php echo __('Discard change'); ?>"></span></div>
<div class="inline-input inline-input-container">
<div class="inline-input-accept inline-input-button inline-input-passive"><span class="fas fa-check" role="button" tabindex="0" aria-label="<?php echo __('Accept change'); ?>"></span></div>
<div class="inline-input-decline inline-input-button inline-input-passive"><span class="fas fa-times" role="button" tabindex="0" aria-label="<?php echo __('Discard change'); ?>"></span></div>
<?php
echo $this->Form->input('distribution', array(
'options' => array($distributionLevels),

View File

@ -1,9 +1,9 @@
<?php
echo $this->Form->create('Server', array('class' => 'inline-form inline-field-form', 'url' => $baseurl . '/servers/serverSettingsEdit/' . $setting['setting'] . '/' . $id . '/' . '1', 'id' => 'setting_' . $subGroup . '_' . $id . '_form'));
?>
<div class='inline-input inline-input-container'>
<div class="inline-input-accept inline-input-button inline-input-passive"><span class = "icon-ok" title="<?php echo __('Accept');?>" role="button" tabindex="0" aria-label="<?php echo __('Accept');?>"></span></div>
<div class="inline-input-decline inline-input-button inline-input-passive"><span class = "icon-remove" title="<?php echo __('Cancel');?>" role="button" tabindex="0" aria-label="<?php echo __('Cancel');?>"></span></div>
<div class="inline-input inline-input-container">
<div class="inline-input-accept inline-input-button inline-input-passive"><span class="fas fa-check" title="<?php echo __('Accept');?>" role="button" tabindex="0" aria-label="<?php echo __('Accept');?>"></span></div>
<div class="inline-input-decline inline-input-button inline-input-passive"><span class="fas fa-times" title="<?php echo __('Cancel');?>" role="button" tabindex="0" aria-label="<?php echo __('Cancel');?>"></span></div>
<?php
if (!empty($setting['redacted'])) {
$setting['value'] = '*****';

View File

@ -1297,7 +1297,8 @@ span.success {
bottom:-17px;
background-color: #fff;
position:absolute;
z-index:100;
z-index:10;
color: #333;
}
.inline-input-active {
@ -2379,7 +2380,7 @@ table tr:hover .down-expand-button {
}
.strikethrough {
text-decoration: line-through;
text-decoration: line-through !important;
}
.highlighted_node {
@ -2601,7 +2602,7 @@ table tr:hover .down-expand-button {
}
/* Threat levels */
.threat-level-high::before, .threat-level-medium::before, .threat-level-low::before {
.threat-level-high::before, .threat-level-medium::before, .threat-level-low::before, .threat-level-undefined::before {
font-family: 'Font Awesome 5 Free';
font-weight: 900;
-moz-osx-font-smoothing: grayscale;
@ -2629,6 +2630,11 @@ table tr:hover .down-expand-button {
color: rgb(35,120,40);
}
.threat-level-undefined::before {
content: "\f128";
color: gray;
}
#UserGpgkey, #UserCertifPublic {
font-family: Monaco, Menlo, Consolas, "Courier New", monospace;
font-size: 100%;