mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 21:06:06 +00:00
Merge branch 'developer' of https://bitbucket.org/equilibriumito/gabinete-digital into developer
This commit is contained in:
@@ -6,6 +6,7 @@ import { CustomTaskPipe } from '../pipes/custom-task.pipe';
|
|||||||
import { ProcessesService } from '../services/processes.service';
|
import { ProcessesService } from '../services/processes.service';
|
||||||
import { DespachoStore } from '../store/despacho-store.service';
|
import { DespachoStore } from '../store/despacho-store.service';
|
||||||
import { LoaderService } from 'src/app/store/loader.service'
|
import { LoaderService } from 'src/app/store/loader.service'
|
||||||
|
import { SessionStore } from '../store/session.service';
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
})
|
})
|
||||||
@@ -225,6 +226,20 @@ export class DespachoService {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async getListPr() {
|
||||||
|
let result = await this.processes.GetTasksList("Despacho do Presidente da República", false).toPromise();
|
||||||
|
|
||||||
|
let despachosPr;
|
||||||
|
switch (SessionStore.user.Profile) {
|
||||||
|
case 'MDGPR':
|
||||||
|
despachosPr = result.reverse().filter(data => data.activityInstanceName == "Tarefa de Despacho");
|
||||||
|
break;
|
||||||
|
case 'PR':
|
||||||
|
despachosPr = result.reverse().filter(data => data.activityInstanceName == "Concluir Despacho");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
sortArrayISODate(myArray: any) {
|
sortArrayISODate(myArray: any) {
|
||||||
return myArray.sort(function(a, b) {
|
return myArray.sort(function(a, b) {
|
||||||
return (a.CreateDate < b.CreateDate) ? -1 : ((a.CreateDate > b.CreateDate) ? 1 : 0);
|
return (a.CreateDate < b.CreateDate) ? -1 : ((a.CreateDate > b.CreateDate) ? 1 : 0);
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import { Injectable } from '@angular/core';
|
|||||||
import { ActivatedRouteSnapshot, CanActivate, Router, RouterStateSnapshot, UrlTree } from '@angular/router';
|
import { ActivatedRouteSnapshot, CanActivate, Router, RouterStateSnapshot, UrlTree } from '@angular/router';
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
import { SessionStore } from '../store/session.service';
|
import { SessionStore } from '../store/session.service';
|
||||||
|
import { AlertController, Platform } from '@ionic/angular';
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
@@ -9,14 +10,18 @@ import { SessionStore } from '../store/session.service';
|
|||||||
export class InactivityGuard implements CanActivate {
|
export class InactivityGuard implements CanActivate {
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private router:Router
|
private router:Router,
|
||||||
|
private platform: Platform,
|
||||||
){}
|
){}
|
||||||
|
|
||||||
canActivate(
|
canActivate(
|
||||||
route: ActivatedRouteSnapshot,
|
route: ActivatedRouteSnapshot,
|
||||||
state: RouterStateSnapshot): Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree {
|
state: RouterStateSnapshot): Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree {
|
||||||
|
|
||||||
if(SessionStore.exist && SessionStore.user.Inactivity && !SessionStore.hasPin ) {
|
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
||||||
|
this.router.navigate(['/home/events']);
|
||||||
|
return false
|
||||||
|
} else if(SessionStore.exist && SessionStore.user.Inactivity && !SessionStore.hasPin ) {
|
||||||
return true
|
return true
|
||||||
} else if(SessionStore.exist && !SessionStore.user.Inactivity) {
|
} else if(SessionStore.exist && !SessionStore.user.Inactivity) {
|
||||||
return true
|
return true
|
||||||
|
|||||||
@@ -3,24 +3,30 @@ import { CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot, UrlTree, Rout
|
|||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
import { LocalstoreService } from '../store/localstore.service';
|
import { LocalstoreService } from '../store/localstore.service';
|
||||||
import { SessionStore } from '../store/session.service';
|
import { SessionStore } from '../store/session.service';
|
||||||
|
import { AlertController, Platform } from '@ionic/angular';
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
})
|
})
|
||||||
export class LoginGuard implements CanActivate {
|
export class LoginGuard implements CanActivate {
|
||||||
constructor( private router:Router,
|
constructor( private router:Router, private platform: Platform,) {
|
||||||
private localstoreService: LocalstoreService) {
|
|
||||||
|
|
||||||
}
|
}
|
||||||
canActivate(
|
canActivate(
|
||||||
route: ActivatedRouteSnapshot,
|
route: ActivatedRouteSnapshot,
|
||||||
state: RouterStateSnapshot): Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree {
|
state: RouterStateSnapshot): Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree {
|
||||||
|
|
||||||
if(window.location.pathname == '/' && SessionStore.exist ) {
|
if(SessionStore.exist && SessionStore.user.Inactivity && SessionStore.user.LoginPreference != 'Pin' ) {
|
||||||
this.router.navigate(['/home/events']);
|
this.router.navigate(['/home/events']);
|
||||||
return false
|
return false
|
||||||
|
} else if(SessionStore.exist && !SessionStore.hasPin && !this.platform.is('desktop') && !this.platform.is('mobileweb') ) {
|
||||||
|
this.router.navigate(['/pin']);
|
||||||
|
return false
|
||||||
|
} else if(SessionStore.exist && !SessionStore.user.Inactivity && SessionStore.user.LoginPreference == 'Pin' && !this.platform.is('desktop') && !this.platform.is('mobileweb')) {
|
||||||
|
this.router.navigate(['/inactivity']);
|
||||||
|
return false
|
||||||
} else {
|
} else {
|
||||||
return true;
|
return true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -103,7 +103,8 @@ export class HomePage implements OnInit {
|
|||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
/* this.network.checkNetworkConnection;
|
/* this.network.checkNetworkConnection;
|
||||||
this.network.checkNetworkDisconnection; */
|
this.network.checkNetworkDisconnection; */
|
||||||
console.log('Active route ', this.router.url)
|
// console.log('Active route ', this.router.url)
|
||||||
|
|
||||||
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
||||||
this.webnotification.webconnection();
|
this.webnotification.webconnection();
|
||||||
this.webnotification.onReceviNotificationWeb();
|
this.webnotification.onReceviNotificationWeb();
|
||||||
@@ -165,7 +166,6 @@ export class HomePage implements OnInit {
|
|||||||
'despachos',
|
'despachos',
|
||||||
() => {
|
() => {
|
||||||
this.despachoRule.getList({updateStore: true})
|
this.despachoRule.getList({updateStore: true})
|
||||||
|
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -53,7 +53,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="login-preference width-100" *ngIf="!production">
|
<div class="login-preference width-100" *ngIf="!platform.is('desktop') && !platform.is('mobileweb')">
|
||||||
<div class="preference">Preferência Login</div>
|
<div class="preference">Preferência Login</div>
|
||||||
|
|
||||||
<ion-row>
|
<ion-row>
|
||||||
@@ -73,11 +73,6 @@
|
|||||||
</ion-row>
|
</ion-row>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div hidden class="d-flex width-100 justify-center mt-10">
|
|
||||||
<button hidden (click)="addPin()" class="btn-ok buttonSize" fill="clear" color="#fff" >
|
|
||||||
<ion-label>Alterar PIN</ion-label>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</ion-content>
|
</ion-content>
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import { FingerprintPage } from 'src/app/shared/fingerprint/fingerprint.page';
|
|||||||
import { PinPage } from 'src/app/shared/pin/pin.page';
|
import { PinPage } from 'src/app/shared/pin/pin.page';
|
||||||
import { SessionStore } from 'src/app/store/session.service';
|
import { SessionStore } from 'src/app/store/session.service';
|
||||||
import { environment } from 'src/environments/environment';
|
import { environment } from 'src/environments/environment';
|
||||||
|
import { Platform } from '@ionic/angular';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-edit-profile',
|
selector: 'app-edit-profile',
|
||||||
@@ -16,7 +17,8 @@ export class EditProfilePage implements OnInit {
|
|||||||
production = environment.production
|
production = environment.production
|
||||||
|
|
||||||
constructor(private modalController:ModalController,
|
constructor(private modalController:ModalController,
|
||||||
private animationController: AnimationController
|
private animationController: AnimationController,
|
||||||
|
public platform: Platform,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
ngOnInit() {}
|
ngOnInit() {}
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ import { JsonStore } from '../../services/jsonStore.service';
|
|||||||
import { StorageService } from '../../services/storage.service';
|
import { StorageService } from '../../services/storage.service';
|
||||||
import { NotificationsService } from '../../services/notifications.service';
|
import { NotificationsService } from '../../services/notifications.service';
|
||||||
import { SessionStore } from 'src/app/store/session.service';
|
import { SessionStore } from 'src/app/store/session.service';
|
||||||
import { synchro } from 'src/app/services/socket/synchro.service';
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-profile',
|
selector: 'app-profile',
|
||||||
@@ -222,7 +221,7 @@ export class ProfilePage implements OnInit {
|
|||||||
SessionStore.setInativity(false)
|
SessionStore.setInativity(false)
|
||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.router.navigate(['/login']);
|
this.router.navigateByUrl('/', { replaceUrl: true });
|
||||||
}, 100)
|
}, 100)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -358,9 +358,6 @@ export class AgendaPage implements OnInit {
|
|||||||
|
|
||||||
get CalendarCurrentDay ():any {
|
get CalendarCurrentDay ():any {
|
||||||
|
|
||||||
/* console.log(this.viewDate.getDate(), '0_0') */
|
|
||||||
// console.log(this.viewDate.getDate(), '0_0')
|
|
||||||
|
|
||||||
return this.viewDate.getDate()
|
return this.viewDate.getDate()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ export class EventsPage implements OnInit {
|
|||||||
|
|
||||||
this.platform.resize.subscribe(async () => {
|
this.platform.resize.subscribe(async () => {
|
||||||
//console.log('Resize event detected');
|
//console.log('Resize event detected');
|
||||||
console.log('Resize event detected');
|
// console.log('Resize event detected');
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -1,39 +1,8 @@
|
|||||||
<ion-content class="text-white">
|
<ion-content class="text-white">
|
||||||
|
|
||||||
<div class="main-wrapper">
|
<div class="main-wrapper">
|
||||||
<div class="wrapper" *ngIf="SessionStore.user.LoginPreference == 'Password' && SessionStore.hasPin || SessionStore.user.LoginPreference == null && SessionStore.hasPin || SessionStore.user.LoginPreference == 'None' && SessionStore.hasPin || enterWithPassword">
|
|
||||||
|
|
||||||
<div class="bg-1 d-flex justify-center align-center">
|
<div class="main-content d-flex flex-column width" *ngIf="!SessionStore.hasPin || SessionStore.hasPin && SessionStore.user.LoginPreference == 'Pin' && !enterWithPassword " >
|
||||||
<div class="bg-2 d-flex justify-center align-center">
|
|
||||||
<div class="bg-3 d-flex justify-center align-center">
|
|
||||||
<div class="bg-4 d-flex justify-center align-center">
|
|
||||||
<div class="div-logo">
|
|
||||||
<img src='assets/images/fullLogo.png' alt='logo'>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<h3 class="center text-white">Inicie a sessão</h3>
|
|
||||||
<form class="form">
|
|
||||||
<p class="form-label text-white">Email</p>
|
|
||||||
<ion-item class="form-input">
|
|
||||||
<ion-input type="text" [(ngModel)]="username" name="input-username"></ion-input>
|
|
||||||
</ion-item>
|
|
||||||
<p class="form-label text-white">Palavra-passe</p>
|
|
||||||
<ion-item class="form-input">
|
|
||||||
<ion-input (keyup.enter)="Login()" type="password" [(ngModel)]="password" name="input-password" ></ion-input>
|
|
||||||
</ion-item>
|
|
||||||
<div class="d-flex pt-25">
|
|
||||||
<button class="btn-ok btn-login" fill="clear" expand="block" shape="round" (click)="Login()">Iniciar</button>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
<div class="msg-bottom d-flex">
|
|
||||||
<p class="msg-bottom-p">Uma iniciativa do Gabinete do Presidente da República</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="main-content d-flex flex-column height-100 width" *ngIf="!SessionStore.hasPin || SessionStore.hasPin && SessionStore.user.LoginPreference == 'Pin' && !enterWithPassword " >
|
|
||||||
|
|
||||||
<div class="div-top-header">
|
<div class="div-top-header">
|
||||||
|
|
||||||
|
|||||||
@@ -1,77 +1,79 @@
|
|||||||
@import '~src/function.scss';
|
@import '~src/function.scss';
|
||||||
:host, app-login {
|
:host, app-login {
|
||||||
ion-content {
|
ion-content {
|
||||||
background: linear-gradient(180deg, #42B9FE 0%, #0782C9 100%) !important;
|
background: linear-gradient(180deg, #42B9FE 0%, #0782C9 100%) !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ion-content{
|
ion-content{
|
||||||
background-color: white !important;
|
background-color: white !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.main-wrapper{
|
.main-wrapper{
|
||||||
background: linear-gradient(180deg, #42B9FE 0%, #0782C9 100%) !important;
|
background: linear-gradient(180deg, #42B9FE 0%, #0782C9 100%) !important;
|
||||||
display: flex;
|
display: flex;
|
||||||
width: 100vw;
|
width: 100vw;
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
background: white !important;
|
background: white !important;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.wrapper{
|
.wrapper{
|
||||||
/* width: 400px; */
|
/* width: 400px; */
|
||||||
height: auto;
|
height: auto;
|
||||||
padding: 0 !important;
|
padding: 0 !important;
|
||||||
/* margin: auto !important; */
|
/* margin: auto !important; */
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
background: linear-gradient(180deg, #42B9FE 0%, #0782C9 100%) !important;
|
background: linear-gradient(180deg, #42B9FE 0%, #0782C9 100%) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.logo{
|
.logo{
|
||||||
width: 400px;
|
width: 400px;
|
||||||
height: 400px;
|
height: 400px;
|
||||||
background-position: center;
|
background-position: center;
|
||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.bg-1{
|
.bg-1{
|
||||||
width: 250px;
|
width: 250px;
|
||||||
height: 250px;
|
height: 250px;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
background: #4cb9f825;
|
background: #4cb9f825;
|
||||||
margin: auto;
|
margin: auto;
|
||||||
.bg-2{
|
.bg-2{
|
||||||
width: 225px;
|
width: 225px;
|
||||||
height: 225px;
|
height: 225px;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
background: #61bdf2b4;
|
background: #61bdf2b4;
|
||||||
margin: auto;
|
margin: auto;
|
||||||
.bg-3{
|
.bg-3{
|
||||||
width: 200px;
|
width: 200px;
|
||||||
height: 200px;
|
height: 200px;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
background: #96d3f8be;
|
background: #96d3f8be;
|
||||||
margin: auto;
|
margin: auto;
|
||||||
.bg-4{
|
.bg-4{
|
||||||
width: 175px;
|
width: 175px;
|
||||||
height: 175px;
|
height: 175px;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
background: rgba(255, 255, 255, 0.918);
|
background: rgba(255, 255, 255, 0.918);
|
||||||
padding: 15px;
|
padding: 15px;
|
||||||
margin: auto;
|
margin: auto;
|
||||||
|
|
||||||
.bg-4 img{
|
.bg-4 img{
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.div-logo{
|
.div-logo{
|
||||||
width: 200px !important;
|
width: 200px !important;
|
||||||
@@ -133,110 +135,216 @@ ion-item{
|
|||||||
|
|
||||||
|
|
||||||
.circle{
|
.circle{
|
||||||
color: white;
|
color: white;
|
||||||
width: 70px;
|
width: 70px;
|
||||||
height: 70px;
|
height: 70px;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
font-size: 19pt;
|
font-size: 19pt;
|
||||||
background: #44b5ea;
|
background: #44b5ea;
|
||||||
border-radius: 56px;
|
border-radius: 56px;
|
||||||
margin-bottom: 15px;
|
margin-bottom: 15px;
|
||||||
user-select: none;
|
user-select: none;
|
||||||
margin-right: 15px;
|
margin-right: 15px;
|
||||||
margin-left: 15px;
|
margin-left: 15px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.title{
|
.title{
|
||||||
padding-top: 32px;
|
padding-top: 32px;
|
||||||
z-index: 1000;
|
z-index: 1000;
|
||||||
height: unset !important;
|
height: unset !important;
|
||||||
position: relative;
|
position: relative;
|
||||||
top: -30px;
|
top: -30px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.terminal {
|
.terminal {
|
||||||
padding-top: 49px;
|
justify-content: center;
|
||||||
justify-content: center;
|
display: flex;
|
||||||
display: flex;
|
flex-direction: column;
|
||||||
flex-direction: column;
|
background-image: url(/assets/background/auth.svg);
|
||||||
align-items: center;
|
background-position: center;
|
||||||
background-image: url(/assets/background/auth.svg);
|
background-repeat: no-repeat;
|
||||||
background-position: center;
|
width: 100%;
|
||||||
background-repeat: no-repeat;
|
z-index: 100;
|
||||||
width: 100%;
|
background-size: 610px;
|
||||||
padding-bottom: 48px;
|
|
||||||
margin-bottom: -58px;
|
|
||||||
z-index: 100;
|
|
||||||
margin-top: -80px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.clear{
|
.clear{
|
||||||
color: #44b5ea;
|
color: #44b5ea;
|
||||||
font-size: 12pt;
|
font-size: 12pt;
|
||||||
z-index: 1000;
|
z-index: 1000;
|
||||||
}
|
}
|
||||||
.dot-active{
|
.dot-active{
|
||||||
background: #44b5ea;
|
background: #44b5ea;
|
||||||
}
|
}
|
||||||
|
|
||||||
.dot{
|
.dot{
|
||||||
width: 25px;
|
width: 25px;
|
||||||
height: 25px;
|
height: 25px;
|
||||||
margin: 0 10px 0 0;
|
margin: 0 10px 0 0;
|
||||||
border: 3px solid #44b5ea;
|
border: 3px solid #44b5ea;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
border-radius: 50px;
|
border-radius: 50px;
|
||||||
-webkit-border-radius: 50px;
|
-webkit-border-radius: 50px;
|
||||||
-moz-border-radius: 50px;
|
-moz-border-radius: 50px;
|
||||||
-ms-border-radius: 50px;
|
-ms-border-radius: 50px;
|
||||||
-o-border-radius: 50px;
|
-o-border-radius: 50px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.main-content {
|
.main-content {
|
||||||
width: 100vw;
|
width: 100vw;
|
||||||
height: 100vh;
|
/* background-color: white; */
|
||||||
background-color: white;
|
text-align: center;
|
||||||
text-align: center;
|
align-items: center;
|
||||||
align-items: center;
|
/* justify-content: center; */
|
||||||
justify-content: center;
|
background-size: 686px 674px;
|
||||||
background-size: 686px 674px;
|
background-position: center;
|
||||||
background-position: center;
|
background-position-y: 110px;
|
||||||
background-position-y: 110px;
|
background-repeat: no-repeat;
|
||||||
background-repeat: no-repeat;
|
margin: auto;
|
||||||
margin: auto;
|
/* justify-content: space-around; */
|
||||||
justify-content: space-around;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.voltar{
|
.voltar{
|
||||||
user-select: none;
|
user-select: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.msg-bottom{
|
.msg-bottom{
|
||||||
width: 100%;
|
width: 100%;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
|
||||||
.msg-bottom-p{
|
.msg-bottom-p{
|
||||||
width: 220px;
|
width: 220px;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
bottom: 0 !important;
|
bottom: 0 !important;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@media only screen and (max-height: 746px){
|
@media only screen and (max-height: 746px){
|
||||||
.msg-bottom-p {
|
.msg-bottom-p {
|
||||||
padding-top: 20px;
|
padding-top: 20px;
|
||||||
position: unset !important;
|
position: unset !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.pin-4 {
|
.pin-4 {
|
||||||
z-index: 1000;
|
z-index: 1000;
|
||||||
margin-bottom: 36px;
|
margin-bottom: 107px;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@media only screen and (min-height: 168px) {
|
||||||
|
.circle{
|
||||||
|
width: 60px;
|
||||||
|
height: 60px;
|
||||||
|
margin-bottom: 7px;
|
||||||
|
margin-right: 7px;
|
||||||
|
margin-left: 7px;
|
||||||
|
}
|
||||||
|
.terminal{
|
||||||
|
margin-top: -33px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pin-4 {
|
||||||
|
position: relative;
|
||||||
|
top: 49px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.clear {
|
||||||
|
padding-top: 10px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.div-top-header {
|
||||||
|
position: unset ;
|
||||||
|
top: unset ;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media only screen and (min-height: 640px) {
|
||||||
|
.circle{
|
||||||
|
width: 60px;
|
||||||
|
height: 60px;
|
||||||
|
margin-bottom: 9px;
|
||||||
|
margin-right: 9px;
|
||||||
|
margin-left: 9px;
|
||||||
|
}
|
||||||
|
.terminal{
|
||||||
|
margin-top: -33px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pin-4 {
|
||||||
|
position: relative;
|
||||||
|
top: 49px;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@media only screen and (min-height: 667px) {
|
||||||
|
.circle{
|
||||||
|
width: 60px;
|
||||||
|
height: 60px;
|
||||||
|
margin-bottom: 7px;
|
||||||
|
margin-right: 7px;
|
||||||
|
margin-left: 7px;
|
||||||
|
}
|
||||||
|
.terminal{
|
||||||
|
margin-top: 0px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.clear {
|
||||||
|
padding-top: 25px !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media only screen and (min-height: 731px) {
|
||||||
|
.circle{
|
||||||
|
width: 63px;
|
||||||
|
height: 63px;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
margin-right: 10px;
|
||||||
|
margin-left: 10px;
|
||||||
|
}
|
||||||
|
.terminal{
|
||||||
|
margin-top: -33px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pin-4 {
|
||||||
|
position: relative;
|
||||||
|
top: 35px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.div-top-header {
|
||||||
|
position: absolute !important;
|
||||||
|
top: 0px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@media only screen and (min-height: 832px) {
|
||||||
|
.circle{
|
||||||
|
width: 65px;
|
||||||
|
height: 65px;
|
||||||
|
margin-bottom: 15px;
|
||||||
|
margin-right: 15px;
|
||||||
|
margin-left: 15px;
|
||||||
|
}
|
||||||
|
.terminal{
|
||||||
|
margin-top: -33px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pin-4 {
|
||||||
|
position: relative;
|
||||||
|
top: unset !important;
|
||||||
|
margin-bottom: 107px;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,7 +32,47 @@ export class InactivityPage implements OnInit {
|
|||||||
public alertController: AlertController
|
public alertController: AlertController
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
ngOnInit() {}
|
loop = false
|
||||||
|
|
||||||
|
ngOnInit() {
|
||||||
|
|
||||||
|
|
||||||
|
// window.addEventListener('resize', (event) => {
|
||||||
|
// if(this.router.url != '/login') return false
|
||||||
|
|
||||||
|
// if(this.loop == false) {
|
||||||
|
// this.loop = true
|
||||||
|
// this.runloop()
|
||||||
|
// }
|
||||||
|
|
||||||
|
// }, true);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
runloop() {
|
||||||
|
// const containerHeight = 651
|
||||||
|
|
||||||
|
// let circleHeight = document.querySelector('.circle')['offsetHeight']
|
||||||
|
// let circleWidth = document.querySelector('.circle')['offsetWidth']
|
||||||
|
// console.log(window.innerHeight, ' < ', containerHeight)
|
||||||
|
|
||||||
|
// console.log(circleHeight)
|
||||||
|
|
||||||
|
// document.querySelectorAll('.circle').forEach(e=>{
|
||||||
|
// e['style']['height'] = (circleHeight -1 )+'px'
|
||||||
|
// e['style']['width'] = (circleWidth -1 )+'px'
|
||||||
|
// })
|
||||||
|
|
||||||
|
|
||||||
|
// if( window.innerHeight< containerHeight) {
|
||||||
|
// setTimeout(()=>{
|
||||||
|
// this.runloop()
|
||||||
|
// }, 100)
|
||||||
|
// } else {
|
||||||
|
// this.loop = false
|
||||||
|
// }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
async presentAlert(message: string) {
|
async presentAlert(message: string) {
|
||||||
const alert = await this.alertController.create({
|
const alert = await this.alertController.create({
|
||||||
@@ -70,7 +110,7 @@ export class InactivityPage implements OnInit {
|
|||||||
domainName: environment.domain,
|
domainName: environment.domain,
|
||||||
BasicAuthKey: ""
|
BasicAuthKey: ""
|
||||||
}
|
}
|
||||||
let attempt = await this.authService.login(this.userattempt, false)
|
let attempt = await this.authService.login(this.userattempt, {saveSession: false})
|
||||||
|
|
||||||
if (attempt) {
|
if (attempt) {
|
||||||
|
|
||||||
|
|||||||
@@ -144,7 +144,7 @@ ion-item{
|
|||||||
user-select: none;
|
user-select: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.title{
|
.title {
|
||||||
padding-top: 32px;
|
padding-top: 32px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -203,7 +203,7 @@ ion-item{
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
|
||||||
.msg-bottom-p{
|
.msg-bottom-p {
|
||||||
width: 220px;
|
width: 220px;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
bottom: 0 !important;
|
bottom: 0 !important;
|
||||||
@@ -211,7 +211,7 @@ ion-item{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@media only screen and (max-height: 746px){
|
@media only screen and (max-height: 746px) {
|
||||||
.msg-bottom-p {
|
.msg-bottom-p {
|
||||||
padding-top: 20px;
|
padding-top: 20px;
|
||||||
position: unset !important;
|
position: unset !important;
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ import { ToastService } from 'src/app/services/toast.service';
|
|||||||
import { environment } from 'src/environments/environment';
|
import { environment } from 'src/environments/environment';
|
||||||
import { AlertController } from '@ionic/angular';
|
import { AlertController } from '@ionic/angular';
|
||||||
import { NotificationsService } from 'src/app/services/notifications.service';
|
import { NotificationsService } from 'src/app/services/notifications.service';
|
||||||
import { LocalstoreService } from 'src/app/store/localstore.service';
|
|
||||||
import { SessionStore } from 'src/app/store/session.service';
|
import { SessionStore } from 'src/app/store/session.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
@@ -17,7 +16,7 @@ import { SessionStore } from 'src/app/store/session.service';
|
|||||||
export class LoginPage implements OnInit {
|
export class LoginPage implements OnInit {
|
||||||
|
|
||||||
logstatus: boolean;
|
logstatus: boolean;
|
||||||
username: string = environment.defaultuser;
|
username: string = SessionStore.user.Email || environment.defaultuser;
|
||||||
password: string = environment.defaultuserpwd;
|
password: string = environment.defaultuserpwd;
|
||||||
userattempt: UserForm;
|
userattempt: UserForm;
|
||||||
code = []
|
code = []
|
||||||
@@ -32,31 +31,11 @@ export class LoginPage implements OnInit {
|
|||||||
private router: Router,
|
private router: Router,
|
||||||
private authService: AuthService,
|
private authService: AuthService,
|
||||||
private toastService: ToastService,
|
private toastService: ToastService,
|
||||||
public alertController: AlertController,
|
public alertController: AlertController
|
||||||
private localstoreService: LocalstoreService
|
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {}
|
||||||
|
|
||||||
let userData = this.sessionStore.user
|
|
||||||
|
|
||||||
const loginPreference = userData?.LoginPreference
|
|
||||||
const pin = userData?.PIN
|
|
||||||
|
|
||||||
if (pin) {
|
|
||||||
this.hasPin = true
|
|
||||||
} else {
|
|
||||||
this.hasPin = false
|
|
||||||
}
|
|
||||||
|
|
||||||
if (loginPreference) {
|
|
||||||
this.loginPreference = loginPreference
|
|
||||||
} else {
|
|
||||||
this.loginPreference = ''
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
//Function to validade the login inputs
|
//Function to validade the login inputs
|
||||||
validateUsername() {
|
validateUsername() {
|
||||||
@@ -97,13 +76,23 @@ export class LoginPage implements OnInit {
|
|||||||
domainName: environment.domain,
|
domainName: environment.domain,
|
||||||
BasicAuthKey: ""
|
BasicAuthKey: ""
|
||||||
}
|
}
|
||||||
let attempt = await this.authService.login(this.userattempt)
|
|
||||||
|
let attempt = await this.authService.login(this.userattempt, {saveSession: false})
|
||||||
|
|
||||||
if (attempt) {
|
if (attempt) {
|
||||||
await this.authService.loginChat(this.userattempt);
|
|
||||||
await this.getToken();
|
|
||||||
|
|
||||||
this.router.navigate(['/pin']);
|
if (attempt.UserId == SessionStore.user.UserId) {
|
||||||
|
await this.authService.SetSession(attempt, this.userattempt);
|
||||||
|
this.authService.loginChat(this.userattempt);
|
||||||
|
this.getToken();
|
||||||
|
SessionStore.setInativity(true)
|
||||||
|
this.goback()
|
||||||
|
} else {
|
||||||
|
SessionStore.delete()
|
||||||
|
window.localStorage.clear();
|
||||||
|
await this.authService.SetSession(attempt, this.userattempt);
|
||||||
|
this.router.navigate(['/pin']);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -116,4 +105,15 @@ export class LoginPage implements OnInit {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
goback() {
|
||||||
|
const pathName = SessionStore.user.UrlBeforeInactivity
|
||||||
|
if(pathName) {
|
||||||
|
this.router.navigate([pathName]);
|
||||||
|
} else {
|
||||||
|
this.router.navigate(['/home/events']);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ export class AuthService {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async login(user: UserForm, saveSession = true): Promise<LoginUserRespose> {
|
async login(user: UserForm, {saveSession = true}): Promise<LoginUserRespose> {
|
||||||
user.BasicAuthKey = 'Basic ' + btoa(user.username + ':' + this.aesencrypt.encrypt(user.password,user.username ));
|
user.BasicAuthKey = 'Basic ' + btoa(user.username + ':' + this.aesencrypt.encrypt(user.password,user.username ));
|
||||||
|
|
||||||
this.headers = this.headers.set('Authorization',user.BasicAuthKey);
|
this.headers = this.headers.set('Authorization',user.BasicAuthKey);
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ export class InativityService {
|
|||||||
|
|
||||||
function resetTimer() {
|
function resetTimer() {
|
||||||
clearTimeout(t);
|
clearTimeout(t);
|
||||||
t = setTimeout(userIsNotActive, 60000 * 5); // time is in milliseconds
|
t = setTimeout(userIsNotActive, 60000 * 15); // time is in milliseconds
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -72,8 +72,6 @@ export class WebNotificationPopupService {
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import { AES, enc, SHA1 } from 'crypto-js'
|
|||||||
})
|
})
|
||||||
export class LocalstoreService {
|
export class LocalstoreService {
|
||||||
|
|
||||||
private prefix = 'v16-'
|
private prefix = 'v17-'
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user