Radek Krejci | 95bd14c | 2017-09-21 14:24:13 +0200 | [diff] [blame] | 1 | import { Device } from '../inventory/device'; |
| 2 | |
Radek Krejci | 482629d | 2018-03-13 14:56:00 +0100 | [diff] [blame] | 3 | import { SessionsService } from './sessions.service'; |
| 4 | |
| 5 | export enum NodeType { |
| 6 | container = 1, |
| 7 | leaf = 4, |
| 8 | leaflist = 8, |
| 9 | list = 16 |
| 10 | } |
| 11 | |
Radek Krejci | 95bd14c | 2017-09-21 14:24:13 +0200 | [diff] [blame] | 12 | export class Session { |
| 13 | constructor ( |
| 14 | public key: string, |
| 15 | public device: Device, |
Radek Krejci | 30ce159 | 2018-03-01 14:44:14 +0100 | [diff] [blame] | 16 | public loading = false, |
Radek Krejci | 482629d | 2018-03-13 14:56:00 +0100 | [diff] [blame] | 17 | public data: Node = null, |
Radek Krejci | d0fac3b | 2018-03-13 16:55:47 +0100 | [diff] [blame] | 18 | public treeFilters = [], |
Radek Krejci | 26bf2bc | 2018-01-09 15:00:54 +0100 | [diff] [blame] | 19 | public modifications = null, |
Radek Krejci | ae75839 | 2017-10-20 10:53:26 +0200 | [diff] [blame] | 20 | public cpblts: string = "", |
Radek Krejci | d0fac3b | 2018-03-13 16:55:47 +0100 | [diff] [blame] | 21 | public dataPresence: string = 'none', |
Radek Krejci | a133960 | 2017-11-02 13:52:38 +0100 | [diff] [blame] | 22 | public statusVisibility: boolean = true, |
| 23 | public cpbltsVisibility: boolean = false, |
Radek Krejci | 95bd14c | 2017-09-21 14:24:13 +0200 | [diff] [blame] | 24 | ) {} |
| 25 | } |
Radek Krejci | 482629d | 2018-03-13 14:56:00 +0100 | [diff] [blame] | 26 | |
| 27 | export class NodeSchema { |
| 28 | /* |
| 29 | * type: NodeType; |
| 30 | * path: string; |
| 31 | */ |
| 32 | } |
| 33 | |
| 34 | export class Node { |
| 35 | /* |
| 36 | * path: string; |
| 37 | * info: NodeSchema; |
| 38 | * |
| 39 | * === container === |
| 40 | * children: Node[] |
| 41 | * newChildren: Node[] |
| 42 | * |
| 43 | * === leaf === |
| 44 | * value: string; |
| 45 | * |
| 46 | * === leaf-list === |
| 47 | * value: string; |
| 48 | * |
| 49 | * === list === |
| 50 | * children: Node[] |
| 51 | * newChildren: Node[] |
| 52 | */ |
| 53 | } |