Browse Source

Added callflow node to send webhook

Changed icons of new modules to be unique
pull/3/head
Remco van Vugt 8 years ago
parent
commit
b057a2ccbd
1 changed files with 48 additions and 1 deletions
  1. +48
    -1
      src/apps/callflows/submodules/misc/misc.js

+ 48
- 1
src/apps/callflows/submodules/misc/misc.js View File

@ -397,7 +397,7 @@ define(function(require){
},
'check_cid[]': {
name: self.i18n.active().oldCallflows.check_cid,
icon: 'lightbulb-o',
icon: 'list-ol',
category: self.i18n.active().oldCallflows.caller_id_cat,
module: 'check_cid',
tip: self.i18n.active().oldCallflows.check_cid_tip,
@ -477,6 +477,53 @@ define(function(require){
}
},
'webhook[]': {
name: self.i18n.active().oldCallflows.webhook,
icon: 'upload',
category: self.i18n.active().oldCallflows.integrations_cat,
module: 'webhook',
tip: self.i18n.active().oldCallflows.webhook_tip,
data: {
},
rules: [
{
type: 'quantity',
maxSize: '1'
}
],
isUsable: 'true',
weight: 40,
caption: function(node, caption_map) {
return node.getMetadata('webhook') || '';
},
edit: function(node, callback) {
var popup_html = $(monster.template(self, 'webhook-callflowEdit', {
data_webhook: {
'http_verb': node.getMetadata('http_verb') || 'get',
'retries': node.getMetadata('retries') || '3',
'uri': node.getMetadata('uri') || ''
}
})),
popup;
$('#add', popup_html).click(function() {
node.setMetadata('http_verb', $('#http_verb option:selected', popup_html).val());
node.setMetadata('retries', $('#retries_input', popup_html).val());
node.setMetadata('uri', $('#uri_input', popup_html).val());
popup.dialog('close');
});
popup = monster.ui.dialog(popup_html, {
title: self.i18n.active().oldCallflows.webhook_title,
beforeClose: function() {
if(typeof callback == 'function') {
callback();
}
}
});
}
},
'manual_presence[]': {
name: self.i18n.active().oldCallflows.manual_presence,


Loading…
Cancel
Save