From dffdc9c2ee54db28c7dd4555fa0790a7910c97c1 Mon Sep 17 00:00:00 2001 From: Robert Anderson <randerson@lbsd.net> Date: Mon, 29 Jun 2009 10:55:13 +0000 Subject: [PATCH] Fixed eventtimestamp filter and column display Removed 'add port lock' button --- webgui/ajax.php | 2 +- .../include/ajax/functions/AdminUserLogs.php | 7 +++++- webgui/js/app/windows/AdminUserLogs.js | 24 +++++++------------ 3 files changed, 16 insertions(+), 17 deletions(-) diff --git a/webgui/ajax.php b/webgui/ajax.php index acc9632d..fb31692c 100644 --- a/webgui/ajax.php +++ b/webgui/ajax.php @@ -198,7 +198,7 @@ $res = new json_response; $res->setID('ID'); $res->addField('ID','int'); - $res->addField('EventTimestamp','int'); + $res->addField('EventTimestamp','string'); $res->addField('AcctStatusType','int'); $res->addField('ServiceType','int'); $res->addField('FramedProtocol','int'); diff --git a/webgui/include/ajax/functions/AdminUserLogs.php b/webgui/include/ajax/functions/AdminUserLogs.php index c8d5e288..f6b5beb0 100644 --- a/webgui/include/ajax/functions/AdminUserLogs.php +++ b/webgui/include/ajax/functions/AdminUserLogs.php @@ -83,7 +83,12 @@ function getAdminUserLogs($params) { $item = array(); $item['ID'] = $row->id; - $item['EventTimestamp'] = $row->eventtimestamp; + + # Convert to ISO format + $date = new DateTime($row->eventtimestamp); + $value = $date->format("Y-m-d H:i:s"); + $item['EventTimestamp'] = $value; + $item['AcctStatusType'] = $row->acctstatustype; $item['ServiceType'] = $row->servicetype; $item['FramedProtocol'] = $row->framedprotocol; diff --git a/webgui/js/app/windows/AdminUserLogs.js b/webgui/js/app/windows/AdminUserLogs.js index a694d591..80ddb054 100644 --- a/webgui/js/app/windows/AdminUserLogs.js +++ b/webgui/js/app/windows/AdminUserLogs.js @@ -27,7 +27,7 @@ function showAdminUserLogsWindow(id) { frame: true, defaultType: 'datefield', height: 180, - width: 300, + width: 320, labelWidth: 100, items: [ { @@ -35,17 +35,17 @@ function showAdminUserLogsWindow(id) { name: 'after', width: 180, fieldLabel: 'From', -// vtype: 'daterange', + vtype: 'daterange', format: 'Y-m-d', value: firstOfMonth, - endDateField: 'before', + endDateField: 'before' }, { id: 'before', name: 'before', width: 180, fieldLabel: 'To', -// vtype: 'daterange', + vtype: 'daterange', format: 'Y-m-d', value: firstOfNext, startDateField: 'after' @@ -101,8 +101,8 @@ function showAdminUserLogsWindow(id) { id: 'summaryTotal', name: 'summaryTotal', readOnly: true, - height: 135, - width: 200, + height: 139, + width: 275, fieldLabel: 'Summary', fieldClass: 'font-family: monospace; font-size: 10px;', value: '' @@ -116,13 +116,6 @@ function showAdminUserLogsWindow(id) { region: 'south', width: 700, border: true, - tbar: [ - { - text: 'Add Port Lock', - tooltip: 'Add port lock', - iconCls: 'add' - } - ], // Column model colModel: new Ext.grid.ColumnModel([ { @@ -206,14 +199,15 @@ function showAdminUserLogsWindow(id) { { filters: [ {type: 'numeric', dataIndex: 'ID'}, - /*{ + { type: 'date', + format: 'Y-m-d H:i:s', dataIndex: 'EventTimestamp', value: { after: firstOfMonth, before: firstOfNext } - },*/ + }, {type: 'numeric', dataIndex: 'AcctStatusType'}, {type: 'numeric', dataIndex: 'ServiceType'}, {type: 'numeric', dataIndex: 'FramedProtocol'}, -- GitLab