Skip to content

Commit 59422e4

Browse files
committed
bk/2025-05-08-1802
1 parent a0784d0 commit 59422e4

7 files changed

Lines changed: 83 additions & 60 deletions

File tree

Server/Bin/dataset.xml

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

Server/Src/Main.View.dfm

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,17 @@ object MainForm: TMainForm
150150
Align = alBottom
151151
Caption = ' Log '
152152
TabOrder = 5
153+
object lbClearLog: TLabel
154+
Left = 464
155+
Top = 0
156+
Width = 33
157+
Height = 15
158+
Cursor = crHandPoint
159+
Hint = 'Clear Log'
160+
Caption = ' Clear '
161+
Transparent = False
162+
OnClick = lbClearLogClick
163+
end
153164
object mmLog: TMemo
154165
Left = 2
155166
Top = 17
@@ -160,6 +171,8 @@ object MainForm: TMainForm
160171
Color = clBtnFace
161172
ScrollBars = ssVertical
162173
TabOrder = 0
174+
ExplicitLeft = 3
175+
ExplicitTop = 23
163176
end
164177
end
165178
object btnStop: TBitBtn

Server/Src/Main.View.pas

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ TMainForm = class(TForm)
4848
btnSendToAll: TBitBtn;
4949
btnDeleteUserIDSelected: TBitBtn;
5050
BitBtn2: TBitBtn;
51+
lbClearLog: TLabel;
5152
procedure FormCreate(Sender: TObject);
5253
procedure TMSFNCWebPushSender1NotificationError(Sender: TObject; AResponseCode: Integer; AResponse, AEndpoint,
5354
APayload, AUserID, ABrowserID: string; var ADelete: Boolean);
@@ -62,6 +63,7 @@ TMainForm = class(TForm)
6263
procedure btnSendToAllClick(Sender: TObject);
6364
procedure btnSendToSelectedUserIdClick(Sender: TObject);
6465
procedure btnDeleteUserIDSelectedClick(Sender: TObject);
66+
procedure lbClearLogClick(Sender: TObject);
6567
private
6668
procedure ConfScreen;
6769
function GetPortsText: string;
@@ -115,6 +117,11 @@ procedure TMainForm.ConfScreen;
115117
btnStop.Enabled := not btnStart.Enabled;
116118
end;
117119

120+
procedure TMainForm.lbClearLogClick(Sender: TObject);
121+
begin
122+
mmLog.Lines.Clear;
123+
end;
124+
118125
procedure TMainForm.TMSFNCWebPushSender1NotificationError(Sender: TObject; AResponseCode: Integer; AResponse, AEndpoint,
119126
APayload, AUserID, ABrowserID: string; var ADelete: Boolean);
120127
begin

WebClient/Src/Client.Main.View.dfm

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -16,26 +16,7 @@ object ClientMainView: TClientMainView
1616
Width = 43
1717
Height = 16
1818
Caption = 'UserID:'
19-
HeightPercent = 100.000000000000000000
20-
WidthPercent = 100.000000000000000000
21-
end
22-
object WebLabel3: TWebLabel
23-
Left = 312
24-
Top = 33
25-
Width = 130
26-
Height = 16
27-
Caption = 'Push Notification demo'
28-
ElementID = 'title'
29-
HeightPercent = 100.000000000000000000
30-
WidthPercent = 100.000000000000000000
31-
end
32-
object WebLabel4: TWebLabel
33-
Left = 312
34-
Top = 65
35-
Width = 184
36-
Height = 16
37-
Caption = 'Usage of TWebPushNotifications'
38-
ElementID = 'description'
19+
ElementID = 'lbUserID'
3920
HeightPercent = 100.000000000000000000
4021
WidthPercent = 100.000000000000000000
4122
end
@@ -44,6 +25,7 @@ object ClientMainView: TClientMainView
4425
Top = 8
4526
Width = 216
4627
Height = 19
28+
ElementID = 'edtUserID'
4729
HeightPercent = 100.000000000000000000
4830
WidthPercent = 100.000000000000000000
4931
OnChange = WebEdit1Change
@@ -55,6 +37,7 @@ object ClientMainView: TClientMainView
5537
Height = 25
5638
Caption = 'Subscribe for push notifications'
5739
ChildOrder = 1
40+
ElementID = 'btnSubscribe'
5841
HeightPercent = 100.000000000000000000
5942
WidthPercent = 100.000000000000000000
6043
OnClick = WebButton1Click
@@ -66,6 +49,7 @@ object ClientMainView: TClientMainView
6649
Height = 25
6750
Caption = 'Unsubscribe from push notifications'
6851
ChildOrder = 2
52+
ElementID = 'btnUnsubscribe'
6953
HeightPercent = 100.000000000000000000
7054
WidthPercent = 100.000000000000000000
7155
OnClick = WebButton2Click
Lines changed: 57 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,59 @@
1-
<html>
2-
<head>
3-
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
4-
<title>TMS Web Project</title>
5-
</head>
6-
<body>
7-
<header>
8-
<img src="https://www.tmssoftware.com/site/img/logos/loper.svg" class="background-image">
9-
<div class="top-title top-title-small">
10-
<a href="https://www.tmssoftware.com/" target="_blank" title="Visit tmssoftware">
11-
<img class="large" src="https://www.tmssoftware.com/site/img/logo_tms_software.png">
12-
<img class="small" src="https://www.tmssoftware.com/site/img/logo_tms_software_small.png">
13-
</a>
14-
</div>
15-
<div class="top-title top-title-small">
16-
<a href="http://web.tmssoftware.com/" target="_blank" title="Visit TMS Web Core page">
17-
<div class="tms-panel-thumb">WEB</div>
18-
<div class="tms-thumb-text">TMS WEB Core</div>
19-
</a>
20-
</div>
21-
<div class="bg-webgreen top-title top-title-detail" id="title">Title</div>
22-
<div class="bg-webgreen top-title top-title-description">
23-
<table>
24-
<tr><td class="icon">
25-
<i class="icon material-icons">info</i>
26-
</td><td>
27-
<span id="description">Description</span>
28-
</td></tr>
29-
</table>
30-
</div>
31-
</header>
32-
<div id="appcontent" class="appcontent">
1+
<!DOCTYPE html>
2+
<html lang="pt-br" data-bs-theme="dark">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1">
6+
<title>Push Notifications - Delphi</title>
7+
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
8+
<style>
9+
body {
10+
background-color: #121212;
11+
color: #f8f9fa;
12+
}
13+
.btn-group button {
14+
font-weight: 500;
15+
transition: all 0.2s;
16+
margin: 30px 0 0 0;
17+
}
18+
.btn-group button:hover {
19+
/*background-color: #343a40; */
20+
/*color: #fff;*/
21+
font-weight: bold;
22+
}
23+
.footer {
24+
height: 60px;
25+
background-color: #1e1e1e;
26+
border-top: 1px solid #343a40;
27+
border-radius: 0 0 12px 12px;
28+
font-size: 14px;
29+
}
30+
</style>
31+
</head>
32+
<body>
33+
<div class="container py-4">
34+
<!-- FORMULARIO -->
35+
<div class="card bg-dark border-secondary rounded-3 p-3 mb-4" id="divFormulario">
36+
<div class="mb-3">
37+
<label for="edtUserID" class="form-label text-white" id="lbUserID">UserID</label>
38+
<input type="text" class="form-control" id="edtUserID" placeholder="Enter Userid">
39+
</div>
40+
41+
<!-- BOTOES -->
42+
<div class="btn-group w-100 mb-3" role="group" id="divBotoes">
43+
<button type="button" class="btn btn-success" id="btnSubscribe">Subscribe for push notifications</button>
44+
<button type="button" class="btn btn-danger" id="btnUnsubscribe">Unsubscribe from push notifications</button>
45+
</div>
3346
</div>
34-
</body>
35-
</html>
3647

48+
<!-- RODAPE OU ESPACO INFERIOR -->
49+
<div class="footer d-flex align-items-center justify-content-center">
50+
<span class="text-secondary"> 2025 -
51+
<a target="_blank" href="https://www.youtube.com/@code4delphi" class="link-success link-offset-2 link-underline-opacity-0 link-underline-opacity-25-hover">
52+
@Code4Delphi
53+
</a> - Push Notifications - Delphi - TMS Web Core</span>
54+
</div>
55+
</div>
56+
57+
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
58+
</body>
59+
</html>

WebClient/Src/Client.Main.View.pas

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ TClientMainView = class(TWebForm)
2424
WebButton2: TWebButton;
2525
WebLabel1: TWebLabel;
2626
WebPushNotifications1: TWebPushNotifications;
27-
WebLabel3: TWebLabel;
28-
WebLabel4: TWebLabel;
2927
procedure WebButton1Click(Sender: TObject);
3028
procedure WebButton2Click(Sender: TObject);
3129
procedure WebEdit1Change(Sender: TObject);
@@ -53,9 +51,7 @@ procedure TClientMainView.WebFormCreate(Sender: TObject);
5351
begin
5452
LLocalStorage := TLocalStorage.Create(Self);
5553
if LLocalStorage.Count > 0 then
56-
begin
5754
WebEdit1.Text := TLocalStorage.GetValue(STORAGE_KEY);
58-
end;
5955

6056
Self.SetButtonState;
6157
end;

WebClient/styles.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
/* Here you can add your CSS classes */
1+
/* Here you can add your CSS classes */

0 commit comments

Comments
 (0)