NONRTRIC-946: Servicemanager - Add Read The Docs
[nonrtric/plt/sme.git] / invoker / view / securitymethod.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
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">ServiceAPIDescription</h5>
31         <div id="response"> 
32           <h6>
33             Description:
34             <small id="Description" class="text-muted"></small>
35           </h6>
36           <h6>
37             Notification Destination:
38             <small id="NotificationDestination" class="text-muted"></small>
39           </h6>
40           <h6>
41             Supported Features:
42             <small id="SupportedFeatures" class="text-muted"></small>
43           </h6>
44           
45           <h6>Security Information:</h6>
46           <div id="responseTable" class="table-responsive">
47             <table class="table table-striped">
48               <thead>
49                  <tr>
50                     <th scope="col">AefId</th>
51                     <th scope="col">ApiId</th>
52                     <th scope="col">PrefSecurityMethods</th>
53                     <th scope="col">SelSecurityMethod</th>
54                  </tr>
55               </thead>
56               <tbody id="data-output">
57                  <!-- Prodcuts from javascript file in here. -->
58               </tbody>
59            </table>
60           </div>
61         </div>
62       </div>  
63
64       <div class="btns col-md-12 text-center">
65         <form action="/" method="GET">
66             <input class="btn btn-secondary" formaction="/" type="submit" value="Return to main page">
67           </form>
68       </div>
69     </div>
70   </div>
71   <script>
72     var htmlResponse = "{{.response}}"
73     const strData = JSON.parse(htmlResponse);
74     document.getElementById("Description").innerHTML = strData.description;
75     document.getElementById("NotificationDestination").innerHTML = strData.notificationDestination;
76     document.getElementById("SupportedFeatures").innerHTML = strData.supportedFeatures;
77
78     let secInfo = Object.values(checkValue(strData.securityInfo));
79     document.querySelector("#data-output").innerHTML = printSecInfo(secInfo);
80   </script>
81   {{- else}}
82   <div class="p-5 mb-4 bg-light rounded-3">
83     <div class="container-fluid py-5">
84         {{if .isError}}
85             <div class="alert alert-danger" role="alert">
86                 {{.response}}
87             </div>
88         {{end}}
89       <h5 class="card-subtitle mb-3 text-body-secondary">CAPIF_Security_API > Obtain_Security_Method</h5>
90       <form action="/securitymethod" method="POST">
91         <div class="mb-3">
92           <label for="apfId" class="form-label">Api invoker identifier:</label>
93           <input type="text" class="form-control" id="invokerId" name="invokerId" placeholder="invokerId" required>
94         </div>   
95         <div class="mb-3">
96             <label for="servSecurity" class="form-label">Service Security:</label>
97             <textarea id="servSecurity"  class="form-control" name="servSecurity" rows="10" cols="60"></textarea>
98           </div>     
99         <div class="btns col-md-12 text-center">
100             <input class="btn btn-primary" type="submit" value="Submit">
101             <input class="btn btn-secondary" formaction="/" type="submit" value="Cancel" formnovalidate>
102         </div>
103       </form>
104     </div>
105   </div>
106   {{- end}}
107 {{end}}
108
109