diff --git a/app/Http/Controllers/Admin/AdminSettingsController.php b/app/Http/Controllers/Admin/AdminSettingsController.php index 708fa312..a87499bc 100644 --- a/app/Http/Controllers/Admin/AdminSettingsController.php +++ b/app/Http/Controllers/Admin/AdminSettingsController.php @@ -105,10 +105,31 @@ trait AdminSettingsController { $sys = [ 'pixelfed' => config('pixelfed.version'), - 'mysql' => DB::select( DB::raw("select version()") )[0]->{'version()'}, 'php' => phpversion(), 'redis' => explode(' ',exec('redis-cli -v'))[1], ]; + switch (config('database.default')) { + case 'pgsql': + $sys['database'] = [ + 'name' => 'Postgres', + 'version' => explode(' ', DB::select(DB::raw('select version();'))[0]->version)[1] + ]; + break; + + case 'mysql': + $sys['database'] = [ + 'name' => 'MySQL', + 'version' => DB::select( DB::raw("select version()") )[0]->{'version()'} + ]; + break; + + default: + $sys['database'] = [ + 'name' => 'Unknown', + 'version' => '?' + ]; + break; + } return view('admin.settings.system', compact('sys')); } } \ No newline at end of file diff --git a/app/Http/Controllers/InternalApiController.php b/app/Http/Controllers/InternalApiController.php index 45738baa..8e41f9f3 100644 --- a/app/Http/Controllers/InternalApiController.php +++ b/app/Http/Controllers/InternalApiController.php @@ -78,7 +78,6 @@ class InternalApiController extends Controller } $status->caption = strip_tags($request->caption); - $status->visibility = 'draft'; $status->scope = 'draft'; $status->profile_id = $profile->id; $status->save(); diff --git a/app/Http/Controllers/ProfileController.php b/app/Http/Controllers/ProfileController.php index 5440b789..1b544ce7 100644 --- a/app/Http/Controllers/ProfileController.php +++ b/app/Http/Controllers/ProfileController.php @@ -68,7 +68,7 @@ class ProfileController extends Controller } $is_admin = is_null($user->domain) ? $user->user->is_admin : false; $profile = $user; - return view('profile.show', compact('user', 'profile', 'settings', 'owner', 'is_following', 'is_admin', 'timeline')); + return view('profile.show', compact('user', 'profile', 'settings', 'owner', 'is_following', 'is_admin')); } public function permalinkRedirect(Request $request, $username) diff --git a/resources/views/admin/settings/system.blade.php b/resources/views/admin/settings/system.blade.php index 5878e0b8..03c3669c 100644 --- a/resources/views/admin/settings/system.blade.php +++ b/resources/views/admin/settings/system.blade.php @@ -21,9 +21,9 @@
{{$sys['mysql']}}
+{{$sys['database']['version']}}