Compare commits
1 Commits
9c49015968
...
v1.3.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
dc9720a67a |
@@ -68,7 +68,7 @@ export default async function companySettingsRoutes(
|
|||||||
const settings = await prisma.company_settings.findFirst({
|
const settings = await prisma.company_settings.findFirst({
|
||||||
select: { [column]: true },
|
select: { [column]: true },
|
||||||
});
|
});
|
||||||
const buf = settings?.[column] as unknown as Buffer | null;
|
const buf = settings?.[column] as Buffer | null;
|
||||||
if (!buf) return error(reply, "Logo nenalezeno", 404);
|
if (!buf) return error(reply, "Logo nenalezeno", 404);
|
||||||
|
|
||||||
let mime = "image/png";
|
let mime = "image/png";
|
||||||
@@ -203,15 +203,9 @@ export default async function companySettingsRoutes(
|
|||||||
max_requests_per_minute: true,
|
max_requests_per_minute: true,
|
||||||
available_vat_rates: true,
|
available_vat_rates: true,
|
||||||
available_currencies: true,
|
available_currencies: true,
|
||||||
smtp_from: true,
|
|
||||||
smtp_from_name: true,
|
|
||||||
offer_number_pattern: true,
|
|
||||||
order_number_pattern: true,
|
|
||||||
invoice_number_pattern: true,
|
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (!settings) return error(reply, "Nastavení nenalezeno", 500);
|
|
||||||
|
|
||||||
// Check if logo exists
|
// Check if logo exists
|
||||||
const logoCheck = await prisma.company_settings.findFirst({
|
const logoCheck = await prisma.company_settings.findFirst({
|
||||||
@@ -225,8 +219,9 @@ export default async function companySettingsRoutes(
|
|||||||
settings.custom_fields as string | null,
|
settings.custom_fields as string | null,
|
||||||
);
|
);
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
const pkg = await import("../../../package.json", {
|
||||||
const pkg = require("../../../package.json") as { version: string };
|
assert: { type: "json" },
|
||||||
|
});
|
||||||
|
|
||||||
let available_vat_rates: number[] = [0, 10, 12, 15, 21];
|
let available_vat_rates: number[] = [0, 10, 12, 15, 21];
|
||||||
try {
|
try {
|
||||||
@@ -260,7 +255,7 @@ export default async function companySettingsRoutes(
|
|||||||
available_currencies,
|
available_currencies,
|
||||||
has_logo,
|
has_logo,
|
||||||
has_logo_dark,
|
has_logo_dark,
|
||||||
app_version: pkg.version,
|
app_version: pkg.default.version,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -269,8 +264,9 @@ export default async function companySettingsRoutes(
|
|||||||
"/system-info",
|
"/system-info",
|
||||||
{ preHandler: requirePermission("settings.manage") },
|
{ preHandler: requirePermission("settings.manage") },
|
||||||
async (request, reply) => {
|
async (request, reply) => {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
const pkg = await import("../../../package.json", {
|
||||||
const pkg = require("../../../package.json") as { version: string };
|
assert: { type: "json" },
|
||||||
|
});
|
||||||
const uptimeSec = process.uptime();
|
const uptimeSec = process.uptime();
|
||||||
const days = Math.floor(uptimeSec / 86400);
|
const days = Math.floor(uptimeSec / 86400);
|
||||||
const hours = Math.floor((uptimeSec % 86400) / 3600);
|
const hours = Math.floor((uptimeSec % 86400) / 3600);
|
||||||
@@ -303,7 +299,7 @@ export default async function companySettingsRoutes(
|
|||||||
const projectNas = new NasFileManager();
|
const projectNas = new NasFileManager();
|
||||||
|
|
||||||
return success(reply, {
|
return success(reply, {
|
||||||
app_version: pkg.version,
|
app_version: pkg.default.version,
|
||||||
node_version: process.version,
|
node_version: process.version,
|
||||||
platform: `${os.type()} ${os.release()}`,
|
platform: `${os.type()} ${os.release()}`,
|
||||||
uptime: uptimeStr,
|
uptime: uptimeStr,
|
||||||
|
|||||||
Reference in New Issue
Block a user