feat: add server tag retrieval and available colors endpoints
This commit is contained in:
@@ -8,6 +8,26 @@ use Paymenter\Extensions\Servers\Proxmox\Models\Server;
|
||||
|
||||
class ServerTagController
|
||||
{
|
||||
/**
|
||||
* Get tags for a server
|
||||
*/
|
||||
public function show($serverId)
|
||||
{
|
||||
$server = Server::where('id', $serverId)
|
||||
->where('user_id', Auth::id())
|
||||
->firstOrFail();
|
||||
|
||||
return response()->json([
|
||||
'success' => true,
|
||||
'tag1' => $server->tag1,
|
||||
'tag1color' => $server->tag1color,
|
||||
'tag2' => $server->tag2,
|
||||
'tag2color' => $server->tag2color,
|
||||
'tag3' => $server->tag3,
|
||||
'tag3color' => $server->tag3color,
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update tags for a server
|
||||
*/
|
||||
@@ -34,4 +54,19 @@ class ServerTagController
|
||||
], 500);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get available tag colors
|
||||
*/
|
||||
public function colors()
|
||||
{
|
||||
return response()->json([
|
||||
'success' => true,
|
||||
'colors' => [
|
||||
'#e74c3c', '#e67e22', '#f1c40f', '#2ecc71', '#1abc9c', '#3498db',
|
||||
'#9b59b6', '#e91e63', '#00bcd4', '#8bc34a', '#ff5722', '#607d8b',
|
||||
'#795548', '#9e9e9e', '#673ab7', '#4caf50'
|
||||
],
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user