From b4d7fd48d4fa90562a7dcf7937794a28bb88a906 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maik=20Fr=C3=B6be?= Date: Wed, 4 Dec 2024 13:04:47 +0100 Subject: [PATCH] mf --- frontend/src/components/RegisterForm.vue | 7 ++++--- frontend/src/components/RunReviewForm.vue | 9 +++++---- frontend/src/components/RunReviewWindow.vue | 3 ++- frontend/src/components/SoftwareDetails.vue | 3 ++- frontend/src/components/TiraTaskAdmin.vue | 3 ++- 5 files changed, 15 insertions(+), 10 deletions(-) diff --git a/frontend/src/components/RegisterForm.vue b/frontend/src/components/RegisterForm.vue index 1e2b7673..00b99d07 100644 --- a/frontend/src/components/RegisterForm.vue +++ b/frontend/src/components/RegisterForm.vue @@ -94,7 +94,8 @@ export default { showInstructorClasses: ['Undergraduate Student', 'Course', 'Thesis'], nameRules: [validateTeamName], notEmptyRules: [validateNotEmpty], emailRules: [validateEmail], remaining_team_names: [''], - userinfo: inject('userinfo') as UserInfo + userinfo: inject('userinfo') as UserInfo, + rest_url: inject("REST base URL") }), methods: { async submitRegistration (isActive: any) { @@ -102,7 +103,7 @@ export default { if (valid) { this.loading = true - post(inject("REST base URL")+'/api/registration/add_registration/vm/'+ this.task.task_id, { + post(this.rest_url +'/api/registration/add_registration/vm/'+ this.task.task_id, { 'username': this.username, 'email': this.email, 'affiliation': this.affiliation, 'country': this.country, 'employment': this.selectedEmployment, 'group': this.username, 'participation': this.selectedParticipation, 'instructorName': this.instructorName, 'instructorEmail': this.instructorEmail, @@ -138,7 +139,7 @@ export default { contact_organizer() {return get_contact_link_to_organizer(this.task.organizer_id);}, }, beforeMount() { - get(inject("REST base URL")+'/api/registration_formular/' + this.task.task_id) + get(this.rest_url +'/api/registration_formular/' + this.task.task_id) .then(inject_response(this, {'loading': false})) .catch(reportError("Problem While Loading the registration formular.", "This might be a short-term hiccup, please try again. We got the following error: ")) }, diff --git a/frontend/src/components/RunReviewForm.vue b/frontend/src/components/RunReviewForm.vue index a42710b9..04a7c809 100644 --- a/frontend/src/components/RunReviewForm.vue +++ b/frontend/src/components/RunReviewForm.vue @@ -88,6 +88,7 @@ export default { toggle_publish_in_progress: false, toggle_visible_in_progress: false, userinfo: inject('userinfo') as UserInfo, + rest_url: inject("REST base URL"), } }, computed: { @@ -101,7 +102,7 @@ export default { methods: { togglePublish() { this.toggle_publish_in_progress = true - get(inject("REST base URL")+'/publish/' + this.vm_id + '/' + this.ds_id() + '/' + this.run_id + '/' + !this.review.published) + get(this.rest_url+'/publish/' + this.vm_id + '/' + this.ds_id() + '/' + this.run_id + '/' + !this.review.published) .then(message => {this.review.published = message.published}) .catch(reportError("Problem While (un)publishing the run.", "This might be a short-term hiccup, please try again. We got the following error: ")) .then(() => { this.toggle_publish_in_progress = false }) @@ -109,7 +110,7 @@ export default { }, toggleVisible() { this.toggle_visible_in_progress = true - get(inject("REST base URL")+`/blind/${this.vm_id}/${this.ds_id()}/${this.run_id}/${!this.review.blinded}`) + get(this.rest_url+`/blind/${this.vm_id}/${this.ds_id()}/${this.run_id}/${!this.review.blinded}`) .then(message => {this.review.blinded = message.blinded}) .catch(reportError("Problem While (un)blinding the run.", "This might be a short-term hiccup, please try again. We got the following error: ")) .then(() => { this.toggle_visible_in_progress = false }) @@ -117,7 +118,7 @@ export default { }, submitReview() { this.edit_review_in_progress = true - post(inject("REST base URL")+`/tira-admin/edit-review/${this.ds_id()}/${this.vm_id}/${this.run_id}`, { + post(this.rest_url+`/tira-admin/edit-review/${this.ds_id()}/${this.vm_id}/${this.run_id}`, { 'no_errors': this.review.noErrors, 'output_error': this.review.invalidOutput, 'software_error': this.review.otherErrors, @@ -134,7 +135,7 @@ export default { beforeMount() { this.loading = true - get(inject("REST base URL")+'/api/review/' + this.ds_id() + '/' + this.vm_id + '/' + this.run_id) + get(this.rest_url+'/api/review/' + this.ds_id() + '/' + this.vm_id + '/' + this.run_id) .then(inject_response(this, {'loading': false})) .catch(reportError("Problem While Loading the Review", "This might be a short-term hiccup, please try again. We got the following error: ")) } diff --git a/frontend/src/components/RunReviewWindow.vue b/frontend/src/components/RunReviewWindow.vue index 61aa2a1c..6475efb6 100644 --- a/frontend/src/components/RunReviewWindow.vue +++ b/frontend/src/components/RunReviewWindow.vue @@ -54,6 +54,7 @@ export default { loading: true, evaluation_data: {}, text: 'saa', + rest_url: inject("REST base URL") } }, computed: { @@ -71,7 +72,7 @@ export default { methods: { clicked: function() { this.loading = true - get(inject("REST base URL")+'/api/evaluations_of_run/' + this.vm_id + '/' + this.run_id) + get(this.rest_url +'/api/evaluations_of_run/' + this.vm_id + '/' + this.run_id) .then(inject_response(this, {'loading': false})) .catch(reportError("Problem While Loading the the runs and evaluations for review", "This might be a short-term hiccup, please try again. We got the following error: ")) } diff --git a/frontend/src/components/SoftwareDetails.vue b/frontend/src/components/SoftwareDetails.vue index 284589d6..d033b5a7 100644 --- a/frontend/src/components/SoftwareDetails.vue +++ b/frontend/src/components/SoftwareDetails.vue @@ -134,6 +134,7 @@ export default { selectedComponentTab: 'details', tab: '', component_tab: '', + rest_url: inject("REST base URL") } }, computed: { @@ -152,7 +153,7 @@ export default { methods: { fetchData() { this.loading = true - get(inject("REST base URL") + '/task/' + this.task_id + '/vm/' + this.run.vm_id + '/run_details/' + this.run.run_id) + get(this.rest_url + '/task/' + this.task_id + '/vm/' + this.run.vm_id + '/run_details/' + this.run.run_id) .then(inject_response(this, { 'loading': false })) .catch(() => { this.details_not_visible = true; this.loading = false }) }, diff --git a/frontend/src/components/TiraTaskAdmin.vue b/frontend/src/components/TiraTaskAdmin.vue index 24748df5..52bd9e9b 100644 --- a/frontend/src/components/TiraTaskAdmin.vue +++ b/frontend/src/components/TiraTaskAdmin.vue @@ -108,6 +108,7 @@ export default { task_id: extractTaskFromCurrentUrl() as string, selectedDataset: '', selectedDatasetForDelete: '', + rest_url: inject("REST base URL") } }, methods: { @@ -117,7 +118,7 @@ export default { }, deleteDataset(x: any) { if (x['action'] == 'delete_dataset') { - get(inject("REST base URL") + '/tira-admin/delete-dataset/' + x['dataset_id']) + get(this.rest_url + '/tira-admin/delete-dataset/' + x['dataset_id']) .then(() => { this.$emit('delete-dataset', x['dataset_id']) this.selectedDatasetForDelete = ''