Commit 726b409a by Elias Sarraf

cleanup & config.json

parent 9d914788
kgOrdersClient/.vscode/ kgOrdersClient/.vscode/
kgOrdersClient/__history/ kgOrdersClient/__history/
kgOrdersClient/__recovery/ kgOrdersClient/__recovery/
kgOrdersClient/TMSWeb kgOrdersClient/TMSWeb/
kgOrdersClient/Win32 kgOrdersClient/Win32/
kgOrdersClient/template/css/__history/ kgOrdersClient/css/__history/
kgOrdersClient/config/__history/
kgOrdersServer/__history kgOrdersServer/__history
kgOrdersServer/__recovery kgOrdersServer/__recovery
kgOrdersServer/doc/
kgOrdersServer/Win32/
kgOrdersServer/*.log kgOrdersServer/*.log
kgOrdersServer/*.txt kgOrdersServer/*.txt
kgOrdersServer/Source/__history kgOrdersServer/doc/
kgOrdersServer/Win32/
kgOrdersServer/Source/__history/
kgOrdersServer/Source/__recovery/ kgOrdersServer/Source/__recovery/
*.local *.local
...@@ -19,3 +20,4 @@ kgOrdersServer/Source/__recovery/ ...@@ -19,3 +20,4 @@ kgOrdersServer/Source/__recovery/
*.res *.res
*.tvsconfig *.tvsconfig
*.skincfg
...@@ -45,10 +45,6 @@ procedure LoadConfig(LoadProc: TConfigLoadedProc); ...@@ -45,10 +45,6 @@ procedure LoadConfig(LoadProc: TConfigLoadedProc);
if JS.toString(Obj['ApiUrl']) <> '' then if JS.toString(Obj['ApiUrl']) <> '' then
Config.ApiUrl := JS.toString(Obj['ApiUrl']); Config.ApiUrl := JS.toString(Obj['ApiUrl']);
if JS.toString(Obj['AppUrl']) <> '' then
Config.AppUrl := JS.toString(Obj['AppUrl']);
end; end;
finally finally
LoadProc(Config); LoadProc(Config);
......
...@@ -2,7 +2,7 @@ object DMConnection: TDMConnection ...@@ -2,7 +2,7 @@ object DMConnection: TDMConnection
Height = 264 Height = 264
Width = 395 Width = 395
object ApiConnection: TXDataWebConnection object ApiConnection: TXDataWebConnection
URL = 'http://localhost:2004/emsys/envoy/api/' URL = 'http://localhost:2004/emsys/kgOrders/api/'
OnError = ApiConnectionError OnError = ApiConnectionError
OnRequest = ApiConnectionRequest OnRequest = ApiConnectionRequest
OnResponse = ApiConnectionResponse OnResponse = ApiConnectionResponse
...@@ -10,7 +10,7 @@ object DMConnection: TDMConnection ...@@ -10,7 +10,7 @@ object DMConnection: TDMConnection
Top = 80 Top = 80
end end
object AuthConnection: TXDataWebConnection object AuthConnection: TXDataWebConnection
URL = 'http://localhost:2004/emsys/envoycalls/auth/' URL = 'http://localhost:2004/emsys/kgOrders/auth/'
OnError = AuthConnectionError OnError = AuthConnectionError
Left = 48 Left = 48
Top = 16 Top = 16
......
{ {
"AuthUrl" : "http://144.71.200.57:2004/emsys/envoy/auth/", "AuthUrl" : "http://localhost:2004/emsys/kgOrders/auth/",
"ApiUrl" : "http://144.71.200.57:2004/emsys/envoy/api/", "ApiUrl" : "http://localhost:2004/emsys/kgOrders/api/",
"AppUrl" : "http://144.71.200.57:2004/emsys/envoy/app/" }
}
\ No newline at end of file
.login-card {
display: inline-block;
width: 300px; /* Adjust width as needed */
padding: 0;
border-radius: 10px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
background-color: #fff;
}
input[type="text"] {
min-width: 50px;
max-width: 100%;
width: auto;
padding-left: 5px;
}
.card-header {
width: 100%;
text-align: left; /* Align text to the left */
background-color: #f8f9fa; /* Match the card background */
padding: 0.75rem 1.25rem;
border-bottom: 1px solid rgba(0, 0, 0, 0.125);
border-top-left-radius: 10px;
border-top-right-radius: 10px;
margin: 0; /* Remove any margin */
box-sizing: border-box; /* Ensure padding is included in the element's total width and height */
}
/* Ensure that the title does not affect the navbar layout */
#view.main.apptitle {
display: flex;
align-items: center;
justify-content: flex-start; /* Align title to the left */
width: auto; /* Ensure it doesn't stretch the container */
margin-right: 20px; /* Optional: add space between title and navbar items */
}
/* Fixed width for title area to prevent shifting */
#title {
white-space: nowrap; /* Prevent the title text from wrapping */
width: 200px; /* Fixed width for the title */
text-overflow: ellipsis; /* Truncate text with ellipsis if it overflows */
overflow: hidden;
font-weight: bold; /* Optional: make the title text bold */
}
/* Navbar items - keep them aligned and spaced out */
.navbar-nav .nav-item {
padding: 0 15px; /* Adjust spacing between navbar items */
}
/* Flexbox for the entire navbar */
.navbar-nav {
display: flex;
justify-content: flex-end; /* Align navbar items to the right */
width: 100%;
}
/* Additional mobile responsiveness (optional) */
@media (max-width: 1200px) {
.navbar-nav {
flex-direction: column; /* Stack items vertically on smaller screens */
align-items: flex-start; /* Align items to the left */
}
.navbar-nav-spaced .nav-item {
padding: 10px 0; /* Adjust vertical spacing between items */
}
}
/* Make sure active navbar item color gets applied */
.navbar-nav .nav-item a.active {
color: #fff !important; /* Set text color to white for active item */
background-color: #004F84 !important; /* Darker blue for active background */
font-weight: bold;
}
/* Default navbar item color */
.navbar-nav .nav-item a {
color: #000 !important; /* Default color for links */
transition: color 0.3s ease;
}
/* Navbar item hover state */
.navbar-nav .nav-item a:hover {
color: #fff !important; /* Set hover text color to white */
background-color: #286090 !important; /* Light blue on hover */
}
.nav-item {
padding: 0 20px; /* Adjust this value for desired spacing between labels */
}
.mr-2 {
margin-right: 0.5rem;
}
.custom-h4 {
margin-bottom: 5px;
}
.custom-hr {
margin-top: 5px;
margin-bottom: 10px;
}
.custom-select-large {
font-size: 1.25rem;
padding: 0.5rem;
height: 2.5rem;
}
.player-container {
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
background-color: #fff;
border: 1px solid #ccc;
padding: 20px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
z-index: 1000;
}
.player-container audio {
width: 100%;
}
.close-btn {
position: absolute;
top: 10px;
right: 10px;
cursor: pointer;
}
.card-title {
margin: 0;
font-size: 1.25rem; /* Adjust font size as needed */
}
.card-body {
padding: 2rem;
}
.table tbody tr:hover {
background-color: #d1e7fd; /* Light blue color for hover effect */
cursor: pointer;
}
.form-input{
display: table;
}
.form-cells{
display: table-cell
}
.table tbody tr {
transition: background-color 0.3s ease;
}
.table {
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
border-radius: 5px;
}
.navbar-nav {
margin-left: auto; /* Align the dropdown to the right */
}
.container {
margin-top: 50px; /* Adjust the top margin as needed */
}
@media (max-width: 1200px) {
.table-responsive {
display: block;
width: 100%;
overflow-x: auto;
-webkit-overflow-scrolling: touch;
}
.table thead {
display: none;
}
.table tbody, .table tr, .table td {
display: block;
width: 100%;
}
.table tr {
margin-bottom: 1rem;
}
.table td {
text-align: right;
padding-left: 50%; /* Adjust padding to accommodate the data-label */
position: relative;
}
.table td::before {
content: attr(data-label);
position: absolute;
left: 0;
width: 50%;
padding-left: 15px; /* Adjust as necessary */
font-weight: bold;
text-align: left;
}
.table td .transcript {
margin-top: 20px; /* Set top margin to 20px */
text-align: left; /* Ensure text alignment is left */
margin-left: 8px;
white-space: normal; /* Prevent text from being cut off */
}
}
.btn-primary {
background-color: #286090 !important;
border-color: #286090 !important;
color: #fff !important;
}
.btn-primary:hover {
background-color: #204d74 !important;
border-color: #204d74 !important;
}
.login-navbar {
max-width: 1200px; /* Set the max-width to match a medium screen */
margin: auto;
border-bottom-left-radius: 10px; /* Round the bottom left corner */
border-bottom-right-radius: 10px; /* Round the bottom right corner */
border: 1px solid #d3d3d3;
}
.navbar-toggler {
display: none;
}
.dropdown-menu a {
display: flex; /* Use flexbox for alignment */
align-items: center; /* Vertically center the content */
width: 100%; /* Ensure they take up the full width */
padding: 0.5rem 1rem; /* Add padding to make them clickable */
color: #000; /* Adjust the text color if necessary */
text-decoration: none; /* Remove underlines */
}
.dropdown-menu a:hover {
background-color: #204d74;
color: #fff;
}
.dropdown-menu a span {
flex-grow: 1; /* Make the span take up the remaining space */
}
/* Style for the selected number */
.selected-number .page-link {
background-color: #204d74;
color: #fff !important;
}
/* Style for the unselected numbers and text (previous/next) */
.pagination .page-item a,
.pagination .page-item span {
color: #204d74;
}
.pagination .page-item.active .page-link,
.pagination .page-item.active .page-link:hover,
.pagination .page-item.active .page-link:focus {
background-color: #204d74;
border-color: #204d74;
color: #fff !important;
}
.grid-container {
position: relative; /* Ensure the container is the reference for child positioning */
height: 400px; /* Set the height for the grid */
width: 100%; /* Full width of the parent container */
overflow: hidden; /* Prevent unintended overflow */
}
#TFAddOrder_TMSFNCGrid2 {
top: 0px !important; /* Reset the top offset */
left: 0px !important; /* Reset the left offset */
position: absolute !important; /* Use relative positioning to align with the grid container */
}
#TFAddOrder_TMSFNCGrid2_Canvas {
position: relative !important; /* Ensure absolute positioning within the parent */
width: 100% !important; /* Make the canvas fill the container width */
height: 100% !important; /* Make the canvas fill the container height */
left: 0px !important; /* Align canvas to the left */
}
#TFAddOrder_ScrollBar5 {
top: 0px !important; /* Align scrollbar to the top */
right: 0px !important; /* Align scrollbar to the right edge */
position: absolute !important; /* Position within the grid container */
height: 400px !important; /* Match the height of the grid container */
box-sizing: border-box !important; /* Prevent borders from affecting dimensions */
}
.login-card {
display: inline-block;
width: 300px; /* Adjust width as needed */
padding: 0;
border-radius: 10px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
background-color: #fff;
}
input[type="text"] {
min-width: 50px;
max-width: 100%;
width: auto;
padding-left: 5px;
}
.card-header {
width: 100%;
text-align: left; /* Align text to the left */
background-color: #f8f9fa; /* Match the card background */
padding: 0.75rem 1.25rem;
border-bottom: 1px solid rgba(0, 0, 0, 0.125);
border-top-left-radius: 10px;
border-top-right-radius: 10px;
margin: 0; /* Remove any margin */
box-sizing: border-box; /* Ensure padding is included in the element's total width and height */
}
/* Ensure that the title does not affect the navbar layout */
#view.main.apptitle {
display: flex;
align-items: center;
justify-content: flex-start; /* Align title to the left */
width: auto; /* Ensure it doesn't stretch the container */
margin-right: 20px; /* Optional: add space between title and navbar items */
}
/* Fixed width for title area to prevent shifting */
#title {
white-space: nowrap; /* Prevent the title text from wrapping */
width: 200px; /* Fixed width for the title */
text-overflow: ellipsis; /* Truncate text with ellipsis if it overflows */
overflow: hidden;
font-weight: bold; /* Optional: make the title text bold */
}
/* Navbar items - keep them aligned and spaced out */
.navbar-nav .nav-item {
padding: 0 15px; /* Adjust spacing between navbar items */
}
/* Flexbox for the entire navbar */
.navbar-nav {
display: flex;
justify-content: flex-end; /* Align navbar items to the right */
width: 100%;
}
/* Additional mobile responsiveness (optional) */
@media (max-width: 1200px) {
.navbar-nav {
flex-direction: column; /* Stack items vertically on smaller screens */
align-items: flex-start; /* Align items to the left */
}
.navbar-nav-spaced .nav-item {
padding: 10px 0; /* Adjust vertical spacing between items */
}
}
/* Make sure active navbar item color gets applied */
.navbar-nav .nav-item a.active {
color: #fff !important; /* Set text color to white for active item */
background-color: #004F84 !important; /* Darker blue for active background */
font-weight: bold;
}
/* Default navbar item color */
.navbar-nav .nav-item a {
color: #000 !important; /* Default color for links */
transition: color 0.3s ease;
}
/* Navbar item hover state */
.navbar-nav .nav-item a:hover {
color: #fff !important; /* Set hover text color to white */
background-color: #286090 !important; /* Light blue on hover */
}
.nav-item {
padding: 0 20px; /* Adjust this value for desired spacing between labels */
}
.mr-2 {
margin-right: 0.5rem;
}
.custom-h4 {
margin-bottom: 5px;
}
.custom-hr {
margin-top: 5px;
margin-bottom: 10px;
}
.custom-select-large {
font-size: 1.25rem;
padding: 0.5rem;
height: 2.5rem;
}
.player-container {
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
background-color: #fff;
border: 1px solid #ccc;
padding: 20px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
z-index: 1000;
}
.player-container audio {
width: 100%;
}
.close-btn {
position: absolute;
top: 10px;
right: 10px;
cursor: pointer;
}
.card-title {
margin: 0;
font-size: 1.25rem; /* Adjust font size as needed */
}
.card-body {
padding: 2rem;
}
.table tbody tr:hover {
background-color: #d1e7fd; /* Light blue color for hover effect */
cursor: pointer;
}
.form-input{
display: table;
}
.form-cells{
display: table-cell
}
.table tbody tr {
transition: background-color 0.3s ease;
}
.table {
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
border-radius: 5px;
}
.navbar-nav {
margin-left: auto; /* Align the dropdown to the right */
}
.container {
margin-top: 50px; /* Adjust the top margin as needed */
}
@media (max-width: 1200px) {
.table-responsive {
display: block;
width: 100%;
overflow-x: auto;
-webkit-overflow-scrolling: touch;
}
.table thead {
display: none;
}
.table tbody, .table tr, .table td {
display: block;
width: 100%;
}
.table tr {
margin-bottom: 1rem;
}
.table td {
text-align: right;
padding-left: 50%; /* Adjust padding to accommodate the data-label */
position: relative;
}
.table td::before {
content: attr(data-label);
position: absolute;
left: 0;
width: 50%;
padding-left: 15px; /* Adjust as necessary */
font-weight: bold;
text-align: left;
}
.table td .transcript {
margin-top: 20px; /* Set top margin to 20px */
text-align: left; /* Ensure text alignment is left */
margin-left: 8px;
white-space: normal; /* Prevent text from being cut off */
}
}
.btn-primary {
background-color: #286090 !important;
border-color: #286090 !important;
color: #fff !important;
}
.btn-primary:hover {
background-color: #204d74 !important;
border-color: #204d74 !important;
}
.login-navbar {
max-width: 1200px; /* Set the max-width to match a medium screen */
margin: auto;
border-bottom-left-radius: 10px; /* Round the bottom left corner */
border-bottom-right-radius: 10px; /* Round the bottom right corner */
border: 1px solid #d3d3d3;
}
.navbar-toggler {
display: none;
}
.dropdown-menu a {
display: flex; /* Use flexbox for alignment */
align-items: center; /* Vertically center the content */
width: 100%; /* Ensure they take up the full width */
padding: 0.5rem 1rem; /* Add padding to make them clickable */
color: #000; /* Adjust the text color if necessary */
text-decoration: none; /* Remove underlines */
}
.dropdown-menu a:hover {
background-color: #204d74;
color: #fff;
}
.dropdown-menu a span {
flex-grow: 1; /* Make the span take up the remaining space */
}
/* Style for the selected number */
.selected-number .page-link {
background-color: #204d74;
color: #fff !important;
}
/* Style for the unselected numbers and text (previous/next) */
.pagination .page-item a,
.pagination .page-item span {
color: #204d74;
}
.pagination .page-item.active .page-link,
.pagination .page-item.active .page-link:hover,
.pagination .page-item.active .page-link:focus {
background-color: #204d74;
border-color: #204d74;
color: #fff !important;
}
.grid-container {
position: relative; /* Ensure the container is the reference for child positioning */
height: 400px; /* Set the height for the grid */
width: 100%; /* Full width of the parent container */
overflow: hidden; /* Prevent unintended overflow */
}
...@@ -66,6 +66,6 @@ begin ...@@ -66,6 +66,6 @@ begin
Application.Initialize; Application.Initialize;
Application.MainFormOnTaskbar := True; Application.MainFormOnTaskbar := True;
Application.CreateForm(TDMConnection, DMConnection); Application.CreateForm(TDMConnection, DMConnection);
Application.Run;
DMConnection.InitApp(@StartApplication, @UnauthorizedAccessProc); DMConnection.InitApp(@StartApplication, @UnauthorizedAccessProc);
Application.Run;
end. end.
...@@ -90,11 +90,11 @@ ...@@ -90,11 +90,11 @@
<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=1.3.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=;LastCompiledTime=2018/08/27 15:18:29</VerInfo_Keys> <VerInfo_Keys>CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=;LastCompiledTime=2018/08/27 15:18:29</VerInfo_Keys>
<AppDPIAwarenessMode>PerMonitor</AppDPIAwarenessMode> <AppDPIAwarenessMode>PerMonitor</AppDPIAwarenessMode>
<VerInfo_MinorVer>3</VerInfo_MinorVer>
<TMSUseJSDebugger>2</TMSUseJSDebugger> <TMSUseJSDebugger>2</TMSUseJSDebugger>
<TMSWebSingleInstance>1</TMSWebSingleInstance> <TMSWebSingleInstance>1</TMSWebSingleInstance>
<TMSWebBrowser>5</TMSWebBrowser>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Cfg_2)'!=''"> <PropertyGroup Condition="'$(Cfg_2)'!=''">
<DCC_LocalDebugSymbols>false</DCC_LocalDebugSymbols> <DCC_LocalDebugSymbols>false</DCC_LocalDebugSymbols>
...@@ -178,6 +178,7 @@ ...@@ -178,6 +178,7 @@
</DCCReference> </DCCReference>
<None Include="index.html"/> <None Include="index.html"/>
<None Include="css\app.css"/> <None Include="css\app.css"/>
<None Include="config\config.json"/>
<BuildConfiguration Include="Base"> <BuildConfiguration Include="Base">
<Key>Base</Key> <Key>Base</Key>
</BuildConfiguration> </BuildConfiguration>
...@@ -213,6 +214,12 @@ ...@@ -213,6 +214,12 @@
<Overwrite>true</Overwrite> <Overwrite>true</Overwrite>
</Platform> </Platform>
</DeployFile> </DeployFile>
<DeployFile LocalName="config\config.json" Configuration="Debug" Class="ProjectFile">
<Platform Name="Win32">
<RemoteDir>.\</RemoteDir>
<Overwrite>true</Overwrite>
</Platform>
</DeployFile>
<DeployFile LocalName="css\app.css" Configuration="Debug" Class="ProjectFile"> <DeployFile LocalName="css\app.css" Configuration="Debug" Class="ProjectFile">
<Platform Name="Win32"> <Platform Name="Win32">
<RemoteDir>.\</RemoteDir> <RemoteDir>.\</RemoteDir>
......
...@@ -20,7 +20,6 @@ type ...@@ -20,7 +20,6 @@ type
{ Private declarations } { Private declarations }
public public
{ Public declarations } { Public declarations }
procedure SetLoginAuditEntry( userStr: string );
end; end;
var var
...@@ -40,20 +39,31 @@ uses ...@@ -40,20 +39,31 @@ uses
procedure TAuthDatabase.DataModuleCreate(Sender: TObject); procedure TAuthDatabase.DataModuleCreate(Sender: TObject);
var var
IniFile: TIniFile; iniFile: TIniFile;
iniStr: string; iniStr: string;
begin begin
IniFile := TIniFile.Create( ChangeFileExt(Application.ExeName, '.ini') ); iniFile := TIniFile.Create( ExtractFilePath(Application.ExeName) + 'kgOrdersServer.ini' );
try try
iniStr := IniFile.ReadString( 'Database', 'Server', '' );
if iniStr.IsEmpty then iniStr := iniFile.ReadString('Database', 'Server', '');
Logger.Log( 1, 'iniFile: ' + ChangeFileExt(Application.ExeName, '.ini') + if not iniStr.IsEmpty then
' Database->Server: Entry not found' )
else
begin
Logger.Log( 1, 'iniFile: ' + ChangeFileExt(Application.ExeName, '.ini') +
' Database->Server: ' + iniStr );
ucKG.Server := iniStr; ucKG.Server := iniStr;
iniStr := iniFile.ReadString('Database', 'Database', '');
if not iniStr.IsEmpty then
ucKG.Database := iniStr;
iniStr := iniFile.ReadString('Database', 'Username', '');
if not iniStr.IsEmpty then
ucKG.Username := iniStr;
iniStr := iniFile.ReadString('Database', 'Password', '');
if not iniStr.IsEmpty then
ucKG.Password := iniStr;
try
ucKG.Connect;
except
on E: Exception do
begin
Logger.Log(5, 'Failed to connect to auth database: ' + E.Message);
end;
end; end;
Logger.Log(1, ''); Logger.Log(1, '');
...@@ -67,34 +77,5 @@ begin ...@@ -67,34 +77,5 @@ begin
ucKG.Connected := false; ucKG.Connected := false;
end; end;
procedure TAuthDatabase.SetLoginAuditEntry( userStr: string );
var
auditMasterId: string;
userInfo: TStringList;
entry: string;
username: string;
fullname: string;
agency: string;
userid: string;
personnelid: string;
admin: boolean;
i: Integer;
begin
Logger.Log( 3, 'TAuthDatabase.SetLoginAuditEntry - start' );
userInfo := TStringList.Create;
try
userInfo.Delimiter := '&';
userInfo.StrictDelimiter := True;
userInfo.DelimitedText := userStr;
username := userInfo.Values['username'];
fullname := userInfo.Values['fullname'];
userid := userInfo.Values['userId'];
personnelid := userInfo.Values['personnelid'];
finally
userInfo.Free;
end;
end;
end. end.
...@@ -6,7 +6,7 @@ unit Common.Config; ...@@ -6,7 +6,7 @@ unit Common.Config;
interface interface
const const
defaultServerUrl = 'http://localhost:2004/emsys/envoycalls/'; defaultServerUrl = 'http://localhost:2004/emsys/kgOrders/';
type type
TServerConfig = class TServerConfig = class
...@@ -15,16 +15,12 @@ type ...@@ -15,16 +15,12 @@ type
FJWTTokenSecret: string; FJWTTokenSecret: string;
FAdminPassword: string; FAdminPassword: string;
FWebAppFolder: string; FWebAppFolder: string;
FMemoLogLevel: Integer;
FFileLogLevel: Integer;
public public
constructor Create; constructor Create;
property url: string read FUrl write FUrl; property url: string read FUrl write FUrl;
property jwtTokenSecret: string read FJWTTokenSecret write FJWTTokenSecret; property jwtTokenSecret: string read FJWTTokenSecret write FJWTTokenSecret;
property adminPassword: string read FAdminPassword write FAdminPassword; property adminPassword: string read FAdminPassword write FAdminPassword;
property webAppFolder: string read FWebAppFolder write FWebAppFolder; property webAppFolder: string read FWebAppFolder write FWebAppFolder;
property memoLogLevel: Integer read FMemoLogLevel write FMemoLogLevel;
property fileLogLevel: Integer read FFileLogLevel write FFileLogLevel;
end; end;
procedure LoadServerConfig; procedure LoadServerConfig;
...@@ -65,8 +61,6 @@ begin ...@@ -65,8 +61,6 @@ begin
Logger.Log( 1, '-- serverConfig.adminPassword: ' + serverConfig.adminPassword ); Logger.Log( 1, '-- serverConfig.adminPassword: ' + serverConfig.adminPassword );
Logger.Log( 1, '-- serverConfig.jwtTokenSecret: ' + serverConfig.jwtTokenSecret ); Logger.Log( 1, '-- serverConfig.jwtTokenSecret: ' + serverConfig.jwtTokenSecret );
Logger.Log( 1, '-- serverConfig.webAppFolder: ' + serverConfig.webAppFolder ); Logger.Log( 1, '-- serverConfig.webAppFolder: ' + serverConfig.webAppFolder );
Logger.Log( 1, '-- serverConfig.memoLogLevel: ' + IntToStr(serverConfig.memoLogLevel) );
Logger.Log( 1, '-- serverConfig.fileLogLevel: ' + IntToStr(serverConfig.fileLogLevel) );
Logger.Log( 1, '--LoadServerConfig - end' ); Logger.Log( 1, '--LoadServerConfig - end' );
end; end;
...@@ -82,8 +76,6 @@ begin ...@@ -82,8 +76,6 @@ begin
adminPassword := 'whatisthisusedfor'; adminPassword := 'whatisthisusedfor';
jwtTokenSecret := 'super_secret0123super_secret4567'; jwtTokenSecret := 'super_secret0123super_secret4567';
webAppFolder := 'static'; webAppFolder := 'static';
memoLogLevel := 3;
fileLogLevel := 4;
// ServerConfigStr := Bcl.Json.TJson.Serialize( ServerConfig ); // ServerConfigStr := Bcl.Json.TJson.Serialize( ServerConfig );
// ConfigFile := 'serverconfig.json'; // ConfigFile := 'serverconfig.json';
// TFile.WriteAllText( ConfigFile, ServerConfigStr ); // TFile.WriteAllText( ConfigFile, ServerConfigStr );
......
...@@ -21,6 +21,12 @@ object FMain: TFMain ...@@ -21,6 +21,12 @@ object FMain: TFMain
Width = 753 Width = 753
Height = 549 Height = 549
Anchors = [akLeft, akTop, akRight, akBottom] Anchors = [akLeft, akTop, akRight, akBottom]
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Lucida Console'
Font.Style = []
ParentFont = False
ReadOnly = True ReadOnly = True
TabOrder = 0 TabOrder = 0
end end
......
...@@ -28,8 +28,6 @@ type ...@@ -28,8 +28,6 @@ type
procedure btnAuthSwaggerUIClick(Sender: TObject); procedure btnAuthSwaggerUIClick(Sender: TObject);
strict private strict private
phoneDict: TDictionary<string, string>;
procedure StartServers; procedure StartServers;
procedure UpdateGUI; procedure UpdateGUI;
end; end;
...@@ -97,36 +95,47 @@ procedure TFMain.StartServers; ...@@ -97,36 +95,47 @@ procedure TFMain.StartServers;
// Reads from the ini file to figure out what IP the database is located at and // Reads from the ini file to figure out what IP the database is located at and
// whether or not Twilio automatic updates should be enabled // whether or not Twilio automatic updates should be enabled
var var
iniFilename: string;
iniFile: TIniFile; iniFile: TIniFile;
iniStr: string; iniStr: string;
begin begin
// this looks ok in the log file but not in the memo on the form // this looks ok in the log file but not in the memo on the form
Logger.Log(1, '*******************************************************'); Logger.Log( 1, '*******************************************************' );
Logger.Log(1, '* kgOrders Server - beta ver. *'); Logger.Log( 1, '* kgOrdersServer - ver 1.1.0 *' );
Logger.Log(1, '* Developed by EM Systems, Inc. *'); Logger.Log( 1, '* Developed by EM Systems, Inc. *' );
Logger.Log(1, '*******************************************************'); Logger.Log( 1, '*******************************************************' );
Logger.Log(1, ''); Logger.Log( 1, '' );
Logger.Log(1, 'TMemoLogAppender - logLevel: ' + IntToStr(serverConfig.memoLogLevel));
Logger.Log(1, 'TFileLogAppender - logLevel: ' + IntToStr(serverConfig.fileLogLevel)); iniFile := TIniFile.Create( ExtractFilePath(Application.ExeName) + 'kgOrdersServer.ini' );
Logger.Log(1, '');
iniFilename := ChangeFileExt(Application.ExeName, '.ini');
Logger.Log( 1, 'iniFilename: ' + iniFileName);
iniFile := TIniFile.Create( iniFilename );
try try
iniStr := iniFile.ReadString( 'Options', 'LogFileNum', '' ); Logger.Log( 1, 'iniFile: ' + ExtractFilePath(Application.ExeName) + 'kgOrdersServer.ini' );
Logger.Log( 1, 'LogLevels are displayed here. They were set in kgOrders.dpr, it executes first' );
iniStr := iniFile.ReadString( 'Settings', 'MemoLogLevel', '' );
if iniStr.IsEmpty then
Logger.Log( 1, '--Settings->memoLogLevel: Entry not found - default: 3' )
else
Logger.Log( 1, '--Settings->memoLogLevel: ' + iniStr );
iniStr := iniFile.ReadString( 'Settings', 'FileLogLevel', '' );
if iniStr.IsEmpty then if iniStr.IsEmpty then
Logger.Log( 1, '--Options->LogFileNum: Entry not found' ) Logger.Log( 1, '--Settings->fileLogLevel: Entry not found - default: 4' )
else else
Logger.Log( 1, '--Options->LogFileNum: ' + IntToStr(StrToInt(iniStr) - 1) ); Logger.Log( 1, '--Settings->fileLogLevel: ' + iniStr );
Logger.Log( 1, '' );
iniStr := iniFile.ReadString( 'Settings', 'LogFileNum', '' );
if iniStr.IsEmpty then
Logger.Log( 1, '--Settings->LogFileNum: Entry not found' )
else
Logger.Log( 1, '--Settings->LogFileNum: ' + IntToStr(StrToInt(iniStr) - 1) );
iniStr := IniFile.ReadString( 'Database', 'Server', '' ); iniStr := IniFile.ReadString( 'Database', 'Server', '' );
if iniStr.IsEmpty then if iniStr.IsEmpty then
Logger.Log( 1, '--Database->Server: Entry not found' ) Logger.Log( 1, '--Database->Server: Entry not found' )
else else
Logger.Log( 1, '--Database->Server: ' + iniStr ); Logger.Log( 1, '--Database->Server: ' + iniStr );
Logger.Log(1, '');
Logger.Log( 1, '' );
finally finally
IniFile.Free; IniFile.Free;
end; end;
...@@ -143,7 +152,6 @@ end; ...@@ -143,7 +152,6 @@ end;
procedure TFMain.FormClose(Sender: TObject; var Action: TCloseAction); procedure TFMain.FormClose(Sender: TObject; var Action: TCloseAction);
begin begin
phoneDict.Free;
ServerConfig.Free; ServerConfig.Free;
AuthServerModule.Free; AuthServerModule.Free;
ApiServerModule.Free; ApiServerModule.Free;
......
...@@ -150,11 +150,23 @@ end; ...@@ -150,11 +150,23 @@ end;
{$R *.res} {$R *.res}
var
iniFile: TIniFile;
memoLogLevel: Integer;
fileLogLevel: Integer;
begin begin
ReportMemoryLeaksOnShutdown := True; ReportMemoryLeaksOnShutdown := True;
Application.Initialize; Application.Initialize;
Application.MainFormOnTaskbar := True; Application.MainFormOnTaskbar := True;
Application.CreateForm(TFMain, FMain); Application.CreateForm(TFMain, FMain);
iniFile := TIniFile.Create( ExtractFilePath(Application.ExeName) + 'kgOrdersServer.ini' );
try
memoLogLevel := iniFile.ReadInteger( 'Settings', 'memoLogLevel', 3 );
fileLogLevel := iniFile.ReadInteger( 'Settings', 'memoLogLevel', 4 );
finally
iniFile.Free;
end;
Logger.AddAppender(TMemoLogAppender.Create( 5, FMain.memoinfo )); Logger.AddAppender(TMemoLogAppender.Create( 5, FMain.memoinfo ));
Logger.AddAppender(TFileLogAppender.Create( 5, 'kgOrdersServer' )); Logger.AddAppender(TFileLogAppender.Create( 5, 'kgOrdersServer' ));
Application.Run; Application.Run;
......
[Options] [Settings]
LogFileNum=37 MemoLogLevel=3
FileLogLevel=5
LogFileNum=20
webClientVersion=1.0.0
[Database] [Database]
--Server=192.168.159.132 --Server=192.168.159.132
--Server=192.168.198.131 Server=192.168.198.131
Server=192.168.75.133 --Server=192.168.75.133
Password=emsys!012
[Options]
LogFileNum=6
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