* Adjust code for run ztf script.
This commit is contained in:
@@ -296,15 +296,18 @@ function runAutocase()
|
||||
var url = createLink('zanode', 'ajaxRunZTFScript', 'scriptID=' + automation)
|
||||
|
||||
var postData = {'caseIDList' : caseIDList.join(',')};
|
||||
|
||||
var response = true;
|
||||
$.post(url, postData, function(result)
|
||||
{
|
||||
if(result.result == 'fail')
|
||||
{
|
||||
alert(result.message);
|
||||
return false;
|
||||
response = false;
|
||||
}
|
||||
return true;
|
||||
}, 'json');
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
function confirmAction(obj)
|
||||
|
||||
@@ -176,15 +176,17 @@ function runAutocase()
|
||||
var url = createLink('zanode', 'ajaxRunZTFScript', 'scriptID=' + automation)
|
||||
|
||||
var postData = {'caseIDList' : caseIDList.join(',')};
|
||||
|
||||
var response = true;
|
||||
$.post(url, postData, function(result)
|
||||
{
|
||||
if(result.result == 'fail')
|
||||
{
|
||||
alert(result.message);
|
||||
return false;
|
||||
response = false;
|
||||
}
|
||||
return true;
|
||||
}, 'json');
|
||||
return response;
|
||||
}
|
||||
|
||||
function confirmAction(obj)
|
||||
|
||||
@@ -1381,7 +1381,13 @@ class testtask extends control
|
||||
|
||||
/* Set modules. */
|
||||
$moduleOptionMenu = array(0 => '/');
|
||||
foreach($cases as $case) $moduleOptionMenu += $this->tree->getModulesName($case->module);
|
||||
foreach($cases as $caseID => $case)
|
||||
{
|
||||
if($case->auto == 'auto' and $confirm == 'yes') unset($cases[$caseID]);
|
||||
$moduleOptionMenu += $this->tree->getModulesName($case->module);
|
||||
}
|
||||
if(empty($cases)) return print(js::locate($url));
|
||||
|
||||
$this->view->moduleOptionMenu = $moduleOptionMenu;
|
||||
|
||||
/* If case has changed and not confirmed, remove it. */
|
||||
|
||||
@@ -39,11 +39,7 @@
|
||||
<td class='text-left wordwrap'><?php echo "<span title='{$case->title}'>{$case->title}</span>"?></td>
|
||||
<td class='text-left precondition wordwrap'><?php echo "<span title='{$case->precondition}'>{$case->precondition}</span>"?></td>
|
||||
<td class='text-left'>
|
||||
<?php if($confirm == 'yes'):?>
|
||||
<?php echo html::hidden("results[$caseID]", '');?>
|
||||
<?php else:?>
|
||||
<?php echo html::radio("results[$caseID]", $this->lang->testcase->resultList, 'pass', "onclick='showAction(this.value,\".action$caseID\")'", 'block')?>
|
||||
<?php endif;?>
|
||||
</td>
|
||||
<td>
|
||||
<?php if(!empty($steps[$caseID])):?>
|
||||
|
||||
@@ -177,15 +177,18 @@ function runAutocase()
|
||||
var url = createLink('zanode', 'ajaxRunZTFScript', 'scriptID=' + automation)
|
||||
|
||||
var postData = {'caseIDList' : caseIDList.join(',')};
|
||||
|
||||
var response = true;
|
||||
$.post(url, postData, function(result)
|
||||
{
|
||||
if(result.result == 'fail')
|
||||
{
|
||||
alert(result.message);
|
||||
return false;
|
||||
response = false;
|
||||
}
|
||||
return true;
|
||||
}, 'json');
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
function confirmAction(obj)
|
||||
|
||||
@@ -736,7 +736,7 @@ class zanodemodel extends model
|
||||
);
|
||||
|
||||
$result = json_decode(commonModel::http("http://{$node->ip}:{$node->ztf}/api/v1/jobs/add", json_encode($params), array(), array("Authorization:$node->tokenSN")));
|
||||
if(empty($result->data) || $result->code != 0)
|
||||
if($result->code != 0)
|
||||
{
|
||||
$this->dao->delete()->from(TABLE_TESTRESULT)->where('id')->eq($task)->exec();
|
||||
return dao::$errors = $this->lang->zanode->runTimeout;
|
||||
|
||||
Reference in New Issue
Block a user