Merge pull request #825 from pixelfed/frontend-ui-refactor

More postgres fixes
This commit is contained in:
daniel 2019-02-12 19:50:41 -07:00 committed by GitHub
commit 72009384df
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 25 additions and 5 deletions

View file

@ -105,10 +105,31 @@ trait AdminSettingsController
{ {
$sys = [ $sys = [
'pixelfed' => config('pixelfed.version'), 'pixelfed' => config('pixelfed.version'),
'mysql' => DB::select( DB::raw("select version()") )[0]->{'version()'},
'php' => phpversion(), 'php' => phpversion(),
'redis' => explode(' ',exec('redis-cli -v'))[1], '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')); return view('admin.settings.system', compact('sys'));
} }
} }

View file

@ -78,7 +78,6 @@ class InternalApiController extends Controller
} }
$status->caption = strip_tags($request->caption); $status->caption = strip_tags($request->caption);
$status->visibility = 'draft';
$status->scope = 'draft'; $status->scope = 'draft';
$status->profile_id = $profile->id; $status->profile_id = $profile->id;
$status->save(); $status->save();

View file

@ -68,7 +68,7 @@ class ProfileController extends Controller
} }
$is_admin = is_null($user->domain) ? $user->user->is_admin : false; $is_admin = is_null($user->domain) ? $user->user->is_admin : false;
$profile = $user; $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) public function permalinkRedirect(Request $request, $username)

View file

@ -21,9 +21,9 @@
<div class="col-12 col-md-3"> <div class="col-12 col-md-3">
<div class="card mb-3 border-left-blue"> <div class="card mb-3 border-left-blue">
<div class="card-body text-center"> <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>
<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> </div>
<div class="col-12 col-md-3"> <div class="col-12 col-md-3">