Skip to content
This repository was archived by the owner on Sep 6, 2023. It is now read-only.

Commit 9ae5998

Browse files
committed
Improved css classes and add sql count requests
1 parent d0577c1 commit 9ae5998

File tree

4 files changed

+97
-89
lines changed

4 files changed

+97
-89
lines changed

ggrachdev.debugbar/classes/general/BitrixDebugger/Representer/DebugBarRepresenter.php

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,20 +40,23 @@ protected static function renderRightView(): string {
4040

4141
public static function render(Debugger $debugger): string {
4242

43-
global $DBDebug, $APPLICATION;
43+
global $DBDebug, $ggrachTracker;
44+
45+
$connection = \Bitrix\Main\Application::getConnection();
46+
$connection->stopTracker();
4447

4548
// Включен ли дебаг-режим
4649
$bxSettingsDebug = \Bitrix\Main\Config\Configuration::getValue("exception_handling")['debug'];
4750

4851
if ($DBDebug || $bxSettingsDebug) {
49-
self::addViewInRightSlot('<a target="_blank" href="/bitrix/admin/fileman_file_edit.php?path=/bitrix/.settings.php&full_src=Y" class="ggrach__debug-bar__right__item type-notice-error" title="В битриксе включен дебаг-режим, он замедляет работу сайта!">D</a>');
52+
self::addViewInRightSlot('<a target="_blank" href="/bitrix/admin/fileman_file_edit.php?path=/bitrix/.settings.php&full_src=Y" class="ggrach__debug-bar__right__item ggrach_background_error" title="В битриксе включен дебаг-режим, он замедляет работу сайта!">D</a>');
5053
}
5154

5255
$log = $debugger->getLog(true);
5356

5457
if (!empty($log)) {
5558
foreach ($log as $typeLog => $arLogs) {
56-
$viewLeft = '<div class="ggrach__debug-bar__item type-notice-' . strtolower($typeLog) . '" data-type-notice="' . $typeLog . '" data-click="show_notice_panel">';
59+
$viewLeft = '<div class="ggrach__debug-bar__item ggrach_background_' . strtolower($typeLog) . ' type-notice-' . strtolower($typeLog) . '" data-type-notice="' . $typeLog . '" data-click="show_notice_panel">';
5760

5861
if (in_array($typeLog, self::SYSTEM_KEYS_LOG)) {
5962
$count = $typeLog;
@@ -92,15 +95,17 @@ public static function render(Debugger $debugger): string {
9295
}
9396
}
9497

95-
self::addViewInRightSlot('<a target="_blank" href="/bitrix/admin/site_edit.php?LID=' . \SITE_ID . '&lang=ru" class="ggrach__debug-bar__right__item type-notice-notice" title="SITE ID - Идентификатор сайта">' . \SITE_ID . '</a>');
98+
self::addViewInRightSlot('<a target="_blank" href="/bitrix/admin/site_edit.php?LID=' . \SITE_ID . '&lang=ru" class="ggrach__debug-bar__right__item ggrach_background_notice" title="SITE ID - Идентификатор сайта">' . \SITE_ID . '</a>');
9699

97-
self::addViewInRightSlot('<a target="_blank" href="/bitrix/admin/site_edit.php?LID=' . \SITE_ID . '&lang=ru" class="ggrach__debug-bar__right__item type-notice-success" title="Текущая страница">' . SITE_CHARSET . '</a>');
100+
self::addViewInRightSlot('<a target="_blank" href="/bitrix/admin/site_edit.php?LID=' . \SITE_ID . '&lang=ru" class="ggrach__debug-bar__right__item ggrach_background_success" title="Текущая страница">' . SITE_CHARSET . '</a>');
98101

99102
$debugBarIsClosed = $_COOKIE['ggrach_debug_bar_is_close'] == 'true';
100103

101104
$closeIcon = $debugBarIsClosed ? '&lt;' : '&#215;';
102105

103-
self::addViewInRightSlot('<a href="javascript:void(0);" data-click="toggle_debug_bar" class="ggrach__debug-bar__right__item ggrach__debug-bar__right__item_close ggrach-debug-bar-color-black" title="Скрыть / Раскрыть дебаг-бар">'.$closeIcon.'</a>');
106+
self::addViewInRightSlot('<div class="ggrach__debug-bar__right__item ggrach_background_notice" title="Количество SQL запросов">SQL: ' . sizeof($ggrachTracker->getQueries()) . '</div>');
107+
108+
self::addViewInRightSlot('<a href="javascript:void(0);" data-click="toggle_debug_bar" class="ggrach__debug-bar__right__item ggrach__debug-bar__right__item_close ggrach_background_black" title="Скрыть / Раскрыть дебаг-бар">'.$closeIcon.'</a>');
104109

105110
$view = '<section class="ggrach__overlay" style="display: none;"></section><section class="ggrach__debug-bar '.($debugBarIsClosed ? 'hide-debug-bar' : '').'">';
106111

ggrachdev.debugbar/include.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
use \Bitrix\Main\Page\Asset;
44

5+
global $ggrachTracker;
6+
7+
$connection = \Bitrix\Main\Application::getConnection();
8+
$ggrachTracker = $connection->startTracker();
9+
510
// Корневая папка модуля
611
$ggrachDebuggerRootPath = str_replace($_SERVER['DOCUMENT_ROOT'], '', __DIR__ . '/..');
712

ggrachdev.debugbar/install/css/general.css

Lines changed: 1 addition & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -119,87 +119,6 @@
119119
order: 3;
120120
}
121121

122-
.type-notice-notice {
123-
color: #fff;
124-
background: rgb(25,60,119);
125-
background: -moz-linear-gradient(180deg, rgba(25,60,119,1) 0%, rgba(18,97,148,1) 72%);
126-
background: -webkit-linear-gradient(180deg, rgba(25,60,119,1) 0%, rgba(18,97,148,1) 72%);
127-
background: linear-gradient(180deg, rgba(25,60,119,1) 0%, rgba(18,97,148,1) 72%);
128-
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr="#193c77",endColorstr="#126194",GradientType=1);
129-
}
130-
131-
.type-notice-warning {
132-
color: #000;
133-
background: rgb(179,195,43);
134-
background: -moz-linear-gradient(180deg, rgba(179,195,43,1) 0%, rgba(213,224,27,1) 72%);
135-
background: -webkit-linear-gradient(180deg, rgba(179,195,43,1) 0%, rgba(213,224,27,1) 72%);
136-
background: linear-gradient(180deg, rgba(179,195,43,1) 0%, rgba(213,224,27,1) 72%);
137-
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr="#b3c32b",endColorstr="#d5e01b",GradientType=1);
138-
}
139-
140-
.type-notice-success {
141-
color: #fff;
142-
background: rgb(25,119,44);
143-
background: -moz-linear-gradient(180deg, rgba(25,119,44,1) 0%, rgba(18,148,70,1) 72%);
144-
background: -webkit-linear-gradient(180deg, rgba(25,119,44,1) 0%, rgba(18,148,70,1) 72%);
145-
background: linear-gradient(180deg, rgba(25,119,44,1) 0%, rgba(18,148,70,1) 72%);
146-
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr="#19772c",endColorstr="#129446",GradientType=1);
147-
}
148-
149-
.type-notice-error {
150-
color: #fff;
151-
background: rgb(170,18,18);
152-
background: -moz-linear-gradient(180deg, rgba(170,18,18,1) 0%, rgba(200,9,9,1) 72%);
153-
background: -webkit-linear-gradient(180deg, rgba(170,18,18,1) 0%, rgba(200,9,9,1) 72%);
154-
background: linear-gradient(180deg, rgba(170,18,18,1) 0%, rgba(200,9,9,1) 72%);
155-
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr="#aa1212",endColorstr="#c80909",GradientType=1);
156-
}
157-
158-
.type-notice-get {
159-
color: #fff;
160-
background: rgb(91,91,91);
161-
background: -moz-linear-gradient(180deg, rgba(91,91,91,1) 0%, rgba(139,139,139,1) 72%);
162-
background: -webkit-linear-gradient(180deg, rgba(91,91,91,1) 0%, rgba(139,139,139,1) 72%);
163-
background: linear-gradient(180deg, rgba(91,91,91,1) 0%, rgba(139,139,139,1) 72%);
164-
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr="#5b5b5b",endColorstr="#8b8b8b",GradientType=1);
165-
}
166-
167-
.type-notice-post {
168-
color: #fff;
169-
background: rgb(96,52,52);
170-
background: -moz-linear-gradient(180deg, rgba(96,52,52,1) 0%, rgba(131,85,85,1) 72%);
171-
background: -webkit-linear-gradient(180deg, rgba(96,52,52,1) 0%, rgba(131,85,85,1) 72%);
172-
background: linear-gradient(180deg, rgba(96,52,52,1) 0%, rgba(131,85,85,1) 72%);
173-
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr="#603434",endColorstr="#835555",GradientType=1);
174-
}
175-
176-
.type-notice-cookie {
177-
color: #fff;
178-
background: rgb(87,97,138);
179-
background: -moz-linear-gradient(180deg, rgba(87,97,138,1) 0%, rgba(137,123,176,1) 72%);
180-
background: -webkit-linear-gradient(180deg, rgba(87,97,138,1) 0%, rgba(137,123,176,1) 72%);
181-
background: linear-gradient(180deg, rgba(87,97,138,1) 0%, rgba(137,123,176,1) 72%);
182-
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr="#57618a",endColorstr="#897bb0",GradientType=1);
183-
}
184-
185-
.type-notice-bx {
186-
color: #fff;
187-
background: rgb(136,63,63);
188-
background: -moz-linear-gradient(180deg, rgba(136,63,63,1) 0%, rgba(168,58,58,1) 72%);
189-
background: -webkit-linear-gradient(180deg, rgba(136,63,63,1) 0%, rgba(168,58,58,1) 72%);
190-
background: linear-gradient(180deg, rgba(136,63,63,1) 0%, rgba(168,58,58,1) 72%);
191-
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr="#883f3f",endColorstr="#a83a3a",GradientType=1);
192-
}
193-
194-
.type-notice-server {
195-
color: #fff;
196-
background: rgb(0,97,65);
197-
background: -moz-linear-gradient(180deg, rgba(0,97,65,1) 0%, rgba(0,172,115,1) 72%);
198-
background: -webkit-linear-gradient(180deg, rgba(0,97,65,1) 0%, rgba(0,172,115,1) 72%);
199-
background: linear-gradient(180deg, rgba(0,97,65,1) 0%, rgba(0,172,115,1) 72%);
200-
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr="#006141",endColorstr="#00ac73",GradientType=1);
201-
}
202-
203122
.ggrach__debug-bar__item.type-notice-bx {
204123
order: 15;
205124
}
@@ -217,7 +136,6 @@
217136
order: 4;
218137
}
219138

220-
221139
.ggrach__debug-bar__item.type-notice-get {
222140
order: 10;
223141
}
@@ -234,7 +152,7 @@
234152
order: 14;
235153
}
236154

237-
.ggrach-debug-bar-color-black {
155+
.ggrach_background_black {
238156
color: #fff !important;
239157
background: #000;
240158
}

ggrachdev.debugbar/install/css/light/theme.css

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,84 @@
77
.ggrach__debug-bar__log__line {
88
font-size: 12px;
99
color: darkgrey;
10+
}
11+
.ggrach_background_notice {
12+
color: #fff;
13+
background: rgb(25,60,119);
14+
background: -moz-linear-gradient(180deg, rgba(25,60,119,1) 0%, rgba(18,97,148,1) 72%);
15+
background: -webkit-linear-gradient(180deg, rgba(25,60,119,1) 0%, rgba(18,97,148,1) 72%);
16+
background: linear-gradient(180deg, rgba(25,60,119,1) 0%, rgba(18,97,148,1) 72%);
17+
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr="#193c77",endColorstr="#126194",GradientType=1);
18+
}
19+
20+
.ggrach_background_warning {
21+
color: #000;
22+
background: rgb(179,195,43);
23+
background: -moz-linear-gradient(180deg, rgba(179,195,43,1) 0%, rgba(213,224,27,1) 72%);
24+
background: -webkit-linear-gradient(180deg, rgba(179,195,43,1) 0%, rgba(213,224,27,1) 72%);
25+
background: linear-gradient(180deg, rgba(179,195,43,1) 0%, rgba(213,224,27,1) 72%);
26+
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr="#b3c32b",endColorstr="#d5e01b",GradientType=1);
27+
}
28+
29+
.ggrach_background_success {
30+
color: #fff;
31+
background: rgb(25,119,44);
32+
background: -moz-linear-gradient(180deg, rgba(25,119,44,1) 0%, rgba(18,148,70,1) 72%);
33+
background: -webkit-linear-gradient(180deg, rgba(25,119,44,1) 0%, rgba(18,148,70,1) 72%);
34+
background: linear-gradient(180deg, rgba(25,119,44,1) 0%, rgba(18,148,70,1) 72%);
35+
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr="#19772c",endColorstr="#129446",GradientType=1);
36+
}
37+
38+
.ggrach_background_error {
39+
color: #fff;
40+
background: rgb(170,18,18);
41+
background: -moz-linear-gradient(180deg, rgba(170,18,18,1) 0%, rgba(200,9,9,1) 72%);
42+
background: -webkit-linear-gradient(180deg, rgba(170,18,18,1) 0%, rgba(200,9,9,1) 72%);
43+
background: linear-gradient(180deg, rgba(170,18,18,1) 0%, rgba(200,9,9,1) 72%);
44+
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr="#aa1212",endColorstr="#c80909",GradientType=1);
45+
}
46+
47+
.ggrach_background_get {
48+
color: #fff;
49+
background: rgb(91,91,91);
50+
background: -moz-linear-gradient(180deg, rgba(91,91,91,1) 0%, rgba(139,139,139,1) 72%);
51+
background: -webkit-linear-gradient(180deg, rgba(91,91,91,1) 0%, rgba(139,139,139,1) 72%);
52+
background: linear-gradient(180deg, rgba(91,91,91,1) 0%, rgba(139,139,139,1) 72%);
53+
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr="#5b5b5b",endColorstr="#8b8b8b",GradientType=1);
54+
}
55+
56+
.ggrach_background_post {
57+
color: #fff;
58+
background: rgb(96,52,52);
59+
background: -moz-linear-gradient(180deg, rgba(96,52,52,1) 0%, rgba(131,85,85,1) 72%);
60+
background: -webkit-linear-gradient(180deg, rgba(96,52,52,1) 0%, rgba(131,85,85,1) 72%);
61+
background: linear-gradient(180deg, rgba(96,52,52,1) 0%, rgba(131,85,85,1) 72%);
62+
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr="#603434",endColorstr="#835555",GradientType=1);
63+
}
64+
65+
.ggrach_background_cookie {
66+
color: #fff;
67+
background: rgb(87,97,138);
68+
background: -moz-linear-gradient(180deg, rgba(87,97,138,1) 0%, rgba(137,123,176,1) 72%);
69+
background: -webkit-linear-gradient(180deg, rgba(87,97,138,1) 0%, rgba(137,123,176,1) 72%);
70+
background: linear-gradient(180deg, rgba(87,97,138,1) 0%, rgba(137,123,176,1) 72%);
71+
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr="#57618a",endColorstr="#897bb0",GradientType=1);
72+
}
73+
74+
.ggrach_background_bx {
75+
color: #fff;
76+
background: rgb(136,63,63);
77+
background: -moz-linear-gradient(180deg, rgba(136,63,63,1) 0%, rgba(168,58,58,1) 72%);
78+
background: -webkit-linear-gradient(180deg, rgba(136,63,63,1) 0%, rgba(168,58,58,1) 72%);
79+
background: linear-gradient(180deg, rgba(136,63,63,1) 0%, rgba(168,58,58,1) 72%);
80+
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr="#883f3f",endColorstr="#a83a3a",GradientType=1);
81+
}
82+
83+
.ggrach_background_server {
84+
color: #fff;
85+
background: rgb(0,97,65);
86+
background: -moz-linear-gradient(180deg, rgba(0,97,65,1) 0%, rgba(0,172,115,1) 72%);
87+
background: -webkit-linear-gradient(180deg, rgba(0,97,65,1) 0%, rgba(0,172,115,1) 72%);
88+
background: linear-gradient(180deg, rgba(0,97,65,1) 0%, rgba(0,172,115,1) 72%);
89+
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr="#006141",endColorstr="#00ac73",GradientType=1);
1090
}

0 commit comments

Comments
 (0)