diff --git a/Admin/Install/Navigation.install.json b/Admin/Install/Navigation.install.json index 53ea9fd..b1d199a 100644 --- a/Admin/Install/Navigation.install.json +++ b/Admin/Install/Navigation.install.json @@ -34,7 +34,7 @@ "type": 3, "subtype": 1, "name": "Import", - "uri": "/{/lang}/backend/admin/exchange/import?{?}", + "uri": "/{/lang}/backend/admin/exchange/import/list?{?}", "target": "self", "icon": null, "order": 5, @@ -49,7 +49,7 @@ "type": 3, "subtype": 1, "name": "Export", - "uri": "/{/lang}/backend/admin/exchange/export?{?}", + "uri": "/{/lang}/backend/admin/exchange/export/list?{?}", "target": "self", "icon": null, "order": 10, @@ -57,21 +57,6 @@ "permission": { "type": null, "element": null }, "parent": 1007001001, "children": [] - }, - { - "id": 1007002004, - "pid": "/backend/admin/exchange", - "type": 3, - "subtype": 1, - "name": "Setup", - "uri": "/{/lang}/backend/admin/exchange/setup?{?}", - "target": "self", - "icon": null, - "order": 15, - "from": "Exchange", - "permission": { "type": null, "element": null }, - "parent": 1007001001, - "children": [] } ] } diff --git a/Admin/Routes/Web/Backend.php b/Admin/Routes/Web/Backend.php index 92d4125..5a507de 100644 --- a/Admin/Routes/Web/Backend.php +++ b/Admin/Routes/Web/Backend.php @@ -3,13 +3,25 @@ use phpOMS\Router\RouteVerb; return [ - '^.*/backend/admin/exchange/import.*$' => [ + '^.*/backend/admin/exchange/import/list.*$' => [ + [ + 'dest' => '\Modules\Exchange\Controller:viewExchangeImportList', + 'verb' => RouteVerb::GET, + ], + ], + '^.*/backend/admin/exchange/export/list.*$' => [ + [ + 'dest' => '\Modules\Exchange\Controller:viewExchangeExportList', + 'verb' => RouteVerb::GET, + ], + ], + '^.*/backend/admin/exchange/import/profile.*$' => [ [ 'dest' => '\Modules\Exchange\Controller:viewExchangeImport', 'verb' => RouteVerb::GET, ], ], - '^.*/backend/admin/exchange/export.*$' => [ + '^.*/backend/admin/exchange/export/profile.*$' => [ [ 'dest' => '\Modules\Exchange\Controller:viewExchangeExport', 'verb' => RouteVerb::GET, @@ -21,10 +33,4 @@ return [ 'verb' => RouteVerb::GET, ], ], - '^.*/backend/admin/exchange/setup.*$' => [ - [ - 'dest' => '\Modules\Exchange\Controller:viewExchangeSetup', - 'verb' => RouteVerb::GET, - ], - ], ]; diff --git a/Controller.php b/Controller.php index dce18b4..ccc4a42 100644 --- a/Controller.php +++ b/Controller.php @@ -82,4 +82,49 @@ final class Controller extends ModuleAbstract implements WebInterface */ protected static $dependencies = [ ]; + + public function viewExchangeDashboard(RequestAbstract $request, ResponseAbstract $response, $data = null) : \Serializable + { + $view = new View($this->app, $request, $response); + $view->setTemplate('/Modules/Exchange/Theme/Backend/exchange-dashboard'); + $view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1007001001, $request, $response)); + + return $view; + } + + public function viewExchangeExportList(RequestAbstract $request, ResponseAbstract $response, $data = null) : \Serializable + { + $view = new View($this->app, $request, $response); + $view->setTemplate('/Modules/Exchange/Theme/Backend/exchange-export-list'); + $view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1007001001, $request, $response)); + + return $view; + } + + public function viewExchangeImportList(RequestAbstract $request, ResponseAbstract $response, $data = null) : \Serializable + { + $view = new View($this->app, $request, $response); + $view->setTemplate('/Modules/Exchange/Theme/Backend/exchange-import-list'); + $view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1007001001, $request, $response)); + + return $view; + } + + public function viewExchangeExport(RequestAbstract $request, ResponseAbstract $response, $data = null) : \Serializable + { + $view = new View($this->app, $request, $response); + $view->setTemplate('/Modules/Exchange/Theme/Backend/exchange-export'); + $view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1007001001, $request, $response)); + + return $view; + } + + public function viewExchangeImport(RequestAbstract $request, ResponseAbstract $response, $data = null) : \Serializable + { + $view = new View($this->app, $request, $response); + $view->setTemplate('/Modules/Exchange/Theme/Backend/exchange-import'); + $view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1007001001, $request, $response)); + + return $view; + } } diff --git a/Theme/Backend/Lang/Navigation.en.lang.php b/Theme/Backend/Lang/Navigation.en.lang.php index 224c035..cd6ae5c 100644 --- a/Theme/Backend/Lang/Navigation.en.lang.php +++ b/Theme/Backend/Lang/Navigation.en.lang.php @@ -15,5 +15,4 @@ return ['Navigation' => [ 'Exchange' => 'Exchange', 'Export' => 'Export', 'Import' => 'Import', - 'Setup' => 'Setup', ]]; diff --git a/Theme/Backend/exchange-dashboard.tpl.php b/Theme/Backend/exchange-dashboard.tpl.php index 7381814..012ddfa 100644 --- a/Theme/Backend/exchange-dashboard.tpl.php +++ b/Theme/Backend/exchange-dashboard.tpl.php @@ -10,61 +10,8 @@ * @version 1.0.0 * @link http://website.orange-management.de */ -$logs = $this->app->logger->countLogs(); -$penetrators = $this->app->logger->getHighestPerpetrator(); +/** + * @var \phpOMS\Views\View $this + */ echo $this->getData('nav')->render(); ?> - -
-
-
-

getHtml('System'); ?>

-
- - -
getHtml('OS'); ?>printHtml(php_uname('s')); ?> -
getHtml('Version'); ?>printHtml(php_uname('v')); ?> -
getHtml('Release'); ?>printHtml(php_uname('r')); ?> -
getHtml('RAMUsage'); ?>printHtml(memory_get_usage(true)/(1024*1024)); ?> MB -
getHtml('MemoryLimit'); ?>printHtml(ini_get('memory_limit')); ?> -
getHtml('SystemRAM'); ?>printHtml(\phpOMS\System\SystemUtils::getRAM()/(1024)); ?> MB -
getHtml('CPUUsage'); ?>printHtml(\phpOMS\System\SystemUtils::getCpuUsage()); ?>% -
-
-
-
- -
-
-

getHtml('Logs'); ?>

-
- - -
getHtml('Emergencies'); ?>printHtml($logs['emergency'] ?? 0); ?> -
getHtml('Criticals'); ?>printHtml($logs['critical'] ?? 0); ?> -
getHtml('Errors'); ?>printHtml($logs['error'] ?? 0); ?> -
getHtml('Warnings'); ?>printHtml($logs['warning'] ?? 0); ?> -
getHtml('Alerts'); ?>printHtml($logs['alert'] ?? 0); ?> -
getHtml('Notices'); ?>printHtml($logs['notice'] ?? 0); ?> -
getHtml('Info'); ?>printHtml($logs['info'] ?? 0); ?> -
getHtml('Debug'); ?>printHtml($logs['debug'] ?? 0); ?> -
getHtml('Total'); ?>printHtml(array_sum($logs)); ?> -
-
-
-
- -
-
-

getHtml('Penetrators'); ?>

-
- - - $count) : ?> -
printHtml($ip); ?>printHtml($count); ?> - -
-
-
-
-
diff --git a/Theme/Backend/exchange-export-list.tpl.php b/Theme/Backend/exchange-export-list.tpl.php new file mode 100644 index 0000000..012ddfa --- /dev/null +++ b/Theme/Backend/exchange-export-list.tpl.php @@ -0,0 +1,17 @@ +getData('nav')->render(); ?> diff --git a/Theme/Backend/exchange-export.tpl.php b/Theme/Backend/exchange-export.tpl.php new file mode 100644 index 0000000..6450588 --- /dev/null +++ b/Theme/Backend/exchange-export.tpl.php @@ -0,0 +1,17 @@ +getData('nav')->render(); ?> diff --git a/Theme/Backend/exchange-import-list.tpl.php b/Theme/Backend/exchange-import-list.tpl.php new file mode 100644 index 0000000..012ddfa --- /dev/null +++ b/Theme/Backend/exchange-import-list.tpl.php @@ -0,0 +1,17 @@ +getData('nav')->render(); ?> diff --git a/Theme/Backend/exchange-import.tpl.php b/Theme/Backend/exchange-import.tpl.php new file mode 100644 index 0000000..6450588 --- /dev/null +++ b/Theme/Backend/exchange-import.tpl.php @@ -0,0 +1,17 @@ +getData('nav')->render(); ?> diff --git a/Theme/Backend/export.tpl.php b/Theme/Backend/export.tpl.php deleted file mode 100644 index ad7dcb5..0000000 --- a/Theme/Backend/export.tpl.php +++ /dev/null @@ -1,92 +0,0 @@ -app->logger->getByLine((int) $this->request->getData('id') ?? 1); -$temp = trim($log['backtrace']); -$log['backtrace'] = json_decode($temp, true); - -$details = '* Uri: `' . trim($log['path']) . "`\n" - . '* Level: `' . trim($log['level']) . "`\n" - . '* Message: `' . trim($log['message']) . "`\n" - . '* File: `' . trim($log['file']) . "`\n" - . '* Line: `' . trim($log['line']) . "`\n" - . '* Version: `' . trim($log['version']) . "`\n" - . '* OS: `' . trim($log['os']) . "`\n\n" - . "Backtrace: \n\n```\n" . json_encode($log['backtrace'], JSON_PRETTY_PRINT); - -echo $this->getData('nav')->render(); ?> - -
-
-
-

getHtml('Logs') ?>

- -
- - - - - - - - - - - - - - -
getHtml('ID', 0, 0); ?> - - printHtml((int) $this->request->getData('id') ?? 0); ?> -
getHtml('Time') ?> - - printHtml($log['datetime']); ?> -
getHtml('Uri') ?> - - printHtml($log['path']); ?> -
getHtml('Source') ?> - - printHtml($log['ip']); ?> -
getHtml('Level') ?> - - - printHtml($log['level']); ?> -
getHtml('Message') ?> - - printHtml($log['message']); ?> -
getHtml('File') ?> - - printHtml($log['file']); ?> -
getHtml('Line') ?> - - printHtml($log['line']); ?> -
getHtml('Version') ?> - - printHtml($log['version']); ?> -
getHtml('OS') ?> - - printHtml($log['os']); ?> -
getHtml('Backtrace') ?> -
-
printHtml(json_encode($log['backtrace'], JSON_PRETTY_PRINT)); ?>
-
getHtml('Report') ?> -
-
-
-
-
diff --git a/Theme/Backend/import.tpl.php b/Theme/Backend/import.tpl.php deleted file mode 100644 index 512ee17..0000000 --- a/Theme/Backend/import.tpl.php +++ /dev/null @@ -1,48 +0,0 @@ -app->logger->get(25), true); - -echo $this->getData('nav')->render(); ?> - -
-
- - - - - - - - $value) : - $url = \phpOMS\Uri\UriFactory::build('/{/lang}/backend/admin/monitoring/logs/single?{?}&id=' . $key);?> - - -
getHtml('Logs') ?>
getHtml('Timestamp') ?> - getHtml('Level') ?> - getHtml('Source') ?> - getHtml('Message') ?> -
-
printHtml($url); ?>> printHtml($value[0] ?? ''); ?> - printHtml($url); ?>> printHtml($value[1] ?? ''); ?> - printHtml($url); ?>> printHtml($value[2] ?? ''); ?> - printHtml($url); ?>> printHtml($value[7] ?? ''); ?> - -
- -
-
-