Add Change-event-notification-subscription-tutorial
[netconf.git] / restconf / sal-rest-docgen / src / main / resources / explorer / index.html
1 <!-- HTML for static distribution bundle build -->
2 <!DOCTYPE html>
3 <html lang="en">
4 <head>
5   <meta charset="UTF-8">
6   <title>RestConf Documentation</title>
7   <link rel="stylesheet" type="text/css" href="./css/swagger-ui.css" >
8   <link rel="icon" type="image/png" href="./images/favicon-32x32.png" sizes="32x32" />
9   <link rel="icon" type="image/png" href="./images/favicon-16x16.png" sizes="16x16" />
10   <style>
11       html
12       {
13         box-sizing: border-box;
14         overflow: -moz-scrollbars-vertical;
15         overflow-y: scroll;
16       }
17
18       *,
19       *:before,
20       *:after
21       {
22         box-sizing: inherit;
23       }
24
25       body
26       {
27         margin:0;
28         background: #fafafa;
29       }
30
31       topbar-wrapper img {
32         content:url('images/logo_small.png');
33       }
34     </style>
35 </head>
36
37 <body>
38 <div id="swagger-ui"></div>
39
40 <script src="./js/jquery-3.6.1.min.js"></script>
41 <script src="./js/swagger-ui-bundle.js"> </script>
42 <script>
43     window.onload = function() {
44       var xmlHttp = new XMLHttpRequest();
45       xmlHttp.open("GET", document.URL.split('/apidoc')[0] + "/apidoc/openapi3/apis/mounts", false);
46       xmlHttp.send( null );
47
48       var base_url_rfc = document.URL.split('/apidoc')[0] + '/apidoc/openapi3/apis/mounts/';
49       var swagger_urls = [{url: document.URL.split('/apidoc')[0] + "/apidoc/openapi3/apis/single", name: "Controller resources - RestConf RFC 8040"}];
50       var devices = JSON.parse(xmlHttp.responseText);
51       for (var i =0; i < devices.length; i++) {
52         var device_name = devices[i]['instance'].split('=')[2].replace('/', '');
53         var dveice_id = devices[i]['id'];
54         var dict = {
55           url: base_url_rfc + dveice_id,
56           name: device_name + " resources - RestConf RFC 8040",
57         };
58         swagger_urls.push(dict);
59       }
60
61       // Begin Swagger UI call region
62       const ui = SwaggerUIBundle({
63         urls: swagger_urls,
64         dom_id: '#swagger-ui',
65         docExpansion: 'none',
66         deepLinking: true,
67         showAlternativeSchemaExample: true,
68         onComplete: function(swaggerApi, swaggerUi){
69               var wrappers = document.getElementsByClassName('wrapper');
70               for(var i = 0; i < wrappers.length; i++) {
71             if (wrappers[i].innerText === "Schemas") {
72               wrappers[i].remove();
73               break;
74             }
75           }
76           var topbar = document.getElementsByClassName('topbar-wrapper');
77           var node2 = document.createElement("H2");
78           var node = document.createElement("IMG");
79           node.height = 40;
80           node.src = 'images/logo_small.png';
81           node2.innerText = "OpenDaylight RestConf API Documentation";
82           node2.prepend(node);
83           topbar[0].children[0].remove();
84           topbar[0].prepend(node2);
85           node.style = "padding-right: 18px;";
86           topbar[0].children[0].style="color:white; display: contents;";
87
88           var modules = document.getElementsByClassName('opblock-tag-section')
89           for(var i = 0; i < modules.length; i++) {
90             var innerText = modules[i].getElementsByTagName('a')[0].innerText;
91             var arrayInnerText = innerText.split(' ')
92             if (arrayInnerText.length > 0) {
93               modules[i].getElementsByTagName('a')[0].innerText = arrayInnerText[arrayInnerText.length - 1];
94             }
95           }
96           document.getElementsByClassName("select-label")[0].style = "max-width: max-content; padding-left: 20px";
97           document.getElementById("select").style = "flex: 0"
98         },
99         presets: [
100           SwaggerUIBundle.presets.apis,
101           SwaggerUIStandalonePreset
102         ],
103         plugins: [
104           SwaggerUIBundle.plugins.DownloadUrl
105         ],
106         layout: "StandaloneLayout"
107       })
108       // End Swagger UI call region
109
110       window.ui = ui
111
112     }
113
114   </script>
115 <script src="./js/swagger-ui-standalone-preset.js"> </script>
116 </body>
117 </html>
118
119
120
121