new: [localtools] templates added

connector
iglocska 2021-06-01 07:45:58 +02:00
parent 3806831633
commit cc31a22527
No known key found for this signature in database
GPG Key ID: BEA224F1FEF113AC
4 changed files with 120 additions and 2 deletions

View File

@ -12,14 +12,23 @@
'options' => $dropdownData['connectors'],
'type' => 'dropdown'
],
[
'field' => 'exposed',
'type' => 'checkbox'
],
[
'field' => 'settings',
'type' => 'textarea'
]
],
[
'field' => 'description',
'type' => 'textarea'
],
],
'submit' => [
'action' => $this->request->getParam('action')
]
],
'url' => empty($redirect) ? null : $redirect
]
]);
?>

View File

@ -0,0 +1,49 @@
<?php
echo $this->element('genericElements/IndexTable/index_table', [
'data' => [
'data' => $data,
'top_bar' => [
'children' => [
[
'type' => 'search',
'button' => __('Filter'),
'placeholder' => __('Enter value to search'),
'data' => '',
'searchKey' => 'value'
]
]
],
'fields' => [
[
'name' => __('Id'),
'data_path' => 'id',
],
[
'name' => __('Name'),
'data_path' => 'name',
],
[
'name' => 'Connector',
'data_path' => 'connector'
],
[
'name' => __('Description'),
'data_path' => 'description',
]
],
'title' => __('Local tools made available by the remote Cerebrate'),
'description' => __('Cerebrate can connect to local tools via individual connectors and administrators can choose to expose a subset of their tools to other members of their Cerebrate in order for their peers to be able to issue interconnection requests. '),
'pull' => 'right',
'skip_pagination' => 1,
'actions' => [
[
'url' => '/localTools/connectionRequest',
'url_params_data_paths' => ['id'],
'title' => 'Issue a connection request',
'icon' => 'plug'
]
]
]
]);
echo '</div>';
?>

View File

@ -29,12 +29,21 @@ echo $this->element('genericElements/IndexTable/index_table', [
'sort' => 'connector',
'data_path' => 'connector',
],
[
'name' => 'Exposed',
'data_path' => 'exposed',
'element' => 'boolean'
],
[
'name' => 'settings',
'data_path' => 'settings',
'isJson' => 1,
'element' => 'array'
],
[
'name' => 'description',
'data_path' => 'description'
],
[
'name' => 'health',
'data_path' => 'health',

View File

@ -0,0 +1,51 @@
<?php
$children = [];
if (!empty($entity['children'])) {
foreach ($entity['children'] as $child) {
$children[] = [
'url' => '/LocalTools/action/{{0}}/' . $child,
'url_params' => ['id'],
'title' => \Cake\Utility\Inflector::humanize(substr($child, 0, -6))
];
}
}
echo $this->element(
'/genericElements/SingleViews/single_view',
[
'data' => $entity,
'title' => sprintf(
'%s control panel using %s',
h($entity->name),
h($entity->connector)
),
'fields' => [
[
'key' => __('ID'),
'path' => 'id'
],
[
'key' => __('Name'),
'path' => 'name'
],
[
'key' => __('Connector'),
'path' => 'connector'
],
[
'key' => __('Exposed'),
'path' => 'exposed',
'type' => 'boolean'
],
[
'key' => __('settings'),
'path' => 'settings',
'type' => 'json'
],
[
'key' => __('Description'),
'path' => 'description'
]
],
'children' => $children
]
);