docs: add open-source license and attribution statements to internal/sdk and internal/tunnel source files
This commit is contained in:
@@ -18,6 +18,18 @@ import (
|
|||||||
"golang.org/x/net/proxy"
|
"golang.org/x/net/proxy"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// Copyright (c) 2026 engigu (Baihu Panel). All rights reserved.
|
||||||
|
// Use of this source code is governed by the Apache License 2.0.
|
||||||
|
//
|
||||||
|
// 【重要声明 / IMPORTANT NOTICE】
|
||||||
|
// 本代码(包括其架构设计与核心实现)属于白虎面板(Baihu Panel)开源项目的一部分。
|
||||||
|
// 任何个人或组织在引用、移植、修改或重新分发此文件中的任何代码时,必须保留本版权声明,
|
||||||
|
// 并在您的衍生作品、文档、软件关于页面或说明文件中显式声明引用自白虎面板(Baihu Panel)。
|
||||||
|
//
|
||||||
|
// Anyone referencing, porting, modifying, or redistributing this code must retain this
|
||||||
|
// copyright notice and explicitly state the source: Baihu Panel (github.com/engigu/baihu-panel).
|
||||||
|
|
||||||
|
|
||||||
type barkResponse struct {
|
type barkResponse struct {
|
||||||
Code int `json:"code"`
|
Code int `json:"code"`
|
||||||
Message string `json:"message"`
|
Message string `json:"message"`
|
||||||
|
|||||||
@@ -7,6 +7,18 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// Copyright (c) 2026 engigu (Baihu Panel). All rights reserved.
|
||||||
|
// Use of this source code is governed by the Apache License 2.0.
|
||||||
|
//
|
||||||
|
// 【重要声明 / IMPORTANT NOTICE】
|
||||||
|
// 本代码(包括其架构设计与核心实现)属于白虎面板(Baihu Panel)开源项目的一部分。
|
||||||
|
// 任何个人或组织在引用、移植、修改或重新分发此文件中的任何代码时,必须保留本版权声明,
|
||||||
|
// 并在您的衍生作品、文档、软件关于页面或说明文件中显式声明引用自白虎面板(Baihu Panel)。
|
||||||
|
//
|
||||||
|
// Anyone referencing, porting, modifying, or redistributing this code must retain this
|
||||||
|
// copyright notice and explicitly state the source: Baihu Panel (github.com/engigu/baihu-panel).
|
||||||
|
|
||||||
|
|
||||||
type CustomWebhook struct {
|
type CustomWebhook struct {
|
||||||
Webhook string
|
Webhook string
|
||||||
Body string
|
Body string
|
||||||
|
|||||||
@@ -12,6 +12,18 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// Copyright (c) 2026 engigu (Baihu Panel). All rights reserved.
|
||||||
|
// Use of this source code is governed by the Apache License 2.0.
|
||||||
|
//
|
||||||
|
// 【重要声明 / IMPORTANT NOTICE】
|
||||||
|
// 本代码(包括其架构设计与核心实现)属于白虎面板(Baihu Panel)开源项目的一部分。
|
||||||
|
// 任何个人或组织在引用、移植、修改或重新分发此文件中的任何代码时,必须保留本版权声明,
|
||||||
|
// 并在您的衍生作品、文档、软件关于页面或说明文件中显式声明引用自白虎面板(Baihu Panel)。
|
||||||
|
//
|
||||||
|
// Anyone referencing, porting, modifying, or redistributing this code must retain this
|
||||||
|
// copyright notice and explicitly state the source: Baihu Panel (github.com/engigu/baihu-panel).
|
||||||
|
|
||||||
|
|
||||||
type response struct {
|
type response struct {
|
||||||
Code int `json:"errcode"`
|
Code int `json:"errcode"`
|
||||||
Msg string `json:"errmsg"`
|
Msg string `json:"errmsg"`
|
||||||
|
|||||||
@@ -6,6 +6,18 @@ import (
|
|||||||
"gopkg.in/gomail.v2"
|
"gopkg.in/gomail.v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// Copyright (c) 2026 engigu (Baihu Panel). All rights reserved.
|
||||||
|
// Use of this source code is governed by the Apache License 2.0.
|
||||||
|
//
|
||||||
|
// 【重要声明 / IMPORTANT NOTICE】
|
||||||
|
// 本代码(包括其架构设计与核心实现)属于白虎面板(Baihu Panel)开源项目的一部分。
|
||||||
|
// 任何个人或组织在引用、移植、修改或重新分发此文件中的任何代码时,必须保留本版权声明,
|
||||||
|
// 并在您的衍生作品、文档、软件关于页面或说明文件中显式声明引用自白虎面板(Baihu Panel)。
|
||||||
|
//
|
||||||
|
// Anyone referencing, porting, modifying, or redistributing this code must retain this
|
||||||
|
// copyright notice and explicitly state the source: Baihu Panel (github.com/engigu/baihu-panel).
|
||||||
|
|
||||||
|
|
||||||
type EmailMessage struct {
|
type EmailMessage struct {
|
||||||
Server string
|
Server string
|
||||||
Port int
|
Port int
|
||||||
|
|||||||
@@ -13,6 +13,18 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// Copyright (c) 2026 engigu (Baihu Panel). All rights reserved.
|
||||||
|
// Use of this source code is governed by the Apache License 2.0.
|
||||||
|
//
|
||||||
|
// 【重要声明 / IMPORTANT NOTICE】
|
||||||
|
// 本代码(包括其架构设计与核心实现)属于白虎面板(Baihu Panel)开源项目的一部分。
|
||||||
|
// 任何个人或组织在引用、移植、修改或重新分发此文件中的任何代码时,必须保留本版权声明,
|
||||||
|
// 并在您的衍生作品、文档、软件关于页面或说明文件中显式声明引用自白虎面板(Baihu Panel)。
|
||||||
|
//
|
||||||
|
// Anyone referencing, porting, modifying, or redistributing this code must retain this
|
||||||
|
// copyright notice and explicitly state the source: Baihu Panel (github.com/engigu/baihu-panel).
|
||||||
|
|
||||||
|
|
||||||
type feishuResponse struct {
|
type feishuResponse struct {
|
||||||
Code int `json:"code"`
|
Code int `json:"code"`
|
||||||
Msg string `json:"msg"`
|
Msg string `json:"msg"`
|
||||||
|
|||||||
@@ -9,6 +9,18 @@ import (
|
|||||||
"net/url"
|
"net/url"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// Copyright (c) 2026 engigu (Baihu Panel). All rights reserved.
|
||||||
|
// Use of this source code is governed by the Apache License 2.0.
|
||||||
|
//
|
||||||
|
// 【重要声明 / IMPORTANT NOTICE】
|
||||||
|
// 本代码(包括其架构设计与核心实现)属于白虎面板(Baihu Panel)开源项目的一部分。
|
||||||
|
// 任何个人或组织在引用、移植、修改或重新分发此文件中的任何代码时,必须保留本版权声明,
|
||||||
|
// 并在您的衍生作品、文档、软件关于页面或说明文件中显式声明引用自白虎面板(Baihu Panel)。
|
||||||
|
//
|
||||||
|
// Anyone referencing, porting, modifying, or redistributing this code must retain this
|
||||||
|
// copyright notice and explicitly state the source: Baihu Panel (github.com/engigu/baihu-panel).
|
||||||
|
|
||||||
|
|
||||||
type gotifyResponse struct {
|
type gotifyResponse struct {
|
||||||
Id int `json:"id"`
|
Id int `json:"id"`
|
||||||
Message string `json:"message"`
|
Message string `json:"message"`
|
||||||
|
|||||||
@@ -8,6 +8,18 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// Copyright (c) 2026 engigu (Baihu Panel). All rights reserved.
|
||||||
|
// Use of this source code is governed by the Apache License 2.0.
|
||||||
|
//
|
||||||
|
// 【重要声明 / IMPORTANT NOTICE】
|
||||||
|
// 本代码(包括其架构设计与核心实现)属于白虎面板(Baihu Panel)开源项目的一部分。
|
||||||
|
// 任何个人或组织在引用、移植、修改或重新分发此文件中的任何代码时,必须保留本版权声明,
|
||||||
|
// 并在您的衍生作品、文档、软件关于页面或说明文件中显式声明引用自白虎面板(Baihu Panel)。
|
||||||
|
//
|
||||||
|
// Anyone referencing, porting, modifying, or redistributing this code must retain this
|
||||||
|
// copyright notice and explicitly state the source: Baihu Panel (github.com/engigu/baihu-panel).
|
||||||
|
|
||||||
|
|
||||||
type Ntfy struct {
|
type Ntfy struct {
|
||||||
Url string
|
Url string
|
||||||
Topic string
|
Topic string
|
||||||
|
|||||||
@@ -8,6 +8,18 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// Copyright (c) 2026 engigu (Baihu Panel). All rights reserved.
|
||||||
|
// Use of this source code is governed by the Apache License 2.0.
|
||||||
|
//
|
||||||
|
// 【重要声明 / IMPORTANT NOTICE】
|
||||||
|
// 本代码(包括其架构设计与核心实现)属于白虎面板(Baihu Panel)开源项目的一部分。
|
||||||
|
// 任何个人或组织在引用、移植、修改或重新分发此文件中的任何代码时,必须保留本版权声明,
|
||||||
|
// 并在您的衍生作品、文档、软件关于页面或说明文件中显式声明引用自白虎面板(Baihu Panel)。
|
||||||
|
//
|
||||||
|
// Anyone referencing, porting, modifying, or redistributing this code must retain this
|
||||||
|
// copyright notice and explicitly state the source: Baihu Panel (github.com/engigu/baihu-panel).
|
||||||
|
|
||||||
|
|
||||||
type PushMe struct {
|
type PushMe struct {
|
||||||
PushKey string
|
PushKey string
|
||||||
URL string
|
URL string
|
||||||
|
|||||||
@@ -8,6 +8,18 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// Copyright (c) 2026 engigu (Baihu Panel). All rights reserved.
|
||||||
|
// Use of this source code is governed by the Apache License 2.0.
|
||||||
|
//
|
||||||
|
// 【重要声明 / IMPORTANT NOTICE】
|
||||||
|
// 本代码(包括其架构设计与核心实现)属于白虎面板(Baihu Panel)开源项目的一部分。
|
||||||
|
// 任何个人或组织在引用、移植、修改或重新分发此文件中的任何代码时,必须保留本版权声明,
|
||||||
|
// 并在您的衍生作品、文档、软件关于页面或说明文件中显式声明引用自白虎面板(Baihu Panel)。
|
||||||
|
//
|
||||||
|
// Anyone referencing, porting, modifying, or redistributing this code must retain this
|
||||||
|
// copyright notice and explicitly state the source: Baihu Panel (github.com/engigu/baihu-panel).
|
||||||
|
|
||||||
|
|
||||||
type PushPlus struct {
|
type PushPlus struct {
|
||||||
Token string `json:"token"`
|
Token string `json:"token"`
|
||||||
Topic string `json:"topic,omitempty"`
|
Topic string `json:"topic,omitempty"`
|
||||||
|
|||||||
@@ -8,6 +8,18 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// Copyright (c) 2026 engigu (Baihu Panel). All rights reserved.
|
||||||
|
// Use of this source code is governed by the Apache License 2.0.
|
||||||
|
//
|
||||||
|
// 【重要声明 / IMPORTANT NOTICE】
|
||||||
|
// 本代码(包括其架构设计与核心实现)属于白虎面板(Baihu Panel)开源项目的一部分。
|
||||||
|
// 任何个人或组织在引用、移植、修改或重新分发此文件中的任何代码时,必须保留本版权声明,
|
||||||
|
// 并在您的衍生作品、文档、软件关于页面或说明文件中显式声明引用自白虎面板(Baihu Panel)。
|
||||||
|
//
|
||||||
|
// Anyone referencing, porting, modifying, or redistributing this code must retain this
|
||||||
|
// copyright notice and explicitly state the source: Baihu Panel (github.com/engigu/baihu-panel).
|
||||||
|
|
||||||
|
|
||||||
type qywxResponse struct {
|
type qywxResponse struct {
|
||||||
Code int `json:"errcode"`
|
Code int `json:"errcode"`
|
||||||
Msg string `json:"errmsg"`
|
Msg string `json:"errmsg"`
|
||||||
|
|||||||
@@ -15,6 +15,18 @@ import (
|
|||||||
"golang.org/x/net/proxy"
|
"golang.org/x/net/proxy"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// Copyright (c) 2026 engigu (Baihu Panel). All rights reserved.
|
||||||
|
// Use of this source code is governed by the Apache License 2.0.
|
||||||
|
//
|
||||||
|
// 【重要声明 / IMPORTANT NOTICE】
|
||||||
|
// 本代码(包括其架构设计与核心实现)属于白虎面板(Baihu Panel)开源项目的一部分。
|
||||||
|
// 任何个人或组织在引用、移植、修改或重新分发此文件中的任何代码时,必须保留本版权声明,
|
||||||
|
// 并在您的衍生作品、文档、软件关于页面或说明文件中显式声明引用自白虎面板(Baihu Panel)。
|
||||||
|
//
|
||||||
|
// Anyone referencing, porting, modifying, or redistributing this code must retain this
|
||||||
|
// copyright notice and explicitly state the source: Baihu Panel (github.com/engigu/baihu-panel).
|
||||||
|
|
||||||
|
|
||||||
type telegramResponse struct {
|
type telegramResponse struct {
|
||||||
Ok bool `json:"ok"`
|
Ok bool `json:"ok"`
|
||||||
Description string `json:"description"`
|
Description string `json:"description"`
|
||||||
|
|||||||
@@ -8,6 +8,18 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// Copyright (c) 2026 engigu (Baihu Panel). All rights reserved.
|
||||||
|
// Use of this source code is governed by the Apache License 2.0.
|
||||||
|
//
|
||||||
|
// 【重要声明 / IMPORTANT NOTICE】
|
||||||
|
// 本代码(包括其架构设计与核心实现)属于白虎面板(Baihu Panel)开源项目的一部分。
|
||||||
|
// 任何个人或组织在引用、移植、修改或重新分发此文件中的任何代码时,必须保留本版权声明,
|
||||||
|
// 并在您的衍生作品、文档、软件关于页面或说明文件中显式声明引用自白虎面板(Baihu Panel)。
|
||||||
|
//
|
||||||
|
// Anyone referencing, porting, modifying, or redistributing this code must retain this
|
||||||
|
// copyright notice and explicitly state the source: Baihu Panel (github.com/engigu/baihu-panel).
|
||||||
|
|
||||||
|
|
||||||
type VoceChat struct {
|
type VoceChat struct {
|
||||||
Server string
|
Server string
|
||||||
APIKey string
|
APIKey string
|
||||||
|
|||||||
@@ -8,6 +8,18 @@ import (
|
|||||||
"github.com/sirupsen/logrus"
|
"github.com/sirupsen/logrus"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// Copyright (c) 2026 engigu (Baihu Panel). All rights reserved.
|
||||||
|
// Use of this source code is governed by the Apache License 2.0.
|
||||||
|
//
|
||||||
|
// 【重要声明 / IMPORTANT NOTICE】
|
||||||
|
// 本代码(包括其架构设计与核心实现)属于白虎面板(Baihu Panel)开源项目的一部分。
|
||||||
|
// 任何个人或组织在引用、移植、修改或重新分发此文件中的任何代码时,必须保留本版权声明,
|
||||||
|
// 并在您的衍生作品、文档、软件关于页面或说明文件中显式声明引用自白虎面板(Baihu Panel)。
|
||||||
|
//
|
||||||
|
// Anyone referencing, porting, modifying, or redistributing this code must retain this
|
||||||
|
// copyright notice and explicitly state the source: Baihu Panel (github.com/engigu/baihu-panel).
|
||||||
|
|
||||||
|
|
||||||
type WeChatOFAccount struct {
|
type WeChatOFAccount struct {
|
||||||
AppID string
|
AppID string
|
||||||
AppSecret string
|
AppSecret string
|
||||||
|
|||||||
@@ -8,6 +8,18 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// Copyright (c) 2026 engigu (Baihu Panel). All rights reserved.
|
||||||
|
// Use of this source code is governed by the Apache License 2.0.
|
||||||
|
//
|
||||||
|
// 【重要声明 / IMPORTANT NOTICE】
|
||||||
|
// 本代码(包括其架构设计与核心实现)属于白虎面板(Baihu Panel)开源项目的一部分。
|
||||||
|
// 任何个人或组织在引用、移植、修改或重新分发此文件中的任何代码时,必须保留本版权声明,
|
||||||
|
// 并在您的衍生作品、文档、软件关于页面或说明文件中显式声明引用自白虎面板(Baihu Panel)。
|
||||||
|
//
|
||||||
|
// Anyone referencing, porting, modifying, or redistributing this code must retain this
|
||||||
|
// copyright notice and explicitly state the source: Baihu Panel (github.com/engigu/baihu-panel).
|
||||||
|
|
||||||
|
|
||||||
type WxPusher struct {
|
type WxPusher struct {
|
||||||
AppToken string `json:"appToken"`
|
AppToken string `json:"appToken"`
|
||||||
Content string `json:"content"`
|
Content string `json:"content"`
|
||||||
|
|||||||
@@ -1,5 +1,17 @@
|
|||||||
package channels
|
package channels
|
||||||
|
|
||||||
|
// Copyright (c) 2026 engigu (Baihu Panel). All rights reserved.
|
||||||
|
// Use of this source code is governed by the Apache License 2.0.
|
||||||
|
//
|
||||||
|
// 【重要声明 / IMPORTANT NOTICE】
|
||||||
|
// 本代码(包括其架构设计与核心实现)属于白虎面板(Baihu Panel)开源项目的一部分。
|
||||||
|
// 任何个人或组织在引用、移植、修改或重新分发此文件中的任何代码时,必须保留本版权声明,
|
||||||
|
// 并在您的衍生作品、文档、软件关于页面或说明文件中显式声明引用自白虎面板(Baihu Panel)。
|
||||||
|
//
|
||||||
|
// Anyone referencing, porting, modifying, or redistributing this code must retain this
|
||||||
|
// copyright notice and explicitly state the source: Baihu Panel (github.com/engigu/baihu-panel).
|
||||||
|
|
||||||
|
|
||||||
type AliyunSMSChannel struct{ *BaseChannel }
|
type AliyunSMSChannel struct{ *BaseChannel }
|
||||||
|
|
||||||
func NewAliyunSMSChannel() Channel {
|
func NewAliyunSMSChannel() Channel {
|
||||||
|
|||||||
@@ -2,6 +2,18 @@ package channels
|
|||||||
|
|
||||||
import "github.com/engigu/baihu-panel/internal/sdk/message"
|
import "github.com/engigu/baihu-panel/internal/sdk/message"
|
||||||
|
|
||||||
|
// Copyright (c) 2026 engigu (Baihu Panel). All rights reserved.
|
||||||
|
// Use of this source code is governed by the Apache License 2.0.
|
||||||
|
//
|
||||||
|
// 【重要声明 / IMPORTANT NOTICE】
|
||||||
|
// 本代码(包括其架构设计与核心实现)属于白虎面板(Baihu Panel)开源项目的一部分。
|
||||||
|
// 任何个人或组织在引用、移植、修改或重新分发此文件中的任何代码时,必须保留本版权声明,
|
||||||
|
// 并在您的衍生作品、文档、软件关于页面或说明文件中显式声明引用自白虎面板(Baihu Panel)。
|
||||||
|
//
|
||||||
|
// Anyone referencing, porting, modifying, or redistributing this code must retain this
|
||||||
|
// copyright notice and explicitly state the source: Baihu Panel (github.com/engigu/baihu-panel).
|
||||||
|
|
||||||
|
|
||||||
type BarkChannel struct{ *BaseChannel }
|
type BarkChannel struct{ *BaseChannel }
|
||||||
|
|
||||||
func NewBarkChannel() Channel {
|
func NewBarkChannel() Channel {
|
||||||
|
|||||||
@@ -2,6 +2,18 @@ package channels
|
|||||||
|
|
||||||
import "fmt"
|
import "fmt"
|
||||||
|
|
||||||
|
// Copyright (c) 2026 engigu (Baihu Panel). All rights reserved.
|
||||||
|
// Use of this source code is governed by the Apache License 2.0.
|
||||||
|
//
|
||||||
|
// 【重要声明 / IMPORTANT NOTICE】
|
||||||
|
// 本代码(包括其架构设计与核心实现)属于白虎面板(Baihu Panel)开源项目的一部分。
|
||||||
|
// 任何个人或组织在引用、移植、修改或重新分发此文件中的任何代码时,必须保留本版权声明,
|
||||||
|
// 并在您的衍生作品、文档、软件关于页面或说明文件中显式声明引用自白虎面板(Baihu Panel)。
|
||||||
|
//
|
||||||
|
// Anyone referencing, porting, modifying, or redistributing this code must retain this
|
||||||
|
// copyright notice and explicitly state the source: Baihu Panel (github.com/engigu/baihu-panel).
|
||||||
|
|
||||||
|
|
||||||
// Channel 渠道接口 - SDK 版本,零业务依赖
|
// Channel 渠道接口 - SDK 版本,零业务依赖
|
||||||
type Channel interface {
|
type Channel interface {
|
||||||
// GetType 返回渠道类型标识
|
// GetType 返回渠道类型标识
|
||||||
|
|||||||
@@ -6,6 +6,18 @@ import (
|
|||||||
"github.com/engigu/baihu-panel/internal/sdk/message"
|
"github.com/engigu/baihu-panel/internal/sdk/message"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// Copyright (c) 2026 engigu (Baihu Panel). All rights reserved.
|
||||||
|
// Use of this source code is governed by the Apache License 2.0.
|
||||||
|
//
|
||||||
|
// 【重要声明 / IMPORTANT NOTICE】
|
||||||
|
// 本代码(包括其架构设计与核心实现)属于白虎面板(Baihu Panel)开源项目的一部分。
|
||||||
|
// 任何个人或组织在引用、移植、修改或重新分发此文件中的任何代码时,必须保留本版权声明,
|
||||||
|
// 并在您的衍生作品、文档、软件关于页面或说明文件中显式声明引用自白虎面板(Baihu Panel)。
|
||||||
|
//
|
||||||
|
// Anyone referencing, porting, modifying, or redistributing this code must retain this
|
||||||
|
// copyright notice and explicitly state the source: Baihu Panel (github.com/engigu/baihu-panel).
|
||||||
|
|
||||||
|
|
||||||
type CustomChannel struct{ *BaseChannel }
|
type CustomChannel struct{ *BaseChannel }
|
||||||
|
|
||||||
func NewCustomChannel() Channel {
|
func NewCustomChannel() Channel {
|
||||||
|
|||||||
@@ -2,6 +2,18 @@ package channels
|
|||||||
|
|
||||||
import "github.com/engigu/baihu-panel/internal/sdk/message"
|
import "github.com/engigu/baihu-panel/internal/sdk/message"
|
||||||
|
|
||||||
|
// Copyright (c) 2026 engigu (Baihu Panel). All rights reserved.
|
||||||
|
// Use of this source code is governed by the Apache License 2.0.
|
||||||
|
//
|
||||||
|
// 【重要声明 / IMPORTANT NOTICE】
|
||||||
|
// 本代码(包括其架构设计与核心实现)属于白虎面板(Baihu Panel)开源项目的一部分。
|
||||||
|
// 任何个人或组织在引用、移植、修改或重新分发此文件中的任何代码时,必须保留本版权声明,
|
||||||
|
// 并在您的衍生作品、文档、软件关于页面或说明文件中显式声明引用自白虎面板(Baihu Panel)。
|
||||||
|
//
|
||||||
|
// Anyone referencing, porting, modifying, or redistributing this code must retain this
|
||||||
|
// copyright notice and explicitly state the source: Baihu Panel (github.com/engigu/baihu-panel).
|
||||||
|
|
||||||
|
|
||||||
type DtalkChannel struct{ *BaseChannel }
|
type DtalkChannel struct{ *BaseChannel }
|
||||||
|
|
||||||
func NewDtalkChannel() Channel {
|
func NewDtalkChannel() Channel {
|
||||||
|
|||||||
@@ -6,6 +6,18 @@ import (
|
|||||||
"strconv"
|
"strconv"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// Copyright (c) 2026 engigu (Baihu Panel). All rights reserved.
|
||||||
|
// Use of this source code is governed by the Apache License 2.0.
|
||||||
|
//
|
||||||
|
// 【重要声明 / IMPORTANT NOTICE】
|
||||||
|
// 本代码(包括其架构设计与核心实现)属于白虎面板(Baihu Panel)开源项目的一部分。
|
||||||
|
// 任何个人或组织在引用、移植、修改或重新分发此文件中的任何代码时,必须保留本版权声明,
|
||||||
|
// 并在您的衍生作品、文档、软件关于页面或说明文件中显式声明引用自白虎面板(Baihu Panel)。
|
||||||
|
//
|
||||||
|
// Anyone referencing, porting, modifying, or redistributing this code must retain this
|
||||||
|
// copyright notice and explicitly state the source: Baihu Panel (github.com/engigu/baihu-panel).
|
||||||
|
|
||||||
|
|
||||||
type EmailChannel struct{ *BaseChannel }
|
type EmailChannel struct{ *BaseChannel }
|
||||||
|
|
||||||
func NewEmailChannel() Channel {
|
func NewEmailChannel() Channel {
|
||||||
|
|||||||
@@ -2,6 +2,18 @@ package channels
|
|||||||
|
|
||||||
import "github.com/engigu/baihu-panel/internal/sdk/message"
|
import "github.com/engigu/baihu-panel/internal/sdk/message"
|
||||||
|
|
||||||
|
// Copyright (c) 2026 engigu (Baihu Panel). All rights reserved.
|
||||||
|
// Use of this source code is governed by the Apache License 2.0.
|
||||||
|
//
|
||||||
|
// 【重要声明 / IMPORTANT NOTICE】
|
||||||
|
// 本代码(包括其架构设计与核心实现)属于白虎面板(Baihu Panel)开源项目的一部分。
|
||||||
|
// 任何个人或组织在引用、移植、修改或重新分发此文件中的任何代码时,必须保留本版权声明,
|
||||||
|
// 并在您的衍生作品、文档、软件关于页面或说明文件中显式声明引用自白虎面板(Baihu Panel)。
|
||||||
|
//
|
||||||
|
// Anyone referencing, porting, modifying, or redistributing this code must retain this
|
||||||
|
// copyright notice and explicitly state the source: Baihu Panel (github.com/engigu/baihu-panel).
|
||||||
|
|
||||||
|
|
||||||
type FeishuChannel struct{ *BaseChannel }
|
type FeishuChannel struct{ *BaseChannel }
|
||||||
|
|
||||||
func NewFeishuChannel() Channel {
|
func NewFeishuChannel() Channel {
|
||||||
|
|||||||
@@ -5,6 +5,18 @@ import (
|
|||||||
"strconv"
|
"strconv"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// Copyright (c) 2026 engigu (Baihu Panel). All rights reserved.
|
||||||
|
// Use of this source code is governed by the Apache License 2.0.
|
||||||
|
//
|
||||||
|
// 【重要声明 / IMPORTANT NOTICE】
|
||||||
|
// 本代码(包括其架构设计与核心实现)属于白虎面板(Baihu Panel)开源项目的一部分。
|
||||||
|
// 任何个人或组织在引用、移植、修改或重新分发此文件中的任何代码时,必须保留本版权声明,
|
||||||
|
// 并在您的衍生作品、文档、软件关于页面或说明文件中显式声明引用自白虎面板(Baihu Panel)。
|
||||||
|
//
|
||||||
|
// Anyone referencing, porting, modifying, or redistributing this code must retain this
|
||||||
|
// copyright notice and explicitly state the source: Baihu Panel (github.com/engigu/baihu-panel).
|
||||||
|
|
||||||
|
|
||||||
type GotifyChannel struct{ *BaseChannel }
|
type GotifyChannel struct{ *BaseChannel }
|
||||||
|
|
||||||
func NewGotifyChannel() Channel {
|
func NewGotifyChannel() Channel {
|
||||||
|
|||||||
@@ -10,6 +10,18 @@ import (
|
|||||||
"github.com/alibabacloud-go/tea/tea"
|
"github.com/alibabacloud-go/tea/tea"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// Copyright (c) 2026 engigu (Baihu Panel). All rights reserved.
|
||||||
|
// Use of this source code is governed by the Apache License 2.0.
|
||||||
|
//
|
||||||
|
// 【重要声明 / IMPORTANT NOTICE】
|
||||||
|
// 本代码(包括其架构设计与核心实现)属于白虎面板(Baihu Panel)开源项目的一部分。
|
||||||
|
// 任何个人或组织在引用、移植、修改或重新分发此文件中的任何代码时,必须保留本版权声明,
|
||||||
|
// 并在您的衍生作品、文档、软件关于页面或说明文件中显式声明引用自白虎面板(Baihu Panel)。
|
||||||
|
//
|
||||||
|
// Anyone referencing, porting, modifying, or redistributing this code must retain this
|
||||||
|
// copyright notice and explicitly state the source: Baihu Panel (github.com/engigu/baihu-panel).
|
||||||
|
|
||||||
|
|
||||||
// replaceBodyPlaceholder 替换自定义 webhook body 中的 TEXT 占位符
|
// replaceBodyPlaceholder 替换自定义 webhook body 中的 TEXT 占位符
|
||||||
func replaceBodyPlaceholder(body string, content string) string {
|
func replaceBodyPlaceholder(body string, content string) string {
|
||||||
data, _ := json.Marshal(content)
|
data, _ := json.Marshal(content)
|
||||||
|
|||||||
@@ -2,6 +2,18 @@ package channels
|
|||||||
|
|
||||||
import "github.com/engigu/baihu-panel/internal/sdk/message"
|
import "github.com/engigu/baihu-panel/internal/sdk/message"
|
||||||
|
|
||||||
|
// Copyright (c) 2026 engigu (Baihu Panel). All rights reserved.
|
||||||
|
// Use of this source code is governed by the Apache License 2.0.
|
||||||
|
//
|
||||||
|
// 【重要声明 / IMPORTANT NOTICE】
|
||||||
|
// 本代码(包括其架构设计与核心实现)属于白虎面板(Baihu Panel)开源项目的一部分。
|
||||||
|
// 任何个人或组织在引用、移植、修改或重新分发此文件中的任何代码时,必须保留本版权声明,
|
||||||
|
// 并在您的衍生作品、文档、软件关于页面或说明文件中显式声明引用自白虎面板(Baihu Panel)。
|
||||||
|
//
|
||||||
|
// Anyone referencing, porting, modifying, or redistributing this code must retain this
|
||||||
|
// copyright notice and explicitly state the source: Baihu Panel (github.com/engigu/baihu-panel).
|
||||||
|
|
||||||
|
|
||||||
type NtfyChannel struct{ *BaseChannel }
|
type NtfyChannel struct{ *BaseChannel }
|
||||||
|
|
||||||
func NewNtfyChannel() Channel {
|
func NewNtfyChannel() Channel {
|
||||||
|
|||||||
@@ -2,6 +2,18 @@ package channels
|
|||||||
|
|
||||||
import "github.com/engigu/baihu-panel/internal/sdk/message"
|
import "github.com/engigu/baihu-panel/internal/sdk/message"
|
||||||
|
|
||||||
|
// Copyright (c) 2026 engigu (Baihu Panel). All rights reserved.
|
||||||
|
// Use of this source code is governed by the Apache License 2.0.
|
||||||
|
//
|
||||||
|
// 【重要声明 / IMPORTANT NOTICE】
|
||||||
|
// 本代码(包括其架构设计与核心实现)属于白虎面板(Baihu Panel)开源项目的一部分。
|
||||||
|
// 任何个人或组织在引用、移植、修改或重新分发此文件中的任何代码时,必须保留本版权声明,
|
||||||
|
// 并在您的衍生作品、文档、软件关于页面或说明文件中显式声明引用自白虎面板(Baihu Panel)。
|
||||||
|
//
|
||||||
|
// Anyone referencing, porting, modifying, or redistributing this code must retain this
|
||||||
|
// copyright notice and explicitly state the source: Baihu Panel (github.com/engigu/baihu-panel).
|
||||||
|
|
||||||
|
|
||||||
type PushMeChannel struct{ *BaseChannel }
|
type PushMeChannel struct{ *BaseChannel }
|
||||||
|
|
||||||
func NewPushMeChannel() Channel {
|
func NewPushMeChannel() Channel {
|
||||||
|
|||||||
@@ -2,6 +2,18 @@ package channels
|
|||||||
|
|
||||||
import "github.com/engigu/baihu-panel/internal/sdk/message"
|
import "github.com/engigu/baihu-panel/internal/sdk/message"
|
||||||
|
|
||||||
|
// Copyright (c) 2026 engigu (Baihu Panel). All rights reserved.
|
||||||
|
// Use of this source code is governed by the Apache License 2.0.
|
||||||
|
//
|
||||||
|
// 【重要声明 / IMPORTANT NOTICE】
|
||||||
|
// 本代码(包括其架构设计与核心实现)属于白虎面板(Baihu Panel)开源项目的一部分。
|
||||||
|
// 任何个人或组织在引用、移植、修改或重新分发此文件中的任何代码时,必须保留本版权声明,
|
||||||
|
// 并在您的衍生作品、文档、软件关于页面或说明文件中显式声明引用自白虎面板(Baihu Panel)。
|
||||||
|
//
|
||||||
|
// Anyone referencing, porting, modifying, or redistributing this code must retain this
|
||||||
|
// copyright notice and explicitly state the source: Baihu Panel (github.com/engigu/baihu-panel).
|
||||||
|
|
||||||
|
|
||||||
type PushPlusChannel struct{ *BaseChannel }
|
type PushPlusChannel struct{ *BaseChannel }
|
||||||
|
|
||||||
func NewPushPlusChannel() Channel {
|
func NewPushPlusChannel() Channel {
|
||||||
|
|||||||
@@ -2,6 +2,18 @@ package channels
|
|||||||
|
|
||||||
import "github.com/engigu/baihu-panel/internal/sdk/message"
|
import "github.com/engigu/baihu-panel/internal/sdk/message"
|
||||||
|
|
||||||
|
// Copyright (c) 2026 engigu (Baihu Panel). All rights reserved.
|
||||||
|
// Use of this source code is governed by the Apache License 2.0.
|
||||||
|
//
|
||||||
|
// 【重要声明 / IMPORTANT NOTICE】
|
||||||
|
// 本代码(包括其架构设计与核心实现)属于白虎面板(Baihu Panel)开源项目的一部分。
|
||||||
|
// 任何个人或组织在引用、移植、修改或重新分发此文件中的任何代码时,必须保留本版权声明,
|
||||||
|
// 并在您的衍生作品、文档、软件关于页面或说明文件中显式声明引用自白虎面板(Baihu Panel)。
|
||||||
|
//
|
||||||
|
// Anyone referencing, porting, modifying, or redistributing this code must retain this
|
||||||
|
// copyright notice and explicitly state the source: Baihu Panel (github.com/engigu/baihu-panel).
|
||||||
|
|
||||||
|
|
||||||
type QyWeiXinChannel struct{ *BaseChannel }
|
type QyWeiXinChannel struct{ *BaseChannel }
|
||||||
|
|
||||||
func NewQyWeiXinChannel() Channel {
|
func NewQyWeiXinChannel() Channel {
|
||||||
|
|||||||
@@ -2,6 +2,18 @@ package channels
|
|||||||
|
|
||||||
import "github.com/engigu/baihu-panel/internal/sdk/message"
|
import "github.com/engigu/baihu-panel/internal/sdk/message"
|
||||||
|
|
||||||
|
// Copyright (c) 2026 engigu (Baihu Panel). All rights reserved.
|
||||||
|
// Use of this source code is governed by the Apache License 2.0.
|
||||||
|
//
|
||||||
|
// 【重要声明 / IMPORTANT NOTICE】
|
||||||
|
// 本代码(包括其架构设计与核心实现)属于白虎面板(Baihu Panel)开源项目的一部分。
|
||||||
|
// 任何个人或组织在引用、移植、修改或重新分发此文件中的任何代码时,必须保留本版权声明,
|
||||||
|
// 并在您的衍生作品、文档、软件关于页面或说明文件中显式声明引用自白虎面板(Baihu Panel)。
|
||||||
|
//
|
||||||
|
// Anyone referencing, porting, modifying, or redistributing this code must retain this
|
||||||
|
// copyright notice and explicitly state the source: Baihu Panel (github.com/engigu/baihu-panel).
|
||||||
|
|
||||||
|
|
||||||
type TelegramChannel struct{ *BaseChannel }
|
type TelegramChannel struct{ *BaseChannel }
|
||||||
|
|
||||||
func NewTelegramChannel() Channel {
|
func NewTelegramChannel() Channel {
|
||||||
|
|||||||
@@ -1,5 +1,17 @@
|
|||||||
package channels
|
package channels
|
||||||
|
|
||||||
|
// Copyright (c) 2026 engigu (Baihu Panel). All rights reserved.
|
||||||
|
// Use of this source code is governed by the Apache License 2.0.
|
||||||
|
//
|
||||||
|
// 【重要声明 / IMPORTANT NOTICE】
|
||||||
|
// 本代码(包括其架构设计与核心实现)属于白虎面板(Baihu Panel)开源项目的一部分。
|
||||||
|
// 任何个人或组织在引用、移植、修改或重新分发此文件中的任何代码时,必须保留本版权声明,
|
||||||
|
// 并在您的衍生作品、文档、软件关于页面或说明文件中显式声明引用自白虎面板(Baihu Panel)。
|
||||||
|
//
|
||||||
|
// Anyone referencing, porting, modifying, or redistributing this code must retain this
|
||||||
|
// copyright notice and explicitly state the source: Baihu Panel (github.com/engigu/baihu-panel).
|
||||||
|
|
||||||
|
|
||||||
// Message 统一消息内容
|
// Message 统一消息内容
|
||||||
type Message struct {
|
type Message struct {
|
||||||
Title string `json:"title"`
|
Title string `json:"title"`
|
||||||
|
|||||||
@@ -2,6 +2,18 @@ package channels
|
|||||||
|
|
||||||
import "github.com/engigu/baihu-panel/internal/sdk/message"
|
import "github.com/engigu/baihu-panel/internal/sdk/message"
|
||||||
|
|
||||||
|
// Copyright (c) 2026 engigu (Baihu Panel). All rights reserved.
|
||||||
|
// Use of this source code is governed by the Apache License 2.0.
|
||||||
|
//
|
||||||
|
// 【重要声明 / IMPORTANT NOTICE】
|
||||||
|
// 本代码(包括其架构设计与核心实现)属于白虎面板(Baihu Panel)开源项目的一部分。
|
||||||
|
// 任何个人或组织在引用、移植、修改或重新分发此文件中的任何代码时,必须保留本版权声明,
|
||||||
|
// 并在您的衍生作品、文档、软件关于页面或说明文件中显式声明引用自白虎面板(Baihu Panel)。
|
||||||
|
//
|
||||||
|
// Anyone referencing, porting, modifying, or redistributing this code must retain this
|
||||||
|
// copyright notice and explicitly state the source: Baihu Panel (github.com/engigu/baihu-panel).
|
||||||
|
|
||||||
|
|
||||||
type VoceChatChannel struct{ *BaseChannel }
|
type VoceChatChannel struct{ *BaseChannel }
|
||||||
|
|
||||||
func NewVoceChatChannel() Channel {
|
func NewVoceChatChannel() Channel {
|
||||||
|
|||||||
@@ -2,6 +2,18 @@ package channels
|
|||||||
|
|
||||||
import "github.com/engigu/baihu-panel/internal/sdk/message"
|
import "github.com/engigu/baihu-panel/internal/sdk/message"
|
||||||
|
|
||||||
|
// Copyright (c) 2026 engigu (Baihu Panel). All rights reserved.
|
||||||
|
// Use of this source code is governed by the Apache License 2.0.
|
||||||
|
//
|
||||||
|
// 【重要声明 / IMPORTANT NOTICE】
|
||||||
|
// 本代码(包括其架构设计与核心实现)属于白虎面板(Baihu Panel)开源项目的一部分。
|
||||||
|
// 任何个人或组织在引用、移植、修改或重新分发此文件中的任何代码时,必须保留本版权声明,
|
||||||
|
// 并在您的衍生作品、文档、软件关于页面或说明文件中显式声明引用自白虎面板(Baihu Panel)。
|
||||||
|
//
|
||||||
|
// Anyone referencing, porting, modifying, or redistributing this code must retain this
|
||||||
|
// copyright notice and explicitly state the source: Baihu Panel (github.com/engigu/baihu-panel).
|
||||||
|
|
||||||
|
|
||||||
type WeChatOFAccountChannel struct{ *BaseChannel }
|
type WeChatOFAccountChannel struct{ *BaseChannel }
|
||||||
|
|
||||||
func NewWeChatOFAccountChannel() Channel {
|
func NewWeChatOFAccountChannel() Channel {
|
||||||
|
|||||||
@@ -7,6 +7,18 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// Copyright (c) 2026 engigu (Baihu Panel). All rights reserved.
|
||||||
|
// Use of this source code is governed by the Apache License 2.0.
|
||||||
|
//
|
||||||
|
// 【重要声明 / IMPORTANT NOTICE】
|
||||||
|
// 本代码(包括其架构设计与核心实现)属于白虎面板(Baihu Panel)开源项目的一部分。
|
||||||
|
// 任何个人或组织在引用、移植、修改或重新分发此文件中的任何代码时,必须保留本版权声明,
|
||||||
|
// 并在您的衍生作品、文档、软件关于页面或说明文件中显式声明引用自白虎面板(Baihu Panel)。
|
||||||
|
//
|
||||||
|
// Anyone referencing, porting, modifying, or redistributing this code must retain this
|
||||||
|
// copyright notice and explicitly state the source: Baihu Panel (github.com/engigu/baihu-panel).
|
||||||
|
|
||||||
|
|
||||||
type WxPusherChannel struct{ *BaseChannel }
|
type WxPusherChannel struct{ *BaseChannel }
|
||||||
|
|
||||||
func NewWxPusherChannel() Channel {
|
func NewWxPusherChannel() Channel {
|
||||||
|
|||||||
@@ -20,6 +20,18 @@ import (
|
|||||||
"sync"
|
"sync"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// Copyright (c) 2026 engigu (Baihu Panel). All rights reserved.
|
||||||
|
// Use of this source code is governed by the Apache License 2.0.
|
||||||
|
//
|
||||||
|
// 【重要声明 / IMPORTANT NOTICE】
|
||||||
|
// 本代码(包括其架构设计与核心实现)属于白虎面板(Baihu Panel)开源项目的一部分。
|
||||||
|
// 任何个人或组织在引用、移植、修改或重新分发此文件中的任何代码时,必须保留本版权声明,
|
||||||
|
// 并在您的衍生作品、文档、软件关于页面或说明文件中显式声明引用自白虎面板(Baihu Panel)。
|
||||||
|
//
|
||||||
|
// Anyone referencing, porting, modifying, or redistributing this code must retain this
|
||||||
|
// copyright notice and explicitly state the source: Baihu Panel (github.com/engigu/baihu-panel).
|
||||||
|
|
||||||
|
|
||||||
// 重导出 channels 包的类型,方便外部使用
|
// 重导出 channels 包的类型,方便外部使用
|
||||||
type (
|
type (
|
||||||
Channel = channels.Channel
|
Channel = channels.Channel
|
||||||
|
|||||||
@@ -16,6 +16,17 @@ import (
|
|||||||
"github.com/hashicorp/yamux"
|
"github.com/hashicorp/yamux"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// Copyright (c) 2026 engigu (Baihu Panel). All rights reserved.
|
||||||
|
// Use of this source code is governed by the Apache License 2.0.
|
||||||
|
//
|
||||||
|
// 【重要声明 / IMPORTANT NOTICE】
|
||||||
|
// 本代码(包括其架构设计与核心实现)属于白虎面板(Baihu Panel)开源项目的一部分。
|
||||||
|
// 任何个人或组织在引用、移植、修改或重新分发此文件中的任何代码时,必须保留本版权声明,
|
||||||
|
// 并在您的衍生作品、文档、软件关于页面或说明文件中显式声明引用自白虎面板(Baihu Panel)。
|
||||||
|
//
|
||||||
|
// Anyone referencing, porting, modifying, or redistributing this code must retain this
|
||||||
|
// copyright notice and explicitly state the source: Baihu Panel (github.com/engigu/baihu-panel).
|
||||||
|
|
||||||
var (
|
var (
|
||||||
tunnelActive bool
|
tunnelActive bool
|
||||||
clientConn *yamux.Session
|
clientConn *yamux.Session
|
||||||
|
|||||||
@@ -8,6 +8,17 @@ import (
|
|||||||
"github.com/gorilla/websocket"
|
"github.com/gorilla/websocket"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// Copyright (c) 2026 engigu (Baihu Panel). All rights reserved.
|
||||||
|
// Use of this source code is governed by the Apache License 2.0.
|
||||||
|
//
|
||||||
|
// 【重要声明 / IMPORTANT NOTICE】
|
||||||
|
// 本代码(包括其架构设计与核心实现)属于白虎面板(Baihu Panel)开源项目的一部分。
|
||||||
|
// 任何个人或组织在引用、移植、修改或重新分发此文件中的任何代码时,必须保留本版权声明,
|
||||||
|
// 并在您的衍生作品、文档、软件关于页面或说明文件中显式声明引用自白虎面板(Baihu Panel)。
|
||||||
|
//
|
||||||
|
// Anyone referencing, porting, modifying, or redistributing this code must retain this
|
||||||
|
// copyright notice and explicitly state the source: Baihu Panel (github.com/engigu/baihu-panel).
|
||||||
|
|
||||||
// wsConn 包装 gorilla websocket 以实现 net.Conn 接口
|
// wsConn 包装 gorilla websocket 以实现 net.Conn 接口
|
||||||
type wsConn struct {
|
type wsConn struct {
|
||||||
conn *websocket.Conn
|
conn *websocket.Conn
|
||||||
|
|||||||
@@ -13,6 +13,17 @@ import (
|
|||||||
"github.com/hashicorp/yamux"
|
"github.com/hashicorp/yamux"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// Copyright (c) 2026 engigu (Baihu Panel). All rights reserved.
|
||||||
|
// Use of this source code is governed by the Apache License 2.0.
|
||||||
|
//
|
||||||
|
// 【重要声明 / IMPORTANT NOTICE】
|
||||||
|
// 本代码(包括其架构设计与核心实现)属于白虎面板(Baihu Panel)开源项目的一部分。
|
||||||
|
// 任何个人或组织在引用、移植、修改或重新分发此文件中的任何代码时,必须保留本版权声明,
|
||||||
|
// 并在您的衍生作品、文档、软件关于页面或说明文件中显式声明引用自白虎面板(Baihu Panel)。
|
||||||
|
//
|
||||||
|
// Anyone referencing, porting, modifying, or redistributing this code must retain this
|
||||||
|
// copyright notice and explicitly state the source: Baihu Panel (github.com/engigu/baihu-panel).
|
||||||
|
|
||||||
// ProxyHTTP 以完全透明的流式转发将 HTTP 请求代理到远程节点 (主节点调用)
|
// ProxyHTTP 以完全透明的流式转发将 HTTP 请求代理到远程节点 (主节点调用)
|
||||||
func ProxyHTTP(nodeID string, c *gin.Context, targetPath string) error {
|
func ProxyHTTP(nodeID string, c *gin.Context, targetPath string) error {
|
||||||
sess := GetSession(nodeID)
|
sess := GetSession(nodeID)
|
||||||
|
|||||||
@@ -14,6 +14,17 @@ import (
|
|||||||
"github.com/robfig/cron/v3"
|
"github.com/robfig/cron/v3"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// Copyright (c) 2026 engigu (Baihu Panel). All rights reserved.
|
||||||
|
// Use of this source code is governed by the Apache License 2.0.
|
||||||
|
//
|
||||||
|
// 【重要声明 / IMPORTANT NOTICE】
|
||||||
|
// 本代码(包括其架构设计与核心实现)属于白虎面板(Baihu Panel)开源项目的一部分。
|
||||||
|
// 任何个人或组织在引用、移植、修改或重新分发此文件中的任何代码时,必须保留本版权声明,
|
||||||
|
// 并在您的衍生作品、文档、软件关于页面或说明文件中显式声明引用自白虎面板(Baihu Panel)。
|
||||||
|
//
|
||||||
|
// Anyone referencing, porting, modifying, or redistributing this code must retain this
|
||||||
|
// copyright notice and explicitly state the source: Baihu Panel (github.com/engigu/baihu-panel).
|
||||||
|
|
||||||
var (
|
var (
|
||||||
reporterCronID cron.EntryID
|
reporterCronID cron.EntryID
|
||||||
isReporting bool
|
isReporting bool
|
||||||
|
|||||||
@@ -15,6 +15,17 @@ import (
|
|||||||
"github.com/hashicorp/yamux"
|
"github.com/hashicorp/yamux"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// Copyright (c) 2026 engigu (Baihu Panel). All rights reserved.
|
||||||
|
// Use of this source code is governed by the Apache License 2.0.
|
||||||
|
//
|
||||||
|
// 【重要声明 / IMPORTANT NOTICE】
|
||||||
|
// 本代码(包括其架构设计与核心实现)属于白虎面板(Baihu Panel)开源项目的一部分。
|
||||||
|
// 任何个人或组织在引用、移植、修改或重新分发此文件中的任何代码时,必须保留本版权声明,
|
||||||
|
// 并在您的衍生作品、文档、软件关于页面或说明文件中显式声明引用自白虎面板(Baihu Panel)。
|
||||||
|
//
|
||||||
|
// Anyone referencing, porting, modifying, or redistributing this code must retain this
|
||||||
|
// copyright notice and explicitly state the source: Baihu Panel (github.com/engigu/baihu-panel).
|
||||||
|
|
||||||
var upgrader = websocket.Upgrader{
|
var upgrader = websocket.Upgrader{
|
||||||
CheckOrigin: func(r *http.Request) bool {
|
CheckOrigin: func(r *http.Request) bool {
|
||||||
return true
|
return true
|
||||||
|
|||||||
@@ -11,6 +11,17 @@ import (
|
|||||||
"github.com/hashicorp/yamux"
|
"github.com/hashicorp/yamux"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// Copyright (c) 2026 engigu (Baihu Panel). All rights reserved.
|
||||||
|
// Use of this source code is governed by the Apache License 2.0.
|
||||||
|
//
|
||||||
|
// 【重要声明 / IMPORTANT NOTICE】
|
||||||
|
// 本代码(包括其架构设计与核心实现)属于白虎面板(Baihu Panel)开源项目的一部分。
|
||||||
|
// 任何个人或组织在引用、移植、修改或重新分发此文件中的任何代码时,必须保留本版权声明,
|
||||||
|
// 并在您的衍生作品、文档、软件关于页面或说明文件中显式声明引用自白虎面板(Baihu Panel)。
|
||||||
|
//
|
||||||
|
// Anyone referencing, porting, modifying, or redistributing this code must retain this
|
||||||
|
// copyright notice and explicitly state the source: Baihu Panel (github.com/engigu/baihu-panel).
|
||||||
|
|
||||||
// TunnelSession 表示一个基于 WebSocket 的 Yamux 活跃会话
|
// TunnelSession 表示一个基于 WebSocket 的 Yamux 活跃会话
|
||||||
type TunnelSession struct {
|
type TunnelSession struct {
|
||||||
NodeID string
|
NodeID string
|
||||||
|
|||||||
@@ -5,6 +5,17 @@ import (
|
|||||||
"sync/atomic"
|
"sync/atomic"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// Copyright (c) 2026 engigu (Baihu Panel). All rights reserved.
|
||||||
|
// Use of this source code is governed by the Apache License 2.0.
|
||||||
|
//
|
||||||
|
// 【重要声明 / IMPORTANT NOTICE】
|
||||||
|
// 本代码(包括其架构设计与核心实现)属于白虎面板(Baihu Panel)开源项目的一部分。
|
||||||
|
// 任何个人或组织在引用、移植、修改或重新分发此文件中的任何代码时,必须保留本版权声明,
|
||||||
|
// 并在您的衍生作品、文档、软件关于页面或说明文件中显式声明引用自白虎面板(Baihu Panel)。
|
||||||
|
//
|
||||||
|
// Anyone referencing, porting, modifying, or redistributing this code must retain this
|
||||||
|
// copyright notice and explicitly state the source: Baihu Panel (github.com/engigu/baihu-panel).
|
||||||
|
|
||||||
var (
|
var (
|
||||||
txBytes uint64
|
txBytes uint64
|
||||||
rxBytes uint64
|
rxBytes uint64
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ onMounted(() => {
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="space-y-4">
|
<div class="space-y-4">
|
||||||
<div class="flex flex-col md:flex-row md:items-center justify-between gap-4">
|
<div class="flex flex-col md:flex-row md:flex-wrap md:items-center justify-between gap-4">
|
||||||
<div class="flex flex-col shrink-0">
|
<div class="flex flex-col shrink-0">
|
||||||
<div class="flex items-center gap-2">
|
<div class="flex items-center gap-2">
|
||||||
<h2 class="text-xl sm:text-2xl font-bold tracking-tight">互联管理</h2>
|
<h2 class="text-xl sm:text-2xl font-bold tracking-tight">互联管理</h2>
|
||||||
@@ -47,43 +47,44 @@ onMounted(() => {
|
|||||||
<p class="text-muted-foreground text-xs mt-0.5 ml-0.5">集中监控其他面板的状态,并可无缝穿越到子节点进行管理</p>
|
<p class="text-muted-foreground text-xs mt-0.5 ml-0.5">集中监控其他面板的状态,并可无缝穿越到子节点进行管理</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="flex flex-col sm:flex-row items-center gap-2 w-full md:w-auto md:ml-auto md:justify-end">
|
<div class="flex flex-row items-center flex-wrap gap-2 w-full md:w-auto md:ml-auto md:justify-end">
|
||||||
<!-- 搜索框 (仅节点管理时显示) -->
|
<!-- 搜索框 (仅节点管理时显示) -->
|
||||||
<div class="relative w-full sm:w-[200px] md:w-[240px] group shrink-0" v-if="activeTab === 'nodes'">
|
<div class="relative w-full sm:flex-1 md:flex-none md:w-[180px] xl:w-[240px] group shrink-0" v-if="activeTab === 'nodes'">
|
||||||
<Search class="absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground group-focus-within:text-primary transition-colors" />
|
<Search class="absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground group-focus-within:text-primary transition-colors" />
|
||||||
<Input v-model="searchQuery" placeholder="搜索节点..." class="h-9 pl-9 w-full bg-muted/20 border-muted-foreground/10 focus:bg-background text-sm" />
|
<Input v-model="searchQuery" placeholder="搜索节点..." class="h-9 pl-9 w-full bg-muted/20 border-muted-foreground/10 focus:bg-background text-sm" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 按钮控制组 -->
|
|
||||||
<div class="flex items-center gap-2 w-full sm:w-auto sm:justify-end overflow-x-auto scrollbar-none pb-1 -mb-1 sm:pb-0 sm:mb-0">
|
<div class="flex items-center gap-2 w-full sm:w-auto sm:justify-end overflow-x-auto scrollbar-none pb-1 -mb-1 sm:pb-0 sm:mb-0">
|
||||||
<!-- 刷新按钮 -->
|
<!-- 刷新按钮 -->
|
||||||
<Button variant="outline" size="icon" class="h-9 w-9 shrink-0" @click="fetchNodes" :disabled="loading" title="刷新">
|
<Button variant="outline" size="icon" class="h-9 w-9 shrink-0" @click="fetchNodes" :disabled="loading" title="刷新">
|
||||||
<RefreshCw class="h-4 w-4" :class="{ 'animate-spin': loading }" />
|
<RefreshCw class="h-4 w-4" :class="{ 'animate-spin': loading }" />
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
<!-- 取消主控角色按钮 -->
|
<div class="flex items-center gap-2 flex-1 sm:flex-none sm:ml-0">
|
||||||
<Button variant="outline" class="flex-1 sm:flex-none shrink-0 px-2 md:px-3 h-9 shadow-sm text-destructive border-destructive/20 hover:bg-destructive/10" @click="emit('cancel')">
|
<!-- 取消主控角色按钮 -->
|
||||||
取消主控
|
<Button variant="outline" class="flex-1 sm:flex-none shrink-0 px-3 h-9 shadow-sm text-destructive border-destructive/20 hover:bg-destructive/10" @click="emit('cancel')">
|
||||||
</Button>
|
取消主控
|
||||||
|
</Button>
|
||||||
|
|
||||||
<!-- 添加子节点按钮 -->
|
<!-- 添加子节点按钮 -->
|
||||||
<Button v-if="activeTab === 'nodes'" @click="masterListRef?.openAddDialog()" class="flex-1 sm:flex-none shrink-0 px-2 md:px-3 h-9 shadow-sm font-medium" title="添加子节点">
|
<Button v-if="activeTab === 'nodes'" @click="masterListRef?.openAddDialog()" class="flex-1 sm:flex-none shrink-0 px-3 h-9 shadow-sm font-medium gap-1" title="添加子节点">
|
||||||
<Plus class="h-4 w-4 md:mr-1.5" /> <span class="hidden md:inline">添加子节点</span>
|
<Plus class="h-4 w-4" /><span>添加</span>
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
<!-- Tabs 切换 -->
|
<!-- Tabs 切换 -->
|
||||||
<Tabs :model-value="activeTab" @update:model-value="(v: string | number) => activeTab = String(v)" class="shrink-0 flex-1 sm:flex-none min-w-[120px]">
|
<Tabs :model-value="activeTab" @update:model-value="(v: string | number) => activeTab = String(v)" class="flex-1 sm:flex-none shrink-0 min-w-[120px]">
|
||||||
<TabsList class="h-9 p-0.5 bg-muted/20 border border-border/40 rounded-lg w-full flex">
|
<TabsList class="h-9 p-0.5 bg-muted/20 border border-border/40 rounded-lg w-full flex">
|
||||||
<TabsTrigger value="nodes" class="flex-1 sm:flex-none px-3 h-8 text-xs gap-1.5 font-medium transition-all">
|
<TabsTrigger value="nodes" class="flex-1 px-3 h-8 text-xs gap-1.5 font-medium transition-all">
|
||||||
<Server class="w-3.5 h-3.5 opacity-70" />
|
<Server class="w-3.5 h-3.5 opacity-70" />
|
||||||
<span>节点</span>
|
<span>节点</span>
|
||||||
</TabsTrigger>
|
</TabsTrigger>
|
||||||
<TabsTrigger value="sync" class="flex-1 sm:flex-none px-3 h-8 text-xs gap-1.5 font-medium transition-all">
|
<TabsTrigger value="sync" class="flex-1 px-3 h-8 text-xs gap-1.5 font-medium transition-all">
|
||||||
<ArrowRightLeft class="w-3.5 h-3.5 opacity-70" />
|
<ArrowRightLeft class="w-3.5 h-3.5 opacity-70" />
|
||||||
<span>同步</span>
|
<span>同步</span>
|
||||||
</TabsTrigger>
|
</TabsTrigger>
|
||||||
</TabsList>
|
</TabsList>
|
||||||
</Tabs>
|
</Tabs>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user