feat: system settings, dynamic logos, template numbering, permission consolidation
- System settings page with tabs: Security, System, Firma
- Configurable attendance rules (break thresholds, rounding) from DB
- Configurable document numbering with template patterns ({YYYY}/{PREFIX}/{NNN})
- Dynamic logo upload (light/dark variants) served from DB instead of static files
- Email settings (SMTP from/name, alert/leave emails) configurable in UI
- Currency and VAT rate lists configurable, used across all modules
- Permissions simplified: offers.settings + settings.roles + settings.security → settings.manage
- Leaflet bundled locally, removed unpkg.com from CSP
- Silent catch blocks fixed with proper logging
- console.log replaced with app.log.info in server.ts
- Schema renamed: company-settings.schema → settings.schema
- App info section: version, Node.js, uptime, memory, DB status, NAS status
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -358,6 +358,7 @@ function buildPrintHtml(
|
||||
userSections: string,
|
||||
emptyMsg: string,
|
||||
filterNote: string,
|
||||
companyName: string,
|
||||
): string {
|
||||
return `<!DOCTYPE html>
|
||||
<html lang="cs">
|
||||
@@ -424,10 +425,10 @@ function buildPrintHtml(
|
||||
<thead><tr><td>
|
||||
<div class="print-header">
|
||||
<div class="print-header-left">
|
||||
<img src="/images/logo-light.png" alt="BOHA" class="print-logo" />
|
||||
<img src="/api/admin/company-settings/logo?variant=light" alt="" class="print-logo" />
|
||||
<div class="print-header-text">
|
||||
<h1>EVIDENCE DOCHÁZKY</h1>
|
||||
<div class="company">BOHA Automation s.r.o.</div>
|
||||
<div class="company">${companyName}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="print-header-right">
|
||||
@@ -1010,9 +1011,16 @@ export default function useAttendanceAdmin({ alert }: AlertContext) {
|
||||
// =========================================================================
|
||||
const handlePrint = async () => {
|
||||
try {
|
||||
let url = `${API_BASE}/attendance?action=print&month=${month}`;
|
||||
if (filterUserId) url += `&user_id=${filterUserId}`;
|
||||
const response = await apiFetch(url);
|
||||
const [response, settingsRes] = await Promise.all([
|
||||
apiFetch(
|
||||
`${API_BASE}/attendance?action=print&month=${month}${filterUserId ? `&user_id=${filterUserId}` : ""}`,
|
||||
),
|
||||
apiFetch(`${API_BASE}/company-settings`),
|
||||
]);
|
||||
const settingsData = await settingsRes.json();
|
||||
const companyName = settingsData.success
|
||||
? settingsData.data.company_name || ""
|
||||
: "";
|
||||
if (response.status === 401) return;
|
||||
const result = await response.json();
|
||||
if (result.success) {
|
||||
@@ -1034,6 +1042,7 @@ export default function useAttendanceAdmin({ alert }: AlertContext) {
|
||||
userSections,
|
||||
emptyMsg,
|
||||
filterNote,
|
||||
companyName,
|
||||
);
|
||||
const printWindow = window.open("", "_blank");
|
||||
if (printWindow) {
|
||||
|
||||
Reference in New Issue
Block a user