From 8eb522fb383035db01d8430a08a3097fbf9450c1 Mon Sep 17 00:00:00 2001 From: Naoki Takezoe Date: Sun, 7 Jan 2018 21:32:26 +0900 Subject: [PATCH] (refs #1836) Add "Clear" button to the database viewer --- src/main/twirl/gitbucket/core/admin/dbviewer.scala.html | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/twirl/gitbucket/core/admin/dbviewer.scala.html b/src/main/twirl/gitbucket/core/admin/dbviewer.scala.html index 3dc0ddbdb..cc632acaf 100644 --- a/src/main/twirl/gitbucket/core/admin/dbviewer.scala.html +++ b/src/main/twirl/gitbucket/core/admin/dbviewer.scala.html @@ -24,6 +24,7 @@
+
@@ -48,12 +49,14 @@ $(function(){ if(query != ''){ query = query + '\n'; } - console.log(e); editor.setValue(query + 'SELECT * FROM ' + $(e.target).text()); }); + $('#clear-query').click(function(){ + editor.setValue(''); + }); + $('#run-query').click(function(){ - console.log(editor.getValue()); $.post('@context.path/admin/dbviewer/_query', { query: editor.getValue() }, function(data){ if(data.type == "query"){ var table = $('');