|
...
|
...
|
@@ -10,6 +10,7 @@ use App\Models\Devops\DevopsTask; |
|
|
|
use App\Models\Project\Project;
|
|
|
|
use App\Models\Devops\ServerConfig;
|
|
|
|
use App\Services\ProjectServer;
|
|
|
|
use App\Utils\EncryptUtils;
|
|
|
|
use Illuminate\Support\Facades\DB;
|
|
|
|
|
|
|
|
/**
|
|
...
|
...
|
@@ -47,7 +48,11 @@ class ServerConfigLogic extends BaseLogic |
|
|
|
* @time :2023/8/2 17:53
|
|
|
|
*/
|
|
|
|
public function getServiceConfig(){
|
|
|
|
$encrypt = new EncryptUtils();
|
|
|
|
$info = $this->model->read(['id'=>$this->param['id']]);
|
|
|
|
$info['account'] = $encrypt->unlock_url($this->param['account']);
|
|
|
|
$info['password'] = $encrypt->unlock_url($this->param['password']);
|
|
|
|
$this->param['port'] = $encrypt->unlock_url($this->param['port']);
|
|
|
|
if($info === false){
|
|
|
|
$this->fail('当前数据不存在或者被删除');
|
|
|
|
}
|
|
...
|
...
|
@@ -65,6 +70,10 @@ class ServerConfigLogic extends BaseLogic |
|
|
|
{
|
|
|
|
DB::beginTransaction();
|
|
|
|
try {
|
|
|
|
$encrypt = new EncryptUtils();
|
|
|
|
$this->param['account'] = $encrypt->lock_url($this->param['account']);
|
|
|
|
$this->param['password'] = $encrypt->lock_url($this->param['password']);
|
|
|
|
$this->param['port'] = $encrypt->lock_url($this->param['port']);
|
|
|
|
//保存配置
|
|
|
|
if(isset($this->param['id']) && !empty($this->param['id'])){
|
|
|
|
$this->model->edit($this->param,['id'=>$this->param['id']]);
|
|
...
|
...
|
@@ -125,11 +134,6 @@ class ServerConfigLogic extends BaseLogic |
|
|
|
if($rs === false){
|
|
|
|
$this->fail('删除失败');
|
|
|
|
}
|
|
|
|
//TODO::上线放开
|
|
|
|
// if($info['type'] == $this->model::TYPE_MYSQL){
|
|
|
|
// $sql = 'DROP DATABASE '.$info['title'];
|
|
|
|
// DB::connection('custom_mysql')->statement($sql);
|
|
|
|
// }
|
|
|
|
return $this->success();
|
|
|
|
}
|
|
|
|
|
...
|
...
|
|