5f3cfbf52ecba737c8d9194e77497b04f9119560
[ccsdk/apps.git] / sdnr / wireless-transport / code-Carbon-SR1 / ux / mwtnCommons / mwtnCommons-module / src / main / resources / mwtnCommons / templates / mwtnJsonViewer.tpl.html
1 <div class="owl">
2   <div class="row text-right" >
3     <div class="form-group" ng-if="noButtons !== true">
4       <button class="btn btn-default" type="button" clipboard supported="myClipboard.supported" text="myClipboard.getJson()"
5         on-copied="myClipboard.copyToClipboard()" on-error="myClipboard.error(err)">
6         <i class="fa fa-clipboard" aria-hidden="true"></i>
7       </button>
8       <button class="btn btn-default" type="button" ng-if="replace"  ng-click="openConfigView()">
9         <i class="fa fa-pencil-square-o pointer" aria-hidden="true" ></i>
10       </button>
11     <div>
12   </div>
13 </div>
14 <div class="owl">
15
16   <div ng-if="info !== false">
17       <span class="owl-dark">{{info}}</span>
18   </div>
19
20   <div class="row" ng-repeat="(key, value) in viewData track by $index" ng-show="value.value !== undefined">
21
22     <!-- type- default -->
23     <div class="col col-md-4 text-right" title="{{value.description}}" ng-if="value.type !== 'array' && value.visible === true">
24       <span class="owl-dark">{{value.labelId | translate}}</span>
25     </div>
26     <div class="col col-md-4 text-left" ng-if="value.type !== 'boolean' && value.type !== 'number' && value.type !== 'object' && value.type !== 'array' && value.visible === true">
27       <b>{{value.value}}</b>
28     </div>
29
30     <!-- type-boolean -->
31     
32     <div class="col col-md-2" ng-if="value.type === 'boolean' && value.visible === true">
33       <i class="fa" ng-class="{'fa-square-o': value.value === false, 'fa-check-square-o green': value.value === true}" aria-hidden="true"></i>
34     </div>
35
36     <!-- type- number -->
37     <div class="col col-md-2 number" ng-if="value.type === 'number' && value.visible === true">
38       <b>{{value.value}}</b>
39     </div>
40     <div class="col col-md-2 text-left" ng-if="value.unit && value.visible === true">
41       <span class="owl-dark">{{value.unit}}</span>
42     </div>
43
44     <!-- type- array of objects -->
45     <div class="col col-md-12" ng-if="value.type === 'array' && value.value.length !== 0 && getType(value.value[0]) === 'object'">
46       <span class="owl-dark text-right" style="margin-top: 5px;">{{value.labelId | translate}}</span><br/>
47       <mwtn-grid network-element="networkElement" data="value.value" path="path"></mwtn-grid>
48     </div>
49     <!-- type- array of non objects -->
50     <div class="col col-md-4 text-right" title="{{value.description}}" ng-if="value.type === 'array' && value.value.length !== 0 && getType(value.value[0]) !== 'object'">
51       <span class="owl-dark">{{value.labelId | translate}}</span>
52     </div>
53     <div class="col col-md-8 text-left" ng-if="value.type === 'array' && value.value.length !== 0 && getType(value.value[0]) !== 'object'">
54       <b>{{value.value}}</b>
55     </div>
56
57     <!-- type- object -->
58     <div class="col col-md-7" ng-if="value.type === 'object'">
59
60 <!--      <pre>{{value | json}}</pre>
61       ###
62       <hr>
63 <mwtn-json-viewer data="value.value"></mwtn-json-viewer>
64       <hr>
65       ### -->
66
67       <div class="owl">
68
69         <!-- TODO exception case: current pm -->
70         <div class="row" ng-repeat="(oKey, oValue) in value.value track by $index" ng-if="oValue.value === undefined">
71           <div class="col col-md-3 text-right">
72             <span class="owl-dark">{{oKey | translate}}</span>
73           </div>
74           <div class="col col-md-4  text-right" ng-if="oValue.type !== 'object'">
75             <b>{{oValue | json}}</b>
76           </div>
77         </div>
78
79         <!-- expected case: -->
80        <div class="row" ng-repeat="(oKey, oValue) in value.value track by $index" ng-if="oValue.value !== undefined">
81           <!-- oValue.type !== 'object'' && oValue.type !== 'array' -->
82           <div class="col col-md-3 text-right" ng-if="oValue.type !== 'object' && oValue.type !== 'array'">
83             <span class="owl-dark">{{oValue.labelId || oKey.replace('onf-ptp-dataset:' ,'') | translate}}</span>
84           </div>
85           <div class="col col-md-4  text-right" ng-if="oValue.type !== 'object' && oValue.type !== 'array'">
86             <b>{{oValue.value || oValue}}</b>
87           </div>
88
89
90           <!-- oValue.type === 'array'' -->
91           <div class="col col-md-3 text-right" ng-if="oValue.type === 'array'">
92             <span class="owl-dark">{{oValue.labelId || oKey.replace('onf-ptp-dataset:' ,'') | translate}}</span>
93           </div>
94           <div class="col col-md-4" ng-if="oValue.type === 'array'">
95             <json-formatter json="oValue.value" open="1"></json-formatter>
96           </div>
97
98           <!-- oValue.type === 'object' -->
99           <div class="col col-md-3 text-right" ng-if="oValue.type === 'object'">
100             <span class="owl-dark">{{oValue.labelId || oKey.replace('onf-ptp-dataset:' ,'') | translate}}</span>
101           </div>
102           <div class="col col-md-4" ng-if="oValue.type === 'object'">
103             <json-formatter json="oValue.value" open="1"></json-formatter>
104           </div>
105         </div>
106       </div> 
107     </div>
108   </div>
109
110 </div>