mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2024-11-25 03:29:13 +08:00
fix: 防火墙与进程守护加载样式调整 (#1864)
This commit is contained in:
parent
2e73857b42
commit
9b02e88e3c
@ -3,6 +3,7 @@ package client
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
"sync"
|
||||
|
||||
"github.com/1Panel-dev/1Panel/backend/buserr"
|
||||
"github.com/1Panel-dev/1Panel/backend/constant"
|
||||
@ -60,12 +61,16 @@ func (f *Firewall) Reload() error {
|
||||
}
|
||||
|
||||
func (f *Firewall) ListPort() ([]FireInfo, error) {
|
||||
var wg sync.WaitGroup
|
||||
var datas []FireInfo
|
||||
wg.Add(2)
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
stdout, err := cmd.Exec("firewall-cmd --zone=public --list-ports")
|
||||
if err != nil {
|
||||
return nil, err
|
||||
return
|
||||
}
|
||||
ports := strings.Split(strings.ReplaceAll(stdout, "\n", ""), " ")
|
||||
var datas []FireInfo
|
||||
for _, port := range ports {
|
||||
if len(port) == 0 {
|
||||
continue
|
||||
@ -78,10 +83,13 @@ func (f *Firewall) ListPort() ([]FireInfo, error) {
|
||||
itemPort.Strategy = "accept"
|
||||
datas = append(datas, itemPort)
|
||||
}
|
||||
}()
|
||||
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
stdout1, err := cmd.Exec("firewall-cmd --zone=public --list-rich-rules")
|
||||
if err != nil {
|
||||
return nil, err
|
||||
return
|
||||
}
|
||||
rules := strings.Split(stdout1, "\n")
|
||||
for _, rule := range rules {
|
||||
@ -93,6 +101,8 @@ func (f *Firewall) ListPort() ([]FireInfo, error) {
|
||||
datas = append(datas, itemRule)
|
||||
}
|
||||
}
|
||||
}()
|
||||
wg.Wait()
|
||||
return datas, nil
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,8 @@
|
||||
<template>
|
||||
<div v-loading="loading" style="position: relative">
|
||||
<div>
|
||||
<FireRouter />
|
||||
|
||||
<div v-loading="loading">
|
||||
<FireStatus
|
||||
v-show="fireName !== '-'"
|
||||
ref="fireStatuRef"
|
||||
@ -105,7 +107,7 @@
|
||||
</template>
|
||||
</LayoutContent>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<OperatrDialog @search="search" ref="dialogRef" />
|
||||
</div>
|
||||
</template>
|
||||
|
@ -1,7 +1,8 @@
|
||||
<template>
|
||||
<div v-loading="loading" style="position: relative">
|
||||
<div>
|
||||
<FireRouter />
|
||||
|
||||
<div v-loading="loading">
|
||||
<FireStatus
|
||||
v-show="fireName !== '-'"
|
||||
ref="fireStatuRef"
|
||||
@ -137,6 +138,7 @@
|
||||
</template>
|
||||
</LayoutContent>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<OperatrDialog @search="search" ref="dialogRef" />
|
||||
</div>
|
||||
|
@ -131,7 +131,9 @@ const getStatus = async () => {
|
||||
loading.value = true;
|
||||
em('update:loading', true);
|
||||
const res = await GetSupervisorStatus();
|
||||
if (res.data.config) {
|
||||
data.value = res.data.config as HostTool.Supersivor;
|
||||
}
|
||||
|
||||
const status = {
|
||||
isExist: data.value.isExist && data.value.ctlExist,
|
||||
|
Loading…
Reference in New Issue
Block a user