芝麻web文件管理V1.00
编辑当前文件:/home2/sdektunc/.trash/media/vendor/debugbar/widgets/sqlqueries/widget.min.js
!function(t){var e=PhpDebugBar.utils.makecsscls("phpdebugbar-widgets-");PhpDebugBar.Widgets.SQLQueriesWidget=PhpDebugBar.Widget.extend({className:e("sqlqueries"),onFilterClick:function(s){t(s).toggleClass(e("excluded"));var a=[];this.$toolbar.find(e(".filter")+e(".excluded")).each((function(){a.push(this.rel)})),this.$list.$el.find("li[connection="+t(s).attr("rel")+"]").toggle(),this.set("exclude",a)},onCopyToClipboard:function(e){var s=t(e).parent("li").find("code").get(0);!function(t){if(document.selection)(e=document.body.createTextRange()).moveToElementText(t),e.select();else if(window.getSelection){var e;(e=document.createRange()).selectNodeContents(t),window.getSelection().removeAllRanges(),window.getSelection().addRange(e)}!function(){try{document.execCommand("copy"),alert("Query copied to the clipboard")}catch(t){console.log("Oops, unable to copy")}}(),window.getSelection().removeAllRanges()}(s)},render:function(){this.$status=t("
").addClass(e("status")).appendTo(this.$el),this.$toolbar=t("
").addClass(e("toolbar")).appendTo(this.$el);var s=[],a=this;this.$list=new PhpDebugBar.Widgets.ListWidget({itemRenderer:function(n,o){if(t("
").addClass(e("sql")).html(PhpDebugBar.Widgets.highlight(o.sql,"sql")).appendTo(n),o.duration_str&&t('
').addClass(e("duration")).text(o.duration_str).appendTo(n),o.memory_str&&t('
').addClass(e("memory")).text(o.memory_str).appendTo(n),void 0!==o.row_count&&t('
').addClass(e("row-count")).text(o.row_count).appendTo(n),void 0!==o.stmt_id&&o.stmt_id&&t('
').addClass(e("stmt-id")).text(o.stmt_id).appendTo(n),o.connection&&(t('
').addClass(e("database")).text(o.connection).appendTo(n),n.attr("connection",o.connection),-1==t.inArray(o.connection,s)&&(s.push(o.connection),t("
").addClass(e("filter")).text(o.connection).attr("rel",o.connection).on("click",(function(){a.onFilterClick(this)})).appendTo(a.$toolbar),s.length>1&&(a.$toolbar.show(),a.$list.$el.css("margin-bottom","20px")))),void 0===o.is_success||o.is_success||(n.addClass(e("error")),n.append(t("
").addClass(e("error")).text("["+o.error_code+"] "+o.error_message))),t('
').addClass(e("copy-clipboard")).css("cursor","pointer").on("click",(function(t){a.onCopyToClipboard(this),t.stopPropagation()})).appendTo(n),o.params&&!t.isEmptyObject(o.params)){var i=t('
Params
').addClass(e("params")).appendTo(n);for(var d in o.params)"function"!=typeof o.params[d]&&i.append('
'+d+'
'+o.params[d]+"
");n.css("cursor","pointer").click((function(){i.is(":visible")?i.hide():i.show()}))}}}),this.$list.$el.appendTo(this.$el),this.bindAttr("data",(function(s){if(s.length<=0)return!1;this.$list.set("data",s.statements),this.$status.empty();for(var a={},n=0,o=0,i=0;i
1){o+=a[d].keys.length;for(i=0;i
").text(s.nb_statements+" statements were executed").appendTo(this.$status);s.nb_failed_statements&&r.append(", "+s.nb_failed_statements+" of which failed"),o&&(r.append(", "+o+" of which were duplicates"),r.append(", "+n+" unique")),s.accumulated_duration_str&&this.$status.append(t('
').addClass(e("duration")).text(s.accumulated_duration_str)),s.memory_usage_str&&this.$status.append(t('
').addClass(e("memory")).text(s.memory_usage_str))}))}})}(PhpDebugBar.$);