From d115293b3db21cdc100785ab3f2c09f345c58906 Mon Sep 17 00:00:00 2001 From: witersen <1801168257@qq.com> Date: Tue, 10 May 2022 01:16:15 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=89=8D=E7=AB=AF=E6=A3=80?= =?UTF-8?q?=E6=B5=8B=E5=8D=87=E7=BA=A7=E6=A8=A1=E5=9D=97=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 01.web/src/views/advance/index.vue | 261 ++++++++++++++++++++++++----- 02.php/app/service/Update.php | 47 +++--- 02.php/server/update.json | 6 +- 3 files changed, 242 insertions(+), 72 deletions(-) diff --git a/01.web/src/views/advance/index.vue b/01.web/src/views/advance/index.vue index fd5502b..8984b38 100644 --- a/01.web/src/views/advance/index.vue +++ b/01.web/src/views/advance/index.vue @@ -386,7 +386,10 @@ placement="top" transfer > - @@ -397,32 +400,82 @@ -
- - - {{ formSoftwareNew.latestVersion }} - - - - - {{ formSoftwareNew.updateStep }} - - - - - - - - -
+ +
+ + + {{ formUpdate.version }} + + + +
    +
  • + [{{ item.title }}] {{ item.content }} +
  • +
+
+ +
    +
  • + [{{ item.title }}] {{ item.content }} +
  • +
+
+ +
    +
  • + [{{ item.title }}] {{ item.content }} +
  • +
+
+ +
    +
  • + [{{ item.title }}] {{ item.content }} +
  • +
+
+ +
    +
  • + [{{ index + 1 }}] {{ item.nodeName }}节点 + +
  • +
+
+ + + + +
    +
  • + [{{ item.title }}] {{ item.content }} +
  • +
+
+
+
@@ -462,7 +515,7 @@ export default { current_verson: "2.3", php_version: "5.5 <= PHP < 8.0", database: "MYSQL、SQLite", - github: "https://github.com/witersen/svnAdminV2.0", + github: "https://github.com/witersen/SvnAdminV2.0", gitee: "https://gitee.com/witersen/SvnAdminV2.0", }, @@ -486,7 +539,7 @@ export default { //保存推送配置信息 loadingEditPush: false, //检测更新 - loadingCheckUpdate:false, + loadingCheckUpdate: false, /** * subversion信息 @@ -528,24 +581,142 @@ export default { port: 0, to: "", from: "", - - // autotls: true, - // auth: false, - // host: "", - // encryption: "none", - // port: 25, - // user: "", - // pass: "", - // from: "", status: false, }, //新版本信息 - formSoftwareNew: { - newContent: "", - latestVersion: "", - fixedContent: "", - updateType: "", - updateStep: "", + formUpdate: { + version: "2.4", + fixd: { + con: [ + { + title: "1", + content: "修复SVN仓库权限配置的bug", + }, + { + title: "2", + content: "完善用户权限控制逻辑", + }, + ], + }, + add: { + con: [ + { + title: "1", + content: "支持文件级授权", + }, + { + title: "2", + content: "支持目录浏览", + }, + { + title: "3", + content: "支持仓库备份与恢复", + }, + { + title: "4", + content: "支持SVN用户禁用与启动", + }, + { + title: "5", + content: "支持用户级日志记录", + }, + { + title: "6", + content: "兼容PHP5.5+", + }, + ], + }, + remove: { + con: [ + { + title: "1", + content: "暂时移除仓库钩子的配置功能", + }, + ], + }, + release: { + download: [ + { + nodeName: "gitee.com", + url: "", + }, + { + nodeName: "github.com", + url: "", + }, + { + nodeName: "witersen.com", + url: "https://download.witersen.com/SVNAdmin/SVNAdmin-2.3.zip", + }, + ], + }, + update: { + step: [ + { + title: "1", + content: "php ${your_path}/server/install.php", + }, + ], + download: [ + { + nodeName: "gitee.com", + packages: [ + { + for: { + source: "2.3", + dest: "2.4", + }, + url: "xxx", + }, + { + for: { + source: "2.3", + dest: "2.5", + }, + url: "xxx", + }, + ], + }, + { + nodeName: "github.com", + packages: [ + { + for: { + source: "2.3", + dest: "2.4", + }, + url: "xxx", + }, + { + for: { + source: "2.3", + dest: "2.5", + }, + url: "xxx", + }, + ], + }, + { + nodeName: "witersen.com", + packages: [ + { + for: { + source: "2.3", + dest: "2.4", + }, + url: "xxx", + }, + { + for: { + source: "2.3", + dest: "2.5", + }, + url: "xxx", + }, + ], + }, + ], + }, }, }; }, @@ -1013,7 +1184,7 @@ export default { var result = response.data; if (result.status == 1) { if (result.data != "") { - that.formSoftwareNew = result.data; + that.formUpdate = result.data; that.modalSofawareUpdateGet = true; } else { that.$Message.success(result.message); diff --git a/02.php/app/service/Update.php b/02.php/app/service/Update.php index 4fcde98..8172d97 100644 --- a/02.php/app/service/Update.php +++ b/02.php/app/service/Update.php @@ -3,7 +3,7 @@ * @Author: witersen * @Date: 2022-04-24 23:37:05 * @LastEditors: witersen - * @LastEditTime: 2022-05-09 11:41:40 + * @LastEditTime: 2022-05-10 00:01:53 * @Description: QQ:1801168257 */ @@ -21,33 +21,28 @@ class Update extends Base */ public function CheckUpdate() { - foreach ($this->config_update['update_server'] as $key => $value) { - $versionInfo = FunCurlRequest($value['url']); - if ($versionInfo != null) { - $versionInfo = json_decode($versionInfo, true); - $latestVersion = $versionInfo['latestVersion']; - if ($latestVersion == $this->config_version['version']) { - return message(200, 1, '当前版本为最新版'); - } else if ($latestVersion > $this->config_version['version']) { - return message(200, 1, '有更新', [ - 'latestVersion' => $versionInfo['latestVersion'], - 'fixedContent' => implode('
', $versionInfo['fixedContent']) == '' ? '暂无内容' : implode('
', $versionInfo['fixedContent']), - 'newContent' => implode('
', $versionInfo['newContent']) == '' ? '暂无内容' : implode('
', $versionInfo['newContent']), - 'updateType' => $versionInfo['updateType'], - 'updateStep' => $versionInfo['updateStep'] - ]); - } else if ($latestVersion < $this->config_version['version']) { - return message(200, 0, '系统版本错误'); - } + foreach ($this->config_update['update_server'] as $key1 => $value1) { + + $json = FunCurlRequest($value1['url']); + + if ($json == null) { + continue; + } + + //json => array + $array = json_decode($json, true); + + $last = $array['version']; + + if ($this->config_version['version'] == $last) { + return message(200, 1, '当前为最新版'); + } + + if ($this->config_version['version'] < $last) { + return message(200, 1, '有新版本', $array); } } - return message(200, 0, '检测更新超时'); - } - /** - * 确认更新 - */ - public function StartUpdate() - { + return message(200, 0, '检测超时'); } } diff --git a/02.php/server/update.json b/02.php/server/update.json index 23f8364..303d0b4 100644 --- a/02.php/server/update.json +++ b/02.php/server/update.json @@ -68,7 +68,11 @@ "step": [ { "title": "1", - "content": "php ${your_path}/server/install.php" + "content": "登录服务器控制台" + }, + { + "title": "2", + "content": "执行命令 php ${your_path}/server/install.php" } ], "download": [