Make the origin override persistent
The dev tools pane now remembers the last address you entered in "override origin" to save a few clicks when doing local Vue development
This commit is contained in:
parent
f4e3f1f277
commit
2b3c0a9bac
1 changed files with 8 additions and 5 deletions
|
|
@ -2,7 +2,7 @@
|
||||||
<div>
|
<div>
|
||||||
<form class="uk-form-stacked" @submit.prevent="overrideAPIHost">
|
<form class="uk-form-stacked" @submit.prevent="overrideAPIHost">
|
||||||
<label class="uk-form-label">Override API origin</label>
|
<label class="uk-form-label">Override API origin</label>
|
||||||
<input v-model="currentOrigin" class="uk-input" type="text" />
|
<input v-model="newOrigin" class="uk-input" type="text" />
|
||||||
<button class="uk-button uk-button-default uk-margin-small">
|
<button class="uk-button uk-button-default uk-margin-small">
|
||||||
Apply
|
Apply
|
||||||
</button>
|
</button>
|
||||||
|
|
@ -19,19 +19,22 @@ export default {
|
||||||
|
|
||||||
data: function() {
|
data: function() {
|
||||||
return {
|
return {
|
||||||
currentOrigin: this.$store.state.origin
|
newOrigin: this.$store.state.origin
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
mounted() {
|
mounted() {
|
||||||
if (!this.$store.getters.ready) {
|
if (localStorage.overrideOrigin){
|
||||||
this.currentOrigin = "http://microscope.local:5000";
|
this.newOrigin = localStorage.overrideOrigin;
|
||||||
|
}else{
|
||||||
|
this.newOrigin = "http://microscope.local:5000";
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
overrideAPIHost: function() {
|
overrideAPIHost: function() {
|
||||||
this.$store.commit("changeOrigin", this.currentOrigin);
|
this.$store.commit("changeOrigin", this.newOrigin);
|
||||||
|
localStorage.overrideOrigin = this.newOrigin
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue