Log.js
1.14 KB
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
Ext.define('App.controller.Log', {
extend : 'Ext.app.Controller',
init : function() {
this.control({
'toolbar button[action=loadLog]' : {
click : this.onLoadLog
}
});
},
onLoadLog :function (btn, e, options) {
var form = Ext.getCmp('formlog');
if (form!=null) {
Ext.Ajax.request({
method: "GET",
url: 'api/log/show',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
success: function(response, opts) {
var result = Ext.JSON.decode(response.responseText);
var str="";
for(var i in result){
str=str+result[i]+"\n";
}
Ext.getCmp('logResult').setValue(str);
form.unmask();
}, failure: function(response, opts) {
form.unmask();
Ext.Msg.alert('Failure', 'Ошибка связи с сервером');
}
});
}
}
});