Skip to content

Commit 3be9274

Browse files
committed
feat: connection status, deps update
1 parent a9cdbeb commit 3be9274

8 files changed

Lines changed: 797 additions & 601 deletions

File tree

app/Http/Controllers/Postgres/PostgresConnectionController.php

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,31 @@ public function index(Request $request)
5050
->where('user_id', $request->user()->id)
5151
->get();
5252

53+
// Test connection status for each connection
54+
$connectionsWithStatus = $connections->map(function ($connection) {
55+
try {
56+
$credentials = [
57+
'host' => $connection->host,
58+
'port' => $connection->port,
59+
'username' => $connection->username,
60+
'password' => $connection->password,
61+
'database' => $connection->database,
62+
];
63+
64+
$isOnline = $this->connectionManager->testConnection($credentials);
65+
$connection->connection_status = $isOnline;
66+
$connection->last_tested = now();
67+
} catch (\Exception $e) {
68+
$connection->connection_status = false;
69+
$connection->connection_error = $e->getMessage();
70+
$connection->last_tested = now();
71+
}
72+
73+
return $connection;
74+
});
75+
5376
return Inertia::render('postgres/postgres', [
54-
'connections' => $connections,
77+
'connections' => $connectionsWithStatus,
5578
]);
5679
}
5780

bun.lock

Lines changed: 233 additions & 123 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
],
4545
"dev": [
4646
"Composer\\Config::disableProcessTimeout",
47-
"bunx concurrently -c \"#93c5fd,#c4b5fd,#fb7185,#fdba74\" \"php artisan serve\" \"php artisan queue:listen --tries=1\" \"php artisan pail --timeout=0\" \"bun --bun run dev\" --names=server,queue,logs,vite"
47+
"bunx concurrently -c \"#93c5fd,#c4b5fd,#fb7185,#fdba74\" \"php artisan serve\" \"php artisan queue:listen --tries=1\" \"php artisan pail -vvv --timeout=0\" \"bun --bun run dev\" --names=server,queue,logs,vite"
4848
],
4949
"dev:ssr": [
5050
"bun --bun run build:ssr",

0 commit comments

Comments
 (0)