Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions internal/template/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package template
import (
"bufio"
"bytes"

"github.com/0xJacky/Nginx-UI/internal/nginx"
"github.com/0xJacky/Nginx-UI/settings"
templ "github.com/0xJacky/Nginx-UI/template"
Expand All @@ -12,8 +13,9 @@ import (
"github.com/tufanbarisyildirim/gonginx/parser"
"github.com/uozi-tech/cosy/logger"
cSettings "github.com/uozi-tech/cosy/settings"

"io"
"path/filepath"
dirPath "path"
"strings"
"text/template"
)
Expand All @@ -39,7 +41,7 @@ func GetTemplateInfo(path, name string) (configListItem ConfigInfoItem) {
Filename: name,
}

file, err := templ.DistFS.Open(filepath.Join(path, name))
file, err := templ.DistFS.Open(dirPath.Join(path, name))
if err != nil {
logger.Error(err)
return
Expand Down Expand Up @@ -83,7 +85,7 @@ type ConfigDetail struct {
}

func ParseTemplate(path, name string, bindData map[string]Variable) (c ConfigDetail, err error) {
file, err := templ.DistFS.Open(filepath.Join(path, name))
file, err := templ.DistFS.Open(dirPath.Join(path, name))
if err != nil {
err = errors.Wrap(err, "error tokenized template")
return
Expand Down