More postgres fixes

This commit is contained in:
Daniel Supernault 2019-02-12 19:48:28 -07:00
parent 3ac9a05632
commit e3760749ae
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7
4 changed files with 25 additions and 5 deletions

View file

@ -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'));
}
}

View file

@ -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();

View file

@ -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)

View file

@ -21,9 +21,9 @@
<div class="col-12 col-md-3">
<div class="card mb-3 border-left-blue">
<div class="card-body text-center">
<p class="font-weight-ultralight h2 mb-0 text-truncate">{{$sys['mysql']}}</p>
<p class="font-weight-ultralight h2 mb-0 text-truncate">{{$sys['database']['version']}}</p>
</div>
<div class="card-footer font-weight-bold py-0 text-center bg-white">MySQL</div>
<div class="card-footer font-weight-bold py-0 text-center bg-white">{{$sys['database']['name']}}</div>
</div>
</div>
<div class="col-12 col-md-3">