forked from xpressengine/xe-module-profiler
-
Notifications
You must be signed in to change notification settings - Fork 1
/
profiler.admin.view.php
182 lines (151 loc) · 6.05 KB
/
profiler.admin.view.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
<?php
/* Copyright (C) NAVER <http://www.navercorp.com> */
/**
* @class profilerAdminView
* @author NAVER ([email protected])
* @brief Profiler module admin view class.
*/
class profilerAdminView extends profiler
{
function init()
{
$this->setTemplatePath($this->module_path . 'tpl');
$this->setTemplateFile(lcfirst(str_replace('dispProfilerAdmin', '', $this->act)));
}
function dispProfilerAdminDashboard()
{
$oProfilerAdminModel = getAdminModel('profiler');
$a_slowlog = $oProfilerAdminModel->getStaticsSlowlog('addon');
$t_slowlog = $oProfilerAdminModel->getStaticsSlowlog('trigger');
Context::set('a_slowlog', $a_slowlog);
Context::set('t_slowlog', $t_slowlog);
}
function dispProfilerAdminConfig()
{
$oProfilerModel = getModel('profiler');
$module_config = $oProfilerModel->getConfig();
Context::set('module_config', $module_config);
}
function dispProfilerAdminSlowlog()
{
$oProfilerAdminModel = getAdminModel('profiler');
$output = $oProfilerAdminModel->getStaticsSlowlog('trigger');
$t_slowlog = $output->data;
$output2 = $oProfilerAdminModel->getStaticsSlowlogCount('trigger', '5');
$t_slowlog2 = $output2->data;
$paging = $oProfilerAdminModel->getPageNavigation($t_slowlog, Context::get('page'));
Context::set('total_count', $paging->total_count);
Context::set('total_page', $paging->total_page);
Context::set('page', $paging->page);
Context::set('trigger_slowlog', $paging->data);
Context::set('page_navigation', $paging->page_navigation);
Context::set('t_slowlog', $t_slowlog2);
}
function dispProfilerAdminAddonList()
{
$oProfilerAdminModel = getAdminModel('profiler');
$output = $oProfilerAdminModel->getStaticsSlowlog('addon');
$a_slowlog = $output->data;
$output2 = $oProfilerAdminModel->getStaticsSlowlogCount('addon', '5');
$a_slowlog2 = $output2->data;
$paging = $oProfilerAdminModel->getPageNavigation($a_slowlog, Context::get('page'));
Context::set('total_count', $paging->total_count);
Context::set('total_page', $paging->total_page);
Context::set('page', $paging->page);
Context::set('addon_slowlog', $paging->data);
Context::set('page_navigation', $paging->page_navigation);
Context::set('a_slowlog', $a_slowlog2);
}
function dispProfilerAdminWidgetList()
{
$oProfilerAdminModel = getAdminModel('profiler');
$output = $oProfilerAdminModel->getStaticsSlowlog('widget');
$w_slowlog = $output->data;
$output2 = $oProfilerAdminModel->getStaticsSlowlogCount('widget', '5');
$w_slowlog2 = $output2->data;
$paging = $oProfilerAdminModel->getPageNavigation($w_slowlog, Context::get('page'));
Context::set('total_count', $paging->total_count);
Context::set('total_page', $paging->total_page);
Context::set('page', $paging->page);
Context::set('widget_slowlog', $paging->data);
Context::set('page_navigation', $paging->page_navigation);
Context::set('w_slowlog', $w_slowlog2);
}
function dispProfilerAdminTrigger()
{
// 고급 삭제 옵션
$advanced = Context::get('advanced') == 'Y' ? TRUE : FALSE;
// 삭제할 수 있는 트리거 목록
$oProfilerAdminModel = getAdminModel('profiler');
$invalid_trigger_list = $oProfilerAdminModel->getTriggersToBeDeleted($advanced);
$paging = $oProfilerAdminModel->getPageNavigation($invalid_trigger_list, Context::get('page'));
// 템플릿 엔진으로 값 전달
Context::set('total_count', $paging->total_count);
Context::set('total_page', $paging->total_page);
Context::set('page', $paging->page);
Context::set('trigger_list', $paging->data);
Context::set('page_navigation', $paging->page_navigation);
}
function dispProfilerAdminModuleConfig()
{
// 고급 삭제 옵션
$advanced = Context::get('advanced') == 'Y' ? TRUE : FALSE;
// 삭제할 수 있는 모듈 설정 목록
$oProfilerAdminModel = getAdminModel('profiler');
$invalid_module_config = $oProfilerAdminModel->getModuleConfigToBeDeleted($advanced);
$paging = $oProfilerAdminModel->getPageNavigation($invalid_module_config, Context::get('page'));
// 템플릿 엔진으로 값 전달
Context::set('total_count', $paging->total_count);
Context::set('total_page', $paging->total_page);
Context::set('page', $paging->page);
Context::set('module_config_list', $paging->data);
Context::set('page_navigation', $paging->page_navigation);
}
function dispProfilerAdminTable()
{
// 삭제할 수 있는 테이블 목록
$oProfilerAdminModel = getAdminModel('profiler');
$arrange_table_list = $oProfilerAdminModel->getTableToBeArranged();
$paging = $oProfilerAdminModel->getPageNavigation($arrange_table_list, Context::get('page'));
$oDB = DB::getInstance();
$column_list = array();
switch($oDB->db_type)
{
case 'mysql':
case 'mysql_innodb':
case 'mysqli':
case 'mysqli_innodb':
$column_list = array('name', 'type', 'collation', 'rows', 'size', 'overhead', 'repair');
break;
case 'mssql':
$column_list = array('name', 'rows', 'size', 'overhead');
break;
case 'cubrid':
break;
}
// 템플릿 엔진으로 값 전달
Context::set('total_count', $paging->total_count);
Context::set('total_page', $paging->total_page);
Context::set('page', $paging->page);
Context::set('table_list', $paging->data);
Context::set('column_list', $column_list);
Context::set('page_navigation', $paging->page_navigation);
}
function dispProfilerAdminAddonConfig()
{
// 고급 삭제 옵션
$advanced = Context::get('advanced') === 'Y';
// 삭제할 수 있는 모듈 설정 목록
$oProfilerAdminModel = getAdminModel('profiler');
$invalid_addon_config = $oProfilerAdminModel->getAddonConfigToBeDeleted($advanced);
$paging = $oProfilerAdminModel->getPageNavigation($invalid_addon_config, Context::get('page'));
// 템플릿 엔진으로 값 전달
Context::set('total_count', $paging->total_count);
Context::set('total_page', $paging->total_page);
Context::set('page', $paging->page);
Context::set('addon_config_list', $paging->data);
Context::set('page_navigation', $paging->page_navigation);
}
}
/* End of file profiler.admin.view.php */
/* Location: ./modules/profiler/profiler.admin.view.php */