Skip to content

Commit c1193a5

Browse files
committed
fix(app): layout height
1 parent 91817a3 commit c1193a5

File tree

2 files changed

+72
-74
lines changed

2 files changed

+72
-74
lines changed

frontend/src/layouts/BaseLayout.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,12 @@ const lang = computed(() => {
4141
const settings = useSettingsStore()
4242
const is_theme_dark = computed(() => settings.theme == 'dark')
4343
</script>
44+
4445
<template>
4546
<a-config-provider :theme="{
4647
algorithm: is_theme_dark?theme.darkAlgorithm:theme.defaultAlgorithm,
4748
}" :locale="lang" :autoInsertSpaceInButton="false">
48-
<a-layout style="min-height: 100%;">
49+
<a-layout style="min-height: 100vh">
4950
<div class="drawer-sidebar">
5051
<a-drawer
5152
:closable="false"

server/internal/nginx/nginx.go

Lines changed: 70 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -1,102 +1,99 @@
11
package nginx
22

33
import (
4-
"github.com/0xJacky/Nginx-UI/server/internal/logger"
5-
"github.com/0xJacky/Nginx-UI/server/settings"
6-
"os/exec"
7-
"path/filepath"
8-
"regexp"
4+
"github.com/0xJacky/Nginx-UI/server/internal/logger"
5+
"github.com/0xJacky/Nginx-UI/server/settings"
6+
"os/exec"
7+
"path/filepath"
8+
"regexp"
99
)
1010

11-
func execShell(cmdArgs ...string) (out string) {
12-
cmd := []string{"-c"}
13-
cmd = append(cmd, cmdArgs...)
14-
15-
bytes, err := exec.Command("/bin/sh", cmd...).CombinedOutput()
16-
out = string(bytes)
17-
if err != nil {
18-
out += " " + err.Error()
19-
}
20-
return
11+
func execShell(cmd string) (out string) {
12+
bytes, err := exec.Command("/bin/sh -c", cmd).CombinedOutput()
13+
out = string(bytes)
14+
if err != nil {
15+
out += " " + err.Error()
16+
}
17+
return
2118
}
2219

2320
func TestConf() (out string) {
24-
if settings.NginxSettings.TestConfigCmd != "" {
25-
out = execShell(settings.NginxSettings.TestConfigCmd)
21+
if settings.NginxSettings.TestConfigCmd != "" {
22+
out = execShell(settings.NginxSettings.TestConfigCmd)
2623

27-
return
28-
}
24+
return
25+
}
2926

30-
out = execShell("nginx", "-t")
27+
out = execShell("nginx -t")
3128

32-
return
29+
return
3330
}
3431

3532
func Reload() (out string) {
36-
if settings.NginxSettings.ReloadCmd != "" {
37-
out = execShell(settings.NginxSettings.ReloadCmd)
38-
return
39-
}
33+
if settings.NginxSettings.ReloadCmd != "" {
34+
out = execShell(settings.NginxSettings.ReloadCmd)
35+
return
36+
}
4037

41-
out = execShell("nginx", "-s", "reload")
38+
out = execShell("nginx -s reload")
4239

43-
return
40+
return
4441
}
4542

4643
func Restart() (out string) {
47-
if settings.NginxSettings.RestartCmd != "" {
48-
out = execShell(settings.NginxSettings.RestartCmd)
44+
if settings.NginxSettings.RestartCmd != "" {
45+
out = execShell(settings.NginxSettings.RestartCmd)
4946

50-
return
51-
}
47+
return
48+
}
5249

53-
out = execShell("nginx", "-s", "reopen")
50+
out = execShell("nginx -s reopen")
5451

55-
return
52+
return
5653
}
5754

5855
func GetConfPath(dir ...string) string {
59-
var confPath string
60-
61-
if settings.NginxSettings.ConfigDir == "" {
62-
out, err := exec.Command("nginx", "-V").CombinedOutput()
63-
if err != nil {
64-
logger.Error(err)
65-
return ""
66-
}
67-
r, _ := regexp.Compile("--conf-path=(.*)/(.*.conf)")
68-
match := r.FindStringSubmatch(string(out))
69-
if len(match) < 1 {
70-
logger.Error("nginx.GetConfPath len(match) < 1")
71-
return ""
72-
}
73-
confPath = r.FindStringSubmatch(string(out))[1]
74-
} else {
75-
confPath = settings.NginxSettings.ConfigDir
76-
}
77-
78-
return filepath.Join(confPath, filepath.Join(dir...))
56+
var confPath string
57+
58+
if settings.NginxSettings.ConfigDir == "" {
59+
out, err := exec.Command("nginx", "-V").CombinedOutput()
60+
if err != nil {
61+
logger.Error(err)
62+
return ""
63+
}
64+
r, _ := regexp.Compile("--conf-path=(.*)/(.*.conf)")
65+
match := r.FindStringSubmatch(string(out))
66+
if len(match) < 1 {
67+
logger.Error("nginx.GetConfPath len(match) < 1")
68+
return ""
69+
}
70+
confPath = r.FindStringSubmatch(string(out))[1]
71+
} else {
72+
confPath = settings.NginxSettings.ConfigDir
73+
}
74+
75+
return filepath.Join(confPath, filepath.Join(dir...))
7976
}
8077

8178
func GetNginxPIDPath() string {
82-
var confPath string
83-
84-
if settings.NginxSettings.PIDPath == "" {
85-
out, err := exec.Command("nginx", "-V").CombinedOutput()
86-
if err != nil {
87-
logger.Error(err)
88-
return ""
89-
}
90-
r, _ := regexp.Compile("--pid-path=(.*.pid)")
91-
match := r.FindStringSubmatch(string(out))
92-
if len(match) < 1 {
93-
logger.Error("nginx.GetNginxPIDPath len(match) < 1")
94-
return ""
95-
}
96-
confPath = r.FindStringSubmatch(string(out))[1]
97-
} else {
98-
confPath = settings.NginxSettings.PIDPath
99-
}
100-
101-
return confPath
79+
var confPath string
80+
81+
if settings.NginxSettings.PIDPath == "" {
82+
out, err := exec.Command("nginx", "-V").CombinedOutput()
83+
if err != nil {
84+
logger.Error(err)
85+
return ""
86+
}
87+
r, _ := regexp.Compile("--pid-path=(.*.pid)")
88+
match := r.FindStringSubmatch(string(out))
89+
if len(match) < 1 {
90+
logger.Error("nginx.GetNginxPIDPath len(match) < 1")
91+
return ""
92+
}
93+
confPath = r.FindStringSubmatch(string(out))[1]
94+
} else {
95+
confPath = settings.NginxSettings.PIDPath
96+
}
97+
98+
return confPath
10299
}

0 commit comments

Comments
 (0)