Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PSDI Army
yii2
Commits
bb7a6872
Commit
bb7a6872
authored
Feb 11, 2014
by
Qiang Xue
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2401 from schmunk42/feature/toolbar-ui-3
Feature/toolbar ui 3
parents
65a8eae7
e1c30eab
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
89 additions
and
77 deletions
+89
-77
index.php
extensions/debug/views/default/index.php
+84
-77
detail.php
extensions/debug/views/default/panels/db/detail.php
+1
-0
detail.php
extensions/debug/views/default/panels/log/detail.php
+1
-0
summary.php
extensions/debug/views/default/panels/log/summary.php
+1
-0
detail.php
extensions/debug/views/default/panels/request/detail.php
+2
-0
No files found.
extensions/debug/views/default/index.php
View file @
bb7a6872
...
...
@@ -17,95 +17,102 @@ $this->title = 'Yii Debugger';
<div
class=
"default-index"
>
<div
id=
"yii-debug-toolbar"
class=
"yii-debug-toolbar-top"
>
<div
class=
"yii-debug-toolbar-block title"
>
<a
href=
"#"
>
<img
width=
"29"
height=
"30"
alt=
""
src=
"
<?=
\yii\debug\Module
::
getYiiLogo
()
?>
"
>
Yii Debugger
</a>
</div>
<?php
foreach
(
$panels
as
$panel
)
:
?>
<?=
$panel
->
getSummary
()
?>
<?php
endforeach
;
?>
<div
id=
"yii-debug-toolbar"
class=
"yii-debug-toolbar-top"
>
<div
class=
"yii-debug-toolbar-block title"
>
<a
href=
"#"
>
<img
width=
"29"
height=
"30"
alt=
""
src=
"
<?=
\yii\debug\Module
::
getYiiLogo
()
?>
"
>
Yii Debugger
</a>
</div>
<?php
foreach
(
$panels
as
$panel
)
:
?>
<?=
$panel
->
getSummary
()
?>
<?php
endforeach
;
?>
</div>
<div
class=
"container"
>
<div
class=
"row"
>
<h1>
Available Debug Data
</h1>
<?php
$timeFormatter
=
extension_loaded
(
'intl'
)
?
Yii
::
createObject
([
'class'
=>
'yii\i18n\Formatter'
])
:
Yii
::
$app
->
formatter
;
if
(
isset
(
$this
->
context
->
module
->
panels
[
'db'
])
&&
isset
(
$this
->
context
->
module
->
panels
[
'request'
]))
{
echo
GridView
::
widget
([
'dataProvider'
=>
$dataProvider
,
'filterModel'
=>
$searchModel
,
'rowOptions'
=>
function
(
$model
,
$key
,
$index
,
$grid
)
use
(
$searchModel
)
{
$dbPanel
=
$this
->
context
->
module
->
panels
[
'db'
];
echo
" <h1>Available Debug Data</h1>"
;
$timeFormatter
=
extension_loaded
(
'intl'
)
?
Yii
::
createObject
([
'class'
=>
'yii\i18n\Formatter'
])
:
Yii
::
$app
->
formatter
;
if
(
$searchModel
->
isCodeCritical
(
$model
[
'statusCode'
])
||
$dbPanel
->
isQueryCountCritical
(
$model
[
'sqlCount'
]))
{
return
[
'class'
=>
'danger'
];
}
else
{
return
[];
}
},
'columns'
=>
[
[
'class'
=>
'yii\grid\SerialColumn'
],
[
'attribute'
=>
'tag'
,
'value'
=>
function
(
$data
)
{
return
Html
::
a
(
$data
[
'tag'
],
[
'view'
,
'tag'
=>
$data
[
'tag'
]]);
},
'format'
=>
'html'
,
],
[
'attribute'
=>
'time'
,
'value'
=>
function
(
$data
)
use
(
$timeFormatter
)
{
return
$timeFormatter
->
asDateTime
(
$data
[
'time'
],
'short'
);
},
],
'ip'
,
[
'attribute'
=>
'sqlCount'
,
'label'
=>
'Total queries'
,
'value'
=>
function
(
$data
)
{
$dbPanel
=
$this
->
context
->
module
->
panels
[
'db'
];
echo
GridView
::
widget
([
'dataProvider'
=>
$dataProvider
,
'filterModel'
=>
$searchModel
,
'rowOptions'
=>
function
(
$model
,
$key
,
$index
,
$grid
)
use
(
$searchModel
)
{
$dbPanel
=
$this
->
context
->
module
->
panels
[
'db'
];
if
(
$dbPanel
->
isQueryCountCritical
(
$data
[
'sqlCount'
]))
{
if
(
$searchModel
->
isCodeCritical
(
$model
[
'statusCode'
])
||
$dbPanel
->
isQueryCountCritical
(
$model
[
'sqlCount'
]))
{
return
[
'class'
=>
'danger'
];
}
else
{
return
[];
}
},
'columns'
=>
[
[
'class'
=>
'yii\grid\SerialColumn'
],
[
'attribute'
=>
'tag'
,
'value'
=>
function
(
$data
)
{
return
Html
::
a
(
$data
[
'tag'
],
[
'view'
,
'tag'
=>
$data
[
'tag'
]]);
},
'format'
=>
'html'
,
],
[
'attribute'
=>
'time'
,
'value'
=>
function
(
$data
)
use
(
$timeFormatter
)
{
return
$timeFormatter
->
asDateTime
(
$data
[
'time'
],
'short'
);
},
],
'ip'
,
[
'attribute'
=>
'sqlCount'
,
'label'
=>
'Total queries'
,
'value'
=>
function
(
$data
)
{
$dbPanel
=
$this
->
context
->
module
->
panels
[
'db'
];
$content
=
Html
::
tag
(
'b'
,
$data
[
'sqlCount'
])
.
' '
.
Html
::
tag
(
'span'
,
''
,
[
'class'
=>
'glyphicon glyphicon-exclamation-sign'
]);
return
Html
::
a
(
$content
,
[
'view'
,
'panel'
=>
'db'
,
'tag'
=>
$data
[
'tag'
]],
[
'title'
=>
'Too many queries. Allowed count is '
.
$dbPanel
->
criticalQueryThreshold
,
]);
if
(
$dbPanel
->
isQueryCountCritical
(
$data
[
'sqlCount'
]))
{
}
else
{
return
$data
[
'sqlCount'
];
}
},
'format'
=>
'html'
,
],
[
'attribute'
=>
'method'
,
'filter'
=>
[
'get'
=>
'GET'
,
'post'
=>
'POST'
,
'delete'
=>
'DELETE'
,
'put'
=>
'PUT'
,
'head'
=>
'HEAD'
]
],
[
'attribute'
=>
'ajax'
,
'value'
=>
function
(
$data
)
{
return
$data
[
'ajax'
]
?
'Yes'
:
'No'
;
},
'filter'
=>
[
'No'
,
'Yes'
],
],
[
'attribute'
=>
'url'
,
'label'
=>
'URL'
,
],
[
'attribute'
=>
'statusCode'
,
'filter'
=>
[
200
=>
200
,
404
=>
404
,
403
=>
403
,
500
=>
500
],
'label'
=>
'Status code'
$content
=
Html
::
tag
(
'b'
,
$data
[
'sqlCount'
])
.
' '
.
Html
::
tag
(
'span'
,
''
,
[
'class'
=>
'glyphicon glyphicon-exclamation-sign'
]);
return
Html
::
a
(
$content
,
[
'view'
,
'panel'
=>
'db'
,
'tag'
=>
$data
[
'tag'
]],
[
'title'
=>
'Too many queries. Allowed count is '
.
$dbPanel
->
criticalQueryThreshold
,
]);
}
else
{
return
$data
[
'sqlCount'
];
}
},
'format'
=>
'html'
,
],
[
'attribute'
=>
'method'
,
'filter'
=>
[
'get'
=>
'GET'
,
'post'
=>
'POST'
,
'delete'
=>
'DELETE'
,
'put'
=>
'PUT'
,
'head'
=>
'HEAD'
]
],
[
'attribute'
=>
'ajax'
,
'value'
=>
function
(
$data
)
{
return
$data
[
'ajax'
]
?
'Yes'
:
'No'
;
},
'filter'
=>
[
'No'
,
'Yes'
],
],
[
'attribute'
=>
'url'
,
'label'
=>
'URL'
,
],
[
'attribute'
=>
'statusCode'
,
'filter'
=>
[
200
=>
200
,
404
=>
404
,
403
=>
403
,
500
=>
500
],
'label'
=>
'Status code'
],
],
],
]);
?>
]);
}
else
{
echo
"<div class='alert alert-warning'>No data available. Panel <code>db</code> or <code>request</code> not found.</div>"
;
}
?>
</div>
</div>
</div>
extensions/debug/views/default/panels/db/detail.php
View file @
bb7a6872
<?php
use
yii\helpers\Html
;
use
yii\grid\GridView
;
?>
<h1>
Database Queries
</h1>
...
...
extensions/debug/views/default/panels/log/detail.php
View file @
bb7a6872
...
...
@@ -2,6 +2,7 @@
use
yii\helpers\Html
;
use
yii\grid\GridView
;
use
yii\log\Logger
;
?>
<h1>
Log Messages
</h1>
<?php
...
...
extensions/debug/views/default/panels/log/summary.php
View file @
bb7a6872
<?php
use
yii\log\Target
;
use
yii\log\Logger
;
?>
<?php
...
...
extensions/debug/views/default/panels/request/detail.php
View file @
bb7a6872
...
...
@@ -5,6 +5,8 @@ use yii\bootstrap\Tabs;
* @var yii\debug\panels\RequestPanel $panel
*/
echo
"<h1>Request</h1>"
;
echo
Tabs
::
widget
([
'items'
=>
[
[
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment