More postgres fixes

pull/825/head
Daniel Supernault 2019-02-12 19:48:28 -07:00
rodzic 3ac9a05632
commit e3760749ae
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 0DEF1C662C9033F7
4 zmienionych plików z 25 dodań i 5 usunięć

Wyświetl plik

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

Wyświetl plik

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

Wyświetl plik

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

Wyświetl plik

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