Browse Source

支持重设仓库UUID

docker-svn
witersen 3 years ago
parent
commit
f8967024a7
  1. 3
      .gitignore
  2. 78
      01.web/src/views/repositoryInfo/index.vue
  3. 6
      02.php/api.php
  4. 11
      02.php/app/controller/Svnrep.php
  5. 22
      02.php/app/service/Svnrep.php
  6. 2
      README.md

3
.gitignore vendored

@ -1,9 +1,6 @@
01.web/node_modules 01.web/node_modules
01.web/node_modules/* 01.web/node_modules/*
01.web/dist
01.web/dist/*
01.web/index.html 01.web/index.html
01.web/index_prod.html
01.web/.vscode 01.web/.vscode
01.web/.vscode/* 01.web/.vscode/*
02.php/.vscode 02.php/.vscode

78
01.web/src/views/repositoryInfo/index.vue

@ -725,6 +725,15 @@
@click="CopyRepDetail(index)" @click="CopyRepDetail(index)"
></Button> ></Button>
</template> </template>
<template
slot-scope="{ row }"
slot="uuid"
v-if="row.repKey == 'UUID' || row.repKey == 'uuid'"
>
<Button type="primary" size="small" @click="ModalSetUUID()"
>重设</Button
>
</template>
</Table> </Table>
</TabPane> </TabPane>
<TabPane label="恢复"> <TabPane label="恢复">
@ -885,6 +894,25 @@
@on-row-click="ClickRowAddRepPathGroup" @on-row-click="ClickRowAddRepPathGroup"
></Table> ></Table>
</Modal> </Modal>
<!-- 对话框-重设仓库UUID -->
<Modal v-model="modalSetUUID" title="重设仓库UUID">
<Form :label-width="80">
<FormItem label="UUID">
<Input
v-model="tempRepUUID"
placeholder="不填写则自动生成全新UUID"
></Input>
</FormItem>
<FormItem>
<Button type="primary" :loading="loadingSetUUID" @click="SetUUID"
>确定</Button
>
</FormItem>
</Form>
<div slot="footer">
<Button type="primary" ghost @click="modalSetUUID = false">取消</Button>
</div>
</Modal>
</div> </div>
</template> </template>
@ -930,6 +958,8 @@ export default {
modalStudyRepHook: false, modalStudyRepHook: false,
// //
modalRecommendHook: false, modalRecommendHook: false,
//UUID
modalSetUUID: false,
/** /**
* 排序数据 * 排序数据
@ -1004,6 +1034,8 @@ export default {
loadingGetRepHooks: true, loadingGetRepHooks: true,
// //
loadingEditRepHook: false, loadingEditRepHook: false,
//UUID
loadingSetUUID: false,
/** /**
* 临时变量 * 临时变量
@ -1038,6 +1070,8 @@ export default {
tempSelectRepHookTmpl: "", tempSelectRepHookTmpl: "",
// //
tempSelectRepHookRecommend: "", tempSelectRepHookRecommend: "",
//UUID
tempRepUUID: "",
/** /**
* 对话框标题 * 对话框标题
@ -1145,7 +1179,7 @@ export default {
title: "版本数", title: "版本数",
key: "rep_rev", key: "rep_rev",
sortable: "custom", sortable: "custom",
minWidth: 120, minWidth: 90,
}, },
{ {
title: "体积", title: "体积",
@ -1333,17 +1367,24 @@ export default {
title: "属性", title: "属性",
key: "repKey", key: "repKey",
tooltip: true, tooltip: true,
fixed: "left",
width: 170,
}, },
{ {
title: "信息", title: "信息",
key: "repValue", key: "repValue",
tooltip: true, tooltip: true,
width: 170,
}, },
{ {
title: "复制", title: "复制",
slot: "copy", slot: "copy",
width: 60, width: 60,
}, },
{
title: "重设",
slot: "uuid",
},
], ],
tableDataRepDetail: [], tableDataRepDetail: [],
// //
@ -2670,6 +2711,41 @@ export default {
} }
); );
}, },
/**
* 重设仓库UUID
*/
ModalSetUUID() {
//
this.tempRepUUID = "";
//
this.modalSetUUID = true;
},
SetUUID() {
var that = this;
that.loadingSetUUID = true;
var data = {
rep_name: that.currentRepName,
uuid: that.tempRepUUID,
};
that.$axios
.post("/api.php?c=Svnrep&a=SetUUID&t=web", data)
.then(function (response) {
that.loadingSetUUID = false;
var result = response.data;
if (result.status == 1) {
that.$Message.success(result.message);
that.GetRepDetail();
that.modalSetUUID = false;
} else {
that.$Message.error(result.message);
}
})
.catch(function (error) {
that.loadingSetUUID = false;
console.log(error);
that.$Message.error("出错了 请联系管理员!");
});
},
/** /**
* 单选按钮 选择导入 * 单选按钮 选择导入
*/ */

6
02.php/api.php

@ -3,7 +3,7 @@
* @Author: witersen * @Author: witersen
* @Date: 2022-04-24 23:37:06 * @Date: 2022-04-24 23:37:06
* @LastEditors: witersen * @LastEditors: witersen
* @LastEditTime: 2022-05-20 16:31:42 * @LastEditTime: 2022-05-21 12:51:28
* @Description: QQ:1801168257 * @Description: QQ:1801168257
*/ */
@ -16,8 +16,8 @@
/** /**
* 开启错误信息 如需要调试 可取消注释 * 开启错误信息 如需要调试 可取消注释
*/ */
// ini_set('display_errors', '1'); ini_set('display_errors', '1');
// error_reporting(E_ALL); error_reporting(E_ALL);
define('BASE_PATH', __DIR__); define('BASE_PATH', __DIR__);

11
02.php/app/controller/Svnrep.php

@ -3,7 +3,7 @@
* @Author: witersen * @Author: witersen
* @Date: 2022-04-24 23:37:05 * @Date: 2022-04-24 23:37:05
* @LastEditors: witersen * @LastEditors: witersen
* @LastEditTime: 2022-05-11 11:45:59 * @LastEditTime: 2022-05-21 13:55:49
* @Description: QQ:1801168257 * @Description: QQ:1801168257
*/ */
@ -191,6 +191,15 @@ class Svnrep extends Base
json2($result); json2($result);
} }
/**
* 重设仓库的UUID
*/
public function SetUUID()
{
$result = $this->ServiceSvnrep->SetUUID();
json2($result);
}
/** /**
* 获取备份文件夹下的文件列表 * 获取备份文件夹下的文件列表
*/ */

22
02.php/app/service/Svnrep.php

@ -3,7 +3,7 @@
* @Author: witersen * @Author: witersen
* @Date: 2022-04-24 23:37:05 * @Date: 2022-04-24 23:37:05
* @LastEditors: witersen * @LastEditors: witersen
* @LastEditTime: 2022-05-20 16:31:32 * @LastEditTime: 2022-05-21 14:14:40
* @Description: QQ:1801168257 * @Description: QQ:1801168257
*/ */
@ -1211,6 +1211,26 @@ class Svnrep extends Base
return message(200, 1, '成功', $newArray); return message(200, 1, '成功', $newArray);
} }
/**
* 重设仓库的UUID
*/
public function SetUUID()
{
if ($this->payload['uuid'] == '') {
$cmd = sprintf("'%s' setuuid '%s'", $this->config_bin['svnadmin'], $this->config_svn['rep_base_path'] . $this->payload['rep_name']);
} else {
$cmd = sprintf("'%s' setuuid '%s' '%s'", $this->config_bin['svnadmin'], $this->config_svn['rep_base_path'] . $this->payload['rep_name'], $this->payload['uuid']);
}
$result = FunShellExec($cmd);
if ($result['resultCode'] == 0) {
return message();
} else {
return message(200, 0, $result['error']);
}
}
/** /**
* 获取备份文件夹下的文件列表 * 获取备份文件夹下的文件列表
*/ */

2
README.md

@ -268,7 +268,7 @@ todo ..........
- [ ] 支持常见文件在线浏览 - [ ] 支持常见文件在线浏览
- [ ] 支持文件和文件夹在线下载 - [ ] 支持文件和文件夹在线下载
- [ ] 支持重设仓库UUID - [x] 支持重设仓库UUID
- [ ] 删除仓库需要输入管理人员密码 - [ ] 删除仓库需要输入管理人员密码
- [ ] 支持修改应用根目录 - [ ] 支持修改应用根目录
- [ ] 支持authz、passwd文件的在线识别导入和导出 - [ ] 支持authz、passwd文件的在线识别导入和导出

Loading…
Cancel
Save