mirror of
https://github.com/MrUnknownDE/panel.git
synced 2026-04-22 00:03:46 +02:00
Complete implementation of new Server model.
This commit is contained in:
@@ -96,11 +96,27 @@ class Node extends Model
|
||||
return self::$nodes[$id];
|
||||
}
|
||||
|
||||
/**
|
||||
* Return an instance of the Guzzle client for this specific node.
|
||||
*
|
||||
* @return \GuzzleHttp\Client
|
||||
*/
|
||||
public function guzzleClient($headers = [])
|
||||
{
|
||||
return new Client([
|
||||
'base_uri' => sprintf('%s://%s:%s/', $this->scheme, $this->fqdn, $this->daemonListen),
|
||||
'timeout' => env('GUZZLE_TIMEOUT', 5.0),
|
||||
'connect_timeout' => env('GUZZLE_CONNECT_TIMEOUT', 3.0),
|
||||
'headers' => $headers,
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a Guzzle Client for the node in question.
|
||||
*
|
||||
* @param int $node
|
||||
* @return \GuzzleHttp\Client
|
||||
* @deprecated
|
||||
*/
|
||||
public static function guzzleRequest($node)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user