new: [topology improvements] added acl, menu access, downloader

refacto/CRUDComponent
iglocska 2023-10-05 12:37:12 +02:00
parent 58f75e44c1
commit 49d4c959aa
No known key found for this signature in database
GPG Key ID: BEA224F1FEF113AC
3 changed files with 18 additions and 1 deletions

View File

@ -107,6 +107,7 @@ class ACLComponent extends Component
'viewTags' => ['*']
],
'Instance' => [
'downloadTopology' => ['perm_admin'],
'home' => ['*'],
'migrate' => ['perm_admin'],
'migrationIndex' => ['perm_admin'],
@ -114,7 +115,8 @@ class ACLComponent extends Component
'saveSetting' => ['perm_admin'],
'searchAll' => ['*'],
'settings' => ['perm_admin'],
'status' => ['*']
'status' => ['*'],
'topology' => ['perm_admin'],
],
'LocalTools' => [
'action' => ['perm_admin'],

View File

@ -113,6 +113,11 @@ class Sidemenu {
'label' => __('Instance'),
'icon' => $this->iconTable['Instance'],
'children' => [
'Topology' => [
'label' => __('Topology'),
'url' => '/instance/topology',
'icon' => 'project-diagram',
],
'Settings' => [
'label' => __('Settings'),
'url' => '/instance/settings',

View File

@ -188,4 +188,14 @@ class InstanceController extends AppController
$this->set('description', __('A list of all instances and local tools connected .'));
$this->set('data', $this->Instance->getTopology());
}
public function downloadTopology()
{
$topologyMd = $this->Instance->getTopology();
$response = $this->response;
$response = $response->withStringBody($topologyMd);
$response = $response->withType('text/markdown');
$response = $response->withDownload('topology.md');
return $response;
}
}