mirror of
				https://github.com/TeaOSLab/EdgeAdmin.git
				synced 2025-11-04 05:00:25 +08:00 
			
		
		
		
	初步实现安装界面
This commit is contained in:
		@@ -41,16 +41,15 @@ func (this *IndexAction) RunGet(params struct{}) {
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if config.DBs == nil {
 | 
			
		||||
		this.Data["error"] = "can not find valid database config: api_db.yaml"
 | 
			
		||||
		this.Data["error"] = "no database configured in config file: api_db.yaml"
 | 
			
		||||
		this.Show()
 | 
			
		||||
		return
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	dbConfig, ok := config.DBs[config.Default.DB]
 | 
			
		||||
	if !ok {
 | 
			
		||||
		this.Data["error"] = "can not find valid database config: api_db.yaml"
 | 
			
		||||
		this.Show()
 | 
			
		||||
		return
 | 
			
		||||
	var dbConfig *dbs.DBConfig
 | 
			
		||||
	for _, db := range config.DBs {
 | 
			
		||||
		dbConfig = db
 | 
			
		||||
		break
 | 
			
		||||
	}
 | 
			
		||||
	dsn := dbConfig.Dsn
 | 
			
		||||
	dsn = regexp.MustCompile(`tcp\((.+)\)`).ReplaceAllString(dsn, "$1")
 | 
			
		||||
 
 | 
			
		||||
@@ -50,11 +50,12 @@ func (this *UpdateAction) RunGet(params struct{}) {
 | 
			
		||||
		return
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	dbConfig, ok := config.DBs[config.Default.DB]
 | 
			
		||||
	if !ok {
 | 
			
		||||
		this.Show()
 | 
			
		||||
		return
 | 
			
		||||
	var dbConfig *dbs.DBConfig
 | 
			
		||||
	for _, db := range config.DBs {
 | 
			
		||||
		dbConfig = db
 | 
			
		||||
		break
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	dsn := dbConfig.Dsn
 | 
			
		||||
	dsn = regexp.MustCompile(`tcp\((.+)\)`).ReplaceAllString(dsn, "$1")
 | 
			
		||||
	dsnURL, err := url.Parse("mysql://" + dsn)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user