+
+
diff --git a/resources/views/livewire/columns/server-entry-column.blade.php b/resources/views/livewire/columns/server-entry-column.blade.php
new file mode 100644
index 000000000..332b1a988
--- /dev/null
+++ b/resources/views/livewire/columns/server-entry-column.blade.php
@@ -0,0 +1,8 @@
+@php
+ /** @var \App\Models\Server $server */
+ $server = $getRecord();
+@endphp
+
+
+ @livewire('server-entry', ['server' => $server, 'lazy' => true], key($server->id))
+
\ No newline at end of file
diff --git a/resources/views/tables/columns/server-entry-column.blade.php b/resources/views/livewire/server-entry.blade.php
similarity index 73%
rename from resources/views/tables/columns/server-entry-column.blade.php
rename to resources/views/livewire/server-entry.blade.php
index 152db35b6..6f4b25775 100644
--- a/resources/views/tables/columns/server-entry-column.blade.php
+++ b/resources/views/livewire/server-entry.blade.php
@@ -1,25 +1,11 @@
-@php
- use App\Enums\ServerResourceType;
-
- /** @var \App\Models\Server $server */
- $server = $getRecord();
-@endphp
-
-
-
-
-
-
+
+
-
+
{{ $server->name }}
- ({{ $server->formatResource('uptime', type: ServerResourceType::Time) }})
+ ({{ $server->formatResource('uptime', type: \App\Enums\ServerResourceType::Time) }})
CPU
-
{{ $server->formatResource('cpu_absolute', type: ServerResourceType::Percentage) }}
+
{{ $server->formatResource('cpu_absolute', type: \App\Enums\ServerResourceType::Percentage) }}
-
{{ $server->formatResource('cpu', type: ServerResourceType::Percentage, limit: true) }}
+
{{ $server->formatResource('cpu', type: \App\Enums\ServerResourceType::Percentage, limit: true) }}
Memory
@@ -59,5 +45,11 @@
-
-
+
+
+
+
\ No newline at end of file
diff --git a/routes/api-client.php b/routes/api-client.php
index 0feceeb78..c5ab1d3ba 100644
--- a/routes/api-client.php
+++ b/routes/api-client.php
@@ -129,6 +129,7 @@ Route::prefix('/servers/{server:uuid}')->middleware([ServerSubject::class, Authe
Route::prefix('/settings')->group(function () {
Route::post('/rename', [Client\Servers\SettingsController::class, 'rename']);
+ Route::post('/description', [Client\Servers\SettingsController::class, 'description']);
Route::post('/reinstall', [Client\Servers\SettingsController::class, 'reinstall']);
Route::put('/docker-image', [Client\Servers\SettingsController::class, 'dockerImage']);
});
diff --git a/storage/app/packs/.githold b/storage/app/packs/.githold
deleted file mode 100755
index e69de29bb..000000000
diff --git a/tests/Feature/SettingsControllerTest.php b/tests/Feature/SettingsControllerTest.php
index c1850489e..769ffa18f 100644
--- a/tests/Feature/SettingsControllerTest.php
+++ b/tests/Feature/SettingsControllerTest.php
@@ -41,7 +41,7 @@ it('server description can be changed', function () {
expect()->toLogActivities(1)
->and($logged->properties['old'])->toBe($originalDescription)
->and($logged->properties['new'])->toBe($newDescription)
- ->and($server->description)->not()->toBe($originalDescription);
+ ->and($server->description)->toBe($newDescription);
});
it('server description cannot be changed', function () {
@@ -53,7 +53,7 @@ it('server description cannot be changed', function () {
->post("/api/client/servers/$server->uuid/settings/description", [
'description' => 'Test Description',
])
- ->assertStatus(Response::HTTP_NO_CONTENT);
+ ->assertStatus(Response::HTTP_FORBIDDEN);
$server = $server->refresh();
expect()->toLogActivities(0)
diff --git a/tests/Integration/Api/Client/Server/SettingsControllerTest.php b/tests/Integration/Api/Client/Server/SettingsControllerTest.php
index a0a722651..ded84ce1d 100644
--- a/tests/Integration/Api/Client/Server/SettingsControllerTest.php
+++ b/tests/Integration/Api/Client/Server/SettingsControllerTest.php
@@ -21,11 +21,9 @@ class SettingsControllerTest extends ClientApiIntegrationTestCase
/** @var \App\Models\Server $server */
[$user, $server] = $this->generateTestAccount($permissions);
$originalName = $server->name;
- $originalDescription = $server->description;
$response = $this->actingAs($user)->postJson("/api/client/servers/$server->uuid/settings/rename", [
'name' => '',
- 'description' => '',
]);
$response->assertStatus(Response::HTTP_UNPROCESSABLE_ENTITY);
@@ -33,18 +31,15 @@ class SettingsControllerTest extends ClientApiIntegrationTestCase
$server = $server->refresh();
$this->assertSame($originalName, $server->name);
- $this->assertSame($originalDescription, $server->description);
$this->actingAs($user)
->postJson("/api/client/servers/$server->uuid/settings/rename", [
'name' => 'Test Server Name',
- 'description' => 'This is a test server.',
])
->assertStatus(Response::HTTP_NO_CONTENT);
$server = $server->refresh();
$this->assertSame('Test Server Name', $server->name);
- $this->assertSame('This is a test server.', $server->description);
}
/**
diff --git a/tests/Integration/Services/Backups/DeleteBackupServiceTest.php b/tests/Integration/Services/Backups/DeleteBackupServiceTest.php
index d280a95c7..8c0ac8ad2 100644
--- a/tests/Integration/Services/Backups/DeleteBackupServiceTest.php
+++ b/tests/Integration/Services/Backups/DeleteBackupServiceTest.php
@@ -2,10 +2,8 @@
namespace App\Tests\Integration\Services\Backups;
-use GuzzleHttp\Psr7\Request;
use GuzzleHttp\Psr7\Response;
use App\Models\Backup;
-use GuzzleHttp\Exception\ClientException;
use App\Extensions\Backups\BackupManager;
use App\Extensions\Filesystem\S3Filesystem;
use App\Services\Backups\DeleteBackupService;
@@ -54,7 +52,7 @@ class DeleteBackupServiceTest extends IntegrationTestCase
$backup = Backup::factory()->create(['server_id' => $server->id]);
$mock = $this->mock(DaemonBackupRepository::class);
- $mock->expects('setServer->delete')->with($backup)->andThrow(new ConnectionException(previous: new ClientException('', new Request('DELETE', '/'), new Response(404))));
+ $mock->expects('setServer->delete')->with($backup)->andThrow(new ConnectionException(code: 404));
$this->app->make(DeleteBackupService::class)->handle($backup);
@@ -69,7 +67,7 @@ class DeleteBackupServiceTest extends IntegrationTestCase
$backup = Backup::factory()->create(['server_id' => $server->id]);
$mock = $this->mock(DaemonBackupRepository::class);
- $mock->expects('setServer->delete')->with($backup)->andThrow(new ConnectionException(previous: new ClientException('', new Request('DELETE', '/'), new Response(500))));
+ $mock->expects('setServer->delete')->with($backup)->andThrow(new ConnectionException(code: 500));
$this->expectException(ConnectionException::class);
diff --git a/tests/Unit/Helpers/EnvironmentWriterTraitTest.php b/tests/Unit/Helpers/EnvironmentWriterTraitTest.php
deleted file mode 100644
index 4678c0579..000000000
--- a/tests/Unit/Helpers/EnvironmentWriterTraitTest.php
+++ /dev/null
@@ -1,43 +0,0 @@
-escapeEnvironmentValue($input);
-
- $this->assertSame($expected, $output);
- }
-
- public static function variableDataProvider(): array
- {
- return [
- ['foo', 'foo'],
- ['abc123', 'abc123'],
- ['val"ue', '"val\"ue"'],
- ['val\'ue', '"val\'ue"'],
- ['my test value', '"my test value"'],
- ['mysql_p@assword', '"mysql_p@assword"'],
- ['mysql_p#assword', '"mysql_p#assword"'],
- ['mysql p@$$word', '"mysql p@$$word"'],
- ['mysql p%word', '"mysql p%word"'],
- ['mysql p#word', '"mysql p#word"'],
- ['abc_@#test', '"abc_@#test"'],
- ['test 123 $$$', '"test 123 $$$"'],
- ['#password%', '"#password%"'],
- ['$pass ', '"$pass "'],
- ];
- }
-}
-
-class FooClass
-{
- use EnvironmentWriterTrait;
-}