This commit is contained in:
zhaoke
2023-09-07 18:40:00 +08:00
parent b36fa3ee9e
commit 112e31b3cc
7 changed files with 18 additions and 4 deletions
+4 -1
View File
@@ -57,6 +57,7 @@ class artifactrepo extends control
{
$repo = form::data($this->config->artifactrepo->form->create)
->join('products', ',')
->add('editedBy', $this->app->user->account)
->add('createdBy', $this->app->user->account)
->add('createdDate', helper::now())
->get();
@@ -138,7 +139,9 @@ class artifactrepo extends control
{
$repos = $this->artifactrepo->getServerRepos($serverID);
return print(json_encode($repos));
if(!$repos['result']) return $this->send(array('result' => 'fail', 'message' => $this->lang->artifactrepo->loseConnect));
return print(json_encode($repos['data']));
}
public function ajaxUpdateArtifactRepos()
+7
View File
@@ -11,12 +11,19 @@ function getArtifactRepo(event)
{
const server = $(event.target).val();
const url = $.createLink('artifactrepo', 'ajaxGetArtifactRepos', 'serverID=' + server);
if(!server) return;
toggleLoading('#repoName', true);
$.get(url, function(response)
{
repoData = JSON.parse(response);
if(repoData.result !== undefined && repoData.result === 'fail')
{
zui.Modal.alert(repoData.message);
toggleLoading('#repoName', false);
return;
}
var repoItems = [];
for(i in repoData)
{
+1
View File
@@ -15,3 +15,4 @@ $lang->artifactrepo->url = 'Repo Address';
$lang->artifactrepo->confirmDelete = 'Are you sure you want to delete this aritfact repo?';
$lang->artifactrepo->deleteError = 'The artifact repo is already associated with a build. Please cancel the association and try again';
$lang->artifactrepo->loseConnect = 'Artifact repo server not responding';
+1
View File
@@ -15,3 +15,4 @@ $lang->artifactrepo->url = 'Repo Address';
$lang->artifactrepo->confirmDelete = 'Are you sure you want to delete this artifact repo?';
$lang->artifactrepo->deleteError = 'The artifact repo is already associated with a build. Please cancel the association and try again';
$lang->artifactrepo->loseConnect = 'Artifact repo server not responding';
+1
View File
@@ -15,3 +15,4 @@ $lang->artifactrepo->url = 'Repo Address';
$lang->artifactrepo->confirmDelete = 'Are you sure you want to delete this aritfact repo?';
$lang->artifactrepo->deleteError = 'The artifact repo is already associated with a build. Please cancel the association and try again';
$lang->artifactrepo->loseConnect = 'Artifact repo server not responding';
+1
View File
@@ -15,3 +15,4 @@ $lang->artifactrepo->url = '库地址';
$lang->artifactrepo->confirmDelete = '您确认要删除该制品库吗?';
$lang->artifactrepo->deleteError = '当前制品库中制品已关联版本,请取消关联后重试。';
$lang->artifactrepo->loseConnect = '制品库服务器无法连接';
+3 -3
View File
@@ -74,9 +74,9 @@ class artifactrepoModel extends model
$url = $server->url . '/service/rest/v1/repositorySettings';
$auth = "{$server->account}:{$server->password}";
$response = common::http($url, '', array(CURLOPT_USERPWD => $auth));
$data = json_decode($response);
return is_array($data) ? $data : array();
$response = common::http($url, '', array(CURLOPT_USERPWD => $auth), array(), 'data', 'POST', 10, true);
$data = array('result' => $response[1] == 200, 'data' => json_decode($response['body']));
return $data;
}
return array();