Files
FabledCurator/frontend/src/components/settings/MLThresholdSliders.vue
T
bvandeusen cd7721fb03 feat(fc2b): Settings Maintenance tab
MaintenancePanel hosts: backfill + centroid recompute trigger cards,
the five suggestion-threshold sliders (autosave on slider release),
the allowlist table (inline editable min_confidence, delete), and the
alias table (mapping display, delete). Wired as a third Settings tab,
ML settings loaded lazily when the tab opens.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-15 07:57:42 -04:00

41 lines
1.3 KiB
Vue

<template>
<v-card>
<v-card-title>Suggestion thresholds</v-card-title>
<v-card-text v-if="store.settings">
<v-row v-for="f in fields" :key="f.key">
<v-col cols="12">
<v-slider
v-model="local[f.key]" :label="f.label"
min="0" max="1" step="0.05" thumb-label hide-details
color="accent" @end="save"
/>
</v-col>
</v-row>
</v-card-text>
<v-card-text v-else><v-skeleton-loader type="paragraph" /></v-card-text>
</v-card>
</template>
<script setup>
import { reactive, watch } from 'vue'
import { useMLStore } from '../../stores/ml.js'
const store = useMLStore()
const fields = [
{ key: 'suggestion_threshold_artist', label: 'Artist' },
{ key: 'suggestion_threshold_character', label: 'Character' },
{ key: 'suggestion_threshold_copyright', label: 'Copyright' },
{ key: 'suggestion_threshold_general', label: 'General' },
{ key: 'centroid_similarity_threshold', label: 'Centroid similarity' }
]
const local = reactive({})
watch(() => store.settings, (s) => { if (s) Object.assign(local, s) }, { immediate: true })
async function save() {
const patch = {}
for (const f of fields) patch[f.key] = local[f.key]
try { await store.patchSettings(patch) }
catch (e) { window.__fcToast?.({ text: e.message, type: 'error' }) }
}
</script>