Skip to content

feat: admin setting preference#73

Merged
jabibamman merged 4 commits intomasterfrom
feat/admin-setting-preference
Jul 11, 2025
Merged

feat: admin setting preference#73
jabibamman merged 4 commits intomasterfrom
feat/admin-setting-preference

Conversation

@jabibamman
Copy link
Contributor

@jabibamman jabibamman commented Jul 11, 2025

Summary by CodeRabbit

  • New Features

    • Introduced a comprehensive admin system settings interface with categorized tabs for security, system, email, backup, and logging.
    • Added import/export functionality for system settings via a modal dialog.
    • Enabled test email sending and backup configuration/testing from the admin UI.
    • Integrated Element Plus UI library for enhanced interface components.
  • Improvements

    • Centralized system settings state management using a new store.
    • Enhanced localization with expanded English and French translations for system settings and validation messages.
  • Bug Fixes

    • Standardized server state values from 'active/inactive' to 'UP/DOWN' across the app for consistency.
  • Chores

    • Added Docker and PM2 deployment/configuration files.
    • Updated environment and build scripts for improved deployment workflows.
  • Style

    • Improved code formatting and readability in test files.
  • Documentation

    • Updated example environment files to reflect new configuration variables.

@jabibamman jabibamman self-assigned this Jul 11, 2025
@coderabbitai
Copy link

coderabbitai bot commented Jul 11, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

This update introduces a comprehensive system settings management feature for the admin panel, including new Vue components, Pinia store, API integration, and TypeScript types. Server state handling is refactored from 'active'/'inactive' to 'UP'/'DOWN'. Additional improvements include localization updates, Docker/PM2 deployment scripts, and integration of the Element Plus UI library.

Changes

File(s) Change Summary
.env-example, src/features/presence/composables/usePresenceSocket.ts, src/features/servers/components/SshTerminal.vue Switched WebSocket URL environment variable from VITE_WS_URL to VITE_API_URL and updated .env-example accordingly.
docker-compose.yml, ecosystem.config.cjs, start-pm2.sh Added Docker Compose and PM2 ecosystem configuration files and a shell script for PM2-based deployment.
package.json, vite.config.ts, src/main.ts Added Element Plus UI, PM2, new scripts, updated dependencies, and specified dev/preview server configs.
src/features/admin/system-settings/api.ts, src/features/admin/system-settings/store.ts, src/features/admin/system-settings/types.ts Introduced API module, Pinia store, and TypeScript types for system settings management.
src/features/admin/system-settings/components/BackupSettings.vue, EmailSettings.vue, ImportExportModal.vue, LoggingSettings.vue, SecuritySettings.vue, SystemSettings.vue Added Vue components for editing system, security, email, backup, and logging settings, plus import/export modal.
src/features/admin/system-settings/views/SystemSettingsView.vue Added main system settings view with tabbed interface and integration with store and import/export modal.
src/features/admin/views/AdminSettingsView.vue Refactored to use centralized Pinia store, added import/export functionality, and improved UI feedback.
src/features/servers/types.ts, src/features/servers/api.ts, src/features/servers/views/ServerCreateView.vue, src/features/servers/views/ServerListView.vue, src/features/servers/components/ServerCard.vue, src/features/servers/components/ServerHeader.vue, src/features/rooms/views/RoomDetails.vue, src/features/setup/components/steps/CreateServerStep.vue Refactored server state from 'active'/'inactive' to 'UP'/'DOWN' in all relevant types, logic, and UI.
src/router/index.ts Changed admin settings route to use the new system settings view component.
src/locales/en.json, src/locales/fr.json Added extensive localization for system settings, new roles, validation messages, and UI labels.
src/features/settings/__tests__/store.spec.ts Made test formatting and style improvements only.

Sequence Diagram(s)

sequenceDiagram
    participant Admin as Admin User
    participant UI as SystemSettingsView.vue
    participant Store as useSystemSettingsStore (Pinia)
    participant API as systemSettingsApi

    Admin->>UI: Navigates to System Settings
    UI->>Store: fetchSettings()
    Store->>API: getSettings()
    API-->>Store: SystemSettingsResponseDto
    Store-->>UI: settings data

    Admin->>UI: Edits settings in tab (e.g., EmailSettings)
    UI->>Store: updateSettings(category data)
    Store->>API: updateSettings(UpdateSystemSettingsDto)
    API-->>Store: SystemSettingsResponseDto
    Store-->>UI: updated settings

    Admin->>UI: Clicks Import/Export
    UI->>Store: importSettings() / exportSettings()
    Store->>API: importSettings()/exportSettings()
    API-->>Store: result
    Store-->>UI: update

    Admin->>UI: Clicks Reset Category
    UI->>Store: resetCategory(category)
    Store->>API: resetCategory()
    API-->>Store: SystemSettingsResponseDto
    Store-->>UI: updated settings
Loading

Suggested labels

enhancement

Poem

A rabbit hops with settings new,
Tabs and toggles—what a view!
Servers UP, no longer down,
Element Plus now decks the town.
Import, export—JSON flies,
Docker, PM2—deploy with wise.
System settings, carrots won,
🥕 All the admin work—well done!


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 80a8f25 and 548cbe9.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (32)
  • .env-example (0 hunks)
  • docker-compose.yml (1 hunks)
  • ecosystem.config.cjs (1 hunks)
  • package.json (3 hunks)
  • src/features/admin/system-settings/api.ts (1 hunks)
  • src/features/admin/system-settings/components/BackupSettings.vue (1 hunks)
  • src/features/admin/system-settings/components/EmailSettings.vue (1 hunks)
  • src/features/admin/system-settings/components/ImportExportModal.vue (1 hunks)
  • src/features/admin/system-settings/components/LoggingSettings.vue (1 hunks)
  • src/features/admin/system-settings/components/SecuritySettings.vue (1 hunks)
  • src/features/admin/system-settings/components/SystemSettings.vue (1 hunks)
  • src/features/admin/system-settings/store.ts (1 hunks)
  • src/features/admin/system-settings/types.ts (1 hunks)
  • src/features/admin/system-settings/views/SystemSettingsView.vue (1 hunks)
  • src/features/admin/views/AdminSettingsView.vue (34 hunks)
  • src/features/presence/composables/usePresenceSocket.ts (1 hunks)
  • src/features/rooms/views/RoomDetails.vue (3 hunks)
  • src/features/servers/api.ts (3 hunks)
  • src/features/servers/components/ServerCard.vue (1 hunks)
  • src/features/servers/components/ServerHeader.vue (1 hunks)
  • src/features/servers/components/SshTerminal.vue (1 hunks)
  • src/features/servers/types.ts (1 hunks)
  • src/features/servers/views/ServerCreateView.vue (1 hunks)
  • src/features/servers/views/ServerListView.vue (3 hunks)
  • src/features/settings/__tests__/store.spec.ts (4 hunks)
  • src/features/setup/components/steps/CreateServerStep.vue (2 hunks)
  • src/locales/en.json (4 hunks)
  • src/locales/fr.json (5 hunks)
  • src/main.ts (1 hunks)
  • src/router/index.ts (1 hunks)
  • start-pm2.sh (1 hunks)
  • vite.config.ts (1 hunks)
✨ Finishing Touches
  • 📝 Generate Docstrings

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@jabibamman jabibamman merged commit f349d76 into master Jul 11, 2025
1 check failed
@jabibamman jabibamman deleted the feat/admin-setting-preference branch July 11, 2025 13:27
@coderabbitai coderabbitai bot mentioned this pull request Jul 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant