2
0
mirror of https://github.com/acepanel/panel.git synced 2026-02-08 15:24:28 +08:00

refactor: rename app to panel

This commit is contained in:
耗子
2024-09-18 19:08:45 +08:00
parent ef2ecfcc80
commit 2e26af435a
26 changed files with 173 additions and 173 deletions

View File

@@ -7,7 +7,7 @@ import (
"github.com/go-resty/resty/v2"
"github.com/shirou/gopsutil/host"
"github.com/TheTNB/panel/internal/app"
"github.com/TheTNB/panel/internal/panel"
"github.com/TheTNB/panel/pkg/copier"
)
@@ -33,7 +33,7 @@ func NewAPI(url ...string) *API {
client := resty.New()
client.SetTimeout(10 * time.Second)
client.SetBaseURL(url[0])
client.SetHeader("User-Agent", fmt.Sprintf("rat-panel/%s %s/%s", app.Version, hostInfo.Platform, hostInfo.PlatformVersion))
client.SetHeader("User-Agent", fmt.Sprintf("rat-panel/%s %s/%s", panel.Version, hostInfo.Platform, hostInfo.PlatformVersion))
return &API{
client: client,

View File

@@ -5,7 +5,7 @@ import (
"github.com/stretchr/testify/suite"
"github.com/TheTNB/panel/internal/app"
"github.com/TheTNB/panel/internal/panel"
)
type APITestSuite struct {
@@ -14,7 +14,7 @@ type APITestSuite struct {
}
func TestAPITestSuite(t *testing.T) {
app.Version = "2.3.0"
panel.Version = "2.3.0"
suite.Run(t, &APITestSuite{
api: NewAPI(),
})

View File

@@ -4,7 +4,7 @@ import (
"fmt"
"time"
"github.com/TheTNB/panel/internal/app"
"github.com/TheTNB/panel/internal/panel"
)
type Version struct {
@@ -37,7 +37,7 @@ func (r *API) GetLatestVersion() (*Version, error) {
// GetIntermediateVersions 返回当前版本之后的所有版本
func (r *API) GetIntermediateVersions() (*Versions, error) {
resp, err := r.client.R().
SetQueryParam("start", app.Version).
SetQueryParam("start", panel.Version).
SetResult(&Response{}).Get("/versions/log")
if err != nil {
return nil, err