blob: ce7faeef69ed41f5b2016a4e7abcebee58225307 [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 Krejci7a244f02018-02-21 09:46:18 +010029 <div class="node" [class.dirty]="node['dirty']" [class.deleted]="modsService.isDeleted(node)"
Radek Krejci2e84bf02018-02-15 15:01:21 +010030 [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 -->
Radek Krejci7a244f02018-02-21 09:46:18 +010041 <ng-container *ngIf="node['info']['type'] == 4 || (node['new'] && node['info']['type'] == 8)">
Radek Krejci6e772b22018-01-25 13:28:57 +010042 <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>
Radek Krejci7a244f02018-02-21 09:46:18 +010086 <ng-container *ngIf="node['info']['type'] == 8">
87 <div class="value">{{node['info']['datatype']}}
88 <span *ngIf="node['info']['datatype'] != node['info']['datatypebase']">({{node['info']['datatypebase']}})</span>
89 </div>
90 </ng-container>
Radek Krejci6e772b22018-01-25 13:28:57 +010091 <!-- END nodetype-specific code -->
Radek Krejci27134982017-11-10 15:42:00 +010092
Radek Krejci6e772b22018-01-25 13:28:57 +010093 <div class="module_name">{{node['info']['module']}}</div>
94 </div>
Radek Krejci27134982017-11-10 15:42:00 +010095
Radek Krejci6e772b22018-01-25 13:28:57 +010096 <!-- BEGIN nodetype-specific code -->
Radek Krejci7a244f02018-02-21 09:46:18 +010097 <!-- leaf/leaf-list's edit value -->
98 <ng-container *ngIf="node['info']['type'] == 4 || node['info']['type'] == 8">
Radek Krejci6e772b22018-01-25 13:28:57 +010099 <div class="node_edit" [class.dirty]="node['dirty']" *ngIf="node['edit']">
Radek Krejci9b41f5b2018-01-31 14:17:50 +0100100 <tree-indent [node]="node" [indentation]="inheritIndentation(node)" [type]="'edit'"></tree-indent>
Radek Krejci6e772b22018-01-25 13:28:57 +0100101 <img *ngIf="node['edit'] " class="icon_action" src="assets/netopeer/icons/close.svg"
102 alt="cancel" title="cancel editing" tabindex=0
Radek Krejci7a244f02018-02-21 09:46:18 +0100103 (click)="changeValueCancel(node)" (keyup.enter)="changeValueCancel(node)"
Radek Krejci6e772b22018-01-25 13:28:57 +0100104 onmouseover="this.src='assets/netopeer/icons/close_active.svg'"
105 onmouseout="this.src='assets/netopeer/icons/close.svg'" />
106 <img *ngIf="node['edit']" class="icon_action icon_hidden" src="assets/netopeer/icons/confirm.svg"
107 id="{{node['path']}}_value_confirm" alt="done" title="store changes" tabindex=0
108 (click)="changeValue(node, $event.target)" (keyup.enter)="changeValue(node, $event.target)"
109 onmouseover="this.src='assets/netopeer/icons/confirm_active.svg'"
110 onmouseout="this.src='assets/netopeer/icons/confirm.svg'"/>
Radek Krejcid0ce4cf2018-02-09 14:44:34 +0100111 <select *ngIf="node['info']['values']"
112 id="{{node['path']}}_input" type="text" class="value"
113 (change)="checkValue(node, $event.target, true)"
114 checkLeafValue [node]="node" [trusted]="true" (onCheckValue)="checkValue($event.node, $event.element, $event.trusted)">
115 <ng-container *ngFor="let value of node['info']['values']; let i='index'">
116 <option value="{{value}}">{{value}}</option>
117 </ng-container>
118 </select>
119 <input *ngIf="!node['info']['values']"
Radek Krejci7a244f02018-02-21 09:46:18 +0100120 id="{{node['path']}}_input" type="text" class="value" value="{{nodeValue(node)}}" tabindex=0
Radek Krejcid0ce4cf2018-02-09 14:44:34 +0100121 (keyup)="checkValue(node, $event.target)" (change)="checkValue(node, $event.target)"
122 (keyup.enter)="changeValue(node, $event.target)" (keyup.escape)="changeValueCancel(node)"
123 checkLeafValue [node]="node" (onCheckValue)="checkValue($event.node, $event.element)"/>
Radek Krejci6e772b22018-01-25 13:28:57 +0100124 </div>
125 </ng-container>
Radek Krejci27134982017-11-10 15:42:00 +0100126
Radek Krejci7a244f02018-02-21 09:46:18 +0100127 <!-- leaflist's values -->
128 <ng-container *ngIf="node['info']['type'] == 8 && !node['edit'] && !modsService.isDeleted(node)">
129 <div *ngFor="let value of node['value']"
130 class="node yang-leaflist" [class.dirty]="node['dirty']" [class.deleted]="modsService.isDeleted(node, value)">
131 <tree-indent [node]="node" [indentation]="inheritIndentation(node)" [type]="'value'" [value]="value"></tree-indent>
132 <div class="value_standalone">{{value}}</div>
133 </div>
134 </ng-container>
135 <!-- END nodetype-specific code -->
Radek Krejci6e772b22018-01-25 13:28:57 +0100136
137 <!-- recursion - show children -->
Radek Krejci49904942018-01-29 13:32:11 +0100138 <div class="loading" *ngIf="node['loading']">
139 <netopeer-loading></netopeer-loading>
140 </div>
Radek Krejci6e772b22018-01-25 13:28:57 +0100141 <div class="children" *ngIf="(node['children'] || node['newChildren']) && !node['deleted']">
142 <ng-container *ngFor="let child of node['children']">
Radek Krejci9b41f5b2018-01-31 14:17:50 +0100143 <tree-view [node]="child" [indentation]="inheritIndentation(node)"></tree-view>
Radek Krejci6e772b22018-01-25 13:28:57 +0100144 </ng-container>
145 <ng-container *ngFor="let child of newChildrenToShow(node)">
Radek Krejci9b41f5b2018-01-31 14:17:50 +0100146 <tree-view [node]="child" [indentation]="inheritIndentation(node)"></tree-view>
Radek Krejci6e772b22018-01-25 13:28:57 +0100147 </ng-container>
Radek Krejcia1339602017-11-02 13:52:38 +0100148 </div>
Radek Krejci6e772b22018-01-25 13:28:57 +0100149
150 <!-- create new child dialog -->
Radek Krejci9b41f5b2018-01-31 14:17:50 +0100151 <tree-create [node]="node" [indentation]="inheritIndentation(node)"></tree-create>
Radek Krejcia1339602017-11-02 13:52:38 +0100152</div>