mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2024-11-25 03:29:13 +08:00
feat: 修改端口检测规则 (#1591)
This commit is contained in:
parent
c0c1d519bf
commit
4de99f66a8
@ -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
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user