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
6 changes: 4 additions & 2 deletions cubesql-webadmin.xojo_project
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ WebView=CubeSQLAdminPage;webapp/main/CubeSQLAdminPage.xojo_code;&h000000004DEBB7
Folder=dialogs;webapp/dialogs;&h0000000054A427FF;&h0000000018D38FFF;false
WebView=dlgRegisterServer;webapp/dialogs/dlgRegisterServer.xojo_code;&h000000000EEC17FF;&h0000000054A427FF;false
WebView=dlgDatabaseCreate;webapp/dialogs/dlgDatabaseCreate.xojo_code;&h0000000045C397FF;&h0000000054A427FF;false
WebView=dlgDatabaseUpload;webapp/dialogs/dlgDatabaseUpload.xojo_code;&h00000000375D2FFF;&h0000000054A427FF;false
WebView=dlgUserCreate;webapp/dialogs/dlgUserCreate.xojo_code;&h0000000064C14FFF;&h0000000054A427FF;false
WebView=dlgUserGroups;webapp/dialogs/dlgUserGroups.xojo_code;&h00000000347EFFFF;&h0000000054A427FF;false
WebView=dlgPrivilegeGrant;webapp/dialogs/dlgPrivilegeGrant.xojo_code;&h000000004CD7F7FF;&h0000000054A427FF;false
Expand Down Expand Up @@ -45,15 +46,16 @@ Folder=information;webapp/containers/information;&h000000005EFC7FFF;&h0000000058
WebContainer=cntCommands;webapp/containers/information/cntCommands.xojo_code;&h000000002752C7FF;&h000000005EFC7FFF;false
WebContainer=cntClients;webapp/containers/information/cntClients.xojo_code;&h000000002140EFFF;&h000000005EFC7FFF;false
WebContainer=cntLog;webapp/containers/information/cntLog.xojo_code;&h000000002B1057FF;&h000000005EFC7FFF;false
WebContainer=cntDatabasesEncryption;webapp/containers/data/cntDatabasesEncryption.xojo_code;&h0000000044B7E7FF;&h00000000107E37FF;false
DefaultWindow=LoginPage
MajorVersion=0
MinorVersion=0
SubVersion=3
SubVersion=4
NonRelease=0
Release=0
InfoVersion=cubeSQL Web Admin
LongVersion=jo-tools.ch
ShortVersion=0.0.3
ShortVersion=0.0.4
WinCompanyName=jo-tools.ch
WinInternalName=cubesqlwebadmin
WinProductName=cubeSQL Web Admin
Expand Down
9 changes: 4 additions & 5 deletions webapp/containers/base/cntDatasourceBase.xojo_code
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,7 @@ Implements WebDataSource
Case DatasourceColumn.FieldTypes.Boolean
Return If(row.Lookup(col.DatabaseColumnName, 0).BooleanValue, "true", "false")
Case DatasourceColumn.FieldTypes.SQLDateTime
Var utcDateTimeValue As DateTime = DateTime.FromString(row.Lookup(col.DatabaseColumnName, "").StringValue, Nil, New TimeZone("UTC"))
Var localDateTimeValue As New DateTime(utcDateTimeValue.SecondsFrom1970, Timezone.Current)
Return localDateTimeValue.ToString(DateTime.FormatStyles.Medium, DateTime.FormatStyles.Medium)
Return SQLDateTime_AsDateTime_AsLocal(row.Lookup(col.DatabaseColumnName, "").StringValue)
Else
Break
Return ""
Expand Down Expand Up @@ -324,13 +322,14 @@ Implements WebDataSource
If (b1 = False) And (b2 = True) Then Return -1 * desc
Return 0
Case DatasourceColumn.FieldTypes.SQLDateTime
Var d1 As DateTime = DateTime.FromString(row1.Lookup(mSortColumname, "").StringValue, Nil, New TimeZone("UTC"))
Var d2 As DateTime = DateTime.FromString(row2.Lookup(mSortColumname, "").StringValue, Nil, New TimeZone("UTC"))
Var d1 As DateTime = SQLDateTime_AsDateTime_AsLocal(row1.Lookup(mSortColumname, "").StringValue)
Var d2 As DateTime = SQLDateTime_AsDateTime_AsLocal(row2.Lookup(mSortColumname, "").StringValue)
Return d1.Operator_Compare(d2) * desc
Else
Break
Return 0
End Select

End Function
#tag EndMethod

Expand Down
31 changes: 13 additions & 18 deletions webapp/containers/data/cntBackups.xojo_code
Original file line number Diff line number Diff line change
Expand Up @@ -421,8 +421,6 @@ Begin cntDatasourceBase cntBackups
Period = 500
RunMode = 0
Scope = 2
TabIndex = 6
TabStop = True
_mPanelIndex = -1
End
Begin WebTimer timThread
Expand All @@ -434,8 +432,6 @@ Begin cntDatasourceBase cntBackups
Period = 500
RunMode = 0
Scope = 2
TabIndex = 6
TabStop = True
_mPanelIndex = -1
End
End
Expand Down Expand Up @@ -645,10 +641,7 @@ End
Var iMinute As Integer = psTimestamp.Middle(11, 2).ToInteger
Var iSecond As Integer = psTimestamp.Middle(13, 2).ToInteger

Var utcDateTimeValue As DateTime = New DateTime(iYear, iMonth, iDay, iHour, iMinute, iSecond, 0, New TimeZone("UTC"))
Var localDateTimeValue As New DateTime(utcDateTimeValue.SecondsFrom1970, Timezone.Current)

Return localDateTimeValue
Return New DateTime(iYear, iMonth, iDay, iHour, iMinute, iSecond, 0, Timezone.Current)

End Function
#tag EndMethod
Expand Down Expand Up @@ -905,7 +898,6 @@ End
End If

Try

Session.DB.ExecuteSQL("BACKUP NOW '" + Databasename.EscapeSqlQuotes + "'")

Me.SleepAndYieldToNext 100
Expand Down Expand Up @@ -1105,30 +1097,33 @@ End
Return
End If

Var iDbTimeout As Integer = Session.DB.Timeout
Var DB As CubeSQLServer = Session.DB
if (DB = Nil) then return

Var iDbTimeout As Integer = DB.Timeout
Var bSuccess As Boolean = False
Var prepareDownload As WebFile

Try
Session.DB.Timeout = 600 'a long Timeout for Download
Session.DB.ExecuteSQL("DOWNLOAD BACKUP DATABASE '" + sDownloadFromDatabase.EscapeSqlQuotes + "' WITH TIMESTAMP '" + sDownloadTimestamp.EscapeSqlQuotes + "'")
DB.Timeout = 600 'a long Timeout for Download
DB.ExecuteSQL("DOWNLOAD BACKUP DATABASE '" + sDownloadFromDatabase.EscapeSqlQuotes + "' WITH TIMESTAMP '" + sDownloadTimestamp.EscapeSqlQuotes + "'")

Var data As New MemoryBlock(1) 'we don't know the size - let the MemoryBlock increase as needed
Dim bs As New BinaryStream(data)
' call ReceiveChunk in a loop until all chunks have been received
While True
' read the next chunk from the server
Dim chunk As String = Session.DB.ReceiveChunk
Dim chunk As String = DB.ReceiveChunk

' there was an error receving a chunk, report the error and bail
If Session.DB.Error Then
Var errorMessage As String = Session.DB.ErrMsg
If DB.Error Then
Var errorMessage As String = DB.ErrMsg
If (errorMessage = "") Then errorMessage = "Unknown Error while downloading..."
Raise New DatabaseException(errorMessage, Session.DB.ErrCode)
Raise New DatabaseException(errorMessage, DB.ErrCode)
End If

' see if we have reached the end of the chunks and exit the loop if we have
If Session.DB.EndChunk Or (chunk.Bytes = 0) Then
If DB.EndChunk Or (chunk.Bytes = 0) Then
bSuccess = True
bs.Close
Exit 'Loop
Expand Down Expand Up @@ -1156,7 +1151,7 @@ End
Me.AddUserInterfaceUpdate("Error" : "Error" + If(err.ErrorNumber > 0, " " + err.ErrorNumber.ToString, "") + ": " + err.Message)

Finally
Session.DB.Timeout = iDbTimeout
DB.Timeout = iDbTimeout

End Try

Expand Down
Loading