mirror of
https://github.com/kaythomas0/noisedash.git
synced 2025-11-18 22:18:04 +00:00
Add initial implementation for loading proflies
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -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)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user