Skip to content
Snippets Groups Projects
Commit 8429ba08 authored by Robert Anderson's avatar Robert Anderson
Browse files

Initial support for AdminUser Logs

parent 54c69cc8
No related branches found
No related tags found
No related merge requests found
function showWiSPUserLogsWindow(wispUserID) { function showAdminUserLogsWindow(id) {
// Calculate dates we going to need // Calculate dates we going to need
var today = new Date(); var today = new Date();
var firstOfMonth = today.getFirstDateOfMonth(); var firstOfMonth = today.getFirstDateOfMonth();
var firstOfNext = today.getLastDateOfMonth().add(Date.DAY, 1); var firstOfNext = today.getLastDateOfMonth().add(Date.DAY, 1);
var wispUserLogsWindow = new Ext.ux.GenericGridWindow( var adminUserLogsWindow = new Ext.ux.GenericGridWindow(
// Window config // Window config
{ {
title: 'User Logs', title: 'User Logs',
...@@ -126,54 +126,39 @@ function showWiSPUserLogsWindow(wispUserID) { ...@@ -126,54 +126,39 @@ function showWiSPUserLogsWindow(wispUserID) {
// Column model // Column model
colModel: new Ext.grid.ColumnModel([ colModel: new Ext.grid.ColumnModel([
{ {
id: 'ID', header: "Timestamp",
header: "ID", sortable: true,
hidden: true, dataIndex: 'EventTimestamp'
dataIndex: 'ID'
},
{
header: "Username",
hidden: true,
dataIndex: 'Username'
}, },
{ {
header: "Status", header: "Status",
sortable: true, sortable: true,
hidden: true, dataIndex: 'AcctStatusType'
dataIndex: 'Status'
}, },
{ {
header: "Timestamp", header: "Service Type",
sortable: true, sortable: true,
dataIndex: 'Timestamp' dataIndex: 'ServiceType'
}, },
{ {
header: "Session ID", header: "Framed Protocol",
hidden: true, sortable: true,
dataIndex: 'AcctSessionID' dataIndex: 'FramedProtocol'
},
{
header: "Session Time",
dataIndex: 'AcctSessionTime'
}, },
{ {
header: "NAS IP", header: "NAS Port",
hidden: true, sortable: true,
dataIndex: 'NASIPAddress' dataIndex: 'NASPort'
}, },
{ {
header: "Port Type", header: "NAS Port Type",
hidden: true, sortable: true,
dataIndex: 'NASPortType' dataIndex: 'NASPortType'
}, },
{ {
header: "NAS Port", header: "NAS Port ID",
dataIndex: 'NASPort' sortable: true,
}, dataIndex: 'NASPortID'
{
header: "Called Station",
hidden: true,
dataIndex: 'CalledStationID'
}, },
{ {
header: "Calling Station", header: "Calling Station",
...@@ -181,19 +166,20 @@ function showWiSPUserLogsWindow(wispUserID) { ...@@ -181,19 +166,20 @@ function showWiSPUserLogsWindow(wispUserID) {
dataIndex: 'CallingStationID' dataIndex: 'CallingStationID'
}, },
{ {
header: "NAS Xmit Rate", header: "Called Station",
dataIndex: 'NASTransmitRate' sortable: true,
dataIndex: 'CalledStationID'
}, },
{ {
header: "NAS Recv Rate", header: "Session ID",
hidden: true, sortable: true,
dataIndex: 'NASReceiveRate' dataIndex: 'AcctSessionID'
}, },
{ {
header: "IP Address", header: "Framed IP",
hidden: true, sortable: true,
dataIndex: 'FramedIPAddress' dataIndex: 'FramedIPAddress'
}, }/*,
{ {
header: "Input Mbyte", header: "Input Mbyte",
dataIndex: 'AcctInputMbyte' dataIndex: 'AcctInputMbyte'
...@@ -202,35 +188,27 @@ function showWiSPUserLogsWindow(wispUserID) { ...@@ -202,35 +188,27 @@ function showWiSPUserLogsWindow(wispUserID) {
header: "Output Mbyte", header: "Output Mbyte",
dataIndex: 'AcctOutputMbyte' dataIndex: 'AcctOutputMbyte'
}, },
{
header: "Last Update",
hidden: true,
dataIndex: 'LastAcctUpdate'
},
{ {
header: "Term. Reason", header: "Term. Reason",
dataIndex: 'ConnectTermReason' dataIndex: 'ConnectTermReason'
} }*/
]) ])
}, },
// Store config // Store config
{ {
baseParams: { baseParams: {
ID: id,
SOAPUsername: globalConfig.soap.username, SOAPUsername: globalConfig.soap.username,
SOAPPassword: globalConfig.soap.password, SOAPPassword: globalConfig.soap.password,
SOAPAuthType: globalConfig.soap.authtype, SOAPAuthType: globalConfig.soap.authtype,
SOAPModule: 'WiSPUsers', SOAPModule: 'AdminUserLogs',
SOAPFunction: 'getWiSPUserLogs', SOAPFunction: 'getAdminUserLogs',
SOAPParams: '0:UserID,__search', SOAPParams: 'ID,__search'
UserID: wispUserID
} }
}, },
// Filter config // Filter config
{ {
filters: [ filters: [
{type: 'numeric', dataIndex: 'ID'},
{type: 'string', dataIndex: 'Username'},
{type: 'numeric', dataIndex: 'Status'},
{ {
type: 'date', type: 'date',
dataIndex: 'Timestamp', dataIndex: 'Timestamp',
...@@ -239,29 +217,21 @@ function showWiSPUserLogsWindow(wispUserID) { ...@@ -239,29 +217,21 @@ function showWiSPUserLogsWindow(wispUserID) {
before: firstOfNext before: firstOfNext
} }
}, },
{type: 'numeric', dataIndex: 'AcctStatusType'},
{type: 'string', dataIndex: 'AcctSessionID'}, {type: 'numeric', dataIndex: 'ServiceType'},
{type: 'numeric', dataIndex: 'AcctSessionTime'}, {type: 'numeric', dataIndex: 'FramedProtocol'},
{type: 'string', dataIndex: 'NASIPAddress'},
{type: 'string', dataIndex: 'NASPortType'},
{type: 'string', dataIndex: 'NASPort'}, {type: 'string', dataIndex: 'NASPort'},
{type: 'string', dataIndex: 'CalledStationID'}, {type: 'numeric', dataIndex: 'NASPortType'},
{type: 'string', dataIndex: 'NASPortID'},
{type: 'string', dataIndex: 'CallingStationID'}, {type: 'string', dataIndex: 'CallingStationID'},
{type: 'string', dataIndex: 'CalledStationID'},
{type: 'string', dataIndex: 'NASTransmitRate'}, {type: 'string', dataIndex: 'AcctSessionID'},
{type: 'string', dataIndex: 'NASReceiveRate'}, {type: 'string', dataIndex: 'FramedIPAddress'}
{type: 'string', dataIndex: 'FramedIPAddress'},
{type: 'date', dataIndex: 'LastAcctUpdate'},
{type: 'string', dataIndex: 'ConnectTermReason'}
] ]
} }
); );
// Grab store // Grab store
var store = wispUserLogsWindow.getComponent('gridpanel').getStore(); var store = adminUserLogsWindow.getComponent('gridpanel').getStore();
store.on('load',function() { store.on('load',function() {
var inputTotal = store.sum('AcctInputMbyte'); var inputTotal = store.sum('AcctInputMbyte');
...@@ -276,12 +246,12 @@ function showWiSPUserLogsWindow(wispUserID) { ...@@ -276,12 +246,12 @@ function showWiSPUserLogsWindow(wispUserID) {
var userUsage = inputTotal + outputTotal; var userUsage = inputTotal + outputTotal;
var userLeft = userTotalAllowed - userUsage; var userLeft = userTotalAllowed - userUsage;
var form = wispUserLogsWindow.getComponent('summary-form'); var form = adminUserLogsWindow.getComponent('summary-form');
var summaryTotal = form.getForm().findField('summaryTotal'); var summaryTotal = form.getForm().findField('summaryTotal');
summaryTotal.setValue( summaryTotal.setValue(
sprintf('Cap Total: %6d\nTopups : %6d\n-----------------\n %6d\n-----------------\nUsage : %6d\n=================\nAvailable: %6d',userCap,userTopups,userTotalAllowed,userUsage,userLeft) sprintf('Cap Total: %6d\nTopups : %6d\n-----------------\n %6d\n-----------------\nUsage : %6d\n=================\nAvailable: %6d',userCap,userTopups,userTotalAllowed,userUsage,userLeft)
); );
}); });
wispUserLogsWindow.show(); adminUserLogsWindow.show();
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment