Skip to content

Commit be0cb79

Browse files
improve siptrace
1 parent ddb3749 commit be0cb79

File tree

7 files changed

+860
-290
lines changed

7 files changed

+860
-290
lines changed

classic/src/view/sipTrace/Controller.js

Lines changed: 37 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,50 +21,77 @@
2121
Ext.define('MBilling.view.sipTrace.Controller', {
2222
extend: 'Ext.ux.app.ViewController',
2323
alias: 'controller.siptrace',
24-
onNewFilter: function(btn) {
24+
onNewFilter: function (btn) {
2525
var me = this,
2626
module = me.getView();
2727
Ext.widget('siptracefilter', {
2828
title: 'SipTrace',
2929
list: me.list
3030
});
3131
},
32-
onDeleteLog: function(btn) {
32+
onDeleteLog: function (btn) {
3333
var me = this;
34-
Ext.Msg.confirm(me.titleConfirmation, t('Confirm delete all log file?'), function(btn) {
34+
Ext.Msg.confirm(me.titleConfirmation, t('Confirm delete all log file?'), function (btn) {
3535
if (btn === 'yes') {
3636
Ext.Ajax.request({
3737
url: 'index.php/sipTrace/destroy',
3838
scope: me,
39-
success: function(response) {
39+
success: function (response) {
4040
Ext.ux.Alert.alert(me.titleSuccess, t('Success: The SipTrace file was deleted'), 'success');
4141
me.store.load();
4242
}
4343
});
4444
}
4545
});
4646
},
47-
onClearAll: function(btn) {
47+
onClearAll: function (btn) {
4848
var me = this;
4949
Ext.Ajax.request({
5050
url: 'index.php/sipTrace/clearAll',
5151
scope: me,
52-
success: function(response) {
52+
success: function (response) {
5353
Ext.ux.Alert.alert(me.titleSuccess, t('Success'), 'success');
5454
me.store.load();
5555
}
5656
});
5757
},
58-
onExportPcap: function(btn) {
58+
onExportPcap: function (btn) {
5959
var me = this;
6060
window.open('index.php/sipTrace/export');
6161
},
62-
onDetails: function(btn) {
62+
onDetails: function (btn) {
6363
var me = this,
6464
callids = [];
65-
Ext.each(me.list.getSelectionModel().getSelection(), function(record) {
65+
66+
Ext.each(me.list.getSelectionModel().getSelection(), function (record) {
6667
callids.push(record.get('callid'));
6768
});
68-
window.open('index.php/sipTrace/details?callid=' + Ext.encode(callids));
69+
70+
if (callids.length === 0) {
71+
Ext.ux.Alert.alert(me.titleSuccess, t('No records selected.'), 'error');
72+
return;
73+
}
74+
75+
if (callids.length > 3) {
76+
Ext.ux.Alert.alert(me.titleSuccess, t('Select a maximum of 3 records to view.'), 'error');
77+
return;
78+
}
79+
80+
Ext.create('Ext.window.Window', {
81+
title: t('SIPTRACE Details'),
82+
width: Ext.Element.getViewportWidth() * 0.9,
83+
height: Ext.Element.getViewportHeight() * 0.9,
84+
modal: true,
85+
layout: 'fit',
86+
items: [{
87+
xtype: 'component',
88+
autoEl: {
89+
tag: 'iframe',
90+
src: 'index.php/sipTrace/details?callid=' + encodeURIComponent(Ext.encode(callids)),
91+
style: 'border: none; width: 100%; height: 100%;'
92+
}
93+
}]
94+
}).show();
6995
}
96+
7097
});

classic/src/view/sipTrace/List.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Ext.define('MBilling.view.sipTrace.List', {
2323
requires: ['MBilling.view.sipTrace.Filter'],
2424
alias: 'widget.siptracelist',
2525
store: 'SipTrace',
26-
initComponent: function() {
26+
initComponent: function () {
2727
var me = this;
2828
me.buttonImportCsv = false
2929
me.buttonCsv = false;
@@ -81,15 +81,15 @@ Ext.define('MBilling.view.sipTrace.List', {
8181
}, {
8282
header: t('Source'),
8383
dataIndex: 'fromip',
84-
renderer: function(value) {
84+
renderer: function (value) {
8585
value = value == window.myIP ? '<b><font color="blue">' + value + '</font></b>' : value;
8686
return value
8787
},
8888
flex: 3
8989
}, {
9090
header: t('Destination'),
9191
dataIndex: 'toip',
92-
renderer: function(value) {
92+
renderer: function (value) {
9393
value = value == window.myIP ? '<b><font color="blue">' + value + '</font></b>' : value;
9494
return value
9595
},

protected/commands/update.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ chown -R asterisk:asterisk /var/www/html/mbilling/tmp
7575
chown -R asterisk:asterisk /var/run/magnus/
7676
chown -R root:root /root
7777
chown -R mysql:mysql /var/lib/mysql
78-
chmod -R 777 /tmp
78+
chmod -R 1777 /tmp
7979
chmod -R 755 /usr/local/src/magnus
8080
chmod -R 555 /var/www/html/mbilling/
8181
chmod -R 700 /var/www/html/mbilling/resources/reports

0 commit comments

Comments
 (0)