mirror of
https://gitlab.com/openlp/web-remote.git
synced 2024-12-22 19:32:49 +00:00
Showing the slides works
This commit is contained in:
parent
48750470bd
commit
4ebbba85e7
@ -20,18 +20,6 @@ let deserialize = (json, cls) => {
|
|||||||
return inst;
|
return inst;
|
||||||
}
|
}
|
||||||
|
|
||||||
let buildTextParams = id => {
|
|
||||||
let params: URLSearchParams = new URLSearchParams();
|
|
||||||
params.set('data', '{"request": {"text": "' + id + '"}}');
|
|
||||||
return {search: params}
|
|
||||||
}
|
|
||||||
|
|
||||||
let buildNumberParams = id => {
|
|
||||||
let params: URLSearchParams = new URLSearchParams();
|
|
||||||
params.set('data', '{"request": {"id": ' + id + '}}');
|
|
||||||
return {search: params}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class OpenLPService {
|
export class OpenLPService {
|
||||||
private apiURL: string = 'http://localhost:4316';
|
private apiURL: string = 'http://localhost:4316';
|
||||||
@ -53,43 +41,13 @@ export class OpenLPService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getItemSlides(): Observable<Slide[]> {
|
getItemSlides(): Observable<Slide[]> {
|
||||||
return this.http.get<SlideOuterResponse>('http://localhost:4316/controller/live/text')
|
return this.http.get<Slide[]>('http://localhost:4316/controller/live/text');
|
||||||
.pipe(
|
|
||||||
take(1),
|
|
||||||
map(result => result.results.slides));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// getItemSlides() {
|
|
||||||
// return this.http.get('http://localhost:4316/api/controller/live/text')
|
|
||||||
// .toPromise()
|
|
||||||
// .then(response => {
|
|
||||||
// let slides:Slide[] = [];
|
|
||||||
// response.json().results.slides.forEach(item => {
|
|
||||||
// let slide = deserialize(item, Slide);
|
|
||||||
// slide.lines = slide.text.split('\n');
|
|
||||||
// slides.push(slide);
|
|
||||||
// });
|
|
||||||
// return slides;
|
|
||||||
// })
|
|
||||||
// .catch(this.handleError);
|
|
||||||
// }
|
|
||||||
|
|
||||||
getServiceItems(): Observable<ServiceItem[]> {
|
getServiceItems(): Observable<ServiceItem[]> {
|
||||||
return this.http.get<ServiceItem[]>('http://localhost:4316/service/list');
|
return this.http.get<ServiceItem[]>('http://localhost:4316/service/list');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// getServiceItems() {
|
|
||||||
// return this.http.get('http://localhost:4316/api/service/list')
|
|
||||||
// .toPromise()
|
|
||||||
// .then(response => {
|
|
||||||
// let serviceItems:ServiceItem[] = [];
|
|
||||||
// response.json().results.items.forEach(item => serviceItems.push(deserialize(item, ServiceItem)));
|
|
||||||
// return serviceItems;
|
|
||||||
// })
|
|
||||||
// .catch(this.handleError);
|
|
||||||
// }
|
|
||||||
|
|
||||||
sendItemLive(plugin, id) {}
|
sendItemLive(plugin, id) {}
|
||||||
showAlert(text) {}
|
showAlert(text) {}
|
||||||
addItemToService(plugin, id) {}
|
addItemToService(plugin, id) {}
|
||||||
@ -98,16 +56,13 @@ export class OpenLPService {
|
|||||||
return this.http.get<PluginDescription[]>(`${this.apiURL}/plugin/search`);
|
return this.http.get<PluginDescription[]>(`${this.apiURL}/plugin/search`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// getSearchablePlugins() {
|
|
||||||
// return this.http.get('http://localhost:4316/plugin/search')
|
|
||||||
// .toPromise()
|
|
||||||
// .then(response => response.json().results.items)
|
|
||||||
// .catch(this.handleError);
|
|
||||||
// }
|
|
||||||
|
|
||||||
setServiceItem(id:number) {
|
setServiceItem(id:number) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
search(plugin, text) {
|
||||||
|
return this.http.get(`${this.apiURL}/${plugin}/search?q=${text}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// setServiceItem(id:number) {
|
// setServiceItem(id:number) {
|
||||||
// this.http.get('http://localhost:4316/service/set', buildNumberParams(id))
|
// this.http.get('http://localhost:4316/service/set', buildNumberParams(id))
|
||||||
@ -187,9 +142,6 @@ export class OpenLPService {
|
|||||||
.catch(this.dropError);
|
.catch(this.dropError);
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
search(plugin, text) {
|
|
||||||
return this.http.get(`${this.apiURL}/${plugin}/search?q=${text}`);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@ export class OpenLPSlidesComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getSlides() {
|
getSlides() {
|
||||||
// this.openlpService.getItemSlides().then(slides=> {this.slides = slides;console.log(slides);});
|
this.openlpService.getItemSlides().subscribe(slides => this.slides = slides);
|
||||||
}
|
}
|
||||||
|
|
||||||
constructor(private openlpService: OpenLPService) {
|
constructor(private openlpService: OpenLPService) {
|
||||||
|
Loading…
Reference in New Issue
Block a user