-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathapi-console.html
More file actions
211 lines (191 loc) · 6.42 KB
/
api-console.html
File metadata and controls
211 lines (191 loc) · 6.42 KB
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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
<!DOCTYPE html>
<html lang="zh">
<head>
<title>HotPlex API Console</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="icon" type="image/png" href="/docs/assets/logo.png" />
<link rel="preload" href="/docs/assets/fonts/fonts.css" as="style" onload="this.onload=null;this.rel='stylesheet'">
<noscript><link rel="stylesheet" href="/docs/assets/fonts/fonts.css"></noscript>
<style>
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; overflow: hidden; }
body {
display: flex;
flex-direction: column;
font-family: 'Inter', system-ui, sans-serif;
background: #FAF9F5;
}
/* ── Brand Header ───────────────────────────────── */
.hp-header {
flex: 0 0 40px;
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 20px;
background: #FAF9F5;
border-bottom: 1px solid #EBEAE4;
z-index: 999;
}
.hp-header-left {
display: flex;
align-items: center;
gap: 8px;
text-decoration: none;
}
.hp-header-left img {
width: 20px;
height: 20px;
border-radius: 5px;
}
.hp-header-title {
font-weight: 700;
font-size: 13px;
color: #0F0F0E;
letter-spacing: -0.01em;
}
.hp-header-sep {
width: 1px;
height: 14px;
background: #EBEAE4;
}
.hp-header-badge {
font-size: 10px;
font-weight: 500;
color: #7A7973;
letter-spacing: 0.02em;
}
.hp-back {
display: inline-flex;
align-items: center;
gap: 4px;
font-size: 12px;
color: #7A7973;
text-decoration: none;
padding: 4px 10px;
border-radius: 6px;
transition: all 0.15s;
}
.hp-back:hover {
color: #C35A3E;
background: rgba(195, 90, 62, 0.06);
}
.hp-back svg { width: 14px; height: 14px; }
/* ── Scalar Container ───────────────────────────── */
.scalar-wrap {
flex: 1;
min-height: 0;
position: relative;
}
/* Force Scalar web component to fill its container */
.scalar-wrap scalar-api-reference {
display: block;
height: 100%;
width: 100%;
}
/* Loading placeholder */
.scalar-loading {
position: absolute;
inset: 0;
display: flex;
align-items: center;
justify-content: center;
gap: 10px;
background: #FAF9F5;
color: #7A7973;
font-size: 14px;
transition: opacity 0.3s;
}
.scalar-loading.hidden { opacity: 0; pointer-events: none; }
.scalar-loading .spinner {
width: 18px;
height: 18px;
border: 2px solid #EBEAE4;
border-top-color: #C35A3E;
border-radius: 50%;
animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
/* ── Scalar Theme ───────────────────────────────── */
:root {
--scalar-color-accent: #C35A3E;
--scalar-color-accent-soft: rgba(195, 90, 62, 0.1);
--scalar-background-1: #FFFFFF;
--scalar-background-2: #FAF9F5;
--scalar-background-3: #F5F4F0;
--scalar-border-color: #EBEAE4;
--scalar-color-1: #0F0F0E;
--scalar-color-2: #3D3D3A;
--scalar-color-3: #7A7973;
--scalar-font: 'Inter', system-ui, -apple-system, sans-serif;
--scalar-font-code: 'JetBrains Mono', 'Fira Code', ui-monospace, monospace;
--scalar-radius: 8px;
--scalar-radius-lg: 12px;
}
@media (max-width: 768px) {
.hp-header { padding: 0 12px; }
.hp-header-title { font-size: 12px; }
.hp-header-sep, .hp-header-badge { display: none; }
}
</style>
</head>
<body>
<div class="hp-header">
<a href="/docs/" class="hp-header-left">
<img src="/docs/assets/logo.webp" alt="HotPlex" />
<span class="hp-header-title">HotPlex</span>
<span class="hp-header-sep"></span>
<span class="hp-header-badge">API Console</span>
</a>
<a href="/docs/" class="hp-back">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="M19 12H5M12 19l-7-7 7-7"/>
</svg>
返回文档
</a>
</div>
<div class="scalar-wrap">
<div class="scalar-loading" id="scalar-loading">
<div class="spinner"></div>
Loading API Console...
</div>
<script
id="api-reference"
data-url="/docs/swagger/swagger.json"
src="standalone.min.js"
></script>
<script>
document.getElementById('api-reference').dataset.configuration = JSON.stringify({
servers: [
{ url: window.location.protocol + '//' + window.location.hostname + ':8888', description: 'Gateway API (port 8888)' },
{ url: window.location.protocol + '//' + window.location.hostname + ':9999', description: 'Admin API (port 9999)' }
],
theme: 'light',
withDefaultFonts: false,
hideModels: false,
customCss: `
.scalar-api-reference .sidebar-section-title {
font-family: 'Inter', system-ui, sans-serif;
}
.scalar-api-reference .endpoint-card {
border-radius: 12px;
}
`
});
// Hide loading spinner once Scalar renders
var observer = new MutationObserver(function() {
var el = document.querySelector('scalar-api-reference');
if (el && el.shadowRoot && el.shadowRoot.querySelector('.scalar-api-reference')) {
document.getElementById('scalar-loading').classList.add('hidden');
observer.disconnect();
}
});
observer.observe(document.body, { childList: true, subtree: true });
// Fallback: hide after 8s regardless
setTimeout(function() {
document.getElementById('scalar-loading').classList.add('hidden');
}, 8000);
</script>
</div>
</body>
</html>