2
0
mirror of https://github.com/acepanel/panel.git synced 2026-02-06 07:27:16 +08:00

feat: Rsync 插件

This commit is contained in:
耗子
2023-11-23 02:56:20 +08:00
parent 94ff9e2dbc
commit d55bb5ffe1
15 changed files with 1539 additions and 97 deletions

View File

@@ -920,7 +920,7 @@ const docTemplate = `{
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/requests.Update"
"$ref": "#/definitions/panel_app_http_requests_setting.Update"
}
}
],
@@ -1295,7 +1295,7 @@ const docTemplate = `{
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/requests.Add"
"$ref": "#/definitions/panel_app_http_requests_website.Add"
}
}
],
@@ -1661,6 +1661,242 @@ const docTemplate = `{
}
}
},
"/plugins/rsync/modules": {
"get": {
"security": [
{
"BearerToken": []
}
],
"description": "列出所有 Rsync 模块",
"produces": [
"application/json"
],
"tags": [
"插件-Rsync"
],
"summary": "列出模块",
"parameters": [
{
"description": "request",
"name": "data",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/commonrequests.Paginate"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/controllers.SuccessResponse"
}
}
}
},
"put": {
"security": [
{
"BearerToken": []
}
],
"description": "更新 Rsync 模块",
"produces": [
"application/json"
],
"tags": [
"插件-Rsync"
],
"summary": "更新模块",
"parameters": [
{
"description": "request",
"name": "data",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/panel_app_http_requests_plugins_rsync.Update"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/controllers.SuccessResponse"
}
}
}
},
"post": {
"security": [
{
"BearerToken": []
}
],
"description": "添加 Rsync 模块",
"produces": [
"application/json"
],
"tags": [
"插件-Rsync"
],
"summary": "添加模块",
"parameters": [
{
"description": "request",
"name": "data",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/panel_app_http_requests_plugins_rsync.Add"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/controllers.SuccessResponse"
}
}
}
},
"delete": {
"security": [
{
"BearerToken": []
}
],
"description": "删除 Rsync 模块",
"produces": [
"application/json"
],
"tags": [
"插件-Rsync"
],
"summary": "删除模块",
"parameters": [
{
"type": "string",
"description": "模块名称",
"name": "name",
"in": "query",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/controllers.SuccessResponse"
}
}
}
}
},
"/plugins/rsync/restart": {
"post": {
"security": [
{
"BearerToken": []
}
],
"description": "重启 Rsync 服务",
"produces": [
"application/json"
],
"tags": [
"插件-Rsync"
],
"summary": "重启服务",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/controllers.SuccessResponse"
}
}
}
}
},
"/plugins/rsync/start": {
"post": {
"security": [
{
"BearerToken": []
}
],
"description": "启动 Rsync 服务",
"produces": [
"application/json"
],
"tags": [
"插件-Rsync"
],
"summary": "启动服务",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/controllers.SuccessResponse"
}
}
}
}
},
"/plugins/rsync/status": {
"get": {
"security": [
{
"BearerToken": []
}
],
"description": "获取 Rsync 服务状态",
"produces": [
"application/json"
],
"tags": [
"插件-Rsync"
],
"summary": "服务状态",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/controllers.SuccessResponse"
}
}
}
}
},
"/plugins/rsync/stop": {
"post": {
"security": [
{
"BearerToken": []
}
],
"description": "停止 Rsync 服务",
"produces": [
"application/json"
],
"tags": [
"插件-Rsync"
],
"summary": "停止服务",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/controllers.SuccessResponse"
}
}
}
}
},
"/swagger": {
"get": {
"description": "Swagger UI",
@@ -1905,7 +2141,82 @@ const docTemplate = `{
}
}
},
"requests.Add": {
"panel_app_http_requests_plugins_rsync.Add": {
"type": "object",
"properties": {
"auth_user": {
"type": "string"
},
"comment": {
"type": "string"
},
"hosts_allow": {
"type": "string"
},
"name": {
"type": "string"
},
"path": {
"type": "string"
},
"secret": {
"type": "string"
}
}
},
"panel_app_http_requests_plugins_rsync.Update": {
"type": "object",
"properties": {
"auth_user": {
"type": "string"
},
"comment": {
"type": "string"
},
"hosts_allow": {
"type": "string"
},
"name": {
"type": "string"
},
"path": {
"type": "string"
},
"secret": {
"type": "string"
}
}
},
"panel_app_http_requests_setting.Update": {
"type": "object",
"properties": {
"backup_path": {
"type": "string"
},
"email": {
"type": "string"
},
"entrance": {
"type": "string"
},
"name": {
"type": "string"
},
"password": {
"type": "string"
},
"port": {
"type": "integer"
},
"username": {
"type": "string"
},
"website_path": {
"type": "string"
}
}
},
"panel_app_http_requests_website.Add": {
"type": "object",
"properties": {
"db": {
@@ -2135,35 +2446,6 @@ const docTemplate = `{
}
}
},
"requests.Update": {
"type": "object",
"properties": {
"backup_path": {
"type": "string"
},
"email": {
"type": "string"
},
"entrance": {
"type": "string"
},
"name": {
"type": "string"
},
"password": {
"type": "string"
},
"port": {
"type": "integer"
},
"username": {
"type": "string"
},
"website_path": {
"type": "string"
}
}
},
"requests.UserStore": {
"type": "object",
"properties": {

View File

@@ -913,7 +913,7 @@
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/requests.Update"
"$ref": "#/definitions/panel_app_http_requests_setting.Update"
}
}
],
@@ -1288,7 +1288,7 @@
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/requests.Add"
"$ref": "#/definitions/panel_app_http_requests_website.Add"
}
}
],
@@ -1654,6 +1654,242 @@
}
}
},
"/plugins/rsync/modules": {
"get": {
"security": [
{
"BearerToken": []
}
],
"description": "列出所有 Rsync 模块",
"produces": [
"application/json"
],
"tags": [
"插件-Rsync"
],
"summary": "列出模块",
"parameters": [
{
"description": "request",
"name": "data",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/commonrequests.Paginate"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/controllers.SuccessResponse"
}
}
}
},
"put": {
"security": [
{
"BearerToken": []
}
],
"description": "更新 Rsync 模块",
"produces": [
"application/json"
],
"tags": [
"插件-Rsync"
],
"summary": "更新模块",
"parameters": [
{
"description": "request",
"name": "data",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/panel_app_http_requests_plugins_rsync.Update"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/controllers.SuccessResponse"
}
}
}
},
"post": {
"security": [
{
"BearerToken": []
}
],
"description": "添加 Rsync 模块",
"produces": [
"application/json"
],
"tags": [
"插件-Rsync"
],
"summary": "添加模块",
"parameters": [
{
"description": "request",
"name": "data",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/panel_app_http_requests_plugins_rsync.Add"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/controllers.SuccessResponse"
}
}
}
},
"delete": {
"security": [
{
"BearerToken": []
}
],
"description": "删除 Rsync 模块",
"produces": [
"application/json"
],
"tags": [
"插件-Rsync"
],
"summary": "删除模块",
"parameters": [
{
"type": "string",
"description": "模块名称",
"name": "name",
"in": "query",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/controllers.SuccessResponse"
}
}
}
}
},
"/plugins/rsync/restart": {
"post": {
"security": [
{
"BearerToken": []
}
],
"description": "重启 Rsync 服务",
"produces": [
"application/json"
],
"tags": [
"插件-Rsync"
],
"summary": "重启服务",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/controllers.SuccessResponse"
}
}
}
}
},
"/plugins/rsync/start": {
"post": {
"security": [
{
"BearerToken": []
}
],
"description": "启动 Rsync 服务",
"produces": [
"application/json"
],
"tags": [
"插件-Rsync"
],
"summary": "启动服务",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/controllers.SuccessResponse"
}
}
}
}
},
"/plugins/rsync/status": {
"get": {
"security": [
{
"BearerToken": []
}
],
"description": "获取 Rsync 服务状态",
"produces": [
"application/json"
],
"tags": [
"插件-Rsync"
],
"summary": "服务状态",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/controllers.SuccessResponse"
}
}
}
}
},
"/plugins/rsync/stop": {
"post": {
"security": [
{
"BearerToken": []
}
],
"description": "停止 Rsync 服务",
"produces": [
"application/json"
],
"tags": [
"插件-Rsync"
],
"summary": "停止服务",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/controllers.SuccessResponse"
}
}
}
}
},
"/swagger": {
"get": {
"description": "Swagger UI",
@@ -1898,7 +2134,82 @@
}
}
},
"requests.Add": {
"panel_app_http_requests_plugins_rsync.Add": {
"type": "object",
"properties": {
"auth_user": {
"type": "string"
},
"comment": {
"type": "string"
},
"hosts_allow": {
"type": "string"
},
"name": {
"type": "string"
},
"path": {
"type": "string"
},
"secret": {
"type": "string"
}
}
},
"panel_app_http_requests_plugins_rsync.Update": {
"type": "object",
"properties": {
"auth_user": {
"type": "string"
},
"comment": {
"type": "string"
},
"hosts_allow": {
"type": "string"
},
"name": {
"type": "string"
},
"path": {
"type": "string"
},
"secret": {
"type": "string"
}
}
},
"panel_app_http_requests_setting.Update": {
"type": "object",
"properties": {
"backup_path": {
"type": "string"
},
"email": {
"type": "string"
},
"entrance": {
"type": "string"
},
"name": {
"type": "string"
},
"password": {
"type": "string"
},
"port": {
"type": "integer"
},
"username": {
"type": "string"
},
"website_path": {
"type": "string"
}
}
},
"panel_app_http_requests_website.Add": {
"type": "object",
"properties": {
"db": {
@@ -2128,35 +2439,6 @@
}
}
},
"requests.Update": {
"type": "object",
"properties": {
"backup_path": {
"type": "string"
},
"email": {
"type": "string"
},
"entrance": {
"type": "string"
},
"name": {
"type": "string"
},
"password": {
"type": "string"
},
"port": {
"type": "integer"
},
"username": {
"type": "string"
},
"website_path": {
"type": "string"
}
}
},
"requests.UserStore": {
"type": "object",
"properties": {

View File

@@ -151,7 +151,56 @@ definitions:
updated_at:
type: string
type: object
requests.Add:
panel_app_http_requests_plugins_rsync.Add:
properties:
auth_user:
type: string
comment:
type: string
hosts_allow:
type: string
name:
type: string
path:
type: string
secret:
type: string
type: object
panel_app_http_requests_plugins_rsync.Update:
properties:
auth_user:
type: string
comment:
type: string
hosts_allow:
type: string
name:
type: string
path:
type: string
secret:
type: string
type: object
panel_app_http_requests_setting.Update:
properties:
backup_path:
type: string
email:
type: string
entrance:
type: string
name:
type: string
password:
type: string
port:
type: integer
username:
type: string
website_path:
type: string
type: object
panel_app_http_requests_website.Add:
properties:
db:
type: boolean
@@ -301,25 +350,6 @@ definitions:
waf_mode:
type: string
type: object
requests.Update:
properties:
backup_path:
type: string
email:
type: string
entrance:
type: string
name:
type: string
password:
type: string
port:
type: integer
username:
type: string
website_path:
type: string
type: object
requests.UserStore:
properties:
ca:
@@ -990,7 +1020,7 @@ paths:
name: data
required: true
schema:
$ref: '#/definitions/requests.Update'
$ref: '#/definitions/panel_app_http_requests_setting.Update'
produces:
- application/json
responses:
@@ -1213,7 +1243,7 @@ paths:
name: data
required: true
schema:
$ref: '#/definitions/requests.Add'
$ref: '#/definitions/panel_app_http_requests_website.Add'
produces:
- application/json
responses:
@@ -1443,6 +1473,150 @@ paths:
summary: 更新备注
tags:
- 网站管理
/plugins/rsync/modules:
delete:
description: 删除 Rsync 模块
parameters:
- description: 模块名称
in: query
name: name
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/controllers.SuccessResponse'
security:
- BearerToken: []
summary: 删除模块
tags:
- 插件-Rsync
get:
description: 列出所有 Rsync 模块
parameters:
- description: request
in: body
name: data
required: true
schema:
$ref: '#/definitions/commonrequests.Paginate'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/controllers.SuccessResponse'
security:
- BearerToken: []
summary: 列出模块
tags:
- 插件-Rsync
post:
description: 添加 Rsync 模块
parameters:
- description: request
in: body
name: data
required: true
schema:
$ref: '#/definitions/panel_app_http_requests_plugins_rsync.Add'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/controllers.SuccessResponse'
security:
- BearerToken: []
summary: 添加模块
tags:
- 插件-Rsync
put:
description: 更新 Rsync 模块
parameters:
- description: request
in: body
name: data
required: true
schema:
$ref: '#/definitions/panel_app_http_requests_plugins_rsync.Update'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/controllers.SuccessResponse'
security:
- BearerToken: []
summary: 更新模块
tags:
- 插件-Rsync
/plugins/rsync/restart:
post:
description: 重启 Rsync 服务
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/controllers.SuccessResponse'
security:
- BearerToken: []
summary: 重启服务
tags:
- 插件-Rsync
/plugins/rsync/start:
post:
description: 启动 Rsync 服务
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/controllers.SuccessResponse'
security:
- BearerToken: []
summary: 启动服务
tags:
- 插件-Rsync
/plugins/rsync/status:
get:
description: 获取 Rsync 服务状态
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/controllers.SuccessResponse'
security:
- BearerToken: []
summary: 服务状态
tags:
- 插件-Rsync
/plugins/rsync/stop:
post:
description: 停止 Rsync 服务
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/controllers.SuccessResponse'
security:
- BearerToken: []
summary: 停止服务
tags:
- 插件-Rsync
/swagger:
get:
description: Swagger UI