mirror of https://github.com/MISP/MISP
new: [GalaxyPicking] Choose the galaxy namespace first before showing
related galaxiespull/3347/head
parent
5f36725ede
commit
635d1fcc5d
|
@ -64,14 +64,30 @@ class GalaxiesController extends AppController {
|
|||
}
|
||||
}
|
||||
|
||||
public function selectGalaxy($target_id, $target_type='event') {
|
||||
$galaxies = $this->Galaxy->find('all', array('recursive' => -1));
|
||||
public function selectGalaxy($target_id, $target_type='event', $namespace='misp') {
|
||||
$conditions = $namespace == '0' ? array() : array('namespace' => $namespace);
|
||||
$galaxies = $this->Galaxy->find('all', array(
|
||||
'recursive' => -1,
|
||||
'conditions' => $conditions,
|
||||
));
|
||||
$this->set('galaxies', $galaxies);
|
||||
$this->set('target_id', $target_id);
|
||||
$this->set('target_type', $target_type);
|
||||
$this->render('ajax/galaxy_choice');
|
||||
}
|
||||
|
||||
public function selectGalaxyNamespace($target_id, $target_type='event') {
|
||||
$namespaces = $this->Galaxy->find('list', array(
|
||||
'recursive' => -1,
|
||||
'fields' => array('namespace'),
|
||||
'group' => array('namespace')
|
||||
));
|
||||
$this->set('namespaces', $namespaces);
|
||||
$this->set('target_id', $target_id);
|
||||
$this->set('target_type', $target_type);
|
||||
$this->render('ajax/galaxy_namespace_choice');
|
||||
}
|
||||
|
||||
public function selectCluster($target_id, $target_type = 'event', $selectGalaxy = false) {
|
||||
$conditions = array();
|
||||
if ($selectGalaxy) {
|
||||
|
|
|
@ -3093,7 +3093,7 @@ $('.galaxy-toggle-button').click(function() {
|
|||
$('.addGalaxy').click(function() {
|
||||
var target_type = $(this).data('target-type');
|
||||
var target_id = $(this).data('target-id');
|
||||
getPopup(target_type + '/' + target_id, 'galaxies', 'selectGalaxy');
|
||||
getPopup(target_type + '/' + target_id, 'galaxies', 'selectGalaxyNamespace');
|
||||
});
|
||||
|
||||
function quickSubmitGalaxyForm(event_id, cluster_id) {
|
||||
|
|
Loading…
Reference in New Issue