mirror of
https://github.com/kremalicious/umami.git
synced 2025-02-14 21:10:34 +01:00
clean-up protocol, update getDatabaseType logic for CH
This commit is contained in:
parent
be353d5555
commit
ce0a90e341
@ -8,8 +8,6 @@ export const ReportContext = createContext(null);
|
|||||||
export function Report({ reportId, defaultParameters, children, ...props }) {
|
export function Report({ reportId, defaultParameters, children, ...props }) {
|
||||||
const report = useReport(reportId, defaultParameters);
|
const report = useReport(reportId, defaultParameters);
|
||||||
|
|
||||||
//console.log({ report });
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ReportContext.Provider value={{ ...report }}>
|
<ReportContext.Provider value={{ ...report }}>
|
||||||
<Page {...props} className={styles.container}>
|
<Page {...props} className={styles.container}>
|
||||||
|
@ -25,16 +25,13 @@ function getClient() {
|
|||||||
hostname,
|
hostname,
|
||||||
port,
|
port,
|
||||||
pathname,
|
pathname,
|
||||||
// protocol,
|
protocol,
|
||||||
username = 'default',
|
username = 'default',
|
||||||
password,
|
password,
|
||||||
} = new URL(process.env.CLICKHOUSE_URL);
|
} = new URL(process.env.CLICKHOUSE_URL);
|
||||||
|
|
||||||
// const formattedProtocol =
|
|
||||||
// protocol.toLowerCase() === 'clickhouse:' || protocol === 'https:' ? 'https:' : 'http:';
|
|
||||||
|
|
||||||
const client = createClient({
|
const client = createClient({
|
||||||
host: `http://${hostname}:${port}`,
|
host: `${protocol}//${hostname}:${port}`,
|
||||||
database: pathname.replace('/', ''),
|
database: pathname.replace('/', ''),
|
||||||
username: username,
|
username: username,
|
||||||
password,
|
password,
|
||||||
|
@ -17,6 +17,10 @@ export function getDatabaseType(url = process.env.DATABASE_URL) {
|
|||||||
return POSTGRESQL;
|
return POSTGRESQL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (process.env.CLICKHOUSE_URL) {
|
||||||
|
return CLICKHOUSE;
|
||||||
|
}
|
||||||
|
|
||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user