mirror of
https://github.com/umami-software/umami.git
synced 2026-02-04 04:37:11 +01:00
Allow custom release URL.
This commit is contained in:
parent
64f1841ae4
commit
e4c4019e25
7 changed files with 27 additions and 21 deletions
|
|
@ -7,7 +7,8 @@ export const DASHBOARD_CONFIG = 'umami.dashboard';
|
|||
export const VERSION_CHECK = 'umami.version-check';
|
||||
export const SHARE_TOKEN_HEADER = 'x-umami-share-token';
|
||||
export const HOMEPAGE_URL = 'https://umami.is';
|
||||
export const VERSION_URL = 'https://github.com/mikecao/umami/releases';
|
||||
export const REPO_URL = 'https://github.com/umami-software/umami';
|
||||
export const UPDATES_URL = 'https://api.umami.is/v1/updates';
|
||||
|
||||
export const DEFAULT_LOCALE = 'en-US';
|
||||
export const DEFAULT_THEME = 'light';
|
||||
|
|
|
|||
20
lib/db.js
20
lib/db.js
|
|
@ -2,7 +2,7 @@ import { PrismaClient } from '@prisma/client';
|
|||
import chalk from 'chalk';
|
||||
|
||||
BigInt.prototype.toJSON = function () {
|
||||
return this.toString();
|
||||
return Number(this);
|
||||
};
|
||||
|
||||
const options = {
|
||||
|
|
@ -18,20 +18,20 @@ function logQuery(e) {
|
|||
console.log(chalk.yellow(e.params), '->', e.query, chalk.greenBright(`${e.duration}ms`));
|
||||
}
|
||||
|
||||
let prisma;
|
||||
function getClient(options) {
|
||||
const prisma = new PrismaClient(options);
|
||||
|
||||
if (process.env.NODE_ENV === 'production') {
|
||||
prisma = new PrismaClient(options);
|
||||
} else {
|
||||
if (!global.prisma) {
|
||||
global.prisma = new PrismaClient(options);
|
||||
if (process.env.LOG_QUERY) {
|
||||
prisma.$on('query', logQuery);
|
||||
}
|
||||
|
||||
prisma = global.prisma;
|
||||
return prisma;
|
||||
}
|
||||
|
||||
if (process.env.LOG_QUERY) {
|
||||
prisma.$on('query', logQuery);
|
||||
const prisma = global.prisma || getClient(options);
|
||||
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
global.prisma = prisma;
|
||||
}
|
||||
|
||||
export default prisma;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue