mirror of https://github.com/MISP/MISP
chg: [eventGraph] fixed img_preview size, catch keyboard inputs and
removed useless functionpull/3449/head
parent
43275f3a90
commit
46ecaff0f2
|
@ -166,44 +166,4 @@ class EventNetworkHistoryController extends AppController {
|
|||
}
|
||||
}
|
||||
|
||||
public function fetchForm($action, $event_id, $id = null) {
|
||||
$formURL = 'eventNetworkHistory_add_form';
|
||||
if ($action == 'edit') {
|
||||
$params = array(
|
||||
'conditions' => array('EventNetworkHistory.id' => $id),
|
||||
'flatten' => 1,
|
||||
);
|
||||
$networkHistory = $this->NetworkHistory->get($this->Auth->user(), $params);
|
||||
if (empty($networkHistory)) throw new NotFoundException(__('Invalid network history'));
|
||||
$networkHistory = $networkHistory[0];
|
||||
$this->set('networkHistory', $networkHistory);
|
||||
$formURL = 'eventNetworkHistory_add_form';
|
||||
} else if ($action == 'delete') {
|
||||
$params = array(
|
||||
'conditions' => array('EventNetworkHistory.id' => $id),
|
||||
'flatten' => 1,
|
||||
);
|
||||
//$networkHistory = $this->NetworkHistory->fetchNetworkHistory($this->Auth->user(), $params);
|
||||
$networkHistory = $this->NetworkHistory->get($this->Auth->user(), $params);
|
||||
if (empty($networkHistory)) throw new NotFoundException(__('Invalid network history'));
|
||||
$networkHistory = $networkHistory[0];
|
||||
$this->set('networkHistory', $networkHistory);
|
||||
$formURL = 'eventNetworkHistory_delete_form';
|
||||
}
|
||||
|
||||
if (!$this->_isSiteAdmin()) {
|
||||
if ($networkHistory['org_id'] == $this->Auth->user('org_id')
|
||||
&& (($this->userRole['perm_modify'] && $networkHistory['user_id'] != $this->Auth->user('id'))
|
||||
|| $this->userRole['perm_modify_org'])) {
|
||||
// Allow the edit
|
||||
} else {
|
||||
throw new NotFoundException(__('Invalid network history'));
|
||||
}
|
||||
}
|
||||
|
||||
$this->set('action', $action);
|
||||
$this->set('event_id', $event_id);
|
||||
|
||||
$this->render('ajax/' . $formURL);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -609,7 +609,7 @@ class EventGraph {
|
|||
btn_plot.data('network-preview', preview);
|
||||
btn_plot.popover({
|
||||
container: 'body',
|
||||
content: function() { return '<img src="' + $(this).data('network-preview') + '" />'; },
|
||||
content: function() { return '<img style="width: 500px; height: 150px;" src="' + $(this).data('network-preview') + '" />'; },
|
||||
placement: 'right',
|
||||
trigger: 'hover',
|
||||
template: '<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content" style="width: 500px; height: 150px;"></div></div>',
|
||||
|
@ -1876,7 +1876,7 @@ function reset_graph_history() {
|
|||
btn_plot.data('network-preview', preview);
|
||||
btn_plot.popover({
|
||||
container: 'body',
|
||||
content: function() { return '<img src="' + $(this).data('network-preview') + '" />'; },
|
||||
content: function() { return '<img style="width: 500px; height: 150px;" src="' + $(this).data('network-preview') + '" />'; },
|
||||
placement: 'right',
|
||||
trigger: 'hover',
|
||||
template: '<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content" style="width: 500px; height: 150px;"></div></div>',
|
||||
|
@ -2067,6 +2067,9 @@ function enable_interactive_graph() {
|
|||
}
|
||||
return;
|
||||
}
|
||||
if (evt.target !== undefined && $(evt.target).is('input')) {
|
||||
return;
|
||||
}
|
||||
switch(evt.keyCode) {
|
||||
case 88: // x
|
||||
var selected_id = eventGraph.network.getSelectedNodes()[0];
|
||||
|
|
Loading…
Reference in New Issue