| {{?__raw__}}{{{profile}}}{{/__raw__}} |
| |
| {{^__raw__}} |
| |
| <!-- |
| Licensed to the Apache Software Foundation (ASF) under one |
| or more contributor license agreements. See the NOTICE file |
| distributed with this work for additional information |
| regarding copyright ownership. The ASF licenses this file |
| to you under the Apache License, Version 2.0 (the |
| "License"); you may not use this file except in compliance |
| with the License. You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, |
| software distributed under the License is distributed on an |
| "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| KIND, either express or implied. See the License for the |
| specific language governing permissions and limitations |
| under the License. |
| --> |
| {{> www/common-header.tmpl }} |
| |
| {{> www/query_detail_tabs.tmpl }} |
| |
| <!-- Enable the 'highlight' library, which does syntax highlighting of query |
| statements --> |
| <link rel="stylesheet" href="{{ __common__.host-url }}/www/highlight/styles/default.css"> |
| <script src="{{ __common__.host-url }}/www/highlight/highlight.pack.js"></script> |
| <script src="{{ __common__.host-url }}/www/scripts/compression_util.js" type="module"></script> |
| <script>hljs.initHighlightingOnLoad();</script> |
| |
| <span id="tab_body">{{?stmt}}<pre class="code"><code>{{stmt}}</code></pre>{{/stmt}}</span> |
| |
| <script type="module"> |
| $("#stmt-tab").addClass("active"); |
| |
| import {inflateParseJSON} |
| from "{{ __common__.host-url }}/www/scripts/compression_util.js"; |
| |
| var dbOpenReq = indexedDB.open("imported_queries"); |
| var db; |
| |
| var supported_tabs = ["Query", "Timeline", "Text plan", "Profile"]; |
| |
| if (window.location.search.includes("imported")) { |
| var alertMessage = document.getElementsByClassName("alert alert-danger")[0]; |
| if (alertMessage) { |
| alertMessage.remove(); |
| } |
| var nav_links = document.getElementsByClassName("nav nav-tabs")[0]; |
| nav_links = nav_links.getElementsByClassName("nav-link"); |
| for (var i = 0; i < nav_links.length;) { |
| if (supported_tabs.includes(nav_links[i].textContent)) { |
| nav_links[i].href = `${nav_links[i].href}&imported=true`; |
| i++; |
| } else { |
| nav_links[i].parentElement.remove(); |
| } |
| } |
| |
| dbOpenReq.onsuccess = (e) => { |
| db = e.target.result; |
| db.onerror = (e) => { |
| console.log("IndexedDB error"); |
| console.log(e); |
| } |
| var profileStore = db.transaction("profiles", "readonly").objectStore("profiles"); |
| profileStore.get(getQueryID()).onsuccess = (e) => { |
| var sql_query = inflateParseJSON(e.target.result.profile).contents |
| .child_profiles[0].info_strings.find(({key}) => key === "Sql Statement").value; |
| var sql_stmt_body = document.createElement("pre"); |
| sql_stmt_body.className = "code"; |
| var sql_code = sql_stmt_body.appendChild(document.createElement("code")) |
| sql_code.innerHTML = sql_query; |
| tab_body.innerHTML = ""; |
| tab_body.appendChild(sql_stmt_body); |
| hljs.highlightBlock(sql_stmt_body); |
| }; |
| }; |
| } |
| |
| </script> |
| {{> www/common-footer.tmpl }} |
| |
| {{/__raw__}} |