* Add edit nexus server.

This commit is contained in:
zenggang
2023-08-30 07:54:28 +00:00
parent 530bca798d
commit 1c6d6e7dfe
3 changed files with 97 additions and 1 deletions
+32
View File
@@ -432,6 +432,38 @@ class instance extends control
return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $this->createLink('space', 'browse')));
}
/**
* 编辑手工配置外部应用。
* Edit a external app.
*
* @param int $externalID
* @access public
* @return viod
*/
public function editExternalApp(int $externalID)
{
$oldApp = $this->loadModel('pipeline')->getByID($externalID);
if($_POST)
{
$this->pipeline->update($externalID);
$app = $this->pipeline->getByID($externalID);
if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError()));
$this->loadModel('action');
$actionID = $this->action->create($app->type, $externalID, 'edited');
$changes = common::createChanges($oldApp, $app);
$this->action->logHistory($actionID, $changes);
return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'load' => true, 'closeModal' => true));
}
$this->app->loadLang('space');
$this->app->loadLang('sonarqube');
$this->view->app = $oldApp;
$this->display();
}
/**
* (Not used at present.) Install app by custom settings.
*
@@ -0,0 +1,57 @@
<?php
declare(strict_types=1);
/**
* The edit externalapp view file of instance module of ZenTaoPMS.
*
* @copyright Copyright 2009-2023 禅道软件(青岛)有限公司(ZenTao Software (Qingdao) Co., Ltd. www.zentao.net)
* @license ZPL(https://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
* @author Zeng gang<zenggang@easycorp.ltd>
* @package instance
* @link https://www.zentao.net
*/
namespace zin;
formPanel
(
set::id('appCreateForm'),
set::title($lang->edit . $lang->space->appType[$app->type]),
set::submitBtnText($lang->save),
set::actions(array('submit', array('text' => $lang->cancel, 'data-type' => 'submit', 'data-dismiss' => 'modal'))),
formRow
(
formGroup
(
set::name('name'),
set::label($lang->sonarqube->name),
set::value($app->name),
)
),
formRow
(
formGroup
(
set::name('url'),
set::label($lang->sonarqube->url),
set::value($app->url),
)
),
formRow
(
formGroup
(
set::name('account'),
set::label($lang->sonarqube->account),
set::value($app->account),
)
),
formRow
(
formGroup
(
set::name('password'),
set::label($lang->sonarqube->password),
set::value($app->password),
)
),
);
+8 -1
View File
@@ -77,6 +77,13 @@ window.bindUser = function(externalID, appName)
window.editApp = function(externalID, appName)
{
$('#editLinkContainer').attr('href', $.createLink(appName.toLowerCase(), 'edit', 'id=' + externalID));
if(appName == 'Nexus')
{
$('#editLinkContainer').attr('href', $.createLink('instance', 'editExternalApp', 'id=' + externalID));
}
else
{
$('#editLinkContainer').attr('href', $.createLink(appName.toLowerCase(), 'edit', 'id=' + externalID));
}
$('#editLinkContainer').trigger('click');
}