mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-22 09:22:22 +00:00
- Added new constant BEGINNING_OF_TIME
- Added new config entry job_type_permissions_white_list in jqm.php - Added new navigation entry jobsqueueviewer - Added new model application/models/system/JobsQueue_model.php - Added new option in FilterWidget for hours comparison with dates - Added new filter core-jq-lastHour to system/filtersupdate.php - Added new statements to system/dbupdate_3.3.php to create tables system.tbl_jobstatuses, system.tbl_jobtypes and system.tbl_jobstatuses - Added new views application/views/system/jq/jobsQueueViewer.php and application/views/system/jq/jobsQueueViewerData.php
This commit is contained in:
@@ -1,56 +0,0 @@
|
||||
<?php
|
||||
|
||||
if (!defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* Jobs Queue Manager
|
||||
*/
|
||||
class JobsQueueMonitor extends Auth_Controller
|
||||
{
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct(
|
||||
array(
|
||||
'getJobsByType' => 'monitoring:r',
|
||||
'getJobsByStatus' => 'monitoring:r',
|
||||
'getJobsByCreationTime' => 'monitoring:r'
|
||||
)
|
||||
);
|
||||
|
||||
// Loads JobsQueueLib
|
||||
$this->load->library('JobsQueueLib');
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function getJobsByType()
|
||||
{
|
||||
$jobType = $this->input->get(JobsQueueLib::PARAM_JOB_TYPE);
|
||||
|
||||
$this->outputJson($this->jobsqueuelib->getJobsByType($jobType));
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function getJobsByStatus()
|
||||
{
|
||||
$jobStatus = $this->input->get(JobsQueueLib::PARAM_JOB_STATUS);
|
||||
|
||||
$this->outputJson($this->jobsqueuelib->getJobsByStatus($jobStatus));
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function getJobsByCreationTime()
|
||||
{
|
||||
$jobCreationTime = $this->input->get(JobsQueueLib::PARAM_JOB_CREATION_TIME);
|
||||
|
||||
$this->outputJson($this->jobsqueuelib->getJobsByCreationTime($jobCreationTime));
|
||||
}
|
||||
}
|
||||
@@ -35,7 +35,7 @@ class LogsViewer extends Auth_Controller
|
||||
// Public methods
|
||||
|
||||
/**
|
||||
* Main page of the InfoCenter tool
|
||||
* Everything has a beginning
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
|
||||
if (!defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* This controller acts as REST JSON interface between the JobsQueueLib, that contains all the needed functionalities to
|
||||
* operate with the Jobs Queue System, and other tools that cannot access directly to such library
|
||||
*/
|
||||
class JobsQueueManager extends Auth_Controller
|
||||
{
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct(
|
||||
array(
|
||||
'getJobsByType' => 'admin:r',
|
||||
'addNewJobsToQueue' => 'admin:rw'
|
||||
)
|
||||
);
|
||||
|
||||
// Loads JobsQueueLib
|
||||
$this->load->library('JobsQueueLib');
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
/**
|
||||
* To get all the most recently added jobs using the given job type
|
||||
*/
|
||||
public function getLastJobs()
|
||||
{
|
||||
$type = $this->input->get(JobsQueueLib::PARAM_JOB_TYPE);
|
||||
|
||||
$this->outputJson($this->jobsqueuelib->getLastJobs($type));
|
||||
}
|
||||
|
||||
/**
|
||||
* Add new jobs in the jobs queue with the given type
|
||||
* jobs is an array of job objects
|
||||
*/
|
||||
public function addNewJobsToQueue()
|
||||
{
|
||||
$type = $this->input->post(JobsQueueLib::PARAM_JOB_TYPE);
|
||||
$jobs = $this->input->post(JobsQueueLib::PARAM_JOBS);
|
||||
|
||||
$this->outputJson($this->jobsqueuelib->addNewJobsToQueue($type, $jobs));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
if (!defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* Jobs Queue Viewer
|
||||
*
|
||||
* This controller renders a FilterWidget to monitor the current status of the Jobs Queue System
|
||||
*/
|
||||
class JobsQueueViewer extends Auth_Controller
|
||||
{
|
||||
const PARAM_START_DATE = 'startDate';
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct(
|
||||
array(
|
||||
'index' => 'system/developer:r'
|
||||
)
|
||||
);
|
||||
|
||||
// Loads WidgetLib
|
||||
$this->load->library('WidgetLib');
|
||||
|
||||
// Loads phrases system
|
||||
$this->loadPhrases(
|
||||
array(
|
||||
'global',
|
||||
'ui',
|
||||
'filter'
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
/**
|
||||
* Everything has a beginning
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$this->load->view('system/jq/jobsQueueViewer.php');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user