重构:运维工具迁移为独立页面,侧边栏新增「运维工具」菜单
- 新建 OpsController,承接四项运维操作
- 新建 admin/ops/index.blade.php 独立页面(卡片式布局)
- admin 路由改为 /admin/ops/* -> admin.ops.*
- 侧边栏「AI 厂商配置」下方新增「🛠️ 运维工具」菜单入口
- SystemController 移除运维方法,职责回归纯参数配置
- system/edit 移除内嵌运维块,页面保持简洁
This commit is contained in:
@@ -11,17 +11,11 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{-- Flash 提示 --}}
|
||||
@if (session('success'))
|
||||
<div class="mx-6 mt-4 p-3 bg-green-50 border border-green-200 rounded-lg text-green-700 text-sm">
|
||||
✅ {{ session('success') }}
|
||||
</div>
|
||||
@endif
|
||||
@if (session('ops_success'))
|
||||
<div class="mx-6 mt-4 p-3 bg-blue-50 border border-blue-200 rounded-lg text-blue-700 text-sm font-medium">
|
||||
{{ session('ops_success') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="p-6">
|
||||
<form action="{{ route('admin.system.update') }}" method="POST">
|
||||
@@ -53,78 +47,4 @@
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{-- 运维工具(仅 id=1 超管可见) --}}
|
||||
@if (auth()->id() === 1)
|
||||
<div class="mt-6 bg-white rounded-xl shadow-sm border border-gray-100 overflow-hidden">
|
||||
<div class="p-6 border-b border-gray-100 bg-gray-50">
|
||||
<h2 class="text-lg font-bold text-gray-800">🛠️ 运维工具</h2>
|
||||
<p class="text-xs text-gray-500 mt-1">仅站长可见。操作不可撤销,请确认后执行。</p>
|
||||
</div>
|
||||
<div class="p-6">
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
|
||||
|
||||
{{-- 应用缓存清理 --}}
|
||||
<div class="border border-gray-200 rounded-lg p-4">
|
||||
<div class="font-bold text-gray-700 text-sm mb-1">🗑️ 应用缓存清理</div>
|
||||
<p class="text-xs text-gray-400 mb-3">执行 <code class="bg-gray-100 px-1 rounded">config:clear +
|
||||
cache:clear</code>,修改 .env 后需执行。</p>
|
||||
<form action="{{ route('admin.system.ops.clear-cache') }}" method="POST"
|
||||
onsubmit="return confirm('确定清理应用缓存?')">
|
||||
@csrf
|
||||
<button type="submit"
|
||||
class="px-4 py-1.5 bg-amber-500 text-white rounded-md text-sm font-bold hover:bg-amber-600 transition">
|
||||
立即清理
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
{{-- 路由缓存清理 --}}
|
||||
<div class="border border-gray-200 rounded-lg p-4">
|
||||
<div class="font-bold text-gray-700 text-sm mb-1">🗺️ 路由缓存清理</div>
|
||||
<p class="text-xs text-gray-400 mb-3">执行 <code
|
||||
class="bg-gray-100 px-1 rounded">route:clear</code>,修改路由后若出现 404 时执行。</p>
|
||||
<form action="{{ route('admin.system.ops.clear-routes') }}" method="POST"
|
||||
onsubmit="return confirm('确定清理路由缓存?')">
|
||||
@csrf
|
||||
<button type="submit"
|
||||
class="px-4 py-1.5 bg-amber-500 text-white rounded-md text-sm font-bold hover:bg-amber-600 transition">
|
||||
立即清理
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
{{-- 视图缓存清理 --}}
|
||||
<div class="border border-gray-200 rounded-lg p-4">
|
||||
<div class="font-bold text-gray-700 text-sm mb-1">🖼️ 视图缓存清理</div>
|
||||
<p class="text-xs text-gray-400 mb-3">执行 <code
|
||||
class="bg-gray-100 px-1 rounded">view:clear</code>,页面样式/内容不更新时执行。</p>
|
||||
<form action="{{ route('admin.system.ops.clear-views') }}" method="POST"
|
||||
onsubmit="return confirm('确定清理视图缓存?')">
|
||||
@csrf
|
||||
<button type="submit"
|
||||
class="px-4 py-1.5 bg-amber-500 text-white rounded-md text-sm font-bold hover:bg-amber-600 transition">
|
||||
立即清理
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
{{-- 房间在线名单清理 --}}
|
||||
<div class="border border-red-100 rounded-lg p-4 bg-red-50">
|
||||
<div class="font-bold text-red-700 text-sm mb-1">👻 清理幽灵在线名单</div>
|
||||
<p class="text-xs text-red-400 mb-3">清空所有房间 Redis 在线记录,解决人数虚高问题。<br>执行后在线用户需重新进房才能出现在名单。</p>
|
||||
<form action="{{ route('admin.system.ops.clear-room-online') }}" method="POST"
|
||||
onsubmit="return confirm('确定清理所有房间在线名单?在线用户需重进房间!')">
|
||||
@csrf
|
||||
<button type="submit"
|
||||
class="px-4 py-1.5 bg-red-500 text-white rounded-md text-sm font-bold hover:bg-red-600 transition">
|
||||
立即清理
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
@endsection
|
||||
|
||||
Reference in New Issue
Block a user