|
|
|
|
@ -2,6 +2,9 @@ Template.livechatIntegrations.helpers({ |
|
|
|
|
webhookUrl() { |
|
|
|
|
return Template.instance().settingValue.get(); |
|
|
|
|
}, |
|
|
|
|
secretToken() { |
|
|
|
|
return Template.instance().secretToken.get(); |
|
|
|
|
}, |
|
|
|
|
disableTest() { |
|
|
|
|
return Template.instance().disableTest.get(); |
|
|
|
|
}, |
|
|
|
|
@ -16,6 +19,7 @@ Template.livechatIntegrations.helpers({ |
|
|
|
|
Template.livechatIntegrations.onCreated(function() { |
|
|
|
|
this.disableTest = new ReactiveVar(true); |
|
|
|
|
this.settingValue = new ReactiveVar(); |
|
|
|
|
this.secretToken = new ReactiveVar(); |
|
|
|
|
this.sendOnClose = new ReactiveVar(); |
|
|
|
|
this.sendOnOffline = new ReactiveVar(); |
|
|
|
|
|
|
|
|
|
@ -24,6 +28,10 @@ Template.livechatIntegrations.onCreated(function() { |
|
|
|
|
this.settingValue.set(RocketChat.settings.get('Livechat_webhookUrl')); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
this.autorun(() => { |
|
|
|
|
this.secretToken.set(RocketChat.settings.get('Livechat_secret_token')); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
this.autorun(() => { |
|
|
|
|
this.sendOnClose.set(RocketChat.settings.get('Livechat_webhook_on_close')); |
|
|
|
|
}); |
|
|
|
|
@ -62,6 +70,10 @@ Template.livechatIntegrations.events({ |
|
|
|
|
_id: 'Livechat_webhookUrl', |
|
|
|
|
value: s.trim(instance.$('#webhookUrl').val()) |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
_id: 'Livechat_secret_token', |
|
|
|
|
value: s.trim(instance.$('#secretToken').val()) |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
_id: 'Livechat_webhook_on_close', |
|
|
|
|
value: instance.$('#sendOnClose').get(0).checked |
|
|
|
|
|