Revize 5aeb60a5
Přidáno uživatelem Martin Lácha před téměř 4 roky(ů)
- ID 5aeb60a5db1282041bf0d5500a1a994c75439472
- Rodič 57b9509e
src/app/dashboard/components/dashboard.component.ts | ||
---|---|---|
1 |
import { Component, OnInit } from '@angular/core';
|
|
1 |
import {Component, Inject, Injectable, OnInit} from '@angular/core';
|
|
2 | 2 |
import {Group} from '../../shared/api/endpoints/models/group'; |
3 | 3 |
import {Drivers} from '../../shared/api/endpoints/models/drivers'; |
4 | 4 |
import {GeneralInfo} from '../../shared/api/endpoints/models/general-info'; |
... | ... | |
8 | 8 |
import {GroupService} from '../../shared/api/endpoints/services/group.service'; |
9 | 9 |
import {DataService} from '../../shared/api/endpoints/services/data.service'; |
10 | 10 |
import {tap} from 'rxjs/operators'; |
11 |
import {MatDialog, MatDialogConfig} from "@angular/material/dialog"; |
|
12 |
import {DialogComponent} from "../../dialog/component/dialog.component"; |
|
13 |
import {Router} from "@angular/router"; |
|
14 |
|
|
11 | 15 |
|
12 | 16 |
@Component({ |
13 | 17 |
selector: 'app-dashboard', |
... | ... | |
18 | 22 |
|
19 | 23 |
groups: Group[]; |
20 | 24 |
units: Array<{ drivers?: Drivers; generalInfo?: GeneralInfo; holder?: any; lastpos?: Lastpos; sensors?: Array<Sensor>; unit?: Unit }>; |
25 |
items = [ |
|
26 |
{ |
|
27 |
label: 'Units', |
|
28 |
items: [ |
|
29 |
[ |
|
30 |
{ |
|
31 |
label: 'units 1', |
|
32 |
items: [{label: 'sensor 1.1'}, {label: 'sensor 1.2'}] |
|
33 |
}, |
|
34 |
{ |
|
35 |
label: 'units 2', |
|
36 |
items: [{label: 'sensor 2.1'}, {label: 'sensor 2.2'}] |
|
37 |
} |
|
38 |
], |
|
39 |
[ |
|
40 |
{ |
|
41 |
label: 'units 3', |
|
42 |
items: [{label: 'sensor 3.1'}, {label: 'sensor 3.2'}] |
|
43 |
}, |
|
44 |
{ |
|
45 |
label: 'units 4', |
|
46 |
items: [{label: 'sensor 4.1'}, {label: 'sensor 4.2'}] |
|
47 |
} |
|
48 |
] |
|
49 |
] |
|
50 |
}, |
|
51 |
{ |
|
52 |
label: 'Menu Item', |
|
53 |
items: [ |
|
54 |
[ |
|
55 |
{ |
|
56 |
label: 'Event 1', |
|
57 |
items: [{label: 'Event 1.1'}, {label: 'Event 1.2'}] |
|
58 |
}, |
|
59 |
{ |
|
60 |
label: 'Event 2', |
|
61 |
items: [{label: 'Event 2.1'}, {label: 'Event 2.2'}] |
|
62 |
} |
|
63 |
], |
|
64 |
[ |
|
65 |
{ |
|
66 |
label: 'Event 3', |
|
67 |
items: [{label: 'Event 3.1'}, {label: 'Event 3.2'}] |
|
68 |
}, |
|
69 |
{ |
|
70 |
label: 'Event 4', |
|
71 |
items: [{label: 'Event 4.1'}, {label: 'Event 4.2'}] |
|
72 |
} |
|
73 |
] |
|
74 |
] |
|
75 |
}, |
|
76 |
{ |
|
77 |
label: 'Settings', icon: 'pi pi-fw pi-cog', command: () => this.openSetting() |
|
78 |
} |
|
79 |
] |
|
21 | 80 |
|
22 | 81 |
constructor( |
23 | 82 |
private groupService: GroupService, |
24 |
private dataService: DataService |
|
83 |
private dataService: DataService, |
|
84 |
private router: Router |
|
25 | 85 |
) { |
26 | 86 |
} |
27 | 87 |
|
... | ... | |
42 | 102 |
).toPromise() |
43 | 103 |
} |
44 | 104 |
|
105 |
openSetting() { |
|
106 |
this.router.navigate(['/setting']); |
|
107 |
} |
|
45 | 108 |
} |
Také k dispozici: Unified diff
Re #8621 - Návrh modelu dashboardu