Skip to content

Commit de2d001

Browse files
committed
API Explorer v.1.0.2
1 parent a81fbe2 commit de2d001

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+2751
-0
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# apiexplorer-spa
2+
3+
## Project setup
4+
```
5+
npm install
6+
```
7+
8+
### Compiles and hot-reloads for development
9+
```
10+
npm run serve
11+
```
12+
13+
### Compiles and minifies for production
14+
```
15+
npm run build
16+
```
17+
18+
### Lints and fixes files
19+
```
20+
npm run lint
21+
```
22+
23+
### Customize configuration
24+
See [Configuration Reference](https://cli.vuejs.org/config/).
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module.exports = {
2+
presets: [
3+
'@vue/cli-plugin-babel/preset'
4+
]
5+
}
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
{
2+
"name": "apiexplorer-spa",
3+
"version": "0.1.0",
4+
"private": true,
5+
"scripts": {
6+
"serve": "vue-cli-service serve",
7+
"build": "vue-cli-service build && npm run copycss && npm run copyjs && npm run copymanifest",
8+
"lint": "vue-cli-service lint",
9+
"copycss": "copyfiles dist/css/*.css ../css --flat",
10+
"copyjs": "copyfiles dist/js/*.js ../js --flat",
11+
"copymanifest": "copyfiles dist/manifest.json ../js --flat"
12+
},
13+
"dependencies": {
14+
"@popperjs/core": "^2.11.0",
15+
"axios": "^0.21.4",
16+
"copyfiles": "^2.4.1",
17+
"core-js": "^3.19.0",
18+
"marked": "^3.0.8",
19+
"mitt": "^3.0.0",
20+
"pretty-print-json": "^1.1.1",
21+
"swagger-client": "^3.17.0",
22+
"v-calendar": "^3.0.0-alpha.6",
23+
"vue": "^3.2.20",
24+
"vue-i18n": "^9.2.0-beta.23",
25+
"vue-router": "^4.0.12",
26+
"vuex": "^4.0.0-0"
27+
},
28+
"devDependencies": {
29+
"@vue/cli-plugin-babel": "^4.5.14",
30+
"@vue/cli-plugin-eslint": "^4.5.14",
31+
"@vue/cli-plugin-router": "^4.5.14",
32+
"@vue/cli-plugin-vuex": "^4.5.14",
33+
"@vue/cli-service": "^4.5.14",
34+
"@vue/compiler-sfc": "^3.2.20",
35+
"babel-eslint": "^10.1.0",
36+
"eslint": "^6.7.2",
37+
"eslint-plugin-vue": "^7.20.0"
38+
},
39+
"eslintConfig": {
40+
"root": true,
41+
"env": {
42+
"node": true
43+
},
44+
"extends": [
45+
"plugin:vue/vue3-essential",
46+
"eslint:recommended"
47+
],
48+
"parserOptions": {
49+
"parser": "babel-eslint"
50+
},
51+
"rules": {}
52+
},
53+
"browserslist": [
54+
"> 1%",
55+
"last 2 versions",
56+
"not dead"
57+
]
58+
}
4.19 KB
Binary file not shown.
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8">
5+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
6+
<meta name="viewport" content="width=device-width,initial-scale=1.0">
7+
<% if (NODE_ENV === "development") { %>
8+
<link href="<%= VUE_APP_WA_DEV %>/wa-content/css/wa/wa-2.0.css" rel="stylesheet">
9+
<link id="wa-dark-mode" href="<%= VUE_APP_WA_DEV %>/wa-content/css/wa/wa-2.0-dark.css" rel="stylesheet" type="text/css" media="(prefers-color-scheme: dark)">
10+
<link href="<%= VUE_APP_WA_DEV %>/wa-apps/apiexplorer/css/backend.css" rel="stylesheet">
11+
<script defer="" src="<%= VUE_APP_WA_DEV %>/wa-content/js/fontawesome/fontawesome-all.min.js?v=513"></script>
12+
13+
<script src="<%= VUE_APP_WA_DEV %>/wa-content/js/jquery/jquery-3.6.0.min.js"></script>
14+
<script src="<%= VUE_APP_WA_DEV %>/wa-content/js/jquery/jquery-migrate-3.3.2.min.js"></script>
15+
<script src="<%= VUE_APP_WA_DEV %>/wa-content/js/jquery-wa/wa.js"></script>
16+
<script>
17+
window.appState = {
18+
"baseUrl": "<%= VUE_APP_BASE_URL %>",
19+
"rootUrl": "/",
20+
"user_id": "1",
21+
"development_mode": "1",
22+
"locale": "<%= VUE_APP_I18N_LOCALE %>"
23+
};
24+
</script>
25+
<% } %>
26+
</head>
27+
<body>
28+
<div id="wa">
29+
<div id="wa-nav">
30+
<div id="wa-header"></div>
31+
</div>
32+
<div id="app"></div>
33+
</div>
34+
</body>
35+
</html>
Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
<template>
2+
3+
<section class="flexbox wrap-mobile">
4+
5+
<aside class="sidebar hide-scrollbar width-adaptive flexbox mobile-friendly" style="overflow: inherit;" id="apiexplorer-main-sidebar">
6+
<nav class="sidebar-mobile-toggle">
7+
<div class="box align-center">
8+
<a href="javascript:void(0);" @click="mobileSidebarToggle()">
9+
<i class="fas fa-bars"></i> {{ $t('Menu') }}
10+
</a>
11+
</div>
12+
</nav>
13+
<div class="sidebar-header" :style="sidebarStyle">
14+
<app-list :apps_with_api="app_ids" :layout_loaded="loaded" @app-selected="appSelected" @apps-loaded="appsLoaded" />
15+
</div>
16+
<div class="sidebar-body hide-scrollbar custom-pt-16" id="wa-app-navigation" :style="sidebarStyle">
17+
<user-list @user-selected="mobileSidebarHide" />
18+
</div>
19+
<div class="sidebar-footer" :style="sidebarStyle">
20+
<ul class="menu">
21+
<li :class="[$route.name === 'About' && 'selected']" @click="mobileSidebarHide">
22+
<router-link :to="{ name: 'About' }">
23+
<i class="fas fa-info"></i>
24+
<span>{{ $t('About') }}</span>
25+
</router-link>
26+
</li>
27+
</ul>
28+
</div>
29+
</aside>
30+
31+
<main class="content blank hide-scrollbar flexbox">
32+
33+
<aside class="sidebar blank width-18rem bordered-right desktop-only hide-scrollbar" v-if="$route.name === 'Application' || $route.name === 'Method'">
34+
<div class="sidebar-body hide-scrollbar">
35+
<method-list :app_id="current_app" />
36+
</div>
37+
</aside>
38+
39+
<div class="article content">
40+
<div class="article-body" id="wa-app-content">
41+
<router-view v-if="loaded" :key="$route.fullPath"/>
42+
<div v-else class="box skeleton" style="width: 70%;">
43+
<span class="skeleton-header" style="width: 60%;"></span>
44+
<span class="skeleton-line"></span>
45+
<span class="skeleton-line"></span>
46+
<span class="skeleton-line"></span>
47+
<span class="skeleton-line"></span>
48+
</div>
49+
</div>
50+
</div>
51+
</main>
52+
53+
</section>
54+
55+
<div class="alert-fixed-box" v-if="error.state">
56+
<span class="alert danger">
57+
<a href="javascript:void(0);" class="alert-close" @click="closeError"><i class="fas fa-times"></i></a>
58+
<i class="fas fa-skull"></i> <strong v-if="error.title">{{ error.title }}<br /></strong>
59+
<span v-if="error.contentType === 'text'">{{ error.description }}</span>
60+
<div v-else v-html="error.description"></div>
61+
</span>
62+
</div>
63+
64+
</template>
65+
66+
<script>
67+
import AppList from '@/components/AppList';
68+
import UserList from '@/components/UserList';
69+
import MethodList from '@/components/MethodList';
70+
export default {
71+
components: {
72+
AppList,
73+
UserList,
74+
MethodList,
75+
},
76+
data() {
77+
return {
78+
//sidebar: ['/', '/about'],
79+
current_app: "",
80+
app_ids: [],
81+
error: {
82+
state: false,
83+
description: "",
84+
title: "",
85+
contentType: "text",
86+
},
87+
mobileSidebarOpen: false,
88+
sidebarStyle: {}
89+
};
90+
},
91+
computed: {
92+
loaded() {
93+
return this.$store.state.loaded;
94+
}
95+
},
96+
created() {
97+
this.emitter.on('error', (err) => {
98+
if (typeof err === 'object') {
99+
this.error.title = err.title;
100+
this.error.contentType = err.contentType.startsWith('text/html') ? 'html' : 'text';
101+
this.error.description = err.description;
102+
} else {
103+
this.error.description = err;
104+
this.error.contentType = 'text';
105+
this.error.title = '';
106+
}
107+
this.error.state = true;
108+
});
109+
},
110+
methods: {
111+
appsLoaded(apps) {
112+
this.app_ids = apps;
113+
this.$store.commit('load_finish');
114+
},
115+
appSelected(app_id) {
116+
this.current_app = app_id;
117+
this.mobileSidebarHide();
118+
},
119+
mobileSidebarToggle() {
120+
if (this.mobileSidebarOpen) {
121+
this.mobileSidebarHide();
122+
} else {
123+
this.mobileSidebarShow();
124+
}
125+
},
126+
mobileSidebarHide() {
127+
this.mobileSidebarOpen = false;
128+
this.sidebarStyle = {};
129+
},
130+
mobileSidebarShow() {
131+
this.mobileSidebarOpen = true;
132+
this.sidebarStyle = {
133+
display: 'block',
134+
};
135+
},
136+
closeError() {
137+
this.error.state = false;
138+
this.error.description = '';
139+
this.error.contentType = 'text';
140+
this.error.title = '';
141+
}
142+
}
143+
};
144+
</script>

0 commit comments

Comments
 (0)