Browse Source

Add account recording settings

master
Emmanuel Balogun 3 years ago
parent
commit
8c1e0eb603
6 changed files with 261 additions and 2 deletions
  1. +104
    -0
      app.js
  2. +16
    -1
      i18n/en-US.json
  3. +1
    -1
      metadata/app.json
  4. +0
    -0
      metadata/screenshots/screenshot1.png
  5. +59
    -0
      style/app.css
  6. +81
    -0
      views/recordings-config.html

+ 104
- 0
app.js View File

@ -68,11 +68,101 @@ define(function(require) {
}
];
var tabConfig = {
text: self.i18n.active().recordings.menuTitles.config,
menus: [{
tabs: [
{
text: 'Account',
callback: self.renderRecordConfig
}
],
}]
};
menus[0].tabs.push(tabConfig);
monster.ui.generateAppLayout(self, {
menus: menus
});
},
renderRecordConfig: function (pArgs) {
var self = this,
args = pArgs || {},
parent = args.container || $('#recordings_app_container .app-content-wrapper');
self.getAccount(function (accountData) {
var templateData = {
account: $.extend(true, {}, accountData)
};
var contentTemplate = $(self.getTemplate({
name: 'recordings-config',
data: templateData
}));
contentTemplate.find('#recordings_config_save').on('click', function() {
var formData = monster.ui.getFormData('recordings_config_form');
var formattedData = {
"call_recording": {
"account": {
"inbound": {
"offnet": {
"enabled": formData['inbound-offnet'],
},
"onnet": {
"enabled": formData['inbound-onnet'],
}
},
"outbound": {
"offnet": {
"enabled": formData['outbound-offnet'],
},
"onnet": {
"enabled": formData['outbound-onnet'],
}
}
}
}
};
self.callApi({
resource: 'account.get',
data: {
accountId: accountData.id
},
success: function(data, status) {
self.callApi({
resource: 'account.update',
data: {
accountId: accountData.id,
data: $.extend(true, {}, data.data, formattedData)
},
success: function(_data, _status) {
monster.ui.toast({
type: 'success',
message: self.i18n.active().toastrMessages.recordConfigUpdateSuccess,
options: {
timeOut: 5000
}
});
}
});
}
});
});
parent
.fadeOut(function () {
$(this)
.empty()
.append(contentTemplate)
.fadeIn();
});
});
},
renderReceivedRECs: function(pArgs) {
var self = this,
args = pArgs || {},
@ -474,6 +564,20 @@ define(function(require) {
return formattedData;
},
getAccount: function (callback) {
var self = this;
self.callApi({
resource: 'account.get',
data: {
accountId: self.accountId
},
success: function (data) {
callback(data.data);
}
});
},
getCDR: function(callId, callback, error) {
var self = this;


+ 16
- 1
i18n/en-US.json View File

@ -3,7 +3,8 @@
"title": "Recordings Manager",
"menuTitles": {
"receivedRECs": "Received Recordings",
"storage": "Storage"
"storage": "Storage",
"config": "Configuration"
},
"receivedRECs": {
"filterByDate": "Filter by Dates",
@ -63,6 +64,20 @@
"CDRPopup": {
"title": "CDR Details"
}
},
"config": {
"legend": "Record Entire Account",
"internalInbound": "Record Internal Inbound",
"externalInbound": "Record External Inbound",
"internalOutbound": "Record Internal Outbound",
"externalOutbound": "Record External Outbound",
"internalInboundTooltip": "This setting will record every inbound internal calls on the account, including callflows, ring groups, conferences, etc. unless specific settings for the user and/or device indicate otherwise",
"externalInboundTooltip": "This setting will record every inbound external calls on the account, including callflows, ring groups, conferences, etc. unless specific settings for the user and/or device indicate otherwise",
"internalOutboundTooltip": "This setting will record every outbound internal calls on the account, including callflows, ring groups, conferences, etc. unless specific settings for the user and/or device indicate otherwise",
"externalOutboundTooltip": "This setting will record every outbound external calls on the account, including callflows, ring groups, conferences, etc. unless specific settings for the user and/or device indicate otherwise"
}
},
"toastrMessages": {
"recordConfigUpdateSuccess": "Recordings configuration updated successfully!"
}
}

+ 1
- 1
metadata/app.json View File

@ -20,7 +20,7 @@
"license": "-",
"price": 0,
"screenshots": [
"recordings.png"
"screenshot1.png"
],
"urls": {
"documentation": "{documentation_url}",


metadata/screenshots/recordings.png → metadata/screenshots/screenshot1.png View File


+ 59
- 0
style/app.css View File

@ -295,4 +295,63 @@
#recordings_cdr_details_dialog {
width: 750px;
margin: 15px
}
/***** Record Config Tab *****/
.main-content .tab-content {
background: transparent;
border: none;
overflow: visible;
}
.main-content .tab-content .tab-pane {
border-radius: 2px;
border: solid 1px #c0c0c9;
background: #f0f0f9;
}
.recordings_account_tab {
padding: 20px;
}
.recordings_account_tab .control-label {
text-align: left;
width: 180px;
}
.recordings_account_tab .control-label .help-tip {
margin-left: 0.5rem;
}
.recordings_account_tab .control-label .iconography-small {
margin-top: -3px;
font-size: 14px;
width: 14px;
height: 14px;
}
.recordings_account_tab .control-label .iconography-help {
color: #909099;
}
.recordings_account_tab .control-label .iconography-help:hover {
color: #2e2e32;
}
.recordings_account_tab .controls {
margin-left: 250px;
}
.main-content .tab-content {
background: transparent;
border: none;
overflow: visible;
}
.main-content .tab-content .buttons-div {
margin-top: 20px;
padding-top: 20px;
border-top: solid 1px #c0c0c9;
}
.main-content .tab-content .buttons-div > button {
float: right;
}

+ 81
- 0
views/recordings-config.html View File

@ -0,0 +1,81 @@
<div class="main-content">
<div class="tab-content">
<div class="recordings_account_tab">
<form id="recordings_config_form" class="form-horizontal">
<legend>{{ i18n.recordings.config.legend }}</legend>
<div class="control-group">
<label for="inbound-offnet" class="control-label">
{{ i18n.recordings.config.internalInbound }}
<span class="help-tip" title="{{ i18n.recordings.config.internalInboundTooltip }}" data-toggle="tooltip">
{{telicon "question--circle" class="iconography-small iconography-help"}}
</span>
</label>
<div class="controls">
{{#monsterSwitch}}
{{#if account.call_recording}}
<input type="checkbox" name="inbound-onnet"{{#if account.call_recording.account.inbound.onnet.enabled}} checked{{/if}}>
{{else}}
<input type="checkbox" name="inbound-onnet">
{{/if}}
{{/monsterSwitch}}
</div>
</div>
<div class="control-group">
<label for="inbound-offnet" class="control-label">
{{ i18n.recordings.config.externalInbound }}
<span class="help-tip" title="{{ i18n.recordings.config.externalInboundTooltip }}" data-toggle="tooltip">
{{telicon "question--circle" class="iconography-small iconography-help"}}
</span>
</label>
<div class="controls">
{{#monsterSwitch}}
{{#if account.call_recording}}
<input type="checkbox" name="inbound-offnet"{{#if account.call_recording.account.inbound.offnet.enabled}} checked{{/if}}>
{{else}}
<input type="checkbox" name="inbound-offnet">
{{/if}}
{{/monsterSwitch}}
</div>
</div>
<div class="control-group">
<label for="outbound-onnet" class="control-label">
{{ i18n.recordings.config.internalOutbound }}
<span class="help-tip" title="{{ i18n.recordings.config.internalOutboundTooltip }}" data-toggle="tooltip">
{{telicon "question--circle" class="iconography-small iconography-help"}}
</span>
</label>
<div class="controls">
{{#monsterSwitch}}
{{#if account.call_recording}}
<input type="checkbox" name="outbound-onnet"{{#if account.call_recording.account.outbound.onnet.enabled}} checked{{/if}}>
{{else}}
<input type="checkbox" name="outbound-onnet">
{{/if}}
{{/monsterSwitch}}
</div>
</div>
<div class="control-group">
<label for="outbound-offnet" class="control-label">
{{ i18n.recordings.config.externalOutbound }}
<span class="help-tip" title="{{ i18n.recordings.config.externalOutboundTooltip }}" data-toggle="tooltip">
{{telicon "question--circle" class="iconography-small iconography-help"}}
</span>
</label>
<div class="controls">
{{#monsterSwitch}}
{{#if account.call_recording}}
<input type="checkbox" name="outbound-offnet"{{#if account.call_recording.account.outbound.offnet.enabled}} checked{{/if}}>
{{else}}
<input type="checkbox" name="outbound-offnet">
{{/if}}
{{/monsterSwitch}}
</div>
</div>
</form>
</div>
<div class="clearfix buttons-div">
<button id="recordings_config_save" class="monster-button-success">{{i18n.update}}</button>
</div>
</div>
</div>

Loading…
Cancel
Save