-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
JobEnv downloader added RuntemplateChart added
- Loading branch information
Showing
10 changed files
with
153 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/** | ||
* This file is part of the MultiFlexi package | ||
* | ||
* https://multiflexi.eu/ | ||
* | ||
* (c) Vítězslav Dvořák <http://vitexsoftware.com> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace MultiFlexi\Ui; | ||
|
||
/** | ||
* Description of AllJobsLastMonthChart. | ||
* | ||
* @author vitex | ||
*/ | ||
class AppLastMonthChart extends JobChart | ||
{ | ||
public function __construct(\MultiFlexi\Application $engine, $properties = []) | ||
{ | ||
parent::__construct($engine, $properties); | ||
} | ||
|
||
/** | ||
* @return type | ||
*/ | ||
public function getJobs() | ||
{ | ||
$today = date('Y-m-d'); | ||
$lastMonth = date('Y-m-d', strtotime('-30 days', strtotime($today))); | ||
|
||
return parent::getJobs()->where("begin BETWEEN date('".$lastMonth."') AND date('".$today."')")->where('app_id', $this->engine->getMyKey()); | ||
// return parent::getJobs()->where('begin BETWEEN (CURDATE() - INTERVAL 30 DAY) AND CURDATE()'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/** | ||
* This file is part of the MultiFlexi package | ||
* | ||
* https://multiflexi.eu/ | ||
* | ||
* (c) Vítězslav Dvořák <http://vitexsoftware.com> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace MultiFlexi\Ui; | ||
|
||
/** | ||
* Description of AppJson. | ||
* | ||
* @author vitex | ||
*/ | ||
class JobDotEnv extends \Ease\Html\DivTag | ||
{ | ||
/** | ||
* APP JSON Viewer. | ||
* | ||
* @param array<string, string> $properties | ||
*/ | ||
public function __construct(\MultiFlexi\Job $job, array $properties = []) | ||
{ | ||
parent::__construct(new \Ease\Html\PreTag($job->envFile()), $properties); | ||
$this->addTagClass('ui-monospace custom-control'); | ||
$this->addItem(new \Ease\TWB4\LinkButton('jobenv.php?id='.$job->getMyKey(), _('Download').' multiflexi_job_'.$job->getMyKey().'.env', 'info ')); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/** | ||
* This file is part of the MultiFlexi package | ||
* | ||
* https://multiflexi.eu/ | ||
* | ||
* (c) Vítězslav Dvořák <http://vitexsoftware.com> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace MultiFlexi\Ui; | ||
|
||
/** | ||
* Description of RunTemplateJobsLastMonthChart. | ||
* | ||
* @author Vitex <info@vitexsoftware.cz> | ||
*/ | ||
class RunTemplateJobsLastMonthChart extends JobChart | ||
{ | ||
public function __construct(\MultiFlexi\RunTemplate $engine, $properties = []) | ||
{ | ||
parent::__construct($engine, $properties); | ||
} | ||
|
||
/** | ||
* @return type | ||
*/ | ||
public function getJobs() | ||
{ | ||
$today = date('Y-m-d'); | ||
$lastMonth = date('Y-m-d', strtotime('-30 days', strtotime($today))); | ||
|
||
return parent::getJobs()->where("begin BETWEEN date('".$lastMonth."') AND date('".$today."')")->where('runtemplate_id', $this->engine->getMyKey()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/** | ||
* This file is part of the MultiFlexi package | ||
* | ||
* https://multiflexi.eu/ | ||
* | ||
* (c) Vítězslav Dvořák <http://vitexsoftware.com> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace MultiFlexi\Ui; | ||
|
||
require_once './init.php'; | ||
WebPage::singleton()->onlyForLogged(); | ||
$jobID = WebPage::singleton()->getRequestValue('id', 'int'); | ||
|
||
if ($jobID) { | ||
$jobber = new \MultiFlexi\Job($jobID); | ||
header('Content-Type: text/x-env'); | ||
header('Content-Disposition: attachment; filename="multiflexi_job_'.$jobID.'.env"'); | ||
echo $jobber->envFile(); | ||
} |