From 2a69e95fb514b39892ebf75bd72cd0b2162be8bd Mon Sep 17 00:00:00 2001 From: caoyanyi Date: Fri, 21 Jun 2024 13:23:45 +0800 Subject: [PATCH] * [bug#51534] add tips for gitlab webhook result. --- module/gitlab/lang/de.php | 2 +- module/gitlab/lang/en.php | 2 +- module/gitlab/lang/fr.php | 2 +- module/gitlab/lang/zh-cn.php | 2 +- module/gitlab/model.php | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/module/gitlab/lang/de.php b/module/gitlab/lang/de.php index 53cf4fa9a7..ecc772118f 100644 --- a/module/gitlab/lang/de.php +++ b/module/gitlab/lang/de.php @@ -26,7 +26,7 @@ $lang->gitlab->serverFail = 'Connect to GitLab server failed, please chec $lang->gitlab->lastUpdate = 'Last Update'; $lang->gitlab->confirmAddWebhook = 'Are you sure about creating Webhook?'; $lang->gitlab->addWebhookSuccess = 'Webhook created successfully'; -$lang->gitlab->failCreateWebhook = 'Failed to create Webhook, please view the log'; +$lang->gitlab->failCreateWebhook = 'Failed to create Webhook, please view the log in tmp/log/saas.' . date('Ymd') . '.log.php'; $lang->gitlab->placeholderSearch = 'Enter name'; $lang->gitlab->bindStatus['binded'] = $lang->gitlab->binded; diff --git a/module/gitlab/lang/en.php b/module/gitlab/lang/en.php index 320f8caab2..012fe63cd7 100644 --- a/module/gitlab/lang/en.php +++ b/module/gitlab/lang/en.php @@ -26,7 +26,7 @@ $lang->gitlab->serverFail = 'Connect to GitLab server failed, please chec $lang->gitlab->lastUpdate = 'Last Update'; $lang->gitlab->confirmAddWebhook = 'Are you sure about creating Webhook?'; $lang->gitlab->addWebhookSuccess = 'Webhook created successfully'; -$lang->gitlab->failCreateWebhook = 'Failed to create Webhook, please view the log'; +$lang->gitlab->failCreateWebhook = 'Failed to create Webhook, please view the log in tmp/log/saas.' . date('Ymd') . '.log.php'; $lang->gitlab->placeholderSearch = 'Enter name'; $lang->gitlab->bindStatus['binded'] = $lang->gitlab->binded; diff --git a/module/gitlab/lang/fr.php b/module/gitlab/lang/fr.php index 2c187da664..aa1ff6645c 100644 --- a/module/gitlab/lang/fr.php +++ b/module/gitlab/lang/fr.php @@ -26,7 +26,7 @@ $lang->gitlab->serverFail = 'Connect to GitLab server failed, please chec $lang->gitlab->lastUpdate = 'Last Update'; $lang->gitlab->confirmAddWebhook = 'Are you sure about creating Webhook?'; $lang->gitlab->addWebhookSuccess = 'Webhook created successfully'; -$lang->gitlab->failCreateWebhook = 'Failed to create Webhook, please view the log'; +$lang->gitlab->failCreateWebhook = 'Failed to create Webhook, please view the log in tmp/log/saas.' . date('Ymd') . '.log.php'; $lang->gitlab->placeholderSearch = 'Enter name'; $lang->gitlab->bindStatus['binded'] = $lang->gitlab->binded; diff --git a/module/gitlab/lang/zh-cn.php b/module/gitlab/lang/zh-cn.php index d0cdbd9327..12cf8acdaf 100644 --- a/module/gitlab/lang/zh-cn.php +++ b/module/gitlab/lang/zh-cn.php @@ -26,7 +26,7 @@ $lang->gitlab->serverFail = '连接GitLab服务器异常,请检查GitLa $lang->gitlab->lastUpdate = '最后更新'; $lang->gitlab->confirmAddWebhook = '您确定创建Webhook吗?'; $lang->gitlab->addWebhookSuccess = 'Webhook创建成功'; -$lang->gitlab->failCreateWebhook = 'Webhook创建失败,请查看日志'; +$lang->gitlab->failCreateWebhook = 'Webhook创建失败,请在tmp/log/saas.' . date('Ymd') . '.log.php 中查看日志'; $lang->gitlab->placeholderSearch = '请输入名称'; $lang->gitlab->bindStatus['binded'] = $lang->gitlab->binded; diff --git a/module/gitlab/model.php b/module/gitlab/model.php index 91592b79b7..96da5bf7b2 100644 --- a/module/gitlab/model.php +++ b/module/gitlab/model.php @@ -1063,7 +1063,7 @@ class gitlabModel extends model $apiRoot = $this->getApiRoot($gitlabID, false); $url = sprintf($apiRoot, "/projects/{$projectID}/hooks"); - return json_decode(commonModel::http($url, $newHook)); + return json_decode(commonModel::http($url, $newHook, array(), array(), 'json')); } /** @@ -1111,7 +1111,7 @@ class gitlabModel extends model if(!empty($result->id)) return true; - if(!empty($result->message)) return array('result' => 'fail', 'message' => $result->message); + if(!empty($result->message)) return array('result' => 'fail', 'message' => $this->lang->gitlab->failCreateWebhook); return false; }