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