Skip to content

Commit 7247fff

Browse files
committed
修复测试版本若干问题
1 parent edb480e commit 7247fff

File tree

5 files changed

+14522
-13265
lines changed

5 files changed

+14522
-13265
lines changed

internal/gen/generate.go

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,9 @@ import (
1515
"github.com/iwind/TeaGo/files"
1616
"github.com/iwind/TeaGo/logs"
1717
"github.com/iwind/TeaGo/maps"
18-
"github.com/tdewolff/minify/v2"
19-
"github.com/tdewolff/minify/v2/html"
2018
"io"
2119
"os"
2220
"path/filepath"
23-
"regexp"
2421
)
2522

2623
func Generate() error {
@@ -43,18 +40,6 @@ func generateComponentsJSFile() error {
4340
webRoot = Tea.Root + "/web/public/js/components/"
4441
}
4542
var f = files.NewFile(webRoot)
46-
var backQuoteRegexp = regexp.MustCompile("(?sU)`.+`")
47-
48-
var instance = minify.New()
49-
instance.Add("text/html", &html.Minifier{
50-
KeepComments: false,
51-
KeepConditionalComments: false,
52-
KeepDefaultAttrVals: true,
53-
KeepDocumentTags: true,
54-
KeepEndTags: true,
55-
KeepQuotes: true,
56-
KeepWhitespace: true,
57-
})
5843

5944
f.Range(func(file *files.File) {
6045
if !file.IsFile() {
@@ -69,17 +54,6 @@ func generateComponentsJSFile() error {
6954
return
7055
}
7156

72-
data = backQuoteRegexp.ReplaceAllFunc(data, func(blockData []byte) []byte {
73-
var minifiedData = blockData[1 : len(blockData)-1]
74-
var minifyErr error
75-
minifiedData, minifyErr = instance.Bytes("text/html", minifiedData)
76-
if minifyErr == nil {
77-
blockData = append([]byte{'`'}, minifiedData...)
78-
blockData = append(blockData, '`')
79-
}
80-
return blockData
81-
})
82-
8357
buffer.Write(data)
8458
buffer.Write([]byte{'\n', '\n'})
8559
})

internal/web/actions/default/servers/server/settings/https/index.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,9 @@ func (this *IndexAction) RunGet(params struct {
147147
missingServerNames = append(missingServerNames, serverName)
148148
}
149149
}
150-
this.Data["missingCertServerNames"] = missingServerNames
150+
if len(missingServerNames) > 0 {
151+
this.Data["missingCertServerNames"] = missingServerNames
152+
}
151153
}
152154

153155
this.Show()

0 commit comments

Comments
 (0)