41
41
</div >
42
42
</div >
43
43
44
- <div class =" flex justify-between items-center mt-8" >
44
+ <div class =" flex justify-between items-center" >
45
+ <h3 >{{ $t('credits.activity') }}</h3 >
45
46
<Button
46
47
:label =" $t('credits.invoiceHistory')"
47
48
text
81
82
82
83
<Divider />
83
84
85
+ <UsageLogsTable ref =" usageLogsTableRef" />
86
+
84
87
<div class =" flex flex-row gap-2" >
85
88
<Button
86
89
:label =" $t('credits.faqs')"
@@ -108,10 +111,11 @@ import DataTable from 'primevue/datatable'
108
111
import Divider from ' primevue/divider'
109
112
import Skeleton from ' primevue/skeleton'
110
113
import TabPanel from ' primevue/tabpanel'
111
- import { computed , ref } from ' vue'
114
+ import { computed , ref , watch } from ' vue'
112
115
import { useI18n } from ' vue-i18n'
113
116
114
117
import UserCredit from ' @/components/common/UserCredit.vue'
118
+ import UsageLogsTable from ' @/components/dialog/content/setting/UsageLogsTable.vue'
115
119
import { useFirebaseAuthActions } from ' @/composables/auth/useFirebaseAuthActions'
116
120
import { useDialogService } from ' @/services/dialogService'
117
121
import { useFirebaseAuthStore } from ' @/stores/firebaseAuthStore'
@@ -131,12 +135,23 @@ const authActions = useFirebaseAuthActions()
131
135
const loading = computed (() => authStore .loading )
132
136
const balanceLoading = computed (() => authStore .isFetchingBalance )
133
137
138
+ const usageLogsTableRef = ref <InstanceType <typeof UsageLogsTable > | null >(null )
139
+
134
140
const formattedLastUpdateTime = computed (() =>
135
141
authStore .lastBalanceUpdateTime
136
142
? authStore .lastBalanceUpdateTime .toLocaleString ()
137
143
: ' '
138
144
)
139
145
146
+ watch (
147
+ () => authStore .lastBalanceUpdateTime ,
148
+ (newTime , oldTime ) => {
149
+ if (newTime && newTime !== oldTime && usageLogsTableRef .value ) {
150
+ usageLogsTableRef .value .refresh ()
151
+ }
152
+ }
153
+ )
154
+
140
155
const handlePurchaseCreditsClick = () => {
141
156
dialogService .showTopUpCreditsDialog ()
142
157
}
0 commit comments