Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 84d6580

Browse files
author
fuze
committed
вывод статистики запросов в админке
1 parent de3051b commit 84d6580

File tree

5 files changed

+53
-1
lines changed

5 files changed

+53
-1
lines changed

‎package/system/controllers/api/actions/method.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ public function run($method_name = null){
175175

176176
/**
177177
* Действия после успешного запроса
178-
* @return \actionApiMethod
178+
* @return boolean
179179
*/
180180
private function afterRequest() {
181181

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<?php
2+
3+
class onApiAdminDashboardChart extends cmsAction {
4+
5+
public function run() {
6+
7+
return array(
8+
'id' => 'api',
9+
'title' => LANG_API_CONTROLLER,
10+
'sections' => array(
11+
'errors_log' => array(
12+
'title' => LANG_API_STAT_ERRORS,
13+
'table' => 'api_logs',
14+
'filter' => array(
15+
array(
16+
'condition' => 'nn',
17+
'value' => null,
18+
'field' => 'error'
19+
)
20+
),
21+
'key' => 'date_pub'
22+
),
23+
'success_log' => array(
24+
'title' => LANG_API_STAT_OK,
25+
'table' => 'api_logs',
26+
'filter' => array(
27+
array(
28+
'condition' => 'ni',
29+
'value' => null,
30+
'field' => 'error'
31+
)
32+
),
33+
'key' => 'date_pub'
34+
)
35+
)
36+
);
37+
}
38+
39+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?php
2+
3+
return array(
4+
5+
'hooks' => array(
6+
'admin_dashboard_chart'
7+
)
8+
9+
);

‎package/system/languages/en/controllers/api/api.php‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
define('LANG_API_KEY_IS_PUB', 'Access key is enable');
1414
define('LANG_API_KEY_UPDATE', 'Access Key has been changed. Do not forget to change it in your application.');
1515
define('LANG_API_DELETE_CONFIRM', 'Delete this access key?\nApplications that use it, can not work.');
16+
define('LANG_API_STAT_ERRORS', 'Request errors');
17+
define('LANG_API_STAT_OK', 'Success requests');
1618

1719
define('LANG_API_EMPTY_CTYPE', 'Content type not set');
1820

‎package/system/languages/ru/controllers/api/api.php‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
define('LANG_API_KEY_IS_PUB', 'Ключ доступа включен');
1414
define('LANG_API_KEY_UPDATE', 'Ключ доступа был изменен. Не забудьте его поменять в вашем приложении.');
1515
define('LANG_API_DELETE_CONFIRM', 'Удалить этот ключ доступа?\nПриложения, использующие его, не смогут работать.');
16+
define('LANG_API_STAT_ERRORS', 'Ошибки запросов');
17+
define('LANG_API_STAT_OK', 'Успешные запросы');
1618

1719
define('LANG_API_EMPTY_CTYPE', 'Не задан тип контента');
1820

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /