mockaton 7.4.1 → 7.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -1
- package/package.json +1 -1
- package/sample-mocks/api/user/avatar.GET.200.png +0 -0
- package/sample-mocks/api/user/friends.GET.200.json +3 -1
- package/sample-mocks/api/user.GET.200.json +4 -1
- package/sample-mocks/api/video/stat/[stat-id]/[video-id].GET.200.json +3 -1
- package/src/Dashboard.css +20 -15
- package/src/Dashboard.js +11 -4
package/README.md
CHANGED
package/package.json
CHANGED
|
Binary file
|
package/src/Dashboard.css
CHANGED
|
@@ -7,10 +7,10 @@
|
|
|
7
7
|
--color4xxBackground: #ffedd1;
|
|
8
8
|
--colorAccent: #1e88e5;
|
|
9
9
|
--colorBackground: #fff;
|
|
10
|
+
--colorHeaderBackground: #eee;
|
|
10
11
|
--colorComboBoxBackground: #fafafa;
|
|
11
12
|
--colorComboBoxHeaderBackground: #fff;
|
|
12
13
|
--colorDisabled: #222;
|
|
13
|
-
--colorHeaderBackground: #fff;
|
|
14
14
|
--colorHover: #dfefff;
|
|
15
15
|
--colorLabel: #666;
|
|
16
16
|
--colorLightRed: #ffe4ee;
|
|
@@ -23,11 +23,11 @@
|
|
|
23
23
|
:root {
|
|
24
24
|
--color4xxBackground: #403630;
|
|
25
25
|
--colorAccent: #1f91ff;
|
|
26
|
-
--colorBackground: #
|
|
26
|
+
--colorBackground: #161616;
|
|
27
|
+
--colorHeaderBackground: #090909;
|
|
27
28
|
--colorComboBoxBackground: #252525;
|
|
28
29
|
--colorComboBoxHeaderBackground: #222;
|
|
29
30
|
--colorDisabled: #aaa;
|
|
30
|
-
--colorHeaderBackground: #141414;
|
|
31
31
|
--colorHover: #023661;
|
|
32
32
|
--colorLabel: #aaa;
|
|
33
33
|
--colorLightRed: #ffe4ee;
|
|
@@ -55,6 +55,7 @@ body {
|
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
select {
|
|
58
|
+
font-size: 100%;
|
|
58
59
|
background: var(--colorComboBoxBackground);
|
|
59
60
|
color: var(--colorText);
|
|
60
61
|
cursor: pointer;
|
|
@@ -83,12 +84,14 @@ menu {
|
|
|
83
84
|
display: flex;
|
|
84
85
|
width: 100%;
|
|
85
86
|
align-items: flex-end;
|
|
86
|
-
padding:
|
|
87
|
+
padding: 20px 16px;
|
|
87
88
|
background: var(--colorHeaderBackground);
|
|
89
|
+
box-shadow: var(--boxShadow1);
|
|
88
90
|
gap: 16px;
|
|
89
91
|
|
|
90
92
|
img {
|
|
91
93
|
width: 140px;
|
|
94
|
+
align-self: center;
|
|
92
95
|
margin-right: 75px;
|
|
93
96
|
}
|
|
94
97
|
|
|
@@ -135,7 +138,7 @@ menu {
|
|
|
135
138
|
main {
|
|
136
139
|
display: flex;
|
|
137
140
|
align-items: flex-start;
|
|
138
|
-
margin-top:
|
|
141
|
+
margin-top: 64px;
|
|
139
142
|
|
|
140
143
|
> table {
|
|
141
144
|
border-collapse: collapse;
|
|
@@ -155,7 +158,7 @@ main {
|
|
|
155
158
|
|
|
156
159
|
.PayloadViewer {
|
|
157
160
|
position: sticky;
|
|
158
|
-
top:
|
|
161
|
+
top: 72px;
|
|
159
162
|
width: 50%;
|
|
160
163
|
margin-left: 20px;
|
|
161
164
|
|
|
@@ -165,16 +168,17 @@ main {
|
|
|
165
168
|
|
|
166
169
|
pre {
|
|
167
170
|
overflow: auto;
|
|
168
|
-
max-height: calc(100vh -
|
|
169
|
-
padding: 12px;
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
tab-size: 2;
|
|
175
|
-
|
|
176
|
-
code * {
|
|
171
|
+
max-height: calc(100vh - 72px);
|
|
172
|
+
padding-top: 12px;
|
|
173
|
+
|
|
174
|
+
code {
|
|
175
|
+
white-space: pre;
|
|
176
|
+
tab-size: 2;
|
|
177
177
|
font-family: monospace;
|
|
178
|
+
|
|
179
|
+
* {
|
|
180
|
+
font-family: monospace;
|
|
181
|
+
}
|
|
178
182
|
}
|
|
179
183
|
}
|
|
180
184
|
}
|
|
@@ -307,6 +311,7 @@ main {
|
|
|
307
311
|
* Prism
|
|
308
312
|
*/
|
|
309
313
|
|
|
314
|
+
|
|
310
315
|
@media (prefers-color-scheme: dark) {
|
|
311
316
|
.token.cdata, .token.comment, .token.doctype, .token.prolog {
|
|
312
317
|
color: #8292a2
|
package/src/Dashboard.js
CHANGED
|
@@ -172,9 +172,11 @@ function PreviewLink({ method, urlMask }) {
|
|
|
172
172
|
document.querySelector(`.${CSS.PreviewLink}.${CSS.chosen}`)?.classList.remove(CSS.chosen)
|
|
173
173
|
this.classList.add(CSS.chosen)
|
|
174
174
|
clearTimeout(spinner)
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
175
|
+
const mime = res.headers.get('content-type')
|
|
176
|
+
if (mime.startsWith('image/')) // naively assumes GET.200
|
|
177
|
+
renderPayloadImage(this.href)
|
|
178
|
+
else
|
|
179
|
+
updatePayloadViewer(await res.text() || Strings.empty_response_body, mime)
|
|
178
180
|
refPayloadFile.current.innerText = this.closest('tr').querySelector('select').value
|
|
179
181
|
}
|
|
180
182
|
catch (error) {
|
|
@@ -190,8 +192,13 @@ function ProgressBar() {
|
|
|
190
192
|
r('div', { style: { animationDuration: '1000ms' } }))) // TODO from Config.delay - 180
|
|
191
193
|
}
|
|
192
194
|
|
|
195
|
+
function renderPayloadImage(href) {
|
|
196
|
+
empty(refPayloadViewer.current)
|
|
197
|
+
refPayloadViewer.current.append(r('img', { src: href }))
|
|
198
|
+
}
|
|
199
|
+
|
|
193
200
|
function updatePayloadViewer(body, mime) {
|
|
194
|
-
if (mime === 'application/json' && window.
|
|
201
|
+
if (mime === 'application/json' && window?.Prism.languages)
|
|
195
202
|
refPayloadViewer.current.innerHTML = window.Prism.highlight(body, window.Prism.languages.json, 'json')
|
|
196
203
|
else
|
|
197
204
|
refPayloadViewer.current.innerText = body
|