File tree 3 files changed +55
-5
lines changed
3 files changed +55
-5
lines changed Original file line number Diff line number Diff line change 26
26
< script src ="./dist/vendor.js "> </ script >
27
27
< script src ="./dist/data.js "> </ script >
28
28
< script src ="./dist/main.js "> </ script >
29
+ < script >
30
+ $ ( function ( ) {
31
+ $ ( "[data-toggle=\"tooltip\"]" ) . tooltip ( ) ;
32
+ } ) ;
33
+ </ script >
29
34
</ body >
30
35
</ html >
Original file line number Diff line number Diff line change 9
9
v-if =" !fullscreen" >
10
10
<nav class =" col-sm-4 col-md-3 d-none d-sm-block bg-faded logo" >
11
11
{{ schema.info.title }}
12
+ <div class =" row" >
13
+ <div class =" col" >
14
+ <div class =" input-group" >
15
+ <input
16
+ id =" search"
17
+ :placeholder =" this.searchRegexp ? 'Regexp' : 'Search'"
18
+ class =" form-control"
19
+ v-model =" search" >
20
+ <div class =" input-group-append" >
21
+ <button
22
+ :class =" ['btn', this.searchRegexp ? 'btn-primary' : 'btn-outline-secondary']"
23
+ type =" button"
24
+ data-toggle =" tooltip"
25
+ data-placement =" right"
26
+ title =" Toggle Regexp Search"
27
+ @click =" onToggleSearchMode" >
28
+ <i class =" oi oi-code" />
29
+ </button >
30
+ </div >
31
+ </div >
32
+ </div >
33
+ </div >
12
34
</nav >
13
35
<div class =" col-sm-8 offset-sm-4 col-md-9 offset-md-3 pt-3" >
14
36
<request-url
21
43
</div >
22
44
</div >
23
45
<div class =" row" >
24
- <nav class =" col-sm-4 col-md-3 d-none d-sm-block bg-faded sidebar" v-if =" !fullscreen" >
46
+ <nav
47
+ class =" col-sm-4 col-md-3 d-none d-sm-block bg-faded sidebar"
48
+ v-if =" !fullscreen" >
49
+
25
50
<path-menu
26
51
:schema =" schema"
27
52
:request-url =" selectedUrl"
53
+ :search =" search"
54
+ :search-regexp =" searchRegexp"
28
55
@selectUrl =" onSelectUrl" />
29
56
</nav >
30
57
<main class =" col-sm-8 offset-sm-4 col-md-9 offset-md-3 pt-3" >
@@ -88,14 +115,19 @@ export default {
88
115
responseHeaders: {},
89
116
responseBody: " " ,
90
117
requestUrl: " " ,
91
- fullscreen: false
118
+ fullscreen: false ,
119
+ search: " " ,
120
+ searchRegexp: false
92
121
};
93
122
},
94
123
props: [" schema" ],
95
124
methods: {
96
125
onRequestBodyChange (requestBody ) {
97
126
this .requestBody = requestBody;
98
127
},
128
+ onToggleSearchMode () {
129
+ this .searchRegexp = ! this .searchRegexp ;
130
+ },
99
131
onSelectUrl (url ) {
100
132
this .requestUrl = getFirstServerUrl (this .schema ) + getBasePath (this .schema ) + url;
101
133
this .selectedUrl = url;
@@ -139,7 +171,7 @@ export default {
139
171
.logo {
140
172
position : fixed ;
141
173
top : 0 ;
142
- height : 70 px ;
174
+ height : 100 px ;
143
175
left : 0 ;
144
176
z-index : 1000 ;
145
177
padding : 20px ;
@@ -150,7 +182,7 @@ export default {
150
182
151
183
.sidebar {
152
184
position : fixed ;
153
- top : 70 px ;
185
+ top : 100 px ;
154
186
bottom : 0 ;
155
187
left : 0 ;
156
188
z-index : 1000 ;
Original file line number Diff line number Diff line change 13
13
</template >
14
14
15
15
<script >
16
+ import trim from " lodash/trim" ;
17
+
16
18
export default {
17
19
name: " PathMenu" ,
18
20
props: [
19
21
" schema" ,
22
+ " search" ,
23
+ " searchRegexp" ,
20
24
" requestUrl"
21
25
],
22
26
computed: {
23
27
urls () {
24
- return Object .keys (this .schema .paths );
28
+ if (trim (this .searchRegexp )) {
29
+ return Object .keys (this .schema .paths ).filter (u => {
30
+ return u .match (this .search );
31
+ });
32
+ } else {
33
+ const search = this .search .toLowerCase ();
34
+ return Object .keys (this .schema .paths ).filter (u => {
35
+ return u .includes (search);
36
+ });
37
+ }
25
38
}
26
39
},
27
40
methods: {
You can’t perform that action at this time.
0 commit comments