debug: PeopleView on-screen debug message
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
<template>
|
||||
<div class="people-view">
|
||||
<div v-if="debugMsg" class="debug-msg">{{ debugMsg }}</div>
|
||||
<div class="ms-ppl-toolbar">
|
||||
<h1 class="ms-ppl-section-title">People</h1>
|
||||
<div class="ms-ppl-search-wrap">
|
||||
@@ -115,6 +116,7 @@ import VideoPlayer from '../components/VideoPlayer.vue'
|
||||
|
||||
const people = ref<any[]>([])
|
||||
const loading = ref(true)
|
||||
const debugMsg = ref('')
|
||||
const searchQuery = ref('')
|
||||
const searchResults = ref<any[]>([])
|
||||
const isSearching = ref(false)
|
||||
@@ -142,14 +144,16 @@ const filteredPeople = computed(() => {
|
||||
})
|
||||
|
||||
onMounted(async () => {
|
||||
debugMsg.value = 'PeopleView mounted! Loading...'
|
||||
try {
|
||||
const result: any = await invoke('get_people', { page: 1, per_page: 1000 })
|
||||
console.log('get_people result:', result, Array.isArray(result), result?.length)
|
||||
debugMsg.value = `get_people: ${Array.isArray(result)} length=${result?.length ?? 'N/A'}`
|
||||
people.value = Array.isArray(result) ? result : []
|
||||
} catch (e) {
|
||||
console.error('Failed to load people:', e)
|
||||
} catch (e: any) {
|
||||
debugMsg.value = `Error: ${e.message || e}`
|
||||
} finally {
|
||||
loading.value = false
|
||||
debugMsg.value += `, people=${people.value.length}, loading=false`
|
||||
}
|
||||
})
|
||||
|
||||
@@ -249,6 +253,7 @@ watch(showCandidates, (v) => { if (v) loadCandidates() })
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.debug-msg { background: #fef3c7; color: #92400e; padding: 8px 12px; border-radius: 8px; margin-bottom: 12px; font-size: 0.85rem; font-family: monospace; }
|
||||
.people-view { max-width: 1200px; }
|
||||
h1 { margin: 0; }
|
||||
.loading-state, .empty { text-align: center; padding: 60px 0; color: #5f6368; }
|
||||
|
||||
Reference in New Issue
Block a user