Add environment status page

This commit is contained in:
Pig Fang 2019-08-28 11:39:00 +08:00
parent 048441071e
commit 8bb617623e
6 changed files with 30 additions and 0 deletions

View File

@ -361,6 +361,15 @@ class AdminController extends Controller
->with('forms', compact('resources', 'redis', 'cache'));
}
public function status(Request $request)
{
return view('admin.status', [
'phpVersion' => PHP_VERSION,
'webSoftware' => $request->server('SERVER_SOFTWARE', trans('general.unknown')),
'os' => sprintf('%s %s %s', php_uname('s'), php_uname('r'), php_uname('m')),
]);
}
public function getUserData(Request $request, User $users)
{
$isSingleUser = $request->has('uid');

View File

@ -32,6 +32,7 @@ $menu['admin'] = [
['title' => 'general.score-options', 'link' => 'admin/score', 'icon' => 'fa-credit-card'],
['title' => 'general.options', 'link' => 'admin/options', 'icon' => 'fa-cog'],
['title' => 'general.res-options', 'link' => 'admin/resource', 'icon' => 'fa-atom'],
['title' => 'general.status', 'link' => 'admin/status', 'icon' => 'fa-battery-three-quarters'],
['title' => 'general.plugin-market', 'link' => 'admin/plugins/market', 'icon' => 'fa-shopping-bag'],
['title' => 'general.plugin-manage', 'link' => 'admin/plugins/manage', 'icon' => 'fa-plug'],
['title' => 'general.plugin-configs', 'id' => 'plugin-configs', 'icon' => 'fa-cogs', 'children' => []],

View File

@ -25,6 +25,7 @@ customize: Customize
options: Options
score-options: Score Options
res-options: Resource Options
status: Status
check-update: Check Update
download-update: Download Updates
close: Close
@ -43,6 +44,7 @@ reset: Reset
submit: Submit
cancel: Cancel
op-success: Operated successfully.
unknown: Unknown
notice: Notice
switch-2d-preview: Switch to 2D preview

View File

@ -25,6 +25,7 @@ customize: 个性化
options: 站点配置
score-options: 积分配置
res-options: 资源配置
status: 运行状态
check-update: 检查更新
download-update: 下载更新
close: 关闭
@ -43,6 +44,7 @@ reset: 重置
submit: 提交
cancel: 取消
op-success: 操作成功
unknown: 未知
notice: 提示
switch-2d-preview: 切换 2D 预览

View File

@ -0,0 +1,14 @@
@extends('admin.master')
@section('title', trans('general.status'))
@section('content')
<div class="content-wrapper">
<section class="content-header">
<h1>@lang('general.status')</h1>
</section>
<section class="content">
</section>
</div>
@endsection

View File

@ -123,6 +123,8 @@ Route::group(['middleware' => ['authorize', 'admin'], 'prefix' => 'admin'], func
Route::any('/options', 'AdminController@options');
Route::any('/resource', 'AdminController@resource');
Route::get('/status', 'AdminController@status');
Route::view('/users', 'admin.users');
Route::post('/users', 'AdminController@userAjaxHandler');
Route::any('/user-data', 'AdminController@getUserData');