统一后台列表页样式并调整站长菜单
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
@section('title', 'AI 厂商配置')
|
||||
|
||||
@section('content')
|
||||
@php require resource_path('views/admin/partials/list-theme.php'); @endphp
|
||||
<div x-data="{
|
||||
showForm: false,
|
||||
editId: null,
|
||||
@@ -68,12 +69,12 @@
|
||||
}">
|
||||
|
||||
{{-- 全局开关 + 高级设置 --}}
|
||||
<div class="bg-white rounded-xl shadow-sm border border-gray-100 overflow-hidden mb-6">
|
||||
<div class="{{ $adminListCardClass }} mb-6">
|
||||
<div class="p-6">
|
||||
<!-- 顶部栏:开关和添加按钮 -->
|
||||
<div class="flex items-center justify-between border-b border-gray-100 pb-4 mb-4">
|
||||
<div class="flex items-center gap-4">
|
||||
<h2 class="text-lg font-bold text-gray-800">🤖 AI 聊天机器人配置</h2>
|
||||
<h2 class="{{ $adminListHeaderTitleClass }}">🤖 AI 聊天机器人配置</h2>
|
||||
<div class="flex items-center gap-2">
|
||||
<span class="text-sm text-gray-500">大厅状态:</span>
|
||||
<button id="chatbot-toggle-btn" data-ai-chatbot-toggle-url="{{ route('admin.ai-providers.toggle-chatbot') }}"
|
||||
@@ -87,8 +88,7 @@
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<button x-on:click="openNew()"
|
||||
class="px-4 py-2 bg-indigo-600 text-white rounded-md hover:bg-indigo-700 transition font-bold text-sm">
|
||||
<button x-on:click="openNew()" class="{{ $adminListPrimaryButtonClass }}">
|
||||
+ 添加 AI 厂商
|
||||
</button>
|
||||
</div>
|
||||
@@ -145,26 +145,26 @@
|
||||
</div>
|
||||
|
||||
{{-- 厂商列表 --}}
|
||||
<div class="bg-white rounded-xl shadow-sm border border-gray-100 overflow-hidden">
|
||||
<table class="w-full text-sm">
|
||||
<thead class="bg-gray-50 text-gray-600">
|
||||
<div class="{{ $adminListCardClass }}">
|
||||
<table class="{{ $adminListTableClass }}">
|
||||
<thead class="{{ $adminListTableHeadRowClass }}">
|
||||
<tr>
|
||||
<th class="px-6 py-3 text-left font-bold">厂商</th>
|
||||
<th class="px-6 py-3 text-left font-bold">模型</th>
|
||||
<th class="px-6 py-3 text-left font-bold">API 端点</th>
|
||||
<th class="px-6 py-3 text-center font-bold">参数</th>
|
||||
<th class="px-6 py-3 text-center font-bold">排序</th>
|
||||
<th class="px-6 py-3 text-center font-bold">状态</th>
|
||||
<th class="px-6 py-3 text-center font-bold">默认</th>
|
||||
<th class="px-6 py-3 text-center font-bold">操作</th>
|
||||
<th class="{{ $adminListTableHeadCellClass }}">厂商</th>
|
||||
<th class="{{ $adminListTableHeadCellClass }}">模型</th>
|
||||
<th class="{{ $adminListTableHeadCellClass }}">API 端点</th>
|
||||
<th class="{{ $adminListTableHeadCellClass }} text-center">参数</th>
|
||||
<th class="{{ $adminListTableHeadCellClass }} text-center">排序</th>
|
||||
<th class="{{ $adminListTableHeadCellClass }} text-center">状态</th>
|
||||
<th class="{{ $adminListTableHeadCellClass }} text-center">默认</th>
|
||||
<th class="{{ $adminListTableHeadCellClass }} text-center">操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="divide-y divide-gray-100">
|
||||
<tbody class="{{ $adminListTableBodyClass }}">
|
||||
@forelse ($providers as $provider)
|
||||
<tr class="hover:bg-gray-50 transition {{ !$provider->is_enabled ? 'opacity-50' : '' }}">
|
||||
<tr class="{{ $adminListTableRowClass }} {{ !$provider->is_enabled ? 'opacity-50' : '' }}">
|
||||
<td class="px-6 py-4">
|
||||
<div class="font-bold text-gray-800">{{ $provider->name }}</div>
|
||||
<div class="text-xs text-gray-400">{{ $provider->provider }}</div>
|
||||
<div class="{{ $adminListPrimaryTextClass }}">{{ $provider->name }}</div>
|
||||
<div class="{{ $adminListSecondaryTextClass }}">{{ $provider->provider }}</div>
|
||||
</td>
|
||||
<td class="px-6 py-4">
|
||||
<code class="bg-gray-100 px-2 py-1 rounded text-xs">{{ $provider->model }}</code>
|
||||
@@ -202,22 +202,22 @@
|
||||
<div class="flex items-center justify-center gap-2">
|
||||
<button data-ai-provider-test-url="{{ route('admin.ai-providers.test', $provider->id) }}"
|
||||
data-ai-provider-name="{{ $provider->name }}"
|
||||
class="text-teal-600 hover:text-teal-800 text-xs font-bold">⚡ 测试</button>
|
||||
class="{{ $adminListActionButtonClass }} text-teal-600 hover:text-teal-800 hover:bg-teal-50">⚡ 测试</button>
|
||||
<button x-on:click="openEdit({{ $provider->toJson() }})"
|
||||
class="text-indigo-600 hover:text-indigo-800 text-xs font-bold">编辑</button>
|
||||
class="{{ $adminListActionButtonClass }} text-indigo-600 hover:text-indigo-800 hover:bg-indigo-50">编辑</button>
|
||||
<form action="{{ route('admin.ai-providers.destroy', $provider->id) }}" method="POST"
|
||||
data-admin-confirm="确定要删除 {{ $provider->name }} 吗?">
|
||||
@csrf
|
||||
@method('DELETE')
|
||||
<button type="submit"
|
||||
class="text-red-500 hover:text-red-700 text-xs font-bold">删除</button>
|
||||
class="{{ $adminListActionButtonClass }} text-red-500 hover:text-red-700 hover:bg-red-50">删除</button>
|
||||
</form>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@empty
|
||||
<tr>
|
||||
<td colspan="8" class="px-6 py-12 text-center text-gray-400">
|
||||
<td colspan="8" class="{{ $adminListEmptyClass }}">
|
||||
暂无 AI 厂商配置,请点击上方"添加 AI 厂商"按钮。
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
Reference in New Issue
Block a user