mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2025-05-10 18:05:48 +02:00
fix(app): layout height
This commit is contained in:
parent
91817a3a32
commit
c1193a5b8c
2 changed files with 68 additions and 70 deletions
|
@ -41,11 +41,12 @@ const lang = computed(() => {
|
|||
const settings = useSettingsStore()
|
||||
const is_theme_dark = computed(() => settings.theme == 'dark')
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<a-config-provider :theme="{
|
||||
algorithm: is_theme_dark?theme.darkAlgorithm:theme.defaultAlgorithm,
|
||||
}" :locale="lang" :autoInsertSpaceInButton="false">
|
||||
<a-layout style="min-height: 100%;">
|
||||
<a-layout style="min-height: 100vh">
|
||||
<div class="drawer-sidebar">
|
||||
<a-drawer
|
||||
:closable="false"
|
||||
|
|
|
@ -1,102 +1,99 @@
|
|||
package nginx
|
||||
|
||||
import (
|
||||
"github.com/0xJacky/Nginx-UI/server/internal/logger"
|
||||
"github.com/0xJacky/Nginx-UI/server/settings"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
"regexp"
|
||||
"github.com/0xJacky/Nginx-UI/server/internal/logger"
|
||||
"github.com/0xJacky/Nginx-UI/server/settings"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
"regexp"
|
||||
)
|
||||
|
||||
func execShell(cmdArgs ...string) (out string) {
|
||||
cmd := []string{"-c"}
|
||||
cmd = append(cmd, cmdArgs...)
|
||||
|
||||
bytes, err := exec.Command("/bin/sh", cmd...).CombinedOutput()
|
||||
out = string(bytes)
|
||||
if err != nil {
|
||||
out += " " + err.Error()
|
||||
}
|
||||
return
|
||||
func execShell(cmd string) (out string) {
|
||||
bytes, err := exec.Command("/bin/sh -c", cmd).CombinedOutput()
|
||||
out = string(bytes)
|
||||
if err != nil {
|
||||
out += " " + err.Error()
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func TestConf() (out string) {
|
||||
if settings.NginxSettings.TestConfigCmd != "" {
|
||||
out = execShell(settings.NginxSettings.TestConfigCmd)
|
||||
if settings.NginxSettings.TestConfigCmd != "" {
|
||||
out = execShell(settings.NginxSettings.TestConfigCmd)
|
||||
|
||||
return
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
out = execShell("nginx", "-t")
|
||||
out = execShell("nginx -t")
|
||||
|
||||
return
|
||||
return
|
||||
}
|
||||
|
||||
func Reload() (out string) {
|
||||
if settings.NginxSettings.ReloadCmd != "" {
|
||||
out = execShell(settings.NginxSettings.ReloadCmd)
|
||||
return
|
||||
}
|
||||
if settings.NginxSettings.ReloadCmd != "" {
|
||||
out = execShell(settings.NginxSettings.ReloadCmd)
|
||||
return
|
||||
}
|
||||
|
||||
out = execShell("nginx", "-s", "reload")
|
||||
out = execShell("nginx -s reload")
|
||||
|
||||
return
|
||||
return
|
||||
}
|
||||
|
||||
func Restart() (out string) {
|
||||
if settings.NginxSettings.RestartCmd != "" {
|
||||
out = execShell(settings.NginxSettings.RestartCmd)
|
||||
if settings.NginxSettings.RestartCmd != "" {
|
||||
out = execShell(settings.NginxSettings.RestartCmd)
|
||||
|
||||
return
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
out = execShell("nginx", "-s", "reopen")
|
||||
out = execShell("nginx -s reopen")
|
||||
|
||||
return
|
||||
return
|
||||
}
|
||||
|
||||
func GetConfPath(dir ...string) string {
|
||||
var confPath string
|
||||
var confPath string
|
||||
|
||||
if settings.NginxSettings.ConfigDir == "" {
|
||||
out, err := exec.Command("nginx", "-V").CombinedOutput()
|
||||
if err != nil {
|
||||
logger.Error(err)
|
||||
return ""
|
||||
}
|
||||
r, _ := regexp.Compile("--conf-path=(.*)/(.*.conf)")
|
||||
match := r.FindStringSubmatch(string(out))
|
||||
if len(match) < 1 {
|
||||
logger.Error("nginx.GetConfPath len(match) < 1")
|
||||
return ""
|
||||
}
|
||||
confPath = r.FindStringSubmatch(string(out))[1]
|
||||
} else {
|
||||
confPath = settings.NginxSettings.ConfigDir
|
||||
}
|
||||
if settings.NginxSettings.ConfigDir == "" {
|
||||
out, err := exec.Command("nginx", "-V").CombinedOutput()
|
||||
if err != nil {
|
||||
logger.Error(err)
|
||||
return ""
|
||||
}
|
||||
r, _ := regexp.Compile("--conf-path=(.*)/(.*.conf)")
|
||||
match := r.FindStringSubmatch(string(out))
|
||||
if len(match) < 1 {
|
||||
logger.Error("nginx.GetConfPath len(match) < 1")
|
||||
return ""
|
||||
}
|
||||
confPath = r.FindStringSubmatch(string(out))[1]
|
||||
} else {
|
||||
confPath = settings.NginxSettings.ConfigDir
|
||||
}
|
||||
|
||||
return filepath.Join(confPath, filepath.Join(dir...))
|
||||
return filepath.Join(confPath, filepath.Join(dir...))
|
||||
}
|
||||
|
||||
func GetNginxPIDPath() string {
|
||||
var confPath string
|
||||
var confPath string
|
||||
|
||||
if settings.NginxSettings.PIDPath == "" {
|
||||
out, err := exec.Command("nginx", "-V").CombinedOutput()
|
||||
if err != nil {
|
||||
logger.Error(err)
|
||||
return ""
|
||||
}
|
||||
r, _ := regexp.Compile("--pid-path=(.*.pid)")
|
||||
match := r.FindStringSubmatch(string(out))
|
||||
if len(match) < 1 {
|
||||
logger.Error("nginx.GetNginxPIDPath len(match) < 1")
|
||||
return ""
|
||||
}
|
||||
confPath = r.FindStringSubmatch(string(out))[1]
|
||||
} else {
|
||||
confPath = settings.NginxSettings.PIDPath
|
||||
}
|
||||
if settings.NginxSettings.PIDPath == "" {
|
||||
out, err := exec.Command("nginx", "-V").CombinedOutput()
|
||||
if err != nil {
|
||||
logger.Error(err)
|
||||
return ""
|
||||
}
|
||||
r, _ := regexp.Compile("--pid-path=(.*.pid)")
|
||||
match := r.FindStringSubmatch(string(out))
|
||||
if len(match) < 1 {
|
||||
logger.Error("nginx.GetNginxPIDPath len(match) < 1")
|
||||
return ""
|
||||
}
|
||||
confPath = r.FindStringSubmatch(string(out))[1]
|
||||
} else {
|
||||
confPath = settings.NginxSettings.PIDPath
|
||||
}
|
||||
|
||||
return confPath
|
||||
return confPath
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue