diff --git a/resources/js/components/admin/IpUserMappings.vue b/resources/js/components/admin/IpUserMappings.vue index 32bc956..2d442ac 100644 --- a/resources/js/components/admin/IpUserMappings.vue +++ b/resources/js/components/admin/IpUserMappings.vue @@ -1,142 +1,173 @@ @@ -167,7 +198,8 @@ export default { if (!value) { 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) { const contentType = response.headers.get('content-type') || ''; @@ -261,6 +293,7 @@ export default { this.message = '已新增映射'; this.newMapping = { ip_address: '', user_name: '', remark: '' }; await this.loadMappings(); + setTimeout(() => { this.message = ''; }, 3000); } catch (error) { this.error = error.message; } finally { @@ -299,6 +332,7 @@ export default { } this.message = '已更新映射'; + setTimeout(() => { this.message = ''; }, 3000); } catch (error) { this.error = error.message; } finally { @@ -306,6 +340,7 @@ export default { } }, async deleteMapping(mapping) { + if (!confirm('确定要删除吗?')) return; mapping._deleting = true; this.error = ''; this.message = ''; @@ -331,6 +366,7 @@ export default { this.message = '已删除映射'; await this.loadMappings(); + setTimeout(() => { this.message = ''; }, 3000); } catch (error) { this.error = error.message; } finally { diff --git a/resources/js/components/admin/OperationLogs.vue b/resources/js/components/admin/OperationLogs.vue index 7198e1f..a5d5b7b 100644 --- a/resources/js/components/admin/OperationLogs.vue +++ b/resources/js/components/admin/OperationLogs.vue @@ -1,120 +1,154 @@ @@ -159,7 +193,7 @@ export default { if (!value) { return '-'; } - return value.replace('T', ' ').replace('Z', ''); + return value.replace('T', ' ').replace('Z', '').substring(0, 19); }, hasPayload(payload) { return payload && Object.keys(payload).length > 0; @@ -167,6 +201,22 @@ export default { formatPayload(payload) { 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() { const params = new URLSearchParams(); params.set('page', String(this.logsPage)); @@ -193,7 +243,7 @@ export default { } 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.logsLastPage = pagination.last_page || 1; this.logsPage = pagination.current_page || 1; diff --git a/resources/js/components/admin/SystemSettings.vue b/resources/js/components/admin/SystemSettings.vue index f488909..9297ec2 100644 --- a/resources/js/components/admin/SystemSettings.vue +++ b/resources/js/components/admin/SystemSettings.vue @@ -4,9 +4,9 @@

系统设置

-

管理本地偏好与服务端全局配置

+

管理本地偏好与服务端全局配置

-
+
数据同步中...
@@ -18,24 +18,24 @@

JIRA 偏好

- Local + Local
- -
+ +
-

留空则使用服务端默认值。

+

留空则使用服务端默认值。

-
- +
+ {{ jira.message }}
-
+
{{ jira.error }}
-
-
+
+
生效用户: - {{ effectiveDefaultQueryUser || '-' }} + {{ effectiveDefaultQueryUser || '-' }}
-
+
服务端默认: {{ jira.serverDefaultUser || '-' }}
-
+
Host: {{ jira.host || '-' }}
@@ -99,7 +99,7 @@ v-if="isAdmin" @click="loadConfigs" :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="刷新列表" > @@ -117,42 +117,42 @@
-
+
{{ configs.message }}
-
+
{{ configs.error }}
-
+