diff --git a/extensions/Servers/Proxmox/Http/Controllers/ServerIconController.php b/extensions/Servers/Proxmox/Http/Controllers/ServerIconController.php index dcaa896e9..f3bca2b91 100644 --- a/extensions/Servers/Proxmox/Http/Controllers/ServerIconController.php +++ b/extensions/Servers/Proxmox/Http/Controllers/ServerIconController.php @@ -13,6 +13,7 @@ class ServerIconController $request->validate([ 'icon' => 'nullable|string|max:64', 'color' => 'nullable|string|max:32', + 'prefix' => 'nullable|string|max:32', ]); $server = Server::where('id', $serverId) @@ -21,6 +22,7 @@ class ServerIconController $server->user_set_icon = $request->input('icon'); $server->user_set_icon_color = $request->input('color'); + $server->user_set_icon_prefix = $request->input('prefix', 'ri'); $server->save(); return response()->json(['success' => true]); @@ -34,6 +36,7 @@ class ServerIconController return response()->json([ 'icon' => $server->user_set_icon, 'color' => $server->user_set_icon_color, + 'prefix' => $server->user_set_icon_prefix ?? 'ri', ]); } } diff --git a/extensions/Servers/Proxmox/database/migrations/2025_12_06_150000_add_user_set_icon_prefix_to_ext_proxmox_servers.php b/extensions/Servers/Proxmox/database/migrations/2025_12_06_150000_add_user_set_icon_prefix_to_ext_proxmox_servers.php new file mode 100644 index 000000000..cc8fefa65 --- /dev/null +++ b/extensions/Servers/Proxmox/database/migrations/2025_12_06_150000_add_user_set_icon_prefix_to_ext_proxmox_servers.php @@ -0,0 +1,28 @@ +string('user_set_icon_prefix', 32)->nullable()->after('user_set_icon_color'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('ext_proxmox_servers', function (Blueprint $table) { + $table->dropColumn('user_set_icon_prefix'); + }); + } +}; diff --git a/extensions/Servers/Proxmox/views/components/layout.blade.php b/extensions/Servers/Proxmox/views/components/layout.blade.php index c91be84f4..747abd8c4 100644 --- a/extensions/Servers/Proxmox/views/components/layout.blade.php +++ b/extensions/Servers/Proxmox/views/components/layout.blade.php @@ -41,10 +41,11 @@
user_set_icon . "'" : 'null' }}, - initialColor: {{ $server->user_set_icon_color ? "'" . $server->user_set_icon_color . "'" : 'null' }} + initialColor: {{ $server->user_set_icon_color ? "'" . $server->user_set_icon_color . "'" : 'null' }}, + initialPrefix: {{ $server->user_set_icon_prefix ? "'" . $server->user_set_icon_prefix . "'" : "'ri'" }} })"> @endforeach
@@ -113,10 +284,11 @@