diff --git a/Makefile b/Makefile index 66ca406..7196573 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,7 @@ build: dev: rm -f bindata.go - go-bindata static/... + go-bindata -debug static/... go build @echo "You can now execute ./pgweb" diff --git a/api.go b/api.go index 8a07f6f..3b1dc7e 100644 --- a/api.go +++ b/api.go @@ -31,7 +31,7 @@ func API_Home(c *gin.Context) { return } - c.Data(200, "text/html", data) + c.Data(200, "text/html; charset=utf-8", data) } func API_RunQuery(c *gin.Context) { diff --git a/static/css/app.css b/static/css/app.css index a8707da..2ea6111 100644 --- a/static/css/app.css +++ b/static/css/app.css @@ -1,7 +1,7 @@ #nav { position: fixed; top: 0; - left: 250; + left: 250px; right: 0; height: 50px; box-shadow: inset 0 -1px 0 0 #b8b7b5; @@ -12,6 +12,7 @@ margin: 0px; padding: 0px; height: 50px; + display: block; } #nav ul li { @@ -26,6 +27,9 @@ font-weight: 500; margin: 0 1px; cursor: pointer; + display: block; + list-style: none; + list-style-type: none; } #nav ul li:first-child { @@ -182,19 +186,38 @@ -webkit-font-smoothing: antialiased; } +#results tbody tr:hover td { + background: #ffe; +} + #results tr.selected td { - background: #3874d7; + background: #3874d7 !important; color: #fff !important; } #results td { color: #3a3633; - max-width: 200px; - overflow: hidden; vertical-align: middle; border: 0px none; } +#results td div { + max-width: 200px; + max-height: 51px; + overflow: hidden; + text-overflow: ellipsis; + + /* + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + */ +} + +#results td div span.null { + color: #bbb; +} + #results th:first-child, #results td:first-child { padding-left: 15px; diff --git a/static/index.html b/static/index.html index bb3696b..7e44c24 100644 --- a/static/index.html +++ b/static/index.html @@ -1,34 +1,44 @@ - - -
-
-
-
-
- + + + + pgweb + + + + + + + + + + + + + +
+
+
+
+
+ +
+
+
+
+
+
-
-
-
-
-
-
- - - - - - - \ No newline at end of file + + \ No newline at end of file diff --git a/static/js/app.js b/static/js/app.js index 11f50cb..33d5054 100644 --- a/static/js/app.js +++ b/static/js/app.js @@ -30,6 +30,14 @@ function loadTables() { }); } +function escapeHtml(str) { + if (str != null || str != undefined) { + return jQuery("
").text(str).html(); + } + + return "null"; +} + function buildTable(results) { $("#results").text("").removeClass("empty"); @@ -54,7 +62,7 @@ function buildTable(results) { results.rows.forEach(function(row) { var r = ""; - for (i in row) { r += "" + row[i] + ""; } + for (i in row) { r += "
" + escapeHtml(row[i]) + "
"; } rows += "" + r + ""; });