Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix vm title on device list page. fixed a traceback as well. #581

Merged
merged 1 commit into from Apr 5, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 7 additions & 4 deletions src/app/pages/vm/devices/device-list/device-list.component.ts
@@ -1,18 +1,18 @@
import {Component, ElementRef, OnInit} from '@angular/core';
import {ActivatedRoute, Router} from '@angular/router';
import {Subscription} from 'rxjs';
import {Subscription} from 'rxjs/Subscription';


import {RestService, WebSocketService} from '../../../../services/';
import { DialogService } from 'app/services';
import { AppLoaderService } from '../../../../services/app-loader/app-loader.service';
import { EntityUtils } from '../../../common/entity/utils';
import { ChangeDetectorRef } from '@angular/core';

@Component({
selector : 'app-device-list',
template : `
<h1> VM: {{ this.vm }} Devices </h1>
<entity-table [conf]="this"></entity-table>
<entity-table [title]="title" [conf]="this"></entity-table>
`
})
export class DeviceListComponent {
Expand All @@ -30,14 +30,15 @@ export class DeviceListComponent {
public columns: Array<any> = [
{name : 'Type', prop : 'dtype'},
];
public title = "VM ";
public config: any = {
paging : true,
sorting : {columns : this.columns},
};

constructor(protected router: Router, protected aroute: ActivatedRoute,
protected rest: RestService, protected ws: WebSocketService, protected loader: AppLoaderService,
public dialogService: DialogService) {}
public dialogService: DialogService, private cdRef:ChangeDetectorRef) {}


isActionVisible(actionId: string, row: any) {
Expand Down Expand Up @@ -142,6 +143,8 @@ export class DeviceListComponent {
this.route_delete = [ 'vm', this.pk, 'devices', this.vm, 'delete' ];
// this is filter by vm's id to show devices belonging to that VM
this.resource_name = 'vm/device/?vm__id=' + this.pk;
this.title = this.title + this.vm + ' devices';
this.cdRef.detectChanges();
});
}
}