diff --git a/README.md b/README.md index 91826803..d5d3be15 100644 --- a/README.md +++ b/README.md @@ -104,6 +104,15 @@ Now you can log in to csc with one of the normal subscriber you just created. UR `https:///csc` +### Send Fax + +You need to first enable faxserver and activate it for the subscriber, to be able to send a fax via the "action button menu". + +1. By default, vagrant-ngcp has faxserver enabled by default in the config, so currently we do not need to make any changes here. Otherwise, it would be enabled via /etc/ngcp-config/config.yml by setting "faxserver: enable:" to "yes" and applying the changes with ngcpcfg apply 'enable faxserver'"" +1. Log in to ngcp-panel with administrator credentials +1. Go to Settings > Subscribers > Details > Preferences > Fax Features > Fax2Mail and SendFax, and set Active to "yes" +1. Additionally, the visibility of the fax option in "action button menu" is reliant on store state "sendFax: true" in src/store/user.js. This means it can be toggled off in the code as well if neeeded + ### How to add new npm package 1. Remove the package if you've already installed it diff --git a/src/api/communication.js b/src/api/communication.js new file mode 100644 index 00000000..2c574f0b --- /dev/null +++ b/src/api/communication.js @@ -0,0 +1,17 @@ + +import Vue from 'vue'; + +export function createFax(options, subscriberId) { + return new Promise((resolve, reject) => { + let headers = { + 'Content-Type': 'application/json', + }; + let mergedParams = Object.assign(options, subscriberId); + let payload = JSON.stringify(mergedParams); + Vue.http.post('/api/faxes/', payload, { headers: headers }).then(() => { + resolve(); + }).catch((err)=>{ + reject(err); + }); + }); +} diff --git a/src/components/CscSendFax.vue b/src/components/CscSendFax.vue new file mode 100644 index 00000000..a262f94d --- /dev/null +++ b/src/components/CscSendFax.vue @@ -0,0 +1,115 @@ + + + + + diff --git a/src/components/layouts/Default.vue b/src/components/layouts/Default.vue index b9250b22..d7c658c5 100644 --- a/src/components/layouts/Default.vue +++ b/src/components/layouts/Default.vue @@ -91,7 +91,7 @@ - + {{ $t('sendFax') }} @@ -105,14 +105,22 @@ +