implement php backend

This commit is contained in:
Dennis Eichhorn 2023-01-07 18:59:09 +01:00
parent b78eb6c942
commit 050f5a04c5
36 changed files with 863 additions and 1513 deletions

1
.gitignore vendored
View File

@ -1,5 +1,6 @@
.vs
obj/
/Files/
app/server/build/*.txt
app/server/build/*.cmake
CMakeFiles

View File

@ -5,21 +5,21 @@
"type": 2,
"subtype": 1,
"name": "OnlineResourceWatcher",
"uri": "{/lang}/{/app}/orw/dashboard?u={?u}",
"uri": "{/lang}/{/app}/orw/resource/list?u={?u}",
"target": "self",
"icon": null,
"order": 40,
"from": "OnlineResourceWatcher",
"permission": { "permission": 2, "category": null, "element": null },
"parent": 1006901001,
"parent": 1003301001,
"children": [
{
"id": 1008002001,
"pid": "/orw",
"type": 3,
"subtype": 1,
"name": "OnlineResourceWatcher",
"uri": "{/lang}/{/app}/orw/dashboard?u={?u}",
"name": "Resources",
"uri": "{/lang}/{/app}/orw/resource/list?u={?u}",
"target": "self",
"icon": null,
"order": 1,
@ -27,66 +27,6 @@
"permission": { "permission": 2, "category": null, "element": null },
"parent": 1008001001,
"children": []
},
{
"id": 1008003001,
"pid": "/orw",
"type": 3,
"subtype": 1,
"name": "Archive",
"uri": "{/lang}/{/app}/orw/archive?u={?u}",
"target": "self",
"icon": null,
"order": 5,
"from": "OnlineResourceWatcher",
"permission": { "permission": 2, "category": null, "element": null },
"parent": 1008001001,
"children": []
},
{
"id": 1008004001,
"pid": "/orw",
"type": 3,
"subtype": 1,
"name": "Create",
"uri": "{/lang}/{/app}/orw/create?{?}",
"target": "self",
"icon": null,
"order": 10,
"from": "OnlineResourceWatcher",
"permission": { "permission": 4, "category": null, "element": null },
"parent": 1008001001,
"children": []
},
{
"id": 1008005001,
"pid": "/orw",
"type": 3,
"subtype": 1,
"name": "Draft",
"uri": "{/lang}/{/app}/orw/draft/list?u={?u}",
"target": "self",
"icon": null,
"order": 15,
"from": "OnlineResourceWatcher",
"permission": { "permission": 4, "category": null, "element": null },
"parent": 1008001001,
"children": []
},
{
"id": 1008006001,
"pid": "/orw",
"type": 3,
"subtype": 1,
"name": "Analysis",
"uri": "{/lang}/{/app}/orw/analysis",
"target": "self",
"icon": null,
"order": 15,
"from": "OnlineResourceWatcher",
"permission": { "permission": 4, "category": null, "element": null },
"parent": 1008001001,
"children": []
}
]
}

View File

@ -79,33 +79,43 @@
}
}
},
"orw_resource_check": {
"name": "orw_resource_check",
"orw_resource_report": {
"name": "orw_resource_report",
"fields": {
"orw_resource_check_id": {
"name": "orw_resource_check_id",
"orw_resource_report_id": {
"name": "orw_resource_report_id",
"type": "INT",
"null": false,
"primary": true,
"autoincrement": true
},
"orw_resource_check_status": {
"name": "orw_resource_check_status",
"orw_resource_report_status": {
"name": "orw_resource_report_status",
"type": "TINYINT",
"null": false
},
"orw_resource_check_change": {
"name": "orw_resource_check_change",
"orw_resource_report_metric": {
"name": "orw_resource_report_metric",
"type": "INT",
"null": false
},
"orw_resource_report_path": {
"name": "orw_resource_report_path",
"type": "VARCHAR(255)",
"null": false
},
"orw_resource_report_change": {
"name": "orw_resource_report_change",
"type": "TEXT",
"null": false
},
"orw_resource_check_created_at": {
"name": "orw_resource_check_created_at",
"orw_resource_report_created_at": {
"name": "orw_resource_report_created_at",
"type": "DATETIME",
"null": false
},
"orw_resource_check_resource": {
"name": "orw_resource_check_resource",
"orw_resource_report_resource": {
"name": "orw_resource_report_resource",
"type": "INT",
"null": true,
"default": null,

View File

@ -14,7 +14,10 @@ declare(strict_types=1);
namespace Modules\OnlineResourceWatcher\Admin;
use phpOMS\Application\ApplicationAbstract;
use phpOMS\Config\SettingsInterface;
use phpOMS\Module\InstallerAbstract;
use phpOMS\Module\ModuleInfo;
/**
* Installer class.
@ -33,4 +36,16 @@ final class Installer extends InstallerAbstract
* @since 1.0.0
*/
public const PATH = __DIR__;
/**
* {@inheritdoc}
*/
public static function install(ApplicationAbstract $app, ModuleInfo $info, SettingsInterface $cfgHandler) : void
{
parent::install($app, $info, $cfgHandler);
if (!\is_dir(__DIR__ . '/../Files')) {
mkdir(__DIR__ . '/../Files');
}
}
}

31
Admin/Routes/Console.php Normal file
View File

@ -0,0 +1,31 @@
<?php
/**
* Karaka
*
* PHP Version 8.1
*
* @package Modules
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://jingga.app
*/
declare(strict_types=1);
use Modules\OnlineResourceWatcher\Controller\ApiController;
use Modules\OnlineResourceWatcher\Models\PermissionCategory;
use phpOMS\Account\PermissionType;
use phpOMS\Router\RouteVerb;
return [
'^.*/orw/check -i all*$' => [
[
'dest' => '\Modules\OnlineResourceWatcher\Controller\ApiController:apiCheckResources',
'permission' => [
'module' => ApiController::NAME,
'type' => PermissionType::CREATE,
'state' => PermissionCategory::RESOURCE,
],
],
]
];

View File

@ -18,9 +18,9 @@ use phpOMS\Account\PermissionType;
use phpOMS\Router\RouteVerb;
return [
'^.*/news/dashboard.*$' => [
'^.*/orw/resource/list.*$' => [
[
'dest' => '\Modules\OnlineResourceWatcher\Controller\BackendController:viewOnlineResourceWatcherDashboard',
'dest' => '\Modules\OnlineResourceWatcher\Controller\BackendController:viewResourceList',
'verb' => RouteVerb::GET,
'permission' => [
'module' => BackendController::NAME,
@ -29,9 +29,9 @@ return [
],
],
],
'^.*/news/article.*$' => [
'^.*/orw/resource\?.*$' => [
[
'dest' => '\Modules\OnlineResourceWatcher\Controller\BackendController:viewOnlineResourceWatcherArticle',
'dest' => '\Modules\OnlineResourceWatcher\Controller\BackendController:viewResource',
'verb' => RouteVerb::GET,
'permission' => [
'module' => BackendController::NAME,
@ -40,31 +40,9 @@ return [
],
],
],
'^.*/news/archive.*$' => [
'^.*/orw/resource/create.*$' => [
[
'dest' => '\Modules\OnlineResourceWatcher\Controller\BackendController:viewOnlineResourceWatcherArchive',
'verb' => RouteVerb::GET,
'permission' => [
'module' => BackendController::NAME,
'type' => PermissionType::READ,
'state' => PermissionCategory::RESOURCE,
],
],
],
'^.*/news/draft/list.*$' => [
[
'dest' => '\Modules\OnlineResourceWatcher\Controller\BackendController:viewOnlineResourceWatcherDraftList',
'verb' => RouteVerb::GET,
'permission' => [
'module' => BackendController::NAME,
'type' => PermissionType::MODIFY,
'state' => PermissionCategory::RESOURCE,
],
],
],
'^.*/news/create.*$' => [
[
'dest' => '\Modules\OnlineResourceWatcher\Controller\BackendController:viewOnlineResourceWatcherCreate',
'dest' => '\Modules\OnlineResourceWatcher\Controller\BackendController:viewResourceCreate',
'verb' => RouteVerb::GET,
'permission' => [
'module' => BackendController::NAME,
@ -73,9 +51,9 @@ return [
],
],
],
'^.*/news/edit.*$' => [
'^.*/orw/resource/report/list.*$' => [
[
'dest' => '\Modules\OnlineResourceWatcher\Controller\BackendController:viewOnlineResourceWatcherEdit',
'dest' => '\Modules\OnlineResourceWatcher\Controller\BackendController:viewReportList',
'verb' => RouteVerb::GET,
'permission' => [
'module' => BackendController::NAME,
@ -84,9 +62,9 @@ return [
],
],
],
'^.*/news/analysis.*$' => [
'^.*/orw/resource/report\?.*$' => [
[
'dest' => '\Modules\OnlineResourceWatcher\Controller\BackendController:viewOnlineResourceWatcherAnalysis',
'dest' => '\Modules\OnlineResourceWatcher\Controller\BackendController:viewReport',
'verb' => RouteVerb::GET,
'permission' => [
'module' => BackendController::NAME,

View File

@ -17,12 +17,19 @@ namespace Modules\OnlineResourceWatcher\Controller;
use Modules\Admin\Models\NullAccount;
use Modules\OnlineResourceWatcher\Models\Resource;
use Modules\OnlineResourceWatcher\Models\ResourceMapper;
use Modules\OnlineResourceWatcher\Models\Report;
use Modules\OnlineResourceWatcher\Models\ReportStatus;
use Modules\OnlineResourceWatcher\Models\ReportMapper;
use Modules\OnlineResourceWatcher\Models\ResourceStatus;
use phpOMS\Message\Http\RequestStatusCode;
use phpOMS\Message\NotificationLevel;
use phpOMS\Message\RequestAbstract;
use phpOMS\Message\ResponseAbstract;
use phpOMS\Model\Message\FormValidation;
use phpOMS\System\SystemUtils;
use phpOMS\System\File\Local\Directory;
use phpOMS\Utils\StringUtils;
use phpOMS\Utils\ImageUtils;
/**
* OnlineResourceWatcher controller class.
@ -103,7 +110,7 @@ final class ApiController extends Controller
// @todo: check if user is part of organization below AND has free resources to add!!!
$resource->organization = new NullAccount(
empty($request->getData('organization'))
? $request->header->account
? 1
: (int) ($request->getData('organization'))
);
@ -125,11 +132,249 @@ final class ApiController extends Controller
*/
public function apiCheckResources(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : void
{
SystemUtils::runProc(
__DIR__ . '/server/bin/OnlineResourceWatcherServerApp', ''
);
$resources = ResourceMapper::getAll()
->where('status', ResourceStatus::ACTIVE)
->execute();
$this->fillJsonResponse($request, $response, NotificationLevel::OK, 'Resources', 'Resources are getting checked.', null);
$toCheck = [];
$basePath = __DIR__ . '/../Files';
Directory::delete($basePath . '/temp');
if (!\is_dir($basePath . '/temp')) {
\mkdir($basePath . '/temp');
}
// Load resources
foreach ($resources as $resource) {
$path = $basePath . '/';
$timestamp = \time();
$path .= 'temp/' . $resource->getId() . '/' . $timestamp;
$toCheck[] = [
'resource' => $resource,
'timestamp' => $timestamp,
'path' => $path,
'handled' => false,
'loop' => 0,
];
SystemUtils::runProc(
'wget',
'--retry-connrefused --waitretry=1 --read-timeout=10 --timeout=10 --dns-timeout=10 -t 2 --quota=25m --adjust-extension --span-hosts --convert-links --page-requisites --no-directories --restrict-file-names=windows --no-parent execute robots=off --limit-rate=5m --accept css,png,jpg,jpeg,gif,htm,html,txt,md,pdf,xls,xlsx,doc,docx --directory-prefix=' . $path . ' output-document=index.html ' . $resource->uri,
true
);
}
// Check downloaded resources
// @todo: this may not work correctly because the download runs async.
$totalCount = \count($toCheck);
// @todo: the following code is INSANE, simplify!!!
$baseLen = \strlen($basePath . '/temp');
while (!empty($toCheck)) {
foreach ($toCheck as $index => $check) {
++$toCheck[$index]['loop'];
$resource = $check['resource'];
// too many tries
if ($check['loop'] > 60 * 10) {
$report = new Report();
$report->resource = $resource->getId();
$report->versionPath = (string) $check['timestamp'];
$report->status = ReportStatus::DOWNLOAD_ERROR;
ReportMapper::create()->execute($report);
$resource->checkedAt = $report->createdAt;
ResourceMapper::update()->execute($resource);
unset($toCheck[$index]);
continue;
}
$path = $check['path'];
if (!\is_dir($path)) {
// Either the download takes too long or the download failed!
continue;
}
$end = \stripos($path, '/', $baseLen + 1);
$id = (int) \substr($path, $baseLen + 1, $end - $baseLen - 1);
// new resource
if ($check['loop'] === 60 * 10 && !\is_dir($basePath . '/' . $id)) {
$filesNew = \scandir($path);
$fileName = '';
if (in_array('index.htm', $filesNew) || \in_array('index.html', $filesNew)) {
$fileName = \in_array('index.htm', $filesNew) ? 'index.htm' : 'index.html';
} else {
foreach ($filesNew as $file) {
if (StringUtils::endsWith($file, '.png')
|| StringUtils::endsWith($file, '.jpg')
|| StringUtils::endsWith($file, '.jpeg')
|| StringUtils::endsWith($file, '.gif')
|| StringUtils::endsWith($file, '.pdf')
|| StringUtils::endsWith($file, '.doc')
|| StringUtils::endsWith($file, '.docx')
|| StringUtils::endsWith($file, '.xls')
|| StringUtils::endsWith($file, '.xlsx')
|| StringUtils::endsWith($file, '.md')
|| StringUtils::endsWith($file, '.txt')
) {
$fileName = $file;
break;
}
}
}
$report = new Report();
$report->resource = $resource->getId();
$report->versionPath = (string) $check['timestamp'];
$hash = '';
if (!empty($fileName)) {
$report->status = ReportStatus::ADDED;
$hash = \md5_file($path . '/' . $fileName);
} else {
$report->status = ReportStatus::DOWNLOAD_ERROR;
}
ReportMapper::create()->execute($report);
$resource->path = (string) $resource->getId();
$resource->lastVersionPath = (string) $check['timestamp'];
$resource->lastVersionDate = $report->createdAt;
$resource->hash = $hash;
$resource->checkedAt = $report->createdAt;
ResourceMapper::update()->execute($resource);
Directory::copy($path, $basePath . '/' . $id . '/' . $check['timestamp']);
unset($toCheck[$index]);
continue;
}
if (!\is_dir($basePath . '/' . $id)) {
continue;
}
// existing resource
$resourcePaths = \scandir($basePath . '/' . $id);
\natsort($resourcePaths);
$lastVersionTimestamp = \end($resourcePaths);
if ($lastVersionTimestamp === '.' && $lastVersionTimestamp === '..') {
$lastVersionTimestamp = \reset($resourcePaths);
if ($lastVersionTimestamp === '.' && $lastVersionTimestamp === '..') {
Directory::delete($basePath . '/' . $id);
}
}
$lastVersionPath = $basePath . '/' . $id . '/' . $lastVersionTimestamp;
$filesNew = \scandir($path);
// Using this because the index.htm gets created last and at the time of the check below it may not yet exist.
$filesOld = \scandir($lastVersionPath);
$oldPath = '';
$newPath = '';
$extension = '';
if (\in_array('index.htm', $filesOld) || \in_array('index.html', $filesOld)
|| \in_array('index.htm', $filesNew) || \in_array('index.html', $filesNew)
) {
$extension = \in_array('index.htm', $filesOld) ? 'htm' : 'html';
$oldPath = $lastVersionPath . '/index.' . $extension;
$newPath = $path . '/index.' . $extension;
$toCheck[$index]['handled'] = true;
} else {
foreach ($filesNew as $file) {
if (StringUtils::endsWith($file, '.png')
|| StringUtils::endsWith($file, '.jpg')
|| StringUtils::endsWith($file, '.jpeg')
|| StringUtils::endsWith($file, '.gif')
|| StringUtils::endsWith($file, '.pdf')
|| StringUtils::endsWith($file, '.doc')
|| StringUtils::endsWith($file, '.docx')
|| StringUtils::endsWith($file, '.xls')
|| StringUtils::endsWith($file, '.xlsx')
|| StringUtils::endsWith($file, '.md')
|| StringUtils::endsWith($file, '.txt')
) {
$oldPath = $lastVersionPath . '/' . $file;
$newPath = $path . '/' . $file;
$extension = \substr($file, \strripos($file, '.') + 1);
$toCheck[$index]['handled'] = true;
break;
}
}
}
if (!\is_file($newPath) || !$toCheck[$index]['handled']) {
continue;
}
$md5Old = $resource->hash;
$md5New = \md5_file($newPath);
$hasDifferentHash = $md5Old !== $md5New;
// @todo: check if old path exists and if not, don't calculate a diff
$difference = 0;
if ($hasDifferentHash) {
if (\in_array($extension, ['md', 'txt', 'doc', 'docx', 'pdf', 'xls', 'xlsx'])) {
$contentOld = \Modules\Media\Controller\ApiController::loadFileContent($oldPath);
$contentNew = \Modules\Media\Controller\ApiController::loadFileContent($newPath);
$difference = \levenshtein($contentOld, $contentNew);
} elseif (\in_array($extension, ['png', 'jpg', 'jpeg', 'gif'])) {
$difference = ImageUtils::difference($oldPath, $newPath, $path . '/_' . $file, 0);
}
}
$report = new Report();
$report->resource = $resource->getId();
$report->versionPath = (string) $check['timestamp'];
$report->changeMetric = $difference;
if ($difference !== 0) {
$report->status = ReportStatus::CHANGE;
$resource->path = (string) $resource->getId();
$resource->lastVersionPath = (string) $check['timestamp'];
$resource->lastVersionDate = $report->createdAt;
$resource->hash = $md5New;
Directory::copy($path, $basePath . '/' . $id . '/' . $check['timestamp']);
}
ReportMapper::create()->execute($report);
$resource->checkedAt = $report->createdAt;
ResourceMapper::update()->execute($resource);
Directory::delete($basePath . '/temp/' . $id);
// @todo: delete older history depending on plan
// @todo: inform users
unset($toCheck[$index]);
}
\sleep(1);
}
Directory::delete($basePath . '/temp');
$this->fillJsonResponse($request, $response, NotificationLevel::OK, 'Resources', 'Resources were checked.', null);
}
/**

View File

@ -14,7 +14,7 @@ declare(strict_types=1);
namespace Modules\OnlineResourceWatcher\Controller;
use Modules\Auditor\Models\AuditMapper;
use Modules\OnlineResourceWatcher\Models\ResourceMapper;
use phpOMS\Contract\RenderableInterface;
use phpOMS\DataStorage\Database\Query\OrderType;
use phpOMS\Message\RequestAbstract;
@ -44,7 +44,116 @@ final class BackendController extends Controller
* @since 1.0.0
* @codeCoverageIgnore
*/
public function viewOnlineResourceWatcherDashboard(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : RenderableInterface
public function viewResourceList(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : RenderableInterface
{
$view = new View($this->app->l11nManager, $request, $response);
$view->setTemplate('/Modules/OnlineResourceWatcher/Theme/Backend/resource-list');
/* Table functionality */
$searchFieldData = $request->getLike('.*\-p\-.*');
$searchField = [];
foreach ($searchFieldData as $key => $data) {
if ($data === '1') {
$split = \explode('-', $key);
$member = \end($split);
$searchField[] = $member;
}
}
$filterFieldData = $request->getLike('.*\-f\-.*?\-t');
$filterField = [];
foreach ($filterFieldData as $key => $type) {
$split = \explode('-', $key);
\end($split);
$member = \prev($split);
if (!empty($request->getData('organizationUserList-f-' . $member . '-f1'))) {
$filterField[$member] = [
'type' => $type,
'value1' => $request->getData('organizationUserList-f-' . $member . '-f1'),
'logic1' => $request->getData('organizationUserList-f-' . $member . '-o1'),
'value2' => $request->getData('organizationUserList-f-' . $member . '-f2'),
'logic2' => $request->getData('organizationUserList-f-' . $member . '-o2'),
];
}
}
$pageLimit = 25;
$view->addData('pageLimit', $pageLimit);
$mapper = ResourceMapper::getAll()->with('createdBy');
$list = ResourceMapper::find(
search: $request->getData('search'),
mapper: $mapper,
id: (int) ($request->getData('id') ?? 0),
secondaryId: (string) ($request->getData('subid') ?? ''),
type: $request->getData('pType'),
pageLimit: empty((int) ($request->getData('limit') ?? 0)) ? 100 : ((int) $request->getData('limit')),
sortBy: $request->getData('sort_by') ?? '',
sortOrder: $request->getData('sort_order') ?? OrderType::DESC,
searchFields: $searchField,
filters: $filterField
);
$view->setData('resources', $list['data']);
$tableView = new TableView($this->app->l11nManager, $request, $response);
$tableView->module = 'OnlineResourceWatcher';
$tableView->theme = 'Backend';
$tableView->setTitleTemplate('/Web/Backend/Themes/table-title');
$tableView->setColumnHeaderElementTemplate('/Web/Backend/Themes/header-element-table');
$tableView->setFilterTemplate('/Web/Backend/Themes/popup-filter-table');
$tableView->setSortTemplate('/Web/Backend/Themes/sort-table');
$tableView->setData('hasPrevious', $list['hasPrevious']);
$tableView->setData('hasNext', $list['hasNext']);
$view->addData('tableView', $tableView);
return $view;
}
/**
* Routing end-point for application behaviour.
*
* @param RequestAbstract $request Request
* @param ResponseAbstract $response Response
* @param mixed $data Generic data
*
* @return RenderableInterface Returns a renderable object
*
* @since 1.0.0
* @codeCoverageIgnore
*/
public function viewResource(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : RenderableInterface
{
$view = new View($this->app->l11nManager, $request, $response);
$view->setTemplate('/Modules/OnlineResourceWatcher/Theme/Backend/resource-single');
$resource = ResourceMapper::get()
->where('id', (int) $request->getData('id'))
->execute();
$view->setData('resource', $resource);
return $view;
}
/**
* Routing end-point for application behaviour.
*
* @param RequestAbstract $request Request
* @param ResponseAbstract $response Response
* @param mixed $data Generic data
*
* @return RenderableInterface Returns a renderable object
*
* @since 1.0.0
* @codeCoverageIgnore
*/
public function viewResourceCreate(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : RenderableInterface
{
$view = new View($this->app->l11nManager, $request, $response);
@ -63,7 +172,7 @@ final class BackendController extends Controller
* @since 1.0.0
* @codeCoverageIgnore
*/
public function viewOnlineResourceWatcherArticle(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : RenderableInterface
public function viewReportList(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : RenderableInterface
{
$view = new View($this->app->l11nManager, $request, $response);
@ -82,83 +191,7 @@ final class BackendController extends Controller
* @since 1.0.0
* @codeCoverageIgnore
*/
public function viewOnlineResourceWatcherArchive(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : RenderableInterface
{
$view = new View($this->app->l11nManager, $request, $response);
return $view;
}
/**
* Routing end-point for application behaviour.
*
* @param RequestAbstract $request Request
* @param ResponseAbstract $response Response
* @param mixed $data Generic data
*
* @return RenderableInterface Returns a renderable object
*
* @since 1.0.0
* @codeCoverageIgnore
*/
public function viewOnlineResourceWatcherDraftList(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : RenderableInterface
{
$view = new View($this->app->l11nManager, $request, $response);
return $view;
}
/**
* Routing end-point for application behaviour.
*
* @param RequestAbstract $request Request
* @param ResponseAbstract $response Response
* @param mixed $data Generic data
*
* @return RenderableInterface Returns a renderable object
*
* @since 1.0.0
* @codeCoverageIgnore
*/
public function viewOnlineResourceWatcherCreate(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : RenderableInterface
{
$view = new View($this->app->l11nManager, $request, $response);
return $view;
}
/**
* Routing end-point for application behaviour.
*
* @param RequestAbstract $request Request
* @param ResponseAbstract $response Response
* @param mixed $data Generic data
*
* @return RenderableInterface Returns a renderable object
*
* @since 1.0.0
* @codeCoverageIgnore
*/
public function viewOnlineResourceWatcherEdit(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : RenderableInterface
{
$view = new View($this->app->l11nManager, $request, $response);
return $view;
}
/**
* Routing end-point for application behaviour.
*
* @param RequestAbstract $request Request
* @param ResponseAbstract $response Response
* @param mixed $data Generic data
*
* @return RenderableInterface Returns a renderable object
*
* @since 1.0.0
* @codeCoverageIgnore
*/
public function viewOnlineResourceWatcherAnalysis(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : RenderableInterface
public function viewReport(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : RenderableInterface
{
$view = new View($this->app->l11nManager, $request, $response);

47
Models/NullReport.ph Normal file
View File

@ -0,0 +1,47 @@
<?php
/**
* Karaka
*
* PHP Version 8.1
*
* @package Modules\OnlineResourceWatcher\Models
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://jingga.app
*/
declare(strict_types=1);
namespace Modules\OnlineResourceWatcher\Models;
/**
* Null model
*
* @package Modules\OnlineResourceWatcher\Models
* @license OMS License 1.0
* @link https://jingga.app
* @since 1.0.0
*/
final class NullReport extends Report
{
/**
* Constructor
*
* @param int $id Model id
*
* @since 1.0.0
*/
public function __construct(int $id = 0)
{
$this->id = $id;
parent::__construct();
}
/**
* {@inheritdoc}
*/
public function jsonSerialize() : mixed
{
return ['id' => $this->id];
}
}

47
Models/NullResource.php Normal file
View File

@ -0,0 +1,47 @@
<?php
/**
* Karaka
*
* PHP Version 8.1
*
* @package Modules\OnlineResourceWatcher\Models
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://jingga.app
*/
declare(strict_types=1);
namespace Modules\OnlineResourceWatcher\Models;
/**
* Null model
*
* @package Modules\OnlineResourceWatcher\Models
* @license OMS License 1.0
* @link https://jingga.app
* @since 1.0.0
*/
final class NullResource extends Resource
{
/**
* Constructor
*
* @param int $id Model id
*
* @since 1.0.0
*/
public function __construct(int $id = 0)
{
$this->id = $id;
parent::__construct();
}
/**
* {@inheritdoc}
*/
public function jsonSerialize() : mixed
{
return ['id' => $this->id];
}
}

87
Models/Report.php Normal file
View File

@ -0,0 +1,87 @@
<?php
/**
* Karaka
*
* PHP Version 8.1
*
* @package Modules\OnlineResourceWatcher\Models
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://jingga.app
*/
declare(strict_types=1);
namespace Modules\OnlineResourceWatcher\Models;
use Modules\Admin\Models\Account;
use Modules\Admin\Models\NullAccount;
/**
* Report class.
*
* @package Modules\OnlineResourceWatcher\Models
* @license OMS License 1.0
* @link https://jingga.app
* @since 1.0.0
*/
class Report implements \JsonSerializable
{
/**
* ID.
*
* @var int
* @since 1.0.0
*/
protected int $id = 0;
/**
* Created.
*
* @var \DateTimeImmutable
* @since 1.0.0
*/
public \DateTimeImmutable $createdAt;
public int $resource = 0;
public string $versionPath = '';
public int $changeMetric = 0;
public int $status = ReportStatus::NO_CHANGE;
public string $change = '';
/**
* Constructor.
*
* @since 1.0.0
*/
public function __construct()
{
$this->createdAt = new \DateTimeImmutable('now');
}
/**
* {@inheritdoc}
*/
public function toArray() : array
{
return [
'id' => $this->id,
'createdAt' => $this->createdAt,
'resource' => $this->resource,
'status' => $this->status,
'changemetric' => $this->changeMetric,
];
}
/**
* {@inheritdoc}
*/
public function jsonSerialize() : mixed
{
return $this->toArray();
}
}

61
Models/ReportMapper.php Normal file
View File

@ -0,0 +1,61 @@
<?php
/**
* Karaka
*
* PHP Version 8.1
*
* @package Modules\OnlineResourceWatcher\Models
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://jingga.app
*/
declare(strict_types=1);
namespace Modules\OnlineResourceWatcher\Models;
use Modules\Admin\Models\AccountMapper;
use phpOMS\DataStorage\Database\Mapper\DataMapperFactory;
/**
* Resource mapper class.
*
* @package Modules\OnlineResourceWatcher\Models
* @license OMS License 1.0
* @link https://jingga.app
* @since 1.0.0
*/
final class ReportMapper extends DataMapperFactory
{
/**
* Columns.
*
* @var array<string, array{name:string, type:string, internal:string, autocomplete?:bool, readonly?:bool, writeonly?:bool, annotations?:array}>
* @since 1.0.0
*/
public const COLUMNS = [
'orw_resource_report_id' => ['name' => 'orw_resource_report_id', 'type' => 'int', 'internal' => 'id'],
'orw_resource_report_status' => ['name' => 'orw_resource_report_status', 'type' => 'int', 'internal' => 'status',],
'orw_resource_report_metric' => ['name' => 'orw_resource_report_metric', 'type' => 'int', 'internal' => 'changeMetric',],
'orw_resource_report_path' => ['name' => 'orw_resource_report_path', 'type' => 'string', 'internal' => 'versionPath',],
'orw_resource_report_change' => ['name' => 'orw_resource_report_change', 'type' => 'string', 'internal' => 'change',],
'orw_resource_report_resource' => ['name' => 'orw_resource_report_resource', 'type' => 'int', 'internal' => 'resource',],
'orw_resource_report_created_at' => ['name' => 'orw_resource_report_created_at', 'type' => 'DateTimeImmutable', 'internal' => 'createdAt',],
];
/**
* Primary table.
*
* @var string
* @since 1.0.0
*/
public const TABLE = 'orw_resource_report';
/**
* Primary field name.
*
* @var string
* @since 1.0.0
*/
public const PRIMARYFIELD ='orw_resource_report_id';
}

36
Models/ReportStatus.php Normal file
View File

@ -0,0 +1,36 @@
<?php
/**
* Karaka
*
* PHP Version 8.1
*
* @package Modules\OnlineResourceWatcher\Models
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://jingga.app
*/
declare(strict_types=1);
namespace Modules\OnlineResourceWatcher\Models;
use phpOMS\Stdlib\Base\Enum;
/**
* Event type enum.
*
* @package Modules\OnlineResourceWatcher\Models
* @license OMS License 1.0
* @link https://jingga.app
* @since 1.0.0
*/
abstract class ReportStatus extends Enum
{
public const ADDED = 0;
public const NO_CHANGE = 1;
public const CHANGE = 2;
public const DOWNLOAD_ERROR = -1;
}

View File

@ -173,6 +173,18 @@ class Resource implements \JsonSerializable
];
}
/**
* Get status
*
* @return int
*
* @since 1.0.0
*/
public function getStatus() : int
{
return $this->status;
}
/**
* {@inheritdoc}
*/

View File

@ -0,0 +1,17 @@
<?php
/**
* Karaka
*
* PHP Version 8.1
*
* @package Modules\Localization
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://jingga.app
*/
declare(strict_types=1);
return ['Navigation' => [
'OnlineResourceWatcher' => 'Online Resource Watcher',
]];

View File

@ -1,111 +0,0 @@
<?php
/**
* Karaka
*
* PHP Version 8.1
*
* @package Modules\Auditor
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://jingga.app
*/
declare(strict_types=1);
use phpOMS\Uri\UriFactory;
/**
* @var \phpOMS\Views\View $this
* @var \Modules\Audit\Models\Audit[] $audits
*/
$audits = $this->getData('audits') ?? [];
$tableView = $this->getData('tableView');
$tableView->id = 'auditList';
$tableView->baseUri = '{/prefix}admin/audit/list';
$tableView->setObjects($audits);
$previous = $tableView->getPreviousLink(
$this->request,
empty($this->objects) || !$this->getData('hasPrevious') ? null : \reset($this->objects)
);
$next = $tableView->getNextLink(
$this->request,
empty($this->objects) ? null : \end($this->objects),
$this->getData('hasNext') ?? false
);
?>
<div class="row">
<div class="col-xs-12">
<div class="portlet">
<div class="portlet-head">
<?= $tableView->renderTitle(
$this->getHtml('Bills', '0', '0')
); ?>
</div>
<div class="slider">
<table id="<?= $tableView->id; ?>" class="default sticky">
<thead>
<tr>
<td><?= $tableView->renderHeaderElement(
'id',
$this->getHtml('ID', '0', '0'),
'number'
); ?>
<td><?= $tableView->renderHeaderElement(
'number',
$this->getHtml('Number', '0', '0'),
'text'
); ?>
<td><?= $tableView->renderHeaderElement(
'customer_no',
$this->getHtml('CustomerNo', '0', '0'),
'number'
); ?>
<td class="wf-100"><?= $tableView->renderHeaderElement(
'customer_name',
$this->getHtml('CustomerName', '0', '0'),
'text'
); ?>
<td><?= $tableView->renderHeaderElement(
'amount',
$this->getHtml('Amount', '0', '0'),
'number'
); ?>
<td><?= $tableView->renderHeaderElement(
'createdAt',
$this->getHtml('Date', '0', '0'),
'date'
); ?>
<tbody>
<?php $count = 0;
foreach ($audits as $key => $audit) : ++$count;
$url = UriFactory::build('{/lang}/{/app}/{/prefix}admin/audit/single?id=' . $audit->getId()); ?>
<tr tabindex="0" data-href="<?= $url; ?>">
<td>
<td>
<td>
<td>
<td>
<td>
<?php endforeach; ?>
<?php if ($count === 0) : ?>
<tr><td colspan="8" class="empty"><?= $this->getHtml('Empty', '0', '0'); ?>
<?php endif; ?>
</table>
</div>
<?php if ($this->getData('hasPrevious') || $this->getData('hasNext')) : ?>
<div class="portlet-foot">
<?php if ($this->getData('hasPrevious')) : ?>
<a tabindex="0" class="button" href="<?= UriFactory::build($previous); ?>"><i class="fa fa-chevron-left"></i></a>
<?php endif; ?>
<?php if ($this->getData('hasNext')) : ?>
<a tabindex="0" class="button" href="<?= UriFactory::build($next); ?>"><i class="fa fa-chevron-right"></i></a>
<?php endif; ?>
</div>
<?php endif; ?>
</div>
</div>
</div>

View File

@ -1,133 +0,0 @@
<?php
/**
* Karaka
*
* PHP Version 8.1
*
* @package Modules\Auditor
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://jingga.app
*/
declare(strict_types=1);
use phpOMS\Uri\UriFactory;
/**
* @var \phpOMS\Views\View $this
* @var \Modules\Audit\Models\Audit[] $audits
*/
$audits = $this->getData('audits') ?? [];
$tableView = $this->getData('tableView');
$tableView->id = 'auditList';
$tableView->baseUri = ''{/lang}/{/app}/admin/audit/list';
$tableView->setObjects($audits);
$previous = $tableView->getPreviousLink(
$this->request,
empty($this->objects) || !$this->getData('hasPrevious') ? null : \reset($this->objects)
);
$next = $tableView->getNextLink(
$this->request,
empty($this->objects) ? null : \end($this->objects),
$this->getData('hasNext') ?? false
);
?>
<div class="row">
<div class="col-xs-12">
<div class="portlet">
<div class="portlet-head">
<?= $tableView->renderTitle(
$this->getHtml('Logs', '0', '0')
); ?>
</div>
<div class="slider">
<table id="<?= $tableView->id; ?>" class="default sticky">
<thead>
<tr>
<td><?= $tableView->renderHeaderElement(
'id',
$this->getHtml('ID', '0', '0'),
'number'
); ?>
<td><?= $tableView->renderHeaderElement(
'action',
$this->getHtml('Action', '0', '0'),
'select',
[
'create' => $this->getHtml('CREATE', '0', '0'),
'modify' => $this->getHtml('UPDATE', '0', '0'),
'delete' => $this->getHtml('DELETE', '0', '0'),
],
false // don't render sort
); ?>
<td><?= $tableView->renderHeaderElement(
'type',
$this->getHtml('Type', '0', '0'),
'number'
); ?>
<td class="wf-100"><?= $tableView->renderHeaderElement(
'trigger',
$this->getHtml('Trigger', '0', '0'),
'text'
); ?>
<td><?= $tableView->renderHeaderElement(
'createdBy',
$this->getHtml('By', '0', '0'),
'text'
); ?>
<td><?= $tableView->renderHeaderElement(
'ref',
$this->getHtml('Ref', '0', '0'),
'text',
[],
true,
true,
false
); ?>
<td><?= $tableView->renderHeaderElement(
'createdAt',
$this->getHtml('Date', '0', '0'),
'date'
); ?>
<tbody>
<?php $count = 0;
foreach ($audits as $key => $audit) : ++$count;
$url = UriFactory::build('{/lang}/{/app}/'{/lang}/{/app}/admin/audit/single?id=' . $audit->getId()); ?>
<tr tabindex="0" data-href="<?= $url; ?>">
<td><?= $audit->getId(); ?>
<td><?php if ($audit->old === null) : echo $this->getHtml('CREATE', '0', '0'); ?>
<?php elseif ($audit->old !== null && $audit->new !== null) : echo $this->getHtml('UPDATE', '0', '0'); ?>
<?php elseif ($audit->new === null) : echo $this->getHtml('DELETE', '0', '0'); ?>
<?php else : echo $this->getHtml('UNKNOWN', '0', '0'); ?>
<?php endif; ?>
<td><?= $audit->type; ?>
<td><?= $audit->trigger; ?>
<td><a class="content" href="<?= UriFactory::build('{/lang}/{/app}/'{/lang}/{/app}/admin/account/settings?id=' . $audit->createdBy->getId()); ?>"><?= $this->printHtml(
$this->renderUserName('%3$s %2$s %1$s', [$audit->createdBy->name1, $audit->createdBy->name2, $audit->createdBy->name3, $audit->createdBy->login])
); ?></a>
<td><?= $this->printHtml($audit->getRef()); ?>
<td><?= $audit->createdAt->format('Y-m-d H:i:s'); ?>
<?php endforeach; ?>
<?php if ($count === 0) : ?>
<tr><td colspan="8" class="empty"><?= $this->getHtml('Empty', '0', '0'); ?>
<?php endif; ?>
</table>
</div>
<?php if ($this->getData('hasPrevious') || $this->getData('hasNext')) : ?>
<div class="portlet-foot">
<?php if ($this->getData('hasPrevious')) : ?>
<a tabindex="0" class="button" href="<?= UriFactory::build($previous); ?>"><i class="fa fa-chevron-left"></i></a>
<?php endif; ?>
<?php if ($this->getData('hasNext')) : ?>
<a tabindex="0" class="button" href="<?= UriFactory::build($next); ?>"><i class="fa fa-chevron-right"></i></a>
<?php endif; ?>
</div>
<?php endif; ?>
</div>
</div>
</div>

View File

@ -1,101 +0,0 @@
<?php
/**
* Karaka
*
* PHP Version 8.1
*
* @package Modules\Auditor
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://jingga.app
*/
declare(strict_types=1);
use phpOMS\Uri\UriFactory;
/**
* @var \phpOMS\Views\View $this
* @var \Modules\Audit\Models\Audit[] $audits
*/
$audits = $this->getData('audits') ?? [];
$tableView = $this->getData('tableView');
$tableView->id = 'auditList';
$tableView->baseUri = '{/prefix}admin/audit/list';
$tableView->setObjects($audits);
$previous = $tableView->getPreviousLink(
$this->request,
empty($this->objects) || !$this->getData('hasPrevious') ? null : \reset($this->objects)
);
$next = $tableView->getNextLink(
$this->request,
empty($this->objects) ? null : \end($this->objects),
$this->getData('hasNext') ?? false
);
?>
<div class="row">
<div class="col-xs-12">
<div class="portlet">
<div class="portlet-head">
<?= $tableView->renderTitle(
$this->getHtml('Organizations', '0', '0')
); ?>
</div>
<div class="slider">
<table id="<?= $tableView->id; ?>" class="default sticky">
<thead>
<tr>
<td><?= $tableView->renderHeaderElement(
'id',
$this->getHtml('ID', '0', '0'),
'number'
); ?>
<td class="wf-100"><?= $tableView->renderHeaderElement(
'name',
$this->getHtml('Name', '0', '0'),
'text'
); ?>
<td><?= $tableView->renderHeaderElement(
'members',
$this->getHtml('Members', '0', '0'),
'number'
); ?>
<td><?= $tableView->renderHeaderElement(
'resources',
$this->getHtml('Resources', '0', '0'),
'number'
); ?>
<td><?= $tableView->renderHeaderElement(
'createdAt',
$this->getHtml('Date', '0', '0'),
'date'
); ?>
<tbody>
<?php $count = 0;
foreach ($audits as $key => $audit) : ++$count;
$url = UriFactory::build('{/lang}/{/app}/{/prefix}admin/audit/single?id=' . $audit->getId()); ?>
<tr tabindex="0" data-href="<?= $url; ?>">
<td>
<?php endforeach; ?>
<?php if ($count === 0) : ?>
<tr><td colspan="8" class="empty"><?= $this->getHtml('Empty', '0', '0'); ?>
<?php endif; ?>
</table>
</div>
<?php if ($this->getData('hasPrevious') || $this->getData('hasNext')) : ?>
<div class="portlet-foot">
<?php if ($this->getData('hasPrevious')) : ?>
<a tabindex="0" class="button" href="<?= UriFactory::build($previous); ?>"><i class="fa fa-chevron-left"></i></a>
<?php endif; ?>
<?php if ($this->getData('hasNext')) : ?>
<a tabindex="0" class="button" href="<?= UriFactory::build($next); ?>"><i class="fa fa-chevron-right"></i></a>
<?php endif; ?>
</div>
<?php endif; ?>
</div>
</div>
</div>

View File

@ -1,116 +0,0 @@
<?php
/**
* Karaka
*
* PHP Version 8.1
*
* @package Modules\Auditor
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://jingga.app
*/
declare(strict_types=1);
use phpOMS\Uri\UriFactory;
/**
* @var \phpOMS\Views\View $this
* @var \Modules\Audit\Models\Audit[] $resources
*/
$resources = $this->getData('resources') ?? [];
$tableView = $this->getData('tableView');
$tableView->id = 'auditList';
$tableView->baseUri = '{/prefix}admin/audit/list';
$tableView->setObjects($resources);
$previous = $tableView->getPreviousLink(
$this->request,
empty($this->objects) || !$this->getData('hasPrevious') ? null : \reset($this->objects)
);
$next = $tableView->getNextLink(
$this->request,
empty($this->objects) ? null : \end($this->objects),
$this->getData('hasNext') ?? false
);
?>
<div class="row">
<div class="col-xs-12">
<div class="portlet">
<div class="portlet-head">
<?= $tableView->renderTitle(
$this->getHtml('Resources', '0', '0')
); ?>
</div>
<div class="slider">
<table id="<?= $tableView->id; ?>" class="default sticky">
<thead>
<tr>
<td><?= $tableView->renderHeaderElement(
'id',
$this->getHtml('ID', '0', '0'),
'number'
); ?>
<td class="wf-100"><?= $tableView->renderHeaderElement(
'resource',
$this->getHtml('Resource', '0', '0'),
'text'
); ?>
<td><?= $tableView->renderHeaderElement(
'user_no',
$this->getHtml('User', '0', '0'),
'number'
); ?>
<td><?= $tableView->renderHeaderElement(
'user_name',
$this->getHtml('User', '0', '0'),
'text'
); ?>
<td><?= $tableView->renderHeaderElement(
'status',
$this->getHtml('Status', '0', '0'),
'text'
); ?>
<td><?= $tableView->renderHeaderElement(
'lastChecked',
$this->getHtml('Checked', '0', '0'),
'date'
); ?>
<td><?= $tableView->renderHeaderElement(
'createdAt',
$this->getHtml('Date', '0', '0'),
'date'
); ?>
<tbody>
<?php $count = 0;
foreach ($resources as $key => $resource) : ++$count;
$url = UriFactory::build('{/lang}/{/app}/admin/audit/single?id=' . $resource->getId()); ?>
<tr tabindex="0" data-href="<?= $url; ?>">
<td>
<td>
<td>
<td>
<td>
<td>
<?php endforeach; ?>
<?php if ($count === 0) : ?>
<tr><td colspan="8" class="empty"><?= $this->getHtml('Empty', '0', '0'); ?>
<?php endif; ?>
</table>
</div>
<?php if ($this->getData('hasPrevious') || $this->getData('hasNext')) : ?>
<div class="portlet-foot">
<?php if ($this->getData('hasPrevious')) : ?>
<a tabindex="0" class="button" href="<?= UriFactory::build($previous); ?>"><i class="fa fa-chevron-left"></i></a>
<?php endif; ?>
<?php if ($this->getData('hasNext')) : ?>
<a tabindex="0" class="button" href="<?= UriFactory::build($next); ?>"><i class="fa fa-chevron-right"></i></a>
<?php endif; ?>
</div>
<?php endif; ?>
</div>
</div>
</div>

View File

@ -1,111 +0,0 @@
<?php
/**
* Karaka
*
* PHP Version 8.1
*
* @package Modules\Auditor
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://jingga.app
*/
declare(strict_types=1);
use phpOMS\Uri\UriFactory;
/**
* @var \phpOMS\Views\View $this
* @var \Modules\Audit\Models\Audit[] $audits
*/
$audits = $this->getData('audits') ?? [];
$tableView = $this->getData('tableView');
$tableView->id = 'auditList';
$tableView->baseUri = '{/prefix}admin/audit/list';
$tableView->setObjects($audits);
$previous = $tableView->getPreviousLink(
$this->request,
empty($this->objects) || !$this->getData('hasPrevious') ? null : \reset($this->objects)
);
$next = $tableView->getNextLink(
$this->request,
empty($this->objects) ? null : \end($this->objects),
$this->getData('hasNext') ?? false
);
?>
<div class="row">
<div class="col-xs-12">
<div class="portlet">
<div class="portlet-head">
<?= $tableView->renderTitle(
$this->getHtml('Users', '0', '0')
); ?>
</div>
<div class="slider">
<table id="<?= $tableView->id; ?>" class="default sticky">
<thead>
<tr>
<td><?= $tableView->renderHeaderElement(
'id',
$this->getHtml('ID', '0', '0'),
'number'
); ?>
<td class="wf-100"><?= $tableView->renderHeaderElement(
'name',
$this->getHtml('User', '0', '0'),
'text'
); ?>
<td><?= $tableView->renderHeaderElement(
'organization',
$this->getHtml('Organization', '0', '0'),
'text'
); ?>
<td><?= $tableView->renderHeaderElement(
'resources',
$this->getHtml('Resources', '0', '0'),
'number'
); ?>
<td><?= $tableView->renderHeaderElement(
'lastActivity',
$this->getHtml('Active', '0', '0'),
'date'
); ?>
<td><?= $tableView->renderHeaderElement(
'createdAt',
$this->getHtml('Date', '0', '0'),
'date'
); ?>
<tbody>
<?php $count = 0;
foreach ($audits as $key => $audit) : ++$count;
$url = UriFactory::build('{/lang}/{/app}/{/prefix}admin/audit/single?id=' . $audit->getId()); ?>
<tr tabindex="0" data-href="<?= $url; ?>">
<td>
<td>
<td>
<td>
<td>
<td>
<?php endforeach; ?>
<?php if ($count === 0) : ?>
<tr><td colspan="8" class="empty"><?= $this->getHtml('Empty', '0', '0'); ?>
<?php endif; ?>
</table>
</div>
<?php if ($this->getData('hasPrevious') || $this->getData('hasNext')) : ?>
<div class="portlet-foot">
<?php if ($this->getData('hasPrevious')) : ?>
<a tabindex="0" class="button" href="<?= UriFactory::build($previous); ?>"><i class="fa fa-chevron-left"></i></a>
<?php endif; ?>
<?php if ($this->getData('hasNext')) : ?>
<a tabindex="0" class="button" href="<?= UriFactory::build($next); ?>"><i class="fa fa-chevron-right"></i></a>
<?php endif; ?>
</div>
<?php endif; ?>
</div>
</div>
</div>

View File

@ -1,24 +0,0 @@
<?php
/**
* Karaka
*
* PHP Version 8.1
*
* @package Web\Backend
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://jingga.app
*/
declare(strict_types=1);
use phpOMS\Uri\UriFactory;
?>
<header>
<a id="logo" href="<?= UriFactory::build('{/lang}/{/app}/{/prefix}'); ?>">
<span><img alt="<?= $this->getHtml('Logo', '0', '0'); ?>" src="Applications/Backend/img/logo.png" width="40px"></span>
<span id="logo-name">Jingga</span>
</a>
<?php include __DIR__ . '/nav-top.tpl.php'; ?>
</header>

View File

@ -1,118 +0,0 @@
<?php
/**
* Karaka
*
* PHP Version 8.1
*
* @package Web\Backend
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://jingga.app
*/
declare(strict_types=1);
use phpOMS\Uri\UriFactory;
?>
<nav id="nav-side">
<div id="nav-side-outer" class="oms-ui-state">
<ul id="nav-side-inner" class="nav" role="navigation">
<li>
<ul>
<li>
<label for="nav-admin">
<i class=""></i>
<span><?= $this->getHtml('Admin', '0', '0'); ?></span>
</label>
</li>
<li><a class="<?= $this->request->uri->getPathElement(0) === 'admin'
&& $this->request->uri->getPathElement(1) === 'organizations'
? 'active' : '';
?>" href="<?= UriFactory::build('{/lang}/{/app}/{/prefix}'); ?>admin/organizations"><?= $this->getHtml('Organizations', '0', '0'); ?></a>
<li><a class="<?= $this->request->uri->getPathElement(0) === 'admin'
&& $this->request->uri->getPathElement(1) === 'users'
? 'active' : '';
?>" href="<?= UriFactory::build('{/lang}/{/app}/{/prefix}'); ?>admin/users"><?= $this->getHtml('Users', '0', '0'); ?></a>
<li><a class="<?= $this->request->uri->getPathElement(0) === 'admin'
&& $this->request->uri->getPathElement(1) === 'resources'
? 'active' : '';
?>" href="<?= UriFactory::build('{/lang}/{/app}/{/prefix}'); ?>admin/resources"><?= $this->getHtml('Resources', '0', '0'); ?></a>
<li><a class="<?= $this->request->uri->getPathElement(0) === 'admin'
&& $this->request->uri->getPathElement(1) === 'bills'
? 'active' : '';
?>" href="<?= UriFactory::build('{/lang}/{/app}/{/prefix}'); ?>admin/bills"><?= $this->getHtml('Bills', '0', '0'); ?></a>
<li><a class="<?= $this->request->uri->getPathElement(0) === 'admin'
&& $this->request->uri->getPathElement(1) === 'logs'
? 'active' : '';
?>" href="<?= UriFactory::build('{/lang}/{/app}/{/prefix}'); ?>admin/logs"><?= $this->getHtml('Logs', '0', '0'); ?></a>
</ul>
</li>
<li>
<ul>
<li>
<label for="nav-org">
<i class=""></i>
<span><?= $this->getHtml('Organization', '0', '0'); ?></span>
</label>
</li>
<li><a class="<?= $this->request->uri->getPathElement(0) === 'organization'
&& $this->request->uri->getPathElement(1) === 'settings'
? 'active' : '';
?>" href="<?= UriFactory::build('{/lang}/{/app}/{/prefix}'); ?>organization/settings"><?= $this->getHtml('Settings', '0', '0'); ?></a>
<li><a class="<?= $this->request->uri->getPathElement(0) === 'organization'
&& $this->request->uri->getPathElement(1) === 'users'
? 'active' : '';
?>" href="<?= UriFactory::build('{/lang}/{/app}/{/prefix}'); ?>organization/users"><?= $this->getHtml('Users', '0', '0'); ?></a>
<li><a class="<?= $this->request->uri->getPathElement(0) === 'organization'
&& $this->request->uri->getPathElement(1) === 'resources'
? 'active' : '';
?>" href="<?= UriFactory::build('{/lang}/{/app}/{/prefix}'); ?>organization/resources"><?= $this->getHtml('Resources', '0', '0'); ?></a>
<li><a class="<?= $this->request->uri->getPathElement(0) === 'organization'
&& $this->request->uri->getPathElement(1) === 'bills'
? 'active' : '';
?>" href="<?= UriFactory::build('{/lang}/{/app}/{/prefix}'); ?>organization/bills"><?= $this->getHtml('Bills', '0', '0'); ?></a>
</ul>
</li>
<li>
<ul>
<li>
<label for="nav-home">
<i class=""></i>
<span><?= $this->getHtml('Home', '0', '0'); ?></span>
</label>
</li>
<li><a class="<?= $this->request->uri->getPathElement(0) === ''
? 'active' : '';
?>" href="<?= UriFactory::build('{/lang}/{/app}/{/prefix}');
?>"><?= $this->getHtml('Dashboard', '0', '0'); ?></a>
<li><a class="<?= $this->request->uri->getPathElement(0) === 'user'
&& $this->request->uri->getPathElement(1) === 'settings'
? 'active' : '';
?>" href="<?= UriFactory::build('{/lang}/{/app}/{/prefix}'); ?>user/settings"><?= $this->getHtml('Settings', '0', '0'); ?></a>
<li><a class="<?= $this->request->uri->getPathElement(0) === 'user'
&& $this->request->uri->getPathElement(1) === 'resources'
? 'active' : '';
?>" href="<?= UriFactory::build('{/lang}/{/app}/{/prefix}'); ?>user/resources"><?= $this->getHtml('Resources', '0', '0'); ?></a>
<li><a class="<?= $this->request->uri->getPathElement(0) === 'user'
&& $this->request->uri->getPathElement(1) === 'reports'
? 'active' : '';
?>" href="<?= UriFactory::build('{/lang}/{/app}/{/prefix}'); ?>user/reports"><?= $this->getHtml('Reports', '0', '0'); ?></a>
</ul>
</li>
<li>
<ul>
<li>
<label for="nav-legal">
<i class=""></i>
<span><?= $this->getHtml('Legal', '0', '0'); ?></span>
</label>
</li>
<li><a href="/privacy"><?= $this->getHtml('PrivacyPolicy', '0', '0'); ?></a>
<li><a href="/terms"><?= $this->getHtml('Terms', '0', '0'); ?></a>
<li><a href="/imprint"><?= $this->getHtml('Imprint', '0', '0'); ?></a>
</ul>
</li>
</ul>
</div>
</nav>

View File

@ -1,23 +0,0 @@
<?php
/**
* Karaka
*
* PHP Version 8.1
*
* @package Web\Backend
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://jingga.app
*/
declare(strict_types=1);
use phpOMS\Uri\UriFactory;
?>
<div id="t-nav-container">
<ul id="t-nav" role="navigation">
<li><a id="nav-logout" class="active" href="api/logout"
data-action='[{"key":1,"listener":"click","action":[{"key":1,"type":"event.prevent"},{"key":2,"type":"message.request","uri":"api\/logout","method":"POST","request_type":"raw"},{"key":3,"type":"dom.reload"}]}]' ><?= $this->getHtml('SignOut', '0', '0'); ?></a></li>
</ul>
</div>

View File

@ -1,99 +0,0 @@
<?php
/**
* Karaka
*
* PHP Version 8.1
*
* @package Modules\Auditor
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://jingga.app
*/
declare(strict_types=1);
use phpOMS\Uri\UriFactory;
/**
* @var \phpOMS\Views\View $this
* @var \Modules\Audit\Models\Audit[] $audits
*/
$audits = $this->getData('audits') ?? [];
$tableView = $this->getData('tableView');
$tableView->id = 'auditList';
$tableView->baseUri = ''{/lang}/{/app}/admin/audit/list';
$tableView->setObjects($audits);
$previous = $tableView->getPreviousLink(
$this->request,
empty($this->objects) || !$this->getData('hasPrevious') ? null : \reset($this->objects)
);
$next = $tableView->getNextLink(
$this->request,
empty($this->objects) ? null : \end($this->objects),
$this->getData('hasNext') ?? false
);
?>
<div class="row">
<div class="col-xs-12">
<div class="portlet">
<div class="portlet-head">
<?= $tableView->renderTitle(
$this->getHtml('Bills', '0', '0')
); ?>
</div>
<div class="slider">
<table id="<?= $tableView->id; ?>" class="default sticky">
<thead>
<tr>
<td><?= $tableView->renderHeaderElement(
'id',
$this->getHtml('ID', '0', '0'),
'number'
); ?>
<td class="wf-100"><?= $tableView->renderHeaderElement(
'number',
$this->getHtml('Number', '0', '0'),
'text'
); ?>
<td><?= $tableView->renderHeaderElement(
'amount',
$this->getHtml('Amount', '0', '0'),
'number'
); ?>
<td><?= $tableView->renderHeaderElement(
'createdAt',
$this->getHtml('Date', '0', '0'),
'date'
); ?>
<tbody>
<?php $count = 0;
foreach ($audits as $key => $audit) : ++$count;
$url = UriFactory::build('{/lang}/{/app}/'{/lang}/{/app}/admin/audit/single?id=' . $audit->getId()); ?>
<tr tabindex="0" data-href="<?= $url; ?>">
<td>
<td>
<td>
<td>
<?php endforeach; ?>
<?php if ($count === 0) : ?>
<tr><td colspan="8" class="empty"><?= $this->getHtml('Empty', '0', '0'); ?>
<?php endif; ?>
</table>
</div>
<?php if ($this->getData('hasPrevious') || $this->getData('hasNext')) : ?>
<div class="portlet-foot">
<?php if ($this->getData('hasPrevious')) : ?>
<a tabindex="0" class="button" href="<?= UriFactory::build($previous); ?>"><i class="fa fa-chevron-left"></i></a>
<?php endif; ?>
<?php if ($this->getData('hasNext')) : ?>
<a tabindex="0" class="button" href="<?= UriFactory::build($next); ?>"><i class="fa fa-chevron-right"></i></a>
<?php endif; ?>
</div>
<?php endif; ?>
</div>
</div>
</div>

View File

@ -1,116 +0,0 @@
<?php
/**
* Karaka
*
* PHP Version 8.1
*
* @package Modules\Auditor
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://jingga.app
*/
declare(strict_types=1);
use phpOMS\Uri\UriFactory;
/**
* @var \phpOMS\Views\View $this
* @var \Modules\Audit\Models\Audit[] $audits
*/
$audits = $this->getData('audits') ?? [];
$tableView = $this->getData('tableView');
$tableView->id = 'auditList';
$tableView->baseUri = '{/prefix}admin/audit/list';
$tableView->setObjects($audits);
$previous = $tableView->getPreviousLink(
$this->request,
empty($this->objects) || !$this->getData('hasPrevious') ? null : \reset($this->objects)
);
$next = $tableView->getNextLink(
$this->request,
empty($this->objects) ? null : \end($this->objects),
$this->getData('hasNext') ?? false
);
?>
<div class="row">
<div class="col-xs-12">
<div class="portlet">
<div class="portlet-head">
<?= $tableView->renderTitle(
$this->getHtml('Resources', '0', '0')
); ?>
</div>
<div class="slider">
<table id="<?= $tableView->id; ?>" class="default sticky">
<thead>
<tr>
<td><?= $tableView->renderHeaderElement(
'id',
$this->getHtml('ID', '0', '0'),
'number'
); ?>
<td class="wf-100"><?= $tableView->renderHeaderElement(
'resource',
$this->getHtml('Resource', '0', '0'),
'text'
); ?>
<td><?= $tableView->renderHeaderElement(
'user_no',
$this->getHtml('User', '0', '0'),
'number'
); ?>
<td><?= $tableView->renderHeaderElement(
'user_name',
$this->getHtml('User', '0', '0'),
'text'
); ?>
<td><?= $tableView->renderHeaderElement(
'status',
$this->getHtml('Status', '0', '0'),
'text'
); ?>
<td><?= $tableView->renderHeaderElement(
'lastChecked',
$this->getHtml('Checked', '0', '0'),
'date'
); ?>
<td><?= $tableView->renderHeaderElement(
'createdAt',
$this->getHtml('Date', '0', '0'),
'date'
); ?>
<tbody>
<?php $count = 0;
foreach ($audits as $key => $audit) : ++$count;
$url = UriFactory::build('{/lang}/{/app}/{/prefix}admin/audit/single?id=' . $audit->getId()); ?>
<tr tabindex="0" data-href="<?= $url; ?>">
<td>
<td>
<td>
<td>
<td>
<td>
<?php endforeach; ?>
<?php if ($count === 0) : ?>
<tr><td colspan="8" class="empty"><?= $this->getHtml('Empty', '0', '0'); ?>
<?php endif; ?>
</table>
</div>
<?php if ($this->getData('hasPrevious') || $this->getData('hasNext')) : ?>
<div class="portlet-foot">
<?php if ($this->getData('hasPrevious')) : ?>
<a tabindex="0" class="button" href="<?= UriFactory::build($previous); ?>"><i class="fa fa-chevron-left"></i></a>
<?php endif; ?>
<?php if ($this->getData('hasNext')) : ?>
<a tabindex="0" class="button" href="<?= UriFactory::build($next); ?>"><i class="fa fa-chevron-right"></i></a>
<?php endif; ?>
</div>
<?php endif; ?>
</div>
</div>
</div>

View File

@ -1,83 +0,0 @@
<?php
/**
* Karaka
*
* PHP Version 8.1
*
* @package Web\Backend
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://jingga.app
*/
declare(strict_types=1);
use phpOMS\Uri\UriFactory;
?>
<div class="row">
<div class="col-xs-12 col-md-6">
<div class="portlet">
<form id="iOrganizationSettings" action="<?= UriFactory::build('{/api}organization/settings'); ?>" method="post">
<div class="portlet-head"><?= $this->getHtml('BillingSettings', '0', '0'); ?></div>
<div class="portlet-body">
<div class="form-group">
<label for="iName"><?= $this->getHtml('Name', '0', '0'); ?></label>
<input id="iName" name="name" type="text" required>
</div>
<div class="form-group">
<label for="iAddress"><?= $this->getHtml('Address', '0', '0'); ?></label>
<input id="iAddress" name="address" type="text" required>
</div>
<div class="form-group">
<div class="input-control">
<label for="iPostal"><?= $this->getHtml('Postal', '0', '0'); ?></label>
<input id="iPostal" name="postal" type="text">
</div>
<div class="input-control">
<label for="iCity"><?= $this->getHtml('City', '0', '0'); ?></label>
<input id="iCity" name="city" type="text" required>
</div>
</div>
<div class="form-group">
<label for="iEmail"><?= $this->getHtml('BillingEmail', '0', '0'); ?></label>
<input id="iEmail" name="email" type="email" required>
</div>
</div>
<div class="portlet-foot">
<input id="iSubmitOrganization" name="submitOrganization" type="submit" value="<?= $this->getHtml('Save', '0', '0'); ?>">
</div>
</form>
</div>
</div>
<div class="col-xs-12 col-md-6">
<div class="portlet">
<form id="iPlanSettings" action="<?= UriFactory::build('{/api}organization/plan'); ?>" method="post">
<div class="portlet-head"><?= $this->getHtml('PlanSettings', '0', '0'); ?></div>
<div class="portlet-body">
</div>
<div class="portlet-foot">
<input id="iSubmitPlan" name="sbmitPlan" type="submit" value="<?= $this->getHtml('Save', '0', '0'); ?>">
</div>
</form>
</div>
</div>
</div>
<div class="row">
<div class="col-xs-12">
<div class="portlet">
<div class="portlet-head"><?= $this->getHtml('Statistics', '0', '0'); ?></div>
<div class="portlet-body">
</div>
<div class="portlet-foot">
<input id="iSubmitPlan" name="sbmitPlan" type="submit" value="<?= $this->getHtml('Save', '0', '0'); ?>">
</div>
</div>
</div>
</div>

View File

@ -1,106 +0,0 @@
<?php
/**
* Karaka
*
* PHP Version 8.1
*
* @package Modules\Auditor
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://jingga.app
*/
declare(strict_types=1);
use phpOMS\Uri\UriFactory;
/**
* @var \phpOMS\Views\View $this
* @var \Modules\Audit\Models\Audit[] $audits
*/
$audits = $this->getData('audits') ?? [];
$tableView = $this->getData('tableView');
$tableView->id = 'auditList';
$tableView->baseUri = ''{/lang}/{/app}/admin/audit/list';
$tableView->setObjects($audits);
$previous = $tableView->getPreviousLink(
$this->request,
empty($this->objects) || !$this->getData('hasPrevious') ? null : \reset($this->objects)
);
$next = $tableView->getNextLink(
$this->request,
empty($this->objects) ? null : \end($this->objects),
$this->getData('hasNext') ?? false
);
?>
<div class="row">
<div class="col-xs-12">
<div class="portlet">
<div class="portlet-head">
<?= $tableView->renderTitle(
$this->getHtml('Users', '0', '0')
); ?>
<a class="button rf save" href="<?= UriFactory::build('{/lang}/{/app}/'{/lang}/{/app}/'); ?>organization/users/add"><?= $this->getHtml('Add', '0', '0'); ?></a>
</div>
<div class="slider">
<table id="<?= $tableView->id; ?>" class="default sticky">
<thead>
<tr>
<td><?= $tableView->renderHeaderElement(
'id',
$this->getHtml('ID', '0', '0'),
'number'
); ?>
<td class="wf-100"><?= $tableView->renderHeaderElement(
'name',
$this->getHtml('User', '0', '0'),
'text'
); ?>
<td><?= $tableView->renderHeaderElement(
'resources',
$this->getHtml('Resources', '0', '0'),
'number'
); ?>
<td><?= $tableView->renderHeaderElement(
'lastActivity',
$this->getHtml('Active', '0', '0'),
'date'
); ?>
<td><?= $tableView->renderHeaderElement(
'createdAt',
$this->getHtml('Date', '0', '0'),
'date'
); ?>
<tbody>
<?php $count = 0;
foreach ($audits as $key => $audit) : ++$count;
$url = UriFactory::build('{/lang}/{/app}/'{/lang}/{/app}/admin/audit/single?id=' . $audit->getId()); ?>
<tr tabindex="0" data-href="<?= $url; ?>">
<td>
<td>
<td>
<td>
<td>
<?php endforeach; ?>
<?php if ($count === 0) : ?>
<tr><td colspan="8" class="empty"><?= $this->getHtml('Empty', '0', '0'); ?>
<?php endif; ?>
</table>
</div>
<?php if ($this->getData('hasPrevious') || $this->getData('hasNext')) : ?>
<div class="portlet-foot">
<?php if ($this->getData('hasPrevious')) : ?>
<a tabindex="0" class="button" href="<?= UriFactory::build($previous); ?>"><i class="fa fa-chevron-left"></i></a>
<?php endif; ?>
<?php if ($this->getData('hasNext')) : ?>
<a tabindex="0" class="button" href="<?= UriFactory::build($next); ?>"><i class="fa fa-chevron-right"></i></a>
<?php endif; ?>
</div>
<?php endif; ?>
</div>
</div>
</div>

View File

@ -4,7 +4,7 @@
*
* PHP Version 8.1
*
* @package Modules\Auditor
* @package Modules\OnlineResourceWatcher
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
@ -15,15 +15,15 @@ declare(strict_types=1);
use phpOMS\Uri\UriFactory;
/**
* @var \phpOMS\Views\View $this
* @var \Modules\Audit\Models\Audit[] $audits
* @var \phpOMS\Views\View $this
* @var \Modules\OnlineResourceWatcher\Models\Resource[] $resources
*/
$audits = $this->getData('audits') ?? [];
$resources = $this->getData('resources') ?? [];
$tableView = $this->getData('tableView');
$tableView->id = 'auditList';
$tableView->baseUri = '{/prefix}admin/audit/list';
$tableView->setObjects($audits);
$tableView->id = 'resourceList';
$tableView->baseUri = '{/prefix}orw/resource/list';
$tableView->setObjects($resources);
$previous = $tableView->getPreviousLink(
$this->request,
@ -42,9 +42,9 @@ $next = $tableView->getNextLink(
<div class="portlet">
<div class="portlet-head">
<?= $tableView->renderTitle(
$this->getHtml('Resources', '0', '0')
$this->getHtml('Resources')
); ?>
<a class="button rf save" href="<?= UriFactory::build('{/lang}/{/app}/{/prefix}'); ?>user/resources/create"><?= $this->getHtml('New', '0', '0'); ?></a>
<a class="button rf save" href="<?= UriFactory::build('{/lang}/{/app}/'); ?>orw/resources/create"><?= $this->getHtml('New', '0', '0'); ?></a>
</div>
<div class="slider">
<table id="<?= $tableView->id; ?>" class="default sticky">
@ -57,33 +57,34 @@ $next = $tableView->getNextLink(
); ?>
<td class="wf-100"><?= $tableView->renderHeaderElement(
'resource',
$this->getHtml('Resource', '0', '0'),
$this->getHtml('Resource'),
'text'
); ?>
<td><?= $tableView->renderHeaderElement(
'status',
$this->getHtml('Status', '0', '0'),
$this->getHtml('Status'),
'text'
); ?>
<td><?= $tableView->renderHeaderElement(
'lastChecked',
$this->getHtml('Checked', '0', '0'),
$this->getHtml('Checked'),
'date'
); ?>
<td><?= $tableView->renderHeaderElement(
'createdAt',
$this->getHtml('Date', '0', '0'),
$this->getHtml('Date'),
'date'
); ?>
<tbody>
<?php $count = 0;
foreach ($audits as $key => $audit) : ++$count;
$url = UriFactory::build('{/lang}/{/app}/{/prefix}admin/audit/single?id=' . $audit->getId()); ?>
foreach ($resources as $key => $resource) : ++$count;
$url = UriFactory::build('{/lang}/{/app}/{/prefix}orw/resource?id=' . $resource->getId()); ?>
<tr tabindex="0" data-href="<?= $url; ?>">
<td><?= $resource->getId(); ?>
<td><?= $this->printHtml($resource->title); ?>
<td><?= $this->printHtml((string) $resource->getStatus()); ?>
<td>
<td>
<td>
<td>
<td><?= $this->printHtml($resource->createdAt->format('Y-m-d')); ?>
<?php endforeach; ?>
<?php if ($count === 0) : ?>
<tr><td colspan="8" class="empty"><?= $this->getHtml('Empty', '0', '0'); ?>

View File

@ -0,0 +1,88 @@
<?php
/**
* Karaka
*
* PHP Version 8.1
*
* @package Web\Backend
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://jingga.app
*/
declare(strict_types=1);
use phpOMS\Uri\UriFactory;
$resource = $this->getData('resource');
?>
<div class="row">
<div class="col-xs-8">
<div class="portlet">
<form id="iResource" action="<?= UriFactory::build('{/api}resource'); ?>" method="post">
<div class="portlet-head"><?= $this->getHtml('Resource'); ?></div>
<div class="portlet-body">
<div class="form-group">
<label for="iName"><?= $this->getHtml('Name'); ?></label>
<input id="iName" name="name" type="text" value="<?= $this->printHtml($resource->title); ?>">
</div>
<div class="form-group">
<label for="iStatus"><?= $this->getHtml('Status'); ?></label>
<select id="iStatus" name="status">
<option value="1"<?= $resource->status === 1 ? ' selected' : ''; ?>>Active</option>
<option value="2"<?= $resource->status === 2 ? ' selected' : ''; ?>>Inactive</option>
</select>
</div>
<div class="form-group">
<label for="iUrl"><?= $this->getHtml('Url'); ?></label>
<input id="iUrl" name="uri" type="text" required>
</div>
<div class="form-group">
<label for="iXPath"><?= $this->getHtml('XPath'); ?></label>
<input id="iXPath" name="xpath" type="text">
</div>
</div>
<div class="portlet-foot">
<input id="iSubmitUser" name="submitUser" type="submit" value="<?= $this->getHtml('Save', '0', '0'); ?>">
</div>
</form>
</div>
</div>
<div class="col-xs-4">
<div class="portlet">
<div class="portlet-head"><?= $this->getHtml('History'); ?></div>
<div class="portlet-body">
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-xs-12">
<div class="portlet">
<div class="portlet-body">
<div id="resource" class="tabview tab-2 m-editor wf-100">
<ul class="tab-links">
<li><label tabindex="0" for="resource-c-tab-1"><?= $this->getHtml('Preview'); ?></label>
<li><label tabindex="1" for="resource-c-tab-2"><?= $this->getHtml('Comparison'); ?></label>
</ul>
<div class="tab-content">
<input type="radio" id="resource-c-tab-1" name="tabular-1" checked>
<div class="tab">
</div>
<input type="radio" id="resource-c-tab-2" name="tabular-1">
<div class="tab">
</div>
</div>
</div>
</div>
</div>
</div>
</div>

View File

@ -1,11 +0,0 @@
<div class="row">
<div class="col-xs-12">
<div class="portlet">
<div class="portlet-head">Test Title</div>
<div class="portlet-body">
</div>
<div class="portlet-foot">
</div>
</div>
</div>
</div>

View File

@ -1,99 +0,0 @@
<?php
/**
* Karaka
*
* PHP Version 8.1
*
* @package Modules\Auditor
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://jingga.app
*/
declare(strict_types=1);
use phpOMS\Uri\UriFactory;
/**
* @var \phpOMS\Views\View $this
* @var \Modules\Audit\Models\Audit[] $audits
*/
$audits = $this->getData('audits') ?? [];
$tableView = $this->getData('tableView');
$tableView->id = 'auditList';
$tableView->baseUri = '{/prefix}admin/audit/list';
$tableView->setObjects($audits);
$previous = $tableView->getPreviousLink(
$this->request,
empty($this->objects) || !$this->getData('hasPrevious') ? null : \reset($this->objects)
);
$next = $tableView->getNextLink(
$this->request,
empty($this->objects) ? null : \end($this->objects),
$this->getData('hasNext') ?? false
);
?>
<div class="row">
<div class="col-xs-12">
<div class="portlet">
<div class="portlet-head">
<?= $tableView->renderTitle(
$this->getHtml('Reports', '0', '0')
); ?>
</div>
<div class="slider">
<table id="<?= $tableView->id; ?>" class="default sticky">
<thead>
<tr>
<td><?= $tableView->renderHeaderElement(
'id',
$this->getHtml('ID', '0', '0'),
'number'
); ?>
<td class="wf-100"><?= $tableView->renderHeaderElement(
'resource',
$this->getHtml('Resource', '0', '0'),
'text'
); ?>
<td><?= $tableView->renderHeaderElement(
'status',
$this->getHtml('Status', '0', '0'),
'text'
); ?>
<td><?= $tableView->renderHeaderElement(
'createdAt',
$this->getHtml('Date', '0', '0'),
'date'
); ?>
<tbody>
<?php $count = 0;
foreach ($audits as $key => $audit) : ++$count;
$url = UriFactory::build('{/lang}/{/app}/{/prefix}admin/audit/single?id=' . $audit->getId()); ?>
<tr tabindex="0" data-href="<?= $url; ?>">
<td>
<td>
<td>
<td>
<?php endforeach; ?>
<?php if ($count === 0) : ?>
<tr><td colspan="8" class="empty"><?= $this->getHtml('Empty', '0', '0'); ?>
<?php endif; ?>
</table>
</div>
<?php if ($this->getData('hasPrevious') || $this->getData('hasNext')) : ?>
<div class="portlet-foot">
<?php if ($this->getData('hasPrevious')) : ?>
<a tabindex="0" class="button" href="<?= UriFactory::build($previous); ?>"><i class="fa fa-chevron-left"></i></a>
<?php endif; ?>
<?php if ($this->getData('hasNext')) : ?>
<a tabindex="0" class="button" href="<?= UriFactory::build($next); ?>"><i class="fa fa-chevron-right"></i></a>
<?php endif; ?>
</div>
<?php endif; ?>
</div>
</div>
</div>

View File

@ -1,50 +0,0 @@
<?php
/**
* Karaka
*
* PHP Version 8.1
*
* @package Web\Backend
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://jingga.app
*/
declare(strict_types=1);
use phpOMS\Uri\UriFactory;
?>
<div class="row">
<div class="col-xs-12">
<div class="portlet">
<form id="iUserSettings" action="<?= UriFactory::build('{/api}user/settings'); ?>" method="post">
<div class="portlet-head"><?= $this->getHtml('UserSettings', '0', '0'); ?></div>
<div class="portlet-body">
<div class="form-group">
<label for="iLogin"><?= $this->getHtml('Login', '0', '0'); ?></label>
<input id="iLogin" name="login" type="text" disabled>
</div>
<div class="form-group">
<label for="iPassword"><?= $this->getHtml('NewPassword', '0', '0'); ?></label>
<input id="iPassword" name="password" type="password">
</div>
<div class="form-group">
<label for="iEmail"><?= $this->getHtml('Email', '0', '0'); ?></label>
<input id="iEmail" name="email" type="email" required>
</div>
<div class="form-group">
<label for="iEmail"><?= $this->getHtml('Organization', '0', '0'); ?></label>
<input id="iEmail" name="organization" type="text" disabled="">
<input type="submit" value="<?= $this->getHtml('Exit', '0', '0'); ?>">
</div>
</div>
<div class="portlet-foot">
<input id="iSubmitUser" name="submitUser" type="submit" value="<?= $this->getHtml('Save', '0', '0'); ?>">
</div>
</form>
</div>
</div>
</div>

View File

@ -17,9 +17,11 @@
"description": "OnlineResourceWatcher module.",
"directory": "OnlineResourceWatcher",
"dependencies": {
"Admin": "1.0.0",
"Media": "*"
},
"providing": {
"Navigation": "*"
},
"load": [
{

@ -1 +1 @@
Subproject commit 24068a973461f7d5aecfce6fb4feb3d382ba7140
Subproject commit 0f9a1b17321170523ada479604a2bf21e00ce3ed