feat(runtime): fix issue with install php runtime failed (#8230)

This commit is contained in:
zhengkunwang
2025-03-24 10:41:30 +00:00
committed by GitHub
parent a617424786
commit 0bddeef63e
8 changed files with 30 additions and 5 deletions
+1
View File
@@ -113,5 +113,6 @@ type Resource struct {
type Database struct {
Name string `json:"name"`
Type string `json:"type"`
From string `json:"from"`
ID uint `json:"id"`
}
+1 -1
View File
@@ -112,7 +112,7 @@ func (a AppService) PageApp(ctx *gin.Context, req request.AppSearch) (interface{
lang := strings.ToLower(common.GetLang(ctx))
for _, ap := range apps {
if req.Type == "php" {
if ap.RequiredPanelVersion == 0 || !common.CompareAppVersion(fmt.Sprintf("%f", ap.RequiredPanelVersion), info.SystemVersion) {
if ap.RequiredPanelVersion == 0 || !common.CompareAppVersion(fmt.Sprintf("%f", ap.RequiredPanelVersion), common.GetSystemVersion(info.SystemVersion)) {
continue
}
}
+2
View File
@@ -3219,6 +3219,7 @@ func (w WebsiteService) ListDatabases() ([]response.Database, error) {
ID: db.ID,
Name: db.Name,
Type: database.Type,
From: database.From,
})
}
}
@@ -3230,6 +3231,7 @@ func (w WebsiteService) ListDatabases() ([]response.Database, error) {
ID: db.ID,
Name: db.Name,
Type: database.Type,
From: database.From,
})
}
}
+9
View File
@@ -399,3 +399,12 @@ func RestartService(core, agent, reload bool) {
global.LOG.Errorf("restart 1panel service failed, err: %v, std: %s", err, std)
}
}
func GetSystemVersion(versionString string) string {
re := regexp.MustCompile(`v(\d+\.\d+\.\d+)`)
match := re.FindStringSubmatch(versionString)
if len(match) > 1 {
return match[1]
}
return ""
}