Commit 717c521e authored by Vitali Stupin's avatar Vitali Stupin

Initial

parent 78996152
<!--The content below is only a placeholder and can be replaced.-->
<div style="text-align:center">
<h1>
Welcome to {{ title }}!
</h1>
<img width="300" alt="Angular Logo" src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNTAgMjUwIj4KICAgIDxwYXRoIGZpbGw9IiNERDAwMzEiIGQ9Ik0xMjUgMzBMMzEuOSA2My4ybDE0LjIgMTIzLjFMMTI1IDIzMGw3OC45LTQzLjcgMTQuMi0xMjMuMXoiIC8+CiAgICA8cGF0aCBmaWxsPSIjQzMwMDJGIiBkPSJNMTI1IDMwdjIyLjItLjFWMjMwbDc4LjktNDMuNyAxNC4yLTEyMy4xTDEyNSAzMHoiIC8+CiAgICA8cGF0aCAgZmlsbD0iI0ZGRkZGRiIgZD0iTTEyNSA1Mi4xTDY2LjggMTgyLjZoMjEuN2wxMS43LTI5LjJoNDkuNGwxMS43IDI5LjJIMTgzTDEyNSA1Mi4xem0xNyA4My4zaC0zNGwxNy00MC45IDE3IDQwLjl6IiAvPgogIDwvc3ZnPg==">
</div>
<h2>Here are some links to help you start: </h2>
<ul>
<li>
<h2><a target="_blank" rel="noopener" href="https://angular.io/tutorial">Tour of Heroes</a></h2>
</li>
<li>
<h2><a target="_blank" rel="noopener" href="https://angular.io/cli">CLI Documentation</a></h2>
</li>
<li>
<h2><a target="_blank" rel="noopener" href="https://blog.angular.io/">Angular blog</a></h2>
</li>
</ul>
<div class="container">
<h1>All subsystems with methods and WSDL descriptions for instance "EE"</h1>
<h3>How is this report generated?</h3>
<br>
<p>This report is generated by making getWsdl requests from RIA's Monitoring Security Server to all X-Road subsystems in the X-Road instance.</p>
<p>Subsystems with the <span class="badge badge-secondary">Empty</span> icon have no X-Road services available.</p>
<p>Subsystems with the <span class="badge badge-danger">Error</span> icon either could not be reached by RIA's Monitoring Security Server or there was some other error during the request.</p>
<p>Support: <a href="mailto:help@ria.ee">help@ria.ee</a></p>
<app-search></app-search>
<app-method-list></app-method-list>
</div>
\ No newline at end of file
......@@ -6,5 +6,4 @@ import { Component } from '@angular/core';
styleUrls: ['./app.component.css']
})
export class AppComponent {
title = 'methods';
}
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { HttpClientModule } from '@angular/common/http';
import { AppComponent } from './app.component';
import { MethodListComponent } from './method-list/method-list.component';
import { SearchComponent } from './search/search.component';
import { SubsystemItemComponent } from './method-list/subsystem-item/subsystem-item.component';
@NgModule({
declarations: [
AppComponent
AppComponent,
MethodListComponent,
SearchComponent,
SubsystemItemComponent
],
imports: [
BrowserModule
BrowserModule,
HttpClientModule
],
providers: [],
bootstrap: [AppComponent]
......
<div class="card" *ngFor="let subsystem of subsystems">
<app-subsystem-item [subsystem]="subsystem"></app-subsystem-item>
</div>
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { MethodListComponent } from './method-list.component';
describe('MethodListComponent', () => {
let component: MethodListComponent;
let fixture: ComponentFixture<MethodListComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ MethodListComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(MethodListComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
import { Component, OnInit } from '@angular/core';
import { Subsystem } from '../subsystem';
import { MethodsService } from '../methods.service';
@Component({
selector: 'app-method-list',
templateUrl: './method-list.component.html',
styleUrls: ['./method-list.component.css']
})
export class MethodListComponent implements OnInit {
subsystems: Subsystem[];
constructor(private methodsService: MethodsService) { }
ngOnInit() {
this.getMethods();
}
getMethods(): void {
this.methodsService.getMethods()
.subscribe(subsystems => this.subsystems = subsystems.slice(0, 50));
}
}
.pointerCursor {
cursor: pointer;
}
\ No newline at end of file
<div class="card-header pointerCursor" (click)="isHidden = !isHidden">
{{subsystemName}}
<span class="badge badge-secondary" *ngIf="!subsystem.methods.length && subsystem.subsystemStatus == 'OK'">Empty</span>
<span class="badge badge-danger" *ngIf="subsystem.subsystemStatus == 'ERROR'">Error</span>
</div>
<div class="card-body" [hidden]="isHidden" *ngIf="!subsystem.methods.length">
<p>No services found</p>
</div>
<div class="card-body" [hidden]="isHidden" *ngIf="subsystem.methods.length">
<p *ngFor="let method of subsystem.methods">
{{subsystemName}}/{{method.serviceCode}}/{{method.serviceVersion}}
<a href="{{methodsService.apiUrlBase}}{{method.wsdl}}" class="badge badge-success" *ngIf="method.wsdl">WSDL</a>
<span class="badge badge-danger" *ngIf="!method.wsdl">Error while downloading or parsing of WSDL</span>
</p>
</div>
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { SubsystemItemComponent } from './subsystem-item.component';
describe('SubsystemItemComponent', () => {
let component: SubsystemItemComponent;
let fixture: ComponentFixture<SubsystemItemComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ SubsystemItemComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(SubsystemItemComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
import { Component, OnInit, Input } from '@angular/core';
import { Subsystem } from '../../subsystem';
import { MethodsService } from '../../methods.service';
@Component({
selector: 'app-subsystem-item',
templateUrl: './subsystem-item.component.html',
styleUrls: ['./subsystem-item.component.css']
})
export class SubsystemItemComponent implements OnInit {
@Input() subsystem: Subsystem;
subsystemName: string;
isHidden: boolean = true;
constructor(private methodsService: MethodsService) { }
ngOnInit() {
this.subsystemName = this.subsystem.xRoadInstance + '/' + this.subsystem.memberClass
+ '/' + this.subsystem.memberCode + '/' + this.subsystem.subsystemCode
}
}
export class Method {
methodStatus: string;
serviceCode: string;
wsdl: string;
serviceVersion: string;
}
import { TestBed } from '@angular/core/testing';
import { MethodsService } from './methods.service';
describe('MethodsService', () => {
beforeEach(() => TestBed.configureTestingModule({}));
it('should be created', () => {
const service: MethodsService = TestBed.get(MethodsService);
expect(service).toBeTruthy();
});
});
import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { Observable, of } from 'rxjs';
import { catchError } from 'rxjs/operators';
import { Subsystem } from './subsystem';
@Injectable({
providedIn: 'root'
})
export class MethodsService {
//private apiUrlBase = 'https://www.x-tee.ee/catalogue/EE/wsdls/';
public apiUrlBase = 'http://localhost/';
private apiService = 'index.json';
private apiUrl = this.apiUrlBase + this.apiService;
private subsystems: Subsystem[];
private observable: Observable<Subsystem[]>;
constructor(private http: HttpClient) {
this.observable = this.http.get<Subsystem[]>(this.apiUrl)
.pipe(
catchError(this.handleError('getMethods', []))
);
this.observable.subscribe(subsystems => this.subsystems = subsystems);
}
getMethods (): Observable<Subsystem[]> {
if (this.subsystems) {
return of(this.subsystems)
} else {
return this.observable;
}
}
/**
* Handle Http operation that failed.
* Let the app continue.
* @param operation - name of the operation that failed
* @param result - optional value to return as the observable result
*/
private handleError<T> (operation = 'operation', result?: T) {
return (error: any): Observable<T> => {
// TODO: send the error to remote logging infrastructure
console.error(error); // log to console instead
// Let the app keep running by returning an empty result.
return of(result as T);
};
}
}
import { TestBed } from '@angular/core/testing';
import { SearchService } from './search.service';
describe('SearchService', () => {
beforeEach(() => TestBed.configureTestingModule({}));
it('should be created', () => {
const service: SearchService = TestBed.get(SearchService);
expect(service).toBeTruthy();
});
});
import { Injectable } from '@angular/core';
@Injectable({
providedIn: 'root'
})
export class SearchService {
constructor() { }
}
<div class="card">
<div class="card-header">
Search filters
</div>
<div class="card-body">
<div class="form-group form-check">
<input type="checkbox" class="form-check-input" id="exampleCheck1">
<label class="form-check-label" for="exampleCheck1">Check me out</label>
</div>
</div>
</div>
<br>
\ No newline at end of file
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { SearchComponent } from './search.component';
describe('SearchComponent', () => {
let component: SearchComponent;
let fixture: ComponentFixture<SearchComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ SearchComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(SearchComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-search',
templateUrl: './search.component.html',
styleUrls: ['./search.component.css']
})
export class SearchComponent implements OnInit {
constructor() { }
ngOnInit() {
}
}
import { Method } from './method';
export class Subsystem {
memberClass: string;
subsystemCode: string;
xRoadInstance: string;
subsystemStatus: string;
memberCode: string;
methods: Method[];
}
......@@ -7,6 +7,11 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico">
<link rel="stylesheet"
href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css">
<!--script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"></script-->
</head>
<body>
<app-root></app-root>
......
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