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"> |
| 4 | <tree-indent [node]="node" [indentation]="indentation" [type]="'root'" |
| 5 | (onOpenCreatingDialog)="openCreatingDialog($event.element, $event.node, $event.parent)"> |
| 6 | </tree-indent> |
| 7 | </div> |
| 8 | <div class="children" *ngIf="node['children'] || node['newChildren']"> |
| 9 | <ng-container *ngFor="let child of node['children']"> |
| 10 | <tree-view [node]="child" [root]="root"></tree-view> |
| 11 | </ng-container> |
| 12 | <ng-container *ngFor="let child of newChildrenToShow(node)"> |
| 13 | <tree-view [node]="child" [root]="root"></tree-view> |
| 14 | </ng-container> |
| 15 | </div> |
| 16 | |
| 17 | <!-- create new child dialog --> |
| 18 | <div id="{{node['path']}}_createChildDialog" class="node_edit" *ngIf="node['creatingChild']" [class.dialog]="node['schemaChildren']" |
| 19 | treeScrollTo [node]="node"> |
| 20 | <ng-container *ngIf="node['schemaChildren'].length; else nothingToCreate"> |
| 21 | <tree-indent [node]="node" [indentation]="indentation" [type]="'edit'" |
| 22 | (onCloseCreatingDialog)="closeCreatingDialog($event)"></tree-indent> |
| 23 | <select #nodeSelect (change)="creatingDialogSelect(node, $event.target.value, $event.currentTarget)"> |
| 24 | <option disabled selected value="-1" style="display:none"> </option> |
| 25 | <ng-container *ngFor="let schema of node['schemaChildren']; let i='index'"> |
| 26 | <option value="{{i}}">{{schemaInfoName(node, schema)}}</option> |
| 27 | </ng-container> |
| 28 | </select> |
| 29 | <!-- <pre>{{node['schemaChildren'] | json}}</pre> --> |
| 30 | </ng-container> |
| 31 | <ng-template #nothingToCreate> |
| 32 | <div class="msg-failure msg-rounded"> |
| 33 | <span class="msg-close" (click)="closeCreatingDialog(node);">x</span>There is no element to create at {{node['path']}}. |
| 34 | </div> |
| 35 | </ng-template> |
| 36 | </div> |
| 37 | </div> |
| 38 | <div class="subtree" *ngIf="node['path'] != '/' && (node['info']['config'] || activeSession.statusVisibility)" |
| 39 | [class.status]="!node['info']['config']"> |
Radek Krejci | 6e772b2 | 2018-01-25 13:28:57 +0100 | [diff] [blame] | 40 | |
| 41 | <div class="node" [class.dirty]="node['dirty']" [class.deleted]="node['deleted']"> |
| 42 | <tree-indent [node]="node" [indentation]="indentation" |
Radek Krejci | 6e772b2 | 2018-01-25 13:28:57 +0100 | [diff] [blame] | 43 | (onDeleteSubtree)="deleteSubtree($event)" (onOpenCreatingDialog)="openCreatingDialog($event.element, $event.node, $event.parent)"> |
| 44 | </tree-indent> |
| 45 | <img class="icon" src="assets/netopeer/icons/info.svg" alt="info" title="{{node['info']['dsc']}}" |
| 46 | onmouseover="this.src='assets/netopeer/icons/info_active.svg'" |
| 47 | onmouseout="this.src='assets/netopeer/icons/info.svg'"/> |
| 48 | |
| 49 | <!-- BEGIN nodetype-specific code --> |
| 50 | <!-- leaf --> |
| 51 | <ng-container *ngIf="node['info']['type'] == 4"> |
| 52 | <ng-container *ngIf="node['info']['key']"> |
| 53 | <img class="icon" src="assets/netopeer/icons/key.svg" alt="key" title="list key"/> |
| 54 | </ng-container> |
| 55 | <ng-container *ngIf="node['info']['config'] && !node['info']['key'] && node['info']['datatypebase'] != 'empty'"> |
| 56 | <img *ngIf="!node['edit']" class="icon_action" src="assets/netopeer/icons/edit.svg" |
| 57 | alt="edit" title="edit value" tabindex=0 |
| 58 | (click)="startEditing(node, $event.target);" (keyup.enter)="startEditing(node, $event.target);" |
| 59 | onmouseover="this.src='assets/netopeer/icons/edit_active.svg'" |
| 60 | onmouseout="this.src='assets/netopeer/icons/edit.svg'"/> |
| 61 | <img *ngIf="node['edit']" class="icon" src="assets/netopeer/icons/edit.svg" alt="edit" title="editing value"/> |
| 62 | </ng-container> |
| 63 | </ng-container> |
| 64 | |
| 65 | <!-- container and lists --> |
| 66 | <ng-container *ngIf="node['path'] != 'locallyNew' && ((node['info']['type'] == 16 || node['info']['type'] == 1)) && expandable(node)"> |
| 67 | <img *ngIf="hasHiddenChild(node)" (click)="expand(node, true)" |
| 68 | class="icon_action" src="assets/netopeer/icons/show_all.svg" |
| 69 | onmouseover="this.src='assets/netopeer/icons/show_all_active.svg'" |
| 70 | onmouseout="this.src='assets/netopeer/icons/show_all.svg'" alt="show-all" title="expand subtree"/> |
| 71 | <img *ngIf="!node['children']" (click)="expand(node, false)" |
| 72 | class="icon_action" src="assets/netopeer/icons/show_children.svg" |
| 73 | onmouseover="this.src='assets/netopeer/icons/show_children_active.svg'" |
| 74 | onmouseout="this.src='assets/netopeer/icons/show_children.svg'" alt="show-children" title="expand children"/> |
| 75 | <img *ngIf="node['children']" (click)="collapse(node)" |
| 76 | class="icon_action" src="assets/netopeer/icons/collapse.svg" alt="collapse" title="collapse" |
| 77 | onmouseover="this.src='assets/netopeer/icons/collapse_active.svg'" |
| 78 | onmouseout="this.src='assets/netopeer/icons/collapse.svg'"/> |
| 79 | </ng-container> |
| 80 | |
| 81 | <div><span class="node_name">{{node['info']['name']}}</span> |
| 82 | <!-- list's keys --> |
| 83 | <span *ngIf="node['info']['type'] == 16" class="node_info">* [{{node['keys']}}]</span> |
| 84 | |
| 85 | <!-- leaf and leaflists --> |
| 86 | <span *ngIf="node['info']['type'] == 8 || node['info']['type'] == 4">:</span> |
| 87 | </div> |
Radek Krejci | 2713498 | 2017-11-10 15:42:00 +0100 | [diff] [blame] | 88 | |
| 89 | <!-- leaf --> |
Radek Krejci | 6e772b2 | 2018-01-25 13:28:57 +0100 | [diff] [blame] | 90 | <ng-container *ngIf="node['info']['type'] == 4"> |
| 91 | <div class="value" *ngIf="!node['edit']" (click)="startEditing(node, $event.target);">{{node['value']}}</div> |
| 92 | <div class="value" *ngIf="node['edit']">{{node['info']['datatype']}} |
| 93 | <span *ngIf="node['info']['datatype'] != node['info']['datatypebase']">({{node['info']['datatypebase']}})</span> |
| 94 | </div> |
| 95 | </ng-container> |
| 96 | <!-- END nodetype-specific code --> |
Radek Krejci | 2713498 | 2017-11-10 15:42:00 +0100 | [diff] [blame] | 97 | |
Radek Krejci | 6e772b2 | 2018-01-25 13:28:57 +0100 | [diff] [blame] | 98 | <div class="module_name">{{node['info']['module']}}</div> |
| 99 | </div> |
Radek Krejci | 2713498 | 2017-11-10 15:42:00 +0100 | [diff] [blame] | 100 | |
Radek Krejci | 6e772b2 | 2018-01-25 13:28:57 +0100 | [diff] [blame] | 101 | <!-- BEGIN nodetype-specific code --> |
| 102 | <!-- leaf's edit value --> |
| 103 | <ng-container *ngIf="node['info']['type'] == 4"> |
| 104 | <div class="node_edit" [class.dirty]="node['dirty']" *ngIf="node['edit']"> |
| 105 | <tree-indent [node]="node" [indentation]="inheritIndentation(node)" [type]="'edit'" |
| 106 | (onCloseCreatingDialog)="closeCreatingDialog($event)" |
| 107 | (onDeleteSubtree)="deleteSubtree($event)"></tree-indent> |
| 108 | <img *ngIf="node['edit'] " class="icon_action" src="assets/netopeer/icons/close.svg" |
| 109 | alt="cancel" title="cancel editing" tabindex=0 |
| 110 | (click)="node['edit']=false" (keyup.enter)="node['edit']=false" |
| 111 | onmouseover="this.src='assets/netopeer/icons/close_active.svg'" |
| 112 | onmouseout="this.src='assets/netopeer/icons/close.svg'" /> |
| 113 | <img *ngIf="node['edit']" class="icon_action icon_hidden" src="assets/netopeer/icons/confirm.svg" |
| 114 | id="{{node['path']}}_value_confirm" alt="done" title="store changes" tabindex=0 |
| 115 | (click)="changeValue(node, $event.target)" (keyup.enter)="changeValue(node, $event.target)" |
| 116 | onmouseover="this.src='assets/netopeer/icons/confirm_active.svg'" |
| 117 | onmouseout="this.src='assets/netopeer/icons/confirm.svg'"/> |
| 118 | <input id="{{node['path']}}_input" type="text" class="value" value="{{node['value']}}" tabindex=0 |
| 119 | (keyup)="checkValue(node, $event.target)" (change)="checkValue(node, $event.target)" |
| 120 | (keyup.enter)="changeValue(node, $event.target)" (keyup.escape)="changeValueCancel(node)" |
| 121 | checkLeafValue [node]="node" (onCheckValue)="checkValue($event.node, $event.element)"/> |
| 122 | </div> |
| 123 | </ng-container> |
Radek Krejci | 2713498 | 2017-11-10 15:42:00 +0100 | [diff] [blame] | 124 | |
Radek Krejci | 6e772b2 | 2018-01-25 13:28:57 +0100 | [diff] [blame] | 125 | <!-- leaflist's values --> |
| 126 | <ng-container *ngIf="node['info']['type'] == 8"> |
| 127 | <div class="node" *ngFor="let value of node['value']"> |
| 128 | <tree-indent [node]="node" [indentation]="inheritIndentation(node)" [type]="'value'" ></tree-indent> |
| 129 | <div class="value_standalone">{{value}}</div> |
| 130 | </div> |
| 131 | </ng-container> |
| 132 | <!-- END nodetype-specific code --> |
| 133 | |
| 134 | <!-- recursion - show children --> |
Radek Krejci | 4990494 | 2018-01-29 13:32:11 +0100 | [diff] [blame] | 135 | <div class="loading" *ngIf="node['loading']"> |
| 136 | <netopeer-loading></netopeer-loading> |
| 137 | </div> |
Radek Krejci | 6e772b2 | 2018-01-25 13:28:57 +0100 | [diff] [blame] | 138 | <div class="children" *ngIf="(node['children'] || node['newChildren']) && !node['deleted']"> |
| 139 | <ng-container *ngFor="let child of node['children']"> |
Radek Krejci | f71867f | 2018-01-30 13:28:28 +0100 | [diff] [blame^] | 140 | <tree-view [node]="child" [root]="root" [indentation]="inheritIndentation(node)"></tree-view> |
Radek Krejci | 6e772b2 | 2018-01-25 13:28:57 +0100 | [diff] [blame] | 141 | </ng-container> |
| 142 | <ng-container *ngFor="let child of newChildrenToShow(node)"> |
Radek Krejci | f71867f | 2018-01-30 13:28:28 +0100 | [diff] [blame^] | 143 | <tree-view [node]="child" [root]="root" [indentation]="inheritIndentation(node)"></tree-view> |
Radek Krejci | 6e772b2 | 2018-01-25 13:28:57 +0100 | [diff] [blame] | 144 | </ng-container> |
Radek Krejci | a133960 | 2017-11-02 13:52:38 +0100 | [diff] [blame] | 145 | </div> |
Radek Krejci | 6e772b2 | 2018-01-25 13:28:57 +0100 | [diff] [blame] | 146 | |
| 147 | <!-- create new child dialog --> |
| 148 | <div id="{{node['path']}}_createChildDialog" class="node_edit" *ngIf="node['creatingChild']" [class.dialog]="node['schemaChildren']" |
| 149 | treeScrollTo [node]="node"> |
| 150 | <ng-container *ngIf="node['schemaChildren'].length; else nothingToCreate"> |
| 151 | <tree-indent [node]="node" [indentation]="inheritIndentation(node)" [type]="'edit'" |
| 152 | (onCloseCreatingDialog)="closeCreatingDialog($event)"></tree-indent> |
| 153 | <select #nodeSelect (change)="creatingDialogSelect(node, $event.target.value, $event.currentTarget)"> |
| 154 | <option disabled selected value="-1" style="display:none"> </option> |
| 155 | <ng-container *ngFor="let schema of node['schemaChildren']; let i='index'"> |
| 156 | <option value="{{i}}">{{schemaInfoName(node, schema)}}</option> |
| 157 | </ng-container> |
| 158 | </select> |
| 159 | <!-- <pre>{{node['schemaChildren'] | json}}</pre> --> |
| 160 | </ng-container> |
| 161 | <ng-template #nothingToCreate> |
| 162 | <div class="msg-failure msg-rounded"> |
| 163 | <span class="msg-close" (click)="closeCreatingDialog(node);">x</span>There is no element to create at {{node['path']}}. |
| 164 | </div> |
| 165 | </ng-template> |
| 166 | </div> |
| 167 | |
Radek Krejci | a133960 | 2017-11-02 13:52:38 +0100 | [diff] [blame] | 168 | </div> |