Commit fd487f12 authored by Vikas's avatar Vikas

Add weather settings component

parent ac8c5e4c
var Contacts_Component_WeatherSettings = VTAP.Component.Core.extend({
data() {
return {
key : '' //placeholder to store the key
}
},
created() {
//get if the key already exists
VTAP.AppData.Get('Contacts', {"data_key":"weather_apikey"}, (error, success) => {
if(success && success.length) {
this.key = success[0]['data_value'];
}
});
},
methods : {
save() {
//save the key
VTAP.AppData.Save('Contacts', {"data_key":"weather_apikey", "data_value":this.key, onlyadmin : true}, (error, success) => {
if(success) {
VTAP.Utility.ShowSuccessNotification();
}
});
}
},
template:
`<b-modal size="md" title="Weather API Key" @ok="save()" :ok-title="translate('LBL_SAVE')">
<div class='p-4'>
<div class='align-items-center d-flex justify-content-center'>
<div class='col-3'>API Key</div>
<div class='col-9'><input type="text" class='form-control' v-model="key"></div>
</div>
</div>
</b-modal>`
});
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment