Skip to content

Commit 4c6f855

Browse files
committed
Added #175
Added #197 Added #269
1 parent d8f5dbd commit 4c6f855

15 files changed

+1002
-54
lines changed

.dockerignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,5 @@ apitest.js
2323
logs/*
2424
api_correspondent.js
2525
prompt.txt
26-
api_test_r1.js
26+
api_test_r1.js
27+
openrouter.js

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,5 @@ apitest.js
1818
logs/*
1919
api_correspondent.js
2020
prompt.txt
21-
api_test_r1.js
21+
api_test_r1.js
22+
openrouter.js

config/config.js

+21
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,24 @@ const envPath = path.join(currentDir, 'data', '.env');
44
console.log('Loading .env from:', envPath); // Debug log
55
require('dotenv').config({ path: envPath });
66

7+
// Helper function to parse boolean-like env vars
8+
const parseEnvBoolean = (value, defaultValue = 'yes') => {
9+
if (!value) return defaultValue;
10+
return value.toLowerCase() === 'true' || value === '1' || value.toLowerCase() === 'yes' ? 'yes' : 'no';
11+
};
12+
13+
// Initialize limit functions with defaults
14+
const limitFunctions = {
15+
activateTagging: parseEnvBoolean(process.env.ACTIVATE_TAGGING, 'yes'),
16+
activateCorrespondents: parseEnvBoolean(process.env.ACTIVATE_CORRESPONDENTS, 'yes'),
17+
activateDocumentType: parseEnvBoolean(process.env.ACTIVATE_DOCUMENT_TYPE, 'yes'),
18+
activateTitle: parseEnvBoolean(process.env.ACTIVATE_TITLE, 'yes')
19+
};
720

821
console.log('Loaded environment variables:', {
922
PAPERLESS_API_URL: process.env.PAPERLESS_API_URL,
1023
PAPERLESS_API_TOKEN: process.env.PAPERLESS_API_TOKEN,
24+
LIMIT_FUNCTIONS: limitFunctions
1125
});
1226

1327
module.exports = {
@@ -32,6 +46,13 @@ module.exports = {
3246
},
3347
aiProvider: process.env.AI_PROVIDER || 'openai',
3448
scanInterval: process.env.SCAN_INTERVAL || '*/30 * * * *',
49+
// Add limit functions to config
50+
limitFunctions: {
51+
activateTagging: limitFunctions.activateTagging,
52+
activateCorrespondents: limitFunctions.activateCorrespondents,
53+
activateDocumentType: limitFunctions.activateDocumentType,
54+
activateTitle: limitFunctions.activateTitle
55+
},
3556
specialPromptPreDefinedTags: `You are a document analysis AI. You will analyze the document.
3657
You take the main information to associate tags with the document.
3758
You will also find the correspondent of the document (Sender not reciever). Also you find a meaningful and short title for the document.

public/css/dashboard.css

+184-2
Original file line numberDiff line numberDiff line change
@@ -165,9 +165,10 @@ body {
165165
.main-content {
166166
flex: 1;
167167
margin-left: 260px;
168-
padding: 2rem 0 2rem 2rem;
169-
overflow-y: auto;
168+
padding: 2rem;
170169
width: calc(100% - 260px);
170+
overflow-y: auto;
171+
height: 100vh;
171172
}
172173

173174
.content-wrapper {
@@ -477,7 +478,188 @@ body {
477478
color: var(--text-primary);
478479
}
479480

481+
.checkbox-container {
482+
display: flex;
483+
flex-wrap: wrap;
484+
gap: 10px;
485+
}
486+
487+
.checkbox-container input[type="checkbox"] {
488+
margin-right: 5px;
489+
}
490+
491+
@media (max-width: 600px) {
492+
.checkbox-container {
493+
flex-direction: column;
494+
}
495+
}
496+
497+
/* Mobile Menu Button */
498+
.mobile-menu-button {
499+
display: none;
500+
position: fixed;
501+
top: 1rem;
502+
left: 1rem;
503+
z-index: 9999;
504+
padding: 0.75rem;
505+
background: var(--bg-secondary);
506+
border: none;
507+
border-radius: 4px;
508+
color: var(--text-primary);
509+
cursor: pointer;
510+
width: 48px;
511+
height: 48px;
512+
align-items: center;
513+
justify-content: center;
514+
}
515+
516+
/* Sidebar Overlay */
517+
.sidebar-overlay {
518+
display: none;
519+
position: fixed;
520+
top: 0;
521+
left: 0;
522+
right: 0;
523+
bottom: 0;
524+
background: rgba(0, 0, 0, 0.5);
525+
z-index: 998;
526+
}
527+
528+
.sidebar-overlay.active {
529+
display: block;
530+
}
531+
532+
/* Theme Toggle */
533+
.theme-toggle {
534+
z-index: 9999;
535+
}
536+
537+
/* Base Sidebar Styles */
538+
.sidebar {
539+
width: 260px;
540+
background: var(--sidebar-bg);
541+
border-right: 1px solid var(--border-color);
542+
display: flex;
543+
flex-direction: column;
544+
transition: transform 0.3s ease-in-out;
545+
}
546+
547+
/* Mobile Styles */
548+
@media (max-width: 768px) {
549+
.main-content {
550+
margin-left: 0;
551+
width: 100%;
552+
padding: 4rem 1rem 1rem 1rem;
553+
height: 100vh;
554+
overflow-y: auto;
555+
-webkit-overflow-scrolling: touch;
556+
}
557+
558+
.sidebar {
559+
position: fixed;
560+
height: 100%;
561+
overflow-y: auto;
562+
-webkit-overflow-scrolling: touch;
563+
}
564+
565+
.layout-container {
566+
display: block;
567+
height: 100vh;
568+
overflow: hidden;
569+
}
570+
571+
body {
572+
overflow-y: hidden;
573+
}
574+
575+
/* Enable scrolling when sidebar is closed */
576+
body:not(.sidebar-active) {
577+
overflow-y: auto;
578+
}
579+
580+
.mobile-menu-button {
581+
display: flex;
582+
}
583+
584+
.sidebar {
585+
position: fixed;
586+
top: 0;
587+
left: 0;
588+
bottom: 0;
589+
width: 85%;
590+
max-width: 320px;
591+
transform: translateX(-100%);
592+
z-index: 999;
593+
background: var(--bg-secondary);
594+
}
595+
596+
.sidebar.active {
597+
transform: translateX(0);
598+
}
599+
600+
/* Ensure sidebar content is clickable */
601+
.sidebar-nav,
602+
.sidebar-link,
603+
.sidebar-header,
604+
.brand-icon,
605+
.brand-title {
606+
position: relative;
607+
z-index: 999;
608+
pointer-events: auto !important;
609+
}
610+
611+
.sidebar-link {
612+
display: flex;
613+
align-items: center;
614+
padding: 1rem 1.5rem;
615+
color: var(--text-secondary);
616+
text-decoration: none;
617+
transition: all 0.2s ease;
618+
cursor: pointer;
619+
}
620+
621+
.sidebar-link:hover {
622+
background: var(--hover-bg);
623+
color: var(--accent-primary);
624+
}
625+
626+
.sidebar-link.active {
627+
background: var(--hover-bg);
628+
color: var(--accent-primary);
629+
border-right: 3px solid var(--accent-primary);
630+
}
631+
632+
/* Reset main content */
633+
.main-content {
634+
margin-left: 0;
635+
width: 100%;
636+
padding: 4rem 1rem 1rem 1rem;
637+
}
638+
639+
/* Layout container */
640+
.layout-container {
641+
display: flex;
642+
min-height: 100vh;
643+
width: 100%;
644+
}
645+
}
646+
480647
/* Custom Scrollbar */
648+
.main-content::-webkit-scrollbar,
649+
.sidebar::-webkit-scrollbar {
650+
width: 8px;
651+
}
652+
653+
.main-content::-webkit-scrollbar-track,
654+
.sidebar::-webkit-scrollbar-track {
655+
background: var(--bg-secondary);
656+
}
657+
658+
.main-content::-webkit-scrollbar-thumb,
659+
.sidebar::-webkit-scrollbar-thumb {
660+
background: var(--accent-secondary);
661+
border-radius: 4px;
662+
}
481663
::-webkit-scrollbar {
482664
width: 8px;
483665
height: 8px;

public/css/setup.css

+16
Original file line numberDiff line numberDiff line change
@@ -434,6 +434,22 @@ textarea.disabled {
434434
}
435435
}
436436

437+
.checkbox-container {
438+
display: flex;
439+
flex-wrap: wrap;
440+
gap: 10px;
441+
}
442+
443+
.checkbox-container input[type="checkbox"] {
444+
margin-right: 5px;
445+
}
446+
447+
@media (max-width: 600px) {
448+
.checkbox-container {
449+
flex-direction: column;
450+
}
451+
}
452+
437453
/* Dark mode adjustments */
438454
[data-theme="dark"] .tippy-box[data-theme~='custom'] {
439455
background-color: var(--bg-secondary);

0 commit comments

Comments
 (0)