2
0
mirror of https://github.com/acepanel/panel.git synced 2026-02-04 10:17:17 +08:00

fix: website save

This commit is contained in:
耗子
2024-10-11 02:56:28 +08:00
parent ac6c57b394
commit 07bb0961da
6 changed files with 31 additions and 11 deletions

View File

@@ -69,7 +69,7 @@ func (r *websiteRepo) Get(id uint) (*types.WebsiteSetting, error) {
setting.Name = website.Name
setting.Path = website.Path
setting.SSL = website.SSL
setting.PHP = strconv.Itoa(website.PHP)
setting.PHP = website.PHP
setting.Raw = config
portStr := str.Cut(config, "# port标记位开始", "# port标记位结束")

View File

@@ -2,6 +2,7 @@ package service
import (
"fmt"
"github.com/spf13/cast"
"net/http"
"regexp"
"strings"
@@ -173,9 +174,9 @@ func (s *InfoService) InstalledDbAndPhp(w http.ResponseWriter, r *http.Request)
postgresqlInstalled, _ := s.appRepo.IsInstalled("slug like ?", "postgresql%")
php, _ := s.appRepo.GetInstalledAll("slug like ?", "php%")
var phpData []types.LV
var phpData []types.LVInt
var dbData []types.LV
phpData = append(phpData, types.LV{Value: "0", Label: "不使用"})
phpData = append(phpData, types.LVInt{Value: 0, Label: "不使用"})
dbData = append(dbData, types.LV{Value: "0", Label: "不使用"})
for _, p := range php {
// 过滤 phpmyadmin
@@ -184,8 +185,8 @@ func (s *InfoService) InstalledDbAndPhp(w http.ResponseWriter, r *http.Request)
continue
}
app, _ := s.appRepo.Get(p.Slug)
phpData = append(phpData, types.LV{Value: strings.ReplaceAll(p.Slug, "php", ""), Label: app.Name})
item, _ := s.appRepo.Get(p.Slug)
phpData = append(phpData, types.LVInt{Value: cast.ToInt(strings.ReplaceAll(p.Slug, "php", "")), Label: item.Name})
}
if mysqlInstalled {