mirror of
https://github.com/acepanel/panel.git
synced 2026-02-04 09:13:49 +08:00
refactor: 重构types包
This commit is contained in:
2
.github/FUNDING.yml
vendored
2
.github/FUNDING.yml
vendored
@@ -1,4 +1,4 @@
|
|||||||
# These are supported funding model platforms
|
# These are supported funding model platforms
|
||||||
|
|
||||||
open_collective: tnb
|
open_collective: tnb
|
||||||
custom: ['https://afdian.net/a/TheTNB']
|
custom: [ 'https://afdian.net/a/TheTNB' ]
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import (
|
|||||||
|
|
||||||
"github.com/TheTNB/panel/app/models"
|
"github.com/TheTNB/panel/app/models"
|
||||||
"github.com/TheTNB/panel/internal/services"
|
"github.com/TheTNB/panel/internal/services"
|
||||||
"github.com/TheTNB/panel/types"
|
"github.com/TheTNB/panel/pkg/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
// CertRenew 证书续签
|
// CertRenew 证书续签
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import (
|
|||||||
"github.com/TheTNB/panel/app/models"
|
"github.com/TheTNB/panel/app/models"
|
||||||
"github.com/TheTNB/panel/internal/services"
|
"github.com/TheTNB/panel/internal/services"
|
||||||
"github.com/TheTNB/panel/pkg/tools"
|
"github.com/TheTNB/panel/pkg/tools"
|
||||||
"github.com/TheTNB/panel/types"
|
"github.com/TheTNB/panel/pkg/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Monitoring 系统监控
|
// Monitoring 系统监控
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ import (
|
|||||||
"github.com/TheTNB/panel/pkg/str"
|
"github.com/TheTNB/panel/pkg/str"
|
||||||
"github.com/TheTNB/panel/pkg/systemctl"
|
"github.com/TheTNB/panel/pkg/systemctl"
|
||||||
"github.com/TheTNB/panel/pkg/tools"
|
"github.com/TheTNB/panel/pkg/tools"
|
||||||
"github.com/TheTNB/panel/types"
|
"github.com/TheTNB/panel/pkg/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Panel 面板命令行
|
// Panel 面板命令行
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import (
|
|||||||
|
|
||||||
"github.com/TheTNB/panel/pkg/io"
|
"github.com/TheTNB/panel/pkg/io"
|
||||||
"github.com/TheTNB/panel/pkg/shell"
|
"github.com/TheTNB/panel/pkg/shell"
|
||||||
"github.com/TheTNB/panel/types"
|
"github.com/TheTNB/panel/pkg/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
// PanelTask 面板每日任务
|
// PanelTask 面板每日任务
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
package controllers
|
package controllers
|
||||||
|
|
||||||
import (
|
import (
|
||||||
commonrequests "github.com/TheTNB/panel/app/http/requests/common"
|
|
||||||
"github.com/goravel/framework/contracts/http"
|
"github.com/goravel/framework/contracts/http"
|
||||||
"github.com/goravel/framework/facades"
|
"github.com/goravel/framework/facades"
|
||||||
|
|
||||||
|
commonrequests "github.com/TheTNB/panel/app/http/requests/common"
|
||||||
)
|
)
|
||||||
|
|
||||||
// SuccessResponse 通用成功响应
|
// SuccessResponse 通用成功响应
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ import (
|
|||||||
"github.com/TheTNB/panel/pkg/shell"
|
"github.com/TheTNB/panel/pkg/shell"
|
||||||
"github.com/TheTNB/panel/pkg/systemctl"
|
"github.com/TheTNB/panel/pkg/systemctl"
|
||||||
"github.com/TheTNB/panel/pkg/tools"
|
"github.com/TheTNB/panel/pkg/tools"
|
||||||
"github.com/TheTNB/panel/types"
|
"github.com/TheTNB/panel/pkg/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
type MenuItem struct {
|
type MenuItem struct {
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ import (
|
|||||||
"github.com/TheTNB/panel/pkg/os"
|
"github.com/TheTNB/panel/pkg/os"
|
||||||
"github.com/TheTNB/panel/pkg/shell"
|
"github.com/TheTNB/panel/pkg/shell"
|
||||||
"github.com/TheTNB/panel/pkg/str"
|
"github.com/TheTNB/panel/pkg/str"
|
||||||
"github.com/TheTNB/panel/types"
|
"github.com/TheTNB/panel/pkg/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Fail2banController struct {
|
type Fail2banController struct {
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ import (
|
|||||||
"github.com/TheTNB/panel/pkg/shell"
|
"github.com/TheTNB/panel/pkg/shell"
|
||||||
"github.com/TheTNB/panel/pkg/str"
|
"github.com/TheTNB/panel/pkg/str"
|
||||||
"github.com/TheTNB/panel/pkg/systemctl"
|
"github.com/TheTNB/panel/pkg/systemctl"
|
||||||
"github.com/TheTNB/panel/types"
|
"github.com/TheTNB/panel/pkg/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
type MySQLController struct {
|
type MySQLController struct {
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import (
|
|||||||
"github.com/TheTNB/panel/pkg/shell"
|
"github.com/TheTNB/panel/pkg/shell"
|
||||||
"github.com/TheTNB/panel/pkg/str"
|
"github.com/TheTNB/panel/pkg/str"
|
||||||
"github.com/TheTNB/panel/pkg/systemctl"
|
"github.com/TheTNB/panel/pkg/systemctl"
|
||||||
"github.com/TheTNB/panel/types"
|
"github.com/TheTNB/panel/pkg/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
type OpenRestyController struct {
|
type OpenRestyController struct {
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
package plugins
|
package plugins
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"github.com/goravel/framework/contracts/http"
|
||||||
|
|
||||||
"github.com/TheTNB/panel/app/http/controllers"
|
"github.com/TheTNB/panel/app/http/controllers"
|
||||||
"github.com/TheTNB/panel/internal/services"
|
"github.com/TheTNB/panel/internal/services"
|
||||||
"github.com/goravel/framework/contracts/http"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type PHPController struct{}
|
type PHPController struct{}
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ import (
|
|||||||
"github.com/TheTNB/panel/pkg/io"
|
"github.com/TheTNB/panel/pkg/io"
|
||||||
"github.com/TheTNB/panel/pkg/shell"
|
"github.com/TheTNB/panel/pkg/shell"
|
||||||
"github.com/TheTNB/panel/pkg/systemctl"
|
"github.com/TheTNB/panel/pkg/systemctl"
|
||||||
"github.com/TheTNB/panel/types"
|
"github.com/TheTNB/panel/pkg/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
type PostgreSQLController struct {
|
type PostgreSQLController struct {
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import (
|
|||||||
"github.com/TheTNB/panel/pkg/os"
|
"github.com/TheTNB/panel/pkg/os"
|
||||||
"github.com/TheTNB/panel/pkg/shell"
|
"github.com/TheTNB/panel/pkg/shell"
|
||||||
"github.com/TheTNB/panel/pkg/systemctl"
|
"github.com/TheTNB/panel/pkg/systemctl"
|
||||||
"github.com/TheTNB/panel/types"
|
"github.com/TheTNB/panel/pkg/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
type PureFtpdController struct {
|
type PureFtpdController struct {
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import (
|
|||||||
"github.com/TheTNB/panel/pkg/io"
|
"github.com/TheTNB/panel/pkg/io"
|
||||||
"github.com/TheTNB/panel/pkg/shell"
|
"github.com/TheTNB/panel/pkg/shell"
|
||||||
"github.com/TheTNB/panel/pkg/systemctl"
|
"github.com/TheTNB/panel/pkg/systemctl"
|
||||||
"github.com/TheTNB/panel/types"
|
"github.com/TheTNB/panel/pkg/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
type RedisController struct {
|
type RedisController struct {
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import (
|
|||||||
"github.com/TheTNB/panel/pkg/shell"
|
"github.com/TheTNB/panel/pkg/shell"
|
||||||
"github.com/TheTNB/panel/pkg/str"
|
"github.com/TheTNB/panel/pkg/str"
|
||||||
"github.com/TheTNB/panel/pkg/systemctl"
|
"github.com/TheTNB/panel/pkg/systemctl"
|
||||||
"github.com/TheTNB/panel/types"
|
"github.com/TheTNB/panel/pkg/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
type RsyncController struct {
|
type RsyncController struct {
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import (
|
|||||||
"github.com/TheTNB/panel/internal/services"
|
"github.com/TheTNB/panel/internal/services"
|
||||||
"github.com/TheTNB/panel/pkg/io"
|
"github.com/TheTNB/panel/pkg/io"
|
||||||
"github.com/TheTNB/panel/pkg/shell"
|
"github.com/TheTNB/panel/pkg/shell"
|
||||||
"github.com/TheTNB/panel/types"
|
"github.com/TheTNB/panel/pkg/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
type S3fsController struct {
|
type S3fsController struct {
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ import (
|
|||||||
"github.com/TheTNB/panel/pkg/io"
|
"github.com/TheTNB/panel/pkg/io"
|
||||||
"github.com/TheTNB/panel/pkg/str"
|
"github.com/TheTNB/panel/pkg/str"
|
||||||
"github.com/TheTNB/panel/pkg/systemctl"
|
"github.com/TheTNB/panel/pkg/systemctl"
|
||||||
"github.com/TheTNB/panel/types"
|
"github.com/TheTNB/panel/pkg/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
type WebsiteController struct {
|
type WebsiteController struct {
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import (
|
|||||||
"github.com/goravel/framework/contracts/http"
|
"github.com/goravel/framework/contracts/http"
|
||||||
"github.com/goravel/framework/facades"
|
"github.com/goravel/framework/facades"
|
||||||
|
|
||||||
"github.com/TheTNB/panel/types"
|
"github.com/TheTNB/panel/pkg/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Status 检查程序状态
|
// Status 检查程序状态
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import (
|
|||||||
"github.com/goravel/framework/contracts/http"
|
"github.com/goravel/framework/contracts/http"
|
||||||
"github.com/goravel/framework/contracts/validation"
|
"github.com/goravel/framework/contracts/validation"
|
||||||
|
|
||||||
"github.com/TheTNB/panel/types"
|
"github.com/TheTNB/panel/pkg/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
type ContainerCreate struct {
|
type ContainerCreate struct {
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import (
|
|||||||
"github.com/goravel/framework/contracts/http"
|
"github.com/goravel/framework/contracts/http"
|
||||||
"github.com/goravel/framework/contracts/validation"
|
"github.com/goravel/framework/contracts/validation"
|
||||||
|
|
||||||
"github.com/TheTNB/panel/types"
|
"github.com/TheTNB/panel/pkg/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
type ContainerUpdate struct {
|
type ContainerUpdate struct {
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import (
|
|||||||
"github.com/goravel/framework/contracts/http"
|
"github.com/goravel/framework/contracts/http"
|
||||||
"github.com/goravel/framework/contracts/validation"
|
"github.com/goravel/framework/contracts/validation"
|
||||||
|
|
||||||
"github.com/TheTNB/panel/types"
|
"github.com/TheTNB/panel/pkg/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
type NetworkCreate struct {
|
type NetworkCreate struct {
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import (
|
|||||||
"github.com/goravel/framework/contracts/http"
|
"github.com/goravel/framework/contracts/http"
|
||||||
"github.com/goravel/framework/contracts/validation"
|
"github.com/goravel/framework/contracts/validation"
|
||||||
|
|
||||||
"github.com/TheTNB/panel/types"
|
"github.com/TheTNB/panel/pkg/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
type VolumeCreate struct {
|
type VolumeCreate struct {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ package internal
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/TheTNB/panel/app/models"
|
"github.com/TheTNB/panel/app/models"
|
||||||
"github.com/TheTNB/panel/types"
|
"github.com/TheTNB/panel/pkg/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Backup interface {
|
type Backup interface {
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import (
|
|||||||
"github.com/docker/docker/api/types/volume"
|
"github.com/docker/docker/api/types/volume"
|
||||||
|
|
||||||
requests "github.com/TheTNB/panel/app/http/requests/container"
|
requests "github.com/TheTNB/panel/app/http/requests/container"
|
||||||
paneltypes "github.com/TheTNB/panel/types"
|
paneltypes "github.com/TheTNB/panel/pkg/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Container interface {
|
type Container interface {
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
package internal
|
package internal
|
||||||
|
|
||||||
import "github.com/TheTNB/panel/types"
|
import (
|
||||||
|
"github.com/TheTNB/panel/pkg/types"
|
||||||
|
)
|
||||||
|
|
||||||
type PHP interface {
|
type PHP interface {
|
||||||
Status() (bool, error)
|
Status() (bool, error)
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ package internal
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/TheTNB/panel/app/models"
|
"github.com/TheTNB/panel/app/models"
|
||||||
"github.com/TheTNB/panel/types"
|
"github.com/TheTNB/panel/pkg/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Plugin interface {
|
type Plugin interface {
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ import (
|
|||||||
"github.com/TheTNB/panel/pkg/io"
|
"github.com/TheTNB/panel/pkg/io"
|
||||||
"github.com/TheTNB/panel/pkg/shell"
|
"github.com/TheTNB/panel/pkg/shell"
|
||||||
"github.com/TheTNB/panel/pkg/str"
|
"github.com/TheTNB/panel/pkg/str"
|
||||||
"github.com/TheTNB/panel/types"
|
"github.com/TheTNB/panel/pkg/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
type BackupImpl struct {
|
type BackupImpl struct {
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ import (
|
|||||||
"github.com/goravel/framework/support/json"
|
"github.com/goravel/framework/support/json"
|
||||||
|
|
||||||
requests "github.com/TheTNB/panel/app/http/requests/container"
|
requests "github.com/TheTNB/panel/app/http/requests/container"
|
||||||
paneltypes "github.com/TheTNB/panel/types"
|
paneltypes "github.com/TheTNB/panel/pkg/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Container struct {
|
type Container struct {
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ import (
|
|||||||
"github.com/TheTNB/panel/pkg/io"
|
"github.com/TheTNB/panel/pkg/io"
|
||||||
"github.com/TheTNB/panel/pkg/shell"
|
"github.com/TheTNB/panel/pkg/shell"
|
||||||
"github.com/TheTNB/panel/pkg/systemctl"
|
"github.com/TheTNB/panel/pkg/systemctl"
|
||||||
"github.com/TheTNB/panel/types"
|
"github.com/TheTNB/panel/pkg/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
type PHPImpl struct {
|
type PHPImpl struct {
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import (
|
|||||||
"github.com/TheTNB/panel/app/models"
|
"github.com/TheTNB/panel/app/models"
|
||||||
"github.com/TheTNB/panel/internal"
|
"github.com/TheTNB/panel/internal"
|
||||||
"github.com/TheTNB/panel/pkg/io"
|
"github.com/TheTNB/panel/pkg/io"
|
||||||
"github.com/TheTNB/panel/types"
|
"github.com/TheTNB/panel/pkg/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
type PluginImpl struct {
|
type PluginImpl struct {
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ import (
|
|||||||
"github.com/TheTNB/panel/pkg/shell"
|
"github.com/TheTNB/panel/pkg/shell"
|
||||||
"github.com/TheTNB/panel/pkg/str"
|
"github.com/TheTNB/panel/pkg/str"
|
||||||
"github.com/TheTNB/panel/pkg/systemctl"
|
"github.com/TheTNB/panel/pkg/systemctl"
|
||||||
"github.com/TheTNB/panel/types"
|
"github.com/TheTNB/panel/pkg/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
type WebsiteImpl struct {
|
type WebsiteImpl struct {
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ package internal
|
|||||||
import (
|
import (
|
||||||
requests "github.com/TheTNB/panel/app/http/requests/website"
|
requests "github.com/TheTNB/panel/app/http/requests/website"
|
||||||
"github.com/TheTNB/panel/app/models"
|
"github.com/TheTNB/panel/app/models"
|
||||||
"github.com/TheTNB/panel/types"
|
"github.com/TheTNB/panel/pkg/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Website interface {
|
type Website interface {
|
||||||
|
|||||||
@@ -9,8 +9,9 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/TheTNB/panel/pkg/slice"
|
|
||||||
"github.com/goravel/framework/support"
|
"github.com/goravel/framework/support"
|
||||||
|
|
||||||
|
"github.com/TheTNB/panel/pkg/slice"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Execf 执行 shell 命令
|
// Execf 执行 shell 命令
|
||||||
|
|||||||
@@ -63,6 +63,7 @@ func (t *Turn) Write(p []byte) (n int, err error) {
|
|||||||
|
|
||||||
return writer.Write(p)
|
return writer.Write(p)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (t *Turn) Close() error {
|
func (t *Turn) Close() error {
|
||||||
if t.Session != nil {
|
if t.Session != nil {
|
||||||
t.Session.Close()
|
t.Session.Close()
|
||||||
|
|||||||
@@ -51,8 +51,8 @@ func GetMonitoringInfo() MonitoringInfo {
|
|||||||
res.Disk, _ = disk.Partitions(true)
|
res.Disk, _ = disk.Partitions(true)
|
||||||
|
|
||||||
ioCounters, _ := disk.IOCounters()
|
ioCounters, _ := disk.IOCounters()
|
||||||
for _, io := range ioCounters {
|
for _, info := range ioCounters {
|
||||||
res.DiskIO = append(res.DiskIO, io)
|
res.DiskIO = append(res.DiskIO, info)
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, partition := range res.Disk {
|
for _, partition := range res.Disk {
|
||||||
|
|||||||
Reference in New Issue
Block a user