Implement table item context menu

- Add ability to export table contents into CSV
- Add ability to truncate table
- Add ability to delete table
This commit is contained in:
Dan Sosedoff
2015-05-19 12:24:52 -05:00
parent c2290acae3
commit 651b65a882
6 changed files with 298 additions and 17 deletions

View File

@@ -185,6 +185,10 @@ func HandleQuery(query string, c *gin.Context) {
if len(q["format"]) > 0 && q["format"][0] == "csv" {
filename := fmt.Sprintf("pgweb-%v.csv", time.Now().Unix())
if len(q["filename"]) > 0 && q["filename"][0] != "" {
filename = q["filename"][0]
}
c.Writer.Header().Set("Content-disposition", "attachment;filename="+filename)
c.Data(200, "text/csv", result.CSV())
return

File diff suppressed because one or more lines are too long