Compare commits

...
Sign in to create a new pull request.

1 commit

Author SHA1 Message Date
google-labs-jules[bot]
15fa4117ab feat(ui): pass profileId in navigation
- Updated `navigateToProfiles` in `MainLayoutComponent` to pass `profileId` as a query parameter.
- Updated `ProfilesComponent` to read the `id` query parameter and set `editingProfileId` accordingly.
2026-01-06 21:53:48 +00:00
2 changed files with 13 additions and 4 deletions

View file

@ -127,8 +127,7 @@ export class MainLayoutComponent implements AfterViewInit {
}
navigateToProfiles(profileId: string) {
// TODO: Could pass profileId via query params or state
this.router.navigate(['/', 'profiles']);
this.router.navigate(['/', 'profiles'], { queryParams: { id: profileId } });
}
navigateToConsole(minerName: string) {

View file

@ -1,5 +1,6 @@
import { Component, inject, signal } from '@angular/core';
import { Component, inject, signal, OnInit } from '@angular/core';
import { CommonModule } from '@angular/common';
import { ActivatedRoute } from '@angular/router';
import { MinerService } from '../../miner.service';
import { NotificationService } from '../../notification.service';
import { ProfileCreateComponent } from '../../profile-create.component';
@ -555,9 +556,10 @@ import { ProfileCreateComponent } from '../../profile-create.component';
}
`]
})
export class ProfilesComponent {
export class ProfilesComponent implements OnInit {
private minerService = inject(MinerService);
private notifications = inject(NotificationService);
private route = inject(ActivatedRoute);
state = this.minerService.state;
showCreateForm = signal(false);
@ -571,6 +573,14 @@ export class ProfilesComponent {
profiles = () => this.state().profiles;
ngOnInit() {
this.route.queryParams.subscribe(params => {
if (params['id']) {
this.editingProfileId.set(params['id']);
}
});
}
isRunning(profileId: string): boolean {
return this.state().runningMiners.some(m => m.profile_id === profileId);
}