blob: b41c61217c9a06e9f126644aa357287a806927ec [file] [log] [blame]
Radek Krejcia1339602017-11-02 13:52:38 +01001<div class="subtree" *ngIf="node['info']['config'] || activeSession.statusVisibility" [class.status]="!node['info']['config']">
Radek Krejci6e772b22018-01-25 13:28:57 +01002
3 <div class="node" [class.dirty]="node['dirty']" [class.deleted]="node['deleted']">
4 <tree-indent [node]="node" [indentation]="indentation"
Radek Krejci6e772b22018-01-25 13:28:57 +01005 (onDeleteSubtree)="deleteSubtree($event)" (onOpenCreatingDialog)="openCreatingDialog($event.element, $event.node, $event.parent)">
6 </tree-indent>
7 <img class="icon" src="assets/netopeer/icons/info.svg" alt="info" title="{{node['info']['dsc']}}"
8 onmouseover="this.src='assets/netopeer/icons/info_active.svg'"
9 onmouseout="this.src='assets/netopeer/icons/info.svg'"/>
10
11 <!-- BEGIN nodetype-specific code -->
12 <!-- leaf -->
13 <ng-container *ngIf="node['info']['type'] == 4">
14 <ng-container *ngIf="node['info']['key']">
15 <img class="icon" src="assets/netopeer/icons/key.svg" alt="key" title="list key"/>
16 </ng-container>
17 <ng-container *ngIf="node['info']['config'] && !node['info']['key'] && node['info']['datatypebase'] != 'empty'">
18 <img *ngIf="!node['edit']" class="icon_action" src="assets/netopeer/icons/edit.svg"
19 alt="edit" title="edit value" tabindex=0
20 (click)="startEditing(node, $event.target);" (keyup.enter)="startEditing(node, $event.target);"
21 onmouseover="this.src='assets/netopeer/icons/edit_active.svg'"
22 onmouseout="this.src='assets/netopeer/icons/edit.svg'"/>
23 <img *ngIf="node['edit']" class="icon" src="assets/netopeer/icons/edit.svg" alt="edit" title="editing value"/>
24 </ng-container>
25 </ng-container>
26
27 <!-- container and lists -->
28 <ng-container *ngIf="node['path'] != 'locallyNew' && ((node['info']['type'] == 16 || node['info']['type'] == 1)) && expandable(node)">
29 <img *ngIf="hasHiddenChild(node)" (click)="expand(node, true)"
30 class="icon_action" src="assets/netopeer/icons/show_all.svg"
31 onmouseover="this.src='assets/netopeer/icons/show_all_active.svg'"
32 onmouseout="this.src='assets/netopeer/icons/show_all.svg'" alt="show-all" title="expand subtree"/>
33 <img *ngIf="!node['children']" (click)="expand(node, false)"
34 class="icon_action" src="assets/netopeer/icons/show_children.svg"
35 onmouseover="this.src='assets/netopeer/icons/show_children_active.svg'"
36 onmouseout="this.src='assets/netopeer/icons/show_children.svg'" alt="show-children" title="expand children"/>
37 <img *ngIf="node['children']" (click)="collapse(node)"
38 class="icon_action" src="assets/netopeer/icons/collapse.svg" alt="collapse" title="collapse"
39 onmouseover="this.src='assets/netopeer/icons/collapse_active.svg'"
40 onmouseout="this.src='assets/netopeer/icons/collapse.svg'"/>
41 </ng-container>
42
43 <div><span class="node_name">{{node['info']['name']}}</span>
44 <!-- list's keys -->
45 <span *ngIf="node['info']['type'] == 16" class="node_info">* [{{node['keys']}}]</span>
46
47 <!-- leaf and leaflists -->
48 <span *ngIf="node['info']['type'] == 8 || node['info']['type'] == 4">:</span>
49 </div>
Radek Krejci27134982017-11-10 15:42:00 +010050
51 <!-- leaf -->
Radek Krejci6e772b22018-01-25 13:28:57 +010052 <ng-container *ngIf="node['info']['type'] == 4">
53 <div class="value" *ngIf="!node['edit']" (click)="startEditing(node, $event.target);">{{node['value']}}</div>
54 <div class="value" *ngIf="node['edit']">{{node['info']['datatype']}}
55 <span *ngIf="node['info']['datatype'] != node['info']['datatypebase']">({{node['info']['datatypebase']}})</span>
56 </div>
57 </ng-container>
58 <!-- END nodetype-specific code -->
Radek Krejci27134982017-11-10 15:42:00 +010059
Radek Krejci6e772b22018-01-25 13:28:57 +010060 <div class="module_name">{{node['info']['module']}}</div>
61 </div>
Radek Krejci27134982017-11-10 15:42:00 +010062
Radek Krejci6e772b22018-01-25 13:28:57 +010063 <!-- BEGIN nodetype-specific code -->
64 <!-- leaf's edit value -->
65 <ng-container *ngIf="node['info']['type'] == 4">
66 <div class="node_edit" [class.dirty]="node['dirty']" *ngIf="node['edit']">
67 <tree-indent [node]="node" [indentation]="inheritIndentation(node)" [type]="'edit'"
68 (onCloseCreatingDialog)="closeCreatingDialog($event)"
69 (onDeleteSubtree)="deleteSubtree($event)"></tree-indent>
70 <img *ngIf="node['edit'] " class="icon_action" src="assets/netopeer/icons/close.svg"
71 alt="cancel" title="cancel editing" tabindex=0
72 (click)="node['edit']=false" (keyup.enter)="node['edit']=false"
73 onmouseover="this.src='assets/netopeer/icons/close_active.svg'"
74 onmouseout="this.src='assets/netopeer/icons/close.svg'" />
75 <img *ngIf="node['edit']" class="icon_action icon_hidden" src="assets/netopeer/icons/confirm.svg"
76 id="{{node['path']}}_value_confirm" alt="done" title="store changes" tabindex=0
77 (click)="changeValue(node, $event.target)" (keyup.enter)="changeValue(node, $event.target)"
78 onmouseover="this.src='assets/netopeer/icons/confirm_active.svg'"
79 onmouseout="this.src='assets/netopeer/icons/confirm.svg'"/>
80 <input id="{{node['path']}}_input" type="text" class="value" value="{{node['value']}}" tabindex=0
81 (keyup)="checkValue(node, $event.target)" (change)="checkValue(node, $event.target)"
82 (keyup.enter)="changeValue(node, $event.target)" (keyup.escape)="changeValueCancel(node)"
83 checkLeafValue [node]="node" (onCheckValue)="checkValue($event.node, $event.element)"/>
84 </div>
85 </ng-container>
Radek Krejci27134982017-11-10 15:42:00 +010086
Radek Krejci6e772b22018-01-25 13:28:57 +010087 <!-- leaflist's values -->
88 <ng-container *ngIf="node['info']['type'] == 8">
89 <div class="node" *ngFor="let value of node['value']">
90 <tree-indent [node]="node" [indentation]="inheritIndentation(node)" [type]="'value'" ></tree-indent>
91 <div class="value_standalone">{{value}}</div>
92 </div>
93 </ng-container>
94 <!-- END nodetype-specific code -->
95
96 <!-- recursion - show children -->
Radek Krejci49904942018-01-29 13:32:11 +010097 <div class="loading" *ngIf="node['loading']">
98 <netopeer-loading></netopeer-loading>
99 </div>
Radek Krejci6e772b22018-01-25 13:28:57 +0100100 <div class="children" *ngIf="(node['children'] || node['newChildren']) && !node['deleted']">
101 <ng-container *ngFor="let child of node['children']">
102 <tree-view [node]="child" [indentation]="inheritIndentation(node)"></tree-view>
103 </ng-container>
104 <ng-container *ngFor="let child of newChildrenToShow(node)">
105 <tree-view [node]="child" [indentation]="inheritIndentation(node)"></tree-view>
106 </ng-container>
Radek Krejcia1339602017-11-02 13:52:38 +0100107 </div>
Radek Krejci6e772b22018-01-25 13:28:57 +0100108
109 <!-- create new child dialog -->
110 <div id="{{node['path']}}_createChildDialog" class="node_edit" *ngIf="node['creatingChild']" [class.dialog]="node['schemaChildren']"
111 treeScrollTo [node]="node">
112 <ng-container *ngIf="node['schemaChildren'].length; else nothingToCreate">
113 <tree-indent [node]="node" [indentation]="inheritIndentation(node)" [type]="'edit'"
114 (onCloseCreatingDialog)="closeCreatingDialog($event)"></tree-indent>
115 <select #nodeSelect (change)="creatingDialogSelect(node, $event.target.value, $event.currentTarget)">
116 <option disabled selected value="-1" style="display:none">&nbsp;</option>
117 <ng-container *ngFor="let schema of node['schemaChildren']; let i='index'">
118 <option value="{{i}}">{{schemaInfoName(node, schema)}}</option>
119 </ng-container>
120 </select>
121 <!-- <pre>{{node['schemaChildren'] | json}}</pre> -->
122 </ng-container>
123 <ng-template #nothingToCreate>
124 <div class="msg-failure msg-rounded">
125 <span class="msg-close" (click)="closeCreatingDialog(node);">x</span>There is no element to create at {{node['path']}}.
126 </div>
127 </ng-template>
128 </div>
129
Radek Krejcia1339602017-11-02 13:52:38 +0100130</div>