Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
smradius
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
shail
smradius
Commits
6dc26bc9
Commit
6dc26bc9
authored
15 years ago
by
Robert Anderson
Browse files
Options
Downloads
Patches
Plain Diff
WiSPUserLogs and related functions
parent
05c66cf0
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
webgui/ajax.php
+29
-0
29 additions, 0 deletions
webgui/ajax.php
webgui/js/app/windows/AdminUserLogs.js
+1
-1
1 addition, 1 deletion
webgui/js/app/windows/AdminUserLogs.js
webgui/js/app/windows/WiSPUserLogs.js
+2
-288
2 additions, 288 deletions
webgui/js/app/windows/WiSPUserLogs.js
with
32 additions
and
289 deletions
webgui/ajax.php
+
29
−
0
View file @
6dc26bc9
...
...
@@ -189,6 +189,35 @@
break
;
# WiSPUserLogs.js functions
case
"getWiSPUserLogs"
:
$res
=
getWiSPUserLogs
(
$soapParams
);
$rawData
=
$res
[
0
];
$numResults
=
$res
[
1
];
$res
=
new
json_response
;
$res
->
setID
(
'ID'
);
$res
->
addField
(
'ID'
,
'int'
);
$res
->
addField
(
'EventTimestamp'
,
'int'
);
$res
->
addField
(
'AcctStatusType'
,
'int'
);
$res
->
addField
(
'ServiceType'
,
'int'
);
$res
->
addField
(
'FramedProtocol'
,
'int'
);
$res
->
addField
(
'NASPortType'
,
'int'
);
$res
->
addField
(
'NASPortID'
,
'string'
);
$res
->
addField
(
'CallingStationID'
,
'string'
);
$res
->
addField
(
'CalledStationID'
,
'string'
);
$res
->
addField
(
'AcctSessionID'
,
'string'
);
$res
->
addField
(
'FramedIPAddress'
,
'string'
);
$res
->
addField
(
'AcctInputMbyte'
,
'int'
);
$res
->
addField
(
'AcctOutputMbyte'
,
'int'
);
$res
->
addField
(
'ConnectTermReason'
,
'string'
);
$res
->
parseArray
(
$rawData
);
$res
->
setDatasetSize
(
$numResults
);
echo
json_encode
(
$res
->
export
());
break
;
# AdminUserLogs.js functions
case
"getAdminUserLogs"
:
...
...
This diff is collapsed.
Click to expand it.
webgui/js/app/windows/AdminUserLogs.js
+
1
−
1
View file @
6dc26bc9
...
...
@@ -5,7 +5,7 @@ function showAdminUserLogsWindow(id) {
var
today
=
new
Date
();
var
firstOfMonth
=
today
.
getFirstDateOfMonth
();
var
firstOfNext
=
today
.
getLastDateOfMonth
().
add
(
Date
.
DAY
,
1
);
var
adminUserLogsWindow
=
new
Ext
.
ux
.
GenericGridWindow
(
// Window config
{
...
...
This diff is collapsed.
Click to expand it.
webgui/js/app/windows/WiSPUserLogs.js
+
2
−
288
View file @
6dc26bc9
function
showWiSPUserLogsWindow
(
wispUserID
)
{
// Calculate dates we going to need
/*
var today = new Date();
var firstOfMonth = today.getFirstDateOfMonth();
var firstOfNext = today.getLastDateOfMonth().add(Date.DAY, 1);
*/
var
wispUserLogsWindow
=
new
Ext
.
ux
.
GenericGridWindow
(
// Window config
{
title
:
'
User Logs
'
,
layout
:
'
border
'
,
height
:
480
,
width
:
700
,
minHeight
:
480
,
minWidth
:
700
,
closable
:
true
,
plain
:
true
,
uxItems
:
[
{
xtype
:
'
form
'
,
id
:
'
search-form
'
,
title
:
'
Search
'
,
region
:
'
west
'
,
border
:
true
,
frame
:
true
,
defaultType
:
'
datefield
'
,
height
:
180
,
width
:
300
,
labelWidth
:
100
,
items
:
[
{
id
:
'
after
'
,
name
:
'
after
'
,
width
:
180
,
fieldLabel
:
'
From
'
,
// vtype: 'daterange',
format
:
'
Y-m-d
'
,
// value: firstOfMonth,
// endDateField: 'before',
},
{
id
:
'
before
'
,
name
:
'
before
'
,
width
:
180
,
fieldLabel
:
'
To
'
,
// vtype: 'daterange',
format
:
'
Y-m-d
'
,
// value: firstOfNext,
// startDateField: 'after'
}
],
buttons
:
[
{
text
:
'
Search
'
,
id
:
'
formbtn
'
,
handler
:
function
()
{
// Pull in window, grid & form
var
mainWindow
=
this
.
ownerCt
.
ownerCt
;
var
grid
=
mainWindow
.
getComponent
(
'
gridpanel
'
);
var
form
=
mainWindow
.
getComponent
(
'
search-form
'
);
// Grab store
var
store
=
grid
.
getStore
();
// Grab timestamp filter
var
gridFilters
=
grid
.
filters
;
var
timestampFilter
=
gridFilters
.
getFilter
(
'
Timestamp
'
);
// Grab form fields
var
afterField
=
form
.
getForm
().
findField
(
'
after
'
);
var
beforeField
=
form
.
getForm
().
findField
(
'
before
'
);
// Set filter values from form
timestampFilter
.
setValue
({
after
:
afterField
.
getValue
(),
before
:
beforeField
.
getValue
()
});
// Trigger store reload
store
.
reload
();
}
}
],
buttonAlign
:
'
center
'
},
{
xtype
:
'
form
'
,
id
:
'
summary-form
'
,
region
:
'
center
'
,
split
:
true
,
border
:
true
,
autoScroll
:
true
,
defaultType
:
'
textarea
'
,
height
:
180
,
width
:
400
,
labelWidth
:
80
,
items
:
[
{
id
:
'
summaryTotal
'
,
name
:
'
summaryTotal
'
,
readOnly
:
true
,
height
:
135
,
width
:
200
,
fieldLabel
:
'
Summary
'
,
fieldClass
:
'
font-family: monospace; font-size: 10px;
'
,
value
:
''
}
]
}
]
},
// Grid config
{
region
:
'
south
'
,
width
:
700
,
border
:
true
,
tbar
:
[
{
text
:
'
Add Port Lock
'
,
tooltip
:
'
Add port lock
'
,
iconCls
:
'
add
'
}
],
// Column model
colModel
:
new
Ext
.
grid
.
ColumnModel
([
{
id
:
'
ID
'
,
header
:
"
ID
"
,
hidden
:
true
,
dataIndex
:
'
ID
'
},
{
header
:
"
Username
"
,
hidden
:
true
,
dataIndex
:
'
Username
'
},
{
header
:
"
Status
"
,
sortable
:
true
,
hidden
:
true
,
dataIndex
:
'
Status
'
},
{
header
:
"
Timestamp
"
,
sortable
:
true
,
dataIndex
:
'
Timestamp
'
},
{
header
:
"
Session ID
"
,
hidden
:
true
,
dataIndex
:
'
AcctSessionID
'
},
{
header
:
"
Session Time
"
,
dataIndex
:
'
AcctSessionTime
'
},
{
header
:
"
NAS IP
"
,
hidden
:
true
,
dataIndex
:
'
NASIPAddress
'
},
{
header
:
"
Port Type
"
,
hidden
:
true
,
dataIndex
:
'
NASPortType
'
},
{
header
:
"
NAS Port
"
,
dataIndex
:
'
NASPort
'
},
{
header
:
"
Called Station
"
,
hidden
:
true
,
dataIndex
:
'
CalledStationID
'
},
{
header
:
"
Calling Station
"
,
sortable
:
true
,
dataIndex
:
'
CallingStationID
'
},
{
header
:
"
NAS Xmit Rate
"
,
dataIndex
:
'
NASTransmitRate
'
},
{
header
:
"
NAS Recv Rate
"
,
hidden
:
true
,
dataIndex
:
'
NASReceiveRate
'
},
{
header
:
"
IP Address
"
,
hidden
:
true
,
dataIndex
:
'
FramedIPAddress
'
},
{
header
:
"
Input Mbyte
"
,
dataIndex
:
'
AcctInputMbyte
'
},
{
header
:
"
Output Mbyte
"
,
dataIndex
:
'
AcctOutputMbyte
'
},
{
header
:
"
Last Update
"
,
hidden
:
true
,
dataIndex
:
'
LastAcctUpdate
'
},
{
header
:
"
Term. Reason
"
,
dataIndex
:
'
ConnectTermReason
'
}
])
},
// Store config
{
baseParams
:
{
SOAPUsername
:
globalConfig
.
soap
.
username
,
SOAPPassword
:
globalConfig
.
soap
.
password
,
SOAPAuthType
:
globalConfig
.
soap
.
authtype
,
SOAPModule
:
'
WiSPUsers
'
,
SOAPFunction
:
'
getWiSPUserLogs
'
,
SOAPParams
:
'
0:UserID,__search
'
,
UserID
:
wispUserID
}
},
// Filter config
{
filters
:
[
{
type
:
'
numeric
'
,
dataIndex
:
'
ID
'
},
{
type
:
'
string
'
,
dataIndex
:
'
Username
'
},
{
type
:
'
numeric
'
,
dataIndex
:
'
Status
'
},
/*
{
type: 'date',
dataIndex: 'Timestamp',
value: {
after: firstOfMonth,
before: firstOfNext
}
},
*/
{
type
:
'
string
'
,
dataIndex
:
'
AcctSessionID
'
},
{
type
:
'
numeric
'
,
dataIndex
:
'
AcctSessionTime
'
},
{
type
:
'
string
'
,
dataIndex
:
'
NASIPAddress
'
},
{
type
:
'
string
'
,
dataIndex
:
'
NASPortType
'
},
{
type
:
'
string
'
,
dataIndex
:
'
NASPort
'
},
{
type
:
'
string
'
,
dataIndex
:
'
CalledStationID
'
},
{
type
:
'
string
'
,
dataIndex
:
'
CallingStationID
'
},
{
type
:
'
string
'
,
dataIndex
:
'
NASTransmitRate
'
},
{
type
:
'
string
'
,
dataIndex
:
'
NASReceiveRate
'
},
{
type
:
'
string
'
,
dataIndex
:
'
FramedIPAddress
'
},
{
type
:
'
date
'
,
dataIndex
:
'
LastAcctUpdate
'
},
{
type
:
'
string
'
,
dataIndex
:
'
ConnectTermReason
'
}
]
}
);
// Grab store
var
store
=
wispUserLogsWindow
.
getComponent
(
'
gridpanel
'
).
getStore
();
store
.
on
(
'
load
'
,
function
()
{
var
inputTotal
=
store
.
sum
(
'
AcctInputMbyte
'
);
var
outputTotal
=
store
.
sum
(
'
AcctOutputMbyte
'
);
var
userCap
=
3000
;
var
userTopups
=
1000
;
// Total up into this ...
var
userTotalAllowed
=
userCap
+
userTopups
;
var
userUsage
=
inputTotal
+
outputTotal
;
var
userLeft
=
userTotalAllowed
-
userUsage
;
var
form
=
wispUserLogsWindow
.
getComponent
(
'
summary-form
'
);
var
summaryTotal
=
form
.
getForm
().
findField
(
'
summaryTotal
'
);
summaryTotal
.
setValue
(
sprintf
(
'
Cap Total: %6d
\n
Topups : %6d
\n
-----------------
\n
%6d
\n
-----------------
\n
Usage : %6d
\n
=================
\n
Available: %6d
'
,
userCap
,
userTopups
,
userTotalAllowed
,
userUsage
,
userLeft
)
);
});
wispUserLogsWindow
.
show
();
function
showWiSPUserLogsWindow
(
id
)
{
showAdminUserLogsWindow
(
id
);
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment