gui CHANGE refactor work with schemas
- store all schemas as files in backend to unify work and keep all
dependencies in a single searchpath
- work with schemas as with dictionary - move key from the structure
itself to the dictionary key. However it is still possible to generate
the key from the schema itself
diff --git a/frontend/yang/yang.component.html b/frontend/yang/yang.component.html
index 1416bb3..ed016e8 100644
--- a/frontend/yang/yang.component.html
+++ b/frontend/yang/yang.component.html
@@ -1,19 +1,17 @@
<nav #subnav id="subnav">
- <a *ngFor="let schema of schemasService.schemas" [class.active]="schema.key==activeSchema.key"
- (click)="changeActiveSchema(schema.key)">{{schema.name}}@{{schema.revision}}
+ <a *ngFor="let key of schemasService.schemasKeys()" [class.active]="key == schemasService.activeSchema"
+ (click)="schemasService.changeActiveSchemaKey(key)">{{schemasService.schemas[key].name}}@{{schemasService.schemas[key].revision}}
<img class="tab-icon tab-close tab-action-last" src="assets/netopeer/icons/close.svg" alt="x" title="close"
onmouseover="this.src='assets/netopeer/icons/close_active.svg'"
- onmouseout="this.src='assets/netopeer/icons/close.svg'" (click)="close(schema.key)"/>
+ onmouseout="this.src='assets/netopeer/icons/close.svg'" (click)="close(key)"/>
</a><a (click)="addSchema()" onmouseout="getElementById('tabadd').style.filter='invert(100%)'" onmouseover="getElementById('tabadd').style.filter='invert(0%)'">
<img id="tabadd" class="tab-icon tab-add tab-action-last" src="assets/netopeer/icons/add.svg" alt="+" title="open schema"
onmouseover="this.src='assets/netopeer/icons/add_active.svg'"
onmouseout="this.src='assets/netopeer/icons/add.svg'"/>
</a>
</nav>
-
<div class="netopeer-content" [style.padding-top]="'calc(' + subnav.offsetHeight + 'px - -0.7em)'">
-<img *ngIf="!activeSchema" src="assets/netopeer/starthere.svg" alt="Start here with that + sign."/>
+<img *ngIf="!schemasService.activeSchema" (click)="addSchema()" src="assets/netopeer/starthere.svg" alt="Start here with that + sign."/>
-<pre *ngIf="activeSchema">{{activeSchema.data}}</pre>
-
-</div>
\ No newline at end of file
+<pre *ngIf="schemasService.activeSchema">{{schemasService.schemas[schemasService.activeSchema].data}}</pre>
+</div>