mirror of
https://github.com/pelican-dev/panel.git
synced 2025-05-29 09:44:45 +02:00
Merge pull request #108 from NeonSpectrum/fix/daemon-http-params
Fix missed adjustments on http parameters
This commit is contained in:
commit
89b6f70cde
@ -28,9 +28,7 @@ class DaemonFileRepository extends DaemonRepository
|
||||
try {
|
||||
$response = $this->getHttpClient()->get(
|
||||
sprintf('/api/servers/%s/files/contents', $this->server->uuid),
|
||||
[
|
||||
'query' => ['file' => $path],
|
||||
]
|
||||
['file' => $path]
|
||||
);
|
||||
} catch (ClientException|TransferException $exception) {
|
||||
throw new DaemonConnectionException($exception);
|
||||
@ -55,13 +53,10 @@ class DaemonFileRepository extends DaemonRepository
|
||||
Assert::isInstanceOf($this->server, Server::class);
|
||||
|
||||
try {
|
||||
return $this->getHttpClient()->post(
|
||||
sprintf('/api/servers/%s/files/write', $this->server->uuid),
|
||||
[
|
||||
'query' => ['file' => $path],
|
||||
'body' => $content,
|
||||
]
|
||||
);
|
||||
return $this->getHttpClient()
|
||||
->withQueryParameters(['file' => $path])
|
||||
->withBody($content)
|
||||
->post(sprintf('/api/servers/%s/files/write', $this->server->uuid));
|
||||
} catch (TransferException $exception) {
|
||||
throw new DaemonConnectionException($exception);
|
||||
}
|
||||
@ -79,9 +74,7 @@ class DaemonFileRepository extends DaemonRepository
|
||||
try {
|
||||
$response = $this->getHttpClient()->get(
|
||||
sprintf('/api/servers/%s/files/list-directory', $this->server->uuid),
|
||||
[
|
||||
'query' => ['directory' => $path],
|
||||
]
|
||||
['directory' => $path]
|
||||
);
|
||||
} catch (TransferException $exception) {
|
||||
throw new DaemonConnectionException($exception);
|
||||
@ -125,10 +118,8 @@ class DaemonFileRepository extends DaemonRepository
|
||||
return $this->getHttpClient()->put(
|
||||
sprintf('/api/servers/%s/files/rename', $this->server->uuid),
|
||||
[
|
||||
'json' => [
|
||||
'root' => $root ?? '/',
|
||||
'files' => $files,
|
||||
],
|
||||
'root' => $root ?? '/',
|
||||
'files' => $files,
|
||||
]
|
||||
);
|
||||
} catch (TransferException $exception) {
|
||||
@ -275,9 +266,7 @@ class DaemonFileRepository extends DaemonRepository
|
||||
try {
|
||||
return $this->getHttpClient()->post(
|
||||
sprintf('/api/servers/%s/files/pull', $this->server->uuid),
|
||||
[
|
||||
array_filter($attributes, fn ($value) => !is_null($value)),
|
||||
]
|
||||
array_filter($attributes, fn ($value) => !is_null($value))
|
||||
);
|
||||
} catch (TransferException $exception) {
|
||||
throw new DaemonConnectionException($exception);
|
||||
|
@ -147,7 +147,7 @@ class DaemonServerRepository extends DaemonRepository
|
||||
try {
|
||||
$this->getHttpClient()
|
||||
->post(sprintf('/api/servers/%s/ws/deny', $this->server->uuid), [
|
||||
'json' => ['jtis' => $jtis],
|
||||
'jtis' => $jtis,
|
||||
]);
|
||||
} catch (TransferException $exception) {
|
||||
throw new DaemonConnectionException($exception);
|
||||
|
Loading…
x
Reference in New Issue
Block a user