move swagger-ui-theme/ out of hive-c0re/
hive-c0re doesn't touch these files anymore (nginx hosts them directly, see the previous commit) — hive-c0re/swagger-ui-theme/ was a leftover from the original SWAGGER_UI_OVERWRITE_FOLDER build-hook design, which this PR moved away from. New location matches the existing top-level-directory-for-nix-packaged-assets convention (branding/, claude-plugins/). Pure rename, no content change: nix/packages/swagger-ui-theme.nix's three file references updated, everything else picks it up from the same content hash (nix build .#swagger-ui-theme resolves to the exact same store path as before the move).
This commit is contained in:
parent
1bc9c18504
commit
3ef166738c
4 changed files with 20 additions and 26 deletions
161
swagger-ui-theme/hyperhive-theme.css
Normal file
161
swagger-ui-theme/hyperhive-theme.css
Normal file
|
|
@ -0,0 +1,161 @@
|
|||
/* Partial hyperhive reskin for the vendored Swagger UI at /api/docs.
|
||||
Recolors chrome (background, topbar, borders, links, inputs) to
|
||||
match the dashboard. Swagger's own semantic HTTP-method badge colours
|
||||
and execute/cancel button colours are left alone — those carry
|
||||
meaning independent of hyperhive branding.
|
||||
|
||||
Loaded after swagger-ui.css (see index.html) so these rules win the
|
||||
cascade without `!important`, except where noted below.
|
||||
|
||||
`--baseNN` values come from `/static/colors.css` (linked in
|
||||
index.html, same origin as the dashboard) — this follows the
|
||||
operator's live stylix theme, not a hardcoded copy. See
|
||||
frontend/packages/shared/src/colors.css for the base16 contract. */
|
||||
|
||||
/* Page chrome */
|
||||
html,
|
||||
body {
|
||||
background: var(--base00);
|
||||
}
|
||||
.swagger-ui {
|
||||
color: var(--base05);
|
||||
font-family: "JetBrains Mono", "Fira Code", "Cascadia Code",
|
||||
"Source Code Pro", monospace;
|
||||
}
|
||||
|
||||
/* Topbar */
|
||||
.swagger-ui .topbar {
|
||||
background: var(--base01);
|
||||
border-bottom: 1px solid var(--base02);
|
||||
}
|
||||
.swagger-ui .topbar .download-url-wrapper input[type="text"] {
|
||||
border-color: var(--base02);
|
||||
background: var(--base00);
|
||||
color: var(--base05);
|
||||
}
|
||||
.swagger-ui .topbar .download-url-wrapper .download-url-button {
|
||||
background: var(--base0E);
|
||||
color: var(--base01);
|
||||
}
|
||||
|
||||
/* Info block + links */
|
||||
.swagger-ui .info .title,
|
||||
.swagger-ui .info li,
|
||||
.swagger-ui .info p,
|
||||
.swagger-ui .info table {
|
||||
color: var(--base05);
|
||||
}
|
||||
.swagger-ui a.nostyle,
|
||||
.swagger-ui a.nostyle:visited,
|
||||
.swagger-ui .info a {
|
||||
color: var(--base0D);
|
||||
}
|
||||
.swagger-ui .opblock-tag {
|
||||
color: var(--base05);
|
||||
border-bottom-color: var(--base02);
|
||||
}
|
||||
.swagger-ui .opblock-tag:hover {
|
||||
background: color-mix(in srgb, var(--base0E) 8%, transparent);
|
||||
}
|
||||
|
||||
/* Scheme/server selector bar. */
|
||||
.swagger-ui .scheme-container {
|
||||
background: var(--base01);
|
||||
box-shadow: none;
|
||||
border-bottom: 1px solid var(--base02);
|
||||
}
|
||||
|
||||
/* Endpoint rows — method-colour left border stays; only the card body
|
||||
is recoloured. */
|
||||
.swagger-ui .opblock {
|
||||
background: var(--base01);
|
||||
border-color: var(--base02);
|
||||
}
|
||||
.swagger-ui .opblock .opblock-summary-description,
|
||||
.swagger-ui .opblock .opblock-summary-path,
|
||||
.swagger-ui .opblock .opblock-summary-path__deprecated {
|
||||
color: var(--base05);
|
||||
}
|
||||
.swagger-ui .opblock .opblock-section-header {
|
||||
background: var(--base00);
|
||||
}
|
||||
.swagger-ui .opblock-description-wrapper p,
|
||||
.swagger-ui .opblock-external-docs-wrapper p,
|
||||
.swagger-ui .opblock-title_normal p,
|
||||
.swagger-ui .parameter__name,
|
||||
.swagger-ui .parameter__type,
|
||||
.swagger-ui .parameter__deprecated,
|
||||
.swagger-ui .parameter__in,
|
||||
.swagger-ui table.model tr.property-row td {
|
||||
color: var(--base05);
|
||||
}
|
||||
.swagger-ui .tab li,
|
||||
.swagger-ui .opblock .opblock-section-header h4,
|
||||
.swagger-ui .opblock .opblock-section-header label {
|
||||
color: var(--base05);
|
||||
}
|
||||
|
||||
/* Response / model tables. */
|
||||
.swagger-ui table thead tr td,
|
||||
.swagger-ui table thead tr th {
|
||||
color: var(--base05);
|
||||
border-bottom-color: var(--base02);
|
||||
}
|
||||
.swagger-ui .responses-inner h4,
|
||||
.swagger-ui .responses-inner h5 {
|
||||
color: var(--base05);
|
||||
}
|
||||
.swagger-ui .response-col_status {
|
||||
color: var(--base05);
|
||||
}
|
||||
.swagger-ui .model-box,
|
||||
.swagger-ui section.models {
|
||||
background: var(--base01);
|
||||
}
|
||||
.swagger-ui section.models {
|
||||
border-color: var(--base02);
|
||||
}
|
||||
.swagger-ui section.models h4 {
|
||||
color: var(--base05);
|
||||
}
|
||||
.swagger-ui .model {
|
||||
color: var(--base05);
|
||||
}
|
||||
|
||||
/* Form controls */
|
||||
.swagger-ui select,
|
||||
.swagger-ui input[type="text"],
|
||||
.swagger-ui input[type="password"],
|
||||
.swagger-ui input[type="search"],
|
||||
.swagger-ui input[type="email"],
|
||||
.swagger-ui input[type="file"],
|
||||
.swagger-ui textarea {
|
||||
background: var(--base00);
|
||||
color: var(--base05);
|
||||
border-color: var(--base02);
|
||||
}
|
||||
|
||||
/* Generic buttons (Try it out / Reset / Authorize etc) — execute/cancel
|
||||
keep Swagger's own colours. */
|
||||
.swagger-ui .btn {
|
||||
color: var(--base05);
|
||||
border-color: var(--base02);
|
||||
background: var(--base00);
|
||||
}
|
||||
.swagger-ui .btn.authorize {
|
||||
color: var(--base0E);
|
||||
border-color: var(--base0E);
|
||||
}
|
||||
.swagger-ui .btn.authorize svg {
|
||||
fill: var(--base0E);
|
||||
}
|
||||
|
||||
/* `!important`: highlight.js re-asserts this per-token inline, so a
|
||||
plain override loses. Scoped to the code-sample block background
|
||||
only — token colours stay as highlight.js's theme provides. */
|
||||
.swagger-ui .highlight-code {
|
||||
background: var(--base00) !important;
|
||||
}
|
||||
.swagger-ui .microlight {
|
||||
color: var(--base05);
|
||||
}
|
||||
30
swagger-ui-theme/index.html
Normal file
30
swagger-ui-theme/index.html
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
<!-- Served by the gateway's nginx — one of 3 files (see also
|
||||
hyperhive-theme.css, swagger-initializer.js) that
|
||||
nix/packages/swagger-ui-theme.nix overlays onto the plain vendored
|
||||
dist (swagger-ui-dist.nix), and the whole result is what
|
||||
vhosts.nix's `swaggerUiLocations` serves at /api/docs/, wholesale,
|
||||
with NO hive-c0re fallback for any file in the tree. Byte-identical
|
||||
to the vendored Swagger UI's dist/index.html except two added
|
||||
<link>s: `colors.css` (same origin as the dashboard — so this
|
||||
resolves the operator's live stylix theme, not a frozen copy) and
|
||||
hyperhive-theme.css, which consumes its `--baseNN` vars. -->
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Swagger UI</title>
|
||||
<link rel="stylesheet" type="text/css" href="./swagger-ui.css" />
|
||||
<link rel="stylesheet" type="text/css" href="index.css" />
|
||||
<link rel="stylesheet" type="text/css" href="/static/colors.css" />
|
||||
<link rel="stylesheet" type="text/css" href="hyperhive-theme.css" />
|
||||
<link rel="icon" type="image/png" href="./favicon-32x32.png" sizes="32x32" />
|
||||
<link rel="icon" type="image/png" href="./favicon-16x16.png" sizes="16x16" />
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="swagger-ui"></div>
|
||||
<script src="./swagger-ui-bundle.js" charset="UTF-8"> </script>
|
||||
<script src="./swagger-ui-standalone-preset.js" charset="UTF-8"> </script>
|
||||
<script src="./swagger-initializer.js" charset="UTF-8"> </script>
|
||||
</body>
|
||||
</html>
|
||||
21
swagger-ui-theme/swagger-initializer.js
Normal file
21
swagger-ui-theme/swagger-initializer.js
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
window.onload = function() {
|
||||
//<editor-fold desc="Changeable Configuration Block">
|
||||
|
||||
// the following lines will be replaced by docker/configurator, when it runs in a docker-container
|
||||
window.ui = SwaggerUIBundle({
|
||||
"dom_id": "#swagger-ui",
|
||||
"url": "/api/openapi.json",
|
||||
"deepLinking": true,
|
||||
"layout": "StandaloneLayout",
|
||||
presets: [
|
||||
SwaggerUIBundle.presets.apis,
|
||||
SwaggerUIStandalonePreset
|
||||
],
|
||||
plugins: [
|
||||
SwaggerUIBundle.plugins.DownloadUrl
|
||||
],
|
||||
|
||||
});
|
||||
|
||||
//</editor-fold>
|
||||
};
|
||||
Loading…
Reference in a new issue