Browse Source

1、增加备份文件夹体积统计2、tab标签支持记录当前位置 下次直接切换3、配置登录凭证过期时间从24小时为6个小时4、完善svnserve启动和停止

docker-svn
witersen 3 years ago
parent
commit
bc09022fc9
  1. 138
      01.web/src/views/advance/index.vue
  2. 9
      01.web/src/views/index/index.vue
  3. 8
      02.php/app/controller/statistics.class.php
  4. 6
      02.php/app/controller/subversion.class.php
  5. 5
      02.php/app/function/token.function.php
  6. 4
      02.php/config/daemon.config.php

138
01.web/src/views/advance/index.vue

@ -1,7 +1,7 @@
<template> <template>
<div> <div>
<Card :bordered="false" :dis-hover="true"> <Card :bordered="false" :dis-hover="true">
<Tabs value="1"> <Tabs v-model="currentAdvanceTab" @on-click="SetCurrentAdvanceTab">
<TabPane label="Subversion" name="1"> <TabPane label="Subversion" name="1">
<Card :bordered="false" :dis-hover="true" style="width: 620px"> <Card :bordered="false" :dis-hover="true" style="width: 620px">
<Form :label-width="140"> <Form :label-width="140">
@ -33,7 +33,7 @@
<span style="color: #ff9900" v-if="formSvn.installed == 0" <span style="color: #ff9900" v-if="formSvn.installed == 0"
>未安装</span >未安装</span
> >
<span style="color: #2db7f5" v-if="formSvn.installed == 1" <span style="color: #f90" v-if="formSvn.installed == 1"
>未启动</span >未启动</span
> >
<span style="color: #19be6b" v-if="formSvn.installed == 2" <span style="color: #19be6b" v-if="formSvn.installed == 2"
@ -45,13 +45,15 @@
</Col> </Col>
<Col span="6"> <Col span="6">
<Button <Button
:loading="loadingSvnserveStart"
type="success" type="success"
v-if="formSvn.installed == 1" v-if="formSvn.installed == 1"
@click="Start" @click="Start"
>启动</Button >启动</Button
> >
<Button <Button
type="success" :loading="loadingSvnserveStop"
type="warning"
v-if="formSvn.installed == 2" v-if="formSvn.installed == 2"
@click="Stop" @click="Stop"
>停止</Button >停止</Button
@ -328,6 +330,17 @@
export default { export default {
data() { data() {
return { return {
/**
* tab
*/
currentAdvanceTab: "1",
/**
* 加载
*/
loadingSvnserveStart: false,
loadingSvnserveStop: false,
/** /**
* subversion信息 * subversion信息
*/ */
@ -340,10 +353,12 @@ export default {
enable: "", enable: "",
svnserveLog: "", svnserveLog: "",
}, },
/** /**
* *
*/ */
configList: [], configList: [],
/** /**
* 对话框 * 对话框
*/ */
@ -351,6 +366,7 @@ export default {
modalAddRep: false, modalAddRep: false,
// //
modalEditRepName: false, modalEditRepName: false,
/** /**
* 表单 * 表单
*/ */
@ -361,63 +377,27 @@ export default {
repNameOld: "", repNameOld: "",
repNameNew: "", repNameNew: "",
}, },
/**
* 表格
*/
//
tableRepColumn: [
{
title: "序号",
type: "index",
},
{
title: "用户名",
key: "repName",
tooltip: true,
sortable: true,
},
{
title: "密码",
key: "repRev",
tooltip: true,
},
{
title: "启用状态",
slot: "repStatus",
sortable: true,
},
{
title: "过期时间",
key: "repRemarks",
sortable: true,
},
{
title: "备注信息",
key: "repRemarks",
},
{
title: "其它",
slot: "action",
width: 180,
},
],
tableRepData: [
{
repName: "xxxxxxxxxxxxxxxxxxxxxxxxxx",
repRev: 12,
repSize: 128,
repStatus: 0,
},
],
}; };
}, },
computed: {}, computed: {},
created() {}, created() {},
mounted() { mounted() {
if (!sessionStorage.currentAdvanceTab) {
sessionStorage.setItem("currentAdvanceTab", "1");
} else {
this.currentAdvanceTab = sessionStorage.currentAdvanceTab;
}
this.GetDetail(); this.GetDetail();
this.GetConfig(); this.GetConfig();
}, },
methods: { methods: {
/**
* 设置选中的标签
*/
SetCurrentAdvanceTab(name) {
sessionStorage.setItem("currentAdvanceTab", name);
this.currentAdvanceTab = name;
},
/** /**
* 获取版本信息 * 获取版本信息
*/ */
@ -469,11 +449,63 @@ export default {
/** /**
* 启动SVN * 启动SVN
*/ */
Start() {}, Start() {
var that = this;
that.$Modal.confirm({
title: "以daomen方式启动svnserve服务",
content: "确定要启动svnserve服务吗吗?",
onOk: () => {
that.loadingSvnserveStart = true;
var data = {};
that.$axios
.post("/api.php?c=subversion&a=Start&t=web", data)
.then(function (response) {
that.loadingSvnserveStart = false;
var result = response.data;
if (result.status == 1) {
that.$Message.success(result.message);
that.GetDetail();
} else {
that.$Message.error(result.message);
}
})
.catch(function (error) {
that.loadingSvnserveStart = false;
console.log(error);
});
},
});
},
/** /**
* 停止SVN * 停止SVN
*/ */
Stop() {}, Stop() {
var that = this;
that.$Modal.confirm({
title: "停止svnserve服务",
content: "确定要停止svnserve服务吗?",
onOk: () => {
that.loadingSvnserveStop = true;
var data = {};
that.$axios
.post("/api.php?c=subversion&a=Stop&t=web", data)
.then(function (response) {
that.loadingSvnserveStop = false;
var result = response.data;
if (result.status == 1) {
that.$Message.success(result.message);
that.GetDetail();
} else {
that.$Message.error(result.message);
}
})
.catch(function (error) {
that.loadingSvnserveStop = false;
console.log(error);
});
},
});
},
/** /**
* 修改svnserve的绑定端口 * 修改svnserve的绑定端口
*/ */

9
01.web/src/views/index/index.vue

@ -115,6 +115,14 @@
</div> </div>
</Card> </Card>
</Col> </Col>
<Col span="4">
<Card :dis-hover="true">
<div style="text-align: center">
<p>备份占用</p>
<h2 style="color: #28bcfe">{{ systemBrif.backupSize }}</h2>
</div>
</Card>
</Col>
<Col span="4"> <Col span="4">
<Card :dis-hover="true"> <Card :dis-hover="true">
<div style="text-align: center"> <div style="text-align: center">
@ -199,6 +207,7 @@ export default {
repUser: 0, repUser: 0,
repGroup: 0, repGroup: 0,
logCount: 0, logCount: 0,
backupSize:0,
}, },
}; };
}, },

8
02.php/app/controller/statistics.class.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-04-26 16:57:31 * @LastEditTime: 2022-04-27 11:56:45
* @Description: QQ:1801168257 * @Description: QQ:1801168257
*/ */
@ -221,6 +221,9 @@ class statistics extends controller
//仓库占用体积 //仓库占用体积
$repSize = FunFormatSize(FunGetDirSizeDu(SVN_REPOSITORY_PATH)); $repSize = FunFormatSize(FunGetDirSizeDu(SVN_REPOSITORY_PATH));
//备份占用体积
$backupSize = FunFormatSize(FunGetDirSizeDu(SVN_BACHUP_PATH));
//SVN仓库数量 //SVN仓库数量
$repCount = count(FunGetSimpleRepList()); $repCount = count(FunGetSimpleRepList());
@ -239,7 +242,8 @@ class statistics extends controller
'repCount' => $repCount, 'repCount' => $repCount,
'repUser' => $userCount, 'repUser' => $userCount,
'repGroup' => $groupCount, 'repGroup' => $groupCount,
'logCount' => $logCount 'logCount' => $logCount,
'backupSize' => $backupSize
]); ]);
} }
} }

6
02.php/app/controller/subversion.class.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-04-26 16:57:36 * @LastEditTime: 2022-04-27 15:20:52
* @Description: QQ:1801168257 * @Description: QQ:1801168257
*/ */
@ -124,6 +124,8 @@ class subversion extends controller
*/ */
function Start() function Start()
{ {
FunShellExec("systemctl start svnserve");
FunMessageExit();
} }
/** /**
@ -131,6 +133,8 @@ class subversion extends controller
*/ */
function Stop() function Stop()
{ {
FunShellExec("systemctl stop svnserve");
FunMessageExit();
} }
/** /**

5
02.php/app/function/token.function.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-04-26 16:59:54 * @LastEditTime: 2022-04-27 15:07:53
* @Description: QQ:1801168257 * @Description: QQ:1801168257
*/ */
@ -12,7 +12,8 @@ function FunCreateToken($userRoleId, $userName)
{ {
$nowTime = time(); $nowTime = time();
$startTime = $nowTime; $startTime = $nowTime;
$endTime = $startTime + 86400; //配置登录凭证过期时间为6个小时
$endTime = $nowTime + 60 * 60 * 6;
$part1 = $userRoleId . '.' . $userName . '.' . $startTime . '.' . $endTime; $part1 = $userRoleId . '.' . $userName . '.' . $startTime . '.' . $endTime;
$part2 = hash_hmac('md5', $part1, SIGNATURE); $part2 = hash_hmac('md5', $part1, SIGNATURE);
return $part1 . '.' . $part2; return $part1 . '.' . $part2;

4
02.php/config/daemon.config.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-04-26 17:00:18 * @LastEditTime: 2022-04-27 14:54:15
* @Description: QQ:1801168257 * @Description: QQ:1801168257
*/ */
@ -13,7 +13,7 @@
/** /**
* 程序与守护进程通信的本地地址 * 程序与守护进程通信的本地地址
* 不要修改 * 不要修改
*/ */
define('IPC_ADDRESS', '127.0.0.1'); define('IPC_ADDRESS', '127.0.0.1');

Loading…
Cancel
Save