summaryrefslogtreecommitdiff
path: root/docker/swagger.html
blob: 239e4f13669fdc6970a72e2e27367055eb119838 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
<!-- HTML for static distribution bundle build -->
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8">
    <title>Swagger UI</title>
    <link href="https://fonts.googleapis.com/css?family=Open+Sans:400,700|Source+Code+Pro:300,600|Titillium+Web:400,600,700" rel="stylesheet">
    <link rel="stylesheet" type="text/css" href="./swagger-ui.css" >
    <link rel="icon" type="image/png" href="./favicon-32x32.png" sizes="32x32" />
    <link rel="icon" type="image/png" href="./favicon-16x16.png" sizes="16x16" />
    <style>
      html
      {
        box-sizing: border-box;
        overflow: -moz-scrollbars-vertical;
        overflow-y: scroll;
      }

      *,
      *:before,
      *:after
      {
        box-sizing: inherit;
      }

      body
      {
        margin:0;
        background: #fafafa;
      }
    </style>
  </head>

  <body>
    <div id="swagger-ui"></div>

    <script src="./swagger-ui-bundle.js"> </script>
    <script src="./swagger-ui-standalone-preset.js"> </script>
    <script>
    window.onload = function() {

      // Build a system
      var base_url = window.location.origin;
      var swagger_url = base_url + "/api/api.json";
      const ui = SwaggerUIBundle({
        url: swagger_url,
        dom_id: '#swagger-ui',
        deepLinking: true,
        presets: [
          SwaggerUIBundle.presets.apis,
          SwaggerUIStandalonePreset
        ],
        plugins: [
          SwaggerUIBundle.plugins.DownloadUrl
        ],
        layout: "StandaloneLayout"
      })

      window.ui = ui;
      document.getElementsByClassName('topbar')[0].style.backgroundColor = "#fafafa";
      document.getElementsByClassName('topbar-wrapper')[0].getElementsByTagName('img')[0].alt = "IST";
      document.getElementsByClassName('topbar-wrapper')[0].getElementsByTagName('img')[0].src = "./IST_logo_s.png";
      document.getElementsByClassName('topbar-wrapper')[0].getElementsByTagName('img')[0].width = "90";
      document.getElementsByClassName('topbar-wrapper')[0].getElementsByTagName('img')[0].height = "35";
      document.getElementsByClassName('topbar-wrapper')[0].getElementsByTagName('img')[0].style.marginRight = "20px";
      document.getElementsByClassName('topbar-wrapper')[0].getElementsByTagName('span')[0].innerHTML = "lazar-rest-api";
    };

    // add link for docs
    setTimeout(function() {
      var base_url = window.location.origin;
      var section = document.getElementsByClassName("info")[0];
      var node = document.createElement("docs");
      var heading = document.createElement('h2');
      var headingtext = document.createTextNode("Documentation");
      var link = document.createElement('a');
      var linktext = document.createTextNode("See curl examples for a typical workflow.");
      heading.appendChild(headingtext);
      link.appendChild(linktext);
      link.title = "curl examples";
      link.href = "https://github.com/OpenRiskNet/home/blob/master/openshift/deployments/lazar#curl-examples";
      link.target = "javascript:void(0);";
      node.appendChild(heading);
      node.appendChild(link);
      section.appendChild(node);
    }, 1000);
    // add link for gui
    setTimeout(function() {
      var base_url = window.location.origin;
      var section = document.getElementsByClassName("info")[0];
      var node = document.createElement("gui");
      var heading = document.createElement('h2');
      var headingtext = document.createTextNode("Lazar Graphical User Interface");
      var link = document.createElement('a');
      var linktext = document.createTextNode("Lazar (GUI)");
      heading.appendChild(headingtext);
      link.appendChild(linktext);
      link.title = "GUI link";
      link.href = base_url = "/predict";
      link.target = "javascript:void(0);";
      node.appendChild(heading);
      node.appendChild(link);
      section.appendChild(node);
    }, 1000);
  </script>
  </body>
</html>