Commit 60d7ce4f by Elias Sarraf

deploy ver 0.9.13 & server 0.9.13.2

parent 6219d663
...@@ -19,7 +19,7 @@ type ...@@ -19,7 +19,7 @@ type
FUnauthorizedAccessProc: TUnauthorizedAccessProc; FUnauthorizedAccessProc: TUnauthorizedAccessProc;
public public
const clientVersion = '0.9.12'; const clientVersion = '0.9.13';
procedure InitApp(SuccessProc: TSuccessProc; procedure InitApp(SuccessProc: TSuccessProc;
UnauthorizedAccessProc: TUnauthorizedAccessProc); UnauthorizedAccessProc: TUnauthorizedAccessProc);
procedure SetClientConfig(Callback: TVersionCheckCallback); procedure SetClientConfig(Callback: TVersionCheckCallback);
...@@ -46,12 +46,14 @@ begin ...@@ -46,12 +46,14 @@ begin
TFViewErrorPage.DisplayConnectionError(Error); TFViewErrorPage.DisplayConnectionError(Error);
end; end;
procedure TDMConnection.ApiConnectionRequest(Args: TXDataWebConnectionRequest); procedure TDMConnection.ApiConnectionRequest(Args: TXDataWebConnectionRequest);
begin begin
if AuthService.Authenticated then if AuthService.Authenticated then
Args.Request.Headers.SetValue('Authorization', 'Bearer ' + AuthService.GetToken); Args.Request.Headers.SetValue('Authorization', 'Bearer ' + AuthService.GetToken);
end; end;
procedure TDMConnection.ApiConnectionResponse( procedure TDMConnection.ApiConnectionResponse(
Args: TXDataWebConnectionResponse); Args: TXDataWebConnectionResponse);
begin begin
...@@ -59,11 +61,13 @@ begin ...@@ -59,11 +61,13 @@ begin
FUnauthorizedAccessProc(Format('%d: %s',[Args.Response.StatusCode, Args.Response.ContentAsText])); FUnauthorizedAccessProc(Format('%d: %s',[Args.Response.StatusCode, Args.Response.ContentAsText]));
end; end;
procedure TDMConnection.AuthConnectionError(Error: TXDataWebConnectionError); procedure TDMConnection.AuthConnectionError(Error: TXDataWebConnectionError);
begin begin
TFViewErrorPage.DisplayConnectionError(Error); TFViewErrorPage.DisplayConnectionError(Error);
end; end;
procedure TDMConnection.InitApp(SuccessProc: TSuccessProc; procedure TDMConnection.InitApp(SuccessProc: TSuccessProc;
UnauthorizedAccessProc: TUnauthorizedAccessProc); UnauthorizedAccessProc: TUnauthorizedAccessProc);
...@@ -85,7 +89,6 @@ end; ...@@ -85,7 +89,6 @@ end;
procedure TDMConnection.SetClientConfig(Callback: TVersionCheckCallback); procedure TDMConnection.SetClientConfig(Callback: TVersionCheckCallback);
begin begin
XDataWebClient1.Connection := AuthConnection; XDataWebClient1.Connection := AuthConnection;
......
...@@ -19,7 +19,7 @@ type ...@@ -19,7 +19,7 @@ type
IAuthService = interface(IInvokable) IAuthService = interface(IInvokable)
['{9CFD59B2-A832-4F82-82BB-9A25FC93F305}'] ['{9CFD59B2-A832-4F82-82BB-9A25FC93F305}']
function Login(const user, password: string): string; function Login(const user, password: string): string;
function VerifyVersion(ClientVersion: string): TJSONObject; function VerifyVersion(clientVersion: string): TJSONObject;
end; end;
implementation implementation
......
...@@ -62,11 +62,12 @@ begin ...@@ -62,11 +62,12 @@ begin
inherited; inherited;
end; end;
function TAuthService.VerifyVersion(ClientVersion: string): TJSONObject; function TAuthService.VerifyVersion(clientVersion: string): TJSONObject;
var var
iniFile: TIniFile; iniFile: TIniFile;
webClientVersion: string; webClientVersion: string;
begin begin
Logger.Log( 5, 'TAuthService.VerifyVersion(clientVersion: ' + clientVersion + ')' );
Result := TJSONObject.Create; Result := TJSONObject.Create;
TXDataOperationContext.Current.Handler.ManagedObjects.Add(Result); TXDataOperationContext.Current.Handler.ManagedObjects.Add(Result);
...@@ -82,11 +83,9 @@ begin ...@@ -82,11 +83,9 @@ begin
end; end;
if clientVersion <> webClientVersion then if clientVersion <> webClientVersion then
begin begin
//Result.AddPair('error', Logger.Log(1, 'webApp version mismatch client ver: ' + clientVersion + ' required ver: ' + webClientVersion);
//'Your browser is running version' + webClientVersion + ' when it should be running ' +
//clientVersion + sLineBreak + 'Please click below to reload.');
Result.AddPair('error', Result.AddPair('error',
'Version mismatch' + sLineBreak + ' Client version: ' + clientVersion + 'webApp version mismatch' + sLineBreak + ' Client version: ' + clientVersion +
sLineBreak + ' Server version: ' + webClientVersion + sLineBreak + ' Server version: ' + webClientVersion +
sLineBreak + 'Please click button to clear cache and reload.'); sLineBreak + 'Please click button to clear cache and reload.');
end; end;
......
...@@ -91,5 +91,10 @@ begin ...@@ -91,5 +91,10 @@ begin
Logger.Log(1, '--TServerConfig.Create - end'); Logger.Log(1, '--TServerConfig.Create - end');
end; end;
initialization
ServerConfig := TServerConfig.Create;
finalization
ServerConfig.Free;
end. end.
...@@ -10,7 +10,6 @@ object FMain: TFMain ...@@ -10,7 +10,6 @@ object FMain: TFMain
Font.Height = -11 Font.Height = -11
Font.Name = 'Tahoma' Font.Name = 'Tahoma'
Font.Style = [] Font.Style = []
OnClose = FormClose
DesignSize = ( DesignSize = (
773 773
597) 597)
......
...@@ -26,7 +26,6 @@ type ...@@ -26,7 +26,6 @@ type
procedure btnDataClick(Sender: TObject); procedure btnDataClick(Sender: TObject);
procedure btnExitClick(Sender: TObject); procedure btnExitClick(Sender: TObject);
procedure ContactFormData(AText: String); procedure ContactFormData(AText: String);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure initTimerTimer(Sender: TObject); procedure initTimerTimer(Sender: TObject);
procedure btnAuthSwaggerUIClick(Sender: TObject); procedure btnAuthSwaggerUIClick(Sender: TObject);
procedure btnQBClick(Sender: TObject); procedure btnQBClick(Sender: TObject);
...@@ -242,15 +241,6 @@ begin ...@@ -242,15 +241,6 @@ begin
end; end;
procedure TFMain.FormClose(Sender: TObject; var Action: TCloseAction);
begin
ServerConfig.Free;
AuthServerModule.Free;
ApiServerModule.Free;
AppServerModule.Free;
end;
procedure TFMain.UpdateGUI; procedure TFMain.UpdateGUI;
begin begin
if AuthServerModule.SparkleHttpSysDispatcher.Active then if AuthServerModule.SparkleHttpSysDispatcher.Active then
......
...@@ -114,11 +114,11 @@ ...@@ -114,11 +114,11 @@
<VerInfo_Locale>1033</VerInfo_Locale> <VerInfo_Locale>1033</VerInfo_Locale>
<DCC_ExeOutput>.\bin</DCC_ExeOutput> <DCC_ExeOutput>.\bin</DCC_ExeOutput>
<DCC_UnitSearchPath>C:\RADTOOLS\FastMM4;$(DCC_UnitSearchPath)</DCC_UnitSearchPath> <DCC_UnitSearchPath>C:\RADTOOLS\FastMM4;$(DCC_UnitSearchPath)</DCC_UnitSearchPath>
<VerInfo_Keys>CompanyName=EM Systems;FileDescription=$(MSBuildProjectName);FileVersion=0.9.12.1;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=0.9.11;Comments=</VerInfo_Keys> <VerInfo_Keys>CompanyName=EM Systems;FileDescription=$(MSBuildProjectName);FileVersion=0.9.13.2;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=0.9.11;Comments=</VerInfo_Keys>
<VerInfo_MajorVer>0</VerInfo_MajorVer> <VerInfo_MajorVer>0</VerInfo_MajorVer>
<VerInfo_MinorVer>9</VerInfo_MinorVer> <VerInfo_MinorVer>9</VerInfo_MinorVer>
<VerInfo_Release>12</VerInfo_Release> <VerInfo_Release>13</VerInfo_Release>
<VerInfo_Build>1</VerInfo_Build> <VerInfo_Build>2</VerInfo_Build>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Cfg_1_Win64)'!=''"> <PropertyGroup Condition="'$(Cfg_1_Win64)'!=''">
<AppDPIAwarenessMode>PerMonitorV2</AppDPIAwarenessMode> <AppDPIAwarenessMode>PerMonitorV2</AppDPIAwarenessMode>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment