mirror of
https://github.com/octoleo/syncthing.git
synced 2024-12-27 04:32:39 +00:00
Change device/folder getAll to getEach
This commit is contained in:
parent
f53475a204
commit
24a637e9e6
@ -4,7 +4,7 @@ import { ChartComponent } from './chart.component';
|
||||
import { HttpClientModule } from '@angular/common/http';
|
||||
|
||||
class MockService {
|
||||
getAll() {
|
||||
getEach() {
|
||||
// unimplemented
|
||||
}
|
||||
};
|
||||
|
@ -72,7 +72,7 @@ export class ChartComponent implements OnInit {
|
||||
|
||||
ngAfterViewInit() {
|
||||
let totalCount: number = 0;
|
||||
this.service.getAll().subscribe(
|
||||
this.service.getEach().subscribe(
|
||||
t => {
|
||||
// Count the number of folders and set chart
|
||||
totalCount++;
|
||||
|
@ -62,7 +62,10 @@ export class DeviceService {
|
||||
});
|
||||
}
|
||||
|
||||
getAll(): Observable<Device> {
|
||||
/**
|
||||
* getEach() returns each device
|
||||
*/
|
||||
getEach(): Observable<Device> {
|
||||
const deviceObservable: Observable<Device> = new Observable((observer) => {
|
||||
// TODO return devices if cached
|
||||
|
||||
@ -116,8 +119,8 @@ export class DeviceService {
|
||||
}
|
||||
)
|
||||
},
|
||||
err => { console.log("getAll error!", err) },
|
||||
() => { console.log("get all complete!") }
|
||||
err => { console.log("getEach error!", err) },
|
||||
() => { console.log("getEach complete!") }
|
||||
);
|
||||
});
|
||||
return deviceObservable
|
||||
|
@ -49,10 +49,11 @@ export class FolderService {
|
||||
}
|
||||
|
||||
/**
|
||||
* getAll() finds all folders and uses db status service to
|
||||
* set all their statuses
|
||||
* getEach() returns each folder and uses db status service to
|
||||
* set all their statuses and db completion service to find
|
||||
* completion
|
||||
*/
|
||||
getAll(): Observable<Folder> {
|
||||
getEach(): Observable<Folder> {
|
||||
// TODO return this.folders if cached
|
||||
|
||||
const folderObservable: Observable<Folder> = new Observable((observer) => {
|
||||
@ -63,8 +64,8 @@ export class FolderService {
|
||||
// Synchronously get the status of each folder
|
||||
this.getFolderStatusInOrder(observer, 0);
|
||||
},
|
||||
err => { console.log("getAll error!", err) },
|
||||
() => { console.log("get all complete!") }
|
||||
err => { console.log("getEach error!", err) },
|
||||
() => { console.log("getEach complete!") }
|
||||
);
|
||||
});
|
||||
return folderObservable;
|
||||
|
Loading…
Reference in New Issue
Block a user