Browse Source

fix: 防火墙样式调整 (#515)

pull/517/head
ssongliu 2 years ago committed by GitHub
parent
commit
363a67b0f2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      backend/app/service/firewall.go
  2. 20
      frontend/src/routers/modules/host.ts
  3. 4
      frontend/src/views/host/firewall/ip/operate/index.vue
  4. 2
      frontend/src/views/host/firewall/status/index.vue

4
backend/app/service/firewall.go

@ -34,6 +34,9 @@ func (u *FirewallService) LoadBaseInfo() (dto.FirewallBaseInfo, error) {
var baseInfo dto.FirewallBaseInfo
client, err := firewall.NewFirewallClient()
if err != nil {
if err.Error() == "no such type" {
return dto.FirewallBaseInfo{Name: "-", Version: "-", Status: "not running", PingStatus: "Disable"}, nil
}
return baseInfo, err
}
baseInfo.Name = client.Name()
@ -294,7 +297,6 @@ func (u *FirewallService) BacthOperateRule(req dto.BatchRuleOperate) error {
}
func OperateFirewallPort(oldPorts, newPorts []int) error {
fmt.Printf("old: %v, new: %v \n", oldPorts, newPorts)
client, err := firewall.NewFirewallClient()
if err != nil {
return err

20
frontend/src/routers/modules/host.ts

@ -29,6 +29,16 @@ const hostRouter = {
requiresAuth: false,
},
},
{
path: '/hosts/terminal',
name: 'Terminal',
component: () => import('@/views/host/terminal/index.vue'),
meta: {
title: 'menu.terminal',
keepAlive: true,
requiresAuth: false,
},
},
{
path: '/hosts/firewall/port',
name: 'FirewallPort',
@ -48,16 +58,6 @@ const hostRouter = {
requiresAuth: false,
},
},
{
path: '/hosts/terminal',
name: 'Terminal',
component: () => import('@/views/host/terminal/index.vue'),
meta: {
title: 'menu.terminal',
keepAlive: true,
requiresAuth: false,
},
},
],
};

4
frontend/src/views/host/firewall/ip/operate/index.vue

@ -21,8 +21,8 @@
</el-form-item>
<el-form-item :label="$t('firewall.strategy')" prop="strategy">
<el-radio-group v-model="dialogData.rowData!.strategy">
<el-radio label="accept">{{ $t('firewall.accept') }}</el-radio>
<el-radio label="drop">{{ $t('firewall.drop') }}</el-radio>
<el-radio label="accept">{{ $t('firewall.allow') }}</el-radio>
<el-radio label="drop">{{ $t('firewall.deny') }}</el-radio>
</el-radio-group>
</el-form-item>
</el-col>

2
frontend/src/views/host/firewall/status/index.vue

@ -3,7 +3,7 @@
<div class="app-status" style="margin-top: 20px">
<el-card>
<div>
<el-tag style="float: left" effect="dark" type="success">{{ baseInfo.name }}</el-tag>
<el-tag effect="dark" type="success">{{ baseInfo.name }}</el-tag>
<el-tag round class="status-content" v-if="baseInfo.status === 'running'" type="success">
{{ $t('commons.status.running') }}
</el-tag>

Loading…
Cancel
Save