Add Monitoring tab with configurable email history grid
Introduced a new "Monitoring" tab to the main form, featuring a configuration panel for specifying the number of emails to display and a DevExpress grid to show recent email history from TBEMLP_HISTORY. Added logic to validate the configuration input and dynamically reload the grid. Updated designer and code-behind to support new controls and event handlers. Made minor layout adjustments to accommodate the new UI elements.
This commit is contained in:
113
App/EmailProfiler.Form/frmMain.Designer.vb
generated
113
App/EmailProfiler.Form/frmMain.Designer.vb
generated
@@ -324,6 +324,10 @@ Partial Class frmMain
|
|||||||
Me.txtUser = New System.Windows.Forms.TextBox()
|
Me.txtUser = New System.Windows.Forms.TextBox()
|
||||||
Me.Label3 = New System.Windows.Forms.Label()
|
Me.Label3 = New System.Windows.Forms.Label()
|
||||||
Me.txtPasswort = New System.Windows.Forms.TextBox()
|
Me.txtPasswort = New System.Windows.Forms.TextBox()
|
||||||
|
Me.tabMonitoring = New System.Windows.Forms.TabPage()
|
||||||
|
Me.pnlMonitoringGrid = New DevExpress.XtraEditors.PanelControl()
|
||||||
|
Me.pnlMonitoringConfig = New DevExpress.XtraEditors.PanelControl()
|
||||||
|
Me.lblMonitoringConfig = New System.Windows.Forms.Label()
|
||||||
Me.TBEMLP_HISTORYBindingSource = New System.Windows.Forms.BindingSource(Me.components)
|
Me.TBEMLP_HISTORYBindingSource = New System.Windows.Forms.BindingSource(Me.components)
|
||||||
Me.BackgroundWorker1 = New System.ComponentModel.BackgroundWorker()
|
Me.BackgroundWorker1 = New System.ComponentModel.BackgroundWorker()
|
||||||
Me.TBEMLP_POLL_PROFILESTableAdapter = New EmailProfiler.Form.MyDatasetTableAdapters.TBEMLP_POLL_PROFILESTableAdapter()
|
Me.TBEMLP_POLL_PROFILESTableAdapter = New EmailProfiler.Form.MyDatasetTableAdapters.TBEMLP_POLL_PROFILESTableAdapter()
|
||||||
@@ -336,7 +340,10 @@ Partial Class frmMain
|
|||||||
Me.TBEMLP_CONFIGTableAdapter = New EmailProfiler.Form.MyDatasetTableAdapters.TBEMLP_CONFIGTableAdapter()
|
Me.TBEMLP_CONFIGTableAdapter = New EmailProfiler.Form.MyDatasetTableAdapters.TBEMLP_CONFIGTableAdapter()
|
||||||
Me.FolderBrowserDialog1 = New System.Windows.Forms.FolderBrowserDialog()
|
Me.FolderBrowserDialog1 = New System.Windows.Forms.FolderBrowserDialog()
|
||||||
Me.ContextMenuStrip1 = New System.Windows.Forms.ContextMenuStrip(Me.components)
|
Me.ContextMenuStrip1 = New System.Windows.Forms.ContextMenuStrip(Me.components)
|
||||||
Me.tabMonitoring = New System.Windows.Forms.TabPage()
|
Me.txtMonitoringConfig = New System.Windows.Forms.TextBox()
|
||||||
|
Me.btnMonitoringConfig = New System.Windows.Forms.Button()
|
||||||
|
Me.gridMonitoring = New DevExpress.XtraGrid.GridControl()
|
||||||
|
Me.GridView5 = New DevExpress.XtraGrid.Views.Grid.GridView()
|
||||||
GUIDLabel = New System.Windows.Forms.Label()
|
GUIDLabel = New System.Windows.Forms.Label()
|
||||||
PROFILE_NAMELabel = New System.Windows.Forms.Label()
|
PROFILE_NAMELabel = New System.Windows.Forms.Label()
|
||||||
POLL_TYPELabel = New System.Windows.Forms.Label()
|
POLL_TYPELabel = New System.Windows.Forms.Label()
|
||||||
@@ -441,7 +448,14 @@ Partial Class frmMain
|
|||||||
CType(Me.TBEMLP_CONFIGBindingSource, System.ComponentModel.ISupportInitialize).BeginInit()
|
CType(Me.TBEMLP_CONFIGBindingSource, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||||
CType(Me.CHECK_INTERVALL_MINUTESNumericUpDown, System.ComponentModel.ISupportInitialize).BeginInit()
|
CType(Me.CHECK_INTERVALL_MINUTESNumericUpDown, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||||
Me.GroupBox1.SuspendLayout()
|
Me.GroupBox1.SuspendLayout()
|
||||||
|
Me.tabMonitoring.SuspendLayout()
|
||||||
|
CType(Me.pnlMonitoringGrid, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||||
|
Me.pnlMonitoringGrid.SuspendLayout()
|
||||||
|
CType(Me.pnlMonitoringConfig, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||||
|
Me.pnlMonitoringConfig.SuspendLayout()
|
||||||
CType(Me.TBEMLP_HISTORYBindingSource, System.ComponentModel.ISupportInitialize).BeginInit()
|
CType(Me.TBEMLP_HISTORYBindingSource, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||||
|
CType(Me.gridMonitoring, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||||
|
CType(Me.GridView5, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||||
Me.SuspendLayout()
|
Me.SuspendLayout()
|
||||||
'
|
'
|
||||||
'GUIDLabel
|
'GUIDLabel
|
||||||
@@ -1703,7 +1717,7 @@ Partial Class frmMain
|
|||||||
Me.BindingNavigator2.MovePreviousItem = Me.ToolStripButton5
|
Me.BindingNavigator2.MovePreviousItem = Me.ToolStripButton5
|
||||||
Me.BindingNavigator2.Name = "BindingNavigator2"
|
Me.BindingNavigator2.Name = "BindingNavigator2"
|
||||||
Me.BindingNavigator2.PositionItem = Me.ToolStripTextBox1
|
Me.BindingNavigator2.PositionItem = Me.ToolStripTextBox1
|
||||||
Me.BindingNavigator2.Size = New System.Drawing.Size(1065, 25)
|
Me.BindingNavigator2.Size = New System.Drawing.Size(974, 25)
|
||||||
Me.BindingNavigator2.TabIndex = 32
|
Me.BindingNavigator2.TabIndex = 32
|
||||||
Me.BindingNavigator2.Text = "BindingNavigator2"
|
Me.BindingNavigator2.Text = "BindingNavigator2"
|
||||||
'
|
'
|
||||||
@@ -1818,7 +1832,7 @@ Partial Class frmMain
|
|||||||
Me.GridControl1.Location = New System.Drawing.Point(0, 0)
|
Me.GridControl1.Location = New System.Drawing.Point(0, 0)
|
||||||
Me.GridControl1.MainView = Me.GridView1
|
Me.GridControl1.MainView = Me.GridView1
|
||||||
Me.GridControl1.Name = "GridControl1"
|
Me.GridControl1.Name = "GridControl1"
|
||||||
Me.GridControl1.Size = New System.Drawing.Size(245, 320)
|
Me.GridControl1.Size = New System.Drawing.Size(245, 337)
|
||||||
Me.GridControl1.TabIndex = 0
|
Me.GridControl1.TabIndex = 0
|
||||||
Me.GridControl1.ViewCollection.AddRange(New DevExpress.XtraGrid.Views.Base.BaseView() {Me.GridView1})
|
Me.GridControl1.ViewCollection.AddRange(New DevExpress.XtraGrid.Views.Base.BaseView() {Me.GridView1})
|
||||||
'
|
'
|
||||||
@@ -3400,6 +3414,47 @@ Partial Class frmMain
|
|||||||
Me.txtPasswort.TabIndex = 50
|
Me.txtPasswort.TabIndex = 50
|
||||||
Me.txtPasswort.UseSystemPasswordChar = True
|
Me.txtPasswort.UseSystemPasswordChar = True
|
||||||
'
|
'
|
||||||
|
'tabMonitoring
|
||||||
|
'
|
||||||
|
Me.tabMonitoring.Controls.Add(Me.pnlMonitoringGrid)
|
||||||
|
Me.tabMonitoring.Controls.Add(Me.pnlMonitoringConfig)
|
||||||
|
Me.tabMonitoring.Location = New System.Drawing.Point(4, 22)
|
||||||
|
Me.tabMonitoring.Name = "tabMonitoring"
|
||||||
|
Me.tabMonitoring.Padding = New System.Windows.Forms.Padding(3)
|
||||||
|
Me.tabMonitoring.Size = New System.Drawing.Size(1227, 568)
|
||||||
|
Me.tabMonitoring.TabIndex = 4
|
||||||
|
Me.tabMonitoring.Text = "Monitoring"
|
||||||
|
Me.tabMonitoring.UseVisualStyleBackColor = True
|
||||||
|
'
|
||||||
|
'pnlMonitoringGrid
|
||||||
|
'
|
||||||
|
Me.pnlMonitoringGrid.Controls.Add(Me.gridMonitoring)
|
||||||
|
Me.pnlMonitoringGrid.Dock = System.Windows.Forms.DockStyle.Fill
|
||||||
|
Me.pnlMonitoringGrid.Location = New System.Drawing.Point(3, 47)
|
||||||
|
Me.pnlMonitoringGrid.Name = "pnlMonitoringGrid"
|
||||||
|
Me.pnlMonitoringGrid.Size = New System.Drawing.Size(1221, 518)
|
||||||
|
Me.pnlMonitoringGrid.TabIndex = 1
|
||||||
|
'
|
||||||
|
'pnlMonitoringConfig
|
||||||
|
'
|
||||||
|
Me.pnlMonitoringConfig.Controls.Add(Me.btnMonitoringConfig)
|
||||||
|
Me.pnlMonitoringConfig.Controls.Add(Me.txtMonitoringConfig)
|
||||||
|
Me.pnlMonitoringConfig.Controls.Add(Me.lblMonitoringConfig)
|
||||||
|
Me.pnlMonitoringConfig.Dock = System.Windows.Forms.DockStyle.Top
|
||||||
|
Me.pnlMonitoringConfig.Location = New System.Drawing.Point(3, 3)
|
||||||
|
Me.pnlMonitoringConfig.Name = "pnlMonitoringConfig"
|
||||||
|
Me.pnlMonitoringConfig.Size = New System.Drawing.Size(1221, 44)
|
||||||
|
Me.pnlMonitoringConfig.TabIndex = 0
|
||||||
|
'
|
||||||
|
'lblMonitoringConfig
|
||||||
|
'
|
||||||
|
Me.lblMonitoringConfig.AutoSize = True
|
||||||
|
Me.lblMonitoringConfig.Location = New System.Drawing.Point(23, 14)
|
||||||
|
Me.lblMonitoringConfig.Name = "lblMonitoringConfig"
|
||||||
|
Me.lblMonitoringConfig.Size = New System.Drawing.Size(117, 13)
|
||||||
|
Me.lblMonitoringConfig.TabIndex = 0
|
||||||
|
Me.lblMonitoringConfig.Text = "Abrufmenge an Emails:"
|
||||||
|
'
|
||||||
'TBEMLP_HISTORYBindingSource
|
'TBEMLP_HISTORYBindingSource
|
||||||
'
|
'
|
||||||
Me.TBEMLP_HISTORYBindingSource.DataMember = "TBEMLP_HISTORY"
|
Me.TBEMLP_HISTORYBindingSource.DataMember = "TBEMLP_HISTORY"
|
||||||
@@ -3456,15 +3511,36 @@ Partial Class frmMain
|
|||||||
Me.ContextMenuStrip1.Name = "ContextMenuStrip1"
|
Me.ContextMenuStrip1.Name = "ContextMenuStrip1"
|
||||||
Me.ContextMenuStrip1.Size = New System.Drawing.Size(61, 4)
|
Me.ContextMenuStrip1.Size = New System.Drawing.Size(61, 4)
|
||||||
'
|
'
|
||||||
'tabMonitoring
|
'txtMonitoringConfig
|
||||||
'
|
'
|
||||||
Me.tabMonitoring.Location = New System.Drawing.Point(4, 22)
|
Me.txtMonitoringConfig.Location = New System.Drawing.Point(147, 10)
|
||||||
Me.tabMonitoring.Name = "tabMonitoring"
|
Me.txtMonitoringConfig.Name = "txtMonitoringConfig"
|
||||||
Me.tabMonitoring.Padding = New System.Windows.Forms.Padding(3)
|
Me.txtMonitoringConfig.Size = New System.Drawing.Size(61, 21)
|
||||||
Me.tabMonitoring.Size = New System.Drawing.Size(1227, 568)
|
Me.txtMonitoringConfig.TabIndex = 1
|
||||||
Me.tabMonitoring.TabIndex = 4
|
'
|
||||||
Me.tabMonitoring.Text = "Monitoring"
|
'btnMonitoringConfig
|
||||||
Me.tabMonitoring.UseVisualStyleBackColor = True
|
'
|
||||||
|
Me.btnMonitoringConfig.Location = New System.Drawing.Point(220, 9)
|
||||||
|
Me.btnMonitoringConfig.Name = "btnMonitoringConfig"
|
||||||
|
Me.btnMonitoringConfig.Size = New System.Drawing.Size(80, 23)
|
||||||
|
Me.btnMonitoringConfig.TabIndex = 2
|
||||||
|
Me.btnMonitoringConfig.Text = "Übernehmen"
|
||||||
|
Me.btnMonitoringConfig.UseVisualStyleBackColor = True
|
||||||
|
'
|
||||||
|
'gridMonitoring
|
||||||
|
'
|
||||||
|
Me.gridMonitoring.Dock = System.Windows.Forms.DockStyle.Fill
|
||||||
|
Me.gridMonitoring.Location = New System.Drawing.Point(2, 2)
|
||||||
|
Me.gridMonitoring.MainView = Me.GridView5
|
||||||
|
Me.gridMonitoring.Name = "gridMonitoring"
|
||||||
|
Me.gridMonitoring.Size = New System.Drawing.Size(1217, 514)
|
||||||
|
Me.gridMonitoring.TabIndex = 0
|
||||||
|
Me.gridMonitoring.ViewCollection.AddRange(New DevExpress.XtraGrid.Views.Base.BaseView() {Me.GridView5})
|
||||||
|
'
|
||||||
|
'GridView5
|
||||||
|
'
|
||||||
|
Me.GridView5.GridControl = Me.gridMonitoring
|
||||||
|
Me.GridView5.Name = "GridView5"
|
||||||
'
|
'
|
||||||
'frmMain
|
'frmMain
|
||||||
'
|
'
|
||||||
@@ -3545,7 +3621,15 @@ Partial Class frmMain
|
|||||||
CType(Me.CHECK_INTERVALL_MINUTESNumericUpDown, System.ComponentModel.ISupportInitialize).EndInit()
|
CType(Me.CHECK_INTERVALL_MINUTESNumericUpDown, System.ComponentModel.ISupportInitialize).EndInit()
|
||||||
Me.GroupBox1.ResumeLayout(False)
|
Me.GroupBox1.ResumeLayout(False)
|
||||||
Me.GroupBox1.PerformLayout()
|
Me.GroupBox1.PerformLayout()
|
||||||
|
Me.tabMonitoring.ResumeLayout(False)
|
||||||
|
CType(Me.pnlMonitoringGrid, System.ComponentModel.ISupportInitialize).EndInit()
|
||||||
|
Me.pnlMonitoringGrid.ResumeLayout(False)
|
||||||
|
CType(Me.pnlMonitoringConfig, System.ComponentModel.ISupportInitialize).EndInit()
|
||||||
|
Me.pnlMonitoringConfig.ResumeLayout(False)
|
||||||
|
Me.pnlMonitoringConfig.PerformLayout()
|
||||||
CType(Me.TBEMLP_HISTORYBindingSource, System.ComponentModel.ISupportInitialize).EndInit()
|
CType(Me.TBEMLP_HISTORYBindingSource, System.ComponentModel.ISupportInitialize).EndInit()
|
||||||
|
CType(Me.gridMonitoring, System.ComponentModel.ISupportInitialize).EndInit()
|
||||||
|
CType(Me.GridView5, System.ComponentModel.ISupportInitialize).EndInit()
|
||||||
Me.ResumeLayout(False)
|
Me.ResumeLayout(False)
|
||||||
Me.PerformLayout()
|
Me.PerformLayout()
|
||||||
|
|
||||||
@@ -3809,4 +3893,11 @@ Partial Class frmMain
|
|||||||
Friend WithEvents CheckBoxEnableTls1_1 As CheckBox
|
Friend WithEvents CheckBoxEnableTls1_1 As CheckBox
|
||||||
Friend WithEvents Label15 As Label
|
Friend WithEvents Label15 As Label
|
||||||
Friend WithEvents tabMonitoring As TabPage
|
Friend WithEvents tabMonitoring As TabPage
|
||||||
|
Friend WithEvents pnlMonitoringGrid As DevExpress.XtraEditors.PanelControl
|
||||||
|
Friend WithEvents pnlMonitoringConfig As DevExpress.XtraEditors.PanelControl
|
||||||
|
Friend WithEvents lblMonitoringConfig As Label
|
||||||
|
Friend WithEvents btnMonitoringConfig As Button
|
||||||
|
Friend WithEvents txtMonitoringConfig As TextBox
|
||||||
|
Friend WithEvents gridMonitoring As DevExpress.XtraGrid.GridControl
|
||||||
|
Friend WithEvents GridView5 As DevExpress.XtraGrid.Views.Grid.GridView
|
||||||
End Class
|
End Class
|
||||||
|
|||||||
@@ -93,6 +93,11 @@ Public Class frmMain
|
|||||||
|
|
||||||
|
|
||||||
_Encryption = New clsEncryption("!35452didalog=", LogConfig)
|
_Encryption = New clsEncryption("!35452didalog=", LogConfig)
|
||||||
|
|
||||||
|
If String.IsNullOrWhiteSpace(txtMonitoringConfig.Text) OrElse Not IsNumeric(txtMonitoringConfig.Text) OrElse CInt(txtMonitoringConfig.Text) <= 0 Then
|
||||||
|
txtMonitoringConfig.Text = "500"
|
||||||
|
End If
|
||||||
|
LoadMonitoringIntoGrid()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub frmMain_Shown(sender As Object, e As EventArgs) Handles Me.Shown
|
Private Sub frmMain_Shown(sender As Object, e As EventArgs) Handles Me.Shown
|
||||||
@@ -1044,4 +1049,39 @@ Public Class frmMain
|
|||||||
Private Sub COMMENT_PROFILESTextBox_TextChanged(sender As Object, e As EventArgs) Handles COMMENT_PROFILESTextBox.TextChanged
|
Private Sub COMMENT_PROFILESTextBox_TextChanged(sender As Object, e As EventArgs) Handles COMMENT_PROFILESTextBox.TextChanged
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Private Sub LoadMonitoringIntoGrid()
|
||||||
|
Try
|
||||||
|
|
||||||
|
Dim emailAmount As Integer
|
||||||
|
If txtMonitoringConfig.Text = Nothing OrElse Not IsNumeric(txtMonitoringConfig.Text) Then
|
||||||
|
emailAmount = 500
|
||||||
|
Else
|
||||||
|
emailAmount = Convert.ToInt32(txtMonitoringConfig.Text)
|
||||||
|
End If
|
||||||
|
|
||||||
|
Dim oSQL = $"SELECT TOP ({emailAmount}) GUID, PROFILE_ID, EMAIL_MSGID, EMAIL_FROM, EMAIL_SUBJECT, EMAIL_DATE, ADDED_WHEN, STATUS FROM [dbo].[TBEMLP_HISTORY] (nolock) order by GUID DESC"
|
||||||
|
Dim oDT As DataTable = _database.GetDatatable(oSQL)
|
||||||
|
|
||||||
|
Me.gridMonitoring.DataSource = oDT
|
||||||
|
|
||||||
|
Dim gridView = TryCast(Me.GridView5, DevExpress.XtraGrid.Views.Grid.GridView)
|
||||||
|
If gridView IsNot Nothing Then
|
||||||
|
gridView.OptionsView.ColumnAutoWidth = False
|
||||||
|
gridView.BestFitColumns()
|
||||||
|
End If
|
||||||
|
|
||||||
|
Catch ex As Exception
|
||||||
|
If Logger IsNot Nothing Then Logger.Error(ex) Else Debug.WriteLine(ex.ToString())
|
||||||
|
End Try
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub txtMonitoringConfig_LostFocus(sender As Object, e As EventArgs) Handles txtMonitoringConfig.LostFocus
|
||||||
|
If Not IsNumeric(txtMonitoringConfig.Text) OrElse CInt(txtMonitoringConfig.Text) <= 0 Then
|
||||||
|
txtMonitoringConfig.Text = "500"
|
||||||
|
End If
|
||||||
|
LoadMonitoringIntoGrid()
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
End Class
|
End Class
|
||||||
|
|||||||
Reference in New Issue
Block a user