|
463 | 463 |
|
464 | 464 | <!-- Model Packs Tab --> |
465 | 465 | <div v-if="activeTab === 'modelpacks'" class="tab-content admin-section"> |
466 | | - <plugin-slot name="project-admin:modelpacks" /> |
| 466 | + <plugin-slot |
| 467 | + name="project-admin:modelpacks" |
| 468 | + @model-service-linked="onMedcatteryModelLinked" |
| 469 | + /> |
467 | 470 | <model-packs-list |
468 | 471 | v-if="!showModelPackForm && !editingModelPack" |
469 | 472 | :model-packs="modelPacks" |
@@ -699,6 +702,32 @@ export default { |
699 | 702 | const response = await this.$http.get('/api/modelpacks/') |
700 | 703 | this.modelPacks = response.data.results || response.data |
701 | 704 | }, |
| 705 | + async onMedcatteryModelLinked(payload) { |
| 706 | + if (payload?.modelServiceUrl) { |
| 707 | + this.formData.use_model_service = true |
| 708 | + this.formData.model_service_url = payload.modelServiceUrl |
| 709 | + this.formData.model_pack = null |
| 710 | + this.formData.concept_db = null |
| 711 | + this.formData.vocab = null |
| 712 | + if (this.validationErrors.model_pack) { |
| 713 | + delete this.validationErrors.model_pack |
| 714 | + } |
| 715 | + if (this.validationErrors.concept_db) { |
| 716 | + delete this.validationErrors.concept_db |
| 717 | + } |
| 718 | + if (this.validationErrors.vocab) { |
| 719 | + delete this.validationErrors.vocab |
| 720 | + } |
| 721 | + if (this.validationErrors.model_config) { |
| 722 | + delete this.validationErrors.model_config |
| 723 | + } |
| 724 | + if (this.validationErrors.model_service_url) { |
| 725 | + delete this.validationErrors.model_service_url |
| 726 | + } |
| 727 | + } |
| 728 | + const label = payload?.label || 'model' |
| 729 | + this.$toast?.success(`Linked ${label} via MedCAT Service`) |
| 730 | + }, |
702 | 731 | async fetchUsers() { |
703 | 732 | const response = await this.$http.get('/api/users/') |
704 | 733 | this.users = response.data.results || response.data |
|
0 commit comments