fix #2853 about replication rule link issue

This commit is contained in:
pengpengshui 2017-07-26 03:51:47 +08:00
parent a047c1fe96
commit 30bd67748e
2 changed files with 11 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

@ -12,10 +12,20 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
import { Component } from '@angular/core'; import { Component } from '@angular/core';
import {ReplicationRule} from "../../../../lib/src/service/interface";
import {Router} from "@angular/router";
@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 {
rule: ReplicationRule[];
constructor(private router: Router){}
customRedirect(rule: ReplicationRule): void {
if (rule) {
this.router.navigateByUrl(`/harbor/projects/${rule.project_id}/replications`);
}
}
} }