1
0
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:
ssongliu 2023-09-04 15:56:12 +08:00 committed by GitHub
parent f75744e252
commit dbf349ee9d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 2 deletions

View File

@ -109,10 +109,10 @@ func (u *FirewallService) SearchWithPage(req dto.RuleSearch) (int64, interface{}
if len(req.Status) != 0 {
for _, data := range datas {
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)
}
if req.Status == "used" && common.ScanPort(portItem) {
if req.Status == "used" && common.ScanPortWithProto(portItem, data.Protocol) {
datasFilterStatus = append(datasFilterStatus, data)
}
}

View File

@ -113,6 +113,13 @@ func ScanUDPPort(port int) bool {
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 {
for _, a := range arr {
if strings.Contains(a, str) {

View File

@ -88,6 +88,7 @@
:min-width="150"
:label="$t('commons.table.description')"
prop="description"
show-overflow-tooltip
>
<template #default="{ row }">
<fu-input-rw-switch v-model="row.description" @blur="onChange(row)" />

View File

@ -124,6 +124,7 @@
:min-width="150"
:label="$t('commons.table.description')"
prop="description"
show-overflow-tooltip
>
<template #default="{ row }">
<fu-input-rw-switch v-model="row.description" @blur="onChange(row)" />