blob: b8d0feacfd2f366ed32e27978a374a4eae6b9809 [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
Radek Krejci2e84bf02018-02-15 15:01:21 +010029 <div class="node" [class.dirty]="node['dirty']" [class.deleted]="node['deleted']"
30 [class.yang-container]="node['info']['type'] == 1"
31 [class.yang-leaf]="node['info']['type'] == 4"
32 [class.yang-leaflist]="node['info']['type'] == 8"
33 [class.yang-list]="node['info']['type'] == 16">
Radek Krejci9b41f5b2018-01-31 14:17:50 +010034 <tree-indent [node]="node" [indentation]="indentation"></tree-indent>
Radek Krejci6e772b22018-01-25 13:28:57 +010035 <img class="icon" src="assets/netopeer/icons/info.svg" alt="info" title="{{node['info']['dsc']}}"
36 onmouseover="this.src='assets/netopeer/icons/info_active.svg'"
37 onmouseout="this.src='assets/netopeer/icons/info.svg'"/>
38
39 <!-- BEGIN nodetype-specific code -->
40 <!-- leaf -->
41 <ng-container *ngIf="node['info']['type'] == 4">
42 <ng-container *ngIf="node['info']['key']">
43 <img class="icon" src="assets/netopeer/icons/key.svg" alt="key" title="list key"/>
44 </ng-container>
Radek Krejci9b41f5b2018-01-31 14:17:50 +010045 <ng-container *ngIf="node['info']['config'] && !node['deleted'] && (!node['info']['key'] || node['new']) && node['info']['datatypebase'] != 'empty'">
Radek Krejci6e772b22018-01-25 13:28:57 +010046 <img *ngIf="!node['edit']" class="icon_action" src="assets/netopeer/icons/edit.svg"
47 alt="edit" title="edit value" tabindex=0
48 (click)="startEditing(node, $event.target);" (keyup.enter)="startEditing(node, $event.target);"
49 onmouseover="this.src='assets/netopeer/icons/edit_active.svg'"
50 onmouseout="this.src='assets/netopeer/icons/edit.svg'"/>
51 <img *ngIf="node['edit']" class="icon" src="assets/netopeer/icons/edit.svg" alt="edit" title="editing value"/>
52 </ng-container>
53 </ng-container>
54
55 <!-- container and lists -->
Radek Krejci5a69fa32018-02-01 11:03:04 +010056 <ng-container *ngIf="!node['new'] && !node['deleted'] && ((node['info']['type'] == 16 || node['info']['type'] == 1)) && treeService.expandable(node)">
57 <img *ngIf="treeService.hasHiddenChild(node)" (click)="treeService.expand(activeSession, node, true)"
Radek Krejci6e772b22018-01-25 13:28:57 +010058 class="icon_action" src="assets/netopeer/icons/show_all.svg"
59 onmouseover="this.src='assets/netopeer/icons/show_all_active.svg'"
60 onmouseout="this.src='assets/netopeer/icons/show_all.svg'" alt="show-all" title="expand subtree"/>
Radek Krejci5a69fa32018-02-01 11:03:04 +010061 <img *ngIf="!node['children']" (click)="treeService.expand(activeSession, node, false)"
Radek Krejci6e772b22018-01-25 13:28:57 +010062 class="icon_action" src="assets/netopeer/icons/show_children.svg"
63 onmouseover="this.src='assets/netopeer/icons/show_children_active.svg'"
64 onmouseout="this.src='assets/netopeer/icons/show_children.svg'" alt="show-children" title="expand children"/>
Radek Krejci5a69fa32018-02-01 11:03:04 +010065 <img *ngIf="node['children']" (click)="treeService.collapse(activeSession, node)"
Radek Krejci6e772b22018-01-25 13:28:57 +010066 class="icon_action" src="assets/netopeer/icons/collapse.svg" alt="collapse" title="collapse"
67 onmouseover="this.src='assets/netopeer/icons/collapse_active.svg'"
68 onmouseout="this.src='assets/netopeer/icons/collapse.svg'"/>
69 </ng-container>
70
71 <div><span class="node_name">{{node['info']['name']}}</span>
72 <!-- list's keys -->
73 <span *ngIf="node['info']['type'] == 16" class="node_info">* [{{node['keys']}}]</span>
74
75 <!-- leaf and leaflists -->
76 <span *ngIf="node['info']['type'] == 8 || node['info']['type'] == 4">:</span>
77 </div>
Radek Krejci27134982017-11-10 15:42:00 +010078
79 <!-- leaf -->
Radek Krejci6e772b22018-01-25 13:28:57 +010080 <ng-container *ngIf="node['info']['type'] == 4">
81 <div class="value" *ngIf="!node['edit']" (click)="startEditing(node, $event.target);">{{node['value']}}</div>
82 <div class="value" *ngIf="node['edit']">{{node['info']['datatype']}}
83 <span *ngIf="node['info']['datatype'] != node['info']['datatypebase']">({{node['info']['datatypebase']}})</span>
84 </div>
85 </ng-container>
86 <!-- END nodetype-specific code -->
Radek Krejci27134982017-11-10 15:42:00 +010087
Radek Krejci6e772b22018-01-25 13:28:57 +010088 <div class="module_name">{{node['info']['module']}}</div>
89 </div>
Radek Krejci27134982017-11-10 15:42:00 +010090
Radek Krejci6e772b22018-01-25 13:28:57 +010091 <!-- BEGIN nodetype-specific code -->
92 <!-- leaf's edit value -->
93 <ng-container *ngIf="node['info']['type'] == 4">
94 <div class="node_edit" [class.dirty]="node['dirty']" *ngIf="node['edit']">
Radek Krejci9b41f5b2018-01-31 14:17:50 +010095 <tree-indent [node]="node" [indentation]="inheritIndentation(node)" [type]="'edit'"></tree-indent>
Radek Krejci6e772b22018-01-25 13:28:57 +010096 <img *ngIf="node['edit'] " class="icon_action" src="assets/netopeer/icons/close.svg"
97 alt="cancel" title="cancel editing" tabindex=0
98 (click)="node['edit']=false" (keyup.enter)="node['edit']=false"
99 onmouseover="this.src='assets/netopeer/icons/close_active.svg'"
100 onmouseout="this.src='assets/netopeer/icons/close.svg'" />
101 <img *ngIf="node['edit']" class="icon_action icon_hidden" src="assets/netopeer/icons/confirm.svg"
102 id="{{node['path']}}_value_confirm" alt="done" title="store changes" tabindex=0
103 (click)="changeValue(node, $event.target)" (keyup.enter)="changeValue(node, $event.target)"
104 onmouseover="this.src='assets/netopeer/icons/confirm_active.svg'"
105 onmouseout="this.src='assets/netopeer/icons/confirm.svg'"/>
Radek Krejcid0ce4cf2018-02-09 14:44:34 +0100106 <select *ngIf="node['info']['values']"
107 id="{{node['path']}}_input" type="text" class="value"
108 (change)="checkValue(node, $event.target, true)"
109 checkLeafValue [node]="node" [trusted]="true" (onCheckValue)="checkValue($event.node, $event.element, $event.trusted)">
110 <ng-container *ngFor="let value of node['info']['values']; let i='index'">
111 <option value="{{value}}">{{value}}</option>
112 </ng-container>
113 </select>
114 <input *ngIf="!node['info']['values']"
115 id="{{node['path']}}_input" type="text" class="value" value="{{node['value']}}" tabindex=0
116 (keyup)="checkValue(node, $event.target)" (change)="checkValue(node, $event.target)"
117 (keyup.enter)="changeValue(node, $event.target)" (keyup.escape)="changeValueCancel(node)"
118 checkLeafValue [node]="node" (onCheckValue)="checkValue($event.node, $event.element)"/>
Radek Krejci6e772b22018-01-25 13:28:57 +0100119 </div>
120 </ng-container>
Radek Krejci27134982017-11-10 15:42:00 +0100121
Radek Krejci6e772b22018-01-25 13:28:57 +0100122 <!-- leaflist's values -->
123 <ng-container *ngIf="node['info']['type'] == 8">
Radek Krejci2e84bf02018-02-15 15:01:21 +0100124 <div class="node yang-leaflist" *ngFor="let value of node['value']">
Radek Krejci6e772b22018-01-25 13:28:57 +0100125 <tree-indent [node]="node" [indentation]="inheritIndentation(node)" [type]="'value'" ></tree-indent>
126 <div class="value_standalone">{{value}}</div>
127 </div>
128 </ng-container>
129 <!-- END nodetype-specific code -->
130
131 <!-- recursion - show children -->
Radek Krejci49904942018-01-29 13:32:11 +0100132 <div class="loading" *ngIf="node['loading']">
133 <netopeer-loading></netopeer-loading>
134 </div>
Radek Krejci6e772b22018-01-25 13:28:57 +0100135 <div class="children" *ngIf="(node['children'] || node['newChildren']) && !node['deleted']">
136 <ng-container *ngFor="let child of node['children']">
Radek Krejci9b41f5b2018-01-31 14:17:50 +0100137 <tree-view [node]="child" [indentation]="inheritIndentation(node)"></tree-view>
Radek Krejci6e772b22018-01-25 13:28:57 +0100138 </ng-container>
139 <ng-container *ngFor="let child of newChildrenToShow(node)">
Radek Krejci9b41f5b2018-01-31 14:17:50 +0100140 <tree-view [node]="child" [indentation]="inheritIndentation(node)"></tree-view>
Radek Krejci6e772b22018-01-25 13:28:57 +0100141 </ng-container>
Radek Krejcia1339602017-11-02 13:52:38 +0100142 </div>
Radek Krejci6e772b22018-01-25 13:28:57 +0100143
144 <!-- create new child dialog -->
Radek Krejci9b41f5b2018-01-31 14:17:50 +0100145 <tree-create [node]="node" [indentation]="inheritIndentation(node)"></tree-create>
Radek Krejcia1339602017-11-02 13:52:38 +0100146</div>