About modal: powered by footer for branded installations, update status badge (#33233)
This commit is contained in:
parent
27bbdce298
commit
8905c2777b
25 changed files with 114 additions and 49 deletions
|
|
@ -1,4 +1,11 @@
|
|||
import { StorybookConfig } from "@storybook/vue3-vite";
|
||||
import { createReadStream } from "node:fs";
|
||||
|
||||
// serve test logos so the custom branding stories can render them
|
||||
const customLogos = {
|
||||
"/custom-logo-light": "tests/custom-logo-light.svg",
|
||||
"/custom-logo-dark": "tests/custom-logo-dark.svg",
|
||||
};
|
||||
|
||||
export default {
|
||||
stories: ["../assets/js/**/*.stories.@(js|ts)"],
|
||||
|
|
@ -10,4 +17,21 @@ export default {
|
|||
core: {
|
||||
disableTelemetry: true,
|
||||
},
|
||||
viteFinal: (config) => ({
|
||||
...config,
|
||||
plugins: [
|
||||
...(config.plugins ?? []),
|
||||
{
|
||||
name: "evcc-custom-logos",
|
||||
configureServer(server) {
|
||||
server.middlewares.use((req, res, next) => {
|
||||
const file = customLogos[req.url?.split("?")[0] as keyof typeof customLogos];
|
||||
if (!file) return next();
|
||||
res.setHeader("Content-Type", "image/svg+xml");
|
||||
createReadStream(file).pipe(res);
|
||||
});
|
||||
},
|
||||
},
|
||||
],
|
||||
}),
|
||||
} satisfies StorybookConfig;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue