Adding Capif invoker
[nonrtric/plt/sme.git] / invoker / view / onboardinvoker.html
1 <!--
2    ========================LICENSE_START=================================
3    O-RAN-SC
4    %%
5    Copyright (C) 2023: Nordix Foundation
6    %%
7    Licensed under the Apache License, Version 2.0 (the "License");
8    you may not use this file except in compliance with the License.
9    You may obtain a copy of the License at
10
11         http://www.apache.org/licenses/LICENSE-2.0
12
13    Unless required by applicable law or agreed to in writing, software
14    distributed under the License is distributed on an "AS IS" BASIS,
15    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16    See the License for the specific language governing permissions and
17    limitations under the License.
18    ========================LICENSE_END===================================
19 -->
20 {{define "title"}}
21   CAPIF Invoker | {{index . "name"}}
22 {{end}}
23
24 {{define "body"}}
25 {{if .isResponse}}
26   <div class="p-5 mb-4 bg-light rounded-3">
27     <div class="container-fluid py-5">
28       <h4 class="card-subtitle mb-3 text-body-secondary">Response from CAPIF core</h4>
29       <div class="callout callout-info"> 
30         <h5 class="card-subtitle mb-3 text-body-secondary">APIInvokerEnrolmentDetails</h5>
31         <div id="response"> 
32           <h6>
33             Api InvokerId:
34             <small id="apiInvokerId" class="text-muted"></small>
35           </h6>
36           <h6>
37             Api Invoker Information:
38             <small id="apiInvokerInformation" class="text-muted"></small>
39           </h6>
40           <h6>
41             Notification Destination:
42             <small id="notificationDestination" class="text-muted"></small>
43           </h6>
44           <h6>Onboarding Information:</h6>
45           <ul>
46             <li><h6>
47                 Api Invoker Certificate:
48                 <small id="apiInvokerCertificate" class="text-muted"></small>
49               </h6></li>
50             <li><h6>
51                 Api Invoker PublicKey:
52                 <small id="apiInvokerPublicKey" class="text-muted"></small>
53               </h6></li>
54             <li><h6>
55                 Onboarding Secret:
56                 <small id="onboardingSecret" class="text-muted"></small>
57               </h6></li>
58         </ul>
59         <h6>API List:</h6>
60           <div id="responseTable">
61
62           </div>
63         </div>
64       </div>  
65
66       <div class="btns col-md-12 text-center">
67         <form action="/" method="GET">
68           <input class="btn btn-secondary" formaction="/" type="submit" value="Return to main page">
69         </form>
70       </div>
71     </div>
72   </div>
73   <script>
74
75     var htmlResponse = "{{.response}}"
76     const strData = JSON.parse(htmlResponse);
77
78     document.getElementById("apiInvokerId").innerHTML = strData.apiInvokerId;
79     document.getElementById("apiInvokerInformation").innerHTML = strData.apiInvokerInformation;
80     document.getElementById("notificationDestination").innerHTML = strData.notificationDestination;
81
82     document.getElementById("apiInvokerCertificate").innerHTML = strData.onboardingInformation['apiInvokerCertificate'];
83     document.getElementById("apiInvokerPublicKey").innerHTML = strData.onboardingInformation['apiInvokerPublicKey'];
84     document.getElementById("onboardingSecret").innerHTML = strData.onboardingInformation['onboardingSecret'];
85
86     var pretty = JSON.stringify(strData.apiList, undefined, 4);
87     document.getElementById("responseTable").innerHTML = pretty;
88
89   </script>
90 {{- else}}
91   <div class="p-5 mb-4 bg-light rounded-3">
92     <div class="container-fluid py-5">
93       {{if .isError}}
94         <div class="alert alert-danger" role="alert">
95           {{.response}}
96         </div>
97       {{end}}
98       <h5 class="card-subtitle mb-3 text-body-secondary">CAPIF_API_Invoker_Management_API > Onboard_API_Invoker</h5>
99       <form action="/onboardinvoker" method="POST">
100         <div class="mb-3">
101           <label for="enrolmentDetails" class="form-label">APIInvokerEnrolmentDetails:</label>
102           <textarea id="enrolmentDetails"  class="form-control" name="enrolmentDetails" rows="10" cols="60" required></textarea>
103         </div>
104         
105         <div class="btns col-md-12 text-center">
106             <input class="btn btn-primary" type="submit" value="Submit">
107             <input class="btn btn-secondary" formaction="/" type="submit" value="Cancel" formnovalidate>
108         </div>
109       </form>
110     </div>
111   </div>
112 {{- end}}
113 {{end}}
114
115