blob: 0c3a43b6cf62268fb1e90f610d9991ef0394e26b (
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
|
<template>
<div class="sidebar">
<div class="sidebar-list">
<div class="list-group list-group-scroll">
<a class="list-group-item" v-link="{ path: '/about/api', exact: true }">About API</a>
<partial name="loading-box" v-if="loading"></partial>
<template v-for="(name, namespace) in apidocs" v-if="!loading">
<span class="list-group-head">{{name | capitalize}}</span>
<a class="list-group-item" v-for="endpoint in namespace" v-link="endpoint_link(endpoint)">{{endpoint_string(endpoint)}}</a>
</template>
</div>
</div>
</div>
</template>
<script>
import aclog from "aclog";
export default {
data() {
return {
apidocs: {},
loading: false,
};
},
methods: {
endpoint_link(endpoint) {
return "/about/api/" + endpoint.method.toLowerCase() + "/" + endpoint.path;
},
endpoint_string(endpoint) {
return endpoint.method + " " + endpoint.path;
},
},
created() {
this.loading = true;
aclog.apidocs.load().then(docs => {
this.loading = false;
this.apidocs = docs.namespaces
});
}
};
</script>
|