Skip to content

Commit

Permalink
fix inject in vue
Browse files Browse the repository at this point in the history
  • Loading branch information
mam10eks committed Dec 4, 2024
1 parent bcdd449 commit 67acebb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
5 changes: 3 additions & 2 deletions frontend/src/components/RunActions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ export default {
userinfo: inject('userinfo') as UserInfo,
start_evaluation_is_pending: false,
delete_is_pending: false,
grpc_url: inject("gRPC base URL")
}
},
computed: {
Expand All @@ -170,14 +171,14 @@ export default {
methods: {
runEvaluation(isActive: any) {
this.start_evaluation_is_pending = true;
get(inject("gRPC base URL") + `/grpc/${this.run.vm_id}/run_eval/${this.run.dataset_id}/${this.run.run_id}`)
get(this.grpc_url + `/grpc/${this.run.vm_id}/run_eval/${this.run.dataset_id}/${this.run.run_id}`)
.then(reportSuccess('Successfully started the evaluation of run with id ' + this.run.run_id))
.catch(reportError('Failed to start the evaluation of run with id ' + this.run.run_id, 'Maybe this is a short hiccupp, please try again.'))
.then(() => { this.start_evaluation_is_pending = false; isActive.value = false })
},
deleteRun(isActive: any) {
this.delete_is_pending = true;
get(inject("gRPC base URL") + `/grpc/${this.run.vm_id}/run_delete/${this.run.dataset_id}/${this.run.run_id}`)
get(this.grpc_url + `/grpc/${this.run.vm_id}/run_delete/${this.run.dataset_id}/${this.run.run_id}`)
.then(reportSuccess('Successfully deleted the run with id ' + this.run.run_id))
.catch(reportError('Failed to delete the run with id ' + this.run.run_id, 'Maybe this is a short hiccupp, please try again.'))
.then(() => { this.delete_is_pending = false; isActive.value = false })
Expand Down
8 changes: 5 additions & 3 deletions frontend/src/submission-components/RunningProcesses.vue
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,9 @@ export default {
poll_in_progress: false,
selectedRuns: null,
pollSoftwareInterval: null,
abortedProcesses: []
abortedProcesses: [],
grpc_url: inject("gRPC base URL"),
rest_url: inject("REST base URL")
}
},
computed: {
Expand All @@ -174,7 +176,7 @@ export default {
stopRun(run_id) {
if (!(this.abortedProcesses.includes(run_id))) {
this.abortedProcesses.push(run_id)
get(inject("gRPC base URL") + `/grpc/${this.task_id}/${this.user_id_for_task}/stop_docker_software/${run_id}`)
get(this.grpc_url + `/grpc/${this.task_id}/${this.user_id_for_task}/stop_docker_software/${run_id}`)
.then(reportSuccess('Run with the id ' + run_id + " was successfully aborted!"))
.catch(reportError("Problem while trying to abort the process with id: " + run_id))
}
Expand All @@ -188,7 +190,7 @@ export default {
}
this.poll_in_progress = true
get(inject("REST base URL") + `/api/task/${this.task_id}/user/${this.user_id_for_task}/software/running/${force_cache_refresh}`)
get(this.rest_url + `/api/task/${this.task_id}/user/${this.user_id_for_task}/software/running/${force_cache_refresh}`)
.then(inject_response(this, { 'loading': false }))
.catch(reportError("Problem While polling running software."))
.then(message => {
Expand Down

0 comments on commit 67acebb

Please sign in to comment.