Files
jambotron/jambotron-ui/src/app/services/system.service.ts
T

33 lines
965 B
TypeScript

import { Injectable } from '@angular/core';
import {HttpClient} from '@angular/common/http';
import {Observable} from 'rxjs';
import {Tutorial} from '../models/tutorial.model';
import {Bean} from '../models/Bean';
import {NameValueItem} from '../models/name-value-item';
import {GlobalConstants} from '../global-constants';
@Injectable({
providedIn: 'root'
})
export class SystemService {
baseUrl : string = `${GlobalConstants.API_URL}/system`;
constructor(private http: HttpClient) { }
getDataSourceProperties(): Observable<NameValueItem[]>{
return this.http.get<NameValueItem[]>(this.baseUrl + "/data-source-properties")
}
getAllBeans(): Observable<Bean[]> {
return this.http.get<Bean[]>(this.baseUrl+"/beans");
}
getImage(): Observable<Blob> {
return this.http.get(this.baseUrl+"/image", {responseType: 'blob'});
}
getCustomBeans(): Observable<Bean[]> {
return this.http.get<Bean[]>(this.baseUrl+"/beans/custom");
}
}