Skip to content

Commit

Permalink
feat:core done
Browse files Browse the repository at this point in the history
  • Loading branch information
FangPengbo committed Jul 2, 2023
1 parent d87dc28 commit 7d39661
Show file tree
Hide file tree
Showing 176 changed files with 7,706 additions and 52 deletions.
64 changes: 62 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,62 @@
# cavy
数据备份恢复和同步
<br /><br />

<p align="center">
<a href="https://github.com/FangPengbo/backup-cavy">
<img src="https://img1.imgtp.com/2023/07/02/RwC1uXIj.png" alt="Logo" width="70">
</a>
</p>

<h3 align="center"><b>Cavy</b></h3>
<p align="center"><b>database backup&restore 数据库 备份&恢复</b></p>

<div align="center">

[![License](https://img.shields.io/github/license/alibaba/fastjson2?color=4D7A97&logo=apache)](https://www.apache.org/licenses/LICENSE-2.0.html)
[![GitHub release](https://img.shields.io/github/release/FangPengbo/backup-cavy)](https://github.com/FangPengbo/backup-cavy/releases)
[![GitHub Stars](https://img.shields.io/github/stars/FangPengbo/backup-cavy)](https://github.com/FangPengbo/backup-cavy/stargazers)

</div>

<p>
<a href="https://github.com/FangPengbo/backup-cavy" target="_blank">
<img
src="https://img1.imgtp.com/2023/07/02/YgF2uURW.png"
alt="Cavy Screens"
width="100%"
/>
</a>
</p>

## 🚀 Features

* **✅数据库备份**
* **✅数据库恢复**
* **❎消息通知**
* **❎OSS存储**

## Supported databases
| Databases | Status |
|---------------|---------|
| Mysql ||

## ⚡️ Quick start
### 前置依赖
1.创建数据库
```sql
create schema cavy;
```
2.启动服务
```bash
run anywhere
```

### Docker Setup


## 相关开源
使用的前端脚手架:[vue-manage-system](https://github.com/lin-xin/vue-manage-system)


## 📚Documentation

For full documentation, visit [cavy](https://github.com/FangPengbo/backup-cavy)
1 change: 1 addition & 0 deletions console/.env.development
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
VITE_PROJECT_ENV = 'development'
1 change: 1 addition & 0 deletions console/.env.production
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
VITE_PROJECT_ENV = 'production'
23 changes: 23 additions & 0 deletions console/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
.DS_Store
node_modules
/dist


# local env files
.env.local
.env.*.local

# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*

# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
21 changes: 21 additions & 0 deletions console/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2016-2021 vue-manage-system

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
2 changes: 2 additions & 0 deletions console/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# cavy-vue
cavy前端项目
22 changes: 22 additions & 0 deletions console/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<!DOCTYPE html>
<html lang="">

<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<title>vue-manage-system</title>
<link rel="stylesheet" href="/public/css/font_830376_qzecyukz0s.css">
</head>

<body>
<noscript>
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled.
Please enable it to continue.</strong>
</noscript>
<div id="app"></div>
<script type="module" src="/src/main.js"></script>
<!-- built files will be auto injected -->
</body>

</html>
32 changes: 32 additions & 0 deletions console/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"name": "cavy-vue",
"version": "1.0.0",
"private": true,
"scripts": {
"dev": "vite --mode development",
"build": "vite build --mode development",
"serve": "vite --mode production",
"build-prod": "vite build --mode production"
},
"dependencies": {
"axios": "^0.21.1",
"element-plus": "1.0.2-beta.52",
"vue": "^3.1.2",
"vue-cropperjs": "^5.0.0",
"vue-i18n": "^9.0.0",
"vue-router": "^4.0.10",
"vue-schart": "^2.0.0",
"vuex": "^4.0.2",
"wangeditor": "^4.7.4"
},
"devDependencies": {
"vite": "2.3.7",
"@vitejs/plugin-vue": "^1.2.3",
"@vue/compiler-sfc": "^3.1.2"
},
"browserslist": [
"> 1%",
"last 2 versions",
"not dead"
]
}
266 changes: 266 additions & 0 deletions console/public/css/font_830376_qzecyukz0s.css

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions console/src/App.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<template>
<router-view />
</template>

<script>
export default {};
</script>

<style>
@import "./assets/css/main.css";
@import "./assets/css/color-dark.css";
</style>
175 changes: 175 additions & 0 deletions console/src/api/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,175 @@
import request from '../utils/request';
export var BASE_URL=''; //接口地址
export var SW_BASE_URL=''; //接口地址
switch (import.meta.env.VITE_PROJECT_ENV) {
case "development":
BASE_URL = "http://127.0.0.1:9090/api/v1"; //开发环境url
SW_BASE_URL = "ws://127.0.0.1:9090/socket/v1" //开发环境url
break;
case "production":
BASE_URL = "http://127.0.0.1:9090/api/v1"; //生产环境url
SW_BASE_URL = "ws://127.0.0.1:9090/socket/v1"
break;
}
export const Login = data => {
return request({
url: BASE_URL + '/auth/login',
method: 'post',
data:data
});
};

export const SendCode = () => {
return request({
url: BASE_URL + '/auth/sendCode',
method: 'get'
});
};

export const CheckToken = token => {
return request({
url: BASE_URL + '/auth/checkToken',
method: 'get',
headers: {
'Authorization':localStorage.getItem("token")
}
});
};



export const CopyPwd = pwd => {
return request({
url: BASE_URL + '/record/view/' + pwd,
method: 'get',
headers: {
'Authorization':localStorage.getItem("token")
}
});
};

/*数据源*/
export const DataSource = params => {
return request({
url: BASE_URL + '/dataSource',
method: 'get',
params: params
});
};

export const InsertDataSource = data => {
return request({
url: BASE_URL + '/dataSource',
method: 'post',
data: data
});
};

export const DeleteDataSource = id => {
return request({
url: BASE_URL + '/dataSource/' + id,
method: 'delete',
});
};

export const UpdateDataSource = data => {
return request({
url: BASE_URL + '/dataSource',
method: 'put',
data: data
});
};

export const AllDataSource = () => {
return request({
url: BASE_URL + '/dataSource/all',
method: 'get',
});
};

/*备份任务*/
export const BackUpList = params => {
return request({
url: BASE_URL + '/backUpJob',
method: 'get',
params: params
});
};

export const BackUpJobRecordList = id => {
return request({
url: BASE_URL + '/backUpJob/' + id,
method: 'get',
});
};

export const InsertBackUpJob = data => {
return request({
url: BASE_URL + '/backUpJob',
method: 'post',
data: data
});
};

export const EnableBackUpJob = id => {
return request({
url: BASE_URL + '/backUpJob/enable/' + id,
method: 'get',
});
};

export const DeleteBackUpJob = id => {
return request({
url: BASE_URL + '/backUpJob/' + id,
method: 'delete',
});
};

export const UpdateBackUpJob = data => {
return request({
url: BASE_URL + '/backUpJob',
method: 'put',
data: data
});
};


/*公共方法*/
export const AllDataBaseByDataSource = id => {
return request({
url: BASE_URL + '/common/getAllDataBaseByDataSource/' + id,
method: 'get'
});
};

export const LastRunTime = cron => {
return request({
url: BASE_URL + '/common/lastRunTime?cron=' + cron,
method: 'get'
});
};

/*Dashboard*/
export const Dashboard = () => {
return request({
url: BASE_URL + '/dashboard',
method: 'get'
});
};


/*恢复任务*/
export const RestoreList = params => {
return request({
url: BASE_URL + '/restoreJob',
method: 'get',
params: params
});
};

export const RestoreJobRecordList = id => {
return request({
url: BASE_URL + '/restoreJob/' + id,
method: 'get',
});
};
28 changes: 28 additions & 0 deletions console/src/assets/css/color-dark.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
.header{
background-color: #242f42;
}
.login-wrap{
background: #324157;
}
.plugins-tips{
background: #eef1f6;
}
.plugins-tips a{
color: #20a0ff;
}
.el-upload--text em {
color: #20a0ff;
}
.pure-button{
background: #20a0ff;
}
.tags-li.active {
border: 1px solid #409EFF;
background-color: #409EFF;
}
.message-title{
color: #20a0ff;
}
.collapse-btn:hover{
background: rgb(40,52,70);
}
Loading

0 comments on commit 7d39661

Please sign in to comment.