mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-03-14 01:34:47 +08:00
fix: 解决防火墙筛选问题 (#2170)
This commit is contained in:
parent
f75744e252
commit
dbf349ee9d
@ -109,10 +109,10 @@ func (u *FirewallService) SearchWithPage(req dto.RuleSearch) (int64, interface{}
|
|||||||
if len(req.Status) != 0 {
|
if len(req.Status) != 0 {
|
||||||
for _, data := range datas {
|
for _, data := range datas {
|
||||||
portItem, _ := strconv.Atoi(data.Port)
|
portItem, _ := strconv.Atoi(data.Port)
|
||||||
if req.Status == "free" && !common.ScanPort(portItem) {
|
if req.Status == "free" && !common.ScanPortWithProto(portItem, data.Protocol) {
|
||||||
datasFilterStatus = append(datasFilterStatus, data)
|
datasFilterStatus = append(datasFilterStatus, data)
|
||||||
}
|
}
|
||||||
if req.Status == "used" && common.ScanPort(portItem) {
|
if req.Status == "used" && common.ScanPortWithProto(portItem, data.Protocol) {
|
||||||
datasFilterStatus = append(datasFilterStatus, data)
|
datasFilterStatus = append(datasFilterStatus, data)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -113,6 +113,13 @@ func ScanUDPPort(port int) bool {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func ScanPortWithProto(port int, proto string) bool {
|
||||||
|
if proto == "udp" {
|
||||||
|
return ScanUDPPort(port)
|
||||||
|
}
|
||||||
|
return ScanPort(port)
|
||||||
|
}
|
||||||
|
|
||||||
func ExistWithStrArray(str string, arr []string) bool {
|
func ExistWithStrArray(str string, arr []string) bool {
|
||||||
for _, a := range arr {
|
for _, a := range arr {
|
||||||
if strings.Contains(a, str) {
|
if strings.Contains(a, str) {
|
||||||
|
@ -88,6 +88,7 @@
|
|||||||
:min-width="150"
|
:min-width="150"
|
||||||
:label="$t('commons.table.description')"
|
:label="$t('commons.table.description')"
|
||||||
prop="description"
|
prop="description"
|
||||||
|
show-overflow-tooltip
|
||||||
>
|
>
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<fu-input-rw-switch v-model="row.description" @blur="onChange(row)" />
|
<fu-input-rw-switch v-model="row.description" @blur="onChange(row)" />
|
||||||
|
@ -124,6 +124,7 @@
|
|||||||
:min-width="150"
|
:min-width="150"
|
||||||
:label="$t('commons.table.description')"
|
:label="$t('commons.table.description')"
|
||||||
prop="description"
|
prop="description"
|
||||||
|
show-overflow-tooltip
|
||||||
>
|
>
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<fu-input-rw-switch v-model="row.description" @blur="onChange(row)" />
|
<fu-input-rw-switch v-model="row.description" @blur="onChange(row)" />
|
||||||
|
Loading…
x
Reference in New Issue
Block a user