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