Add initial implementation for loading proflies

This commit is contained in:
Kevin Thomas
2021-08-03 19:14:54 -07:00
parent 8796dc137b
commit 1e896fd8db
4 changed files with 120 additions and 36 deletions

View File

@@ -21,13 +21,22 @@
Profiles
</h2>
<v-select
v-model="selectedProfile"
:items="profileItems"
label="Profiles"
class="mx-3"
@click="loadProfiles"
/>
<v-row justify="center">
<v-select
v-model="selectedProfile"
:items="profileItems"
label="Profiles"
class="mx-3"
@click="populateProfileItems"
/>
<v-btn
class="mx-3 mb-5"
@click="loadProfile"
>
Load Profile
</v-btn>
</v-row>
<v-dialog
v-model="profileDialog"

View File

@@ -131,7 +131,7 @@ export default {
this.noise.connect(this.filter)
}
},
loadProfiles () {
populateProfileItems () {
this.$http.get('https://localhost:3000/profiles')
.then(response => {
if (response.status === 200) {
@@ -170,6 +170,17 @@ export default {
})
this.profileDialog = false
},
loadProfile () {
this.$http.get('https://localhost:3000/profiles/'.concat(this.profileItems.indexOf(this.selectedProfile) + 1))
.then(response => {
if (response.status === 200) {
console.log(response.data.profile)
}
})
.catch(function (error) {
console.error(error.response)
})
}
}
}