Skip to content

Commit

Permalink
Merge pull request #54 from psteiwer/dev-eventviewer
Browse files Browse the repository at this point in the history
Dev eventviewer
  • Loading branch information
psteiwer authored Feb 25, 2020
2 parents 0e69066 + 0c5af22 commit 0f40b79
Show file tree
Hide file tree
Showing 3 changed files with 100 additions and 38 deletions.
5 changes: 5 additions & 0 deletions PivotSubscriptions/EventLog.cls
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ ClassMethod LogEvent(pType, pUser, pPivot, pDayOfWeek, pHour, pMinute, pFormat,
Set tEventLog.Format=pFormat
Set tEventLog.Emails=pEmails

If pType="tableError" {
Set tEventLog.Status=$$$OK
Set tEventLog.EndTime=$zdt($h,3,1)
}

Set tSC=tEventLog.%Save()
Set pEvent=tEventLog

Expand Down
53 changes: 53 additions & 0 deletions PivotSubscriptions/UI/EventLogViewer.cls
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
Class PivotSubscriptions.UI.EventLogViewer Extends PivotSubscriptions.UI.Template
{

/// Displayed name of this page.
Parameter PAGENAME = "Event Log Viewer";

/// This XML block defines the contents of this pane.
XData contentPane [ XMLNamespace = "http://www.intersystems.com/zen" ]
{
<pane xmlns="http://www.intersystems.com/zen">
<hgroup valign="top" >
<spacer width="20" />
<vgroup valign="top" >
<spacer height="20" />
<tableNavigatorBar id="tableNavigator" tablePaneId="tablePane" showPageSize="true" />
<tablePane id="tablePane"
cellSpacing="2"
fixedHeaders="false"
queryClass="PivotSubscriptions.UI.EventLogViewer"
queryName="GetEvents"
useSnapshot="true"
showQuery="false"
showZebra="true"
showRowNumbers="false"
pageSize="100"
maxRows="1000"
>
</tablePane>
</vgroup>
</hgroup>
</pane>
}

/// Get the (localized) title string for the page.
Method %OnGetTitle() As %String [ Internal ]
{
Quit $$$Text("Event Log Viewer","PivotSubscriptions")
}

/// Get the (localized) name of the page.
Method %OnGetPageName() As %String [ Internal ]
{
Quit $$$Text("Event Log Viewer","PivotSubscriptions")
}

Query GetEvents() As %SQLQuery
{
SELECT StartTime,EndTime,EventType,Name,Pivot,UserName,DayOfWeek,Format,"Hour","Minute",Emails,Status
FROM PivotSubscriptions.EventLog
ORDER BY ID DESC
}

}
80 changes: 42 additions & 38 deletions PivotSubscriptions/UI/Template.cls
Original file line number Diff line number Diff line change
@@ -1,38 +1,42 @@
Class PivotSubscriptions.UI.Template Extends %DeepSee.UI.standardPage
{

Parameter DOMAIN = "PivotSubscriptions";

/// Get information to display in the ribbon bar.
Method OnGetRibbonInfo(Output pDisplay As %Boolean, Output pViewIcons As %List, Output pSortOptions As %List, Output pSearchBox As %Boolean, Output pRibbonTitle As %String, Output pCommands As %List) As %Status
{
Set pDisplay=1
Set pSearchBox=0
Set pRibbonTitle=$$$Text(..#PAGENAME)

Set pCommands($I(pCommands))=$LB("subscriptionManager",$$$Text("Subscription Manager"),$$$Text("Manage Pivot Subscriptions"),"zenPage.navigate('subscriptionManager');")
Set pCommands($I(pCommands))=$LB("pivotList",$$$Text("Pivot List"),$$$Text("View All Pivot Tables"),"zenPage.navigate('pivotList');")
Set pCommands($I(pCommands))=$LB("configurationPage",$$$Text("Configuration Page"),$$$Text("Configure Settings"),"zenPage.navigate('configurationPage');")

Quit $$$OK
}

ClientMethod navigate(pageName) [ Language = javascript ]
{
var location=""
if (pageName=='subscriptionManager') {
location="./PivotSubscriptions.UI.SubscriptionManager.zen"
} else if (pageName=='pivotList') {
location="./PivotSubscriptions.UI.PivotList.zen"
} else if (pageName=='configurationPage') {
location="./PivotSubscriptions.UI.ConfigurationPage.zen"
} else {
// Invalid page name
}

if (location!="") {
window.location.href=location;
}
}

}
Class PivotSubscriptions.UI.Template Extends %DeepSee.UI.standardPage
{

Parameter DOMAIN = "PivotSubscriptions";

/// Get information to display in the ribbon bar.
Method OnGetRibbonInfo(Output pDisplay As %Boolean, Output pViewIcons As %List, Output pSortOptions As %List, Output pSearchBox As %Boolean, Output pRibbonTitle As %String, Output pCommands As %List) As %Status
{
Set pDisplay=1
Set pSearchBox=0
Set pRibbonTitle=$$$Text(..#PAGENAME)

Set pCommands($I(pCommands))=$LB("subscriptionManager",$$$Text("Subscription Manager"),$$$Text("Manage Pivot Subscriptions"),"zenPage.navigate('subscriptionManager');")
Set pCommands($I(pCommands))=$LB("pivotList",$$$Text("Pivot List"),$$$Text("View All Pivot Tables"),"zenPage.navigate('pivotList');")
// Check for additional permissions?
Set pCommands($I(pCommands))=$LB("configurationPage",$$$Text("Configuration Page"),$$$Text("Configure Settings"),"zenPage.navigate('configurationPage');")
Set pCommands($I(pCommands))=$LB("eventLogViewer",$$$Text("Event Log Viewer"),$$$Text("Event Log Viewer"),"zenPage.navigate('eventLogViewer');")

Quit $$$OK
}

ClientMethod navigate(pageName) [ Language = javascript ]
{
var location=""
if (pageName=='subscriptionManager') {
location="./PivotSubscriptions.UI.SubscriptionManager.zen"
} else if (pageName=='pivotList') {
location="./PivotSubscriptions.UI.PivotList.zen"
} else if (pageName=='configurationPage') {
location="./PivotSubscriptions.UI.ConfigurationPage.zen"
} else if (pageName='eventLogViewer') {
location="./PivotSubscriptions.UI.EventLogViewer.zen"
} else {
// Invalid page name
}

if (location!="") {
window.location.href=location;
}
}

}

0 comments on commit 0f40b79

Please sign in to comment.