mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2025-05-11 18:35:51 +02:00
fix: symbol links are not displayed in config list #272
This commit is contained in:
parent
371472e67b
commit
abe43c5c4d
3 changed files with 74 additions and 74 deletions
|
@ -13,6 +13,7 @@ import (
|
|||
|
||||
func GetConfig(c *gin.Context) {
|
||||
name := c.Param("name")
|
||||
|
||||
path := nginx.GetConfPath("/", name)
|
||||
|
||||
stat, err := os.Stat(path)
|
||||
|
|
|
@ -35,7 +35,7 @@ func GetConfigs(c *gin.Context) {
|
|||
}
|
||||
case mode&os.ModeSymlink != 0: // is a symbol
|
||||
var targetPath string
|
||||
targetPath, err = os.Readlink(nginx.GetConfPath(file.Name()))
|
||||
targetPath, err = os.Readlink(nginx.GetConfPath(dir, file.Name()))
|
||||
if err != nil {
|
||||
logger.Error("Read Symlink Error", targetPath, err)
|
||||
continue
|
||||
|
@ -47,7 +47,7 @@ func GetConfigs(c *gin.Context) {
|
|||
logger.Error("Stat Error", targetPath, err)
|
||||
continue
|
||||
}
|
||||
// but target file is not a dir
|
||||
// hide the file if it's target file is a directory
|
||||
if targetInfo.IsDir() {
|
||||
continue
|
||||
}
|
||||
|
|
|
@ -30,7 +30,6 @@ func EditConfig(c *gin.Context) {
|
|||
}
|
||||
|
||||
if content != "" && content != string(origContent) {
|
||||
// model.CreateBackup(path)
|
||||
err = os.WriteFile(path, []byte(content), 0644)
|
||||
if err != nil {
|
||||
api.ErrHandler(c, err)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue