-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
96d4cda
commit c431f00
Showing
56 changed files
with
978 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
14 changes: 14 additions & 0 deletions
14
Front/SoftSecurity/src/app/alerta-detail/alerta-detail.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<div *ngIf="alerta"> | ||
<h2>{{ alerta.tipoAlerta }}</h2> | ||
|
||
<div><span>Cantidad Alertas: </span>{{ alerta.cantidadAlertas }}</div> | ||
|
||
<div> | ||
<label>Tipo Alerta: | ||
<input [(ngModel)]="alerta.tipoAlerta" placeholder="Tipo Alerta"> | ||
</label> | ||
</div> | ||
|
||
<button (click)="goBack()">Retroceder</button> | ||
|
||
</div> |
25 changes: 25 additions & 0 deletions
25
Front/SoftSecurity/src/app/alerta-detail/alerta-detail.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { AlertaDetailComponent } from './alerta-detail.component'; | ||
|
||
describe('AlertaDetailComponent', () => { | ||
let component: AlertaDetailComponent; | ||
let fixture: ComponentFixture<AlertaDetailComponent>; | ||
|
||
beforeEach(async(() => { | ||
TestBed.configureTestingModule({ | ||
declarations: [ AlertaDetailComponent ] | ||
}) | ||
.compileComponents(); | ||
})); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(AlertaDetailComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
35 changes: 35 additions & 0 deletions
35
Front/SoftSecurity/src/app/alerta-detail/alerta-detail.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { Component, OnInit, Input} from '@angular/core'; | ||
import { Alerta } from '../alerta'; | ||
import { ActivatedRoute } from '@angular/router'; | ||
import { Location } from '@angular/common'; | ||
|
||
import { AlertaService } from '../alerta.service'; | ||
|
||
@Component({ | ||
selector: 'app-alerta-detail', | ||
templateUrl: './alerta-detail.component.html', | ||
styleUrls: ['./alerta-detail.component.css'] | ||
}) | ||
export class AlertaDetailComponent implements OnInit { | ||
|
||
@Input() alerta: Alerta; | ||
|
||
constructor( | ||
private route: ActivatedRoute, | ||
private alertaService: AlertaService, | ||
private location: Location | ||
) { } | ||
|
||
ngOnInit(): void { | ||
this.getAlerta(); | ||
} | ||
|
||
getAlerta(): void { | ||
const cantidadAlertas = +this.route.snapshot.paramMap.get('cantidadAlertas'); | ||
this.alertaService.getAlerta(cantidadAlertas).subscribe(alerta => this.alerta = alerta); | ||
} | ||
|
||
goBack(): void { | ||
this.location.back(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { TestBed, inject } from '@angular/core/testing'; | ||
|
||
import { AlertaService } from './alerta.service'; | ||
|
||
describe('AlertaService', () => { | ||
beforeEach(() => { | ||
TestBed.configureTestingModule({ | ||
providers: [AlertaService] | ||
}); | ||
}); | ||
|
||
it('should be created', inject([AlertaService], (service: AlertaService) => { | ||
expect(service).toBeTruthy(); | ||
})); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { Injectable } from '@angular/core'; | ||
import { Alerta } from './alerta'; | ||
import { ALERTAS } from './alertas'; | ||
import { Observable, of } from 'rxjs'; | ||
|
||
@Injectable({ | ||
providedIn: 'root' | ||
}) | ||
|
||
export class AlertaService { | ||
|
||
constructor() { } | ||
|
||
getAlertas(): Observable<Alerta[]> { | ||
// TODO: send the message _after_ fetching the heroes | ||
//this.mensajeService.add(`AlertaService: fetched alertas`); | ||
return of(ALERTAS); | ||
} | ||
|
||
getAlerta(cantidadAlertas: number): Observable<Alerta> { | ||
// TODO: send the message _after_ fetching the heroes | ||
//this.mensajeService.add(`HeroService: fetched hero cantidadAlertas=${cantidadAlertas}`); | ||
return of(ALERTAS.find(alerta => alerta.cantidadAlertas === cantidadAlertas)); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export class Alerta { | ||
cantidadAlertas: number; | ||
tipoAlerta: string; | ||
} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<p> | ||
alerta works! | ||
</p> |
25 changes: 25 additions & 0 deletions
25
Front/SoftSecurity/src/app/alerta/alerta.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { AlertaComponent } from './alerta.component'; | ||
|
||
describe('AlertaComponent', () => { | ||
let component: AlertaComponent; | ||
let fixture: ComponentFixture<AlertaComponent>; | ||
|
||
beforeEach(async(() => { | ||
TestBed.configureTestingModule({ | ||
declarations: [ AlertaComponent ] | ||
}) | ||
.compileComponents(); | ||
})); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(AlertaComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { Component, OnInit } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'app-alerta', | ||
templateUrl: './alerta.component.html', | ||
styleUrls: ['./alerta.component.css'] | ||
}) | ||
export class AlertaComponent implements OnInit { | ||
|
||
constructor() { } | ||
|
||
ngOnInit() { | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { Alerta } from './alerta'; | ||
|
||
export const ALERTAS: Alerta[] = [ | ||
{ cantidadAlertas: 4, tipoAlerta: 'puerta Abierta'}, | ||
{ cantidadAlertas: 7, tipoAlerta: 'contrasenha Incorrecta'} | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { AppRoutingModule } from './app-routing.module'; | ||
|
||
describe('AppRoutingModule', () => { | ||
let appRoutingModule: AppRoutingModule; | ||
|
||
beforeEach(() => { | ||
appRoutingModule = new AppRoutingModule(); | ||
}); | ||
|
||
it('should create an instance', () => { | ||
expect(appRoutingModule).toBeTruthy(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { NgModule } from '@angular/core'; | ||
import { RouterModule, Routes } from '@angular/router'; | ||
import { SoftsecurityComponent } from './softsecurity/softsecurity.component'; | ||
import { AlertaDetailComponent } from './alerta-detail/alerta-detail.component'; | ||
|
||
|
||
const routes: Routes = [ | ||
{ path: '', redirectTo: '/dashboard', pathMatch: 'full' }, | ||
{ path: 'detail/:id', component: AlertaDetailComponent }, | ||
{ path: 'alertas', component: SoftsecurityComponent } | ||
]; | ||
|
||
@NgModule({ | ||
imports: [ RouterModule.forRoot(routes) ], | ||
exports: [ RouterModule ] | ||
}) | ||
|
||
export class AppRoutingModule {} | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* Application-wide Styles */ | ||
h1 { | ||
color: #5a001b; | ||
font-family: Arial, Helvetica, sans-serif; | ||
font-size: 800%; | ||
} | ||
h2, h3 { | ||
color: #444; | ||
font-family: Arial, Helvetica, sans-serif; | ||
font-weight: lighter; | ||
font-size: 2em; | ||
margin-top: 0; | ||
padding-top: 0; | ||
} | ||
nav a { | ||
padding: 5px 10px; | ||
text-decoration: none; | ||
margin-top: 10px; | ||
display: inline-block; | ||
background-color: #eee; | ||
border-radius: 4px; | ||
} | ||
nav a:visited, a:link { | ||
color: #607D8B; | ||
} | ||
nav a:hover { | ||
color: #039be5; | ||
background-color: #CFD8DC; | ||
} | ||
nav a.active { | ||
color: #039be5; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<!--The content below is only a placeholder and can be replaced.--> | ||
<body> | ||
|
||
<div style="text-align:center"> | ||
<h1>{{title}}</h1> | ||
<nav> | ||
<br> | ||
<a routerLink="/alertas"> Alertas</a> | ||
</nav> | ||
<router-outlet></router-outlet> | ||
<app-mapa></app-mapa> | ||
</div> | ||
|
||
</body> | ||
|
||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { TestBed, async } from '@angular/core/testing'; | ||
import { AppComponent } from './app.component'; | ||
describe('AppComponent', () => { | ||
beforeEach(async(() => { | ||
TestBed.configureTestingModule({ | ||
declarations: [ | ||
AppComponent | ||
], | ||
}).compileComponents(); | ||
})); | ||
it('should create the app', async(() => { | ||
const fixture = TestBed.createComponent(AppComponent); | ||
const app = fixture.debugElement.componentInstance; | ||
expect(app).toBeTruthy(); | ||
})); | ||
it(`should have as title 'app'`, async(() => { | ||
const fixture = TestBed.createComponent(AppComponent); | ||
const app = fixture.debugElement.componentInstance; | ||
expect(app.title).toEqual('app'); | ||
})); | ||
it('should render title in a h1 tag', async(() => { | ||
const fixture = TestBed.createComponent(AppComponent); | ||
fixture.detectChanges(); | ||
const compiled = fixture.debugElement.nativeElement; | ||
expect(compiled.querySelector('h1').textContent).toContain('Welcome to app!'); | ||
})); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { Component } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'app-root', | ||
templateUrl: './app.component.html', | ||
styleUrls: ['./app.component.css'] | ||
}) | ||
export class AppComponent { | ||
title = 'SoftSecurity'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { BrowserModule } from '@angular/platform-browser'; | ||
import { NgModule } from '@angular/core'; | ||
|
||
import { AppComponent } from './app.component'; | ||
import { SoftsecurityComponent } from './softsecurity/softsecurity.component'; | ||
|
||
import { FormsModule } from '@angular/forms'; | ||
import { AlertaDetailComponent } from './alerta-detail/alerta-detail.component'; | ||
import { AppRoutingModule } from './/app-routing.module'; | ||
import { MapaComponent } from './mapa/mapa.component'; | ||
import { AlertaComponent } from './alerta/alerta.component'; | ||
import { FalloComponent } from './fallo/fallo.component'; | ||
import { FalloDetailComponent } from './fallo-detail/fallo-detail.component'; | ||
|
||
@NgModule({ | ||
declarations: [ | ||
AppComponent, | ||
SoftsecurityComponent, | ||
AlertaDetailComponent, | ||
MapaComponent, | ||
AlertaComponent, | ||
FalloComponent, | ||
FalloDetailComponent | ||
], | ||
imports: [ | ||
BrowserModule, | ||
FormsModule, | ||
AppRoutingModule | ||
], | ||
providers: [], | ||
bootstrap: [AppComponent] | ||
}) | ||
export class AppModule { } |
Empty file.
3 changes: 3 additions & 0 deletions
3
Front/SoftSecurity/src/app/fallo-detail/fallo-detail.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<p> | ||
fallo-detail works! | ||
</p> |
25 changes: 25 additions & 0 deletions
25
Front/SoftSecurity/src/app/fallo-detail/fallo-detail.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { FalloDetailComponent } from './fallo-detail.component'; | ||
|
||
describe('FalloDetailComponent', () => { | ||
let component: FalloDetailComponent; | ||
let fixture: ComponentFixture<FalloDetailComponent>; | ||
|
||
beforeEach(async(() => { | ||
TestBed.configureTestingModule({ | ||
declarations: [ FalloDetailComponent ] | ||
}) | ||
.compileComponents(); | ||
})); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(FalloDetailComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
15 changes: 15 additions & 0 deletions
15
Front/SoftSecurity/src/app/fallo-detail/fallo-detail.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { Component, OnInit } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'app-fallo-detail', | ||
templateUrl: './fallo-detail.component.html', | ||
styleUrls: ['./fallo-detail.component.css'] | ||
}) | ||
export class FalloDetailComponent implements OnInit { | ||
|
||
constructor() { } | ||
|
||
ngOnInit() { | ||
} | ||
|
||
} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<p> | ||
fallo works! | ||
</p> |
Oops, something went wrong.