blob: fa9a9f294b8f3bb2eb3f72b1a874264f0d6be772 [file] [log] [blame]
Radek Krejcif71867f2018-01-30 13:28:28 +01001<div *ngIf="node['path'] == '/'">
2 <!-- recursion - show children -->
3 <div class="node">
Radek Krejci9b41f5b2018-01-31 14:17:50 +01004 <tree-indent [node]="node" [indentation]="indentation" [type]="'root'"></tree-indent>
Radek Krejci5a69fa32018-02-01 11:03:04 +01005 <img *ngIf="activeSession.dataVisibility!='all'" class="icon_action" (click)="treeService.rpcGet(activeSession, true)"
6 src="assets/netopeer/icons/show_all.svg" alt="w" title="expand all"
7 onmouseover="this.src='assets/netopeer/icons/show_all_active.svg'"
8 onmouseout="this.src='assets/netopeer/icons/show_all.svg'"/>
9 <img *ngIf="activeSession.dataVisibility!='root'" class="icon_action" (click)="treeService.collapse(activeSession)"
10 src="assets/netopeer/icons/collapse.svg" alt="x" title="collapse"
11 onmouseover="this.src='assets/netopeer/icons/collapse_active.svg'"
12 onmouseout="this.src='assets/netopeer/icons/collapse.svg'"/>
Radek Krejcif71867f2018-01-30 13:28:28 +010013 </div>
14 <div class="children" *ngIf="node['children'] || node['newChildren']">
15 <ng-container *ngFor="let child of node['children']">
Radek Krejci9b41f5b2018-01-31 14:17:50 +010016 <tree-view [node]="child"></tree-view>
Radek Krejcif71867f2018-01-30 13:28:28 +010017 </ng-container>
18 <ng-container *ngFor="let child of newChildrenToShow(node)">
Radek Krejci9b41f5b2018-01-31 14:17:50 +010019 <tree-view [node]="child"></tree-view>
Radek Krejcif71867f2018-01-30 13:28:28 +010020 </ng-container>
21 </div>
22
23 <!-- create new child dialog -->
Radek Krejci9b41f5b2018-01-31 14:17:50 +010024 <tree-create [node]="node" [indentation]="indentation"></tree-create>
Radek Krejcif71867f2018-01-30 13:28:28 +010025</div>
26<div class="subtree" *ngIf="node['path'] != '/' && (node['info']['config'] || activeSession.statusVisibility)"
27 [class.status]="!node['info']['config']">
Radek Krejci6e772b22018-01-25 13:28:57 +010028
29 <div class="node" [class.dirty]="node['dirty']" [class.deleted]="node['deleted']">
Radek Krejci9b41f5b2018-01-31 14:17:50 +010030 <tree-indent [node]="node" [indentation]="indentation"></tree-indent>
Radek Krejci6e772b22018-01-25 13:28:57 +010031 <img class="icon" src="assets/netopeer/icons/info.svg" alt="info" title="{{node['info']['dsc']}}"
32 onmouseover="this.src='assets/netopeer/icons/info_active.svg'"
33 onmouseout="this.src='assets/netopeer/icons/info.svg'"/>
34
35 <!-- BEGIN nodetype-specific code -->
36 <!-- leaf -->
37 <ng-container *ngIf="node['info']['type'] == 4">
38 <ng-container *ngIf="node['info']['key']">
39 <img class="icon" src="assets/netopeer/icons/key.svg" alt="key" title="list key"/>
40 </ng-container>
Radek Krejci9b41f5b2018-01-31 14:17:50 +010041 <ng-container *ngIf="node['info']['config'] && !node['deleted'] && (!node['info']['key'] || node['new']) && node['info']['datatypebase'] != 'empty'">
Radek Krejci6e772b22018-01-25 13:28:57 +010042 <img *ngIf="!node['edit']" class="icon_action" src="assets/netopeer/icons/edit.svg"
43 alt="edit" title="edit value" tabindex=0
44 (click)="startEditing(node, $event.target);" (keyup.enter)="startEditing(node, $event.target);"
45 onmouseover="this.src='assets/netopeer/icons/edit_active.svg'"
46 onmouseout="this.src='assets/netopeer/icons/edit.svg'"/>
47 <img *ngIf="node['edit']" class="icon" src="assets/netopeer/icons/edit.svg" alt="edit" title="editing value"/>
48 </ng-container>
49 </ng-container>
50
51 <!-- container and lists -->
Radek Krejci5a69fa32018-02-01 11:03:04 +010052 <ng-container *ngIf="!node['new'] && !node['deleted'] && ((node['info']['type'] == 16 || node['info']['type'] == 1)) && treeService.expandable(node)">
53 <img *ngIf="treeService.hasHiddenChild(node)" (click)="treeService.expand(activeSession, node, true)"
Radek Krejci6e772b22018-01-25 13:28:57 +010054 class="icon_action" src="assets/netopeer/icons/show_all.svg"
55 onmouseover="this.src='assets/netopeer/icons/show_all_active.svg'"
56 onmouseout="this.src='assets/netopeer/icons/show_all.svg'" alt="show-all" title="expand subtree"/>
Radek Krejci5a69fa32018-02-01 11:03:04 +010057 <img *ngIf="!node['children']" (click)="treeService.expand(activeSession, node, false)"
Radek Krejci6e772b22018-01-25 13:28:57 +010058 class="icon_action" src="assets/netopeer/icons/show_children.svg"
59 onmouseover="this.src='assets/netopeer/icons/show_children_active.svg'"
60 onmouseout="this.src='assets/netopeer/icons/show_children.svg'" alt="show-children" title="expand children"/>
Radek Krejci5a69fa32018-02-01 11:03:04 +010061 <img *ngIf="node['children']" (click)="treeService.collapse(activeSession, node)"
Radek Krejci6e772b22018-01-25 13:28:57 +010062 class="icon_action" src="assets/netopeer/icons/collapse.svg" alt="collapse" title="collapse"
63 onmouseover="this.src='assets/netopeer/icons/collapse_active.svg'"
64 onmouseout="this.src='assets/netopeer/icons/collapse.svg'"/>
65 </ng-container>
66
67 <div><span class="node_name">{{node['info']['name']}}</span>
68 <!-- list's keys -->
69 <span *ngIf="node['info']['type'] == 16" class="node_info">* [{{node['keys']}}]</span>
70
71 <!-- leaf and leaflists -->
72 <span *ngIf="node['info']['type'] == 8 || node['info']['type'] == 4">:</span>
73 </div>
Radek Krejci27134982017-11-10 15:42:00 +010074
75 <!-- leaf -->
Radek Krejci6e772b22018-01-25 13:28:57 +010076 <ng-container *ngIf="node['info']['type'] == 4">
77 <div class="value" *ngIf="!node['edit']" (click)="startEditing(node, $event.target);">{{node['value']}}</div>
78 <div class="value" *ngIf="node['edit']">{{node['info']['datatype']}}
79 <span *ngIf="node['info']['datatype'] != node['info']['datatypebase']">({{node['info']['datatypebase']}})</span>
80 </div>
81 </ng-container>
82 <!-- END nodetype-specific code -->
Radek Krejci27134982017-11-10 15:42:00 +010083
Radek Krejci6e772b22018-01-25 13:28:57 +010084 <div class="module_name">{{node['info']['module']}}</div>
85 </div>
Radek Krejci27134982017-11-10 15:42:00 +010086
Radek Krejci6e772b22018-01-25 13:28:57 +010087 <!-- BEGIN nodetype-specific code -->
88 <!-- leaf's edit value -->
89 <ng-container *ngIf="node['info']['type'] == 4">
90 <div class="node_edit" [class.dirty]="node['dirty']" *ngIf="node['edit']">
Radek Krejci9b41f5b2018-01-31 14:17:50 +010091 <tree-indent [node]="node" [indentation]="inheritIndentation(node)" [type]="'edit'"></tree-indent>
Radek Krejci6e772b22018-01-25 13:28:57 +010092 <img *ngIf="node['edit'] " class="icon_action" src="assets/netopeer/icons/close.svg"
93 alt="cancel" title="cancel editing" tabindex=0
94 (click)="node['edit']=false" (keyup.enter)="node['edit']=false"
95 onmouseover="this.src='assets/netopeer/icons/close_active.svg'"
96 onmouseout="this.src='assets/netopeer/icons/close.svg'" />
97 <img *ngIf="node['edit']" class="icon_action icon_hidden" src="assets/netopeer/icons/confirm.svg"
98 id="{{node['path']}}_value_confirm" alt="done" title="store changes" tabindex=0
99 (click)="changeValue(node, $event.target)" (keyup.enter)="changeValue(node, $event.target)"
100 onmouseover="this.src='assets/netopeer/icons/confirm_active.svg'"
101 onmouseout="this.src='assets/netopeer/icons/confirm.svg'"/>
Radek Krejcid0ce4cf2018-02-09 14:44:34 +0100102 <select *ngIf="node['info']['values']"
103 id="{{node['path']}}_input" type="text" class="value"
104 (change)="checkValue(node, $event.target, true)"
105 checkLeafValue [node]="node" [trusted]="true" (onCheckValue)="checkValue($event.node, $event.element, $event.trusted)">
106 <ng-container *ngFor="let value of node['info']['values']; let i='index'">
107 <option value="{{value}}">{{value}}</option>
108 </ng-container>
109 </select>
110 <input *ngIf="!node['info']['values']"
111 id="{{node['path']}}_input" type="text" class="value" value="{{node['value']}}" tabindex=0
112 (keyup)="checkValue(node, $event.target)" (change)="checkValue(node, $event.target)"
113 (keyup.enter)="changeValue(node, $event.target)" (keyup.escape)="changeValueCancel(node)"
114 checkLeafValue [node]="node" (onCheckValue)="checkValue($event.node, $event.element)"/>
Radek Krejci6e772b22018-01-25 13:28:57 +0100115 </div>
116 </ng-container>
Radek Krejci27134982017-11-10 15:42:00 +0100117
Radek Krejci6e772b22018-01-25 13:28:57 +0100118 <!-- leaflist's values -->
119 <ng-container *ngIf="node['info']['type'] == 8">
120 <div class="node" *ngFor="let value of node['value']">
121 <tree-indent [node]="node" [indentation]="inheritIndentation(node)" [type]="'value'" ></tree-indent>
122 <div class="value_standalone">{{value}}</div>
123 </div>
124 </ng-container>
125 <!-- END nodetype-specific code -->
126
127 <!-- recursion - show children -->
Radek Krejci49904942018-01-29 13:32:11 +0100128 <div class="loading" *ngIf="node['loading']">
129 <netopeer-loading></netopeer-loading>
130 </div>
Radek Krejci6e772b22018-01-25 13:28:57 +0100131 <div class="children" *ngIf="(node['children'] || node['newChildren']) && !node['deleted']">
132 <ng-container *ngFor="let child of node['children']">
Radek Krejci9b41f5b2018-01-31 14:17:50 +0100133 <tree-view [node]="child" [indentation]="inheritIndentation(node)"></tree-view>
Radek Krejci6e772b22018-01-25 13:28:57 +0100134 </ng-container>
135 <ng-container *ngFor="let child of newChildrenToShow(node)">
Radek Krejci9b41f5b2018-01-31 14:17:50 +0100136 <tree-view [node]="child" [indentation]="inheritIndentation(node)"></tree-view>
Radek Krejci6e772b22018-01-25 13:28:57 +0100137 </ng-container>
Radek Krejcia1339602017-11-02 13:52:38 +0100138 </div>
Radek Krejci6e772b22018-01-25 13:28:57 +0100139
140 <!-- create new child dialog -->
Radek Krejci9b41f5b2018-01-31 14:17:50 +0100141 <tree-create [node]="node" [indentation]="inheritIndentation(node)"></tree-create>
Radek Krejcia1339602017-11-02 13:52:38 +0100142</div>