Add grid for status page

This commit is contained in:
Pig Fang 2019-12-15 19:04:30 +08:00
parent 25f9eb7f22
commit 79a96ec6d8
3 changed files with 51 additions and 39 deletions

View File

@ -6,6 +6,7 @@ use App\Models\Player;
use App\Models\Texture;
use App\Models\User;
use App\Notifications;
use App\Services\Filter;
use App\Services\OptionForm;
use App\Services\PluginManager;
use Auth;
@ -406,7 +407,8 @@ class AdminController extends Controller
public function status(
Request $request,
PluginManager $plugins,
Filesystem $filesystem
Filesystem $filesystem,
Filter $filter
) {
$db = get_db_config();
$enabledPlugins = $plugins->getEnabledPlugins()->map(function ($plugin) {
@ -421,7 +423,21 @@ class AdminController extends Controller
$commit = $process->isSuccessful() ? trim($process->getOutput()) : '';
}
$grid = [
'layout' => [
['md-6', 'md-6']
],
'widgets' => [
[
['admin.widgets.status.info'],
[]
]
]
];
$grid = $filter->apply('grid:admin.status', $grid);
return view('admin.status')
->with('grid', $grid)
->with('detail', [
'bs' => [
'version' => config('app.version'),

View File

@ -3,42 +3,5 @@
{% block title %}{{ trans('general.status') }}{% endblock %}
{% block content %}
<div class="row">
<div class="col-md-6">
<div class="card card-info">
<div class="card-header">
<h3 class="card-title">{{ trans('admin.status.info') }}</h3>
</div>
<div class="card-body">
<table class="table table-bordered table-striped">
<tbody>
{% for category, info in detail %}
<tr>
<th colspan="2">{{ trans("admin.status.#{category}.name") }}</th>
</tr>
{% for key, value in info %}
<tr>
<td>{{ trans("admin.status.#{category}.#{key}") }}</td>
<td>{{ value }}</td>
</tr>
{% endfor %}
{% endfor %}
<tr>
<th colspan="2">
{{ trans('admin.status.plugins', {amount: plugins|length}) }}
</th>
</tr>
{% for plugin in plugins %}
<tr>
<td>{{ plugin.title }}</td>
<td>{{ plugin.version }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
<div class="col-md-6"></div>
</div>
{{ include('shared.grid') }}
{% endblock %}

View File

@ -0,0 +1,33 @@
<div class="card card-info">
<div class="card-header">
<h3 class="card-title">{{ trans('admin.status.info') }}</h3>
</div>
<div class="card-body">
<table class="table table-bordered table-striped">
<tbody>
{% for category, info in detail %}
<tr>
<th colspan="2">{{ trans("admin.status.#{category}.name") }}</th>
</tr>
{% for key, value in info %}
<tr>
<td>{{ trans("admin.status.#{category}.#{key}") }}</td>
<td>{{ value }}</td>
</tr>
{% endfor %}
{% endfor %}
<tr>
<th colspan="2">
{{ trans('admin.status.plugins', {amount: plugins|length}) }}
</th>
</tr>
{% for plugin in plugins %}
<tr>
<td>{{ plugin.title }}</td>
<td>{{ plugin.version }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>