Show list of databases and allow switching by clicking on current database name

This commit is contained in:
Dan Sosedoff
2016-11-05 22:49:17 -05:00
parent 7d08017c7f
commit a3c341b5b4
4 changed files with 40 additions and 5 deletions

View File

@@ -127,6 +127,9 @@ func SwitchDb(c *gin.Context) {
}
name := c.Request.URL.Query().Get("db")
if name == "" {
name = c.Request.FormValue("db")
}
if name == "" {
c.JSON(400, Error{"Database name is not provided"})
return
@@ -168,6 +171,8 @@ func SwitchDb(c *gin.Context) {
}
}
conn.Close()
c.JSON(200, info.Format()[0])
}