Commit graph

134 commits

Author SHA1 Message Date
Andras Bacsai
ce12c94709 fix: prevent duplicate services on image change and enable real-time UI refresh
This commit addresses two critical issues with Docker Compose service management:

## Issue 1: Duplicate Services Created on Image Change
When changing the image in a docker-compose file, the parser was creating new
ServiceApplication/ServiceDatabase records instead of updating existing ones.

**Root Cause**: The parsers used `firstOrCreate()` with `['name', 'image', 'service_id']`,
meaning any image change would create a new record.

**Fix**: Remove `image` from `firstOrCreate()` queries and update it separately after
finding or creating the service record.

**Changes**:
- `bootstrap/helpers/parsers.php` (serviceParser v3): Fixed in presave loop (lines 1188-1203)
  and main parsing loop (lines 1519-1539)
- `bootstrap/helpers/shared.php` (parseDockerComposeFile v2): Fixed null check logic
  (lines 1308-1348)

## Issue 2: UI Not Refreshing After Changes
When compose file or domain was modified, the Configuration component wasn't receiving
events to refresh its data, requiring manual page refresh to see updates.

**Root Cause**: The Configuration component wasn't listening for refresh events dispatched
by child components (StackForm, EditDomain).

**Fix**: Add event listeners and dispatchers to enable real-time UI updates.

**Changes**:
- `app/Livewire/Project/Service/Configuration.php`: Added listeners for `refreshServices`
  and `refresh` events (lines 36-37)
- `app/Livewire/Project/Service/EditDomain.php`: Added `refreshServices` dispatch (line 76)
- Note: `app/Livewire/Project/Service/StackForm.php` already had the dispatch

## Tests Added
- `tests/Unit/ServiceParserImageUpdateTest.php`: 4 tests verifying no duplicates created
- `tests/Unit/ServiceConfigurationRefreshTest.php`: 4 tests verifying event dispatching

All 8 new tests pass, and all existing unit tests continue to pass.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-14 10:12:36 +02:00
Andras Bacsai
b4cfb78f86 feat(storage): add read-only volume handling and UI notifications
- Introduced `isReadOnlyVolume` method in `LocalFileVolume` and `LocalPersistentVolume` models to determine if a volume is read-only based on Docker Compose configuration.
- Updated `FileStorage` and `Show` components to set `isReadOnly` state during mounting.
- Enhanced UI to display notifications for read-only volumes, preventing modification actions in the interface.
- Refactored file storage and directory management forms to conditionally enable or disable actions based on read-only status.
2025-10-03 20:05:43 +02:00
Andras Bacsai
ce5555ca9f feat(storage): consolidate storage management into a single component with enhanced UI
- Merged the storage management functionalities into the Storage component, replacing the previous Add component.
- Introduced new methods for submitting persistent volumes, file mounts, and directory mounts, improving code organization and maintainability.
- Enhanced the UI with modals for adding volumes, files, and directories, providing a more intuitive user experience.
- Updated validation rules and error handling for improved robustness during storage submissions.
- Removed deprecated Add component and associated views to streamline the codebase.
2025-10-01 18:46:21 +02:00
Andras Bacsai
25a7be23a9 ui(storage): enhance file storage management with new properties and UI improvements
- Added properties to manage file and directory counts, improving data handling in the Livewire component.
- Updated the file storage view to include a tabbed interface for volumes, files, and directories, enhancing user navigation.
- Improved UI layout for better readability and user experience, including consistent styling and informative messages.
2025-10-01 08:23:21 +02:00
QarthO
bfc8a25b72 move domain trimming before URL validation 2025-08-29 09:09:03 -04:00
Andras Bacsai
80499a03d8 feat(domains): implement domain conflict detection and user confirmation modal across application components 2025-08-28 10:52:41 +02:00
Andras Bacsai
e0aa28ba31 refactor(domains): rename check_domain_usage to checkDomainUsage and update references across the application 2025-08-28 10:00:19 +02:00
Andras Bacsai
63fcc0ebc3 feat(acl): Change views/backend code to able to use proper ACL's later on. Currently it is not enabled. 2025-08-26 10:27:38 +02:00
Andras Bacsai
5c4a265542 refactor(validation): implement centralized validation patterns across components
- Introduced `ValidationPatterns` class to standardize validation rules and messages for various fields across multiple components.
- Updated components including `General`, `StackForm`, `Create`, and `Show` to utilize the new validation patterns, ensuring consistent validation logic.
- Enhanced error messages for required fields and added regex validation for names and descriptions to improve user feedback.
- Adjusted styling in the `create.blade.php` view for better visual hierarchy.
2025-08-19 14:15:31 +02:00
Andras Bacsai
13a9816770 fix(service): ensure configuration changes are properly tracked and dispatched 2025-07-03 15:08:13 +02:00
Andras Bacsai
8fc79022f3 feat(service): enhance service status handling and UI updates 2025-06-24 12:52:22 +02:00
Andras Bacsai
58be59a7b3 refactor(service): remove informational dispatch during service stop for cleaner execution 2025-05-29 11:11:49 +02:00
peaklabs-dev
cb41670af9
refactor(ui): show toast when server does not work and on stop 2025-05-20 15:22:13 +02:00
Andras Bacsai
35b08453e1 refactor(service): consolidate configuration change dispatch logic and remove unused navbar component 2025-05-20 11:15:31 +02:00
Andras Bacsai
2424bd408b
Update app/Livewire/Project/Service/Heading.php
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2025-05-20 11:15:07 +02:00
peaklabs-dev
79e620eac5
fix(ui): add back missing service navbar components 2025-05-19 23:35:17 +02:00
Andras Bacsai
786bfa960f improvement(core): simplify events for app/db/service status changes 2025-05-19 21:50:32 +02:00
Andras Bacsai
ed0961e0dc refactor(database): enhance application conversion logic and add existence checks for databases and applications 2025-04-30 18:30:33 +02:00
Andras Bacsai
0a1a403940
Update app/Livewire/Project/Service/Database.php
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2025-04-30 18:26:43 +02:00
Andras Bacsai
114fafb270 refactor(database): update DB facade usage for consistency across service files 2025-04-30 17:39:41 +02:00
Andras Bacsai
fe24296de7 feat(backup): implement custom database type selection and enhance scheduled backups management 2025-04-30 16:44:44 +02:00
Andras Bacsai
d8c3418e72 feat(Service): Add functionality to convert between applications and databases in docker-compose based applications
fix(ui): Fix service layout refresh on compose change
2025-04-29 14:27:17 +02:00
Andras Bacsai
65be880d70 fix(ui): Change application image validation to be nullable in service application view 2025-04-29 09:23:26 +02:00
Andras Bacsai
7686ebfd6c refactor(file-storage): add loadStorageOnServer method for improved error handling 2025-03-28 21:05:34 +01:00
Andras Bacsai
d894c3d903 feat(database): implement two-step confirmation for database deletion
Added a new delete method in the Database component that includes a two-step confirmation process requiring the user to enter their password. If two-step confirmation is disabled, the deletion proceeds without password verification. Additionally, a confirmation modal has been integrated into the database view to prompt users before deletion, enhancing the safety of this critical operation.
2025-03-12 16:33:35 +01:00
Andras Bacsai
a7318c2d77 fix(domain): dispatch refreshStatus event after successful domain update 2025-03-12 15:37:06 +01:00
Andras Bacsai
f98c58a0a3 fix(ui): Restrict service retrieval to current team 2025-02-27 12:17:23 +01:00
Andras Bacsai
27e4882d57 feat(core): You can validate compose files with docker compose config
fix(core): labels are now accepted with both compose styles
refactor: remove lots of ray's
2025-02-27 11:29:04 +01:00
Andras Bacsai
40ad118492 fix(core): add server functionality check before dispatching container status 2025-02-22 12:51:22 +01:00
Andras Bacsai
6e802f43ba fix(core): update service status refresh event handling 2025-02-17 09:52:18 +01:00
Andras Bacsai
d632eb2be9 refactor: simplify service start and restart workflows 2025-02-04 14:34:34 +01:00
Andras Bacsai
dd2d306abc feat: force deployment of services
fix: added advanced ui dropdown to services
2025-01-13 12:03:03 +01:00
Andras Bacsai
c4a75f4b87 fix: service update statsu 2025-01-13 11:06:10 +01:00
Andras Bacsai
1fe4dd722b Revert "rector: arrrrr"
This reverts commit 16c0cd10d8.
2025-01-07 15:31:43 +01:00
Andras Bacsai
16c0cd10d8 rector: arrrrr 2025-01-07 14:52:08 +01:00
Andras Bacsai
9e3467578f feat: add environment_uuid support and update API documentation
- Introduced `environment_uuid` as a required field in various API endpoints and schemas.
- Updated descriptions to clarify that either `environment_name` or `environment_uuid` must be provided.
- Modified routes and controller methods to accommodate the new UUID parameter.
- Adjusted frontend components to utilize `environment_uuid` for better consistency and clarity.
- Removed deprecated fields related to environment handling.

This change enhances the API's flexibility in identifying environments, improving overall usability.
2024-12-17 13:42:16 +01:00
Andras Bacsai
b7748479d4 fix: service ui structure 2024-12-17 11:13:17 +01:00
Andras Bacsai
4901b12279 fix: service status indicator + oauth saving 2024-12-13 12:03:10 +01:00
Andras Bacsai
7fb1a1fc75 fix: use Auth(), add new db proxy stop event refactor clickhouse view 2024-11-04 14:18:16 +01:00
Lucas Michot
8e1444eaa7 Get rid of many useless blank lines 2024-10-31 17:44:01 +01:00
Lucas Michot
b1d04912a0 Remove all useless catch block useless variables. 2024-10-31 15:19:37 +01:00
Lucas Michot
d557a22b91 Remove all ray() calls 2024-10-28 13:51:23 +01:00
peaklabs-dev
ff60189285
fix 2 step confirmation password is now checked if it is enabled 2024-10-24 16:20:01 +02:00
peaklabs-dev
6dfe6a8142
fix disable tow step confirmation when there is a password 2024-10-22 12:29:48 +02:00
Andras Bacsai
97aab8ba28 feat: show warning if people would like to use sslip with https 2024-10-20 22:26:30 +02:00
Andras Bacsai
b75c2dc604 pint 2024-10-17 22:08:23 +02:00
Andras Bacsai
88f1e58c63 feat: required envs 2024-10-11 14:38:22 +02:00
Andras Bacsai
24eaa2c9b2 fix: sanitize and validate application domains 2024-10-11 10:14:27 +02:00
Andras Bacsai
9330a3f354 feat: add customHelper to stack-form 2024-10-10 13:28:42 +02:00
Andras Bacsai
0e2889b857 improvement: Add link to duplicate domain
fix: duplicate domain error
fix: remove fqdn constraint from db, because it is checked on app level
2024-10-10 10:24:11 +02:00