数据集

This commit is contained in:
XM-GO
2023-04-30 11:15:15 +08:00
parent e825f42fd8
commit 5dfa857249
8 changed files with 61 additions and 28 deletions

View File

@@ -17,6 +17,7 @@ import (
"pandax/apps/visual/driver"
"pandax/apps/visual/entity"
"pandax/apps/visual/services"
"pandax/pkg/global"
"pandax/pkg/tool"
"path"
"strings"
@@ -80,7 +81,14 @@ func (p *VisualDataSetTableApi) InsertVisualDataSetTable(rc *restfulx.ReqCtx) {
}
one := p.VisualDataSourceApp.FindOne(data.DataSourceId)
if driver.TestConnection(one) != nil {
one.Status = "0"
one := p.VisualDataSourceApp.Update(*one)
global.Log.Errorf("数据源:%s不在线", one.SourceName)
return
}
instance := driver.NewDbInstance(one)
sql := ""
if data.TableType == "db" {
sql = fmt.Sprintf(`select * from %s LIMIT 1`, info["table"])