Hide Classify Uncategorized button when AI categorization is disabled
Also checks that Ollama URL and model are configured before showing the button, consistent with the settings page behavior. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -4,6 +4,7 @@
|
|||||||
<h1 class="text-h4">Transactions</h1>
|
<h1 class="text-h4">Transactions</h1>
|
||||||
<v-spacer />
|
<v-spacer />
|
||||||
<v-btn
|
<v-btn
|
||||||
|
v-if="aiEnabled"
|
||||||
color="info"
|
color="info"
|
||||||
variant="tonal"
|
variant="tonal"
|
||||||
prepend-icon="mdi-brain"
|
prepend-icon="mdi-brain"
|
||||||
@@ -268,6 +269,7 @@ const editingTxn = ref(false)
|
|||||||
const editingTxnId = ref('')
|
const editingTxnId = ref('')
|
||||||
const useSplits = ref(false)
|
const useSplits = ref(false)
|
||||||
const splits = ref<SplitFormItem[]>([])
|
const splits = ref<SplitFormItem[]>([])
|
||||||
|
const aiEnabled = ref(false)
|
||||||
const classifying = ref(false)
|
const classifying = ref(false)
|
||||||
const classifySnackbar = ref(false)
|
const classifySnackbar = ref(false)
|
||||||
const classifySnackbarText = ref('')
|
const classifySnackbarText = ref('')
|
||||||
@@ -319,6 +321,10 @@ onMounted(async () => {
|
|||||||
if (props.id) {
|
if (props.id) {
|
||||||
txnForm.value.accountId = props.id
|
txnForm.value.accountId = props.id
|
||||||
}
|
}
|
||||||
|
try {
|
||||||
|
const { data } = await aiCategorizationApi.getSettings()
|
||||||
|
aiEnabled.value = data.isEnabled && !!data.ollamaUrl?.trim() && !!data.modelName?.trim()
|
||||||
|
} catch {}
|
||||||
})
|
})
|
||||||
|
|
||||||
watch(() => props.id, (newId) => {
|
watch(() => props.id, (newId) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user