mirror of
https://github.com/umami-software/umami.git
synced 2026-02-19 03:55:37 +01:00
update data format
This commit is contained in:
parent
d2658458aa
commit
3076729d7a
5 changed files with 6 additions and 5 deletions
|
|
@ -32,7 +32,7 @@ function getClient() {
|
||||||
} = new URL(process.env.CLICKHOUSE_URL);
|
} = new URL(process.env.CLICKHOUSE_URL);
|
||||||
|
|
||||||
const client = createClient({
|
const client = createClient({
|
||||||
host: `${protocol}//${hostname}:${port}`,
|
url: `${protocol}//${hostname}:${port}`,
|
||||||
database: pathname.replace('/', ''),
|
database: pathname.replace('/', ''),
|
||||||
username: username,
|
username: username,
|
||||||
password,
|
password,
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ function getClient() {
|
||||||
? {
|
? {
|
||||||
ssl: true,
|
ssl: true,
|
||||||
sasl: {
|
sasl: {
|
||||||
mechanism: 'scram-sha-256',
|
mechanism: 'plain',
|
||||||
username,
|
username,
|
||||||
password,
|
password,
|
||||||
},
|
},
|
||||||
|
|
@ -57,7 +57,7 @@ async function getProducer(): Promise<Producer> {
|
||||||
}
|
}
|
||||||
|
|
||||||
function getDateFormat(date: Date, format?: string): string {
|
function getDateFormat(date: Date, format?: string): string {
|
||||||
return dateFormat(date, format ? format : 'UTC:yyyy-mm-dd HH:MM:ss');
|
return dateFormat(date, format ? format : 'yyyy-mm-dd HH:MM:ss');
|
||||||
}
|
}
|
||||||
|
|
||||||
async function sendMessage(
|
async function sendMessage(
|
||||||
|
|
|
||||||
|
|
@ -75,7 +75,7 @@ async function clickhouseQuery(data: {
|
||||||
string_value: getStringValue(value, dataType),
|
string_value: getStringValue(value, dataType),
|
||||||
number_value: dataType === DATA_TYPE.number ? value : null,
|
number_value: dataType === DATA_TYPE.number ? value : null,
|
||||||
date_value: dataType === DATA_TYPE.date ? getDateFormat(value) : null,
|
date_value: dataType === DATA_TYPE.date ? getDateFormat(value) : null,
|
||||||
created_at: createdAt,
|
created_at: createdAt ?? getDateFormat(new Date()),
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -94,7 +94,7 @@ async function clickhouseQuery(data: {
|
||||||
string_value: getStringValue(value, dataType),
|
string_value: getStringValue(value, dataType),
|
||||||
number_value: dataType === DATA_TYPE.number ? value : null,
|
number_value: dataType === DATA_TYPE.number ? value : null,
|
||||||
date_value: dataType === DATA_TYPE.date ? getDateFormat(value) : null,
|
date_value: dataType === DATA_TYPE.date ? getDateFormat(value) : null,
|
||||||
created_at: createdAt,
|
created_at: createdAt ?? getDateFormat(new Date()),
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
1
src/tracker/index.d.ts
vendored
1
src/tracker/index.d.ts
vendored
|
|
@ -146,6 +146,7 @@ export type UmamiTracker = {
|
||||||
*/
|
*/
|
||||||
(eventFunction: CustomEventFunction): Promise<string>;
|
(eventFunction: CustomEventFunction): Promise<string>;
|
||||||
};
|
};
|
||||||
|
identify: (data: { [key: string]: number | string | number[] | string[] }) => Promise<string>;
|
||||||
};
|
};
|
||||||
|
|
||||||
interface Window {
|
interface Window {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue