Files
chatroom/resources/views/admin/system/edit.blade.php
lkddi 783afe0677 重构:运维工具迁移为独立页面,侧边栏新增「运维工具」菜单
- 新建 OpsController,承接四项运维操作
- 新建 admin/ops/index.blade.php 独立页面(卡片式布局)
- admin 路由改为 /admin/ops/* -> admin.ops.*
- 侧边栏「AI 厂商配置」下方新增「🛠️ 运维工具」菜单入口
- SystemController 移除运维方法,职责回归纯参数配置
- system/edit 移除内嵌运维块,页面保持简洁
2026-03-03 15:07:36 +08:00

51 lines
2.4 KiB
PHP

@extends('admin.layouts.app')
@section('title', '系统参数配置')
@section('content')
<div class="bg-white rounded-xl shadow-sm border border-gray-100 overflow-hidden">
<div class="p-6 border-b border-gray-100 flex justify-between items-center bg-gray-50">
<div>
<h2 class="text-lg font-bold text-gray-800">修改系统运行参数</h2>
<p class="text-xs text-gray-500 mt-1">保存后会同步更新 Redis 缓存,前台实时生效。</p>
</div>
</div>
@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
<div class="p-6">
<form action="{{ route('admin.system.update') }}" method="POST">
@csrf
@method('PUT')
<div class="space-y-6 max-w-2xl">
@foreach ($params as $alias => $body)
<div>
<label class="block text-sm font-bold text-gray-700 mb-2">
{{ $descriptions[$alias] ?? $alias }}
<span class="text-gray-400 font-normal ml-2">[{{ $alias }}]</span>
</label>
@if (strlen($body) > 50 || str_contains($body, "\n") || str_contains($body, '<'))
<textarea name="{{ $alias }}" rows="4"
class="w-full border-gray-300 rounded-md shadow-sm focus:border-indigo-500 focus:ring-indigo-500 p-2.5 bg-gray-50 border whitespace-pre-wrap">{{ $body }}</textarea>
@else
<input type="text" name="{{ $alias }}" value="{{ $body }}"
class="w-full border-gray-300 rounded-md shadow-sm focus:border-indigo-500 focus:ring-indigo-500 p-2.5 bg-gray-50 border">
@endif
</div>
@endforeach
</div>
<div class="mt-8 pt-6 border-t flex space-x-3">
<button type="submit"
class="px-6 py-2 bg-indigo-600 text-white rounded-md font-bold hover:bg-indigo-700 shadow-sm transition">保存并发布</button>
</div>
</form>
</div>
</div>
@endsection