* Add modal.alert of gitlab,jenkins,job.
This commit is contained in:
@@ -231,8 +231,9 @@ class gitlab extends control
|
||||
$actionID = $this->pipeline->delete($id, 'gitlab');
|
||||
if(!$actionID)
|
||||
{
|
||||
$response['result'] = 'fail';
|
||||
$response['message'] = $this->lang->pipeline->delError;
|
||||
$response['result'] = 'fail';
|
||||
$response['callback'] = sprintf('zui.Modal.alert("%s");', $this->lang->pipeline->delError);
|
||||
|
||||
return $this->send($response);
|
||||
}
|
||||
|
||||
|
||||
@@ -105,8 +105,8 @@ class jenkins extends control
|
||||
$jobs = $this->dao->select('*')->from(TABLE_JOB)->where('server')->eq($id)->andWhere('engine')->eq('jenkins')->andWhere('deleted')->eq('0')->fetchAll();
|
||||
if($jobs)
|
||||
{
|
||||
$response['result'] = 'fail';
|
||||
$response['message'] = $this->lang->jenkins->error->linkedJob;
|
||||
$response['result'] = 'fail';
|
||||
$response['callback'] = sprintf('zui.Modal.alert("%s");', $this->lang->jenkins->error->linkedJob);
|
||||
|
||||
return $this->send($response);
|
||||
}
|
||||
|
||||
@@ -84,10 +84,11 @@ $config->job->actionList['edit']['text'] = $lang->job->edit;
|
||||
$config->job->actionList['edit']['hint'] = $lang->job->edit;
|
||||
$config->job->actionList['edit']['url'] = helper::createLink('job', 'edit',"jobID={id}");
|
||||
|
||||
$config->job->actionList['exec']['icon'] = 'play';
|
||||
$config->job->actionList['exec']['text'] = $lang->job->exec;
|
||||
$config->job->actionList['exec']['hint'] = $lang->job->exec;
|
||||
$config->job->actionList['exec']['url'] = helper::createLink('job', 'exec',"jobID={id}");
|
||||
$config->job->actionList['exec']['icon'] = 'play';
|
||||
$config->job->actionList['exec']['text'] = $lang->job->exec;
|
||||
$config->job->actionList['exec']['hint'] = $lang->job->exec;
|
||||
$config->job->actionList['exec']['className'] = 'ajax-submit';
|
||||
$config->job->actionList['exec']['url'] = helper::createLink('job', 'exec',"jobID={id}");
|
||||
|
||||
$config->job->actionList['delete']['icon'] = 'trash';
|
||||
$config->job->actionList['delete']['text'] = $lang->job->delete;
|
||||
|
||||
@@ -265,7 +265,7 @@ class job extends control
|
||||
*/
|
||||
public function view($jobID, $compileID = 0)
|
||||
{
|
||||
$job = $this->job->getById($jobID);
|
||||
$job = $this->job->getById($jobID);
|
||||
|
||||
$this->loadModel('compile');
|
||||
if($compileID)
|
||||
@@ -348,11 +348,15 @@ class job extends control
|
||||
if(strtolower($job->engine) == 'gitlab' and (!isset($job->reference) or !$job->reference)) return $this->send(array('result' => 'fail', 'message' => $this->lang->job->setReferenceTips, 'locate' => inlink('edit', "id=$jobID")));
|
||||
|
||||
$compile = $this->job->exec($jobID);
|
||||
if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError()));
|
||||
if(dao::isError()) return $this->send(array('result' => 'fail', 'callback' => sprintf('zui.Modal.alert("%s");', dao::getError())));
|
||||
|
||||
$this->app->loadLang('compile');
|
||||
$this->loadModel('action')->create('job', $jobID, 'executed');
|
||||
return $this->send(array('result' => 'success', 'message' => sprintf($this->lang->job->sendExec, zget($this->lang->compile->statusList, $compile->status))));
|
||||
|
||||
$message = sprintf($this->lang->job->sendExec, zget($this->lang->compile->statusList, $compile->status));
|
||||
$response['result'] = 'success';
|
||||
$response['callback'] = sprintf('zui.Modal.alert("%s");', $message);
|
||||
return $this->send($response);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -681,7 +681,7 @@ class jobModel extends model
|
||||
* @param string $action
|
||||
* @param string $module
|
||||
* @access public
|
||||
* @return void
|
||||
* @return bool
|
||||
*/
|
||||
public static function isClickable($object, $action, $module = 'job')
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user