mirror of
				https://github.com/TeaOSLab/EdgeAdmin.git
				synced 2025-11-04 05:00:25 +08:00 
			
		
		
		
	修复测试版本若干问题
This commit is contained in:
		@@ -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'})
 | 
			
		||||
	})
 | 
			
		||||
 
 | 
			
		||||
@@ -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
											
										
									
								
							@@ -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>
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user