Skip to content

Commit

Permalink
feat: setup connect between homeMode and fileMode
Browse files Browse the repository at this point in the history
  • Loading branch information
ElonH committed May 21, 2020
1 parent 733370d commit 639725d
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/app/pages/manager/homeMode/homeMode.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,35 @@ import { Component, OnInit } from '@angular/core';
import { UsersService } from '../../users.service';
import { ListRemotesFlow } from 'src/app/@dataflow/rclone';
import { Subject } from 'rxjs';
import { Router, ActivatedRoute } from '@angular/router';

@Component({
selector: 'manager-homeMode',
template: `
<div class="row justify-content-start">
<div class="cloud col-xl-4 col-lg-6 col-md-12" *ngFor="let remote of remotes">
<home-view-remote [easyMode]="true" [title]="remote"> </home-view-remote>
<home-view-remote [easyMode]="true" [title]="remote" (click)="click(remote)">
</home-view-remote>
</div>
</div>
`,
styleUrls: ['./homeMode.component.scss'],
})
export class HomeModeComponent implements OnInit {
constructor(private usersService: UsersService) {}
constructor(
private usersService: UsersService,
private route: ActivatedRoute,
private router: Router
) {}

remotesFlow$: ListRemotesFlow;
remotesTrigger = new Subject<number>();
remotes: string[] = [];

click(remote: string) {
this.router.navigate(['.'], { relativeTo: this.route, queryParams: { remote: remote } });
}

ngOnInit() {
const outer = this;
this.remotesFlow$ = new (class extends ListRemotesFlow {
Expand Down

0 comments on commit 639725d

Please sign in to comment.