Radek Krejci | f71867f | 2018-01-30 13:28:28 +0100 | [diff] [blame] | 1 | <div *ngIf="node['path'] == '/'"> |
| 2 | <!-- recursion - show children --> |
| 3 | <div class="node"> |
Radek Krejci | 9b41f5b | 2018-01-31 14:17:50 +0100 | [diff] [blame] | 4 | <tree-indent [node]="node" [indentation]="indentation" [type]="'root'"></tree-indent> |
Radek Krejci | 5a69fa3 | 2018-02-01 11:03:04 +0100 | [diff] [blame] | 5 | <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 Krejci | f71867f | 2018-01-30 13:28:28 +0100 | [diff] [blame] | 13 | </div> |
| 14 | <div class="children" *ngIf="node['children'] || node['newChildren']"> |
| 15 | <ng-container *ngFor="let child of node['children']"> |
Radek Krejci | 9b41f5b | 2018-01-31 14:17:50 +0100 | [diff] [blame] | 16 | <tree-view [node]="child"></tree-view> |
Radek Krejci | f71867f | 2018-01-30 13:28:28 +0100 | [diff] [blame] | 17 | </ng-container> |
| 18 | <ng-container *ngFor="let child of newChildrenToShow(node)"> |
Radek Krejci | 9b41f5b | 2018-01-31 14:17:50 +0100 | [diff] [blame] | 19 | <tree-view [node]="child"></tree-view> |
Radek Krejci | f71867f | 2018-01-30 13:28:28 +0100 | [diff] [blame] | 20 | </ng-container> |
| 21 | </div> |
| 22 | |
| 23 | <!-- create new child dialog --> |
Radek Krejci | 9b41f5b | 2018-01-31 14:17:50 +0100 | [diff] [blame] | 24 | <tree-create [node]="node" [indentation]="indentation"></tree-create> |
Radek Krejci | f71867f | 2018-01-30 13:28:28 +0100 | [diff] [blame] | 25 | </div> |
| 26 | <div class="subtree" *ngIf="node['path'] != '/' && (node['info']['config'] || activeSession.statusVisibility)" |
| 27 | [class.status]="!node['info']['config']"> |
Radek Krejci | 6e772b2 | 2018-01-25 13:28:57 +0100 | [diff] [blame] | 28 | |
Radek Krejci | 7a244f0 | 2018-02-21 09:46:18 +0100 | [diff] [blame^] | 29 | <div class="node" [class.dirty]="node['dirty']" [class.deleted]="modsService.isDeleted(node)" |
Radek Krejci | 2e84bf0 | 2018-02-15 15:01:21 +0100 | [diff] [blame] | 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 Krejci | 9b41f5b | 2018-01-31 14:17:50 +0100 | [diff] [blame] | 34 | <tree-indent [node]="node" [indentation]="indentation"></tree-indent> |
Radek Krejci | 6e772b2 | 2018-01-25 13:28:57 +0100 | [diff] [blame] | 35 | <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 Krejci | 7a244f0 | 2018-02-21 09:46:18 +0100 | [diff] [blame^] | 41 | <ng-container *ngIf="node['info']['type'] == 4 || (node['new'] && node['info']['type'] == 8)"> |
Radek Krejci | 6e772b2 | 2018-01-25 13:28:57 +0100 | [diff] [blame] | 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 Krejci | 9b41f5b | 2018-01-31 14:17:50 +0100 | [diff] [blame] | 45 | <ng-container *ngIf="node['info']['config'] && !node['deleted'] && (!node['info']['key'] || node['new']) && node['info']['datatypebase'] != 'empty'"> |
Radek Krejci | 6e772b2 | 2018-01-25 13:28:57 +0100 | [diff] [blame] | 46 | <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 Krejci | 5a69fa3 | 2018-02-01 11:03:04 +0100 | [diff] [blame] | 56 | <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 Krejci | 6e772b2 | 2018-01-25 13:28:57 +0100 | [diff] [blame] | 58 | 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 Krejci | 5a69fa3 | 2018-02-01 11:03:04 +0100 | [diff] [blame] | 61 | <img *ngIf="!node['children']" (click)="treeService.expand(activeSession, node, false)" |
Radek Krejci | 6e772b2 | 2018-01-25 13:28:57 +0100 | [diff] [blame] | 62 | 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 Krejci | 5a69fa3 | 2018-02-01 11:03:04 +0100 | [diff] [blame] | 65 | <img *ngIf="node['children']" (click)="treeService.collapse(activeSession, node)" |
Radek Krejci | 6e772b2 | 2018-01-25 13:28:57 +0100 | [diff] [blame] | 66 | 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 Krejci | 2713498 | 2017-11-10 15:42:00 +0100 | [diff] [blame] | 78 | |
| 79 | <!-- leaf --> |
Radek Krejci | 6e772b2 | 2018-01-25 13:28:57 +0100 | [diff] [blame] | 80 | <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 Krejci | 7a244f0 | 2018-02-21 09:46:18 +0100 | [diff] [blame^] | 86 | <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 Krejci | 6e772b2 | 2018-01-25 13:28:57 +0100 | [diff] [blame] | 91 | <!-- END nodetype-specific code --> |
Radek Krejci | 2713498 | 2017-11-10 15:42:00 +0100 | [diff] [blame] | 92 | |
Radek Krejci | 6e772b2 | 2018-01-25 13:28:57 +0100 | [diff] [blame] | 93 | <div class="module_name">{{node['info']['module']}}</div> |
| 94 | </div> |
Radek Krejci | 2713498 | 2017-11-10 15:42:00 +0100 | [diff] [blame] | 95 | |
Radek Krejci | 6e772b2 | 2018-01-25 13:28:57 +0100 | [diff] [blame] | 96 | <!-- BEGIN nodetype-specific code --> |
Radek Krejci | 7a244f0 | 2018-02-21 09:46:18 +0100 | [diff] [blame^] | 97 | <!-- leaf/leaf-list's edit value --> |
| 98 | <ng-container *ngIf="node['info']['type'] == 4 || node['info']['type'] == 8"> |
Radek Krejci | 6e772b2 | 2018-01-25 13:28:57 +0100 | [diff] [blame] | 99 | <div class="node_edit" [class.dirty]="node['dirty']" *ngIf="node['edit']"> |
Radek Krejci | 9b41f5b | 2018-01-31 14:17:50 +0100 | [diff] [blame] | 100 | <tree-indent [node]="node" [indentation]="inheritIndentation(node)" [type]="'edit'"></tree-indent> |
Radek Krejci | 6e772b2 | 2018-01-25 13:28:57 +0100 | [diff] [blame] | 101 | <img *ngIf="node['edit'] " class="icon_action" src="assets/netopeer/icons/close.svg" |
| 102 | alt="cancel" title="cancel editing" tabindex=0 |
Radek Krejci | 7a244f0 | 2018-02-21 09:46:18 +0100 | [diff] [blame^] | 103 | (click)="changeValueCancel(node)" (keyup.enter)="changeValueCancel(node)" |
Radek Krejci | 6e772b2 | 2018-01-25 13:28:57 +0100 | [diff] [blame] | 104 | 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 Krejci | d0ce4cf | 2018-02-09 14:44:34 +0100 | [diff] [blame] | 111 | <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 Krejci | 7a244f0 | 2018-02-21 09:46:18 +0100 | [diff] [blame^] | 120 | id="{{node['path']}}_input" type="text" class="value" value="{{nodeValue(node)}}" tabindex=0 |
Radek Krejci | d0ce4cf | 2018-02-09 14:44:34 +0100 | [diff] [blame] | 121 | (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 Krejci | 6e772b2 | 2018-01-25 13:28:57 +0100 | [diff] [blame] | 124 | </div> |
| 125 | </ng-container> |
Radek Krejci | 2713498 | 2017-11-10 15:42:00 +0100 | [diff] [blame] | 126 | |
Radek Krejci | 7a244f0 | 2018-02-21 09:46:18 +0100 | [diff] [blame^] | 127 | <!-- 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 Krejci | 6e772b2 | 2018-01-25 13:28:57 +0100 | [diff] [blame] | 136 | |
| 137 | <!-- recursion - show children --> |
Radek Krejci | 4990494 | 2018-01-29 13:32:11 +0100 | [diff] [blame] | 138 | <div class="loading" *ngIf="node['loading']"> |
| 139 | <netopeer-loading></netopeer-loading> |
| 140 | </div> |
Radek Krejci | 6e772b2 | 2018-01-25 13:28:57 +0100 | [diff] [blame] | 141 | <div class="children" *ngIf="(node['children'] || node['newChildren']) && !node['deleted']"> |
| 142 | <ng-container *ngFor="let child of node['children']"> |
Radek Krejci | 9b41f5b | 2018-01-31 14:17:50 +0100 | [diff] [blame] | 143 | <tree-view [node]="child" [indentation]="inheritIndentation(node)"></tree-view> |
Radek Krejci | 6e772b2 | 2018-01-25 13:28:57 +0100 | [diff] [blame] | 144 | </ng-container> |
| 145 | <ng-container *ngFor="let child of newChildrenToShow(node)"> |
Radek Krejci | 9b41f5b | 2018-01-31 14:17:50 +0100 | [diff] [blame] | 146 | <tree-view [node]="child" [indentation]="inheritIndentation(node)"></tree-view> |
Radek Krejci | 6e772b2 | 2018-01-25 13:28:57 +0100 | [diff] [blame] | 147 | </ng-container> |
Radek Krejci | a133960 | 2017-11-02 13:52:38 +0100 | [diff] [blame] | 148 | </div> |
Radek Krejci | 6e772b2 | 2018-01-25 13:28:57 +0100 | [diff] [blame] | 149 | |
| 150 | <!-- create new child dialog --> |
Radek Krejci | 9b41f5b | 2018-01-31 14:17:50 +0100 | [diff] [blame] | 151 | <tree-create [node]="node" [indentation]="inheritIndentation(node)"></tree-create> |
Radek Krejci | a133960 | 2017-11-02 13:52:38 +0100 | [diff] [blame] | 152 | </div> |