Keyboard shortcuts in the Query Tool:

Execute  -->   Ctrl + Shift + E
Explain  -->    Ctrl + Shift + X
Explain analyze  -->   Ctrl + Shift + A
pull/3/head
Harshal Dhumal 2016-06-20 13:03:46 +01:00 committed by Dave Page
parent c16df45f2c
commit 237f93591f
2 changed files with 24 additions and 4 deletions

View File

@ -61,7 +61,7 @@ body {
</select>
</div>
<div class="btn-group" role="group" aria-label="">
<button id="btn-flash" type="button" class="btn btn-default" style="width: 40px;" title="{{ _('Execute/Refresh') }}">
<button id="btn-flash" type="button" class="btn btn-default" style="width: 40px;" title="{{ _('Execute/Refresh (Ctrl+Shift+E)') }}">
<i class="fa fa-bolt" aria-hidden="true"></i>
</button>
<button id="btn-query-dropdown" type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
@ -70,12 +70,12 @@ body {
<ul class="dropdown-menu dropdown-menu">
<li>
<a id="btn-explain" href="#">
<span>{{ _('Explain') }}</span>
<span>{{ _('Explain (Ctrl+Shift+X)') }}</span>
</a>
</li>
<li>
<a id="btn-explain-analyze" href="#">
<span>{{ _('Explain analyze') }}</span>
<span>{{ _('Explain analyze (Ctrl+Shift+A)') }}</span>
</a>
</li>
<li class="divider"></li>

View File

@ -175,7 +175,8 @@ define(
"click #btn-explain-costs": "on_explain_costs",
"click #btn-explain-buffers": "on_explain_buffers",
"click #btn-explain-timing": "on_explain_timing",
"change .limit": "on_limit_change"
"change .limit": "on_limit_change",
"keyup": "keyAction"
},
// This function is used to render the template.
@ -1010,6 +1011,25 @@ define(
self,
self.handler
);
},
// Callback for keyboard event
keyAction: function(ev) {
if(ev.ctrlKey && ev.shiftKey) {
if(ev.keyCode == 69) {
// char e/E
// Execute query.
this.on_flash(ev);
} else if(ev.keyCode == 88){
// char x/X
// Explain query.
this.on_explain(ev);
} else if(ev.keyCode == 65) {
// char a/A
// Explain analyze query.
this.on_explain_analyze(ev);
}
}
}
});