Commit 9cdc7cfd by Mac Stephens

Fix mobile login alerts, add password visibility toggle, and prevent WebSocket send lockups

parent 755708ae
...@@ -13,6 +13,7 @@ uses ...@@ -13,6 +13,7 @@ uses
const const
WEBSOCKET_PORT = 8091; WEBSOCKET_PORT = 8091;
WEBSOCKET_SEND_TIMEOUT_MS = 5000;
HEARTBEAT_TIMEOUT_MS = 75000; HEARTBEAT_TIMEOUT_MS = 75000;
HEARTBEAT_SWEEP_INTERVAL_MS = 10000; HEARTBEAT_SWEEP_INTERVAL_MS = 10000;
...@@ -82,8 +83,12 @@ implementation ...@@ -82,8 +83,12 @@ implementation
uses uses
System.DateUtils, System.DateUtils,
IdStackConsts,
Common.Logging; Common.Logging;
type
TWebSocketServerConnectionAccess = class(TTMSFNCWebSocketServerConnection);
constructor TWebSocketManager.Create; constructor TWebSocketManager.Create;
begin begin
inherited Create; inherited Create;
...@@ -306,6 +311,9 @@ var ...@@ -306,6 +311,9 @@ var
begin begin
CreateGUID(guid); CreateGUID(guid);
TWebSocketServerConnectionAccess(AConnection).Connection.Socket.Binding.SetSockOpt(
Id_SOL_SOCKET, Id_SO_SNDTIMEO, WEBSOCKET_SEND_TIMEOUT_MS);
client := TConnectedClient.Create; client := TConnectedClient.Create;
client.ConnectionId := GUIDToString(guid); client.ConnectionId := GUIDToString(guid);
client.ConnectedAt := Now; client.ConnectedAt := Now;
......
[Settings] [Settings]
LogFileNum=104 LogFileNum=107
webClientVersion=0.9.4.3 webClientVersion=0.9.4.3
[Database] [Database]
Server=192.168.91.129 --Server=192.168.91.129
--Server=192.168.102.10 Server=192.168.102.10
--Server=192.168.56.129 --Server=192.168.56.129
--Port=5432 --Port=5432
--Port=5433 --Port=5433
......
...@@ -41,6 +41,18 @@ object FViewLogin: TFViewLogin ...@@ -41,6 +41,18 @@ object FViewLogin: TFViewLogin
TextHint = 'Password' TextHint = 'Password'
WidthPercent = 100.000000000000000000 WidthPercent = 100.000000000000000000
end end
object btnShowPassword: TWebButton
Left = 367
Top = 163
Width = 50
Height = 21
Caption = 'Show'
ElementID = 'view.login.btnshowpassword'
HeightPercent = 100.000000000000000000
TabOrder = 2
WidthPercent = 100.000000000000000000
OnClick = btnShowPasswordClick
end
object btnLogin: TWebButton object btnLogin: TWebButton
Left = 240 Left = 240
Top = 217 Top = 217
...@@ -49,7 +61,7 @@ object FViewLogin: TFViewLogin ...@@ -49,7 +61,7 @@ object FViewLogin: TFViewLogin
Caption = 'Login' Caption = 'Login'
ElementID = 'view.login.btnlogin' ElementID = 'view.login.btnlogin'
HeightPercent = 100.000000000000000000 HeightPercent = 100.000000000000000000
TabOrder = 2 TabOrder = 3
WidthPercent = 100.000000000000000000 WidthPercent = 100.000000000000000000
OnClick = btnLoginClick OnClick = btnLoginClick
end end
...@@ -59,7 +71,7 @@ object FViewLogin: TFViewLogin ...@@ -59,7 +71,7 @@ object FViewLogin: TFViewLogin
Width = 121 Width = 121
Height = 33 Height = 33
ElementID = 'view.login.message' ElementID = 'view.login.message'
TabOrder = 3 TabOrder = 4
object lblMessage: TWebLabel object lblMessage: TWebLabel
Left = 16 Left = 16
Top = 11 Top = 11
......
...@@ -37,10 +37,17 @@ ...@@ -37,10 +37,17 @@
autofocus> autofocus>
</div> </div>
<div class="mb-3"> <div class="mb-3">
<input id="view.login.edtpassword" <div class="input-group">
class="form-control" <input id="view.login.edtpassword"
type="password" class="form-control"
placeholder="Password"> type="password"
placeholder="Password">
<button id="view.login.btnshowpassword"
class="btn btn-outline-secondary"
type="button">
Show
</button>
</div>
</div> </div>
<div class="mb-3"> <div class="mb-3">
<select id="view.login.edtagency" class="form-select"> <select id="view.login.edtagency" class="form-select">
......
...@@ -13,6 +13,7 @@ type ...@@ -13,6 +13,7 @@ type
WebLabel1: TWebLabel; WebLabel1: TWebLabel;
edtUsername: TWebEdit; edtUsername: TWebEdit;
edtPassword: TWebEdit; edtPassword: TWebEdit;
btnShowPassword: TWebButton;
btnLogin: TWebButton; btnLogin: TWebButton;
pnlMessage: TWebPanel; pnlMessage: TWebPanel;
lblMessage: TWebLabel; lblMessage: TWebLabel;
...@@ -20,6 +21,7 @@ type ...@@ -20,6 +21,7 @@ type
XDataWebClient: TXDataWebClient; XDataWebClient: TXDataWebClient;
lucbAgency: TWebLookupComboBox; lucbAgency: TWebLookupComboBox;
procedure btnLoginClick(Sender: TObject); procedure btnLoginClick(Sender: TObject);
procedure btnShowPasswordClick(Sender: TObject);
procedure btnCloseNotificationClick(Sender: TObject); procedure btnCloseNotificationClick(Sender: TObject);
procedure WebFormCreate(Sender: TObject); procedure WebFormCreate(Sender: TObject);
private private
...@@ -100,6 +102,23 @@ begin ...@@ -100,6 +102,23 @@ begin
end; end;
procedure TFViewLogin.btnShowPasswordClick(Sender: TObject);
begin
if edtPassword.PasswordChar = #0 then
begin
edtPassword.PasswordChar := '*';
edtPassword.ElementHandle.setAttribute('type', 'password');
btnShowPassword.Caption := 'Show';
end
else
begin
edtPassword.PasswordChar := #0;
edtPassword.ElementHandle.setAttribute('type', 'text');
btnShowPassword.Caption := 'Hide';
end;
end;
procedure TFViewLogin.GetAgencyConfigList; procedure TFViewLogin.GetAgencyConfigList;
procedure OnLoad(Response: TXDataClientResponse); procedure OnLoad(Response: TXDataClientResponse);
...@@ -146,14 +165,14 @@ begin ...@@ -146,14 +165,14 @@ begin
if Notification <> '' then if Notification <> '' then
begin begin
lblMessage.Caption := Notification; lblMessage.Caption := Notification;
pnlMessage.ElementHandle.hidden := False; pnlMessage.ElementHandle.classList.remove('d-none');
end; end;
end; end;
procedure TFViewLogin.HideNotification; procedure TFViewLogin.HideNotification;
begin begin
pnlMessage.ElementHandle.hidden := True; pnlMessage.ElementHandle.classList.add('d-none');
end; end;
......
...@@ -91,13 +91,13 @@ ...@@ -91,13 +91,13 @@
<DCC_RemoteDebug>false</DCC_RemoteDebug> <DCC_RemoteDebug>false</DCC_RemoteDebug>
<VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo> <VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
<VerInfo_Locale>1033</VerInfo_Locale> <VerInfo_Locale>1033</VerInfo_Locale>
<VerInfo_Keys>CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=0.9.4.1;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=0.9.3.0;Comments=;LastCompiledTime=2018/08/27 15:18:29</VerInfo_Keys> <VerInfo_Keys>CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=0.9.4.3;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=0.9.3.0;Comments=;LastCompiledTime=2018/08/27 15:18:29</VerInfo_Keys>
<AppDPIAwarenessMode>PerMonitor</AppDPIAwarenessMode> <AppDPIAwarenessMode>PerMonitor</AppDPIAwarenessMode>
<VerInfo_MinorVer>9</VerInfo_MinorVer> <VerInfo_MinorVer>9</VerInfo_MinorVer>
<VerInfo_MajorVer>0</VerInfo_MajorVer> <VerInfo_MajorVer>0</VerInfo_MajorVer>
<VerInfo_Release>4</VerInfo_Release> <VerInfo_Release>4</VerInfo_Release>
<VerInfo_Build>3</VerInfo_Build>
<TMSWebSingleInstance>1</TMSWebSingleInstance> <TMSWebSingleInstance>1</TMSWebSingleInstance>
<VerInfo_Build>1</VerInfo_Build>
<TMSWebBrowser>1</TMSWebBrowser> <TMSWebBrowser>1</TMSWebBrowser>
<TMSWebOutputPath>..\emiMobileServer\bin\static</TMSWebOutputPath> <TMSWebOutputPath>..\emiMobileServer\bin\static</TMSWebOutputPath>
<TMSUseJSDebugger>2</TMSUseJSDebugger> <TMSUseJSDebugger>2</TMSUseJSDebugger>
......
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