Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 2 additions & 16 deletions agent/app/service/firewall.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,29 +112,15 @@ func (u *FirewallService) SearchWithPage(req dto.RuleSearch) (int64, interface{}
}
}

var datasFilterStatus []fireClient.FireInfo
if len(req.Status) != 0 {
for _, data := range datas {
if req.Status == "free" && len(data.UsedStatus) == 0 {
datasFilterStatus = append(datasFilterStatus, data)
}
if req.Status == "used" && len(data.UsedStatus) != 0 {
datasFilterStatus = append(datasFilterStatus, data)
}
}
} else {
datasFilterStatus = datas
}

var datasFilterStrategy []fireClient.FireInfo
if len(req.Strategy) != 0 {
for _, data := range datasFilterStatus {
for _, data := range datas {
if req.Strategy == data.Strategy {
datasFilterStrategy = append(datasFilterStrategy, data)
}
}
} else {
datasFilterStrategy = datasFilterStatus
datasFilterStrategy = datas
}

total, start, end := len(datasFilterStrategy), (req.Page-1)*req.PageSize, req.Page*req.PageSize
Expand Down
1 change: 0 additions & 1 deletion frontend/src/api/interface/host.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ export namespace Host {
pingStatus: string;
}
export interface RuleSearch extends ReqPage {
status: string;
strategy: string;
info: string;
type: string;
Expand Down
1 change: 0 additions & 1 deletion frontend/src/views/host/firewall/forward/import/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ const acceptParams = async (fireName: string): Promise<void> => {
const loadCurrentData = async (fireName: string) => {
const res = await searchFireRule({
type: 'forward',
status: '',
strategy: '',
info: '',
page: 1,
Expand Down
2 changes: 0 additions & 2 deletions frontend/src/views/host/firewall/forward/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ const loading = ref();
const activeTag = ref('forward');
const selects = ref<any>([]);
const searchName = ref();
const searchStatus = ref('');
const searchStrategy = ref('');

const maskShow = ref(true);
Expand Down Expand Up @@ -141,7 +140,6 @@ const search = async () => {
}
let params = {
type: activeTag.value,
status: searchStatus.value,
strategy: searchStrategy.value,
info: searchName.value,
page: paginationConfig.currentPage,
Expand Down
1 change: 0 additions & 1 deletion frontend/src/views/host/firewall/ip/import/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ const acceptParams = async (): Promise<void> => {
const loadCurrentData = async () => {
const res = await searchFireRule({
type: 'address',
status: '',
strategy: '',
info: '',
page: 1,
Expand Down
1 change: 0 additions & 1 deletion frontend/src/views/host/firewall/ip/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,6 @@ const search = async () => {
}
let params = {
type: activeTag.value,
status: '',
strategy: searchStrategy.value,
info: searchName.value,
page: paginationConfig.currentPage,
Expand Down
1 change: 0 additions & 1 deletion frontend/src/views/host/firewall/port/import/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ const acceptParams = async (): Promise<void> => {
const loadCurrentData = async () => {
const res = await searchFireRule({
type: 'port',
status: '',
strategy: '',
info: '',
page: 1,
Expand Down
8 changes: 0 additions & 8 deletions frontend/src/views/host/firewall/port/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,6 @@
</el-button-group>
</template>
<template #rightToolBar>
<el-select v-model="searchStatus" @change="search()" clearable class="p-w-200">
<template #prefix>{{ $t('commons.table.status') }}</template>
<el-option :label="$t('commons.table.all')" value=""></el-option>
<el-option :label="$t('firewall.unUsed')" value="free"></el-option>
<el-option :label="$t('firewall.used')" value="used"></el-option>
</el-select>
<el-select v-model="searchStrategy" @change="search()" clearable class="p-w-200">
<template #prefix>{{ $t('firewall.strategy') }}</template>
<el-option :label="$t('commons.table.all')" value=""></el-option>
Expand Down Expand Up @@ -181,7 +175,6 @@ const loading = ref();
const activeTag = ref('port');
const selects = ref<any>([]);
const searchName = ref();
const searchStatus = ref('');
const searchStrategy = ref('');

const maskShow = ref(true);
Expand Down Expand Up @@ -253,7 +246,6 @@ const search = async () => {
}
let params = {
type: activeTag.value,
status: searchStatus.value,
strategy: searchStrategy.value,
info: searchName.value,
page: paginationConfig.currentPage,
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/views/host/firewall/status/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
</div>
<NoSuchService v-else name="Firewalld / Ufw / iptables" />

<LayoutContent :divider="true" v-if="baseInfo.isExist && !baseInfo.isInit">
<LayoutContent :divider="true" v-if="baseInfo.isExist && baseInfo.isActive && !baseInfo.isInit">
<template #main>
<div class="app-warn">
<div class="flex flex-col gap-2 items-center justify-center w-full sm:flex-row">
Expand Down
Loading