|
@@ -1,17 +1,21 @@ |
|
|
<template> |
|
|
<template> |
|
|
<div> |
|
|
<div> |
|
|
<h4>Default Options</h4> |
|
|
|
|
|
<small class="help-text">default options are saved locally</small> |
|
|
|
|
|
|
|
|
<div class="form-group"> |
|
|
|
|
|
<input id="login" |
|
|
|
|
|
name="login" |
|
|
|
|
|
type="text" |
|
|
|
|
|
class="form-control" |
|
|
|
|
|
placeholder="Login" |
|
|
|
|
|
autocomplete="off" |
|
|
|
|
|
autocorrect="off" |
|
|
|
|
|
autocapitalize="none" |
|
|
|
|
|
v-model="defaultPassword.login"> |
|
|
|
|
|
</div> |
|
|
<options v-bind:password="defaultPassword" v-on:optionsUpdated="updatePassword"></options> |
|
|
<options v-bind:password="defaultPassword" v-on:optionsUpdated="updatePassword"></options> |
|
|
<div class="form-group"> |
|
|
<div class="form-group"> |
|
|
<button type="button" class="btn btn-primary" v-on:click="saveDefault"> |
|
|
|
|
|
<span v-if="optionsSaved"> |
|
|
|
|
|
<i class="fa fa-check" aria-hidden="true"></i> saved |
|
|
|
|
|
</span> |
|
|
|
|
|
<span v-else> |
|
|
|
|
|
Save |
|
|
|
|
|
</span> |
|
|
|
|
|
</button> |
|
|
|
|
|
|
|
|
<div class="alert alert-info" role="alert"> |
|
|
|
|
|
Default options are saved <strong>locally</strong></small> |
|
|
|
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</template> |
|
|
</template> |
|
@@ -28,22 +32,12 @@ |
|
|
computed: mapGetters(['defaultPassword']), |
|
|
computed: mapGetters(['defaultPassword']), |
|
|
data(){ |
|
|
data(){ |
|
|
return { |
|
|
return { |
|
|
options: null, |
|
|
|
|
|
optionsSaved: false |
|
|
optionsSaved: false |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
saveDefault(){ |
|
|
|
|
|
if (this.options !== null) { |
|
|
|
|
|
this.$store.dispatch('saveDefaultPassword', {password: this.options}); |
|
|
|
|
|
} |
|
|
|
|
|
this.optionsSaved = true; |
|
|
|
|
|
setTimeout(() => { |
|
|
|
|
|
this.optionsSaved = false; |
|
|
|
|
|
}, 3000); |
|
|
|
|
|
}, |
|
|
|
|
|
updatePassword(password){ |
|
|
updatePassword(password){ |
|
|
this.options = password; |
|
|
|
|
|
|
|
|
this.$store.dispatch('saveDefaultPassword', {password}); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|