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