feat: Add AI-enhanced configuration (#7870)

This commit is contained in:
zhengkunwang
2025-02-14 14:26:05 +08:00
committed by GitHub
parent c709e48ceb
commit 078d7fbe1e
31 changed files with 2138 additions and 156 deletions

View File

@@ -1,4 +1,5 @@
// Package docs Code generated by swaggo/swag. DO NOT EDIT
// Package docs GENERATED BY SWAG; DO NOT EDIT
// This file was generated by swaggo/swag
package docs
import "github.com/swaggo/swag"
@@ -20,6 +21,267 @@ const docTemplate = `{
"host": "{{.Host}}",
"basePath": "{{.BasePath}}",
"paths": {
"/aitool/domain/bind": {
"post": {
"security": [
{
"ApiKeyAuth": []
},
{
"Timestamp": []
}
],
"consumes": [
"application/json"
],
"tags": [
"AITools"
],
"summary": "Bind domain",
"parameters": [
{
"description": "request",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/dto.WebsiteConfig"
}
}
],
"responses": {
"200": {
"description": "OK"
}
}
}
},
"/aitool/domain/get": {
"post": {
"security": [
{
"ApiKeyAuth": []
},
{
"Timestamp": []
}
],
"consumes": [
"application/json"
],
"tags": [
"AITools"
],
"summary": "Get bind domain",
"parameters": [
{
"description": "request",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/dto.OllamaBindDomainReq"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/dto.OllamaBindDomainRes"
}
}
}
}
},
"/aitool/gpu/load": {
"get": {
"security": [
{
"ApiKeyAuth": []
},
{
"Timestamp": []
}
],
"consumes": [
"application/json"
],
"tags": [
"AITools"
],
"summary": "Load gpu / xpu info",
"responses": {
"200": {
"description": "OK"
}
}
}
},
"/aitool/ollama/model/del": {
"post": {
"security": [
{
"ApiKeyAuth": []
},
{
"Timestamp": []
}
],
"consumes": [
"application/json"
],
"tags": [
"AITools"
],
"summary": "Delete Ollama model",
"parameters": [
{
"description": "request",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/dto.OllamaModelName"
}
}
],
"responses": {
"200": {
"description": "OK"
}
},
"x-panel-log": {
"BeforeFunctions": [],
"bodyKeys": [
"name"
],
"formatEN": "remove Ollama model [name]",
"formatZH": "删除模型 [name]",
"paramKeys": []
}
}
},
"/aitools/ollama/model": {
"post": {
"security": [
{
"ApiKeyAuth": []
},
{
"Timestamp": []
}
],
"consumes": [
"application/json"
],
"tags": [
"AITools"
],
"summary": "Create Ollama model",
"parameters": [
{
"description": "request",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/dto.OllamaModelName"
}
}
],
"responses": {
"200": {
"description": "OK"
}
},
"x-panel-log": {
"BeforeFunctions": [],
"bodyKeys": [
"name"
],
"formatEN": "add Ollama model [name]",
"formatZH": "添加模型 [name]",
"paramKeys": []
}
}
},
"/aitools/ollama/model/load": {
"post": {
"security": [
{
"ApiKeyAuth": []
},
{
"Timestamp": []
}
],
"consumes": [
"application/json"
],
"tags": [
"AITools"
],
"summary": "Page Ollama models",
"parameters": [
{
"description": "request",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/dto.OllamaModelName"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "string"
}
}
}
}
},
"/aitools/ollama/model/search": {
"post": {
"security": [
{
"ApiKeyAuth": []
},
{
"Timestamp": []
}
],
"consumes": [
"application/json"
],
"tags": [
"AITools"
],
"summary": "Page Ollama models",
"parameters": [
{
"description": "request",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/dto.SearchWithPage"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/dto.PageResult"
}
}
}
}
},
"/apps/checkupdate": {
"get": {
"security": [
@@ -6024,6 +6286,47 @@ const docTemplate = `{
}
}
},
"/files/batch/check": {
"post": {
"security": [
{
"ApiKeyAuth": []
},
{
"Timestamp": []
}
],
"consumes": [
"application/json"
],
"tags": [
"File"
],
"summary": "Batch check file exist",
"parameters": [
{
"description": "request",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/request.FilePathsCheck"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/response.ExistFileInfo"
}
}
}
}
}
},
"/files/batch/del": {
"post": {
"security": [
@@ -16759,6 +17062,9 @@ const docTemplate = `{
"github": {
"type": "string"
},
"gpuSupport": {
"type": "boolean"
},
"key": {
"type": "string"
},
@@ -16991,6 +17297,41 @@ const docTemplate = `{
}
}
},
"dto.CCConfig": {
"type": "object",
"properties": {
"action": {
"type": "string"
},
"code": {
"type": "integer"
},
"duration": {
"type": "integer"
},
"ipBlock": {
"type": "string"
},
"ipBlockTime": {
"type": "integer"
},
"mode": {
"type": "string"
},
"res": {
"type": "string"
},
"state": {
"type": "string"
},
"threshold": {
"type": "integer"
},
"type": {
"type": "string"
}
}
},
"dto.CaptchaResponse": {
"type": "object",
"properties": {
@@ -17435,6 +17776,26 @@ const docTemplate = `{
}
}
},
"dto.CommonConfig": {
"type": "object",
"properties": {
"action": {
"type": "string"
},
"code": {
"type": "integer"
},
"res": {
"type": "string"
},
"state": {
"type": "string"
},
"type": {
"type": "string"
}
}
},
"dto.CommonRecover": {
"type": "object",
"required": [
@@ -19131,6 +19492,29 @@ const docTemplate = `{
}
}
},
"dto.GeoRestrict": {
"type": "object",
"properties": {
"action": {
"type": "string"
},
"res": {
"type": "string"
},
"rules": {
"type": "array",
"items": {
"type": "string"
}
},
"state": {
"type": "string"
},
"type": {
"type": "string"
}
}
},
"dto.GroupCreate": {
"type": "object",
"required": [
@@ -19564,6 +19948,9 @@ const docTemplate = `{
"ja": {
"type": "string"
},
"ko": {
"type": "string"
},
"ms": {
"type": "string"
},
@@ -20217,6 +20604,45 @@ const docTemplate = `{
"ProxyCache"
]
},
"dto.OllamaBindDomainReq": {
"type": "object",
"required": [
"appInstallID"
],
"properties": {
"appInstallID": {
"type": "integer"
}
}
},
"dto.OllamaBindDomainRes": {
"type": "object",
"properties": {
"allowIPs": {
"type": "array",
"items": {
"type": "string"
}
},
"domain": {
"type": "string"
},
"sslID": {
"type": "integer"
},
"websiteID": {
"type": "integer"
}
}
},
"dto.OllamaModelName": {
"type": "object",
"properties": {
"name": {
"type": "string"
}
}
},
"dto.OneDriveInfo": {
"type": "object",
"properties": {
@@ -21683,6 +22109,14 @@ const docTemplate = `{
}
}
},
"dto.StateConfig": {
"type": "object",
"properties": {
"state": {
"type": "string"
}
}
},
"dto.SwapHelper": {
"type": "object",
"required": [
@@ -21881,6 +22315,72 @@ const docTemplate = `{
}
}
},
"dto.WafConfig": {
"type": "object",
"required": [
"mode",
"secret",
"state"
],
"properties": {
"mode": {
"type": "string"
},
"secret": {
"type": "string"
},
"state": {
"type": "string"
},
"token": {
"type": "string"
}
}
},
"dto.WebsiteConfig": {
"type": "object",
"properties": {
"args": {
"$ref": "#/definitions/dto.CommonConfig"
},
"cc": {
"$ref": "#/definitions/dto.CCConfig"
},
"cdn": {
"$ref": "#/definitions/dto.StateConfig"
},
"cookie": {
"$ref": "#/definitions/dto.CommonConfig"
},
"defaultUaBlack": {
"$ref": "#/definitions/dto.CommonConfig"
},
"defaultUrlBlack": {
"$ref": "#/definitions/dto.CommonConfig"
},
"fileExt": {
"$ref": "#/definitions/dto.CommonConfig"
},
"geoRestrict": {
"$ref": "#/definitions/dto.GeoRestrict"
},
"header": {
"$ref": "#/definitions/dto.CommonConfig"
},
"methodWhite": {
"$ref": "#/definitions/dto.CommonConfig"
},
"sql": {
"$ref": "#/definitions/dto.CommonConfig"
},
"waf": {
"$ref": "#/definitions/dto.WafConfig"
},
"xss": {
"$ref": "#/definitions/dto.CommonConfig"
}
}
},
"dto.XPUInfo": {
"type": "object",
"properties": {
@@ -22010,6 +22510,9 @@ const docTemplate = `{
"github": {
"type": "string"
},
"gpuSupport": {
"type": "boolean"
},
"icon": {
"type": "string"
},
@@ -22210,32 +22713,6 @@ const docTemplate = `{
}
}
},
"model.Tag": {
"type": "object",
"properties": {
"createdAt": {
"type": "string"
},
"id": {
"type": "integer"
},
"key": {
"type": "string"
},
"name": {
"type": "string"
},
"sort": {
"type": "integer"
},
"translations": {
"type": "string"
},
"updatedAt": {
"type": "string"
}
}
},
"model.Website": {
"type": "object",
"properties": {
@@ -22535,6 +23012,9 @@ const docTemplate = `{
"editCompose": {
"type": "boolean"
},
"gpuConfig": {
"type": "boolean"
},
"hostMode": {
"type": "boolean"
},
@@ -22698,6 +23178,9 @@ const docTemplate = `{
"editCompose": {
"type": "boolean"
},
"gpuConfig": {
"type": "boolean"
},
"hostMode": {
"type": "boolean"
},
@@ -23046,6 +23529,20 @@ const docTemplate = `{
}
}
},
"request.FilePathsCheck": {
"type": "object",
"required": [
"paths"
],
"properties": {
"paths": {
"type": "array",
"items": {
"type": "string"
}
}
}
},
"request.FileReadByLineReq": {
"type": "object",
"required": [
@@ -23264,6 +23761,9 @@ const docTemplate = `{
"editCompose": {
"type": "boolean"
},
"gpuConfig": {
"type": "boolean"
},
"hostMode": {
"type": "boolean"
},
@@ -24883,6 +25383,9 @@ const docTemplate = `{
"editCompose": {
"type": "boolean"
},
"gpuConfig": {
"type": "boolean"
},
"hostMode": {
"type": "boolean"
},
@@ -24921,6 +25424,9 @@ const docTemplate = `{
"github": {
"type": "string"
},
"gpuSupport": {
"type": "boolean"
},
"icon": {
"type": "string"
},
@@ -24966,7 +25472,7 @@ const docTemplate = `{
"tags": {
"type": "array",
"items": {
"$ref": "#/definitions/model.Tag"
"$ref": "#/definitions/response.TagDTO"
}
},
"type": {
@@ -25007,6 +25513,9 @@ const docTemplate = `{
"enable": {
"type": "boolean"
},
"gpuSupport": {
"type": "boolean"
},
"hostMode": {
"type": "boolean"
},
@@ -25087,6 +25596,9 @@ const docTemplate = `{
"description": {
"type": "string"
},
"gpuSupport": {
"type": "boolean"
},
"icon": {
"type": "string"
},
@@ -25242,6 +25754,23 @@ const docTemplate = `{
}
}
},
"response.ExistFileInfo": {
"type": "object",
"properties": {
"modTime": {
"type": "string"
},
"name": {
"type": "string"
},
"path": {
"type": "string"
},
"size": {
"type": "number"
}
}
},
"response.FileInfo": {
"type": "object",
"properties": {
@@ -26162,7 +26691,7 @@ const docTemplate = `{
},
"securityDefinitions": {
"ApiKeyAuth": {
"description": "Custom Token Format, Format: md5('1panel' + API-Key + UnixTimestamp).\n` + "`" + `` + "`" + `` + "`" + `\neg:\ncurl -X GET \"http://localhost:4004/api/v1/dashboard/current\" \\\n-H \"1Panel-Token: \u003c1panel_token\u003e\" \\\n-H \"1Panel-Timestamp: \u003ccurrent_unix_timestamp\u003e\"\n` + "`" + `` + "`" + `` + "`" + `\n- ` + "`" + `1Panel-Token` + "`" + ` is the key for the panel API Key.",
"description": "- ` + "`" + `1Panel-Token` + "`" + ` is the key for the panel API Key.",
"type": "apiKey",
"name": "1Panel-Token",
"in": "header"
@@ -26186,8 +26715,6 @@ var SwaggerInfo = &swag.Spec{
Description: "Top-Rated Web-based Linux Server Management Tool",
InfoInstanceName: "swagger",
SwaggerTemplate: docTemplate,
LeftDelim: "{{",
RightDelim: "}}",
}
func init() {

View File

@@ -17,6 +17,267 @@
},
"basePath": "/api/v1",
"paths": {
"/aitool/domain/bind": {
"post": {
"security": [
{
"ApiKeyAuth": []
},
{
"Timestamp": []
}
],
"consumes": [
"application/json"
],
"tags": [
"AITools"
],
"summary": "Bind domain",
"parameters": [
{
"description": "request",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/dto.WebsiteConfig"
}
}
],
"responses": {
"200": {
"description": "OK"
}
}
}
},
"/aitool/domain/get": {
"post": {
"security": [
{
"ApiKeyAuth": []
},
{
"Timestamp": []
}
],
"consumes": [
"application/json"
],
"tags": [
"AITools"
],
"summary": "Get bind domain",
"parameters": [
{
"description": "request",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/dto.OllamaBindDomainReq"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/dto.OllamaBindDomainRes"
}
}
}
}
},
"/aitool/gpu/load": {
"get": {
"security": [
{
"ApiKeyAuth": []
},
{
"Timestamp": []
}
],
"consumes": [
"application/json"
],
"tags": [
"AITools"
],
"summary": "Load gpu / xpu info",
"responses": {
"200": {
"description": "OK"
}
}
}
},
"/aitool/ollama/model/del": {
"post": {
"security": [
{
"ApiKeyAuth": []
},
{
"Timestamp": []
}
],
"consumes": [
"application/json"
],
"tags": [
"AITools"
],
"summary": "Delete Ollama model",
"parameters": [
{
"description": "request",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/dto.OllamaModelName"
}
}
],
"responses": {
"200": {
"description": "OK"
}
},
"x-panel-log": {
"BeforeFunctions": [],
"bodyKeys": [
"name"
],
"formatEN": "remove Ollama model [name]",
"formatZH": "删除模型 [name]",
"paramKeys": []
}
}
},
"/aitools/ollama/model": {
"post": {
"security": [
{
"ApiKeyAuth": []
},
{
"Timestamp": []
}
],
"consumes": [
"application/json"
],
"tags": [
"AITools"
],
"summary": "Create Ollama model",
"parameters": [
{
"description": "request",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/dto.OllamaModelName"
}
}
],
"responses": {
"200": {
"description": "OK"
}
},
"x-panel-log": {
"BeforeFunctions": [],
"bodyKeys": [
"name"
],
"formatEN": "add Ollama model [name]",
"formatZH": "添加模型 [name]",
"paramKeys": []
}
}
},
"/aitools/ollama/model/load": {
"post": {
"security": [
{
"ApiKeyAuth": []
},
{
"Timestamp": []
}
],
"consumes": [
"application/json"
],
"tags": [
"AITools"
],
"summary": "Page Ollama models",
"parameters": [
{
"description": "request",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/dto.OllamaModelName"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "string"
}
}
}
}
},
"/aitools/ollama/model/search": {
"post": {
"security": [
{
"ApiKeyAuth": []
},
{
"Timestamp": []
}
],
"consumes": [
"application/json"
],
"tags": [
"AITools"
],
"summary": "Page Ollama models",
"parameters": [
{
"description": "request",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/dto.SearchWithPage"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/dto.PageResult"
}
}
}
}
},
"/apps/checkupdate": {
"get": {
"security": [
@@ -6021,6 +6282,47 @@
}
}
},
"/files/batch/check": {
"post": {
"security": [
{
"ApiKeyAuth": []
},
{
"Timestamp": []
}
],
"consumes": [
"application/json"
],
"tags": [
"File"
],
"summary": "Batch check file exist",
"parameters": [
{
"description": "request",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/request.FilePathsCheck"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/response.ExistFileInfo"
}
}
}
}
}
},
"/files/batch/del": {
"post": {
"security": [
@@ -16756,6 +17058,9 @@
"github": {
"type": "string"
},
"gpuSupport": {
"type": "boolean"
},
"key": {
"type": "string"
},
@@ -16988,6 +17293,41 @@
}
}
},
"dto.CCConfig": {
"type": "object",
"properties": {
"action": {
"type": "string"
},
"code": {
"type": "integer"
},
"duration": {
"type": "integer"
},
"ipBlock": {
"type": "string"
},
"ipBlockTime": {
"type": "integer"
},
"mode": {
"type": "string"
},
"res": {
"type": "string"
},
"state": {
"type": "string"
},
"threshold": {
"type": "integer"
},
"type": {
"type": "string"
}
}
},
"dto.CaptchaResponse": {
"type": "object",
"properties": {
@@ -17432,6 +17772,26 @@
}
}
},
"dto.CommonConfig": {
"type": "object",
"properties": {
"action": {
"type": "string"
},
"code": {
"type": "integer"
},
"res": {
"type": "string"
},
"state": {
"type": "string"
},
"type": {
"type": "string"
}
}
},
"dto.CommonRecover": {
"type": "object",
"required": [
@@ -19128,6 +19488,29 @@
}
}
},
"dto.GeoRestrict": {
"type": "object",
"properties": {
"action": {
"type": "string"
},
"res": {
"type": "string"
},
"rules": {
"type": "array",
"items": {
"type": "string"
}
},
"state": {
"type": "string"
},
"type": {
"type": "string"
}
}
},
"dto.GroupCreate": {
"type": "object",
"required": [
@@ -19561,6 +19944,9 @@
"ja": {
"type": "string"
},
"ko": {
"type": "string"
},
"ms": {
"type": "string"
},
@@ -20214,6 +20600,45 @@
"ProxyCache"
]
},
"dto.OllamaBindDomainReq": {
"type": "object",
"required": [
"appInstallID"
],
"properties": {
"appInstallID": {
"type": "integer"
}
}
},
"dto.OllamaBindDomainRes": {
"type": "object",
"properties": {
"allowIPs": {
"type": "array",
"items": {
"type": "string"
}
},
"domain": {
"type": "string"
},
"sslID": {
"type": "integer"
},
"websiteID": {
"type": "integer"
}
}
},
"dto.OllamaModelName": {
"type": "object",
"properties": {
"name": {
"type": "string"
}
}
},
"dto.OneDriveInfo": {
"type": "object",
"properties": {
@@ -21680,6 +22105,14 @@
}
}
},
"dto.StateConfig": {
"type": "object",
"properties": {
"state": {
"type": "string"
}
}
},
"dto.SwapHelper": {
"type": "object",
"required": [
@@ -21878,6 +22311,72 @@
}
}
},
"dto.WafConfig": {
"type": "object",
"required": [
"mode",
"secret",
"state"
],
"properties": {
"mode": {
"type": "string"
},
"secret": {
"type": "string"
},
"state": {
"type": "string"
},
"token": {
"type": "string"
}
}
},
"dto.WebsiteConfig": {
"type": "object",
"properties": {
"args": {
"$ref": "#/definitions/dto.CommonConfig"
},
"cc": {
"$ref": "#/definitions/dto.CCConfig"
},
"cdn": {
"$ref": "#/definitions/dto.StateConfig"
},
"cookie": {
"$ref": "#/definitions/dto.CommonConfig"
},
"defaultUaBlack": {
"$ref": "#/definitions/dto.CommonConfig"
},
"defaultUrlBlack": {
"$ref": "#/definitions/dto.CommonConfig"
},
"fileExt": {
"$ref": "#/definitions/dto.CommonConfig"
},
"geoRestrict": {
"$ref": "#/definitions/dto.GeoRestrict"
},
"header": {
"$ref": "#/definitions/dto.CommonConfig"
},
"methodWhite": {
"$ref": "#/definitions/dto.CommonConfig"
},
"sql": {
"$ref": "#/definitions/dto.CommonConfig"
},
"waf": {
"$ref": "#/definitions/dto.WafConfig"
},
"xss": {
"$ref": "#/definitions/dto.CommonConfig"
}
}
},
"dto.XPUInfo": {
"type": "object",
"properties": {
@@ -22007,6 +22506,9 @@
"github": {
"type": "string"
},
"gpuSupport": {
"type": "boolean"
},
"icon": {
"type": "string"
},
@@ -22207,32 +22709,6 @@
}
}
},
"model.Tag": {
"type": "object",
"properties": {
"createdAt": {
"type": "string"
},
"id": {
"type": "integer"
},
"key": {
"type": "string"
},
"name": {
"type": "string"
},
"sort": {
"type": "integer"
},
"translations": {
"type": "string"
},
"updatedAt": {
"type": "string"
}
}
},
"model.Website": {
"type": "object",
"properties": {
@@ -22532,6 +23008,9 @@
"editCompose": {
"type": "boolean"
},
"gpuConfig": {
"type": "boolean"
},
"hostMode": {
"type": "boolean"
},
@@ -22695,6 +23174,9 @@
"editCompose": {
"type": "boolean"
},
"gpuConfig": {
"type": "boolean"
},
"hostMode": {
"type": "boolean"
},
@@ -23043,6 +23525,20 @@
}
}
},
"request.FilePathsCheck": {
"type": "object",
"required": [
"paths"
],
"properties": {
"paths": {
"type": "array",
"items": {
"type": "string"
}
}
}
},
"request.FileReadByLineReq": {
"type": "object",
"required": [
@@ -23261,6 +23757,9 @@
"editCompose": {
"type": "boolean"
},
"gpuConfig": {
"type": "boolean"
},
"hostMode": {
"type": "boolean"
},
@@ -24880,6 +25379,9 @@
"editCompose": {
"type": "boolean"
},
"gpuConfig": {
"type": "boolean"
},
"hostMode": {
"type": "boolean"
},
@@ -24918,6 +25420,9 @@
"github": {
"type": "string"
},
"gpuSupport": {
"type": "boolean"
},
"icon": {
"type": "string"
},
@@ -24963,7 +25468,7 @@
"tags": {
"type": "array",
"items": {
"$ref": "#/definitions/model.Tag"
"$ref": "#/definitions/response.TagDTO"
}
},
"type": {
@@ -25004,6 +25509,9 @@
"enable": {
"type": "boolean"
},
"gpuSupport": {
"type": "boolean"
},
"hostMode": {
"type": "boolean"
},
@@ -25084,6 +25592,9 @@
"description": {
"type": "string"
},
"gpuSupport": {
"type": "boolean"
},
"icon": {
"type": "string"
},
@@ -25239,6 +25750,23 @@
}
}
},
"response.ExistFileInfo": {
"type": "object",
"properties": {
"modTime": {
"type": "string"
},
"name": {
"type": "string"
},
"path": {
"type": "string"
},
"size": {
"type": "number"
}
}
},
"response.FileInfo": {
"type": "object",
"properties": {
@@ -26159,7 +26687,7 @@
},
"securityDefinitions": {
"ApiKeyAuth": {
"description": "Custom Token Format, Format: md5('1panel' + API-Key + UnixTimestamp).\n```\neg:\ncurl -X GET \"http://localhost:4004/api/v1/dashboard/current\" \\\n-H \"1Panel-Token: \u003c1panel_token\u003e\" \\\n-H \"1Panel-Timestamp: \u003ccurrent_unix_timestamp\u003e\"\n```\n- `1Panel-Token` is the key for the panel API Key.",
"description": "- `1Panel-Token` is the key for the panel API Key.",
"type": "apiKey",
"name": "1Panel-Token",
"in": "header"

View File

@@ -108,6 +108,8 @@ definitions:
type: string
github:
type: string
gpuSupport:
type: boolean
key:
type: string
limit:
@@ -261,6 +263,29 @@ definitions:
- permission
- username
type: object
dto.CCConfig:
properties:
action:
type: string
code:
type: integer
duration:
type: integer
ipBlock:
type: string
ipBlockTime:
type: integer
mode:
type: string
res:
type: string
state:
type: string
threshold:
type: integer
type:
type: string
type: object
dto.CaptchaResponse:
properties:
captchaID:
@@ -555,6 +580,19 @@ definitions:
required:
- type
type: object
dto.CommonConfig:
properties:
action:
type: string
code:
type: integer
res:
type: string
state:
type: string
type:
type: string
type: object
dto.CommonRecover:
properties:
detailName:
@@ -1702,6 +1740,21 @@ definitions:
required:
- encryptionMode
type: object
dto.GeoRestrict:
properties:
action:
type: string
res:
type: string
rules:
items:
type: string
type: array
state:
type: string
type:
type: string
type: object
dto.GroupCreate:
properties:
id:
@@ -1991,6 +2044,8 @@ definitions:
type: string
ja:
type: string
ko:
type: string
ms:
type: string
pt-br:
@@ -2442,6 +2497,31 @@ definitions:
- CACHE
- HttpPer
- ProxyCache
dto.OllamaBindDomainReq:
properties:
appInstallID:
type: integer
required:
- appInstallID
type: object
dto.OllamaBindDomainRes:
properties:
allowIPs:
items:
type: string
type: array
domain:
type: string
sslID:
type: integer
websiteID:
type: integer
type: object
dto.OllamaModelName:
properties:
name:
type: string
type: object
dto.OneDriveInfo:
properties:
client_id:
@@ -3432,6 +3512,11 @@ definitions:
upload:
type: string
type: object
dto.StateConfig:
properties:
state:
type: string
type: object
dto.SwapHelper:
properties:
isNew:
@@ -3561,6 +3646,50 @@ definitions:
type:
type: string
type: object
dto.WafConfig:
properties:
mode:
type: string
secret:
type: string
state:
type: string
token:
type: string
required:
- mode
- secret
- state
type: object
dto.WebsiteConfig:
properties:
args:
$ref: '#/definitions/dto.CommonConfig'
cc:
$ref: '#/definitions/dto.CCConfig'
cdn:
$ref: '#/definitions/dto.StateConfig'
cookie:
$ref: '#/definitions/dto.CommonConfig'
defaultUaBlack:
$ref: '#/definitions/dto.CommonConfig'
defaultUrlBlack:
$ref: '#/definitions/dto.CommonConfig'
fileExt:
$ref: '#/definitions/dto.CommonConfig'
geoRestrict:
$ref: '#/definitions/dto.GeoRestrict'
header:
$ref: '#/definitions/dto.CommonConfig'
methodWhite:
$ref: '#/definitions/dto.CommonConfig'
sql:
$ref: '#/definitions/dto.CommonConfig'
waf:
$ref: '#/definitions/dto.WafConfig'
xss:
$ref: '#/definitions/dto.CommonConfig'
type: object
dto.XPUInfo:
properties:
deviceID:
@@ -3646,6 +3775,8 @@ definitions:
type: string
github:
type: string
gpuSupport:
type: boolean
icon:
type: string
id:
@@ -3778,23 +3909,6 @@ definitions:
workDir:
type: string
type: object
model.Tag:
properties:
createdAt:
type: string
id:
type: integer
key:
type: string
name:
type: string
sort:
type: integer
translations:
type: string
updatedAt:
type: string
type: object
model.Website:
properties:
IPV6:
@@ -3990,6 +4104,8 @@ definitions:
type: string
editCompose:
type: boolean
gpuConfig:
type: boolean
hostMode:
type: boolean
memoryLimit:
@@ -4099,6 +4215,8 @@ definitions:
type: string
editCompose:
type: boolean
gpuConfig:
type: boolean
hostMode:
type: boolean
installId:
@@ -4332,6 +4450,15 @@ definitions:
required:
- path
type: object
request.FilePathsCheck:
properties:
paths:
items:
type: string
type: array
required:
- paths
type: object
request.FileReadByLineReq:
properties:
ID:
@@ -4479,6 +4606,8 @@ definitions:
type: string
editCompose:
type: boolean
gpuConfig:
type: boolean
hostMode:
type: boolean
memoryLimit:
@@ -5573,6 +5702,8 @@ definitions:
type: string
editCompose:
type: boolean
gpuConfig:
type: boolean
hostMode:
type: boolean
memoryLimit:
@@ -5598,6 +5729,8 @@ definitions:
type: string
github:
type: string
gpuSupport:
type: boolean
icon:
type: string
id:
@@ -5628,7 +5761,7 @@ definitions:
type: string
tags:
items:
$ref: '#/definitions/model.Tag'
$ref: '#/definitions/response.TagDTO'
type: array
type:
type: string
@@ -5655,6 +5788,8 @@ definitions:
type: string
enable:
type: boolean
gpuSupport:
type: boolean
hostMode:
type: boolean
id:
@@ -5708,6 +5843,8 @@ definitions:
properties:
description:
type: string
gpuSupport:
type: boolean
icon:
type: string
id:
@@ -5810,6 +5947,17 @@ definitions:
required:
- size
type: object
response.ExistFileInfo:
properties:
modTime:
type: string
name:
type: string
path:
type: string
size:
type: number
type: object
response.FileInfo:
properties:
content:
@@ -6421,6 +6569,159 @@ info:
title: 1Panel
version: "1.0"
paths:
/aitool/domain/bind:
post:
consumes:
- application/json
parameters:
- description: request
in: body
name: request
required: true
schema:
$ref: '#/definitions/dto.WebsiteConfig'
responses:
"200":
description: OK
security:
- ApiKeyAuth: []
- Timestamp: []
summary: Bind domain
tags:
- AITools
/aitool/domain/get:
post:
consumes:
- application/json
parameters:
- description: request
in: body
name: request
required: true
schema:
$ref: '#/definitions/dto.OllamaBindDomainReq'
responses:
"200":
description: OK
schema:
$ref: '#/definitions/dto.OllamaBindDomainRes'
security:
- ApiKeyAuth: []
- Timestamp: []
summary: Get bind domain
tags:
- AITools
/aitool/gpu/load:
get:
consumes:
- application/json
responses:
"200":
description: OK
security:
- ApiKeyAuth: []
- Timestamp: []
summary: Load gpu / xpu info
tags:
- AITools
/aitool/ollama/model/del:
post:
consumes:
- application/json
parameters:
- description: request
in: body
name: request
required: true
schema:
$ref: '#/definitions/dto.OllamaModelName'
responses:
"200":
description: OK
security:
- ApiKeyAuth: []
- Timestamp: []
summary: Delete Ollama model
tags:
- AITools
x-panel-log:
BeforeFunctions: []
bodyKeys:
- name
formatEN: remove Ollama model [name]
formatZH: 删除模型 [name]
paramKeys: []
/aitools/ollama/model:
post:
consumes:
- application/json
parameters:
- description: request
in: body
name: request
required: true
schema:
$ref: '#/definitions/dto.OllamaModelName'
responses:
"200":
description: OK
security:
- ApiKeyAuth: []
- Timestamp: []
summary: Create Ollama model
tags:
- AITools
x-panel-log:
BeforeFunctions: []
bodyKeys:
- name
formatEN: add Ollama model [name]
formatZH: 添加模型 [name]
paramKeys: []
/aitools/ollama/model/load:
post:
consumes:
- application/json
parameters:
- description: request
in: body
name: request
required: true
schema:
$ref: '#/definitions/dto.OllamaModelName'
responses:
"200":
description: OK
schema:
type: string
security:
- ApiKeyAuth: []
- Timestamp: []
summary: Page Ollama models
tags:
- AITools
/aitools/ollama/model/search:
post:
consumes:
- application/json
parameters:
- description: request
in: body
name: request
required: true
schema:
$ref: '#/definitions/dto.SearchWithPage'
responses:
"200":
description: OK
schema:
$ref: '#/definitions/dto.PageResult'
security:
- ApiKeyAuth: []
- Timestamp: []
summary: Page Ollama models
tags:
- AITools
/apps/{key}:
get:
consumes:
@@ -10045,6 +10346,30 @@ paths:
formatEN: Create dir or file [path]
formatZH: 创建文件/文件夹 [path]
paramKeys: []
/files/batch/check:
post:
consumes:
- application/json
parameters:
- description: request
in: body
name: request
required: true
schema:
$ref: '#/definitions/request.FilePathsCheck'
responses:
"200":
description: OK
schema:
items:
$ref: '#/definitions/response.ExistFileInfo'
type: array
security:
- ApiKeyAuth: []
- Timestamp: []
summary: Batch check file exist
tags:
- File
/files/batch/del:
post:
consumes:
@@ -16422,15 +16747,7 @@ schemes:
- https
securityDefinitions:
ApiKeyAuth:
description: |-
Custom Token Format, Format: md5('1panel' + API-Key + UnixTimestamp).
```
eg:
curl -X GET "http://localhost:4004/api/v1/dashboard/current" \
-H "1Panel-Token: <1panel_token>" \
-H "1Panel-Timestamp: <current_unix_timestamp>"
```
- `1Panel-Token` is the key for the panel API Key.
description: '- `1Panel-Token` is the key for the panel API Key.'
in: header
name: 1Panel-Token
type: apiKey