mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2026-10-01 00:00:03 +00:00
feat(runtime): fix issue with install php runtime failed (#8230)
This commit is contained in:
@@ -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"`
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 ""
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user