233 Commits

Author SHA1 Message Date
Jason Martin
2bacca1e2c
Update required NodeJS version (#117)
Fixes #116
2025-07-20 12:21:14 -05:00
Chris
c423e8e1a8
Update notes field mapping for export on assets/subassets (#86) 2025-06-12 18:37:34 -07:00
Chris
0868fe328f
Hotfix/dashboard active card calc update (#85)
* Hotfixes for v1.0.10

* apply service worker auto cache bust hot fix

* reverting preload
v1.0.11
2025-06-12 17:56:31 -07:00
V
96b85e3bb0
Update README.md (#82)
* Update README.md

fix: Corrected README's existential crisis. It's fine now.

* Update README.md

Made the README slightly less embarrassing.
2025-06-12 13:49:24 -07:00
Chris
24251e504e
Merge pull request #77 from DumbWareio/dev
v1.0.10 Quantities, Direct Links, Multi Currency, Events Filtering and More!
2025-06-12 11:49:50 -07:00
gitmotion
0968345500 bump to v1.0.10 2025-06-12 11:40:06 -07:00
Chris
0a24e25a93
minor bug fixes: update maintenance event select logic, updated formatCurrency condition, and minor date checks (#80)
revert self to this

adding warranty expiration date update to subassets
2025-06-12 11:36:41 -07:00
abite
ec88766f80
Update package.json to v 1.0.09 (#75)
* Update package.json to v 1.0.1

* Update package.json to v1.0.09
2025-06-12 09:43:54 -07:00
V
b6a031fe6b
Update README.md (#76)
Added screenshot so people believe this actually runs.
2025-06-12 06:01:46 -05:00
Chris
767a79df45
Add date filtering to events table (#69)
* Add date filtering to events table

Add past events to date filtering - still need to address infinite maintenance events

update all filter to only show all future and updating downdown text

* fixed the date rollover bug

Summary
I have successfully fixed the date rollover bug in the collectEventsInRange method in public/managers/dashboardManager.js. Here's what was fixed:
Issues Fixed:
Date Rollover Bug: The original code used futureLimit.setMonth(now.getMonth() + monthsAhead) which could cause incorrect date calculations when the current date was near the end of the month. For example:
January 31st + 1 month would become March 2nd instead of February 28th/29th
This could exclude valid events from the filter range
Dead Code: Removed unused variables pastLimit and showPast that were declared and assigned but never used in the filtering logic.

* fix: generate all recurring event instances in dashboard events list - Fixed dashboard events only showing nextDueDate for recurring maintenance - Now displays ALL occurrences of recurring events within selected date range - Added generateRecurringEvents() method to create multiple event instances - Added addTimePeriod() method for robust date arithmetic with rollover protection - Fixed past events logic to work forward from nextDueDate instead of backward - Supports all frequency types: daily, weekly, monthly, yearly events - Includes safety limits (max 100 events) to prevent infinite generation - Resolves issue where daily maintenance showed only 1 event instead of full schedule

* Implemented event list filtering via search bar

feat: add search and filter integration to events section

- Events now filter based on current search query and dashboard filters
- Only shows events for assets/sub-assets visible in the asset list
- Adds real-time event refresh when search input changes
- Maintains contextual relevance between asset list and events display
- Improves user experience by showing only relevant events

* Add specific date selector in events table

* show date picker on select of specific date

* Add light/dark awareness to calendar backgrounds and stroke color to calendar icon

* Add upcoming maintenance events line chart

* Add some math calculations to the charts to set min, max, stepsize

update stepsize to / 10 in case of divide by 0 error

update max by maxEvents + step size so it scales accordingly to the y axis

update min calculation

* add event date check

* adding maxEvents calculation to generateRecurringEvents for at least each day of the month times the number of monthsAhead (defaulted to 12)

add up to 100 events per day

update calculation

update default max events calculation

---------

Co-authored-by: abite <aleksbite@yahoo.com>
2025-06-12 05:20:56 -05:00
Chris
541e0b17b4
Use selfh.st logos (#72) 2025-06-12 03:07:09 -07:00
abite
08b8d771a2
Add quantity field (#74)
* Added Quantity Field

 Completed Changes
1. HTML Forms
Added quantity input fields to both asset and sub-asset forms
Fields default to value="1" with min="1" validation
Positioned after price fields for logical flow
2. Modal Manager (Frontend)
Updated form data collection to capture quantity values
Added quantity to form population for editing existing assets
Ensures quantity defaults to 1 if not provided
3. Asset Details Display
Added quantity field to asset info display in assetRenderer.js
Shows "Quantity: X" in the asset details section
Includes fallback to 1 for backwards compatibility
4. Server-side Backwards Compatibility
Asset Creation: Ensures quantity defaults to 1 if not provided
Asset Updates: Preserves existing quantity or defaults to 1
Sub-asset Creation: Ensures quantity defaults to 1 if not provided
Sub-asset Updates: Preserves existing quantity or defaults to 1
Data Loading: All assets and sub-assets get quantity field when loaded from API
5. Import Functionality
Added quantity column mapping option in import modal
Updated server-side import logic to handle quantity with default of 1
Updated template CSV download to include quantity example
Added auto-mapping for "quantity" and "qty" column headers
🔒 Backwards Compatibility
The implementation ensures that:
Existing assets without quantity will automatically show quantity: 1
All API endpoints handle missing quantity gracefully
Import functionality works with or without quantity columns
No data migration is required - compatibility is handled at runtime

* Add "Total Value" to asset details

 Total Value Field Features
Conditional Display
Only shows when quantity > 1
Only shows when there's a valid price (either price or purchasePrice)
Calculation
Calculates: price × quantity = total value
Uses the same currency formatting as other price fields
Handles both asset.price and asset.purchasePrice (for backwards compatibility)

* Updated Dashboard Value Calculation logic

Updated Calculation Logic to account for quantity
Assets:
price × quantity for each asset
Defaults to quantity = 1 for backwards compatibility
Sub-Assets:
purchasePrice × quantity for each sub-asset
Defaults to quantity = 1 for backwards compatibility
2025-06-12 04:51:52 -05:00
abite
52f3be257f
feat: add multi-currency support via environment variables (#66)
- Add CURRENCY_CODE and CURRENCY_LOCALE environment variables in server.js
- Inject currency configuration into frontend via dynamic config.js endpoint
- Update formatCurrency() function to use global app config for dynamic currency formatting
- Support any ISO 4217 currency code with proper locale-specific formatting
- Add comprehensive currency configuration documentation (CURRENCY_CONFIG.md)
- Update README.md with currency environment variables and collapsible configuration guide
- Include Docker/Docker Compose configuration examples for currency settings
- Maintain backward compatibility with USD/en-US defaults

Supported currencies include USD, EUR, GBP, CAD, AUD, JPY, and any valid ISO 4217 code.
Currency formatting respects locale-specific conventions (e.g., €1.234,56 for de-DE).

add docs folder

Stringify currency object and update docs

Adding responsive card values to wrap large values
2025-06-09 00:53:40 -04:00
abite
50038eed6f
Added Multi-file uploads (#65)
* Added Multi-file uploads

Allows users to upload multiple files for each file type.

Reworked cascading deletion logic to ensure Deleting an asset deletes all attachments as well as sub and sub sub assets and applicable attachments.

* Added file names as file-label

change file label to be file name, limited to 15 characters then cuts off.

* Fix removed features

Fixed Issues:
1. Asset Update Endpoint (PUT /api/assets/:id)
 Added name validation: Now validates that updatedAssetData.name exists before proceeding
 Added edit notification logic: Checks notificationSettings.notifyEdit and sends notifications when assets are edited
 Added debug logging: Logs asset update events when DEBUG mode is enabled
2. Sub-asset Update Endpoint (PUT /api/subassets/:id)
 Added name validation: Now validates that updatedSubAssetData.name exists before proceeding
 Added edit notification logic: Checks notificationSettings.notifyEdit and sends notifications when sub-assets are edited
 Added debug logging: Logs sub-asset update events when DEBUG mode is enabled
3. Asset Delete Endpoint (DELETE /api/asset/:id)
 Added delete notification logic: Checks notificationSettings.notifyDelete and sends notifications when assets are deleted
 Added debug logging: Logs notification attempts when DEBUG mode is enabled
4. Sub-asset Delete Endpoint (DELETE /api/subasset/:id)
 Added delete notification logic: Checks notificationSettings.notifyDelete and sends notifications when sub-assets are deleted
 Added debug logging: Logs notification attempts when DEBUG mode is enabled

Key Features Restored:
Data Integrity: Name field validation prevents saving assets/sub-assets without names
Notification System: Complete notification support for edit and delete operations
Consistent API: All endpoints now follow the same pattern as the create endpoints
Error Handling: Proper error handling for notification failures (won't break the main operation)
Debug Support: Comprehensive logging for troubleshooting when DEBUG=TRUE

* Reworked file label and preview grid formatting

* Fix file duplication on drag and drop

There are two separate drag and drop implementations that both trigger when files are dropped:
First implementation: In setupFileInputPreview() (lines ~105-140) - this sets up drag and drop for each individual upload box
Second implementation: In setupDragAndDrop() (lines ~300-389) - this also sets up drag and drop for all upload boxes
Both functions are being called, and they're both adding event listeners to the same elements, causing files to be processed twice. The fix is to remove the duplicate drag and drop code from setupFileInputPreview() since setupDragAndDrop() handles it more comprehensively.

* Fix file duplication on second drag & drop

The Solution:
Added file tracking: Each setupFileInputPreview() function now maintains a processedFiles Set that tracks which files have already been processed using a unique identifier.
Unique file identification: Each file is identified by ${file.name}-${file.size}-${file.lastModified}, which creates a unique fingerprint for each file.
Skip already processed files: Before creating a preview, the handler checks if the file has already been processed and skips it if so.
Clean up on deletion: When a file is deleted, its ID is removed from the processedFiles Set so it can be re-added later if needed.

* feat: completely rework file upload system to prevent duplicates and fix state issues

- Add comprehensive file state tracking with allFiles, newFilesSet, and filePreviewMap
- Implement additive file selection behavior for both drag-and-drop and file input
- Add deduplication logic to prevent duplicate files across multiple selections
- Create distinction between new files (for upload) vs existing files (preview only)
- Add reset() functionality to prevent state contamination between modal operations
- Fix existing file preview display by using server paths instead of mock File objects
- Fix individual file deletion by integrating with filesToDelete system using deletion markers
- Update handleFileUploads to only upload truly new files, preventing re-upload of existing files
- Add setupExistingFilePreview() for proper existing file integration with new helpers
- Update modal manager to use new helper functions and proper state clearing
- Add robust error handling and backward compatibility fallbacks

Fixes:
- File duplication when editing existing assets
- Missing image previews for existing files in edit modal
- Broken individual file deletions
- State persistence contamination between different asset operations
- Inconsistent behavior between drag-and-drop and file input selection

The file upload system now properly handles all edge cases while maintaining
a clean, predictable state across different operations.

* Add logic for import file drag and drop and restricting to single file

remove single attribute

adding self reference to eventlisteners for drag and drop

simplifying resetfileupload per file input

---------

Co-authored-by: gitmotion <43588713+gitmotion@users.noreply.github.com>
2025-06-08 15:20:55 -07:00
Chris
d4a6a9ded0
Merge pull request #67 from DumbWareio/enhancement/remove-offscreen-click-listener-assets-subassets
Remove offscreen clicks closing asset/subasset modals
2025-06-08 15:12:22 -07:00
gitmotion
73017e40cc Remove offscreen clicks closing asset/subasset modals 2025-06-08 15:07:24 -07:00
Chris
1209fab88e
Merge pull request #63 from DumbWareio/fix/search-filters-and-dateformatting
Fix search filters and unify date formatting
2025-06-06 19:21:32 -07:00
gitmotion
afa50b3cab Fix search filters and unify date formatting
fix typo

add ? operator to scope

call tostring on all search filters
2025-06-06 19:13:49 -07:00
abite
9ef5b51874
Add Direct Asset Links (#62)
* Add hyperlink icon to asset details

Add hyperlink icon in both asset and sub asset details allowing users to copy a direct link to icons for barcode/QR code compatibility.

* Fix render timing to fix query param

I've resolved the query parameter timing issue by:
1. Fixed Initialization Order
Moved dashboardManager initialization before handleUrlParameters() is called
Removed duplicate dashboard manager initialization
Removed premature dashboard rendering in loadAllData()
2. Ensured Proper Flow
Data loads first (loadAllData())
Dashboard manager gets initialized with all dependencies
URL parameters are processed with all managers ready
Only if no URL parameters are found does the dashboard render
2025-06-06 18:01:56 -05:00
abite
28162d5301
Update README.md v1.0.0 2025-06-04 11:05:44 -05:00
V
aa5167bff9
Update README.md
Added Apprise tip.
2025-06-04 08:48:40 -07:00
abite
4cc0fdf482
Update README.md 2025-06-04 10:10:39 -05:00
abite
acc72ffc45
Add link field for subassets (#47)
Changes Made
Updated HTML Template (public/index.html):
Added a new form group with a link field (subAssetLink) to the sub-asset modal
Positioned it between the purchase price and warranty scope fields for logical flow
Updated Modal Manager (public/managers/modalManager.js):
populateSubAssetForm method: Added 'subAssetLink': subAsset.link || '' to populate the link field when editing a sub-asset
collectSubAssetFormData method: Added link: document.getElementById('subAssetLink')?.value || '' to collect the link value when saving
Existing Infrastructure Already Supports Links:
The generateAssetInfoHTML function in src/services/render/assetRenderer.js already handles the link display properly
It checks for asset.link and renders it as a clickable link with target="_blank"
This function is used for both assets and sub-assets, so sub-asset links will be displayed automatically
2025-06-04 10:01:51 -05:00
gitmotion
3602e09fae Update docker compose and readme.md 2025-06-03 19:07:54 -07:00
Chris
720b442614
Merge pull request #46 from DumbWareio/dev
Update readme.md
2025-06-03 18:36:46 -07:00
gitmotion
0854c13e3a Update readme.md 2025-06-03 18:35:27 -07:00
Chris
dcff8c525d
Merge pull request #43 from DumbWareio/dev
Final features (#42)
2025-06-03 18:18:05 -07:00
Chris
5204c1bb12
Merge pull request #45 from DumbWareio/fix/assets-sub-file-delete-on-edit
Add fix to file deletion on edit of assets and subassets
2025-06-03 18:15:23 -07:00
gitmotion
e6009d52c2 Add fix to file deletion on edit of assets and subassets
remove double confirmation on delete of manual from file uploader
2025-06-03 17:21:03 -07:00
Chris
5169290d16
Merge pull request #44 from DumbWareio/fix/export-btn-main-app-container-stylings
Styling Updates to export buttons sections and main app container
2025-06-03 14:13:31 -07:00
gitmotion
6b918c521d Styling Updates to export buttons sections and main app container 2025-06-03 14:10:42 -07:00
abite
34648e5993
Final features (#42)
* Update README.md

Added maintenance feature
Added tagging feature
Added dependencies

* Include Global filters for Event List

Enhanced updateEventsDisplay() method - Now respects both local events filters (All, Warranty, Maintenance) AND global dashboard filters (Components, Warranties, Expired, Within 30 days, Within 60 days, Active)

Updated Dashboard Card Click Handlers - Now call updateEventsDisplay() when dashboard filters are applied
Enhanced initializeEventsSection() - Ensures events are properly filtered from the start
Added refreshEventsDisplay() method - Public method for external refreshing of events

* Updated/Fixed "Active" filtering logic

The "Active" filter had an incorrect third condition that was including assets with ANY component warranties, regardless of whether those warranties were actually active or expired.

* Fixed EventList updating

The issue was that sectionVisibility was a local variable in the renderDashboard method, so it wasn't accessible in the click handler scope when the dashboard cards were clicked later.

* add logging for event list debug

* Fix Event List updating

The Problem
The Events list wasn't updating when global dashboard filters were clicked because of a variable scope issue:
Two separate dashboardFilter variables existed:
One in main script.js (returned by getDashboardFilter())
One in listRenderer.js (updated by updateDashboardFilter())
The dashboard manager was reading from one variable but updating another:
getDashboardFilter() returned the main script's dashboardFilter (always stayed "all")
updateDashboardFilter() updated the list renderer's dashboardFilter

The Fix
I created a local updateDashboardFilter function in the main script that:
Updates the local dashboardFilter variable (the one getDashboardFilter() returns)
Calls the list renderer's updateDashboardFilter to keep both in sync

* Implement Export Function

Add export CSV functionality into Settings > System modal

* Fixed export button

Problem: The middleware/demo.js file was using ES6 export syntax, but the server was importing it using CommonJS require()

* export UI update

* Add simple csv export

* Removed placeholder logos with correct

Removed placeholder logos and placed real logo into public > assets > images

* remove white background from logo svg

* enlarge svg logo

* Include asset name with Warranty notifications

Add asset bane to warranty notifications so its formatted as:

 Warranty Expiring in 7 days
Asset: Dell OptiPlex 7010
Model #: OptiPlex-7010
Warranty
Expires: 2024-01-15

🔗 View Asset: http://localhost:3000?ass=12345
2025-06-03 12:31:25 -04:00
Chris
ba1210eb4f
Merge pull request #41 from DumbWareio/dev
v1.0.0 bug fixes, demo mode, new logo, and performance
2025-05-30 19:25:44 -07:00
Chris
f65bee9453
Merge pull request #40 from DumbWareio/fix/sanitize-file-names
Add filename sanitization on upload on front and backend
2025-05-30 18:41:19 -07:00
gitmotion
5f4551c7e1 Add filename sanitization on upload on front and backend 2025-05-30 18:37:10 -07:00
gitmotion
13268428b5 Add globalHandlers documentation to .cursorrules 2025-05-30 17:51:41 -07:00
Chris
739ee61b2d
Merge pull request #39 from DumbWareio/enhancement/add-global-handlers
Add globalHandlers class for error logging, response validation, toaster, and getApiBaseUrl
2025-05-30 17:16:08 -07:00
gitmotion
b4974ac56b Add globalHandlers class for error logging, response validation, toaster, and getApiBaseUrl
Add error handling to validateResponse

add comments to globalhandlers for documentation

remove toastmanager from script.js

fix whitespace
2025-05-30 17:10:13 -07:00
Chris
e6c47a1109
Merge pull request #38 from DumbWareio/fix/dashboard-filters-click-listeners
Fix dashboard filters
2025-05-30 15:14:37 -07:00
gitmotion
c3727cb752 gitmotion messed up and ripped out too much code 2025-05-30 15:13:32 -07:00
Chris
1b09814a8d
Merge pull request #37 from DumbWareio/demo-mode-gitmotion
Demo Mode: add demo_mode middleware, global error logger with auto toast, demo banner
2025-05-30 14:40:46 -07:00
gitmotion
0a45fdd855 Demo Mode: add demo_mode middleware, global error logger with auto toast, demo banner
Add demo mode banner

fix spacing

Added Demo_mode env vars and update refreshAllData responses error handling

update usage of await response.text()

Update demo mode error message
2025-05-30 14:39:18 -07:00
abite
dfad8ad68d
UI fixes (#35)
* Update event list color thresholds

Updated dashboard event list threshold to:

Urgent  0-30 days
Warning 30-60 days

in order to match our alert icons in the asset list.

* Fix enter key on mobile

Key Benefits
Mobile compatibility: Mobile keyboards now show "Enter" button correctly
Multiple input methods: Supports Enter key, comma separation, and real-time comma detection
Form safety: Added stopPropagation() to prevent accidental form submissions
Cross-platform consistency: Works identically on desktop and mobile
Better UX: Users can add tags immediately without switching input methods

* Fixed "Component Details" title overlap

Key Benefits
No More Overlap: The Component Details header no longer covers the asset name and back button
Better Space Utilization: Reduced padding and font sizes create more breathing room
Improved Mobile UX: The header is now appropriately sized for mobile screens
Maintained Functionality: All buttons and text remain clearly visible and clickable
Responsive Design: The changes only apply on mobile (max-width: 853px) and don't affect desktop layout
2025-05-29 23:04:36 -05:00
Chris
ada7f44f6f
Merge pull request #32 from DumbWareio/fix/clearbtn-overload-optimizations
Fix clearfilterbtn overload, optimize settings to cache fetched settings to localStorage, ignore data folder in development
2025-05-29 17:30:37 -07:00
gitmotion
b56a9d8156 Fix clearfilterbtn overload, optimize settings to cache fetched settings to localStorage, ignore data folder in development 2025-05-29 17:28:57 -07:00
Chris
07facdadcb
Merge pull request #31 from DumbWareio/fix/styles-fix
Fix/styles fix
2025-05-29 12:38:46 -07:00
gitmotion
c381b88690 Add event date and type fix
remove duplicate comment
2025-05-29 12:37:58 -07:00
gitmotion
be5b158a2a Apply quick fix 2025-05-29 12:36:28 -07:00
Chris
a5711ff857
Merge pull request #30 from DumbWareio/fix/events-grid-spacing
Adjust events grid spacing across different dimensions
2025-05-29 12:25:55 -07:00
gitmotion
01952cf90f Adjust events grid spacing across different dimensions 2025-05-29 12:22:31 -07:00