* Fix bug 31348.

This commit is contained in:
zhaoke
2023-01-03 05:26:19 +00:00
parent caa5450c97
commit f8a69684b4
5 changed files with 7 additions and 7 deletions
+3 -3
View File
@@ -3204,7 +3204,7 @@ EOD;
* @access public
* @return string
*/
public static function http($url, $data = null, $options = array(), $headers = array(), $dataType = 'data', $method = 'POST')
public static function http($url, $data = null, $options = array(), $headers = array(), $dataType = 'data', $method = 'POST', $timeout = 30)
{
global $lang, $app;
if(!extension_loaded('curl'))
@@ -3226,8 +3226,8 @@ EOD;
$curl = curl_init();
curl_setopt($curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);
curl_setopt($curl, CURLOPT_USERAGENT, 'Sae T OAuth2 v0.1');
curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 30);
curl_setopt($curl, CURLOPT_TIMEOUT, 30);
curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, $timeout);
curl_setopt($curl, CURLOPT_TIMEOUT, $timeout);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($curl, CURLOPT_ENCODING, "");
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);
+1 -1
View File
@@ -149,7 +149,7 @@
<tbody>
<?php foreach($nodeList as $node):?>
<tr>
<td title="<?php echo $node->name;?>"><?php echo html::a($this->createLink('zanode', 'view', "id=$node->id"), $node->name, '', "");?></td>
<td title="<?php echo $node->name;?>"><?php echo html::a($this->createLink('zanode', 'view', "id=$node->id"), $node->name, '_target', "");?></td>
<td><?php echo zget($config->zanode->os->cpuCores, $node->cpuCores);?></td>
<td><?php echo $node->memory . $this->lang->zahost->unitList['GB'];?></td>
<td><?php echo $node->diskSize . $this->lang->zahost->unitList['GB'];?></td>
+1 -1
View File
@@ -24,7 +24,7 @@ $('#checkServiceStatus').click(function(){
if(resultData.data[key] == 'ready' || resultData.data[key] == 'not_available')
{
$('.ztf-status').text(zanodeLang.init[resultData.data[key]])
$('.ztf-install').text(zanodeLang.reinstall);
$('.ztf-install').text('');
}
else
{
+1 -1
View File
@@ -695,7 +695,7 @@ class zanodemodel extends model
*/
public function getServiceStatus($node)
{
$result = json_decode(commonModel::http("http://{$node->ip}:{$node->zap}/api/v1/service/check", json_encode(array("services" => "all")), array(), array("Authorization:$node->tokenSN")));
$result = json_decode(commonModel::http("http://{$node->ip}:{$node->zap}/api/v1/service/check", json_encode(array("services" => "all")), array(), array("Authorization:$node->tokenSN"), 'data', 'POST', 2));
if(empty($result->data->ztfStatus) || $result->code != 'success')
{
$result = new stdclass;
+1 -1
View File
@@ -137,7 +137,7 @@ $account = strpos($zanode->osName, "windows") ? $config->zanode->defaultWinAccou
</span>
</div>
<div class="status-notice">
<span class='init-success hide'><?php echo sprintf($lang->zanode->init->initSuccessNoticeTitle, "<a href='https://www.zentao.net/book/zentaopms/971.html'>{$lang->zanode->manual}</a>", html::a(helper::createLink('testcase', 'automation', "", '', true), $lang->zanode->automation, '', "class='iframe' title='{$lang->zanode->automation}' data-width='50%'", '')); ?></span>
<span class='init-success hide'><?php echo sprintf($lang->zanode->init->initSuccessNoticeTitle, "<a href='https://www.zentao.net/book/zentaopms/configure-environment-974.html'>{$lang->zanode->manual}</a>", html::a(helper::createLink('testcase', 'automation', "", '', true), $lang->zanode->automation, '', "class='iframe' title='{$lang->zanode->automation}' data-width='50%'", '')); ?></span>
<span class='init-fail hide'><?php echo $lang->zanode->init->initFailNoticeTitle . '<br/>' . $lang->zanode->init->initFailNoticeDesc;?></span>
</div>