feat(search): add settings search to the command palette (#12111)

This commit is contained in:
Andras Bacsai
2026-10-07 13:24:21 +02:00
committed by GitHub
parent 38861e1394
commit 522ed390ce
25 changed files with 883 additions and 281 deletions
+307 -137
View File
@@ -3,7 +3,10 @@
namespace App\Livewire;
use App\Models\Application;
use App\Models\CloudInitScript;
use App\Models\CloudProviderToken;
use App\Models\Environment;
use App\Models\IntegrationToken;
use App\Models\Project;
use App\Models\Server;
use App\Models\Service;
@@ -16,6 +19,7 @@ use App\Models\StandaloneMysql;
use App\Models\StandalonePostgresql;
use App\Models\StandaloneRedis;
use App\Models\StandaloneSqlite;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Cache;
use Livewire\Component;
@@ -252,7 +256,7 @@ class GlobalSearch extends Component
// Try to get from Redis cache first
$cacheKey = self::getCacheKey(auth()->user()->currentTeam()->id);
$this->allSearchableItems = Cache::remember($cacheKey, 300, function () {
$resources = Cache::remember($cacheKey, 300, function () {
$items = collect();
$team = auth()->user()->currentTeam();
@@ -617,143 +621,8 @@ class GlobalSearch extends Component
];
});
// Add navigation routes
$navigation = collect([
[
'name' => 'Dashboard',
'type' => 'navigation',
'description' => 'Go to main dashboard',
'link' => route('dashboard'),
'search_text' => 'dashboard home main overview',
],
[
'name' => 'Servers',
'type' => 'navigation',
'description' => 'View all servers',
'link' => route('server.index'),
'search_text' => 'servers all list view',
],
[
'name' => 'Projects',
'type' => 'navigation',
'description' => 'View all projects',
'link' => route('project.index'),
'search_text' => 'projects all list view',
],
[
'name' => 'Destinations',
'type' => 'navigation',
'description' => 'View all destinations',
'link' => route('destination.index'),
'search_text' => 'destinations docker networks',
],
[
'name' => 'Security',
'type' => 'navigation',
'description' => 'Manage private keys and API tokens',
'link' => route('security.private-key.index'),
'search_text' => 'security private keys ssh api tokens cloud-init scripts',
],
[
'name' => 'Cloud-Init Scripts',
'type' => 'navigation',
'description' => 'Manage reusable cloud-init scripts',
'link' => route('security.cloud-init-scripts'),
'search_text' => 'cloud-init scripts cloud init cloudinit initialization startup server setup',
],
[
'name' => 'Sources',
'type' => 'navigation',
'description' => 'Manage GitHub apps and Git sources',
'link' => route('source.all'),
'search_text' => 'sources github apps git repositories',
],
[
'name' => 'Storages',
'type' => 'navigation',
'description' => 'Manage S3 storage for backups',
'link' => route('storage.index'),
'search_text' => 'storages s3 backups',
],
[
'name' => 'Shared Variables',
'type' => 'navigation',
'description' => 'View all shared variables',
'link' => route('shared-variables.index'),
'search_text' => 'shared variables environment all',
],
[
'name' => 'Team Shared Variables',
'type' => 'navigation',
'description' => 'Manage team-wide shared variables',
'link' => route('shared-variables.team.index'),
'search_text' => 'shared variables team environment',
],
[
'name' => 'Project Shared Variables',
'type' => 'navigation',
'description' => 'Manage project shared variables',
'link' => route('shared-variables.project.index'),
'search_text' => 'shared variables project environment',
],
[
'name' => 'Environment Shared Variables',
'type' => 'navigation',
'description' => 'Manage environment shared variables',
'link' => route('shared-variables.environment.index'),
'search_text' => 'shared variables environment',
],
[
'name' => 'Tags',
'type' => 'navigation',
'description' => 'View resources by tags',
'link' => route('tags.show'),
'search_text' => 'tags labels organize',
],
[
'name' => 'Terminal',
'type' => 'navigation',
'description' => 'Access server terminal',
'link' => route('terminal'),
'search_text' => 'terminal ssh console shell command line',
],
[
'name' => 'Profile',
'type' => 'navigation',
'description' => 'Manage your profile and preferences',
'link' => route('profile'),
'search_text' => 'profile account user settings preferences',
],
[
'name' => 'Team',
'type' => 'navigation',
'description' => 'Manage team members and settings',
'link' => route('team.index'),
'search_text' => 'team settings members users invitations',
],
[
'name' => 'Notifications',
'type' => 'navigation',
'description' => 'Configure email, Discord, Telegram notifications',
'link' => route('notifications.email'),
'search_text' => 'notifications alerts email discord telegram slack pushover',
],
]);
// Add instance settings only for self-hosted and root team
if (! isCloud() && $team->id === 0) {
$navigation->push([
'name' => 'Settings',
'type' => 'navigation',
'description' => 'Instance settings and configuration',
'link' => route('settings.index'),
'search_text' => 'settings configuration instance',
]);
}
// Merge all collections
$items = $items->merge($navigation)
->merge($applications)
$items = $items->merge($applications)
->merge($services)
->merge($databases)
->merge($servers)
@@ -762,6 +631,307 @@ class GlobalSearch extends Component
return $items->toArray();
});
// Navigation depends on the user's permissions, so it is not part of the team-wide cache
$this->allSearchableItems = $this->navigationItems()->merge($resources)->values()->all();
}
private function navigationItems(): Collection
{
$user = auth()->user();
$team = $user->currentTeam();
// Add navigation routes
$navigation = collect([
[
'name' => 'Dashboard',
'type' => 'navigation',
'description' => 'Go to main dashboard',
'link' => route('dashboard'),
'search_text' => 'dashboard home main overview',
],
[
'name' => 'Servers',
'type' => 'navigation',
'description' => 'View all servers',
'link' => route('server.index'),
'search_text' => 'servers all list view',
],
[
'name' => 'Projects',
'type' => 'navigation',
'description' => 'View all projects',
'link' => route('project.index'),
'search_text' => 'projects all list view',
],
[
'name' => 'Destinations',
'type' => 'navigation',
'description' => 'View all destinations',
'link' => route('destination.index'),
'search_text' => 'destinations docker networks',
],
[
'name' => 'Security',
'type' => 'navigation',
'description' => 'Manage private keys and API tokens',
'link' => route('security.private-key.index'),
'search_text' => 'security private keys ssh api tokens cloud-init scripts',
],
$user->can('viewAny', CloudInitScript::class) ? [
'name' => 'Cloud-Init Scripts',
'type' => 'navigation',
'description' => 'Manage reusable cloud-init scripts',
'link' => route('security.cloud-init-scripts'),
'search_text' => 'cloud-init scripts cloud init cloudinit initialization startup server setup',
] : null,
[
'name' => 'Sources',
'type' => 'navigation',
'description' => 'Manage GitHub apps and Git sources',
'link' => route('source.all'),
'search_text' => 'sources github apps git repositories',
],
[
'name' => 'Storages',
'type' => 'navigation',
'description' => 'Manage S3 storage for backups',
'link' => route('storage.index'),
'search_text' => 'storages s3 backups',
],
[
'name' => 'Shared Variables',
'type' => 'navigation',
'description' => 'View all shared variables',
'link' => route('shared-variables.index'),
'search_text' => 'shared variables environment all',
],
[
'name' => 'Team Shared Variables',
'type' => 'navigation',
'description' => 'Manage team-wide shared variables',
'link' => route('shared-variables.team.index'),
'search_text' => 'shared variables team environment',
],
[
'name' => 'Project Shared Variables',
'type' => 'navigation',
'description' => 'Manage project shared variables',
'link' => route('shared-variables.project.index'),
'search_text' => 'shared variables project environment',
],
[
'name' => 'Environment Shared Variables',
'type' => 'navigation',
'description' => 'Manage environment shared variables',
'link' => route('shared-variables.environment.index'),
'search_text' => 'shared variables environment',
],
[
'name' => 'Tags',
'type' => 'navigation',
'description' => 'View resources by tags',
'link' => route('tags.show'),
'search_text' => 'tags labels organize',
],
$user->can('canAccessTerminal') ? [
'name' => 'Terminal',
'type' => 'navigation',
'description' => 'Access server terminal',
'link' => route('terminal'),
'search_text' => 'terminal ssh console shell command line',
] : null,
[
'name' => 'Profile',
'type' => 'navigation',
'description' => 'Manage your profile and preferences',
'link' => route('profile'),
'search_text' => 'profile account user settings preferences',
],
[
'name' => 'Team',
'type' => 'navigation',
'description' => 'Manage team members and settings',
'link' => route('team.index'),
'search_text' => 'team settings members users invitations',
],
[
'name' => 'Notifications',
'type' => 'navigation',
'description' => 'Configure email, Discord, Telegram notifications',
'link' => route('notifications.email'),
'search_text' => 'notifications alerts email discord telegram slack pushover',
],
[
'name' => 'Analytics',
'type' => 'navigation',
'description' => 'View traffic analytics for your servers',
'link' => route('analytics'),
'search_text' => 'analytics traffic requests visitors metrics',
],
$user->isAdmin() ? [
'name' => 'Registries',
'type' => 'navigation',
'description' => 'Manage Docker registry credentials',
'link' => route('registries.index'),
'search_text' => 'registries docker registry credentials login private images',
] : null,
[
'name' => 'Server Shared Variables',
'type' => 'navigation',
'description' => 'Manage server shared variables',
'link' => route('shared-variables.server.index'),
'search_text' => 'shared variables server environment',
],
[
'name' => 'Team Members',
'type' => 'navigation',
'description' => 'Manage team members and invitations',
'link' => route('team.member.index'),
'search_text' => 'team members users invitations invite roles',
],
$user->isAdminOfTeam($team->id) ? [
'name' => 'Team Audit Log',
'type' => 'navigation',
'description' => 'View team activity history',
'link' => route('team.audit-log'),
'search_text' => 'team audit log activity history events',
] : null,
isInstanceAdmin() ? [
'name' => 'Team Admin View',
'type' => 'navigation',
'description' => 'Manage all users of this instance',
'link' => route('team.admin-view'),
'search_text' => 'team admin view users instance delete',
] : null,
$user->can('delete', $team) ? [
'name' => 'Team Danger Zone',
'type' => 'navigation',
'description' => 'Delete this team',
'link' => route('team.danger-zone'),
'search_text' => 'team danger zone delete remove',
] : null,
[
'name' => 'API Tokens',
'type' => 'navigation',
'description' => 'Manage API tokens',
'link' => route('security.api-tokens'),
'search_text' => 'security api tokens personal access token',
],
$user->can('viewAny', CloudProviderToken::class) ? [
'name' => 'Cloud Tokens',
'type' => 'navigation',
'description' => 'Manage cloud provider tokens',
'link' => route('security.cloud-tokens'),
'search_text' => 'security cloud provider tokens hetzner digitalocean',
] : null,
$user->can('viewAny', IntegrationToken::class) ? [
'name' => 'Integration Tokens',
'type' => 'navigation',
'description' => 'Manage integration tokens',
'link' => route('security.integration-tokens'),
'search_text' => 'security integration tokens',
] : null,
[
'name' => 'Discord Notifications',
'type' => 'navigation',
'description' => 'Configure Discord notifications',
'link' => route('notifications.discord'),
'search_text' => 'notifications alerts discord webhook',
],
[
'name' => 'Telegram Notifications',
'type' => 'navigation',
'description' => 'Configure Telegram notifications',
'link' => route('notifications.telegram'),
'search_text' => 'notifications alerts telegram bot',
],
[
'name' => 'Slack Notifications',
'type' => 'navigation',
'description' => 'Configure Slack notifications',
'link' => route('notifications.slack'),
'search_text' => 'notifications alerts slack webhook',
],
[
'name' => 'Pushover Notifications',
'type' => 'navigation',
'description' => 'Configure Pushover notifications',
'link' => route('notifications.pushover'),
'search_text' => 'notifications alerts pushover',
],
[
'name' => 'Webhook Notifications',
'type' => 'navigation',
'description' => 'Configure webhook notifications',
'link' => route('notifications.webhook'),
'search_text' => 'notifications alerts webhook http',
],
[
'name' => 'Appearance',
'type' => 'navigation',
'description' => 'Change theme and display preferences',
'link' => route('profile.appearance'),
'search_text' => 'profile appearance theme dark light mode preferences',
],
isCloud() && $user->isAdmin() ? [
'name' => 'Subscription',
'type' => 'navigation',
'description' => 'Manage your subscription and billing',
'link' => route('subscription.show'),
'search_text' => 'subscription billing plan payment invoices',
] : null,
])->filter();
// Add instance settings only for self-hosted and root team
if (! isCloud() && $team->id === 0) {
$navigation->push(
[
'name' => 'Settings',
'type' => 'navigation',
'description' => 'Instance settings and configuration',
'link' => route('settings.index'),
'search_text' => 'settings general configuration instance url domain name timezone public ip https redirect',
],
[
'name' => 'Advanced Settings',
'type' => 'navigation',
'description' => 'Registration, API access, MCP server, DNS validation and telemetry',
'link' => route('settings.advanced'),
'search_text' => 'settings advanced registration api access allowed ips mcp server dns validation custom dns domain connect confirmation telemetry sponsorship cdn',
],
[
'name' => 'Update Settings',
'type' => 'navigation',
'description' => 'Configure Coolify auto updates',
'link' => route('settings.updates'),
'search_text' => 'settings updates auto update upgrade version frequency',
],
[
'name' => 'Instance Backup',
'type' => 'navigation',
'description' => 'Back up the Coolify instance database',
'link' => route('settings.backup'),
'search_text' => 'settings instance backup coolify database restore',
],
[
'name' => 'Instance Email',
'type' => 'navigation',
'description' => 'Configure SMTP or Resend for system emails',
'link' => route('settings.email'),
'search_text' => 'settings instance email smtp resend transactional mail',
],
[
'name' => 'Authentication',
'type' => 'navigation',
'description' => 'Configure OAuth login providers',
'link' => route('settings.oauth'),
'search_text' => 'settings authentication oauth sso login providers github google gitlab azure',
],
);
}
return $navigation;
}
private function search()