Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 33 additions & 3 deletions webapp/containers/base/cntDatasourceBase.xojo_code
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ Implements WebDataSource
If (Me.Table = Nil) Then Return Nil

Var rowIndex As Integer = Me.Table.SelectedRowIndex
If (rowIndex < 0) Then Return Nil
If (rowIndex < 0) Or (rowIndex > Me.TableRows.LastIndex) Then Return Nil

Return Me.Table.RowTagAt(rowIndex)
Return Me.TableRows(rowIndex).Lookup("rowtag", Nil)

End Function
#tag EndMethod
Expand Down Expand Up @@ -198,7 +198,6 @@ Implements WebDataSource

Var row As New WebListBoxRowData
row.PrimaryKey = Me.TableRows(i).Lookup("id", -1).IntegerValue
row.Tag = dictRow

For Each col As DatasourceColumn In Me.Columns
Var colData As Variant = Me.TableRowColumnData(col, dictRow)
Expand Down Expand Up @@ -227,6 +226,8 @@ Implements WebDataSource
End Select
Next

dictRow.Value("rowtag") = dictRowTag

row.Tag = dictRowTag
rows.Add(row)

Expand Down Expand Up @@ -439,6 +440,35 @@ Implements WebDataSource
End Sub
#tag EndMethod

#tag Method, Flags = &h1
Protected Function TableRowFindAndSelect(findByFields As Dictionary) As Boolean
If (Me.TableRows = Nil) Or (Me.TableRows.LastIndex < 0) Then Return False
If (findByFields = Nil) Or (findByFields.KeyCount < 1) Then Return False

Var tableRow As Dictionary
Var bAllFieldsFound As Boolean
For i As Integer = Me.TableRows.LastIndex DownTo 0
tableRow = Me.TableRows(i)

bAllFieldsFound = True
For Each field As Variant In findByFields.Keys
If (tableRow.Lookup(field.StringValue, "").StringValue <> findByFields.Value(field).StringValue) Then
bAllFieldsFound = False
Exit 'Loop matching Fields
End If
Next

If (Not bAllFieldsFound) Then Continue 'searching next Table Row

Me.Table.SelectedRowIndex = i
Return True
Next

Return False

End Function
#tag EndMethod

#tag Method, Flags = &h21
Private Function UnsortedPrimaryKeys() As Integer()
// Part of the WebDataSource interface.
Expand Down
16 changes: 5 additions & 11 deletions webapp/containers/data/cntBackups.xojo_code
Original file line number Diff line number Diff line change
Expand Up @@ -801,18 +801,12 @@ End
Var sSelectAfterReload As String = esSelectAfterReload
esSelectAfterReload = ""

Var bFound As Boolean = False
For i As Integer = Me.Table.LastRowIndex DownTo 0
Var rowTag As Dictionary = Me.Table.RowTagAt(i)
If (rowTag IsA Dictionary) Then
If (rowTag.Lookup("timestamp", "-").StringValue <> sSelectAfterReload) Then Continue
Me.Table.SelectedRowIndex = i
bFound = True
Exit 'Loop
End If
Next
Var findByFields As New Dictionary
findByFields.Value("timestamp") = sSelectAfterReload

If (Not bFound) Then Me.Table.SelectedRowIndex = -1
If (Not Me.TableRowFindAndSelect(findByFields)) Then
Me.Table.SelectedRowIndex = -1
End If

Me.RefreshButtons()

Expand Down
16 changes: 5 additions & 11 deletions webapp/containers/data/cntDatabases.xojo_code
Original file line number Diff line number Diff line change
Expand Up @@ -1145,18 +1145,12 @@ End
Var sSelectAfterReload As String = esSelectAfterReload
esSelectAfterReload = ""

Var bFound As Boolean = False
For i As Integer = Me.Table.LastRowIndex DownTo 0
Var rowTag As Dictionary = Me.Table.RowTagAt(i)
If (rowTag IsA Dictionary) Then
If (rowTag.Lookup("databasename", "").StringValue <> sSelectAfterReload) Then Continue
Me.Table.SelectedRowIndex = i
bFound = True
Exit 'Loop
End If
Next
Var findByFields As New Dictionary
findByFields.Value("databasename") = sSelectAfterReload

If (Not bFound) Then Me.Table.SelectedRowIndex = -1
If (Not Me.TableRowFindAndSelect(findByFields)) Then
Me.Table.SelectedRowIndex = -1
End If

Me.RefreshButtons()

Expand Down
16 changes: 5 additions & 11 deletions webapp/containers/data/cntSchedules.xojo_code
Original file line number Diff line number Diff line change
Expand Up @@ -933,18 +933,12 @@ End
Var sSelectAfterReload As String = esSelectAfterReload
esSelectAfterReload = ""

Var bFound As Boolean = False
For i As Integer = Me.Table.LastRowIndex DownTo 0
Var rowTag As Dictionary = Me.Table.RowTagAt(i)
If (rowTag IsA Dictionary) Then
If (rowTag.Lookup("schedname", "").StringValue <> sSelectAfterReload) Then Continue
Me.Table.SelectedRowIndex = i
bFound = True
Exit 'Loop
End If
Next
Var findByFields As New Dictionary
findByFields.Value("schedname") = sSelectAfterReload

If (Not bFound) Then Me.Table.SelectedRowIndex = -1
If (Not Me.TableRowFindAndSelect(findByFields)) Then
Me.Table.SelectedRowIndex = -1
End If

Me.RefreshButtons()

Expand Down
20 changes: 6 additions & 14 deletions webapp/containers/data/cntTablesIndexes.xojo_code
Original file line number Diff line number Diff line change
Expand Up @@ -785,21 +785,13 @@ End
Var sSelectAfterReload As Dictionary = edictSelectAfterReload
edictSelectAfterReload = Nil

Var bFound As Boolean = False
For i As Integer = Me.Table.LastRowIndex DownTo 0
Var rowTag As Dictionary = Me.Table.RowTagAt(i)
If (rowTag IsA Dictionary) Then
If (rowTag.Lookup("type", "").StringValue = sSelectAfterReload.Lookup("type", "-").StringValue) And _
(rowTag.Lookup("name", "").StringValue = sSelectAfterReload.Lookup("name", "-").StringValue) Then

Me.Table.SelectedRowIndex = i
bFound = True
Exit 'Loop
End If
End If
Next
Var findByFields As New Dictionary
findByFields.Value("type") = sSelectAfterReload.Lookup("type", "-").StringValue
findByFields.Value("name") = sSelectAfterReload.Lookup("name", "-").StringValue

If (Not bFound) Then Me.Table.SelectedRowIndex = -1
If (Not Me.TableRowFindAndSelect(findByFields)) Then
Me.Table.SelectedRowIndex = -1
End If

Me.RefreshButtons()

Expand Down
20 changes: 7 additions & 13 deletions webapp/containers/information/cntClients.xojo_code
Original file line number Diff line number Diff line change
Expand Up @@ -385,18 +385,12 @@ End
Var iSelectAfterReload As Integer = eiSelectAfterReload
eiSelectAfterReload = -1

Var bFound As Boolean = False
For i As Integer = Me.Table.LastRowIndex DownTo 0
Var rowTag As Dictionary = Me.Table.RowTagAt(i)
If (rowTag IsA Dictionary) Then
If (rowTag.Lookup("id", "").IntegerValue <> iSelectAfterReload) Then Continue
Me.Table.SelectedRowIndex = i
bFound = True
Exit 'Loop
End If
Next

If (Not bFound) Then Me.Table.SelectedRowIndex = -1
Var findByFields As New Dictionary
findByFields.Value("id") = iSelectAfterReload

If (Not Me.TableRowFindAndSelect(findByFields)) Then
Me.Table.SelectedRowIndex = -1
End If

Me.RefreshButtons()

Expand Down Expand Up @@ -434,7 +428,7 @@ End
#tag Events btnRefresh
#tag Event
Sub Pressed()
Self.TableLoad()
Self.RefreshInfos()

End Sub
#tag EndEvent
Expand Down
26 changes: 9 additions & 17 deletions webapp/containers/security/cntEnginePreferences.xojo_code
Original file line number Diff line number Diff line change
Expand Up @@ -789,23 +789,15 @@ End
Var sSelectAfterReload As Dictionary = edictSelectAfterReload
edictSelectAfterReload = Nil

Var bFound As Boolean = False
For i As Integer = Me.Table.LastRowIndex DownTo 0
Var rowTag As Dictionary = Me.Table.RowTagAt(i)
If (rowTag IsA Dictionary) Then
If(rowTag.Lookup("engine", "").StringValue = sSelectAfterReload.Lookup("engine", "-").StringValue) And _
(rowTag.Lookup("groupname", "").StringValue = sSelectAfterReload.Lookup("groupname", "-").StringValue) And _
(rowTag.Lookup("databasename", "").StringValue = sSelectAfterReload.Lookup("databasename", "-").StringValue) And _
(rowTag.Lookup("key", "").StringValue = sSelectAfterReload.Lookup("key", "-").StringValue) Then

Me.Table.SelectedRowIndex = i
bFound = True
Exit 'Loop
End If
End If
Next

If (Not bFound) Then Me.Table.SelectedRowIndex = -1
Var findByFields As New Dictionary
findByFields.Value("engine") = sSelectAfterReload.Lookup("engine", "-").StringValue
findByFields.Value("groupname") = sSelectAfterReload.Lookup("groupname", "-").StringValue
findByFields.Value("databasename") = sSelectAfterReload.Lookup("databasename", "-").StringValue
findByFields.Value("key") = sSelectAfterReload.Lookup("key", "-").StringValue

If (Not Me.TableRowFindAndSelect(findByFields)) Then
Me.Table.SelectedRowIndex = -1
End If

Me.RefreshButtons()

Expand Down
18 changes: 6 additions & 12 deletions webapp/containers/security/cntGroups.xojo_code
Original file line number Diff line number Diff line change
Expand Up @@ -535,18 +535,12 @@ End
Var sSelectAfterReload As String = esSelectAfterReload
esSelectAfterReload = ""

Var bFound As Boolean = False
For i As Integer = Me.Table.LastRowIndex DownTo 0
Var rowTag As Dictionary = Me.Table.RowTagAt(i)
If (rowTag IsA Dictionary) Then
If (rowTag.Lookup("groupname", "").StringValue <> sSelectAfterReload) Then Continue
Me.Table.SelectedRowIndex = i
bFound = True
Exit 'Loop
End If
Next

If (Not bFound) Then Me.Table.SelectedRowIndex = -1
Var findByFields As New Dictionary
findByFields.Value("groupname") = sSelectAfterReload

If (Not Me.TableRowFindAndSelect(findByFields)) Then
Me.Table.SelectedRowIndex = -1
End If

Me.RefreshButtons()

Expand Down
26 changes: 9 additions & 17 deletions webapp/containers/security/cntPrivileges.xojo_code
Original file line number Diff line number Diff line change
Expand Up @@ -765,23 +765,15 @@ End
Var sSelectAfterReload As Dictionary = edictSelectAfterReload
edictSelectAfterReload = Nil

Var bFound As Boolean = False
For i As Integer = Me.Table.LastRowIndex DownTo 0
Var rowTag As Dictionary = Me.Table.RowTagAt(i)
If (rowTag IsA Dictionary) Then
If (rowTag.Lookup("groupname", "").StringValue = sSelectAfterReload.Lookup("groupname", "-").StringValue) And _
(rowTag.Lookup("privilege", "").StringValue = sSelectAfterReload.Lookup("privilege", "-").StringValue) And _
(rowTag.Lookup("databasename", "").StringValue = sSelectAfterReload.Lookup("databasename", "-").StringValue) And _
(rowTag.Lookup("tablename", "").StringValue = sSelectAfterReload.Lookup("tablename", "-").StringValue) Then

Me.Table.SelectedRowIndex = i
bFound = True
Exit 'Loop
End If
End If
Next

If (Not bFound) Then Me.Table.SelectedRowIndex = -1
Var findByFields As New Dictionary
findByFields.Value("groupname") = sSelectAfterReload.Lookup("groupname", "-").StringValue
findByFields.Value("privilege") = sSelectAfterReload.Lookup("privilege", "-").StringValue
findByFields.Value("databasename") = sSelectAfterReload.Lookup("databasename", "-").StringValue
findByFields.Value("tablename") = sSelectAfterReload.Lookup("tablename", "-").StringValue

If (Not Me.TableRowFindAndSelect(findByFields)) Then
Me.Table.SelectedRowIndex = -1
End If

Me.RefreshButtons()

Expand Down
16 changes: 5 additions & 11 deletions webapp/containers/security/cntUsers.xojo_code
Original file line number Diff line number Diff line change
Expand Up @@ -889,18 +889,12 @@ End
Var sSelectAfterReload As String = esSelectAfterReload
esSelectAfterReload = ""

Var bFound As Boolean = False
For i As Integer = Me.Table.LastRowIndex DownTo 0
Var rowTag As Dictionary = Me.Table.RowTagAt(i)
If (rowTag IsA Dictionary) Then
If (rowTag.Lookup("username", "").StringValue <> sSelectAfterReload) Then Continue
Me.Table.SelectedRowIndex = i
bFound = True
Exit 'Loop
End If
Next
Var findByFields As New Dictionary
findByFields.Value("username") = sSelectAfterReload

If (Not bFound) Then Me.Table.SelectedRowIndex = -1
If (Not Me.TableRowFindAndSelect(findByFields)) Then
Me.Table.SelectedRowIndex = -1
End If

Me.RefreshButtons()

Expand Down
14 changes: 3 additions & 11 deletions webapp/containers/server/cntPlugins.xojo_code
Original file line number Diff line number Diff line change
Expand Up @@ -211,18 +211,10 @@ End
Var sSelectAfterReload As String = esSelectAfterReload
esSelectAfterReload = ""

Var bFound As Boolean = False
For i As Integer = Me.Table.LastRowIndex DownTo 0
Var rowTag As Dictionary = Me.Table.RowTagAt(i)
If (rowTag IsA Dictionary) Then
If (rowTag.Lookup("name", "").StringValue <> sSelectAfterReload) Then Continue
Me.Table.SelectedRowIndex = i
bFound = True
Exit 'Loop
End If
Next
Var findByFields As New Dictionary
findByFields.Value("name") = sSelectAfterReload

If (Not bFound) And (Me.TableRows <> Nil) And (Me.TableRows.LastIndex >= 0) And (Me.Table.RowCount > 0) Then
If (Not Me.TableRowFindAndSelect(findByFields)) And (Me.TableRows.LastIndex >= 0) And (Me.Table.RowCount > 0) Then
Me.Table.SelectedRowIndex = 0
End If

Expand Down
14 changes: 10 additions & 4 deletions webapp/main/LoginPage.xojo_code
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ Begin WebPage LoginPage
_ImplicitInstance= False
_mDesignHeight = 0
_mDesignWidth = 0
_mName = ""
_mPanelIndex = -1
Begin WebRectangle rectLogin
BackgroundColor = &cFFFFFF
Expand Down Expand Up @@ -584,7 +585,7 @@ Begin WebPage LoginPage
Enabled = True
Height = 32
Index = -2147483648
Indicator = ""
Indicator = 0
Left = 372
LockBottom = False
LockedInPosition= True
Expand All @@ -598,6 +599,7 @@ Begin WebPage LoginPage
SVGColor = &c00000000
SVGData = ""
TabIndex = 15
TabPanelIndex = 0
TabStop = True
Tooltip = ""
Top = 440
Expand Down Expand Up @@ -634,8 +636,6 @@ Begin WebPage LoginPage
Period = 50
RunMode = 0
Scope = 2
TabIndex = 15
TabStop = True
_mPanelIndex = -1
End
End
Expand Down Expand Up @@ -929,7 +929,13 @@ End


#tag Note, Name = DebugMemoryIssues
Place this in the Run Event of a WebThread (Location: Browser).
1. Add a WebLabel
- Name: labMemory
- Multiline: True
2. Add a WebTimer
- Location: Browser
3. Copy and Paste the code below to the Run Event of the WebTimer

It'll show the count of instances.

*****
Expand Down