1
0
mirror of https://github.com/amir20/dozzle.git synced 2025-12-30 09:45:15 +01:00
Files
dozzle/assets/stores/config.ts
Amir Raminfar 2c909dab09 fix: adds port and schema to connection again to fix clashes between same host. fixes #2279 (#2289)
* fix: adds port and schema to connection again to fix clashes between same host. fixes #2279

* fixes tests
2023-07-06 09:22:22 -07:00

23 lines
446 B
TypeScript

const text = document.querySelector("script#config__json")?.textContent || "{}";
interface Config {
version: string;
base: string;
authorizationNeeded: boolean;
secured: boolean;
maxLogs: number;
hostname: string;
hosts: { name: string; id: string }[];
}
const pageConfig = JSON.parse(text);
const config: Config = {
maxLogs: 600,
...pageConfig,
};
config.version = config.version.replace(/^v/, "");
export default config;