Skip to content

Commit

Permalink
=
Browse files Browse the repository at this point in the history
  • Loading branch information
arikaim-repository committed Sep 13, 2020
1 parent f00493b commit bc5e413
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 23 deletions.
23 changes: 23 additions & 0 deletions Api/Ui/Page.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,29 @@ public function loadPageHtml($request, $response, $data, $pageName = null)
return $this->setResult($result)->getResponse();
}

/**
* Load library details
*
* @param \Psr\Http\Message\ServerRequestInterface $request
* @param \Psr\Http\Message\ResponseInterface $response
* @param Validator $data
* @return Psr\Http\Message\ResponseInterface
*/
public function loadLibraryDetails($request, $response, $data)
{
$libraryName = $data->get('name',null);
$data = $this->get('page')->getLibraryDetails($libraryName);
$result = [
'name' => $libraryName,
'css_files' => (isset($data['files']['css']) == true) ? $data['files']['css'] : [],
'js_files' => (isset($data['files']['js']) == true) ? $data['files']['js'] : [],
'async' => $data['async'],
'crossorigin' => $data['crossorigin']
];

return $this->setResult($result)->getResponse();
}

/**
* Get html page properties
*
Expand Down
11 changes: 4 additions & 7 deletions App/Commands/Job/RunJobCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,9 @@ protected function executeCommand($input, $output)
$this->showError("Not valid job name!");
return;
}
$result = Arikaim::queue()->execute($name);

if ($result === false) {
$this->showError("Error execution job!");
} else {
$this->showCompleted();
}

Arikaim::queue()->executeJob($name);

$this->showCompleted();
}
}
5 changes: 3 additions & 2 deletions App/SystemRoutes.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,14 @@ public static function mapSystemRoutes()
Arikaim::$app->post('/core/api/verify/request/',"$apiNamespace\Client:verifyRequest");
// UI Component
Arikaim::$app->get('/core/api/ui/component/properties/{name}[/{params:.*}]',"$apiNamespace\Ui\Component:componentProperties");

Arikaim::$app->get('/core/api/ui/component/details/{name}[/{params:.*}]',"$apiNamespace\Ui\Component:componentDetails")->add($sessionAuth);
Arikaim::$app->map(['GET','POST'],'/core/api/ui/component/{name}[/{params:.*}]',"$apiNamespace\Ui\Component:loadComponent");

// UI Page
Arikaim::$app->get('/core/api/ui/page/{name}',"$apiNamespace\Ui\Page:loadPageHtml");
Arikaim::$app->get('/core/api/ui/page/properties/',"$apiNamespace\Ui\Page:loadPageProperties");
// UI Library
Arikaim::$app->get('/core/api/ui/library/{name}',"$apiNamespace\Ui\Page:loadLibraryDetails");

// Paginator
Arikaim::$app->group('/core/api/ui/paginator',function($group) use($apiNamespace) {
$group->put('/page-size',"$apiNamespace\Ui\Paginator:setPageSize");
Expand Down
17 changes: 4 additions & 13 deletions App/TwigExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ public function getFunctions()
}

$items = [
new TwigFunction('isMobile',[$this,'isMobile']),
new TwigFunction('isMobile',['Arikaim\\Core\\Utils\\Mobile','mobile']),
// paginator
new TwigFunction('paginate',['Arikaim\\Core\\Paginator\\SessionPaginator','create']),
new TwigFunction('paginatorUrl',[$this,'getPaginatorUrl']),
Expand Down Expand Up @@ -298,6 +298,9 @@ public function getFilters()
new TwigFilter('numberFormat',["Arikaim\\Core\\Utils\\Number",'format']),
// text
new TwigFilter('mask',["Arikaim\\Core\\Utils\\Text",'mask']),
new TwigFilter('pad',["Arikaim\\Core\\Utils\\Text",'pad']),
new TwigFilter('padLeft',["Arikaim\\Core\\Utils\\Text",'padLeft']),
new TwigFilter('padRight',["Arikaim\\Core\\Utils\\Text",'padRight']),
// files
new TwigFilter('fileSize',["Arikaim\\Core\\Utils\\File",'getSizeText']),
new TwigFilter('baseName',["Arikaim\\Core\\Utils\\File",'baseName']),
Expand Down Expand Up @@ -335,18 +338,6 @@ public function getAccess()
return $this->access;
}

/**
* True if request is from mobile browser
*
* @return boolean
*/
public function isMobile()
{
$mobile = new Mobile();

return $mobile->isMobile();
}

/**
* Get composer packages info
*
Expand Down
5 changes: 4 additions & 1 deletion Models/Jobs.php
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,10 @@ public function getJob($id)
public function hasJob($id)
{
$model = $this->findById($id);

if (\is_object($model) == false) {
$model = $this->findByColumn($id,'name');
}

return \is_object($model);
}

Expand Down

0 comments on commit bc5e413

Please sign in to comment.