From eb3fe3f2221d4eea36c9830990b88b5b86a3ba2d Mon Sep 17 00:00:00 2001 From: dingguodong Date: Thu, 23 May 2024 15:31:05 +0800 Subject: [PATCH] + Add the method to get the progress of deleting. --- module/system/control.php | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/module/system/control.php b/module/system/control.php index 0554a48835..8a14af8dd2 100644 --- a/module/system/control.php +++ b/module/system/control.php @@ -323,6 +323,30 @@ class system extends control } } + /** + * 获取删除的进度。 + * AJAX: Get delete progress. + * + * @param string $backupName + * @return void + */ + public function ajaxGetDeleteProgress($backupName) + { + session_write_close(); + + if(strpos($backupName, '_') !== false) $backupName = str_replace('_', '-', $backupName); + $rawResult = $this->cne->getBackupList($this->config->instance->zentaopaas); + if($rawResult && $rawResult->code == 200) + { + foreach($rawResult->data as $backup) + { + if($backup->name == $backupName) return $this->sendSuccess(array('status' => 'inprogress', 'message' => $rawResult->message)); + } + $this->sendSuccess(array('status' => 'completed', 'message' => $rawResult->message)); + } + $this->sendError(isset($rawResult->message) ? $rawResult->message : 'fail'); + } + /** * 生成数据库授权链接。 * Generate database auth parameters and jump to login page.