-export class CatalogComponent {
-
- settings = {
- hideSubHeader: true,
- actions: {
- columnTitle: 'Actions',
- add: false,
- edit: false,
- delete: false,
- custom: [
- { name: 'deployxApp', title: 'Deploy'},
- ],
- position: 'right'
-
- },
- columns: {
- name: {
- title: 'xApp Name',
- type: 'string',
- },
- version: {
- title: 'xApp Version',
- type: 'string',
- },
- status: {
- title: 'Status',
- type: 'string',
- },
- },
- };
-
- source: LocalDataSource = new LocalDataSource();
-
- constructor(private service: CatalogService, public dialog: MatDialog) {
- this.service.getAll().subscribe((val:any[]) => this.source.load(val));
+export class CatalogComponent implements OnInit {
+
+ darkMode: boolean;
+ panelClass: string = "";
+ displayedColumns: string[] = ['name', 'version', 'action'];
+ dataSource: CatalogDataSource;
+ @ViewChild(MatSort, { static: true }) sort: MatSort;
+
+ constructor(
+ private appMgrService: AppMgrService,
+ private confirmDialogService: ConfirmDialogService,
+ private dialog: MatDialog,
+ private errorDiaglogService: ErrorDialogService,
+ private loadingDialogService: LoadingDialogService,
+ private notificationService: NotificationService,
+ public ui: UiService) { }
+
+ ngOnInit() {
+ this.dataSource = new CatalogDataSource(this.appMgrService, this.sort, this.notificationService);
+ this.dataSource.loadTable();
+ this.ui.darkModeState.subscribe((isDark) => {
+ this.darkMode = isDark;
+ });