diff --git a/src/.theme/font.fx.css b/src/.theme/font.fx.css index 055bc0a..4bbe6a7 100644 --- a/src/.theme/font.fx.css +++ b/src/.theme/font.fx.css @@ -1,19 +1,19 @@ @font-face { font-family: 'Open Sans'; - src: url('/.theme/font/OpenSans-Regular.ttf'); + src: url('./font/OpenSans-Regular.ttf'); } @font-face { font-family: 'Open Sans Italic'; - src: url('/.theme/font/OpenSans-Italic.ttf'); + src: url('./font/OpenSans-Italic.ttf'); } @font-face { - font-family: 'Open Sans Lighter'; - src: url('/.theme/font/OpenSans-Light.ttf'); + font-family: 'Open Sans Light'; + src: url('./font/OpenSans-Light.ttf'); } @font-face { font-family: 'Open Sans Bold'; - src: url('/.theme/font/OpenSans-Bold.ttf'); + src: url('./font/OpenSans-Bold.ttf'); } \ No newline at end of file diff --git a/src/.theme/style.fx.css b/src/.theme/style.fx.css index acb0f00..25535fc 100644 --- a/src/.theme/style.fx.css +++ b/src/.theme/style.fx.css @@ -13,6 +13,7 @@ * { -fx-font-family: 'Open Sans'; + -fx-font-smoothing-type: lcd; } .root { @@ -37,6 +38,7 @@ } .about .title { + -fx-font-family: 'Open Sans Light'; -fx-font-size: 26px; } diff --git a/src/app/FSTreeProvider.php b/src/app/FSTreeProvider.php index 79d3a8e..c03b92f 100644 --- a/src/app/FSTreeProvider.php +++ b/src/app/FSTreeProvider.php @@ -48,19 +48,31 @@ public function __construct (UXTreeItem $rootTreeItem) { public function setDirectory ($path) { $this->selectedDirectory = $path; - fs::scan($path, ['extensions' => ['zip'], 'callback' => function (File $file) { - $filePath = str::sub($file->getAbsoluteFile(), strlen($this->selectedDirectory) + 1); - $this->zipFiles[$file->getAbsoluteFile()] = new ZipFile($file); - $items = explode(File::DIRECTORY_SEPARATOR, $filePath); + app()->form("MainForm")->showPreloader(); + + $th = new Thread(function () { + $r = fs::scan($this->selectedDirectory, ['extensions' => ['zip'], 'callback' => function (File $file) { + $filePath = str::sub($file->getAbsoluteFile(), strlen($this->selectedDirectory) + 1); + $this->zipFiles[$file->getAbsoluteFile()] = new ZipFile($file); + $items = explode(File::DIRECTORY_SEPARATOR, $filePath); + + if ($file->isFile()) { + uiLater(function () use ($items, $filePath) { + $this->treeHelper->makeTree($this->rootItem, $items, function ($node, bool $isDir) use ($filePath) { + $this->applyIcon($node, ($isDir) ? FSTreeProvider::EMPTY_PATH_ELEMENT : $filePath); + }); + }); + } + }]); - if ($file->isFile()) { - $this->treeHelper->makeTree($this->rootItem, $items, function ($node, bool $isDir) use ($filePath) { - $this->applyIcon($node, ($isDir) ? FSTreeProvider::EMPTY_PATH_ELEMENT : $filePath); - }); - } - }]); + uiLater(function () { + $this->treeHelper->sort($this->rootItem); + app()->form("MainForm")->hidePreloader(); + }); + }); + $th->setDaemon(true); + $th->start(); - $this->treeHelper->sort($this->rootItem); } diff --git a/src/app/events/FSTreeEvents.php b/src/app/events/FSTreeEvents.php new file mode 100644 index 0000000..d62be77 --- /dev/null +++ b/src/app/events/FSTreeEvents.php @@ -0,0 +1,63 @@ +getForm()->fileInfoPanel->updateFilePath($path); + + $this->getForm()->fileInfoPanel->updateFileIcon($provider, $path); + $this->getForm()->updateFileinfo($provider, $path); + } + + public function onZipFileSystem (ZipFileSystem $provider, $zipPath, $path) + { + $this->getForm()->fileInfoPanel->updateFilePath($zipPath); + + $zipPath = $this->normalizeZipPath($provider, $zipPath); + + $this->getForm()->fileInfoPanel->updateFileIcon($provider, $zipPath); + + if ($provider->isFile($zipPath)) { + $provider->getZipInstance()->read($zipPath, function (array $stat, Stream $output) use ($zipPath) { + $this->getForm()->showMeta($stat); + + $ext = $this->getForm()->getHighlightType(fs::ext($zipPath)); + + if ($this->getForm()->findOperation($zipPath, $output, $ext) === false) { + $this->getForm()->showCodeInBrowser($output->readFully(), $ext); + } + }); + + $this->getForm()->updateFileinfo($provider, $zipPath); + } else if ($provider->isDirectory($zipPath)) { + $this->getForm()->fileInfoPanel->updateFileSize("unknown"); + } + } + + private function normalizeZipPath ($provider, $zipPath) + { + if (!$provider->getZipInstance()->has($zipPath)) { + $zipPath = str_replace('\\', '/', $zipPath); + + if (!$provider->getZipInstance()->has($zipPath)) { + $zipPath = str_replace('/', '\\', $zipPath); + } + } + + return $zipPath; + } + + /** + * @return MainForm + */ + private function getForm () + { + return app()->form("MainForm"); + } +} \ No newline at end of file diff --git a/src/app/events/MainMenuEvents.php b/src/app/events/MainMenuEvents.php index b9cc5c4..3c2db02 100644 --- a/src/app/events/MainMenuEvents.php +++ b/src/app/events/MainMenuEvents.php @@ -11,11 +11,11 @@ class MainMenuEvents { public function selectedFolder () { $dc = new UXDirectoryChooser(); - + if (($path = $dc->showDialog(app()->form("MainForm"))) == null) return; - + app()->form("MainForm")->projectDir = $path; - + try { app()->form("MainForm")->ini->set('ProjectDirectory', $path); $result = app()->form("MainForm")->ini->get('directoryList'); @@ -37,9 +37,9 @@ public function selectedFolder () { } catch (Exception $ex) { app()->form("MainForm")->errorAlert($ex); } - + app()->form("MainForm")->tree->root->children->clear(); - + try { app()->form("MainForm")->fsTree->setDirectory($path); } catch (Exception $ex) { @@ -80,7 +80,7 @@ public function changeTheme ($ev, $menu, $themeList) { public function about () { if (!($this->overlayContainer instanceof OverlayContainer)) { - $this->overlayContainer = new OverlayContainer(); + $this->overlayContainer = new BlurredOverlayContainer(); $this->overlayContainer->addContent(new AboutContainer()); app()->form("MainForm")->add($this->overlayContainer->getNode()); } diff --git a/src/app/forms/MainForm.fxml b/src/app/forms/MainForm.fxml index be1f71b..b322ba9 100644 --- a/src/app/forms/MainForm.fxml +++ b/src/app/forms/MainForm.fxml @@ -9,7 +9,7 @@ - + @@ -38,7 +38,7 @@ - + @@ -48,7 +48,7 @@ - + diff --git a/src/app/forms/MainForm.php b/src/app/forms/MainForm.php index a577e5a..b97282d 100644 --- a/src/app/forms/MainForm.php +++ b/src/app/forms/MainForm.php @@ -1,6 +1,7 @@ projectDir = $this->ini->get('ProjectDirectory'); - $this->leftCotainer->content->add(new SelectDirectoryCombobox()->getNode()); + $this->leftContainer->content->add(new SelectDirectoryCombobox()->getNode()); try { - $this->fsTree->onFileSystem(function (StandartFileSystem $provider, $path = null) { - $this->fileInfoPanel->updateFilePath($path); - - $this->fileInfoPanel->updateFileIcon($provider, $path); - $this->updateFileinfo($provider, $path); - }); - - $this->fsTree->onZipFileSystem(function (ZipFileSystem $provider, $zipPath, $path) { - $this->fileInfoPanel->updateFilePath($zipPath); - - if (!$provider->getZipInstance()->has($zipPath)) { - $zipPath = str_replace('\\', '/', $zipPath); - - if (!$provider->getZipInstance()->has($zipPath)) { - $zipPath = str_replace('/', '\\', $zipPath); - } - } - - $this->fileInfoPanel->updateFileIcon($provider, $zipPath); - - if ($provider->isFile($zipPath)) { - $provider->getZipInstance()->read($zipPath, function (array $stat, Stream $output) use ($zipPath) { - $this->showMeta($stat); - - $ext = $this->getHighlightType(fs::ext($zipPath)); - - if (fs::ext($zipPath) === 'fxml') { - $output = (string) $output; - $this->_showForm($output, $this->image); - $this->tabPane->selectedIndex = 1; - } else if ($ext == 'image') { - $this->image->image = new UXImage($output); - $output = "Binary"; - $this->tabPane->selectedIndex = 1; - } else { - switch (fs::ext($zipPath)) { - case 'zip': - case 'exe': - case 'jar': - case 'ttf': - $output = "Binary"; - } - - $this->tabPane->selectedIndex = 0; - } - - $this->showCodeInBrowser($output, $ext); - }); - - $this->updateFileinfo($provider, $zipPath); - } else if ($provider->isDirectory($zipPath)) { - $this->fileInfoPanel->updateFileSize("unknown"); - } - }); - + $treeEvents = new FSTreeEvents(); + $this->fsTree->onFileSystem([$treeEvents, 'onFileSystem']); + $this->fsTree->onZipFileSystem([$treeEvents, 'onZipFileSystem']); } catch (Exception $ex) { $this->errorAlert($ex); } - // splitter - $this->split = new UXSplitPane([$this->leftCotainer, $this->rightContainer]); - $this->split->position = [0, 0]; - $this->split->topAnchor = 25; - $this->split->bottomAnchor = true; - $this->split->rightAnchor = true; - $this->split->leftAnchor = true; + $this->makeSplitter(); $this->add($this->split); + UXSplitPane::setResizeWithParent($this->leftContainer, false); + - UXSplitPane::setResizeWithParent($this->leftCotainer, false); - // end spliter - - // задержка у браузера перед отрисовкой страницы слишком долгая, по этому таймер в 0.5 скунду чтобы не мелькало - timer::after(500, function () { $this->browser->show(); }); - - $this->showCodeInBrowser('', 'html'); - - // фикс мигания экрана если окно развернуто на весь екран и выбрана не светлая тема + // фикс мигания экрана если окно развернуто на весь экран и выбрана не светлая тема waitAsync(100, function () { if ($this->ini->get("maximized") == 1) { $this->maximized = true; @@ -224,7 +164,7 @@ function doTreeClickRight(UXMouseEvent $e = null) $contextRoot = new DirectoryContextMenu(); if ($this->fsTree->getFileByNode($this->tree->focusedItem) === false) { - // чтобы контексттоное меню не появлялось на директориях в архиве + // чтобы контекстное меню не появлялось на директориях в архиве if ($this->tree->focusedItem->children->count() == 0) { $context->showByNode($e); } @@ -257,6 +197,19 @@ function doClose(UXWindowEvent $e = null) $this->ini->set("splitter", $this->split->dividerPositions); } + /** + * @event show + */ + function doShow(UXWindowEvent $e = null) + { + // задержка у браузера перед отрисовкой страницы слишком долгая, по этому таймер в 0.5 скунду чтобы не мелькало + waitAsync(500, function () { + $this->browser->show(); + }); + + $this->showCodeInBrowser('', 'html'); + } + public function getHighlightType ($zipPath) { @@ -288,7 +241,7 @@ public function updateFileinfo ($provider, $path) { } - private function showCodeInBrowser ($output, $ext = 'config') { + public function showCodeInBrowser ($output, $ext = 'config') { $output = str_replace(['<', '>'], ['<', '>'], $output); $this->browser->engine->loadContent( str_replace(['${lang}', '${code}'], [$ext, $output], Stream::of('res://.data/web/highlight.html')) @@ -296,7 +249,7 @@ private function showCodeInBrowser ($output, $ext = 'config') { } - private function showMeta ($meta) { + public function showMeta ($meta) { $meta = $meta["size"]; $types = [Localization::get('ui.sidepanel.fileSizeFromat.b'), Localization::get('ui.sidepanel.fileSizeFromat.kb'), Localization::get('ui.sidepanel.fileSizeFromat.mb'), Localization::get('ui.sidepanel.fileSizeFromat.gb')]; @@ -304,4 +257,15 @@ private function showMeta ($meta) { $this->fileInfoPanel->updateFileSize(round($meta / pow(1024, $index), 2) . ' ' . $types[$index]); } + + private function makeSplitter () + { + $this->split = new UXSplitPane([$this->leftContainer, $this->rightContainer]); + $this->split->position = [0, 0]; + $this->split->topAnchor = 25; + $this->split->bottomAnchor = true; + $this->split->rightAnchor = true; + $this->split->leftAnchor = true; + } + } diff --git a/src/app/modules/AppModule.php b/src/app/modules/AppModule.php index 2709093..ff44868 100644 --- a/src/app/modules/AppModule.php +++ b/src/app/modules/AppModule.php @@ -45,6 +45,12 @@ function doAction(ScriptEvent $e = null) $theme = app()->module("MainModule")->ini->get("theme") ?: 'light'; // Чтобы форма не мелькала при ресайзе окна $form = $this->form("MainForm"); + + $form->registerOperation(FXMLOperation::class); + $form->registerOperation(UnsupportedFilesOperation::class); + $form->registerOperation(ImageOperation::class); + $form->registerOperation(FontOperation::class); + $form->minWidth = AppModule::WINDOW_MIN_WIDTH; $form->minHeight = AppModule::WINDOW_MIN_HEIGHT; $form->opacity = 0; diff --git a/src/app/operations/AbstractOperation.php b/src/app/operations/AbstractOperation.php new file mode 100644 index 0000000..75264b6 --- /dev/null +++ b/src/app/operations/AbstractOperation.php @@ -0,0 +1,24 @@ +output = $output; + } + + abstract public function forExt (); + + abstract public function action (); +} \ No newline at end of file diff --git a/src/app/operations/FXMLOperation.php b/src/app/operations/FXMLOperation.php new file mode 100644 index 0000000..a526e44 --- /dev/null +++ b/src/app/operations/FXMLOperation.php @@ -0,0 +1,45 @@ +output; + + app()->form("MainForm")->showCodeInBrowser($temp, 'xml'); + $this->_showForm($temp, app()->form("MainForm")->image); + } + + public function forExt () + { + return 'fxml'; + } + + private function _showForm ($formData, $outputImage) { + $n = new Environment(); + $n->importAutoLoaders(); + + $n->importClass(MainForm::class); + $n->importClass(MainModule::class); + $n->importClass(FXMLOperation::class); + + $n->execute(function () use ($formData, $outputImage) { + $layout = new UXLoader()->loadFromString($formData); + $form = new UXForm(); + // $form->show(); + $form->add($layout); + $outputImage->image = $form->layout->snapshot(); + }); + } +} \ No newline at end of file diff --git a/src/app/operations/FontOperation.php b/src/app/operations/FontOperation.php new file mode 100644 index 0000000..3ae6cf5 --- /dev/null +++ b/src/app/operations/FontOperation.php @@ -0,0 +1,73 @@ +output, 24); + + if ($font === null) { + app()->form("MainForm")->logger->console("Broken font file or not supported type", LoggerReporter::ERROR)->show(); + return; + } + + app()->form("MainForm")->image->mouseTransparent = true; + + $gc = app()->form("MainForm")->image->getGraphicsContext(); + $gc->clearRect(0, 0, app()->form("MainForm")->image->width, app()->form("MainForm")->image->height); + + $gc->font = $font; + + if (app()->form("MainForm")->data('theme') == 'dark' || app()->form("MainForm")->data('theme') == 'nord') { + $gc->fillColor = 'white'; + } else { + $gc->fillColor = 'black'; + } + + for ($i = a; $i < z; $i++) { + $text .= $i; + } + + $text .= "\n"; + + for ($i = A; $i < Z; $i++) { + $text .= $i; + } + + $text .= "\n"; + + for ($i = 0; $i < 9; $i++) { + $text .= $i; + } + + $abc = ["а", "б", "в", "г", "д", "е", "ё", "ж", "з", "и", "й", "к", "л", "м", "н", "о", "п", "р", "с", "т", "у", "ф", "х", "ц", "ч", "ш", "щ", "ъ", "ы", "ь", "э", "ю", "я"]; + + $text .= "\n"; + $text .= flow($abc)->toString(""); + + $text .= "\n"; + $text .= flow($abc)->map(function ($v) { + return str::upper($v); + })->toString(""); + + $gc->fillText($text, 10, 34); + $gc->fill(); + + } +} \ No newline at end of file diff --git a/src/app/operations/ImageOperation.php b/src/app/operations/ImageOperation.php new file mode 100644 index 0000000..60aae30 --- /dev/null +++ b/src/app/operations/ImageOperation.php @@ -0,0 +1,25 @@ +form("MainForm")->showCodeInBrowser("Binary data"); + app()->form("MainForm")->image->image = new UXImage($this->output); + } +} \ No newline at end of file diff --git a/src/app/operations/OpertaionTrait.php b/src/app/operations/OpertaionTrait.php new file mode 100644 index 0000000..bc12cc5 --- /dev/null +++ b/src/app/operations/OpertaionTrait.php @@ -0,0 +1,38 @@ +operationList[$class] = new $class(); + } + + public function findOperation ($zipPath, $output, $ext) + { + /** @var AbstractOperation $operation */ + foreach ($this->operationList as $operation) { + if (is_array($operation->forExt()) && in_array(fs::ext($zipPath), $operation->forExt())) { + return $this->triggerOperation ($operation, $output, $ext); + } else if (fs::ext($zipPath) == $operation->forExt()) { + return $this->triggerOperation ($operation, $output, $ext); + } else if ($operation->forExt() === $ext) { + return $this->triggerOperation ($operation, $output, $ext); + } + } + + return false; + } + + public function triggerOperation ($operation, $output, $ext) + { + $operation->setOutput($output); + $operation->action($ext); + $this->tabPane->selectedIndex = $operation->getActiveTab(); + } +} \ No newline at end of file diff --git a/src/app/operations/UnsupportedFilesOperation.php b/src/app/operations/UnsupportedFilesOperation.php new file mode 100644 index 0000000..dcfbc27 --- /dev/null +++ b/src/app/operations/UnsupportedFilesOperation.php @@ -0,0 +1,22 @@ +form("MainForm")->showCodeInBrowser("Binary data", $ext); + } +} \ No newline at end of file diff --git a/src/app/ui/overlayContainers/AboutContainer.php b/src/app/ui/overlayContainers/AboutContainer.php index 0218374..95851b6 100644 --- a/src/app/ui/overlayContainers/AboutContainer.php +++ b/src/app/ui/overlayContainers/AboutContainer.php @@ -1,6 +1,7 @@ container->spacing = 10; $this->container->classes->add('about'); + $shadow = new DropShadowEffectBehaviour(); + $shadow->offsetX = 0; + $shadow->offsetY = 2; + $shadow->radius = 2; + $shadow->color = '#000000'; + $shadow->apply($this->container); + $this->title = new UXLabelEx(AppModule::APP_TITLE); $this->title->width = $this->container->width; $this->title->alignment = 'CENTER'; diff --git a/src/app/ui/overlayContainers/BlurredOverlayContainer.php b/src/app/ui/overlayContainers/BlurredOverlayContainer.php new file mode 100644 index 0000000..de63d7c --- /dev/null +++ b/src/app/ui/overlayContainers/BlurredOverlayContainer.php @@ -0,0 +1,96 @@ +container = $this->makeAnchorPane(); + + $binder = new EventBinder($this->container); + $binder->bind("construct", function () { + $this->targetChildren = $this->container->parent->children->toArray(); + + foreach ($this->targetChildren as $key => $node) { + if ($node === $this->container) { + unset($this->targetChildren[$key]); + $this->blurredContainer->children->addAll($this->targetChildren); // фикс первого появления: не применяется размытие т.к. событие construct срабатывает позже чем вызов метода show + break; + } + } + }); + + $this->blurredContainer = $this->makeAnchorPane(); + $this->blurredContainer->mouseTransparent = true; + + $this->applyBlur($this->blurredContainer); + + $this->overlay = new UXHBox(); + $this->overlay->alignment = 'CENTER'; + $this->overlay->leftAnchor = $this->overlay->topAnchor = $this->overlay->rightAnchor = $this->overlay->bottomAnchor = 0; + $this->overlay->style= "-fx-background-color: " . $this->overlayBackground . ";"; + $this->overlay->on("click", function () { + $this->blurredContainer->children->clear(); + + try { + $this->container->parent->children->addAll($this->targetChildren); + } catch (Exception $ignore) {} + + $this->container->hide(); + }); + + $this->container->add($this->blurredContainer); + $this->container->add($this->overlay); + } + + public function addContent (AbstractNode $node) { + $this->overlay->add($node->getNode()); + } + + public function show () { + $this->container->show(); + $this->blurredContainer->children->addAll($this->targetChildren); + } + + + /** + * @return UXAnchorPane + */ + private function makeAnchorPane () { + $pane = new UXAnchorPane(); + $pane->leftAnchor = $pane->topAnchor = $pane->rightAnchor = $pane->bottomAnchor = 0; + + return $pane; + } + + private function applyBlur ($container) { + $blur = new GaussianBlurEffectBehaviour(); + $blur->radius = $this->blurRadius; + $blur->apply($container); + } +} \ No newline at end of file diff --git a/src/app/ui/overlayContainers/OverlayContainer.php b/src/app/ui/overlayContainers/OverlayContainer.php index dd333b7..f4993e5 100644 --- a/src/app/ui/overlayContainers/OverlayContainer.php +++ b/src/app/ui/overlayContainers/OverlayContainer.php @@ -6,6 +6,8 @@ class OverlayContainer extends AbstractNode { + protected $overlayBackground = '#000010cF'; + protected function make () { $this->container = new UXHBox(); $this->container->alignment = 'CENTER'; @@ -13,7 +15,7 @@ protected function make () { $this->container->rightAnchor = 0; $this->container->topAnchor = 0; $this->container->bottomAnchor = 0; - $this->container->style = "-fx-background-color: #000010cF;"; + $this->container->style = "-fx-background-color: " . $this->overlayBackground . ";"; $this->container->on("click", function () { $this->container->hide(); }); diff --git a/src/app/util/LoggerReporter/LoggerReporter.php b/src/app/util/LoggerReporter/LoggerReporter.php index 068a03a..f465846 100644 --- a/src/app/util/LoggerReporter/LoggerReporter.php +++ b/src/app/util/LoggerReporter/LoggerReporter.php @@ -28,12 +28,11 @@ public function __construct() "discord" => new MessageDiscord() ]; - $this->instances["discord"]->updateApiKey(LoggerReporter::INFO, "817425028555210762/2wmTRtl_DAxp7Vn5DV4elnkUtVEBXvSLPEe_vfqid5HivgreHQIJnljUHJ6mfjC3eQnB"); - $this->instances["discord"]->updateApiKey(LoggerReporter::ERROR, "792539671787864064/dSSQtqIT92pibneJwHW6sbca95ZSk3MU8xasR3hALzpnzW_Oo4WxldakZuljwM9EGJyE"); - $this->instances["discord"]->updateApiKey(LoggerReporter::WARNING, "792539671787864064/dSSQtqIT92pibneJwHW6sbca95ZSk3MU8xasR3hALzpnzW_Oo4WxldakZuljwM9EGJyE"); + $this->instances["discord"]->updateApiKey(LoggerReporter::INFO, "1244606300327772240/Y2j908292-QtxKJZRfOghKLz17TTmzfBkIU7ixTGdwRgrtuOLIubdBF3cWTfOAvZGcJt"); + $this->instances["discord"]->updateApiKey(LoggerReporter::ERROR, "1242749474892419092/KZA7cCGu8SNN7BE-vf0XCX_zbT-9kD_fJWVdiKmUXOisDpAvNEtv3OFla0ea-oIvRFAC"); + $this->instances["discord"]->updateApiKey(LoggerReporter::WARNING, "1242749474892419092/KZA7cCGu8SNN7BE-vf0XCX_zbT-9kD_fJWVdiKmUXOisDpAvNEtv3OFla0ea-oIvRFAC"); } - /** * @param $message * @param int $level diff --git a/src/app/util/LoggerReporter/module/MessageDiscord.php b/src/app/util/LoggerReporter/module/MessageDiscord.php index 5ebb6d7..b7339ff 100644 --- a/src/app/util/LoggerReporter/module/MessageDiscord.php +++ b/src/app/util/LoggerReporter/module/MessageDiscord.php @@ -49,7 +49,9 @@ public function send() $this->http->postAsync($this->baseUrl . $this->apiKeys[$this->level], [ "content" => $messageBody, "username" => "App reporter v" . AppModule::APP_VERSION - ]); + ], function ($response) { + $this->onResponse($response); + }); } @@ -65,6 +67,13 @@ public function attachFile(File $logFile) "content" => $messageBody, "username" => "App reporter v" . AppModule::APP_VERSION, "files" => $logFile - ]); + ], function ($response) { + $this->onResponse($response); + }); + } + + public function onResponse (HttpResponse $resposne) { + if (($resposne = $resposne->body()) == null) return; + app()->form("MainForm")->logger->console($resposne, LoggerReporter::ERROR); } } \ No newline at end of file