feat: 修改端口检测规则 (#1591)

This commit is contained in:
zhengkunwang223 2023-07-10 14:47:08 +08:00 committed by GitHub
parent c0c1d519bf
commit 4de99f66a8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 3 deletions

View File

@ -271,7 +271,7 @@ func (a AppService) Install(ctx context.Context, req request.AppInstallCreate) (
app model.App
)
for key := range req.Params {
if !strings.Contains(key, "PORT") {
if !strings.Contains(key, "PANEL_APP_PORT") {
continue
}
var port int

View File

@ -48,7 +48,20 @@ var (
func checkPort(key string, params map[string]interface{}) (int, error) {
port, ok := params[key]
if ok {
portN := int(math.Ceil(port.(float64)))
portN := 0
var err error
switch p := port.(type) {
case string:
portN, err = strconv.Atoi(p)
if err != nil {
return portN, nil
}
case float64:
portN = int(math.Ceil(p))
case int:
portN = p
}
oldInstalled, _ := appInstallRepo.ListBy(appInstallRepo.WithPort(portN))
if len(oldInstalled) > 0 {
var apps []string

View File

@ -166,7 +166,6 @@ const onMessage = (message: any) => {
};
const filterByStatus = () => {
console.log(sortConfig.filters);
if (sortConfig.filters.length > 0) {
const newData = oldData.value.filter((re: any) => {
return (sortConfig.filters as string[]).indexOf(re.status) > -1;