4141 </div >
4242 </div >
4343
44- <div class =" flex justify-between items-center mt-8" >
44+ <div class =" flex justify-between items-center" >
45+ <h3 >{{ $t('credits.activity') }}</h3 >
4546 <Button
4647 :label =" $t('credits.invoiceHistory')"
4748 text
8182
8283 <Divider />
8384
85+ <UsageLogsTable ref =" usageLogsTableRef" />
86+
8487 <div class =" flex flex-row gap-2" >
8588 <Button
8689 :label =" $t('credits.faqs')"
@@ -108,10 +111,11 @@ import DataTable from 'primevue/datatable'
108111import Divider from ' primevue/divider'
109112import Skeleton from ' primevue/skeleton'
110113import TabPanel from ' primevue/tabpanel'
111- import { computed , ref } from ' vue'
114+ import { computed , ref , watch } from ' vue'
112115import { useI18n } from ' vue-i18n'
113116
114117import UserCredit from ' @/components/common/UserCredit.vue'
118+ import UsageLogsTable from ' @/components/dialog/content/setting/UsageLogsTable.vue'
115119import { useFirebaseAuthActions } from ' @/composables/auth/useFirebaseAuthActions'
116120import { useDialogService } from ' @/services/dialogService'
117121import { useFirebaseAuthStore } from ' @/stores/firebaseAuthStore'
@@ -131,12 +135,23 @@ const authActions = useFirebaseAuthActions()
131135const loading = computed (() => authStore .loading )
132136const balanceLoading = computed (() => authStore .isFetchingBalance )
133137
138+ const usageLogsTableRef = ref <InstanceType <typeof UsageLogsTable > | null >(null )
139+
134140const formattedLastUpdateTime = computed (() =>
135141 authStore .lastBalanceUpdateTime
136142 ? authStore .lastBalanceUpdateTime .toLocaleString ()
137143 : ' '
138144)
139145
146+ watch (
147+ () => authStore .lastBalanceUpdateTime ,
148+ (newTime , oldTime ) => {
149+ if (newTime && newTime !== oldTime && usageLogsTableRef .value ) {
150+ usageLogsTableRef .value .refresh ()
151+ }
152+ }
153+ )
154+
140155const handlePurchaseCreditsClick = () => {
141156 dialogService .showTopUpCreditsDialog ()
142157}
0 commit comments