modify ui
This commit is contained in:
@@ -348,7 +348,7 @@ const translate = async () => {
|
|||||||
<input
|
<input
|
||||||
v-model="settings.ollamaApiAddress"
|
v-model="settings.ollamaApiAddress"
|
||||||
type="text"
|
type="text"
|
||||||
class="w-full px-4 py-2 border rounded-lg focus:ring-2 focus:ring-blue-500/20 focus:border-blue-500 outline-none transition-all"
|
class="w-full px-4 py-2 border rounded-lg focus:ring-2 focus:ring-blue-500/20 focus:border-blue-500 outline-none transition-all font-mono"
|
||||||
placeholder="http://localhost:11434"
|
placeholder="http://localhost:11434"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
@@ -414,7 +414,7 @@ const translate = async () => {
|
|||||||
class="text-xs text-red-600 hover:underline flex items-center gap-1"
|
class="text-xs text-red-600 hover:underline flex items-center gap-1"
|
||||||
>
|
>
|
||||||
<Trash2 class="w-3 h-3" />
|
<Trash2 class="w-3 h-3" />
|
||||||
清空全部日志
|
清空
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="bg-white rounded-xl shadow-sm border p-4 space-y-4">
|
<div class="bg-white rounded-xl shadow-sm border p-4 space-y-4">
|
||||||
@@ -430,7 +430,7 @@ const translate = async () => {
|
|||||||
<span class="text-slate-400">[{{ log.timestamp }}]</span>
|
<span class="text-slate-400">[{{ log.timestamp }}]</span>
|
||||||
<span
|
<span
|
||||||
:class="cn(
|
:class="cn(
|
||||||
'px-2 py-0.5 rounded uppercase font-bold text-[9px]',
|
'px-2 py-0.5 rounded uppercase font-bold text-[11px]',
|
||||||
log.type === 'request' ? 'bg-blue-100 text-blue-700' :
|
log.type === 'request' ? 'bg-blue-100 text-blue-700' :
|
||||||
log.type === 'response' ? 'bg-green-100 text-green-700' :
|
log.type === 'response' ? 'bg-green-100 text-green-700' :
|
||||||
'bg-red-100 text-red-700'
|
'bg-red-100 text-red-700'
|
||||||
|
|||||||
@@ -44,8 +44,11 @@ export const useSettingsStore = defineStore('settings', () => {
|
|||||||
const logs = ref<{ timestamp: string; type: 'request' | 'response' | 'error'; content: any }[]>([]);
|
const logs = ref<{ timestamp: string; type: 'request' | 'response' | 'error'; content: any }[]>([]);
|
||||||
|
|
||||||
const addLog = (type: 'request' | 'response' | 'error', content: any) => {
|
const addLog = (type: 'request' | 'response' | 'error', content: any) => {
|
||||||
|
const now = new Date();
|
||||||
|
const timestamp = `${now.getFullYear()}-${String(now.getMonth() + 1).padStart(2, '0')}-${String(now.getDate()).padStart(2, '0')} ${String(now.getHours()).padStart(2, '0')}:${String(now.getMinutes()).padStart(2, '0')}:${String(now.getSeconds()).padStart(2, '0')}`;
|
||||||
|
|
||||||
logs.value.unshift({
|
logs.value.unshift({
|
||||||
timestamp: new Date().toLocaleTimeString(),
|
timestamp,
|
||||||
type,
|
type,
|
||||||
content
|
content
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user