1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
<div id="pma_console_container">
<div id="pma_console">
{# Console toolbar #}
{% include 'console/toolbar.twig' with {
'parent_div_classes': 'collapsed',
'content_array': [
{0: 'switch_button console_switch', 1: 'Console'|trans, 'image': image},
['button clear', 'Clear'|trans],
['button history', 'History'|trans],
['button options', 'Options'|trans],
cfg_bookmark is defined ? ['button bookmarks', 'Bookmarks'|trans] : null,
['button debug hide', 'Debug SQL'|trans]
]
} only %}
{# Console messages #}
<div class="content">
<div class="console_message_container">
<div class="message welcome">
<span id="instructions-0">
{% trans 'Press Ctrl+Enter to execute query' %}
</span>
<span class="hide" id="instructions-1">
{% trans 'Press Enter to execute query' %}
</span>
</div>
{% if sql_history is not empty %}
{% for record in sql_history|reverse %}
<div class="message history collapsed hide
{{- record['sqlquery'] matches '@^SELECT[[:space:]]+@i' ? ' select' }}"
targetdb="{{ record['db'] }}" targettable="{{ record['table'] }}">
{% include 'console/query_action.twig' with {
'parent_div_classes': 'action_content',
'content_array': [
['action collapse', 'Collapse'|trans],
['action expand', 'Expand'|trans],
['action requery', 'Requery'|trans],
['action edit', 'Edit'|trans],
['action explain', 'Explain'|trans],
['action profiling', 'Profiling'|trans],
cfg_bookmark is defined ? ['action bookmark', 'Bookmark'|trans] : null,
['text failed', 'Query failed'|trans],
{0: 'text targetdb', 1: 'Database'|trans, 'extraSpan': record['db']},
{
0: 'text query_time',
1: 'Queried time'|trans,
'extraSpan': record['timevalue'] is defined ?
record['timevalue'] : 'During current session'|trans
}
]
} only %}
<span class="query">{{ record['sqlquery'] }}</span>
</div>
{% endfor %}
{% endif %}
</div><!-- console_message_container -->
<div class="query_input">
<span class="console_query_input"></span>
</div>
</div><!-- message end -->
{# Drak the console with other cards over it #}
<div class="mid_layer"></div>
{# Debug SQL card #}
<div class="card" id="debug_console">
{% include 'console/toolbar.twig' with {
'parent_div_classes': '',
'content_array': [
['button order order_asc', 'ascending'|trans],
['button order order_desc', 'descending'|trans],
['text', 'Order:'|trans],
['switch_button', 'Debug SQL'|trans],
['button order_by sort_count', 'Count'|trans],
['button order_by sort_exec', 'Execution order'|trans],
['button order_by sort_time', 'Time taken'|trans],
['text', 'Order by:'|trans],
['button group_queries', 'Group queries'|trans],
['button ungroup_queries', 'Ungroup queries'|trans]
]
} only %}
<div class="content debug">
<div class="message welcome"></div>
<div class="debugLog"></div>
</div> <!-- Content -->
<div class="templates">
{% include 'console/query_action.twig' with {
'parent_div_classes': 'debug_query action_content',
'content_array': [
['action collapse', 'Collapse'|trans],
['action expand', 'Expand'|trans],
['action dbg_show_trace', 'Show trace'|trans],
['action dbg_hide_trace', 'Hide trace'|trans],
['text count hide', 'Count'|trans],
['text time', 'Time taken'|trans]
]
} only %}
</div> <!-- Template -->
</div> <!-- Debug SQL card -->
{% if cfg_bookmark %}
<div class="card" id="pma_bookmarks">
{% include 'console/toolbar.twig' with {
'parent_div_classes': '',
'content_array': [
['switch_button', 'Bookmarks'|trans],
['button refresh', 'Refresh'|trans],
['button add', 'Add'|trans]
]
} only %}
<div class="content bookmark">
{{ bookmark_content|raw }}
</div>
<div class="mid_layer"></div>
<div class="card add">
{% include 'console/toolbar.twig' with {
'parent_div_classes': '',
'content_array': [
['switch_button', 'Add bookmark'|trans]
]
} only %}
<div class="content add_bookmark">
<div class="options">
<label>
{% trans 'Label' %}: <input type="text" name="label">
</label>
<label>
{% trans 'Target database' %}: <input type="text" name="targetdb">
</label>
<label>
<input type="checkbox" name="shared">{% trans 'Share this bookmark' %}
</label>
<button type="submit" name="submit">{% trans 'OK' %}</button>
</div> <!-- options -->
<div class="query_input">
<span class="bookmark_add_input"></span>
</div>
</div>
</div> <!-- Add bookmark card -->
</div> <!-- Bookmarks card -->
{% endif %}
{# Options card #}
<div class="card" id="pma_console_options">
{% include 'console/toolbar.twig' with {
'parent_div_classes': '',
'content_array': [
['switch_button', 'Options'|trans],
['button default', 'Set default'|trans]
]
} only %}
<div class="content">
<label>
<input type="checkbox" name="always_expand">{% trans 'Always expand query messages' %}
</label>
<br>
<label>
<input type="checkbox" name="start_history">{% trans 'Show query history at start' %}
</label>
<br>
<label>
<input type="checkbox" name="current_query">{% trans 'Show current browsing query' %}
</label>
<br>
<label>
<input type="checkbox" name="enter_executes">
{% trans %}
Execute queries on Enter and insert new line with Shift + Enter. To make this permanent, view settings.
{% endtrans %}
</label>
<br>
<label>
<input type="checkbox" name="dark_theme">{% trans 'Switch to dark theme' %}
</label>
<br>
</div>
</div> <!-- Options card -->
<div class="templates">
{# Templates for console message actions #}
{% include 'console/query_action.twig' with {
'parent_div_classes': 'query_actions',
'content_array': [
['action collapse', 'Collapse'|trans],
['action expand', 'Expand'|trans],
['action requery', 'Requery'|trans],
['action edit', 'Edit'|trans],
['action explain', 'Explain'|trans],
['action profiling', 'Profiling'|trans],
cfg_bookmark is defined ? ['action bookmark', 'Bookmark'|trans] : null,
['text failed', 'Query failed'|trans],
['text targetdb', 'Database'|trans],
['text query_time', 'Queried time'|trans]
]
} only %}
</div>
</div> <!-- #console end -->
</div> <!-- #console_container end -->