#feature: update layout

This commit is contained in:
2025-12-25 19:16:41 +08:00
parent cd11a856bb
commit cd1e3d4859
3 changed files with 362 additions and 276 deletions

View File

@@ -1,142 +1,173 @@
<template> <template>
<div class="bg-white rounded-xl shadow-sm border border-gray-200 p-8"> <div class="space-y-4">
<div class="flex items-start justify-between gap-4"> <div class="bg-white rounded-lg shadow-sm border border-gray-200 flex flex-col h-full">
<div> <!-- Header -->
<h3 class="text-lg font-medium text-gray-900">IP 用户映射</h3> <div class="bg-gray-50 px-4 py-3 border-b border-gray-200 flex justify-between items-center">
<p class="text-gray-500 mt-1">维护 IP 与用户标识的对应关系</p> <div>
</div> <h3 class="text-sm font-bold text-gray-800">IP 用户映射</h3>
<button <p class="text-xs text-gray-500">维护 IP 与用户标识的对应关系</p>
class="px-4 py-2 bg-gray-100 text-gray-700 rounded-md hover:bg-gray-200 disabled:opacity-50" </div>
:disabled="loading" <button
@click="loadMappings" @click="loadMappings"
> :disabled="loading"
{{ loading ? '加载中...' : '刷新' }} class="text-gray-500 hover:text-blue-600 transition-colors p-1.5 rounded hover:bg-gray-200"
</button> title="刷新列表"
</div>
<div class="mt-6 grid grid-cols-1 md:grid-cols-4 gap-4">
<input
v-model="newMapping.ip_address"
type="text"
class="px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"
placeholder="IP 地址"
/>
<input
v-model="newMapping.user_name"
type="text"
class="px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"
placeholder="用户标识"
/>
<input
v-model="newMapping.remark"
type="text"
class="px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"
placeholder="备注(可选)"
/>
<button
class="px-4 py-2 bg-blue-600 text-white rounded-md hover:bg-blue-700 disabled:opacity-50"
:disabled="saving"
@click="createMapping"
>
{{ saving ? '保存中...' : '新增映射' }}
</button>
</div>
<div
v-if="unmappedIps.length"
class="mt-6 border border-amber-200 bg-amber-50 rounded-lg p-4"
>
<div class="flex items-center justify-between">
<div class="text-sm font-medium text-amber-700">待匹配 IP来自日志</div>
<div class="text-xs text-amber-600"> {{ unmappedIps.length }} </div>
</div>
<div class="mt-3 grid grid-cols-1 md:grid-cols-2 gap-2 max-h-64 overflow-auto">
<div
v-for="item in unmappedIps"
:key="item.ip_address"
class="flex items-center justify-between gap-3 bg-white border border-amber-100 rounded px-3 py-2 text-sm"
> >
<div class="flex flex-col"> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" class="w-4 h-4" :class="{'animate-spin': loading}">
<span class="font-mono text-gray-800">{{ item.ip_address }}</span> <path fill-rule="evenodd" d="M15.312 11.424a5.5 5.5 0 01-9.201 2.466l-.312-.311h2.433a.75.75 0 000-1.5H3.989a.75.75 0 00-.75.75v4.242a.75.75 0 001.5 0v-2.43l.31.31a7 7 0 0011.712-3.138.75.75 0 00-1.449-.39zm1.23-3.723a.75.75 0 00.219-.53V2.929a.75.75 0 00-1.5 0v2.433l-.31-.31a7 7 0 00-11.712 3.138.75.75 0 001.449.39 5.5 5.5 0 019.201-2.466l.312.312h-2.433a.75.75 0 000 1.5h4.185a.75.75 0 00.53-.219z" clip-rule="evenodd" />
<span class="text-xs text-gray-500"> </svg>
{{ item.logs_count }} 次日志 · 最近 {{ formatTime(item.last_seen_at) }} </button>
</span> </div>
<!-- Messages -->
<div v-if="message" class="mx-4 mt-4 text-sm text-green-600 bg-green-50 px-3 py-2 rounded border border-green-100">
{{ message }}
</div>
<div v-if="error" class="mx-4 mt-4 text-sm text-red-600 bg-red-50 px-3 py-2 rounded border border-red-100">
{{ error }}
</div>
<!-- Add New Form -->
<div class="p-4 bg-white border-b border-gray-100">
<div class="flex flex-col md:flex-row gap-3 items-end md:items-center">
<div class="flex-1 w-full">
<label class="block text-xs text-gray-500 mb-1">IP 地址</label>
<input
v-model="newMapping.ip_address"
type="text"
class="w-full px-3 py-2 text-sm font-mono border border-gray-300 rounded focus:ring-1 focus:ring-blue-500"
placeholder="192.168.1.100"
/>
</div>
<div class="flex-1 w-full">
<label class="block text-xs text-gray-500 mb-1">用户标识</label>
<input
v-model="newMapping.user_name"
type="text"
class="w-full px-3 py-2 text-sm border border-gray-300 rounded focus:ring-1 focus:ring-blue-500"
placeholder="zhangsan"
/>
</div>
<div class="flex-[1.5] w-full">
<label class="block text-xs text-gray-500 mb-1">备注</label>
<input
v-model="newMapping.remark"
type="text"
class="w-full px-3 py-2 text-sm border border-gray-300 rounded focus:ring-1 focus:ring-blue-500"
placeholder="可选备注"
/>
</div>
<button
@click="createMapping"
:disabled="saving"
class="w-full md:w-auto px-4 py-2 bg-blue-600 text-white text-sm font-medium rounded hover:bg-blue-700 disabled:opacity-50 flex items-center justify-center gap-1 h-[38px] mt-4 md:mt-0"
>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" class="w-4 h-4">
<path d="M10.75 4.75a.75.75 0 00-1.5 0v4.5h-4.5a.75.75 0 000 1.5h4.5v4.5a.75.75 0 001.5 0v-4.5h4.5a.75.75 0 000-1.5h-4.5v-4.5z" />
</svg>
新增
</button>
</div>
</div>
<!-- Unmapped IPs Section -->
<div v-if="unmappedIps.length" class="px-4 py-3 bg-amber-50 border-b border-amber-100">
<div class="flex items-center justify-between mb-2">
<div class="text-sm font-bold text-amber-800 flex items-center gap-1">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" class="w-4 h-4">
<path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z" clip-rule="evenodd" />
</svg>
待匹配 IP ({{ unmappedIps.length }})
</div> </div>
<button </div>
class="px-2 py-1 text-xs text-amber-700 bg-amber-100 rounded hover:bg-amber-200" <div class="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-3 max-h-48 overflow-y-auto pr-1 custom-scrollbar">
<div
v-for="item in unmappedIps"
:key="item.ip_address"
class="group flex items-center justify-between gap-2 bg-white border border-amber-200 rounded px-3 py-2 text-sm shadow-sm hover:border-amber-400 transition-colors cursor-pointer"
@click="fillIp(item.ip_address)" @click="fillIp(item.ip_address)"
title="点击填入"
> >
填入 <div class="flex flex-col min-w-0">
</button> <span class="font-mono text-gray-800 font-medium truncate">{{ item.ip_address }}</span>
<span class="text-xs text-gray-500 truncate">
{{ formatTime(item.last_seen_at) }} ({{ item.logs_count }})
</span>
</div>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" class="w-4 h-4 text-amber-300 group-hover:text-amber-600">
<path d="M10.75 4.75a.75.75 0 00-1.5 0v4.5h-4.5a.75.75 0 000 1.5h4.5v4.5a.75.75 0 001.5 0v-4.5h4.5a.75.75 0 000-1.5h-4.5v-4.5z" />
</svg>
</div>
</div> </div>
</div> </div>
</div>
<div v-if="message" class="mt-4 text-sm text-green-700 bg-green-50 border border-green-200 rounded-md px-3 py-2"> <!-- Table -->
{{ message }} <div class="overflow-x-auto flex-1">
</div> <table class="min-w-full divide-y divide-gray-200">
<div v-if="error" class="mt-4 text-sm text-red-700 bg-red-50 border border-red-200 rounded-md px-3 py-2"> <thead class="bg-gray-50">
{{ error }} <tr>
</div> <th scope="col" class="px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider w-1/4">IP 地址</th>
<th scope="col" class="px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider w-1/4">用户标识</th>
<div v-if="loading" class="mt-4 text-sm text-gray-400">加载中...</div> <th scope="col" class="px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">备注</th>
<div v-else class="mt-4 overflow-x-auto border border-gray-200 rounded-lg"> <th scope="col" class="px-4 py-3 text-right text-xs font-medium text-gray-500 uppercase tracking-wider w-24">操作</th>
<table class="min-w-full text-sm"> </tr>
<thead class="bg-gray-50 text-gray-600"> </thead>
<tr> <tbody class="bg-white divide-y divide-gray-200">
<th class="text-left px-4 py-3 font-medium">IP 地址</th> <tr v-for="mapping in mappings" :key="mapping.id" class="hover:bg-gray-50 group">
<th class="text-left px-4 py-3 font-medium">用户标识</th> <td class="px-4 py-2 align-top">
<th class="text-left px-4 py-3 font-medium">备注</th> <input
<th class="text-left px-4 py-3 font-medium">操作</th> v-model="mapping.ip_address"
</tr> type="text"
</thead> class="w-full text-sm font-mono bg-transparent border-none p-0 focus:ring-0 text-gray-900 placeholder-gray-400 group-hover:bg-white focus:bg-white rounded px-1"
<tbody class="divide-y divide-gray-200"> />
<tr v-for="mapping in mappings" :key="mapping.id" class="text-gray-700"> </td>
<td class="px-4 py-3 font-mono"> <td class="px-4 py-2 align-top">
<input <input
v-model="mapping.ip_address" v-model="mapping.user_name"
type="text" type="text"
class="w-full px-2 py-1 border border-gray-200 rounded-md focus:outline-none focus:ring-1 focus:ring-blue-500" class="w-full text-sm bg-transparent border-none p-0 focus:ring-0 text-gray-900 group-hover:bg-white focus:bg-white rounded px-1"
/> />
</td> </td>
<td class="px-4 py-3"> <td class="px-4 py-2 align-top">
<input <input
v-model="mapping.user_name" v-model="mapping.remark"
type="text" type="text"
class="w-full px-2 py-1 border border-gray-200 rounded-md focus:outline-none focus:ring-1 focus:ring-blue-500" class="w-full text-sm bg-transparent border-none p-0 focus:ring-0 text-gray-600 group-hover:bg-white focus:bg-white rounded px-1"
/> />
</td> </td>
<td class="px-4 py-3"> <td class="px-4 py-2 align-top text-right whitespace-nowrap">
<input <div class="flex items-center justify-end gap-1 opacity-0 group-hover:opacity-100 focus-within:opacity-100 transition-opacity">
v-model="mapping.remark" <button
type="text" @click="updateMapping(mapping)"
class="w-full px-2 py-1 border border-gray-200 rounded-md focus:outline-none focus:ring-1 focus:ring-blue-500" :disabled="mapping._saving"
/> class="p-1.5 text-blue-600 hover:bg-blue-50 rounded"
</td> title="保存"
<td class="px-4 py-3 whitespace-nowrap"> >
<div class="flex items-center gap-2"> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" class="w-4 h-4">
<button <path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z" clip-rule="evenodd" />
class="px-3 py-1 bg-blue-600 text-white rounded-md hover:bg-blue-700 disabled:opacity-50" </svg>
:disabled="mapping._saving" </button>
@click="updateMapping(mapping)" <button
> @click="deleteMapping(mapping)"
{{ mapping._saving ? '保存中...' : '保存' }} :disabled="mapping._deleting"
</button> class="p-1.5 text-red-600 hover:bg-red-50 rounded"
<button title="删除"
class="px-3 py-1 bg-red-50 text-red-700 rounded-md hover:bg-red-100 disabled:opacity-50" >
:disabled="mapping._deleting" <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" class="w-4 h-4">
@click="deleteMapping(mapping)" <path fill-rule="evenodd" d="M8.75 1A2.75 2.75 0 006 3.75v.443c-.795.077-1.584.176-2.365.298a.75.75 0 10.23 1.482l.149-.022.841 10.518A2.75 2.75 0 007.596 19h4.807a2.75 2.75 0 002.742-2.53l.841-10.52.149.023a.75.75 0 00.23-1.482A41.03 41.03 0 0014 4.193V3.75A2.75 2.75 0 0011.25 1h-2.5zM10 4c.84 0 1.673.025 2.5.075V3.75c0-.69-.56-1.25-1.25-1.25h-2.5c-.69 0-1.25.56-1.25 1.25v.325C8.327 4.025 9.16 4 10 4z" clip-rule="evenodd" />
> </svg>
{{ mapping._deleting ? '删除中...' : '删除' }} </button>
</button> </div>
</div> </td>
</td> </tr>
</tr> <tr v-if="mappings.length === 0">
<tr v-if="mappings.length === 0"> <td colspan="4" class="px-4 py-8 text-center text-sm text-gray-400">
<td colspan="4" class="px-4 py-6 text-center text-gray-400">暂无映射</td> 暂无映射数据
</tr> </td>
</tbody> </tr>
</table> </tbody>
</table>
</div>
</div> </div>
</div> </div>
</template> </template>
@@ -167,7 +198,8 @@ export default {
if (!value) { if (!value) {
return '-'; return '-';
} }
return value.replace('T', ' ').replace('Z', ''); // Simple date formatter, removing seconds for compactness
return value.replace('T', ' ').replace('Z', '').substring(5, 16);
}, },
async parseJsonResponse(response) { async parseJsonResponse(response) {
const contentType = response.headers.get('content-type') || ''; const contentType = response.headers.get('content-type') || '';
@@ -261,6 +293,7 @@ export default {
this.message = '已新增映射'; this.message = '已新增映射';
this.newMapping = { ip_address: '', user_name: '', remark: '' }; this.newMapping = { ip_address: '', user_name: '', remark: '' };
await this.loadMappings(); await this.loadMappings();
setTimeout(() => { this.message = ''; }, 3000);
} catch (error) { } catch (error) {
this.error = error.message; this.error = error.message;
} finally { } finally {
@@ -299,6 +332,7 @@ export default {
} }
this.message = '已更新映射'; this.message = '已更新映射';
setTimeout(() => { this.message = ''; }, 3000);
} catch (error) { } catch (error) {
this.error = error.message; this.error = error.message;
} finally { } finally {
@@ -306,6 +340,7 @@ export default {
} }
}, },
async deleteMapping(mapping) { async deleteMapping(mapping) {
if (!confirm('确定要删除吗?')) return;
mapping._deleting = true; mapping._deleting = true;
this.error = ''; this.error = '';
this.message = ''; this.message = '';
@@ -331,6 +366,7 @@ export default {
this.message = '已删除映射'; this.message = '已删除映射';
await this.loadMappings(); await this.loadMappings();
setTimeout(() => { this.message = ''; }, 3000);
} catch (error) { } catch (error) {
this.error = error.message; this.error = error.message;
} finally { } finally {

View File

@@ -1,120 +1,154 @@
<template> <template>
<div class="space-y-6"> <div class="space-y-4">
<div class="bg-white rounded-xl shadow-sm border border-gray-200 p-8"> <div class="bg-white rounded-lg shadow-sm border border-gray-200 flex flex-col h-full">
<div class="flex items-start justify-between gap-4"> <!-- Header & Filters -->
<div> <div class="bg-gray-50 px-4 py-3 border-b border-gray-200 flex flex-col md:flex-row justify-between items-start md:items-center gap-3">
<h3 class="text-lg font-medium text-gray-900">操作日志</h3> <div class="flex items-center gap-2">
<p class="text-gray-500 mt-1">记录对系统产生影响的请求POST/PUT/PATCH/DELETE</p> <h3 class="text-base font-bold text-gray-800">操作日志</h3>
<p v-if="currentIp" class="text-xs text-gray-400 mt-1">当前 IP: {{ currentIp }}</p> <span v-if="currentIp" class="text-xs bg-blue-50 text-blue-600 px-2 py-0.5 rounded border border-blue-100 font-mono">
IP: {{ currentIp }}
</span>
</div>
<div class="flex flex-wrap items-center gap-2 w-full md:w-auto">
<div class="relative flex-grow md:flex-grow-0">
<input
v-model="filters.q"
type="text"
class="w-full md:w-56 pl-3 pr-8 py-1.5 text-sm border border-gray-300 rounded focus:ring-1 focus:ring-blue-500"
placeholder="搜索 IP / 用户 / 路径"
@keyup.enter="applyFilters"
/>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" class="w-4 h-4 absolute right-2.5 top-2 text-gray-400">
<path fill-rule="evenodd" d="M9 3.5a5.5 5.5 0 100 11 5.5 5.5 0 000-11zM2 9a7 7 0 1112.452 4.391l3.328 3.329a.75.75 0 11-1.06 1.06l-3.329-3.328A7 7 0 012 9z" clip-rule="evenodd" />
</svg>
</div>
<select
v-model="filters.method"
class="py-1.5 pl-2 pr-8 text-sm border border-gray-300 rounded focus:ring-1 focus:ring-blue-500 bg-white"
@change="applyFilters"
>
<option value="">全部方法</option>
<option value="POST">POST</option>
<option value="PUT">PUT</option>
<option value="PATCH">PATCH</option>
<option value="DELETE">DELETE</option>
</select>
<select
v-model.number="logsPerPage"
class="py-1.5 pl-2 pr-8 text-sm border border-gray-300 rounded focus:ring-1 focus:ring-blue-500 bg-white"
@change="applyFilters"
>
<option :value="20">20/</option>
<option :value="50">50/</option>
<option :value="100">100/</option>
</select>
<button
class="p-1.5 text-gray-500 hover:text-blue-600 hover:bg-gray-100 rounded transition-colors"
:disabled="logsLoading"
@click="loadLogs"
title="刷新"
>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" class="w-5 h-5" :class="{'animate-spin': logsLoading}">
<path fill-rule="evenodd" d="M15.312 11.424a5.5 5.5 0 01-9.201 2.466l-.312-.311h2.433a.75.75 0 000-1.5H3.989a.75.75 0 00-.75.75v4.242a.75.75 0 001.5 0v-2.43l.31.31a7 7 0 0011.712-3.138.75.75 0 00-1.449-.39zm1.23-3.723a.75.75 0 00.219-.53V2.929a.75.75 0 00-1.5 0v2.433l-.31-.31a7 7 0 00-11.712 3.138.75.75 0 001.449.39 5.5 5.5 0 019.201-2.466l.312.312h-2.433a.75.75 0 000 1.5h4.185a.75.75 0 00.53-.219z" clip-rule="evenodd" />
</svg>
</button>
</div> </div>
<button
class="px-4 py-2 bg-gray-100 text-gray-700 rounded-md hover:bg-gray-200 disabled:opacity-50"
:disabled="logsLoading"
@click="loadLogs"
>
{{ logsLoading ? '加载中...' : '刷新' }}
</button>
</div> </div>
<div class="mt-6 flex flex-wrap items-center gap-3"> <div v-if="logsError" class="mx-4 mt-4 text-sm text-red-600 bg-red-50 px-3 py-2 rounded border border-red-100">
<input
v-model="filters.q"
type="text"
class="w-full md:w-64 px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"
placeholder="搜索 IP / 用户 / 路径"
/>
<select
v-model="filters.method"
class="px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"
>
<option value="">全部方法</option>
<option value="POST">POST</option>
<option value="PUT">PUT</option>
<option value="PATCH">PATCH</option>
<option value="DELETE">DELETE</option>
</select>
<select
v-model.number="logsPerPage"
class="px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"
>
<option :value="20">20/</option>
<option :value="50">50/</option>
<option :value="100">100/</option>
</select>
<button
class="px-4 py-2 bg-blue-600 text-white rounded-md hover:bg-blue-700 disabled:opacity-50"
:disabled="logsLoading"
@click="applyFilters"
>
查询
</button>
</div>
<div v-if="logsError" class="mt-4 text-sm text-red-700 bg-red-50 border border-red-200 rounded-md px-3 py-2">
{{ logsError }} {{ logsError }}
</div> </div>
<div v-if="logsLoading" class="mt-4 text-sm text-gray-400">加载中...</div> <!-- Table -->
<div v-else class="mt-4"> <div class="overflow-x-auto flex-1">
<div class="overflow-x-auto border border-gray-200 rounded-lg"> <table class="min-w-full divide-y divide-gray-200">
<table class="min-w-full text-sm"> <thead class="bg-gray-50">
<thead class="bg-gray-50 text-gray-600">
<tr> <tr>
<th class="text-left px-4 py-3 font-medium">时间</th> <th class="px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider w-40">时间</th>
<th v-if="isAdmin" class="text-left px-4 py-3 font-medium">用户</th> <th v-if="isAdmin" class="px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider w-32">用户</th>
<th class="text-left px-4 py-3 font-medium">IP</th> <th class="px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider w-36">IP</th>
<th class="text-left px-4 py-3 font-medium">方法</th> <th class="px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider w-20">方法</th>
<th class="text-left px-4 py-3 font-medium">路径</th> <th class="px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">路径</th>
<th class="text-left px-4 py-3 font-medium">状态</th> <th class="px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider w-20">状态</th>
<th class="text-left px-4 py-3 font-medium">请求数据</th> <th class="px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider w-20">Payload</th>
</tr> </tr>
</thead> </thead>
<tbody class="divide-y divide-gray-200"> <tbody class="bg-white divide-y divide-gray-200">
<tr v-for="log in logs" :key="log.id" class="text-gray-700"> <template v-for="log in logs" :key="log.id">
<td class="px-4 py-3 whitespace-nowrap">{{ formatTime(log.created_at) }}</td> <tr class="hover:bg-gray-50 text-sm">
<td v-if="isAdmin" class="px-4 py-3 whitespace-nowrap font-mono">{{ log.user_label || '-' }}</td> <td class="px-4 py-2 whitespace-nowrap text-gray-500">{{ formatTime(log.created_at) }}</td>
<td class="px-4 py-3 whitespace-nowrap font-mono">{{ log.ip_address }}</td> <td v-if="isAdmin" class="px-4 py-2 whitespace-nowrap font-medium text-gray-700">{{ log.user_label || '-' }}</td>
<td class="px-4 py-3 whitespace-nowrap font-mono">{{ log.method }}</td> <td class="px-4 py-2 whitespace-nowrap font-mono text-gray-600">{{ log.ip_address }}</td>
<td class="px-4 py-3 whitespace-nowrap">{{ log.path }}</td> <td class="px-4 py-2 whitespace-nowrap font-bold" :class="methodColor(log.method)">{{ log.method }}</td>
<td class="px-4 py-3 whitespace-nowrap">{{ log.status_code }}</td> <td class="px-4 py-2 whitespace-nowrap text-gray-600 font-mono truncate max-w-xs" :title="log.path">{{ log.path }}</td>
<td class="px-4 py-3"> <td class="px-4 py-2 whitespace-nowrap">
<details v-if="hasPayload(log.request_payload)"> <span :class="statusColor(log.status_code)" class="px-2 py-0.5 rounded text-xs font-mono border">
<summary class="cursor-pointer text-blue-600">查看</summary> {{ log.status_code }}
<pre class="mt-2 text-xs bg-gray-50 p-2 rounded whitespace-pre-wrap">{{ formatPayload(log.request_payload) }}</pre> </span>
</details> </td>
<span v-else>-</span> <td class="px-4 py-2 whitespace-nowrap">
<button
v-if="hasPayload(log.request_payload)"
@click="log._expanded = !log._expanded"
class="text-blue-600 hover:text-blue-800 text-xs font-medium flex items-center gap-1 focus:outline-none"
>
{{ log._expanded ? '收起' : '查看' }}
</button>
<span v-else class="text-gray-300">-</span>
</td> </td>
</tr> </tr>
<tr v-if="logs.length === 0"> <!-- Expanded Payload Row -->
<td :colspan="logColumnCount" class="px-4 py-6 text-center text-gray-400">暂无记录</td> <tr v-if="log._expanded && hasPayload(log.request_payload)" class="bg-gray-50/50">
<td :colspan="logColumnCount" class="px-4 py-3 border-b border-gray-100">
<pre class="text-xs font-mono text-gray-600 bg-white border border-gray-200 rounded p-3 overflow-x-auto custom-scrollbar">{{ formatPayload(log.request_payload) }}</pre>
</td>
</tr> </tr>
</tbody> </template>
</table> <tr v-if="logs.length === 0">
</div> <td :colspan="logColumnCount" class="px-4 py-10 text-center text-sm text-gray-400">
暂无操作记录
</td>
</tr>
</tbody>
</table>
</div>
<div class="mt-4 flex items-center justify-between text-sm text-gray-500"> <!-- Footer / Pagination -->
<div> {{ logsTotal }} </div> <div class="bg-gray-50 border-t border-gray-200 px-4 py-3 flex items-center justify-between">
<div class="flex items-center gap-2"> <div class="text-sm text-gray-500 font-medium">
<button <span class="text-gray-900">{{ logsTotal }}</span> 条记录
class="px-3 py-1 bg-gray-100 rounded-md hover:bg-gray-200 disabled:opacity-50" </div>
:disabled="logsPage <= 1" <div class="flex items-center gap-2">
@click="changePage(logsPage - 1)" <button
> class="p-1.5 rounded border border-gray-300 bg-white hover:bg-gray-50 disabled:opacity-30 disabled:hover:bg-white text-gray-600 transition-colors shadow-sm"
上一页 :disabled="logsPage <= 1"
</button> @click="changePage(logsPage - 1)"
<div> {{ logsPage }} / {{ logsLastPage || 1 }} </div> title="上一页"
<button >
class="px-3 py-1 bg-gray-100 rounded-md hover:bg-gray-200 disabled:opacity-50" <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" class="w-5 h-5">
:disabled="logsPage >= logsLastPage" <path fill-rule="evenodd" d="M12.79 5.23a.75.75 0 01-.02 1.06L8.832 10l3.938 3.71a.75.75 0 11-1.04 1.08l-4.5-4.25a.75.75 0 010-1.08l4.5-4.25a.75.75 0 011.06.02z" clip-rule="evenodd" />
@click="changePage(logsPage + 1)" </svg>
> </button>
下一页 <span class="text-sm font-semibold text-gray-700 min-w-[4rem] text-center">
</button> {{ logsPage }} / {{ logsLastPage || 1 }}
</div> </span>
<button
class="p-1.5 rounded border border-gray-300 bg-white hover:bg-gray-50 disabled:opacity-30 disabled:hover:bg-white text-gray-600 transition-colors shadow-sm"
:disabled="logsPage >= logsLastPage"
@click="changePage(logsPage + 1)"
title="下一页"
>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" class="w-5 h-5">
<path fill-rule="evenodd" d="M7.21 14.77a.75.75 0 01.02-1.06L11.168 10 7.23 6.29a.75.75 0 111.04-1.08l4.5 4.25a.75.75 0 010 1.08l-4.5 4.25a.75.75 0 01-1.06-.02z" clip-rule="evenodd" />
</svg>
</button>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</template> </template>
@@ -159,7 +193,7 @@ export default {
if (!value) { if (!value) {
return '-'; return '-';
} }
return value.replace('T', ' ').replace('Z', ''); return value.replace('T', ' ').replace('Z', '').substring(0, 19);
}, },
hasPayload(payload) { hasPayload(payload) {
return payload && Object.keys(payload).length > 0; return payload && Object.keys(payload).length > 0;
@@ -167,6 +201,22 @@ export default {
formatPayload(payload) { formatPayload(payload) {
return JSON.stringify(payload, null, 2); return JSON.stringify(payload, null, 2);
}, },
methodColor(method) {
const map = {
'POST': 'text-green-600',
'PUT': 'text-amber-600',
'PATCH': 'text-amber-600',
'DELETE': 'text-red-600'
};
return map[method] || 'text-gray-600';
},
statusColor(code) {
if (code >= 200 && code < 300) return 'text-green-700 bg-green-50 border-green-200';
if (code >= 300 && code < 400) return 'text-blue-700 bg-blue-50 border-blue-200';
if (code >= 400 && code < 500) return 'text-amber-700 bg-amber-50 border-amber-200';
if (code >= 500) return 'text-red-700 bg-red-50 border-red-200';
return 'text-gray-700 bg-gray-50 border-gray-200';
},
buildLogQuery() { buildLogQuery() {
const params = new URLSearchParams(); const params = new URLSearchParams();
params.set('page', String(this.logsPage)); params.set('page', String(this.logsPage));
@@ -193,7 +243,7 @@ export default {
} }
const pagination = data.data.pagination || {}; const pagination = data.data.pagination || {};
this.logs = data.data.logs || []; this.logs = (data.data.logs || []).map(l => ({...l, _expanded: false}));
this.logsTotal = pagination.total || 0; this.logsTotal = pagination.total || 0;
this.logsLastPage = pagination.last_page || 1; this.logsLastPage = pagination.last_page || 1;
this.logsPage = pagination.current_page || 1; this.logsPage = pagination.current_page || 1;

View File

@@ -4,9 +4,9 @@
<div class="flex items-center justify-between bg-white p-4 rounded-lg shadow-sm border border-gray-200"> <div class="flex items-center justify-between bg-white p-4 rounded-lg shadow-sm border border-gray-200">
<div> <div>
<h3 class="text-lg font-bold text-gray-800">系统设置</h3> <h3 class="text-lg font-bold text-gray-800">系统设置</h3>
<p class="text-xs text-gray-500">管理本地偏好与服务端全局配置</p> <p class="text-sm text-gray-500">管理本地偏好与服务端全局配置</p>
</div> </div>
<div v-if="jira.loading || configs.loading" class="text-xs text-blue-600 animate-pulse"> <div v-if="jira.loading || configs.loading" class="text-sm text-blue-600 animate-pulse">
数据同步中... 数据同步中...
</div> </div>
</div> </div>
@@ -18,24 +18,24 @@
<div class="bg-white rounded-lg shadow-sm border border-gray-200 overflow-hidden"> <div class="bg-white rounded-lg shadow-sm border border-gray-200 overflow-hidden">
<div class="bg-gray-50 px-4 py-3 border-b border-gray-200 flex justify-between items-center"> <div class="bg-gray-50 px-4 py-3 border-b border-gray-200 flex justify-between items-center">
<h4 class="font-semibold text-gray-700 text-sm">JIRA 偏好</h4> <h4 class="font-semibold text-gray-700 text-sm">JIRA 偏好</h4>
<span class="text-[10px] text-gray-400 uppercase tracking-wider">Local</span> <span class="text-xs text-gray-400 uppercase tracking-wider">Local</span>
</div> </div>
<div class="p-4 space-y-4"> <div class="p-4 space-y-4">
<!-- Default User Input --> <!-- Default User Input -->
<div> <div>
<label class="block text-xs font-medium text-gray-600 mb-1">默认查询用户 (本地)</label> <label class="block text-sm font-medium text-gray-600 mb-1">默认查询用户 (本地)</label>
<div class="flex gap-1"> <div class="flex gap-2">
<input <input
type="text" type="text"
v-model="jira.localDefaultQueryUserDraft" v-model="jira.localDefaultQueryUserDraft"
class="flex-1 min-w-0 block w-full px-2 py-1.5 text-sm border border-gray-300 rounded focus:ring-1 focus:ring-blue-500 focus:border-blue-500" class="flex-1 min-w-0 block w-full px-3 py-2 text-sm border border-gray-300 rounded focus:ring-1 focus:ring-blue-500 focus:border-blue-500"
placeholder="如: zhangsan" placeholder="如: zhangsan"
/> />
<button <button
@click="save" @click="save"
:disabled="jira.saving" :disabled="jira.saving"
class="px-3 py-1.5 bg-blue-600 text-white text-xs font-medium rounded hover:bg-blue-700 disabled:opacity-50 transition-colors" class="px-3 py-2 bg-blue-600 text-white text-sm font-medium rounded hover:bg-blue-700 disabled:opacity-50 transition-colors"
title="保存本地设置" title="保存本地设置"
> >
<svg v-if="!jira.saving" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" class="w-4 h-4"> <svg v-if="!jira.saving" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" class="w-4 h-4">
@@ -46,7 +46,7 @@
<button <button
@click="clear" @click="clear"
:disabled="jira.saving" :disabled="jira.saving"
class="px-2 py-1.5 bg-gray-100 text-gray-600 text-xs font-medium rounded hover:bg-gray-200 disabled:opacity-50 transition-colors" class="px-2 py-2 bg-gray-100 text-gray-600 text-sm font-medium rounded hover:bg-gray-200 disabled:opacity-50 transition-colors"
title="清除并使用默认值" title="清除并使用默认值"
> >
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" class="w-4 h-4"> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" class="w-4 h-4">
@@ -54,32 +54,32 @@
</svg> </svg>
</button> </button>
</div> </div>
<p class="mt-1 text-[10px] text-gray-400">留空则使用服务端默认值</p> <p class="mt-1 text-xs text-gray-400">留空则使用服务端默认值</p>
</div> </div>
<!-- Messages --> <!-- Messages -->
<div v-if="jira.message" class="text-xs text-green-600 bg-green-50 px-2 py-1 rounded border border-green-100 flex items-center gap-1"> <div v-if="jira.message" class="text-sm text-green-600 bg-green-50 px-3 py-2 rounded border border-green-100 flex items-center gap-1">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" class="w-3 h-3"> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" class="w-4 h-4">
<path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z" clip-rule="evenodd" /> <path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z" clip-rule="evenodd" />
</svg> </svg>
{{ jira.message }} {{ jira.message }}
</div> </div>
<div v-if="jira.error" class="text-xs text-red-600 bg-red-50 px-2 py-1 rounded border border-red-100"> <div v-if="jira.error" class="text-sm text-red-600 bg-red-50 px-3 py-2 rounded border border-red-100">
{{ jira.error }} {{ jira.error }}
</div> </div>
<!-- Server Info Compact --> <!-- Server Info Compact -->
<div class="bg-gray-50 rounded border border-gray-200 p-3 space-y-2"> <div class="bg-gray-50 rounded border border-gray-200 p-4 space-y-3">
<div class="flex justify-between items-center text-xs"> <div class="flex justify-between items-center text-sm">
<span class="text-gray-500">生效用户:</span> <span class="text-gray-500">生效用户:</span>
<span class="font-mono font-medium text-gray-800 bg-white px-1.5 py-0.5 rounded border border-gray-200">{{ effectiveDefaultQueryUser || '-' }}</span> <span class="font-mono font-medium text-gray-800 bg-white px-2 py-0.5 rounded border border-gray-200">{{ effectiveDefaultQueryUser || '-' }}</span>
</div> </div>
<div class="border-t border-gray-200 my-1"></div> <div class="border-t border-gray-200 my-1"></div>
<div class="flex justify-between items-center text-xs"> <div class="flex justify-between items-center text-sm">
<span class="text-gray-500">服务端默认:</span> <span class="text-gray-500">服务端默认:</span>
<span class="font-mono text-gray-700">{{ jira.serverDefaultUser || '-' }}</span> <span class="font-mono text-gray-700">{{ jira.serverDefaultUser || '-' }}</span>
</div> </div>
<div class="flex justify-between items-start text-xs gap-2"> <div class="flex justify-between items-start text-sm gap-2">
<span class="text-gray-500 shrink-0">Host:</span> <span class="text-gray-500 shrink-0">Host:</span>
<span class="font-mono text-gray-700 text-right break-all">{{ jira.host || '-' }}</span> <span class="font-mono text-gray-700 text-right break-all">{{ jira.host || '-' }}</span>
</div> </div>
@@ -99,7 +99,7 @@
v-if="isAdmin" v-if="isAdmin"
@click="loadConfigs" @click="loadConfigs"
:disabled="configs.loading" :disabled="configs.loading"
class="text-gray-500 hover:text-blue-600 transition-colors p-1 rounded hover:bg-gray-200" class="text-gray-500 hover:text-blue-600 transition-colors p-1.5 rounded hover:bg-gray-200"
title="刷新列表" title="刷新列表"
> >
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" class="w-4 h-4" :class="{'animate-spin': configs.loading}"> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" class="w-4 h-4" :class="{'animate-spin': configs.loading}">
@@ -117,42 +117,42 @@
<!-- Admin Content --> <!-- Admin Content -->
<div v-else class="flex-1 flex flex-col min-h-0"> <div v-else class="flex-1 flex flex-col min-h-0">
<!-- Status Messages --> <!-- Status Messages -->
<div v-if="configs.message" class="mx-4 mt-4 text-xs text-green-600 bg-green-50 px-2 py-1.5 rounded border border-green-100"> <div v-if="configs.message" class="mx-4 mt-4 text-sm text-green-600 bg-green-50 px-3 py-2 rounded border border-green-100">
{{ configs.message }} {{ configs.message }}
</div> </div>
<div v-if="configs.error" class="mx-4 mt-4 text-xs text-red-600 bg-red-50 px-2 py-1.5 rounded border border-red-100"> <div v-if="configs.error" class="mx-4 mt-4 text-sm text-red-600 bg-red-50 px-3 py-2 rounded border border-red-100">
{{ configs.error }} {{ configs.error }}
</div> </div>
<!-- Add New Config Form --> <!-- Add New Config Form -->
<div class="p-4 bg-white border-b border-gray-100"> <div class="p-4 bg-white border-b border-gray-100">
<div class="flex flex-col md:flex-row gap-2 items-start md:items-center"> <div class="flex flex-col md:flex-row gap-3 items-start md:items-center">
<input <input
v-model="configs.newConfig.key" v-model="configs.newConfig.key"
type="text" type="text"
class="flex-1 w-full md:w-auto px-2 py-1.5 text-xs font-mono border border-gray-300 rounded focus:ring-1 focus:ring-blue-500" class="flex-1 w-full md:w-auto px-3 py-2 text-sm font-mono border border-gray-300 rounded focus:ring-1 focus:ring-blue-500"
placeholder="Key (e.g. workspace.repo)" placeholder="Key (e.g. workspace.repo)"
/> />
<input <input
v-model="configs.newConfig.description" v-model="configs.newConfig.description"
type="text" type="text"
class="flex-1 w-full md:w-auto px-2 py-1.5 text-xs border border-gray-300 rounded focus:ring-1 focus:ring-blue-500" class="flex-1 w-full md:w-auto px-3 py-2 text-sm border border-gray-300 rounded focus:ring-1 focus:ring-blue-500"
placeholder="描述" placeholder="描述"
/> />
<div class="relative flex-grow-[2] w-full md:w-auto"> <div class="relative flex-grow-[2] w-full md:w-auto">
<input <input
v-model="configs.newConfig.valueText" v-model="configs.newConfig.valueText"
type="text" type="text"
class="w-full px-2 py-1.5 text-xs font-mono border border-gray-300 rounded focus:ring-1 focus:ring-blue-500" class="w-full px-3 py-2 text-sm font-mono border border-gray-300 rounded focus:ring-1 focus:ring-blue-500"
placeholder='Value (JSON)' placeholder='Value (JSON)'
/> />
</div> </div>
<button <button
@click="createConfig" @click="createConfig"
:disabled="configs.saving" :disabled="configs.saving"
class="w-full md:w-auto px-3 py-1.5 bg-blue-600 text-white text-xs font-medium rounded hover:bg-blue-700 disabled:opacity-50 flex items-center justify-center gap-1" class="w-full md:w-auto px-4 py-2 bg-blue-600 text-white text-sm font-medium rounded hover:bg-blue-700 disabled:opacity-50 flex items-center justify-center gap-1"
> >
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" class="w-3.5 h-3.5"> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" class="w-4 h-4">
<path d="M10.75 4.75a.75.75 0 00-1.5 0v4.5h-4.5a.75.75 0 000 1.5h4.5v4.5a.75.75 0 001.5 0v-4.5h4.5a.75.75 0 000-1.5h-4.5v-4.5z" /> <path d="M10.75 4.75a.75.75 0 00-1.5 0v4.5h-4.5a.75.75 0 000 1.5h4.5v4.5a.75.75 0 001.5 0v-4.5h4.5a.75.75 0 000-1.5h-4.5v-4.5z" />
</svg> </svg>
新增 新增
@@ -165,43 +165,43 @@
<table class="min-w-full divide-y divide-gray-200"> <table class="min-w-full divide-y divide-gray-200">
<thead class="bg-gray-50"> <thead class="bg-gray-50">
<tr> <tr>
<th scope="col" class="px-3 py-2 text-left text-xs font-medium text-gray-500 uppercase tracking-wider w-1/4">Key</th> <th scope="col" class="px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider w-1/4">Key</th>
<th scope="col" class="px-3 py-2 text-left text-xs font-medium text-gray-500 uppercase tracking-wider w-1/4">描述</th> <th scope="col" class="px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider w-1/4">描述</th>
<th scope="col" class="px-3 py-2 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Value (JSON)</th> <th scope="col" class="px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Value (JSON)</th>
<th scope="col" class="px-3 py-2 text-right text-xs font-medium text-gray-500 uppercase tracking-wider w-20">操作</th> <th scope="col" class="px-4 py-3 text-right text-xs font-medium text-gray-500 uppercase tracking-wider w-24">操作</th>
</tr> </tr>
</thead> </thead>
<tbody class="bg-white divide-y divide-gray-200"> <tbody class="bg-white divide-y divide-gray-200">
<tr v-for="config in configs.items" :key="config.id" class="hover:bg-gray-50 group"> <tr v-for="config in configs.items" :key="config.id" class="hover:bg-gray-50 group">
<td class="px-3 py-1.5 align-top"> <td class="px-4 py-2 align-top">
<input <input
v-model="config.key" v-model="config.key"
type="text" type="text"
class="w-full text-xs font-mono bg-transparent border-none p-0 focus:ring-0 text-gray-900 placeholder-gray-400 group-hover:bg-white focus:bg-white rounded" class="w-full text-sm font-mono bg-transparent border-none p-0 focus:ring-0 text-gray-900 placeholder-gray-400 group-hover:bg-white focus:bg-white rounded px-1"
/> />
</td> </td>
<td class="px-3 py-1.5 align-top"> <td class="px-4 py-2 align-top">
<input <input
v-model="config.description" v-model="config.description"
type="text" type="text"
class="w-full text-xs bg-transparent border-none p-0 focus:ring-0 text-gray-600 group-hover:bg-white focus:bg-white rounded" class="w-full text-sm bg-transparent border-none p-0 focus:ring-0 text-gray-600 group-hover:bg-white focus:bg-white rounded px-1"
/> />
</td> </td>
<td class="px-3 py-1.5 align-top"> <td class="px-4 py-2 align-top">
<textarea <textarea
v-model="config.valueText" v-model="config.valueText"
rows="1" rows="1"
class="w-full text-xs font-mono bg-transparent border-transparent focus:border-blue-300 focus:ring-1 focus:ring-blue-200 text-gray-600 rounded px-1 py-0.5 resize-y min-h-[1.5rem]" class="w-full text-sm font-mono bg-transparent border-transparent focus:border-blue-300 focus:ring-1 focus:ring-blue-200 text-gray-600 rounded px-1 py-0.5 resize-y min-h-[1.75rem]"
@focus="$event.target.rows = 3" @focus="$event.target.rows = 3"
@blur="$event.target.rows = 1" @blur="$event.target.rows = 1"
></textarea> ></textarea>
</td> </td>
<td class="px-3 py-1.5 align-top text-right whitespace-nowrap"> <td class="px-4 py-2 align-top text-right whitespace-nowrap">
<div class="flex items-center justify-end gap-1 opacity-0 group-hover:opacity-100 focus-within:opacity-100 transition-opacity"> <div class="flex items-center justify-end gap-1 opacity-0 group-hover:opacity-100 focus-within:opacity-100 transition-opacity">
<button <button
@click="updateConfig(config)" @click="updateConfig(config)"
:disabled="config._saving" :disabled="config._saving"
class="p-1 text-blue-600 hover:bg-blue-50 rounded" class="p-1.5 text-blue-600 hover:bg-blue-50 rounded"
title="保存" title="保存"
> >
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" class="w-4 h-4"> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" class="w-4 h-4">
@@ -211,7 +211,7 @@
<button <button
@click="deleteConfig(config)" @click="deleteConfig(config)"
:disabled="config._deleting" :disabled="config._deleting"
class="p-1 text-red-600 hover:bg-red-50 rounded" class="p-1.5 text-red-600 hover:bg-red-50 rounded"
title="删除" title="删除"
> >
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" class="w-4 h-4"> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" class="w-4 h-4">
@@ -222,7 +222,7 @@
</td> </td>
</tr> </tr>
<tr v-if="configs.items.length === 0"> <tr v-if="configs.items.length === 0">
<td colspan="4" class="px-4 py-8 text-center text-xs text-gray-400"> <td colspan="4" class="px-4 py-8 text-center text-sm text-gray-400">
暂无配置数据 暂无配置数据
</td> </td>
</tr> </tr>