diff --git a/templates/LocalTools/add.php b/templates/LocalTools/add.php index 10cefb6..702e659 100644 --- a/templates/LocalTools/add.php +++ b/templates/LocalTools/add.php @@ -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 ] ]); ?> diff --git a/templates/LocalTools/brood_tools.php b/templates/LocalTools/brood_tools.php new file mode 100644 index 0000000..ae41159 --- /dev/null +++ b/templates/LocalTools/brood_tools.php @@ -0,0 +1,49 @@ +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 ''; +?> diff --git a/templates/LocalTools/connector_index.php b/templates/LocalTools/connector_index.php index 06c8560..8a2bf4e 100644 --- a/templates/LocalTools/connector_index.php +++ b/templates/LocalTools/connector_index.php @@ -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', diff --git a/templates/LocalTools/view.php b/templates/LocalTools/view.php index e69de29..7a523f9 100644 --- a/templates/LocalTools/view.php +++ b/templates/LocalTools/view.php @@ -0,0 +1,51 @@ + '/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 + ] + );