fix img. minification action

This commit is contained in:
Dennis Eichhorn 2022-04-04 19:13:18 +02:00
parent 12c6144c59
commit ba5217dda4
6 changed files with 177 additions and 1 deletions

View File

@ -19,6 +19,6 @@ jobs:
uses: actions/checkout@master
- name: Compress Images
uses: calibreapp/image-actions@master
uses: calibreapp/image-actions@main
with:
githubToken: ${{ secrets.GITHUB_TOKEN }}

View File

@ -149,4 +149,15 @@ return [
],
],
],
'^.*/admin/module/hook/list\?.*$' => [
[
'dest' => '\Modules\Admin\Controller\BackendController:viewModuleHookList',
'verb' => RouteVerb::GET,
'permission' => [
'module' => BackendController::NAME,
'type' => PermissionType::READ,
'state' => PermissionCategory::MODULE,
],
],
],
];

View File

@ -442,6 +442,47 @@ final class BackendController extends Controller
return $view;
}
/**
* Method which generates the module profile view.
*
* @param RequestAbstract $request Request
* @param ResponseAbstract $response Response
* @param mixed $data Generic data
*
* @return RenderableInterface Response can be rendered
*
* @since 1.0.0
*/
public function viewModuleHookList(RequestAbstract $request, ResponseAbstract $response, $data = null) : RenderableInterface
{
$view = new View($this->app->l11nManager, $request, $response);
$view->setTemplate('/Modules/Admin/Theme/Backend/modules-hook-list');
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1000105001, $request, $response));
$module = $request->getData('id') ?? '';
$view->setData('module', $module);
$appPath = __DIR__ . '/../../../Web';
$activeHooks = [];
$apps = \scandir($appPath);
if ($apps === false) {
$apps = [];
}
foreach ($apps as $app) {
if (!\is_file(__DIR__ . '/../../../Web/' . $app . '/Hooks.php')) {
continue;
}
$activeHooks[$app] = include __DIR__ . '/../../../Web/' . $app . '/Hooks.php';
}
$view->setData('hooks', $activeHooks);
return $view;
}
/**
* Method which generates the module profile view.
*

View File

@ -162,6 +162,7 @@ return ['Admin' => [
'Uppercase' => 'Uppercase',
'Username' => 'Username',
'Value' => 'Value',
'Verb' => 'Verb',
'Version' => 'Version',
'VeryFast' => 'Very Fast',
'VeryHeavy' => 'Very Heavy',

View File

@ -0,0 +1,109 @@
<?php
/**
* Karaka
*
* PHP Version 8.0
*
* @package Modules\Admin\Template\Backend
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://karaka.app
*/
declare(strict_types=1);
use phpOMS\Message\Http\HttpHeader;
use phpOMS\Router\RouteVerb;
/**
* @var \phpOMS\Views\View $this
*/
$hooks = $this->getData('hooks') ?? [];
$module = $this->getData('module') ?? '';
echo $this->getData('nav')->render();
?>
<div class="row">
<div class="col-xs-12">
<div class="portlet">
<div class="portlet-head"><?= $this->getHtml('Hooks'); ?><i class="fa fa-download floatRight download btn"></i></div>
<div class="slider">
<table id="navElements" class="default sticky">
<thead>
<tr>
<td><?= $this->getHtml('Active'); ?>
<td><?= $this->getHtml('App'); ?>
<label for="navElements-sort-1">
<input type="radio" name="navElements-sort" id="navElements-sort-1">
<i class="sort-asc fa fa-chevron-up"></i>
</label>
<label for="navElements-sort-2">
<input type="radio" name="navElements-sort" id="navElements-sort-2">
<i class="sort-desc fa fa-chevron-down"></i>
</label>
<label>
<i class="filter fa fa-filter"></i>
</label>
<td><?= $this->getHtml('Verb'); ?>
<label for="navElements-sort-3">
<input type="radio" name="navElements-sort" id="navElements-sort-3">
<i class="sort-asc fa fa-chevron-up"></i>
</label>
<label for="navElements-sort-4">
<input type="radio" name="navElements-sort" id="navElements-sort-4">
<i class="sort-desc fa fa-chevron-down"></i>
</label>
<label>
<i class="filter fa fa-filter"></i>
</label>
<td><?= $this->getHtml('Route'); ?>
<label for="navElements-sort-5">
<input type="radio" name="navElements-sort" id="navElements-sort-5">
<i class="sort-asc fa fa-chevron-up"></i>
</label>
<label for="navElements-sort-6">
<input type="radio" name="navElements-sort" id="navElements-sort-6">
<i class="sort-desc fa fa-chevron-down"></i>
</label>
<label>
<i class="filter fa fa-filter"></i>
</label>
<td><?= $this->getHtml('Destination'); ?>
<label for="navElements-sort-7">
<input type="radio" name="navElements-sort" id="navElements-sort-7">
<i class="sort-asc fa fa-chevron-up"></i>
</label>
<label for="navElements-sort-8">
<input type="radio" name="navElements-sort" id="navElements-sort-8">
<i class="sort-desc fa fa-chevron-down"></i>
</label>
<label>
<i class="filter fa fa-filter"></i>
</label>
</thead>
<tbody>
<?php $c = 0;
foreach ($hooks as $app => $appHooks) :
foreach ($appHooks as $uri => $destinations) :
foreach ($destinations as $route) :
if (\stripos($route['dest'], '\Modules\\' . $module . '\Controller') === false) {
continue;
}
++$c;
?>
<tr>
<td><label class="checkbox" for="iActive-<?= $c ?>">
<input id="iActive-<?= $c ?>" type="checkbox" name="active_route" value="<?= $this->printHtml($uri); ?>"<?= true ? ' checked' : ''; ?>>
<span class="checkmark"></span>
</label>
<td><?= $app; ?>
<td><?= RouteVerb::getName((string) $route['verb']); ?>
<td><?= $uri; ?>
<td><?= $route['dest']; ?>
<?php endforeach; endforeach; endforeach; ?>
</table>
</div>
</div>
</div>

View File

@ -13,6 +13,7 @@
declare(strict_types=1);
use phpOMS\Message\Http\HttpHeader;
use phpOMS\Router\RouteVerb;
/**
* @var \phpOMS\Views\View $this
@ -44,6 +45,18 @@ echo $this->getData('nav')->render();
<label>
<i class="filter fa fa-filter"></i>
</label>
<td><?= $this->getHtml('Verb'); ?>
<label for="navElements-sort-3">
<input type="radio" name="navElements-sort" id="navElements-sort-3">
<i class="sort-asc fa fa-chevron-up"></i>
</label>
<label for="navElements-sort-4">
<input type="radio" name="navElements-sort" id="navElements-sort-4">
<i class="sort-desc fa fa-chevron-down"></i>
</label>
<label>
<i class="filter fa fa-filter"></i>
</label>
<td><?= $this->getHtml('Route'); ?>
<label for="navElements-sort-5">
<input type="radio" name="navElements-sort" id="navElements-sort-5">
@ -86,6 +99,7 @@ echo $this->getData('nav')->render();
<span class="checkmark"></span>
</label>
<td><?= $app; ?>
<td><?= RouteVerb::getName((string) $route['verb']); ?>
<td><?= $uri; ?>
<td><?= $route['dest']; ?>
<?php endforeach; endforeach; endforeach; ?>