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
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
<?xml version="1.0" encoding="UTF-8"?>
<a:screen xmlns:a="http://www.leaf-framework.org/application">
<a:init-procedure/>
<a:view package="leaf.ui.std" template="default">
<a:link id="sys_log_show_all_trace_flag_link" url="${/request/@context_path}/modules/sys/SYS1009/sys_log_show_all_trace_flag.lsc"/>
<a:link id="sys_log_cancel_all_trace_flag_link" url="${/request/@context_path}/modules/sys/SYS1009/sys_log_cancel_all_trace_flag.lsc"/>
<a:link id="sys_log_set_all_trace_flag_link" url="${/request/@context_path}/modules/sys/SYS1009/sys_log_set_all_trace_flag.lsc"/>
<script type="text/javascript"><![CDATA[
function onCheckBoxChange(checkbox, newValue, oldValue) {
var record = $('log_status').getCurrentRecord();
var url = record.get('service_name');
if (!url) {
Leaf.showErrorMessage('${l:PROMPT.ERROR}', '${l:PROMPT.URL_CAN_NOT_BE_NULL}')
return false;
}
if ('Y' == newValue) {
enableTrace(url);
} else {
diableTrace(url);
}
}
function enableTrace(url) {
setTrace(url, 'true');
}
function diableTrace(url) {
setTrace(url, 'false');
}
function setTrace(url, flag) {
var parameters = {
"url": url,
"flag": flag
};
Leaf.request({
url: '${/request/@context_path}/set_trace_flag.lsc',
para: parameters,
success: function() {
Leaf.showMessage('${l:PROMPT}', '${l:PROMPT.OPERATION_SUCCESS}');
},
scope: this
});
}
function showTraceFlag(url) {
var record = $('log_status').getCurrentRecord();
var parameters = {
"url": url
};
Leaf.request({
url: '${/request/@context_path}/show_trace_flag.lsc',
para: parameters,
success: function(res) {
var status = res.result['status'];
if (true == status) {
record.set('status', 'Y');
} else {
record.set('status', 'N');
}
},
scope: this
});
}
function onUpdate(ds, record, name, value) {
if (name == 'service_name') {
showTraceFlag(value);
}
}
function enableAllonUpdate(checkbox, newValue, oldValue) {
var flag = 'false';
if ('Y' == newValue) {
flag = 'true';
}
Leaf.request({
url: /*sys_log_set_all_trace_flag.svc*/$('sys_log_set_all_trace_flag_link').getUrl(),
para: {
"flag": flag
},
success: function() {
Leaf.showMessage('${l:PROMPT}', '${l:PROMPT.OPERATION_SUCCESS}');
},
scope: this
});
}
function cancel_all_trace_flag(d, ds) {
Leaf.request({
url: /*sys_log_cancel_all_trace_flag.svc*/$('sys_log_cancel_all_trace_flag_link').getUrl(),
para: {},
success: function() {
Leaf.showMessage('${l:PROMPT}', '${l:PROMPT.OPERATION_SUCCESS}');
},
scope: this
});
}
function queryRecipientType() {
$('function_tree_ds').query();
}
function save() {
$('function_tree_ds').submit();
}]]></script>
<a:dataSets>
<a:dataSet id="log_status">
<a:datas>
<a:record service_name="" status="false"/>
</a:datas>
<a:events>
<a:event name="update" handler="onUpdate"/>
</a:events>
</a:dataSet>
<a:dataSet id="enabled_all_dataset" autoCreate="true">
<a:datas>
<a:record flag="N"/>
</a:datas>
</a:dataSet>
<a:dataSet id="parameter_static_ds" autoCreate="true">
<a:datas>
<a:record base_dir="" file_ext="screen"/>
<a:record base_dir="" file_ext="svc"/>
<a:record base_dir="web-inf/classes" file_ext="bm"/>
</a:datas>
</a:dataSet>
<a:dataSet id="parameter_ds" autoCreate="true">
<a:fields>
<a:field name="file_ext" displayField="file_ext" options="parameter_static_ds" valueField="file_ext">
<a:mapping>
<a:map from="file_ext" to="file_ext"/>
<a:map from="base_dir" to="base_dir"/>
</a:mapping>
</a:field>
<a:field name="base_dir" readOnly="true"/>
</a:fields>
</a:dataSet>
<a:dataSet id="function_tree_ds" autoCount="false" fetchAll="true" queryDataSet="parameter_ds" queryUrl="${/request/@context_path}/modules/sys_menu_hiding_flag/SYS1009/sys_log_get_config.lsc" submitUrl="${/request/@context_path}/modules/sys_menu_hiding_flag/SYS1009/sys_log_set_config.lsc">
<a:fields>
<a:field name="trace_flag" checkedValue="Y" uncheckedValue="N"/>
<a:field name="base_dir" readOnly="true"/>
<a:field name="name" readOnly="true"/>
<a:field name="path" readOnly="true"/>
<a:field name="parent" readOnly="true"/>
<a:field name="parent_path" readOnly="true"/>
</a:fields>
</a:dataSet>
</a:dataSets>
<script type="text/javascript"><![CDATA[
function init() {
Leaf.request({
url: /*sys_log_show_all_trace_flag.svc*/$('sys_log_show_all_trace_flag_link').getUrl(),
para: {},
success: function(res) {
var status = res.result['status'];
if (true == status) {
$('enabled_all_dataset').getCurrentRecord().set('flag', 'Y');
}
},
scope: this
});
}
init();]]></script>
<a:screenBody>
<a:tabPanel id="tabpanel" height="580" marginHeight="50" width="960">
<a:tabs>
<a:tab prompt="PROMPT.SYSTEM">
<a:form row="2" title="L.LOG" width="600">
<a:hBox>
<a:textField name="service_name" bindTarget="log_status" prompt="PROMPT.URL" width="390"/>
<a:checkBox name="status" bindTarget="log_status" prompt="PROMPT.ENABLED_FLAG">
<a:events>
<a:event name="change" handler="onCheckBoxChange"/>
</a:events>
</a:checkBox>
</a:hBox>
<a:hBox labelWidth="120">
<a:checkBox name="flag" bindTarget="enabled_all_dataset" checkedValue="Y" prompt="SYSTEM_LOG.ENABLED_ALL_RESOURCE" uncheckedValue="N">
<a:events>
<a:event name="change" handler="enableAllonUpdate"/>
</a:events>
</a:checkBox>
</a:hBox>
</a:form>
</a:tab>
<a:tab prompt="PROMPT.DETAIL">
<a:form column="2" labelWidth="100" title="PROMPT.DETAIL" width="600">
<a:comboBox name="file_ext" bindTarget="parameter_ds" prompt="PROMPT.FILE_TYPE"/>
<a:textField name="base_dir" bindTarget="parameter_ds" prompt="PROMPT.DIRECTORY"/>
</a:form>
<a:hBox>
<a:button click="queryRecipientType" text="HLS.QUERY"/>
<a:button click="save" text="HLS.SAVE"/>
<a:button click="cancel_all_trace_flag" text="SYSTEM_LOG.CLEAR_ALL_RESOURCE_FLAG"/>
</a:hBox>
<a:treeGrid id="functionTreeGrid" bindTarget="function_tree_ds" expandField="_expanded" height="400" idField="path" parentField="parent_path" sequenceField="path" showCheckBox="true" width="800">
<a:columns>
<a:column name="name" prompt="PROMPT.URL" width="600"/>
<a:column name="trace_flag" align="right" editor="grid_cb" prompt="PROMPT.ENABLED_FLAG" width="100"/>
</a:columns>
<a:editors>
<a:numberField id="grid_nf"/>
<a:checkBox id="grid_cb"/>
</a:editors>
</a:treeGrid>
</a:tab>
</a:tabs>
</a:tabPanel>
</a:screenBody>
</a:view>
</a:screen>