chg: misp connector index changes

pull/85/head
iglocska 2021-12-22 12:13:27 +01:00
parent e22068ec90
commit 58e32782ca
No known key found for this signature in database
GPG Key ID: BEA224F1FEF113AC
1 changed files with 60 additions and 60 deletions

View File

@ -293,70 +293,70 @@ class MispConnector extends CommonConnectorTools
$response = $this->getData('/servers/serverSettings', $params); $response = $this->getData('/servers/serverSettings', $params);
$data = $response->getJson(); $data = $response->getJson();
if (!empty($data['finalSettings'])) { if (!empty($data['finalSettings'])) {
$finalSettings = [ $finalSettings = [
'type' => 'index', 'type' => 'index',
'data' => [ 'data' => [
'data' => $data['finalSettings'], 'data' => $data['finalSettings'],
'skip_pagination' => 1, 'skip_pagination' => 1,
'top_bar' => [ 'top_bar' => [
'children' => [ 'children' => [
[
'type' => 'search',
'button' => __('Filter'),
'placeholder' => __('Enter value to search'),
'data' => '',
'searchKey' => 'value',
'additionalUrlParams' => $urlParams
]
]
],
'fields' => [
[ [
'name' => 'Setting', 'type' => 'search',
'sort' => 'setting', 'button' => __('Filter'),
'data_path' => 'setting', 'placeholder' => __('Enter value to search'),
], 'data' => '',
[ 'searchKey' => 'value',
'name' => 'Criticality', 'additionalUrlParams' => $urlParams
'sort' => 'level',
'data_path' => 'level',
'arrayData' => [
0 => 'Critical',
1 => 'Recommended',
2 => 'Optional'
],
'element' => 'array_lookup_field'
],
[
'name' => __('Value'),
'sort' => 'value',
'data_path' => 'value',
'options' => 'options'
],
[
'name' => __('Type'),
'sort' => 'type',
'data_path' => 'type',
],
[
'name' => __('Error message'),
'sort' => 'errorMessage',
'data_path' => 'errorMessage',
]
],
'title' => false,
'description' => false,
'pull' => 'right',
'actions' => [
[
'open_modal' => '/localTools/action/' . h($params['connection']['id']) . '/modifySettingAction?setting={{0}}',
'modal_params_data_path' => ['setting'],
'icon' => 'download',
'reload_url' => '/localTools/action/' . h($params['connection']['id']) . '/ServerSettingsAction'
] ]
] ]
],
'fields' => [
[
'name' => 'Setting',
'sort' => 'setting',
'data_path' => 'setting',
],
[
'name' => 'Criticality',
'sort' => 'level',
'data_path' => 'level',
'arrayData' => [
0 => 'Critical',
1 => 'Recommended',
2 => 'Optional'
],
'element' => 'array_lookup_field'
],
[
'name' => __('Value'),
'sort' => 'value',
'data_path' => 'value',
'options' => 'options'
],
[
'name' => __('Type'),
'sort' => 'type',
'data_path' => 'type',
],
[
'name' => __('Error message'),
'sort' => 'errorMessage',
'data_path' => 'errorMessage',
]
],
'title' => false,
'description' => false,
'pull' => 'right',
'actions' => [
[
'open_modal' => '/localTools/action/' . h($params['connection']['id']) . '/modifySettingAction?setting={{0}}',
'modal_params_data_path' => ['setting'],
'icon' => 'download',
'reload_url' => '/localTools/action/' . h($params['connection']['id']) . '/ServerSettingsAction'
]
] ]
]; ]
];
if (!empty($params['quickFilter'])) { if (!empty($params['quickFilter'])) {
$needle = strtolower($params['quickFilter']); $needle = strtolower($params['quickFilter']);
foreach ($finalSettings['data']['data'] as $k => $v) { foreach ($finalSettings['data']['data'] as $k => $v) {