Skip to content

Commit

Permalink
fix: 快速跳转样式调整
Browse files Browse the repository at this point in the history
  • Loading branch information
ssongliu committed Dec 11, 2023
1 parent e48c224 commit 87a083f
Show file tree
Hide file tree
Showing 13 changed files with 28 additions and 43 deletions.
13 changes: 8 additions & 5 deletions backend/app/service/fail2ban.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,17 +101,20 @@ func (u *Fail2BanService) Operate(operation string) error {
func (u *Fail2BanService) UpdateConf(req dto.Fail2BanUpdate) error {
if req.Key == "banaction" {
if req.Value == "firewallcmd-ipset" || req.Value == "ufw" {
itemName := "ufw"
if req.Value == "firewallcmd-ipset" {
itemName = "firewallcmd"
}
client, err := firewall.NewFirewallClient()
if err != nil {
return err
}
if client.Name() != itemName {
return buserr.WithName("ErrBanAction", itemName)
}
status, _ := client.Status()
if status != "running" {
service := "firewalld"
if req.Value == "ufw" {
service = "ufw"
}
return buserr.WithName("ErrBanAction", service)
return buserr.WithName("ErrBanAction", itemName)
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion backend/utils/toolbox/fail2ban.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ func (f *Fail2ban) ListBanned() ([]string, error) {
if err != nil {
return lists, err
}
itemList := strings.Split(stdout, "\n")
itemList := strings.Split(stdout, " ")
for _, item := range itemList {
if len(item) != 0 {
lists = append(lists, item)
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/app-status/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
<div>
<span>{{ $t('app.checkInstalledWarn', [data.app]) }}</span>
<span @click="goRouter(key)">
<el-icon><Position /></el-icon>
<el-icon class="ml-2"><Position /></el-icon>
{{ $t('database.goInstall') }}
</span>
<div>
Expand Down
3 changes: 1 addition & 2 deletions frontend/src/lang/modules/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -755,7 +755,6 @@ const message = {
sockPath: 'Socket Path',
sockPathHelper: 'Communication channel between Docker Daemon and the client',
sockPathHelper1: 'Default Path: /var/run/docker-x.sock',
sockPathHelper2: 'CurrentPath: {0}',
sockPathMsg:
'Saving the Socket Path setting may result in Docker service being unavailable. Do you want to continue?',
sockPathErr: 'Please select or enter the correct Docker sock file path',
Expand Down Expand Up @@ -953,7 +952,7 @@ const message = {
fail2ban: {
sshPort: 'Listen to SSH Port',
sshPortHelper: 'Current Fail2ban listens to the SSH connection port of the host',
noFail2ban: 'Fail2ban service not detected, please refer to the official documentation for installation',
noFail2ban: 'Fail2ban service not detected, please refer to the official documentation for installation!',
unActive: 'The Fail2ban service is not enabled at present, please enable it first!',
operation: 'Perform [{0}] operation on Fail2ban service, continue?',
fail2banChange: 'Fail2ban Configuration Modification',
Expand Down
5 changes: 2 additions & 3 deletions frontend/src/lang/modules/tw.ts
Original file line number Diff line number Diff line change
Expand Up @@ -726,7 +726,6 @@ const message = {
sockPath: 'Socket 路徑',
sockPathHelper: 'Docker 守護進程Docker Daemon與客戶端之間的通信通道',
sockPathHelper1: '默認路徑/var/run/docker-x.sock',
sockPathHelper2: '當前路徑:{0}',
sockPathMsg: '保存設定 Socket 路徑可能導致 Docker 服務不可用是否繼續?',
sockPathErr: '請選擇或輸入正確的 Docker sock 文件路徑',
},
Expand Down Expand Up @@ -904,7 +903,7 @@ const message = {
fail2ban: {
sshPort: '監 SSH 端口',
sshPortHelper: '當 Fail2ban 監聽主機 SSH 連接端口',
noFail2ban: '未檢測到 Fail2ban 服務請參考官方文檔進行安裝',
noFail2ban: '未檢測到 Fail2ban 服務請參考官方文檔進行安裝',
unActive: '當前未開啟 Fail2ban 服務請先開啟!',
operation: '對 Fail2ban 服務進行 [{0}] 操作是否繼續?',
fail2banChange: 'Fail2ban 配置修改',
Expand Down Expand Up @@ -1376,7 +1375,7 @@ const message = {
update: '更',
versionSelect: '請選擇版本',
operatorHelper: '將對選中應用進行 {0} 操作是否繼續?',
checkInstalledWarn: '未檢測到 {0} ,請進入應用商店點擊安裝!',
checkInstalledWarn: '未檢測到 {0} ,請進入應用商店點擊安裝',
gotoInstalled: '去安裝',
search: '搜',
limitHelper: '該應用已安裝不支持重復安裝',
Expand Down
5 changes: 2 additions & 3 deletions frontend/src/lang/modules/zh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -727,7 +727,6 @@ const message = {
sockPath: 'Socket 路径',
sockPathHelper: 'Docker 守护进程Docker Daemon与客户端之间的通信通道',
sockPathHelper1: '默认路径/var/run/docker.sock',
sockPathHelper2: '当前路径:{0}',
sockPathMsg: '保存设置 Socket 路径可能导致 Docker 服务不可用是否继续?',
sockPathErr: '请选择或输入正确的 Docker sock 文件路径',
},
Expand Down Expand Up @@ -905,7 +904,7 @@ const message = {
fail2ban: {
sshPort: '监 SSH 端口',
sshPortHelper: '当 Fail2ban 监听主机 SSH 连接端口',
noFail2ban: '未检测到 Fail2ban 服务请参考官方文档进行安装',
noFail2ban: '未检测到 Fail2ban 服务请参考官方文档进行安装',
unActive: '当前未开启 Fail2ban 服务请先开启!',
operation: '对 Fail2ban 服务进行 [{0}] 操作是否继续?',
fail2banChange: 'Fail2ban 配置修改',
Expand Down Expand Up @@ -1376,7 +1375,7 @@ const message = {
update: '更',
versionSelect: '请选择版本',
operatorHelper: '将对选中应用进行 {0} 操作是否继续?',
checkInstalledWarn: '未检测到 {0} ,请进入应用商店点击安装!',
checkInstalledWarn: '未检测到 {0} ,请进入应用商店点击安装',
gotoInstalled: '去安装',
search: '搜',
limitHelper: '该应用已安装不支持重复安装',
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/views/container/setting/ipv6/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ const loading = ref();
const drawerVisible = ref();
const confirmDialogRef = ref();
const formRef = ref();
const showMore = ref(false);
const showMore = ref(true);
interface DialogProps {
fixedCidrV6: string;
Expand Down
3 changes: 0 additions & 3 deletions frontend/src/views/container/setting/sock-path/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@
</template>
</el-input>
<span class="input-help">{{ $t('container.sockPathHelper1') }}</span>
<span class="input-help" style="margin-top: -12px">
{{ $t('container.sockPathHelper2', [form.currentPath]) }}
</span>
</el-form-item>
</el-col>
</el-row>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/views/database/mysql/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@
<div>
<span>{{ $t('app.checkInstalledWarn', [$t('database.noMysql')]) }}</span>
<span @click="goRouter('app')">
<el-icon><Position /></el-icon>
<el-icon class="ml-2"><Position /></el-icon>
{{ $t('database.goInstall') }}
</span>
<div>
Expand Down
10 changes: 3 additions & 7 deletions frontend/src/views/host/firewall/ip/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -109,14 +109,10 @@
<div class="app-warn">
<div>
<span>{{ $t('firewall.notSupport') }}</span>
<el-link
style="font-size: 12px; margin-left: 5px"
@click="toDoc"
icon="Position"
type="primary"
>
<span @click="toDoc">
<el-icon class="ml-2"><Position /></el-icon>
{{ $t('firewall.quickJump') }}
</el-link>
</span>
<div>
<img src="@/assets/images/no_app.svg" />
</div>
Expand Down
10 changes: 3 additions & 7 deletions frontend/src/views/host/firewall/port/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -159,14 +159,10 @@
<div class="app-warn">
<div>
<span>{{ $t('firewall.notSupport') }}</span>
<el-link
style="font-size: 12px; margin-left: 5px"
@click="toDoc"
icon="Position"
type="primary"
>
<span @click="toDoc">
<el-icon class="ml-2"><Position /></el-icon>
{{ $t('firewall.quickJump') }}
</el-link>
</span>
<div>
<img src="@/assets/images/no_app.svg" />
</div>
Expand Down
12 changes: 4 additions & 8 deletions frontend/src/views/toolbox/fail2ban/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -152,16 +152,12 @@
<div class="app-warn">
<div>
<span>{{ $t('toolbox.fail2ban.noFail2ban') }}</span>
<el-link
style="font-size: 12px; margin-left: 5px"
@click="toDoc"
icon="Position"
type="primary"
>
<span @click="toDoc">
<el-icon class="ml-2"><Position /></el-icon>
{{ $t('firewall.quickJump') }}
</el-link>
</span>
<div>
<img alt="" src="@/assets/images/no_app.svg" />
<img src="@/assets/images/no_app.svg" />
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/views/toolbox/supervisor/status/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
<span v-else-if="!data.ctlExist">{{ $t('tool.supervisor.notSupportCrl') }}</span>
<span v-else-if="data.init">{{ $t('tool.supervisor.initHelper') }}</span>
<span @click="toDoc()" v-if="!data.isExist || !data.ctlExist">
<el-icon><Position /></el-icon>
<el-icon class="ml-2"><Position /></el-icon>
{{ $t('firewall.quickJump') }}
</span>
<div>
Expand Down

0 comments on commit 87a083f

Please sign in to comment.