Commit 6ec6e6bb by cam

removed last remaining envoy references and added image to login page

parent cd6b2e67
......@@ -7,7 +7,7 @@ uses
XData.Web.Client;
const
TOKEN_NAME = 'WEBENVOYCALLS_TOKEN';
TOKEN_NAME = 'KG_ORDERS_WEB_TOKEN';
type
TOnLoginSuccess = reference to procedure;
......
<div class="row">
<div class="col-12">
<h1 class="page-header pt-3" id="view.calls.title" style="font-size: 24px;">Users</h1>
<h1 class="page-header pt-3" id="view.edituser.title" style="font-size: 24px;">Users</h1>
<div class="container mt-4">
<div class="row justify-content-center">
<div class="col-12 col-md-8">
......
<div class="row">
<div class="col-12">
<h1 class="page-header pt-3" id="view.calls.title" style="font-size: 24px;">Calls</h1>
<h1 class="page-header pt-3" id="view.items.title" style="font-size: 24px;">Items</h1>
<div class="container mt-4">
<div class="row justify-content-center">
<div class="col-12 col-md-8">
......
// Displays calls and their associated recordings in the grid. Allows the user
// Displays items in the grid. Allows the user
// to sort the entries, filter their search, and search for a specific person.
// Authors:
// Cameron Hayes
......@@ -35,7 +35,6 @@ type
procedure GeneratePagination(TotalPages: Integer);
function GenerateSearchOptions(): string;
[async] procedure Search(searchOptions: string);
[async] procedure GetCalls(searchOptions: string);
[async] procedure GetItems(searchOptions: string);
[async] procedure getUser();
[async] procedure AddItem(itemOptions: string);
......@@ -340,58 +339,8 @@ begin
end;
end;
procedure TFViewItems.GetCalls(searchOptions: string);
// Retrieves list of calls from the server that meet the criteria searchOptions
// searchOptions: information about how to generate the SQL statement based on
// user input.
var
xdcResponse: TXDataClientResponse;
callList : TJSObject;
i: integer;
data: TJSArray;
call: TJSObject;
callListLength: integer;
begin
{if PageNumber > 0 then
begin
asm
startSpinner();
end;
xdcResponse := await(XDataWebClient1.RawInvokeAsync('ILookupService.GetCalls',
[searchOptions]));
callList := TJSObject(xdcResponse.Result);
data := TJSArray(callList['data']);
callListLength := integer(callList['count']);
ClearTable();
asm
setTimeout(endSpinner, 2000);
end;
for i := 0 to data.Length - 1 do
begin
call := TJSObject(data[i]);
AddRowToTable(string(call['toNumber']), string(call['fromNumber']), string(call['dateCreated']),
string(call['duration']), string(call['transcription']), string(call['mediaUrl']));
end;
TotalPages := (callListLength + PageSize - 1) div PageSize;
if (PageNumber * PageSize) < callListLength then
begin
lblEntries.Caption := 'Showing entries ' + IntToStr((PageNumber - 1) * PageSize + 1) +
' - ' + IntToStr(PageNumber * PageSize) +
' of ' + IntToStr(callListLength);
end
else
begin
lblEntries.Caption := 'Showing entries ' + IntToStr((PageNumber - 1) * PageSize + 1) +
' - ' + IntToStr(callListLength) +
' of ' + IntToStr(callListLength);
end;
GeneratePagination(TotalPages);
end; }
end;
procedure TFViewItems.btnApplyClick(Sender: TObject);
// Button that effectively functions as a GetCalls() button
// Button that effectively functions as a GetItems() button
var
itemOptions: string;
begin
......@@ -451,7 +400,7 @@ begin
end;
procedure TFViewItems.btnSearchClick(Sender: TObject);
// calls Search method
// item Search method
begin
//Search(edtSearch.Text);
end;
......@@ -466,7 +415,7 @@ begin
end;
function TFViewItems.GenerateSearchOptions(): string;
// Generates searchOptions for get calls.
// Generates searchOptions for GetItems.
var
searchOptions: string;
begin
......
<nav class="navbar navbar-light bg-light login-navbar">
<div class="container-fluid">
<a class="navbar-brand" href="#">Envoy Calls</a>
<a class="navbar-brand" href="#">Koehler-Gibson Orders</a>
</div>
</nav>
<div class="container mt-5">
<div class="row justify-content-center">
<div class="col-auto">
<img id="kgpicture"style="width: 250px; height: 250px;">
</div>
<div class="col-md-6 col-lg-4">
<div class="card login-card">
<div class="card-header">
......
......@@ -6,7 +6,7 @@ uses
System.SysUtils, System.Classes, Web, WEBLib.Graphics, WEBLib.Controls, WEBLib.Forms, WEBLib.Dialogs,
Vcl.Controls, Vcl.StdCtrls, WEBLib.StdCtrls, WEBLib.JSON,
JS, XData.Web.Connection, WEBLib.ExtCtrls,
App.Types, ConnectionModule, XData.Web.Client;
App.Types, ConnectionModule, XData.Web.Client, Vcl.Imaging.pngimage;
type
TFViewLogin = class(TWebForm)
......@@ -18,6 +18,7 @@ type
lblMessage: TWebLabel;
btnCloseNotification: TWebButton;
XDataWebClient: TXDataWebClient;
WebImageControl1: TWebImageControl;
procedure btnLoginClick(Sender: TObject);
procedure btnCloseNotificationClick(Sender: TObject);
procedure WebFormCreate(Sender: TObject);
......
......@@ -59,7 +59,7 @@ object FViewMain: TFViewMain
Transparent = False
WidthPercent = 100.000000000000000000
end
object lblCallsList: TWebLinkLabel
object lblItemsList: TWebLinkLabel
Left = 560
Top = 69
Width = 29
......@@ -68,7 +68,7 @@ object FViewMain: TFViewMain
ElementFont = efCSS
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
OnClick = lblCallsListClick
OnClick = lblItemsListClick
Caption = 'Items'
end
object lblUsers: TWebLinkLabel
......
<div id="wrapper">
<nav class="navbar navbar-expand navbar-light bg-light" style="margin-bottom: 0px;">
<div class="container-fluid">
<a id="view.main.apptitle" class="navbar-brand" href="index.html">Envoy Calls</a>
<a id="view.main.apptitle" class="navbar-brand" href="index.html">Koehler-Gibson Orders</a>
<div class="collapse navbar-collapse show" id="navbarNavDropdown">
<ul class="navbar-nav ms-auto">
<li class="nav-item dropdown">
......@@ -16,10 +16,10 @@
<a class="dropdown-item" id="dropdown.menu.userprofile" href="#"><i class="fa fa-user fa-fw"></i><span> User Profile</span></a>
</li>
<li>
<a class="dropdown-item" id="lblorders" href="#"><i class="fa fa-home fa-fw"></i><span> Orders</span></a>
<a class="dropdown-item" id="lblorders" href="#"><i class="fa fa-tags fa-fw"></i><span> Orders</span></a>
</li>
<li>
<a class="dropdown-item" id="dropdown.menu.itemlist" href="#"><i class="fa fa-phone fa-fw"></i><span> Items</span></a>
<a class="dropdown-item" id="dropdown.menu.itemlist" href="#"><i class="fa fa-cubes fa-fw"></i><span> Items</span></a>
</li>
<li>
<a class="dropdown-item" id="dropdown.menu.users" href="#"><i class="fas fa-address-book fa-fw"></i><span> Users</span></abbr></a>
......
......@@ -19,7 +19,7 @@ type
lblAppTitle: TWebLabel;
WebMemo1: TWebMemo;
XDataWebClient: TXDataWebClient;
lblCallsList: TWebLinkLabel;
lblItemsList: TWebLinkLabel;
lblUsers: TWebLinkLabel;
lblorders: TWebLabel;
procedure WebFormCreate(Sender: TObject);
......@@ -27,7 +27,7 @@ type
procedure wllblUserProfileClick(Sender: TObject);
procedure wllblLogoutClick(Sender: TObject);
procedure lblHomeClick(Sender: TObject);
procedure lblCallsListClick(Sender: TObject);
procedure lblItemsListClick(Sender: TObject);
procedure lblUsersClick(Sender: TObject);
procedure lblordersClick(Sender: TObject);
private
......@@ -100,7 +100,7 @@ begin
ShowForm(TFViewUsers);
end;
procedure TFViewMain.lblCallsListClick(Sender: TObject);
procedure TFViewMain.lblItemsListClick(Sender: TObject);
begin
ShowForm(TFViewItems);
end;
......
<div class="row">
<div class="col-12">
<h1 class="page-header pt-3" id="view.calls.title" style="font-size: 24px;">Orders</h1>
<h1 class="page-header pt-3" id="view.orders.title" style="font-size: 24px;">Orders</h1>
<div class="container mt-4">
<div class="row justify-content-center">
<div class="col-12 col-md-8">
......
// Displays calls and their associated recordings in the grid. Allows the user
// Displays orders in the grid. Allows the user
// to sort the entries, filter their search, and search for a specific person.
// Authors:
// Cameron Hayes
......@@ -49,7 +49,7 @@ type
procedure GeneratePagination(TotalPages: Integer);
function GenerateSearchOptions(): string;
[async] procedure Search(searchOptions: string);
[async] procedure GetCalls(searchOptions: string);
[async] procedure GetOrders(searchOptions: string);
[async] procedure getUser();
var
PageNumber: integer;
......@@ -84,7 +84,7 @@ begin
PageNumber := 1;
TotalPages := 1; // Initial total pages
wcbPageSize.Text := '10';
getCalls(GenerateSearchOptions());
getOrders(GenerateSearchOptions());
end;
procedure TFViewOrders.getUser();
......@@ -285,7 +285,7 @@ begin
if PageNumber > 1 then
begin
Dec(PageNumber);
GetCalls(GenerateSearchOptions());
GetOrders(GenerateSearchOptions());
end;
end);
PageItem.appendChild(PageLink);
......@@ -325,7 +325,7 @@ begin
begin
PageNum := StrToInt((Event.currentTarget as TJSHTMLElement).innerText);
PageNumber := PageNum;
GetCalls(GenerateSearchOptions());
GetOrders(GenerateSearchOptions());
end);
PageItem.appendChild(PageLink);
PaginationElement.appendChild(PageItem);
......@@ -364,7 +364,7 @@ begin
begin
PageNum := StrToInt((Event.currentTarget as TJSHTMLElement).innerText);
PageNumber := PageNum;
GetCalls(GenerateSearchOptions());
GetOrders(GenerateSearchOptions());
end);
PageItem.appendChild(PageLink);
PaginationElement.appendChild(PageItem);
......@@ -401,7 +401,7 @@ begin
begin
PageNum := StrToInt((Event.currentTarget as TJSHTMLElement).innerText);
PageNumber := PageNum;
GetCalls(generateSearchOptions());
GetOrders(generateSearchOptions());
end);
end;
PageItem.appendChild(PageLink);
......@@ -421,7 +421,7 @@ begin
if PageNumber < TotalPages then
begin
Inc(PageNumber);
GetCalls(GenerateSearchOptions());
GetOrders(GenerateSearchOptions());
end;
end);
PageItem.appendChild(PageLink);
......@@ -430,8 +430,8 @@ begin
end;
procedure TFViewOrders.GetCalls(searchOptions: string);
// Retrieves list of calls from the server that meet the criteria searchOptions
procedure TFViewOrders.GetOrders(searchOptions: string);
// Retrieves list of orders from the server that meet the criteria searchOptions
// searchOptions: information about how to generate the SQL statement based on
// user input.
var
......@@ -487,7 +487,7 @@ begin
end;
procedure TFViewOrders.btnApplyClick(Sender: TObject);
// Button that effectively functions as a GetCalls() button
// Button that effectively functions as a GetOrders() button
var
searchOptions: string;
begin
......@@ -497,7 +497,7 @@ begin
searchOptions := '&pagenumber=' + IntToStr(PageNumber) +
'&pagesize=' + IntToStr(PageSize) +
'&orderby=' + OrderBy;
GetCalls(searchOptions);
GetOrders(searchOptions);
end;
procedure TFViewOrders.Search(searchOptions: string);
......@@ -531,7 +531,7 @@ begin
end;
procedure TFViewOrders.btnSearchClick(Sender: TObject);
// calls Search method
// orders Search method
begin
Search(edtSearch.Text);
end;
......@@ -546,7 +546,7 @@ begin
end;
function TFViewOrders.GenerateSearchOptions(): string;
// Generates searchOptions for get calls.
// Generates searchOptions for GetOrders.
var
searchOptions: string;
begin
......
<div class="row">
<div class="col-12">
<h1 class="page-header pt-3" id="view.calls.title" style="font-size: 24px;">Users</h1>
<h1 class="page-header pt-3" id="view.users.title" style="font-size: 24px;">Users</h1>
<div class="container mt-4 px-0">
<div class="row justify-content-center">
<div class="col-12 col-md-8">
......
......@@ -20,34 +20,6 @@ const
API_MODEL = 'Api';
type
TCallItem = class
// Class of the info we want from the database from a specific call.
// callSid: SID of the call, 34 digit string.
// fromNumber: Who the phone call was from. (xxx) xxx-xxxx
// toNumber: Who the phone call was to. (xxx) xxx-xxxx
// dateCreated: Date the phone call was created. mm/dd/yyyy hh:nn:ss am/pm
// mediaURL: Link to the recording audio
// duration: Length of the entire call and recording.
// transcription: Transcription of the recording. Not always present due to
// the call being answerered or caller did not leave a message.
public
callSid: string;
fromNumber: string;
toNumber: string;
dateCreated: string;
mediaUrl: string;
duration: string;
transcription: string;
end;
// List of call items
// count: Total amount of records that fit the SQL query
// data: List of retrieved calls
TCallList = class
public
count: integer;
data: TList<TCallItem>;
end;
TUserItem = class
public
......@@ -114,8 +86,7 @@ type
[ServiceContract]
ILookupService = interface(IInvokable)
['{F24E1468-5279-401F-A877-CD48B44F4416}']
[HttpGet] function GetCalls(searchOptions: string): TCallList;
[HttpGet] function Search(phoneNum: string): TCallList;
[HttpGet] function Search(phoneNum: string): TOrderList;
[HttpGet] function GetUsers(searchOptions: string): TUserList;
[HttpGet] function GetItems(searchOptions: string): TItemList;
[HttpGet] function GetOrders(searchOptions: string): TOrderList;
......
unit Main;
//Main form of the program. This program gets calls/recordings/transcriptions from
//twilio and stores them in a database. From there it is able to be accessed by the client.
//Has access to every visual form for debugging purposes.
//Authors:
//Elias Sarraf
//Mac ...
......
......@@ -156,6 +156,6 @@ begin
Application.MainFormOnTaskbar := True;
Application.CreateForm(TFMain, FMain);
Logger.AddAppender(TMemoLogAppender.Create( 5, FMain.memoinfo ));
Logger.AddAppender(TFileLogAppender.Create( 5, 'envoyCallsServer' ));
Logger.AddAppender(TFileLogAppender.Create( 5, 'kgOrdersServer' ));
Application.Run;
end.
[Options]
LogFileNum=92
LogFileNum=98
UpdateTimerLength=0
......
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