forked from tapis-project/live-docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
120 lines (107 loc) · 3.49 KB
/
index.html
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
108
109
110
111
112
113
114
115
116
117
118
119
120
<!DOCTYPE html>
<html>
<head>
<title>ReDoc Demo: Multiple apis</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<script
src="https://code.jquery.com/jquery-3.4.1.slim.min.js"
integrity="sha256-pasqAKBDmFT4eHoN2ndd6lN370kFiGUFyTiUHWhU7k8="
crossorigin="anonymous"></script>
<!-- <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/foundation.min.js" crossorigin="anonymous"></script>-->
<link href="https://fonts.googleapis.com/css?family=Roboto&display=swap" rel="stylesheet">
<!-- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/foundation.min.css" crossorigin="anonymous">-->
<style>
body {
margin: 0;
padding-top: 40px;
font-family: 'Roboto', sans-serif;
}
nav {
padding-left: 10px;
position: fixed;
top: 0;
width: 100%;
z-index: 100;
display: flex;
flex-grow: 1;
align-items: center;
background-color: #0b485b;
}
#links_container {
margin: 0;
padding: 0;
}
#links_container li {
display: inline-block;
padding: 10px;
color: white;
cursor: pointer;
/*border-right: 1px solid #fff;*/
}
#links_container li:hover {
color: #d3d3d3;
}
</style>
</head>
<body>
<!-- Top navigation placeholder -->
<nav>
<div>
<a href="https://tapis.io" target="_blank">
<img src="tapis-logo.png" height="75px">
</a>
</div>
<div>
<ul id="links_container">
</ul>
</div>
</nav>
<redoc scroll-y-offset="body > nav"></redoc>
<script src="https://cdn.jsdelivr.net/npm/redoc@next/bundles/redoc.standalone.js"> </script>
<script>
// $(document).foundation();
// list of APIS
var apis = [
{
name: 'Tenants',
url: 'https://raw.githubusercontent.com/tapis-project/tenants-api/master/service/resources/openapi_v3.yml'
},
{
name: 'Tokens',
url: 'https://raw.githubusercontent.com/tapis-project/tokens-api/master/service/resources/openapi_v3.yml'
},
{
name: 'Authenticator',
url: 'https://raw.githubusercontent.com/joestubbs/authenticator/master/service/resources/openapi_v3.yml'
},
{
name: 'Files',
url: 'https://raw.githubusercontent.com/tapis-project/files-openapi/master/api.yaml'
},
{
name: 'SK-Authz',
url: 'https://raw.githubusercontent.com/tapis-project/tapis-java/master/tapis-securityapi/src/main/resources/SKAuthorizationAPI.yaml'
},
{
name: 'Meta',
url: 'https://raw.githubusercontent.com/tapis-project/tapis-meta/master/openapi/metav3-openapi.yml'
}
];
// initially render first API
Redoc.init(apis[0].url);
function onClick() {
var url = this.getAttribute('data-link');
Redoc.init(url);
}
// dynamically building navigation items
var $list = document.getElementById('links_container');
apis.forEach(function(api) {
var $listitem = document.createElement('li');
$listitem.setAttribute('data-link', api.url);
$listitem.innerText = api.name;
$listitem.addEventListener('click', onClick);
$list.appendChild($listitem);
});
</script>
</body>
</html>