修复测试版本若干问题

This commit is contained in:
刘祥超
2024-05-16 15:32:58 +08:00
parent edb480e3d7
commit 7247fff017
5 changed files with 14440 additions and 13183 deletions

View File

@@ -15,12 +15,9 @@ import (
"github.com/iwind/TeaGo/files"
"github.com/iwind/TeaGo/logs"
"github.com/iwind/TeaGo/maps"
"github.com/tdewolff/minify/v2"
"github.com/tdewolff/minify/v2/html"
"io"
"os"
"path/filepath"
"regexp"
)
func Generate() error {
@@ -43,18 +40,6 @@ func generateComponentsJSFile() error {
webRoot = Tea.Root + "/web/public/js/components/"
}
var f = files.NewFile(webRoot)
var backQuoteRegexp = regexp.MustCompile("(?sU)`.+`")
var instance = minify.New()
instance.Add("text/html", &html.Minifier{
KeepComments: false,
KeepConditionalComments: false,
KeepDefaultAttrVals: true,
KeepDocumentTags: true,
KeepEndTags: true,
KeepQuotes: true,
KeepWhitespace: true,
})
f.Range(func(file *files.File) {
if !file.IsFile() {
@@ -69,17 +54,6 @@ func generateComponentsJSFile() error {
return
}
data = backQuoteRegexp.ReplaceAllFunc(data, func(blockData []byte) []byte {
var minifiedData = blockData[1 : len(blockData)-1]
var minifyErr error
minifiedData, minifyErr = instance.Bytes("text/html", minifiedData)
if minifyErr == nil {
blockData = append([]byte{'`'}, minifiedData...)
blockData = append(blockData, '`')
}
return blockData
})
buffer.Write(data)
buffer.Write([]byte{'\n', '\n'})
})

View File

@@ -147,7 +147,9 @@ func (this *IndexAction) RunGet(params struct {
missingServerNames = append(missingServerNames, serverName)
}
}
this.Data["missingCertServerNames"] = missingServerNames
if len(missingServerNames) > 0 {
this.Data["missingCertServerNames"] = missingServerNames
}
}
this.Show()

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@@ -11,7 +11,7 @@
<div class="right-box with-menu">
<p class="comment">提醒HTTP/2、证书等信息修改后可能需要清空浏览器缓存后才能浏览效果。</p>
<div v-if="httpsConfig.isOn && missingCertServerNames.length > 0" class="ui message warning">
<div v-if="httpsConfig.isOn && missingCertServerNames != null && missingCertServerNames.length > 0" class="ui message warning">
警告当前网站绑定的以下域名尚未配置证书将无法通过HTTPS协议访问{{missingCertServerNames.join("、")}} 。
</div>