Skip to content
This repository has been archived by the owner on Jan 19, 2023. It is now read-only.

Commit

Permalink
added confing in file view remove porpes can know be removed
Browse files Browse the repository at this point in the history
  • Loading branch information
antidodo committed Nov 16, 2021
1 parent b04296d commit a105790
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/components/localTrains/showUploadedFiles.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
<a v-on:click="addEntrypointFile(file)" class="dropdown-item">
Entrypoint
</a>
<a v-on:click="removePurpose(file)" class="dropdown-item">
no
</a>
</div>
</div>
</div>
Expand Down Expand Up @@ -122,7 +125,18 @@ export default {
this.dropDownDict[file] = false;
this.$emit('refresh');
},
async removePurpose(file){
let key = this.getKey(file);
console.log(key);
let url = `${process.env.VUE_APP_STATION_API}/localTrains/RemoveConfigElement/${this.selectedTrain["train_id"]}/${key}`;
await axios.put(url).then(response => {console.log(response)});
this.dropDownDict[file] = false;
this.$emit('refresh');
},
getKey(file){
let config = this.selectedTrain["airflow_config_json"];
return Object.keys(config).find(key => config[key] === file);
}
},
mounted() {
this.loadFileNames(this.selectedTrain);
Expand Down

0 comments on commit a105790

Please sign in to comment.