update to GUI for room server

This commit is contained in:
Lloyd
2025-12-18 22:16:58 +00:00
parent 4e1eb888e5
commit dbe925e26a
5 changed files with 134 additions and 342 deletions
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+2 -2
View File
@@ -8,8 +8,8 @@
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Noto+Sans:wght@400;500;600;700&display=swap" rel="stylesheet">
<script type="module" crossorigin src="/assets/index-Slq7Apk2.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-Bg7ZKVlm.css">
<script type="module" crossorigin src="/assets/index-GsHv-mhm.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-DG39Cjdn.css">
</head>
<body>
<div id="app"></div>
-208
View File
@@ -1,208 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>pyMC Repeater API</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/swagger-ui-dist@5/swagger-ui.css">
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/npm/swagger-ui-dist@5/favicon-32x32.png" sizes="32x32" />
<style>
body {
margin: 0;
padding: 0;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
}
.topbar {
display: none !important;
}
.swagger-ui .info {
margin: 30px 0;
}
.swagger-ui .info .title {
font-size: 2.5rem;
font-weight: 700;
color: #3b4151;
}
.swagger-ui .scheme-container {
background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.swagger-ui .opblock {
border-radius: 8px;
box-shadow: 0 2px 4px rgba(0,0,0,0.08);
margin-bottom: 16px;
border: 1px solid #e8e8e8;
}
.swagger-ui .opblock.opblock-get {
border-left: 4px solid #61affe;
}
.swagger-ui .opblock.opblock-post {
border-left: 4px solid #49cc90;
}
.swagger-ui .opblock.opblock-delete {
border-left: 4px solid #f93e3e;
}
.swagger-ui .opblock.opblock-put {
border-left: 4px solid #fca130;
}
.swagger-ui .opblock-summary {
padding: 12px 20px;
}
.swagger-ui .opblock-summary-method {
font-weight: 700;
border-radius: 4px;
text-transform: uppercase;
font-size: 12px;
padding: 6px 12px;
}
.swagger-ui .btn.execute {
background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
border: none;
color: white;
font-weight: 600;
padding: 10px 24px;
border-radius: 6px;
transition: all 0.2s;
}
.swagger-ui .btn.execute:hover {
box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
transform: translateY(-1px);
}
.swagger-ui .response-col_status {
font-weight: 600;
font-size: 14px;
}
.swagger-ui .model-box {
background: #f7f8fa;
border-radius: 8px;
padding: 16px;
}
.swagger-ui .response-col_description__inner p {
margin: 0;
padding: 8px 0;
}
.swagger-ui .filter-container {
padding: 16px 20px;
border-bottom: 1px solid #e8e8e8;
}
.swagger-ui .filter .operation-filter-input {
border: 2px solid #e8e8e8;
border-radius: 6px;
padding: 10px 16px;
font-size: 14px;
width: 100%;
max-width: 400px;
}
.swagger-ui .filter .operation-filter-input:focus {
border-color: #667eea;
outline: none;
box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}
.swagger-ui .opblock-tag {
font-size: 1.3rem;
font-weight: 700;
color: #3b4151;
padding: 16px 20px;
border-bottom: 2px solid #e8e8e8;
margin-bottom: 16px;
}
.swagger-ui .renderedMarkdown p {
line-height: 1.6;
}
/* Dark mode support */
@media (prefers-color-scheme: dark) {
.swagger-ui .opblock {
background: #2d2d2d;
border-color: #3b3b3b;
}
.swagger-ui .opblock-tag {
color: #e8e8e8;
border-bottom-color: #3b3b3b;
}
.swagger-ui .info .title {
color: #e8e8e8;
}
}
</style>
</head>
<body>
<div id="swagger-ui"></div>
<script src="https://cdn.jsdelivr.net/npm/swagger-ui-dist@5/swagger-ui-bundle.js"></script>
<script src="https://cdn.jsdelivr.net/npm/swagger-ui-dist@5/swagger-ui-standalone-preset.js"></script>
<script>
window.onload = function() {
// Use current browser location for API calls
const currentUrl = window.location.protocol + '//' + window.location.host + '/api';
const ui = SwaggerUIBundle({
url: '/api/openapi',
dom_id: '#swagger-ui',
deepLinking: true,
presets: [
SwaggerUIBundle.presets.apis,
SwaggerUIStandalonePreset
],
plugins: [
SwaggerUIBundle.plugins.DownloadUrl
],
layout: "StandaloneLayout",
tryItOutEnabled: true,
filter: true,
displayRequestDuration: true,
displayOperationId: false,
persistAuthorization: true,
validatorUrl: null,
syntaxHighlight: {
activate: true,
theme: "monokai"
},
defaultModelsExpandDepth: 1,
defaultModelExpandDepth: 2,
docExpansion: "list",
showExtensions: true,
showCommonExtensions: true,
tagsSorter: "alpha",
operationsSorter: "alpha",
// Intercept requests to use current host
requestInterceptor: function(request) {
// Only modify API requests, not the openapi spec fetch
if (!request.url.includes('/api/openapi')) {
// Replace any localhost or hardcoded host with current host
const url = new URL(request.url);
url.protocol = window.location.protocol;
url.host = window.location.host;
request.url = url.toString();
}
return request;
}
});
window.ui = ui;
};
</script>
</body>
</html>