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:
@@ -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,
|
||||
|
||||
@@ -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(),
|
||||
})
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user