Skip to content

Commit

Permalink
Merge pull request #110 from fledge-iot/port-80-issue
Browse files Browse the repository at this point in the history
[FOGL-5832]: Changed alert text for https protocol and handled the case of 404 status code of ping request
  • Loading branch information
MonikaSharma06 authored Aug 19, 2021
2 parents 5902584 + 436c2fa commit 7574bdd
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ export function pingServiceFactory(ping: PingService, sharedService: SharedServi
sharedService.isServiceUp.next(true);
})
.catch(error => {
// Set isService to true, if response status code is non zero and not undefined
if (error && error.status && error.status !== 0) {
// Set isService to true, if response status code is not undefined and not 0 & not 404
if (error && error.status && !(error.status === 0 || error.status === 404)) {
sharedService.isServiceUp.next(true);
} else {
sharedService.isServiceUp.next(false);
Expand Down
5 changes: 2 additions & 3 deletions src/app/components/core/settings/settings.component.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
<div class="container is-fluid">
<article class="message is-warning alert-box">
<div *ngIf="showAlertMessage && !canPing()" class="message-body">
You are trying to connect an instance secured with HTTPS, you must provide your own valid TLS certificate for
production operation. A self-signed certificate is included within Fledge, and you will need to configure your
browser to
You are trying to connect over HTTPS. To secure an instance, you must provide your own valid TLS certificate for production operations.
A self-signed certificate is included within Fledge, and you will need to configure your browser to
accept it as valid. To do this, click this <a (click)="openSSLCertWarningPage()"
class="alert-link"><u><b>link</b></u></a> and in that page accept
the certificate.
Expand Down
1 change: 0 additions & 1 deletion src/app/components/layout/login/login.component.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
.grey-link {
color: grey;
text-decoration: underline;
font-size: smaller;
}
2 changes: 1 addition & 1 deletion src/app/components/layout/navbar/navbar.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ export class NavbarComponent implements OnInit, AfterViewInit, OnDestroy {
}
// If response code is non zero and not undefined, set isAlive and isAuth to true,
// else set service to down and pingInfo accordingly
if (error && error.status && error.status !== 0) {
if (error && error.status && !(error.status === 0 || error.status === 404)) {
this.pingInfo.isAlive = true;
this.pingInfo.isAuth = true;
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/app/services/ping.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export class PingService {
return Promise.resolve(res);
})
.catch(err => {
if (err.status === 0) {
if (err.status === 0 || err.status === 404) {
this.pingResponse.next(false);
} else {
this.pingResponse.next(true);
Expand Down

0 comments on commit 7574bdd

Please sign in to comment.