From: Marcin Haba Date: Tue, 9 Dec 2014 21:21:24 +0000 (+0100) Subject: baculum: Enable support for Verify jobs X-Git-Tag: Release-7.2.0~93 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=b22089404b22dadb8c4bbe8e3fffc4b60a632fb3;p=bacula%2Fbacula baculum: Enable support for Verify jobs --- diff --git a/gui/baculum/protected/Class/Miscellaneous.php b/gui/baculum/protected/Class/Miscellaneous.php index b167b94b42..ad0b61021e 100644 --- a/gui/baculum/protected/Class/Miscellaneous.php +++ b/gui/baculum/protected/Class/Miscellaneous.php @@ -4,7 +4,59 @@ class Miscellaneous extends TModule { const LICENCE_FILE = 'LICENSE'; - private $jobLevels = array('F' => 'Full', 'I' => 'Incremental', 'D'=> 'Differential', 'B' => 'Base', 'f' => 'VirtualFull'); + private $jobTypes = array( + 'B' => 'Backup', + 'M' => 'Migrated', + 'V' => 'Verify', + 'R' => 'Restore', + 'I' => 'Internal', + 'D' => 'Admin', + 'A' => 'Archive', + 'C' => 'Copy', + 'g' => 'Migration' + ); + + private $jobLevels = array( + 'F' => 'Full', + 'I' => 'Incremental', + 'D' => 'Differential', + 'B' => 'Base', + 'f' => 'VirtualFull', + 'V' => 'InitCatalog', + 'C' => 'Catalog', + 'O' => 'VolumeToCatalog', + 'd' => 'DiskToCatalog' + ); + + private $jobStates = array( + 'C' => array('value' => 'Created', 'description' =>'Created but not yet running'), + 'R' => array('value' => 'Running', 'description' => 'Running'), + 'B' => array('value' => 'Blocked', 'description' => 'Blocked'), + 'T' => array('value' => 'Terminated', 'description' =>'Terminated normally'), + 'W' => array('value' => 'Terminated with warnings', 'description' =>'Terminated normally with warnings'), + 'E' => array('value' => 'Error', 'description' =>'Terminated in Error'), + 'e' => array('value' => 'Non-fatal error', 'description' =>'Non-fatal error'), + 'f' => array('value' => 'Fatal error', 'description' =>'Fatal error'), + 'D' => array('value' => 'Verify Diff.', 'description' =>'Verify Differences'), + 'A' => array('value' => 'Canceled by user', 'description' =>'Canceled by the user'), + 'I' => array('value' => 'Incomplete', 'description' =>'Incomplete Job'), + 'F' => array('value' => 'Waiting on FD', 'description' =>'Waiting on the File daemon'), + 'S' => array('value' => 'Waiting on SD', 'description' =>'Waiting on the Storage daemon'), + 'm' => array('value' => 'Waiting for new vol.', 'description' =>'Waiting for a new Volume to be mounted'), + 'M' => array('value' => 'Waiting for mount', 'description' =>'Waiting for a Mount'), + 's' => array('value' => 'Waiting for storage', 'description' =>'Waiting for Storage resource'), + 'j' => array('value' => 'Waiting for job', 'description' =>'Waiting for Job resource'), + 'c' => array('value' => 'Waiting for client', 'description' =>'Waiting for Client resource'), + 'd' => array('value' => 'Waiting for Max. jobs', 'description' =>'Wating for Maximum jobs'), + 't' => array('value' => 'Waiting for start', 'description' =>'Waiting for Start Time'), + 'p' => array('value' => 'Waiting for higher priority', 'description' =>'Waiting for higher priority job to finish'), + 'i' => array('value' => 'Batch insert', 'description' =>'Doing batch insert file records'), + 'a' => array('value' => 'Despooling attributes', 'description' =>'SD despooling attributes'), + 'l' => array('value' => 'Data despooling', 'description' =>'Doing data despooling'), + 'L' => array('value' => 'Commiting data', 'description' =>'Committing data (last despool)') + ); + + private $runningJobStates = array('C', 'R'); /** * Getting the licence from file. @@ -20,6 +72,32 @@ class Miscellaneous extends TModule { return $this->jobLevels; } + public function getJobState($jobStateLetter = null) { + $state; + if(is_null($jobStateLetter)) { + $state = $this->jobStates; + } else { + $state = array_key_exists($jobStateLetter, $this->jobStates) ? $this->jobStates[$jobStateLetter] : null; + } + return $state; + } + + public function getRunningJobStates() { + return $this->runningJobStates; + } + + + public function getJobType($jobTypeLetter = null) { + $type; + if(is_null($jobTypeLetter)) { + $type = $this->jobTypes; + } else { + $type = array_key_exists($jobTypeLetter, $this->jobTypes) ? $this->jobTypes[$jobTypeLetter] : null; + } + return $type; + + } + public function isValidJobLevel($jobLevel) { return array_key_exists($jobLevel, $this->getJobLevels()); } @@ -140,4 +218,4 @@ class Miscellaneous extends TModule { return $elements; } } -?> \ No newline at end of file +?> diff --git a/gui/baculum/protected/Lang/en/messages.mo b/gui/baculum/protected/Lang/en/messages.mo index 0a2bde7889..5b75739980 100755 Binary files a/gui/baculum/protected/Lang/en/messages.mo and b/gui/baculum/protected/Lang/en/messages.mo differ diff --git a/gui/baculum/protected/Lang/en/messages.po b/gui/baculum/protected/Lang/en/messages.po index dbb62f7e26..a2457c4895 100755 --- a/gui/baculum/protected/Lang/en/messages.po +++ b/gui/baculum/protected/Lang/en/messages.po @@ -986,3 +986,20 @@ msgstr "Vol. Use Duration (in sec.):" msgid "Yes" msgstr "Yes" +msgid "JobId to Verify:" +msgstr "JobId to Verify:" + +msgid "JobId to Verify value must be integer greather than 0." +msgstr "JobId to Verify value must be integer greather than 0." + +msgid "Job to Verify:" +msgstr "Job to Verify:" + +msgid "Verify by Job Name" +msgstr "Verify by Job Name" + +msgid "Verify by JobId" +msgstr "Verify by JobId" + +msgid "Verify option:" +msgstr "Verify option:" diff --git a/gui/baculum/protected/Lang/pl/messages.mo b/gui/baculum/protected/Lang/pl/messages.mo index a1da8d1dc2..f05d48bc1e 100755 Binary files a/gui/baculum/protected/Lang/pl/messages.mo and b/gui/baculum/protected/Lang/pl/messages.mo differ diff --git a/gui/baculum/protected/Lang/pl/messages.po b/gui/baculum/protected/Lang/pl/messages.po index b4ea2f6bb9..b0d5575c49 100644 --- a/gui/baculum/protected/Lang/pl/messages.po +++ b/gui/baculum/protected/Lang/pl/messages.po @@ -321,10 +321,10 @@ msgid "Database file path (SQLite only):" msgstr "Lokalizacja pliku DB (tylko SQLite):" msgid "Delete job" -msgstr "Usuń zadanie" +msgstr "Usuń" msgid "Cancel job" -msgstr "Anuluj zadanie" +msgstr "Przerwij" msgid "select pool" msgstr "wybierz pulę" @@ -459,7 +459,7 @@ msgid "Jobs for run" msgstr "Zadania do uruchomienia" msgid "Job status" -msgstr "Status zadania" +msgstr "Status" msgid "Run job again" msgstr "Uruchom ponownie" @@ -987,3 +987,21 @@ msgstr "Zadanie do przywrócenia:" msgid "Step 7 - Finish" msgstr "Krok 7 - Podsumowanie" +msgid "JobId to Verify:" +msgstr "JobId do weryfikacji:" + +msgid "JobId to Verify value must be integer greather than 0." +msgstr "JobId do weryfikacji musi być liczbą całkowitą większą od 0." + +msgid "Job to Verify:" +msgstr "Zadanie do weryfikacji:" + +msgid "Verify by Job Name" +msgstr "Weryfikuj na podstawie nazwy zadania" + +msgid "Verify by JobId" +msgstr "Weryfikuj na podstawie JobId" + +msgid "Verify option:" +msgstr "Opcja weryfikacji:" + diff --git a/gui/baculum/protected/Pages/API/JobRun.php b/gui/baculum/protected/Pages/API/JobRun.php index 30b4309693..d54d5cf9fd 100644 --- a/gui/baculum/protected/Pages/API/JobRun.php +++ b/gui/baculum/protected/Pages/API/JobRun.php @@ -33,6 +33,9 @@ class JobRun extends BaculumAPI { $poolid = property_exists($params, 'poolid') ? intval($params->poolid) : null; $pool = $this->getModule('pool')->getPoolById($poolid); $priority = property_exists($params, 'priority') ? intval($params->priority) : 10; // default priority is set to 10 + $jobid = property_exists($params, 'jobid') ? 'jobid="' . intval($params->jobid) . '"' : ''; + // @TODO: Move Job name pattern in more appropriate place + $verifyjob = property_exists($params, 'verifyjob') && preg_match('/^[\w\d\.\-\s]+$/', $params->verifyjob) === 1 ? 'verifyjob="' . ($params->verifyjob) . '"' : ''; if(!is_null($job)) { $isValidLevel = $this->getModule('misc')->isValidJobLevel($params->level); @@ -42,7 +45,7 @@ class JobRun extends BaculumAPI { if(!is_null($storage)) { if(!is_null($pool)) { $joblevels = $this->getModule('misc')->getJobLevels(); - $run = $this->getModule('bconsole')->bconsoleCommand($this->director, array('run', 'job="' . $job . '"', 'level="' . $joblevels[$level] . '"', 'fileset="' . $fileset . '"', 'client="' . $client->name . '"', 'storage="' . $storage->name . '"', 'pool="' . $pool->name . '"' , 'priority="' . $priority . '"', 'yes'), $this->user); + $run = $this->getModule('bconsole')->bconsoleCommand($this->director, array('run', 'job="' . $job . '"', 'level="' . $joblevels[$level] . '"', 'fileset="' . $fileset . '"', 'client="' . $client->name . '"', 'storage="' . $storage->name . '"', 'pool="' . $pool->name . '"' , 'priority="' . $priority . '"', $jobid , $verifyjob, 'yes'), $this->user); $this->output = $run->output; $this->error = (integer)$run->exitcode; } else { @@ -72,4 +75,4 @@ class JobRun extends BaculumAPI { } } -?> \ No newline at end of file +?> diff --git a/gui/baculum/protected/Portlets/JobConfiguration.php b/gui/baculum/protected/Portlets/JobConfiguration.php index e08869d227..f0b19fbb9a 100644 --- a/gui/baculum/protected/Portlets/JobConfiguration.php +++ b/gui/baculum/protected/Portlets/JobConfiguration.php @@ -17,13 +17,17 @@ * Bacula® is a registered trademark of Kern Sibbald. */ +Prado::using('System.Web.UI.ActiveControls.TActivePanel'); Prado::using('Application.Portlets.Portlets'); class JobConfiguration extends Portlets { const DEFAULT_JOB_PRIORITY = 10; - private $runningJobStates = array('C', 'R'); + + public $jobToVerify = array('C', 'O', 'd'); + + public $verifyOptions = array('jobname' => 'Verify by Job Name', 'jobid' => 'Verify by JobId'); public function configure($jobId) { $jobdata = $this->Application->getModule('api')->get(array('jobs', $jobId))->output; @@ -36,6 +40,32 @@ class JobConfiguration extends Portlets { $this->Level->SelectedValue = $jobdata->level; $this->Level->dataBind(); + $isVerifyOption = in_array($jobdata->level, $this->jobToVerify); + $this->JobToVerifyOptionsLine->Display = ($isVerifyOption === true) ? 'Dynamic' : 'None'; + $this->JobToVerifyJobNameLine->Display = ($isVerifyOption === true) ? 'Dynamic' : 'None'; + $this->JobToVerifyJobIdLine->Display = 'None'; + $this->AccurateLine->Display = ($isVerifyOption === true) ? 'None' : 'Dynamic'; + $this->EstimateLine->Display = ($isVerifyOption === true) ? 'None' : 'Dynamic'; + + $verifyValues = array(); + + foreach($this->verifyOptions as $value => $text) { + $verifyValues[$value] = Prado::localize($text); + } + + $this->JobToVerifyOptions->dataSource = $verifyValues; + $this->JobToVerifyOptions->dataBind(); + + $jobTasks = $this->Application->getModule('api')->get(array('jobs', 'tasks'))->output; + + $jobsAllDirs = array(); + foreach($jobTasks as $director => $tasks) { + $jobsAllDirs = array_merge($jobsAllDirs, $tasks); + } + + $this->JobToVerifyJobName->dataSource = array_combine($jobsAllDirs, $jobsAllDirs); + $this->JobToVerifyJobName->dataBind(); + $clients = $this->Application->getModule('api')->get(array('clients'))->output; $clientsList = array(); foreach($clients as $client) { @@ -74,9 +104,11 @@ class JobConfiguration extends Portlets { $this->Storage->dataSource = $storagesList; $this->Storage->dataBind(); + $runningJobStates = $this->Application->getModule('misc')->getRunningJobStates(); + $this->Priority->Text = ($jobdata->priorjobid == 0) ? self::DEFAULT_JOB_PRIORITY : $jobdata->priorjobid; $this->DeleteButton->Visible = true; - $this->CancelButton->Visible = in_array($jobdata->jobstatus, $this->runningJobStates); + $this->CancelButton->Visible = in_array($jobdata->jobstatus, $runningJobStates); } public function status($sender, $param) { @@ -106,6 +138,16 @@ class JobConfiguration extends Portlets { $params['storageid'] = $this->Storage->SelectedValue; $params['poolid'] = $this->Pool->SelectedValue; $params['priority'] = $this->Priority->Text; + + if (in_array($this->Level->SelectedItem->Value, $this->jobToVerify)) { + $verifyVals = $this->getVerifyVals(); + if ($this->JobToVerifyOptions->SelectedItem->Value == $verifyVals['jobname']) { + $params['verifyjob'] = $this->JobToVerifyJobName->SelectedValue; + } elseif ($this->JobToVerifyOptions->SelectedItem->Value == $verifyVals['jobid']) { + $params['jobid'] = $this->JobToVerifyJobId->Text; + } + } + $result = $this->Application->getModule('api')->create(array('jobs', 'run'), $params)->output; $this->Estimation->Text = implode(PHP_EOL, $result); } @@ -125,5 +167,22 @@ class JobConfiguration extends Portlets { $isValid = preg_match('/^[0-9]+$/',$this->Priority->Text) === 1 && $this->Priority->Text > 0; $param->setIsValid($isValid); } + + public function jobIdToVerifyValidator($sender, $param) { + $verifyVals = $this->getVerifyVals(); + if(in_array($this->Level->SelectedValue, $this->jobToVerify) && $this->JobToVerifyOptions->SelectedItem->Value == $verifyVals['jobid']) { + $isValid = preg_match('/^[0-9]+$/',$this->JobToVerifyJobId->Text) === 1 && $this->JobToVerifyJobId->Text > 0; + } else { + $isValid = true; + } + $param->setIsValid($isValid); + return $isValid; + } + + private function getVerifyVals() { + $verifyOpt = array_keys($this->verifyOptions); + $verifyVals = array_combine($verifyOpt, $verifyOpt); + return $verifyVals; + } } ?> diff --git a/gui/baculum/protected/Portlets/JobConfiguration.tpl b/gui/baculum/protected/Portlets/JobConfiguration.tpl index 298d5fe4ac..1052462f13 100644 --- a/gui/baculum/protected/Portlets/JobConfiguration.tpl +++ b/gui/baculum/protected/Portlets/JobConfiguration.tpl @@ -13,9 +13,73 @@
- + + + var job_to_verify = $('<%=$this->JobToVerifyOptionsLine->ClientID%>'); + var verify_options = $('<%=$this->JobToVerifyOptionsLine->ClientID%>'); + var verify_by_job_name = $('<%=$this->JobToVerifyJobNameLine->ClientID%>'); + var verify_by_jobid = $('<%=$this->JobToVerifyJobIdLine->ClientID%>'); + var accurate = $('<%=$this->AccurateLine->ClientID%>'); + var estimate = $('<%=$this->EstimateLine->ClientID%>'); + var verify_current_opt = $('<%=$this->JobToVerifyOptions->ClientID%>').value; + if(/^(<%=implode('|', $this->jobToVerify)%>)$/.test(this.value)) { + accurate.hide(); + estimate.hide(); + verify_options.show(); + job_to_verify.show(); + if (verify_current_opt == 'jobid') { + verify_by_job_name.hide(); + verify_by_jobid.show(); + } else if (verify_current_opt == 'jobname') { + verify_by_job_name.show(); + verify_by_jobid.hide(); + } + } else if (job_to_verify.visible()) { + job_to_verify.hide(); + verify_options.hide(); + verify_by_job_name.hide(); + verify_by_jobid.hide(); + accurate.show(); + estimate.show(); + } + +
+ +
+
+ + + var verify_by_job_name = $('<%=$this->JobToVerifyJobNameLine->ClientID%>'); + var verify_by_jobid = $('<%=$this->JobToVerifyJobIdLine->ClientID%>'); + if (this.value == 'jobname') { + verify_by_jobid.hide(); + verify_by_job_name.show(); + } else if (this.value == 'jobid') { + verify_by_job_name.hide(); + verify_by_jobid.show(); + } else { + verify_by_job_name.hide(); + verify_by_jobid.hide(); + } + + +
+
+ +
+
+ +
+
+ +
+
+ + +
+
@@ -68,12 +132,12 @@
-
+
-
-
+ + -
+ diff --git a/gui/baculum/protected/Portlets/JobList.php b/gui/baculum/protected/Portlets/JobList.php index 1748575f0a..12cd790a5b 100644 --- a/gui/baculum/protected/Portlets/JobList.php +++ b/gui/baculum/protected/Portlets/JobList.php @@ -31,18 +31,8 @@ class JobList extends Portlets implements ISlideWindow { public $buttonID; public $windowTitle; public $jobLevels; - private $jobStates; - private $jobTypes = array( - 'B' => 'Backup', - 'M' => 'Migrated', - 'V' => 'Verify', - 'R' => 'Restore', - 'I' => 'Internal', - 'D' => 'Admin', - 'A' => 'Archive', - 'C' => 'Copy', - 'g' => 'Migration' - ); + public $jobStates; + public $jobTypes; public function setID($id) { $this->ID = $id; @@ -71,42 +61,10 @@ class JobList extends Portlets implements ISlideWindow { public function onLoad($param) { parent::onLoad($param); $this->prepareData(); - $this->jobLevels = $this->Application->getModule('misc')->getJobLevels(); - } - - public function getJobType($jobLetter) { - return array_key_exists($jobLetter, $this->jobTypes) ? $this->jobTypes[$jobLetter] : null; - } - - public function getJobState($jobStateLetter) { - $jobstates = array( - 'C' => (object)array('value' => 'Created', 'description' =>'Created but not yet running'), - 'R' => (object)array('value' => 'Running', 'description' => 'Running'), - 'B' => (object)array('value' => 'Blocked', 'description' => 'Blocked'), - 'T' => (object)array('value' => 'Terminated', 'description' =>'Terminated normally'), - 'W' => (object)array('value' => 'Terminated with warnings', 'description' =>'Terminated normally with warnings'), - 'E' => (object)array('value' => 'Error', 'description' =>'Terminated in Error'), - 'e' => (object)array('value' => 'Non-fatal error', 'description' =>'Non-fatal error'), - 'f' => (object)array('value' => 'Fatal error', 'description' =>'Fatal error'), - 'D' => (object)array('value' => 'Verify', 'description' =>'Verify Differences'), - 'A' => (object)array('value' => 'Canceled by user', 'description' =>'Canceled by the user'), - 'I' => (object)array('value' => 'Incomplete', 'description' =>'Incomplete Job'), - 'F' => (object)array('value' => 'Waiting on FD', 'description' =>'Waiting on the File daemon'), - 'S' => (object)array('value' => 'Waiting on SD', 'description' =>'Waiting on the Storage daemon'), - 'm' => (object)array('value' => 'Waiting for new vol.', 'description' =>'Waiting for a new Volume to be mounted'), - 'M' => (object)array('value' => 'Waiting for mount', 'description' =>'Waiting for a Mount'), - 's' => (object)array('value' => 'Waiting for storage', 'description' =>'Waiting for Storage resource'), - 'j' => (object)array('value' => 'Waiting for job', 'description' =>'Waiting for Job resource'), - 'c' => (object)array('value' => 'Waiting for client', 'description' =>'Waiting for Client resource'), - 'd' => (object)array('value' => 'Waiting for Max. jobs', 'description' =>'Wating for Maximum jobs'), - 't' => (object)array('value' => 'Waiting for start', 'description' =>'Waiting for Start Time'), - 'p' => (object)array('value' => 'Waiting for higher priority', 'description' =>'Waiting for higher priority job to finish'), - 'i' => (object)array('value' => 'Batch insert', 'description' =>'Doing batch insert file records'), - 'a' => (object)array('value' => 'Despooling attributes', 'description' =>'SD despooling attributes'), - 'l' => (object)array('value' => 'Data despooling', 'description' =>'Doing data despooling'), - 'L' => (object)array('value' => 'Commiting data', 'description' =>'Committing data (last despool)') - ); - return array_key_exists($jobStateLetter, $jobstates) ? $jobstates[$jobStateLetter] : null; + $misc = $this->Application->getModule('misc'); + $this->jobLevels = $misc->getJobLevels(); + $this->jobStates = $misc->getJobState(); + $this->jobTypes = $misc->getJobType(); } public function prepareData($forceReload = false) { diff --git a/gui/baculum/protected/Portlets/JobList.tpl b/gui/baculum/protected/Portlets/JobList.tpl index 5b8d800f18..cdde59509b 100644 --- a/gui/baculum/protected/Portlets/JobList.tpl +++ b/gui/baculum/protected/Portlets/JobList.tpl @@ -38,19 +38,19 @@ - + T - + L -
<%=isset($this->getPage()->JobWindow->getJobState($this->getParent()->Data['jobstatus'])->value) ? $this->getPage()->JobWindow->getJobState($this->getParent()->Data['jobstatus'])->value : ''%>
+
<%=isset($this->getPage()->JobWindow->jobStates[$this->getParent()->Data['jobstatus']]['value']) ? $this->getPage()->JobWindow->jobStates[$this->getParent()->Data['jobstatus']]['value'] : ''%>
'Verify by Job Name', 'jobid' => 'Verify by JobId'); + public function configure($jobname) { $this->JobName->Text = $jobname; $this->Estimation->Text = ''; @@ -30,6 +35,31 @@ class JobRunConfiguration extends Portlets { $this->Level->dataSource = $this->Application->getModule('misc')->getJobLevels(); $this->Level->dataBind(); + $this->JobToVerifyOptionsLine->Display = 'None'; + $this->JobToVerifyJobNameLine->Display = 'None'; + $this->JobToVerifyJobIdLine->Display = 'None'; + $this->AccurateLine->Display = 'Dynamic'; + $this->EstimateLine->Display = 'Dynamic'; + + $verifyValues = array(); + + foreach($this->verifyOptions as $value => $text) { + $verifyValues[$value] = Prado::localize($text); + } + + $this->JobToVerifyOptions->dataSource = $verifyValues; + $this->JobToVerifyOptions->dataBind(); + + $jobTasks = $this->Application->getModule('api')->get(array('jobs', 'tasks'))->output; + + $jobsAllDirs = array(); + foreach($jobTasks as $director => $tasks) { + $jobsAllDirs = array_merge($jobsAllDirs, $tasks); + } + + $this->JobToVerifyJobName->dataSource = array_combine($jobsAllDirs, $jobsAllDirs); + $this->JobToVerifyJobName->dataBind(); + $clients = $this->Application->getModule('api')->get(array('clients'))->output; $clientsList = array(); foreach($clients as $client) { @@ -77,6 +107,16 @@ class JobRunConfiguration extends Portlets { $params['storageid'] = $this->Storage->SelectedValue; $params['poolid'] = $this->Pool->SelectedValue; $params['priority'] = $this->Priority->Text; + + if (in_array($this->Level->SelectedItem->Value, $this->jobToVerify)) { + $verifyVals = $this->getVerifyVals(); + if ($this->JobToVerifyOptions->SelectedItem->Value == $verifyVals['jobname']) { + $params['verifyjob'] = $this->JobToVerifyJobName->SelectedValue; + } elseif ($this->JobToVerifyOptions->SelectedItem->Value == $verifyVals['jobid']) { + $params['jobid'] = $this->JobToVerifyJobId->Text; + } + } + $result = $this->Application->getModule('api')->create(array('jobs', 'run'), $params)->output; $this->Estimation->Text = implode(PHP_EOL, $result); } @@ -96,5 +136,22 @@ class JobRunConfiguration extends Portlets { $isValid = preg_match('/^[0-9]+$/', $this->Priority->Text) === 1 && $this->Priority->Text > 0; $param->setIsValid($isValid); } + + public function jobIdToVerifyValidator($sender, $param) { + $verifyVals = $this->getVerifyVals(); + if(in_array($this->Level->SelectedValue, $this->jobToVerify) && $this->JobToVerifyOptions->SelectedItem->Value == $verifyVals['jobid']) { + $isValid = preg_match('/^[0-9]+$/',$this->JobToVerifyJobId->Text) === 1 && $this->JobToVerifyJobId->Text > 0; + } else { + $isValid = true; + } + $param->setIsValid($isValid); + return $isValid; + } + + private function getVerifyVals() { + $verifyOpt = array_keys($this->verifyOptions); + $verifyVals = array_combine($verifyOpt, $verifyOpt); + return $verifyVals; + } } ?> diff --git a/gui/baculum/protected/Portlets/JobRunConfiguration.tpl b/gui/baculum/protected/Portlets/JobRunConfiguration.tpl index d83f29a540..e0500c994d 100644 --- a/gui/baculum/protected/Portlets/JobRunConfiguration.tpl +++ b/gui/baculum/protected/Portlets/JobRunConfiguration.tpl @@ -13,9 +13,73 @@
- + + + var job_to_verify = $('<%=$this->JobToVerifyOptionsLine->ClientID%>'); + var verify_options = $('<%=$this->JobToVerifyOptionsLine->ClientID%>'); + var verify_by_job_name = $('<%=$this->JobToVerifyJobNameLine->ClientID%>'); + var verify_by_jobid = $('<%=$this->JobToVerifyJobIdLine->ClientID%>'); + var accurate = $('<%=$this->AccurateLine->ClientID%>'); + var estimate = $('<%=$this->EstimateLine->ClientID%>'); + var verify_current_opt = $('<%=$this->JobToVerifyOptions->ClientID%>').value; + if(/^(<%=implode('|', $this->jobToVerify)%>)$/.test(this.value)) { + accurate.hide(); + estimate.hide(); + verify_options.show(); + job_to_verify.show(); + if (verify_current_opt == 'jobid') { + verify_by_job_name.hide(); + verify_by_jobid.show(); + } else if (verify_current_opt == 'jobname') { + verify_by_job_name.show(); + verify_by_jobid.hide(); + } + } else if (job_to_verify.visible()) { + job_to_verify.hide(); + verify_options.hide(); + verify_by_job_name.hide(); + verify_by_jobid.hide(); + accurate.show(); + estimate.show(); + } + +
+ +
+
+ + + var verify_by_job_name = $('<%=$this->JobToVerifyJobNameLine->ClientID%>'); + var verify_by_jobid = $('<%=$this->JobToVerifyJobIdLine->ClientID%>'); + if (this.value == 'jobname') { + verify_by_jobid.hide(); + verify_by_job_name.show(); + } else if (this.value == 'jobid') { + verify_by_job_name.hide(); + verify_by_jobid.show(); + } else { + verify_by_job_name.hide(); + verify_by_jobid.hide(); + } + + +
+
+ +
+
+ +
+
+ +
+
+ + +
+
@@ -64,12 +128,12 @@
-
+
-
-
+ + -
+ diff --git a/gui/baculum/themes/Baculum-v1/style.css b/gui/baculum/themes/Baculum-v1/style.css index ee37ff7425..181a3b7389 100644 --- a/gui/baculum/themes/Baculum-v1/style.css +++ b/gui/baculum/themes/Baculum-v1/style.css @@ -424,7 +424,7 @@ tr.slide-window-element:hover td, tr.slide-window-element-alternating:hover td{ table.window-section-detail, table.file-browser-detail { background-color: rgba(0,0,0,0.5); width: 100%; - font-size: 11px; + font-size: 10px; font-weight: normal; } @@ -675,7 +675,7 @@ div.job-status-W { } div.job-status-D { - background-color: blue; + background-color: #CB4A2C; } /*