Merge pull request #2861 from pengpengshui/master

fix #2853 about replication rule link issue
This commit is contained in:
Steven Zou 2017-07-25 19:04:04 +08:00 committed by GitHub
commit 7f96ba48bc
2 changed files with 12 additions and 1 deletions

View File

@ -1,3 +1,3 @@
<div style="margin-top: 24px;"> <div style="margin-top: 24px;">
<hbr-replication [withReplicationJob]='false'></hbr-replication> <hbr-replication [withReplicationJob]='false' (redirect)="customRedirect($event)"></hbr-replication>
</div> </div>

View File

@ -13,9 +13,20 @@
// limitations under the License. // limitations under the License.
import { Component } from '@angular/core'; import { Component } from '@angular/core';
import {Router,ActivatedRoute} from "@angular/router";
import {ReplicationRule} from "harbor-ui";
@Component({ @Component({
selector: 'total-replication', selector: 'total-replication',
templateUrl: 'total-replication-page.component.html' templateUrl: 'total-replication-page.component.html'
}) })
export class TotalReplicationPageComponent { export class TotalReplicationPageComponent {
constructor(private router: Router,
private activeRoute: ActivatedRoute){}
customRedirect(rule: ReplicationRule): void {
if (rule) {
this.router.navigate(['../../projects', rule.project_id, "replications"], { relativeTo: this.activeRoute });
}
}
} }