diff --git a/frontend/src/components/settings/HeadsCard.vue b/frontend/src/components/settings/HeadsCard.vue new file mode 100644 index 0000000..673ff1f --- /dev/null +++ b/frontend/src/components/settings/HeadsCard.vue @@ -0,0 +1,241 @@ + + + + + diff --git a/frontend/src/components/settings/MaintenancePanel.vue b/frontend/src/components/settings/MaintenancePanel.vue index 68c30d1..44dafe6 100644 --- a/frontend/src/components/settings/MaintenancePanel.vue +++ b/frontend/src/components/settings/MaintenancePanel.vue @@ -26,6 +26,7 @@

+ @@ -52,6 +53,7 @@ import ArchiveReextractCard from './ArchiveReextractCard.vue' import MissingFileRepairCard from './MissingFileRepairCard.vue' import DbMaintenanceCard from './DbMaintenanceCard.vue' import MLThresholdSliders from './MLThresholdSliders.vue' +import HeadsCard from './HeadsCard.vue' import AllowlistTable from './AllowlistTable.vue' import AliasTable from './AliasTable.vue' import TagEvalCard from './TagEvalCard.vue' diff --git a/frontend/src/stores/heads.js b/frontend/src/stores/heads.js new file mode 100644 index 0000000..c1f481e --- /dev/null +++ b/frontend/src/stores/heads.js @@ -0,0 +1,24 @@ +import { defineStore } from 'pinia' + +import { useApi } from '../composables/useApi.js' + +// Heads (#114): the per-concept classifiers that LEARN from your tags and power +// suggestions (replacing Camie + centroid). Training runs as a background task; +// the card rehydrates status from GET /api/heads on mount so it survives +// navigation (the run lives in head_training_run server-side). +export const useHeadsStore = defineStore('heads', () => { + const api = useApi() + + // Summary: head_count, graduated_count, last_trained_at, running_id, the + // per-concept head table, and recent training runs. + async function status() { + return await api.get('/api/heads') + } + + // (Re)train all eligible heads. One run at a time (409 if already running). + async function train(params = {}) { + return await api.post('/api/heads/train', { body: { params } }) + } + + return { status, train } +})