mirror of https://github.com/MISP/MISP
add search bar, fix col widths, show ref field as links
parent
137983abbd
commit
99cd8d8b61
|
@ -16,6 +16,7 @@ class NoticelistsController extends AppController
|
|||
public function index()
|
||||
{
|
||||
$this->CRUD->index([
|
||||
'quickFilters' => ['name', 'expanded_name'],
|
||||
'afterFind' => function (array $noticelists) {
|
||||
foreach ($noticelists as &$noticelist) {
|
||||
$noticelist['Noticelist']['ref'] = json_decode($noticelist['Noticelist']['ref']);
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
<?php
|
||||
|
||||
$links = Hash::extract($data, $field['path']);
|
||||
|
||||
foreach ($links as &$link) {
|
||||
$link = sprintf(
|
||||
'<a href="%s">%s</a>',
|
||||
h($link),
|
||||
$link
|
||||
);
|
||||
}
|
||||
|
||||
echo implode('<br />', $links);
|
|
@ -18,7 +18,7 @@ $fields = [
|
|||
[
|
||||
'name' => __('ref'),
|
||||
'data_path' => 'Noticelist.ref',
|
||||
'element' => 'list'
|
||||
'element' => 'links'
|
||||
],
|
||||
[
|
||||
'name' => __('geographical_area'),
|
||||
|
@ -51,6 +51,17 @@ echo $this->element('genericElements/IndexTable/scaffold', [
|
|||
'scaffold_data' => [
|
||||
'data' => [
|
||||
'data' => $data,
|
||||
'top_bar' => [
|
||||
'pull' => 'right',
|
||||
'children' => [
|
||||
[
|
||||
'type' => 'search',
|
||||
'button' => __('Filter'),
|
||||
'placeholder' => __('Enter value to search'),
|
||||
'searchKey' => 'quickFilter',
|
||||
]
|
||||
]
|
||||
],
|
||||
'fields' => $fields,
|
||||
'title' => empty($ajax) ? __('Noticelists') : false,
|
||||
'actions' => [
|
||||
|
|
|
@ -3,12 +3,12 @@ $fields = [
|
|||
[
|
||||
'name' => __('Scope'),
|
||||
'data_path' => 'data.scope',
|
||||
'class' => 'shortish'
|
||||
'class' => 'short'
|
||||
],
|
||||
[
|
||||
'name' => __('Field'),
|
||||
'data_path' => 'data.field',
|
||||
'class' => 'shortish'
|
||||
'class' => 'short'
|
||||
],
|
||||
[
|
||||
'name' => __('Value'),
|
||||
|
|
|
@ -24,6 +24,7 @@ echo $this->element(
|
|||
[
|
||||
'key' => __('Ref'),
|
||||
'path' => 'Noticelist.ref',
|
||||
'type' => 'links',
|
||||
],
|
||||
[
|
||||
'key' => __('Geographical Area'),
|
||||
|
|
Loading…
Reference in New Issue