bulutfon_dashboard 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/README.md +66 -0
- data/Rakefile +36 -0
- data/app/assets/fonts/fontcustom_d9192ef5338659432e550700796cc26b.eot +0 -0
- data/app/assets/fonts/fontcustom_d9192ef5338659432e550700796cc26b.svg +164 -0
- data/app/assets/fonts/fontcustom_d9192ef5338659432e550700796cc26b.ttf +0 -0
- data/app/assets/fonts/fontcustom_d9192ef5338659432e550700796cc26b.woff +0 -0
- data/app/assets/images/bulutfon_dashboard/screenshot-step-1.png +0 -0
- data/app/assets/images/bulutfon_dashboard/screenshot-step-2.png +0 -0
- data/app/assets/images/bulutfon_dashboard/screenshot-step-3.png +0 -0
- data/app/assets/javascripts/bulutfon_dashboard/application.js +13 -0
- data/app/assets/javascripts/bulutfon_dashboard/audiojs/audiojs-player-graphics.gif +0 -0
- data/app/assets/javascripts/bulutfon_dashboard/audiojs/audiojs.js.erb +695 -0
- data/app/assets/javascripts/bulutfon_dashboard/audiojs/audiojs.swf +0 -0
- data/app/assets/javascripts/bulutfon_dashboard/cdrs.js +19 -0
- data/app/assets/stylesheets/bulutfon_dashboard/application.css +15 -0
- data/app/assets/stylesheets/bulutfon_dashboard/bulutfon-fonts.css.sass +114 -0
- data/app/controllers/bulutfon_dashboard/application_controller.rb +28 -0
- data/app/controllers/bulutfon_dashboard/base_controller.rb +4 -0
- data/app/controllers/bulutfon_dashboard/bulutfon_users_controller.rb +59 -0
- data/app/controllers/bulutfon_dashboard/cdrs_controller.rb +27 -0
- data/app/controllers/bulutfon_dashboard/dashboards_controller.rb +15 -0
- data/app/helpers/bulutfon_dashboard/application_helper.rb +4 -0
- data/app/helpers/bulutfon_dashboard/cdrs_helper.rb +145 -0
- data/app/models/bulutfon_dashboard/api_user.rb +19 -0
- data/app/models/bulutfon_dashboard/bulutfon_user.rb +21 -0
- data/app/models/bulutfon_dashboard/cdr.rb +54 -0
- data/app/views/bulutfon_dashboard/bulutfon_users/_form.html.haml +24 -0
- data/app/views/bulutfon_dashboard/bulutfon_users/edit.html.haml +3 -0
- data/app/views/bulutfon_dashboard/bulutfon_users/new.html.haml +3 -0
- data/app/views/bulutfon_dashboard/bulutfon_users/show.html.haml +93 -0
- data/app/views/bulutfon_dashboard/cdrs/_blank.html.haml +14 -0
- data/app/views/bulutfon_dashboard/cdrs/_cdr.html.haml +12 -0
- data/app/views/bulutfon_dashboard/cdrs/_list.html.haml +24 -0
- data/app/views/bulutfon_dashboard/cdrs/index.html.haml +5 -0
- data/app/views/bulutfon_dashboard/cdrs/show.html.haml +82 -0
- data/app/views/bulutfon_dashboard/dashboards/index.html.haml +53 -0
- data/app/views/layouts/bulutfon_dashboard/application.html.erb +14 -0
- data/config/initializers/simple_form.rb +165 -0
- data/config/initializers/simple_form_bootstrap.rb +149 -0
- data/config/locales/models.tr.yml +201 -0
- data/config/locales/simple_form.en.yml +31 -0
- data/config/routes.rb +5 -0
- data/lib/bulutfon_dashboard.rb +5 -0
- data/lib/bulutfon_dashboard/engine.rb +6 -0
- data/lib/bulutfon_dashboard/version.rb +3 -0
- data/lib/generators/bulutfon_dashboard/assets_generator.rb +57 -0
- data/lib/generators/bulutfon_dashboard/controllers_generator.rb +24 -0
- data/lib/generators/bulutfon_dashboard/helpers_generator.rb +24 -0
- data/lib/generators/bulutfon_dashboard/initializers_generator.rb +14 -0
- data/lib/generators/bulutfon_dashboard/install/install_generator.rb +17 -0
- data/lib/generators/bulutfon_dashboard/migrations_generator.rb +24 -0
- data/lib/generators/bulutfon_dashboard/views_generator.rb +55 -0
- data/lib/generators/templates/assets/fonts/fontcustom_d9192ef5338659432e550700796cc26b.eot +0 -0
- data/lib/generators/templates/assets/fonts/fontcustom_d9192ef5338659432e550700796cc26b.svg +164 -0
- data/lib/generators/templates/assets/fonts/fontcustom_d9192ef5338659432e550700796cc26b.ttf +0 -0
- data/lib/generators/templates/assets/fonts/fontcustom_d9192ef5338659432e550700796cc26b.woff +0 -0
- data/lib/generators/templates/assets/stylesheets/bulutfon-fonts.css.sass +114 -0
- data/lib/generators/templates/controllers/base_controller.rb +9 -0
- data/lib/generators/templates/helpers/application_helper.rb +5 -0
- data/lib/generators/templates/initializers/bulutfon_dashboard.rb +2 -0
- data/lib/generators/templates/migrations/create_bulutfon_dashboard_bulutfon_users.rb +14 -0
- data/lib/tasks/bulutfon_dashboard_tasks.rake +4 -0
- data/lib/templates/erb/scaffold/_form.html.erb +13 -0
- data/test/bulutfon_dashboard_test.rb +7 -0
- data/test/controllers/bulutfon_dashboard/bulutfon_users_controller_test.rb +13 -0
- data/test/controllers/bulutfon_dashboard/cdrs_controller_test.rb +13 -0
- data/test/controllers/bulutfon_dashboard/dashboards_controller_test.rb +13 -0
- data/test/dummy/README.rdoc +28 -0
- data/test/dummy/Rakefile +6 -0
- data/test/dummy/app/assets/javascripts/application.js +13 -0
- data/test/dummy/app/assets/stylesheets/application.css +15 -0
- data/test/dummy/app/controllers/application_controller.rb +5 -0
- data/test/dummy/app/helpers/application_helper.rb +2 -0
- data/test/dummy/app/views/layouts/application.html.erb +14 -0
- data/test/dummy/bin/bundle +3 -0
- data/test/dummy/bin/rails +4 -0
- data/test/dummy/bin/rake +4 -0
- data/test/dummy/bin/setup +29 -0
- data/test/dummy/config.ru +4 -0
- data/test/dummy/config/application.rb +26 -0
- data/test/dummy/config/boot.rb +5 -0
- data/test/dummy/config/database.yml +25 -0
- data/test/dummy/config/environment.rb +5 -0
- data/test/dummy/config/environments/development.rb +41 -0
- data/test/dummy/config/environments/production.rb +79 -0
- data/test/dummy/config/environments/test.rb +42 -0
- data/test/dummy/config/initializers/assets.rb +11 -0
- data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/test/dummy/config/initializers/cookies_serializer.rb +3 -0
- data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
- data/test/dummy/config/initializers/inflections.rb +16 -0
- data/test/dummy/config/initializers/mime_types.rb +4 -0
- data/test/dummy/config/initializers/session_store.rb +3 -0
- data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/test/dummy/config/locales/en.yml +23 -0
- data/test/dummy/config/routes.rb +4 -0
- data/test/dummy/config/secrets.yml +22 -0
- data/test/dummy/public/404.html +67 -0
- data/test/dummy/public/422.html +67 -0
- data/test/dummy/public/500.html +66 -0
- data/test/dummy/public/favicon.ico +0 -0
- data/test/fixtures/bulutfon_dashboard/bulutfon_users.yml +11 -0
- data/test/integration/navigation_test.rb +8 -0
- data/test/models/bulutfon_dashboard/bulutfon_user_test.rb +9 -0
- data/test/test_helper.rb +21 -0
- metadata +221 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
module BulutfonDashboard
|
|
2
|
+
class ApiUser
|
|
3
|
+
include ActiveModel::Validations
|
|
4
|
+
include ActiveModel::Conversion
|
|
5
|
+
extend ActiveModel::Naming
|
|
6
|
+
|
|
7
|
+
cattr_accessor :user, :pbx, :credit
|
|
8
|
+
|
|
9
|
+
def initialize(attributes = {})
|
|
10
|
+
attributes.each do |name, value|
|
|
11
|
+
send("#{name}=", value)
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def persisted?
|
|
16
|
+
false
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
module BulutfonDashboard
|
|
2
|
+
class BulutfonUser < ActiveRecord::Base
|
|
3
|
+
belongs_to :user, class_name: BulutfonDashboard.user_class.to_s
|
|
4
|
+
validates_presence_of :user_id, :api_token
|
|
5
|
+
validate :check_api_token_is_valid
|
|
6
|
+
|
|
7
|
+
private
|
|
8
|
+
|
|
9
|
+
def check_api_token_is_valid
|
|
10
|
+
if self.api_token.present?
|
|
11
|
+
begin
|
|
12
|
+
bulutfon = BulutfonSDK::REST::Bulutfon.new(self.api_token)
|
|
13
|
+
bulutfon.details
|
|
14
|
+
rescue BulutfonSDK::REST::RequestError
|
|
15
|
+
self.errors.add(:api_token)
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
module BulutfonDashboard
|
|
2
|
+
class Cdr
|
|
3
|
+
include ActiveModel::Validations
|
|
4
|
+
include ActiveModel::Conversion
|
|
5
|
+
extend ActiveModel::Naming
|
|
6
|
+
|
|
7
|
+
cattr_accessor :uuid, :bf_calltype, :direction, :caller, :callee, :extension, :call_price, :call_time, :answer_time, :hangup_time, :call_record, :hangup_cause, :hangup_state, :call_flow, :caller_id_number, :destination_number, :sip_hangup_disposition
|
|
8
|
+
|
|
9
|
+
def initialize(attributes = {})
|
|
10
|
+
attributes.each do |name, value|
|
|
11
|
+
send("#{name}=", value)
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def persisted?
|
|
16
|
+
false
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
def direction_in?
|
|
20
|
+
direction == 'IN'
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def direction_out?
|
|
24
|
+
direction == 'OUT'
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
def hangup_cause_i18n
|
|
28
|
+
I18n.t("enumerates.hangup_cause.#{hangup_cause.upcase}")
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
def sip_hangup_disposition_hover_i18n
|
|
32
|
+
I18n.t("enumerates.sip_hangup_disposition_hover.#{disposition_state}")
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
def sip_hangup_disposition_i18n
|
|
36
|
+
I18n.t("enumerates.sip_hangup_disposition.#{disposition_state}")
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
def calculate_call_price
|
|
40
|
+
call_price.present? ? call_price.to_f * 100 : 0.00
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
def call_record_exists?
|
|
44
|
+
call_record == 'YES'
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
private
|
|
48
|
+
|
|
49
|
+
def disposition_state
|
|
50
|
+
hangup_state.present? ? hangup_state : 'blank'
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
end
|
|
54
|
+
end
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
.panel.panel-default
|
|
2
|
+
.panel-heading
|
|
3
|
+
%i.icon-edit.icon-large
|
|
4
|
+
= yield :form_title
|
|
5
|
+
.panel-body
|
|
6
|
+
= simple_form_for(@resource, url: BulutfonDashboard::Engine.routes.url_helpers.bulutfon_users_path) do |f|
|
|
7
|
+
= f.error_notification
|
|
8
|
+
|
|
9
|
+
.alert.alert-info
|
|
10
|
+
Bulutfon kullanıcı panelinizden
|
|
11
|
+
%strong Uygulamalar > API uygulamaları
|
|
12
|
+
menüsünden
|
|
13
|
+
%strong Tekil Api Anahtarınız'a
|
|
14
|
+
erişebilirsiniz.
|
|
15
|
+
%br/
|
|
16
|
+
Ayrıca API Anahtarını alacağınız sayfanıza erişmek için bu
|
|
17
|
+
= link_to 'https://app.bulutfon.com/oauth/applications', 'https://app.bulutfon.com/oauth/applications', target: :_blank
|
|
18
|
+
linki kullanabilirsiniz.
|
|
19
|
+
.form-inputs
|
|
20
|
+
= f.input :api_token
|
|
21
|
+
.form-actions
|
|
22
|
+
= link_to t('view.cancel'), bulutfon_users_path, class: 'btn'
|
|
23
|
+
- text = @resource.id.present? ? t('view.update_api_token') : t('view.save_api_token')
|
|
24
|
+
= f.button :submit, text, class: 'btn btn-primary'
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
:css
|
|
2
|
+
.account .info{
|
|
3
|
+
min-height: 110px;
|
|
4
|
+
}
|
|
5
|
+
#contentTab .nav-pills > li > a {
|
|
6
|
+
border-radius: 4px 4px 0 0 ;
|
|
7
|
+
}
|
|
8
|
+
#contentTab .tab-content {
|
|
9
|
+
border: 1px solid #ddd;
|
|
10
|
+
padding : 5px 15px;
|
|
11
|
+
}
|
|
12
|
+
.panel.panel-default.grid
|
|
13
|
+
.panel-heading
|
|
14
|
+
%i.fa.fa-table.icon-large
|
|
15
|
+
= t('tt.show', resource_name: BulutfonDashboard::BulutfonUser.model_name.human)
|
|
16
|
+
.panel-body
|
|
17
|
+
- if @resource.present?
|
|
18
|
+
= show_for @resource do |s|
|
|
19
|
+
= s.attribute :api_token
|
|
20
|
+
%hr/
|
|
21
|
+
.pull-right
|
|
22
|
+
= link_to edit_bulutfon_users_path, class: 'btn btn-primary' do
|
|
23
|
+
%i.icon-edit
|
|
24
|
+
= t('view.edit_api_token')
|
|
25
|
+
= link_to bulutfon_users_path, method: :delete, class: 'btn btn-danger' do
|
|
26
|
+
%i.icon-trash
|
|
27
|
+
= t('view.destroy_api_token')
|
|
28
|
+
- else
|
|
29
|
+
.alert.alert-warning
|
|
30
|
+
%p
|
|
31
|
+
%h5.center
|
|
32
|
+
%i.fa.fa-info-circle.fa-lg
|
|
33
|
+
Bulutfon entegrasyonunuz henüz tamamlanmamıştır. Entegrasyonu tamamlayabilmek için Bulutfon API Anahtarınızı eklemeniz gerekmektedir. Lütfen aşağıdaki seçenekler üzerinden entegrasyonunuzu tamamlayınız.
|
|
34
|
+
.row.account
|
|
35
|
+
.col-lg-6
|
|
36
|
+
.well
|
|
37
|
+
%h4.text-center
|
|
38
|
+
Bulutfon Hesabım Var
|
|
39
|
+
%p.info
|
|
40
|
+
Eğer Bulutfon üyesi iseniz aşağıdaki butona tıklayarak Bulutfon Hesabınıza giriş yapınız ve kullanıcı panelinizden
|
|
41
|
+
%strong Uygulamalar > API uygulamaları
|
|
42
|
+
menüsünden
|
|
43
|
+
%strong Tekil Api Anahtarınızı
|
|
44
|
+
aşağıdaki ekran görüntülerinde gösterildiği şekilde kopyalayıp API Anahtarını Ekle ve Entegrasyonu Tamamla butonuna tıklayıp gelen sayfadan API Anahtarınızı ekleyiniz.
|
|
45
|
+
.actions
|
|
46
|
+
.text-center
|
|
47
|
+
= link_to 'https://app.bulutfon.com/oauth/applications', target: '_blank', class: 'btn btn-block btn-primary' do
|
|
48
|
+
Bulutfon Hesabına Giriş Yap
|
|
49
|
+
.col-lg-6
|
|
50
|
+
.well
|
|
51
|
+
%h4.text-center
|
|
52
|
+
Bulutfon Hesabım Yok
|
|
53
|
+
%p.info
|
|
54
|
+
Eğer bulutfon üyesi değilseniz aşağıdaki butona tıklayarak Bulutfon üyeliğinizi başlatıp yan taraftaki yönergeleri izleyiniz.
|
|
55
|
+
.actions
|
|
56
|
+
.text-center
|
|
57
|
+
= link_to 'https://app.bulutfon.com/accounts/new', target: '_blank', class: 'btn btn-block btn-primary' do
|
|
58
|
+
Bulutfon Hesabı Oluştur
|
|
59
|
+
.row
|
|
60
|
+
.col-md-6.col-md-offset-3
|
|
61
|
+
.text-center
|
|
62
|
+
= link_to new_bulutfon_users_path, class: 'btn btn-lg btn-block btn-success' do
|
|
63
|
+
%i.fa.fa-plus
|
|
64
|
+
API Anahtarını Ekle ve Entegrasyonu Tamamla
|
|
65
|
+
%br/
|
|
66
|
+
%br/
|
|
67
|
+
%br/
|
|
68
|
+
.row
|
|
69
|
+
.col-lg-12
|
|
70
|
+
#contentTab
|
|
71
|
+
%ul.nav.nav-pills
|
|
72
|
+
%li.active
|
|
73
|
+
%a{'data-toggle' => 'pill', href: '#step1'}
|
|
74
|
+
1. Adım: Uygulamalar > API uygulamaları Menüsü
|
|
75
|
+
%li
|
|
76
|
+
%a{'data-toggle' => 'pill', href: '#step2'}
|
|
77
|
+
2. Adım: Tekil API Anahtarının Alınması
|
|
78
|
+
%li
|
|
79
|
+
%a{'data-toggle' => 'pill', href: '#step3'}
|
|
80
|
+
3. Adım: API Anahtarının Eklenmesi
|
|
81
|
+
.tab-content
|
|
82
|
+
#step1.tab-pane.fade.in.active
|
|
83
|
+
%h3 Uygulamalar > API uygulamaları Menüsü
|
|
84
|
+
%p
|
|
85
|
+
= image_tag 'bulutfon_dashboard/screenshot-step-1.png', class: 'img-responsive'
|
|
86
|
+
#step2.tab-pane.fade
|
|
87
|
+
%h3 Tekil API Anahtarının Alınması
|
|
88
|
+
%p
|
|
89
|
+
= image_tag 'bulutfon_dashboard/screenshot-step-2.png', class: 'img-responsive'
|
|
90
|
+
#step3.tab-pane.fade
|
|
91
|
+
%h3 API Anahtarının Eklenmesi
|
|
92
|
+
%p
|
|
93
|
+
= image_tag 'bulutfon_dashboard/screenshot-step-3.png', class: 'img-responsive'
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
- if params[:q].present?
|
|
2
|
+
= render 'list'
|
|
3
|
+
- else
|
|
4
|
+
.panel-heading
|
|
5
|
+
%i.fa.fa-table.icon-large
|
|
6
|
+
= t('tt.index', resource_name: 'Cdr')
|
|
7
|
+
.panel-tools
|
|
8
|
+
.btn-group
|
|
9
|
+
%a.btn{href: cdrs_path, data: {toggle: 'toolbar-tooltip'}, title: t('view.reload')}
|
|
10
|
+
%i.fa.fa-refresh
|
|
11
|
+
.badge= @cdrs.count
|
|
12
|
+
.panel-body
|
|
13
|
+
.alert.alert-warning
|
|
14
|
+
%p= t('activerecord.attributes.cdr.blank')
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
%tr
|
|
2
|
+
%td= cdr.caller
|
|
3
|
+
%td= cdr.callee
|
|
4
|
+
%td= direction_icon cdr.direction
|
|
5
|
+
%td= call_type_icon cdr.bf_calltype
|
|
6
|
+
%td= cdr.call_time.present? ? l(cdr.call_time.to_datetime) : ''
|
|
7
|
+
%td= cdr.answer_time.present? ? l(cdr.answer_time.to_datetime) : ''
|
|
8
|
+
%td= cdr.hangup_time.present? ? l(cdr.hangup_time.to_datetime) : ''
|
|
9
|
+
%td= cdr.call_record_exists? ? t('simple_form.yes') : t('simple_form.no')
|
|
10
|
+
%td.action
|
|
11
|
+
= link_to(cdr_path(cdr.uuid), class: 'btn btn-success', toogle: 'tooltip', title: t('tooltips.zoom') ) do
|
|
12
|
+
%i.icon-eye-open
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
= stylesheet_link_tag 'bulutfon_dashboard/bulutfon-fonts'
|
|
2
|
+
.panel-heading
|
|
3
|
+
%i.icon-table.icon-large
|
|
4
|
+
= t('tt.index', resource_name: t('activerecord.models.cdr'))
|
|
5
|
+
.panel-tools
|
|
6
|
+
.btn-group
|
|
7
|
+
%a.btn{href: cdrs_path, data: {toggle: 'toolbar-tooltip'}, title: t('view.reload')}
|
|
8
|
+
%i.icon-refresh
|
|
9
|
+
.badge= @cdrs.count
|
|
10
|
+
%table.table
|
|
11
|
+
%thead
|
|
12
|
+
%tr
|
|
13
|
+
%td= t('activerecord.attributes.cdr.caller')
|
|
14
|
+
%td= t('activerecord.attributes.cdr.callee')
|
|
15
|
+
%td= t('activerecord.attributes.cdr.direction')
|
|
16
|
+
%td= t('activerecord.attributes.cdr.call_type')
|
|
17
|
+
%td= t('activerecord.attributes.cdr.start_time')
|
|
18
|
+
%td= t('activerecord.attributes.cdr.answer_time')
|
|
19
|
+
%td= t('activerecord.attributes.cdr.hangup_time')
|
|
20
|
+
%td= t('activerecord.attributes.cdr.call_record_exists?')
|
|
21
|
+
%th.actions
|
|
22
|
+
= t('view.actions')
|
|
23
|
+
%tbody
|
|
24
|
+
= render partial: 'bulutfon_dashboard/cdrs/cdr', collection: @cdrs
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
= stylesheet_link_tag 'bulutfon_dashboard/bulutfon-fonts'
|
|
2
|
+
= javascript_include_tag 'bulutfon_dashboard/application'
|
|
3
|
+
- content_for :toolbar do
|
|
4
|
+
= link_to cdrs_path, class: 'btn btn-default' do
|
|
5
|
+
%i.fa.fa-arrow-left
|
|
6
|
+
= t('generic.back_to_list')
|
|
7
|
+
.panel.panel-default
|
|
8
|
+
.panel-heading
|
|
9
|
+
%i.fa.fa-pencil.fa-lg
|
|
10
|
+
= t('tt.show', resource_name: t('activerecord.models.cdr'))
|
|
11
|
+
.panel-body
|
|
12
|
+
= show_for @cdr do |s|
|
|
13
|
+
.row-fluid
|
|
14
|
+
.col-md-2
|
|
15
|
+
%h3= t('activerecord.attributes.cdr.domain')
|
|
16
|
+
= s.attribute :direction, label: t('activerecord.attributes.cdr.direction') do
|
|
17
|
+
= direction_icon @cdr.direction unless @cdr.direction.nil?
|
|
18
|
+
.col-md-2
|
|
19
|
+
%h3= t('activerecord.attributes.cdr.numbers')
|
|
20
|
+
= s.attribute :caller, label: t('activerecord.attributes.cdr.caller_id_name')
|
|
21
|
+
- if @cdr.direction_in?
|
|
22
|
+
= s.attribute :caller_id_number, label: t('activerecord.attributes.cdr.caller_id_number')
|
|
23
|
+
- else
|
|
24
|
+
= s.attribute :caller_id_number, label: t('activerecord.attributes.cdr.caller_id_number') do
|
|
25
|
+
= "#{@cdr.caller} - #{@cdr.extension}"
|
|
26
|
+
.col-md-2
|
|
27
|
+
%h3= t('activerecord.attributes.cdr.states')
|
|
28
|
+
= s.attribute :hangup_cause, label: t('activerecord.attributes.cdr.hangup_cause') do
|
|
29
|
+
= @cdr.hangup_cause_i18n
|
|
30
|
+
= s.attribute :sip_hangup_disposition, label: t('activerecord.attributes.cdr.hangup_disposition') do
|
|
31
|
+
%span{toggle: :tooltip, title: @cdr.sip_hangup_disposition_hover_i18n }
|
|
32
|
+
= @cdr.sip_hangup_disposition_i18n
|
|
33
|
+
.col-md-2
|
|
34
|
+
%h3= t('activerecord.attributes.cdr.times')
|
|
35
|
+
= s.attribute :call_time, label: t('activerecord.attributes.cdr.start_time') do
|
|
36
|
+
= l @cdr.call_time.to_datetime, format: :cdr if @cdr.call_time.present?
|
|
37
|
+
= s.attribute :answer_time, label: t('activerecord.attributes.cdr.answer_time') do
|
|
38
|
+
= l @cdr.answer_time.to_datetime, format: :cdr if @cdr.answer_time.present?
|
|
39
|
+
= s.attribute :hangup_time, label: t('activerecord.attributes.cdr.hangup_time') do
|
|
40
|
+
= l @cdr.hangup_time.to_datetime, format: :cdr if @cdr.hangup_time.present?
|
|
41
|
+
|
|
42
|
+
.col-md-4
|
|
43
|
+
%h3= t('activerecord.attributes.cdr.datas')
|
|
44
|
+
= s.attribute :uuid, label: t('activerecord.attributes.cdr.uuid')
|
|
45
|
+
- if @cdr.direction_out?
|
|
46
|
+
= s.attribute :nibble_total_billed, label: t('activerecord.attributes.cdr.nibble_total_billed') do
|
|
47
|
+
= sanitize_price(@cdr.calculate_call_price, 'Kuruş')
|
|
48
|
+
|
|
49
|
+
- if @cdr.call_record_exists?
|
|
50
|
+
.panel.panel-default.grid
|
|
51
|
+
.panel-heading
|
|
52
|
+
%i.fa.fa-music.fa-lg
|
|
53
|
+
= t('activerecord.attributes.cdr.voice_record')
|
|
54
|
+
.panel-body
|
|
55
|
+
%table.table-centered.vertical-center
|
|
56
|
+
%tr
|
|
57
|
+
%td= audio_tag @bulutfon.call_records.get_stream(@cdr.uuid, true).to_obj.download_path, type: 'audio/ogg', preload: 'none'
|
|
58
|
+
%td
|
|
59
|
+
= link_to @bulutfon.call_records.get(@cdr.uuid, true).to_obj.download_path, class: 'btn btn-info' do
|
|
60
|
+
%i.fa.fa-download
|
|
61
|
+
= t('generic.download')
|
|
62
|
+
|
|
63
|
+
- if @cdr.direction_in?
|
|
64
|
+
.panel.panel-default.grid
|
|
65
|
+
.panel-heading
|
|
66
|
+
%i.fa.fa-list.fa-lg
|
|
67
|
+
= t('activerecord.attributes.cdr.callflow')
|
|
68
|
+
|
|
69
|
+
%table.table.table-condensed
|
|
70
|
+
%thead
|
|
71
|
+
%th= t('activerecord.attributes.cdr.callee')
|
|
72
|
+
%th= t('activerecord.attributes.cdr.start_time')
|
|
73
|
+
%th= t('activerecord.attributes.cdr.answer_time')
|
|
74
|
+
%th= t('activerecord.attributes.cdr.hangup_time')
|
|
75
|
+
|
|
76
|
+
- flow = @cdr.call_flow.reverse
|
|
77
|
+
- flow.each_with_index do |callflow, idx|
|
|
78
|
+
%tr
|
|
79
|
+
%td= callflow['callee']
|
|
80
|
+
%td= l callflow['start_time'].try(:to_datetime), format: :cdr if callflow['start_time'].present?
|
|
81
|
+
%td= l callflow['answer_time'].try(:to_datetime), format: :cdr if callflow['answer_time'].present?
|
|
82
|
+
%td= l callflow['hangup_time'].try(:to_datetime), format: :cdr if callflow['hangup_time'].present?
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
= stylesheet_link_tag 'bulutfon_dashboard/bulutfon-fonts'
|
|
2
|
+
|
|
3
|
+
.panel.panel-default.grid
|
|
4
|
+
.panel-heading
|
|
5
|
+
%i.fa.fa-user.fa-lg
|
|
6
|
+
= t('tt.show', resource_name: t('activerecord.models.bulutfon_dashboard/bulutfon_user'))
|
|
7
|
+
.panel-body
|
|
8
|
+
= show_for @user do |s|
|
|
9
|
+
.row-fluid
|
|
10
|
+
.col-lg-4
|
|
11
|
+
= s.attribute :name, label: t('activerecord.attributes.dashboard.name_surname') do
|
|
12
|
+
= @user.user['name']
|
|
13
|
+
= s.attribute :pbx_name, label: t('activerecord.attributes.dashboard.pbx_name') do
|
|
14
|
+
= t("enumerates.domain_state.#{@user.pbx['name']}")
|
|
15
|
+
.col-lg-4
|
|
16
|
+
= s.attribute :balance, label: t('activerecord.attributes.dashboard.balance') do
|
|
17
|
+
= number_to_currency @user.credit['balance']
|
|
18
|
+
= s.attribute :sms_credit, label: t('activerecord.attributes.dashboard.sms_credit') do
|
|
19
|
+
= @user.credit['sms_credit']
|
|
20
|
+
.col-lg-4.text-center
|
|
21
|
+
= link_to t('view.urls.cdrs'), cdrs_path, class: 'btn btn-block btn-primary'
|
|
22
|
+
%hr/
|
|
23
|
+
= link_to t('view.urls.bulutfon_entegration'), bulutfon_users_path, class: 'btn btn-block btn-primary'
|
|
24
|
+
|
|
25
|
+
.panel.panel-default.grid
|
|
26
|
+
.panel-heading
|
|
27
|
+
%i.icon-table.icon-large
|
|
28
|
+
= t('tt.index', resource_name: t('view.last_cdrs', number: @content_count))
|
|
29
|
+
.panel-tools
|
|
30
|
+
.btn-group
|
|
31
|
+
%a.btn{href: root_path, data: {toggle: 'toolbar-tooltip'}, title: t('view.reload')}
|
|
32
|
+
%i.icon-refresh
|
|
33
|
+
.badge= @cdrs.count
|
|
34
|
+
- if @cdrs.size == 0
|
|
35
|
+
.panel-body
|
|
36
|
+
.alert.alert-warning
|
|
37
|
+
%p= t('activerecord.attributes.cdr.blank')
|
|
38
|
+
- else
|
|
39
|
+
%table.table
|
|
40
|
+
%thead
|
|
41
|
+
%tr
|
|
42
|
+
%td= t('activerecord.attributes.cdr.caller')
|
|
43
|
+
%td= t('activerecord.attributes.cdr.callee')
|
|
44
|
+
%td= t('activerecord.attributes.cdr.direction')
|
|
45
|
+
%td= t('activerecord.attributes.cdr.call_type')
|
|
46
|
+
%td= t('activerecord.attributes.cdr.start_time')
|
|
47
|
+
%td= t('activerecord.attributes.cdr.answer_time')
|
|
48
|
+
%td= t('activerecord.attributes.cdr.hangup_time')
|
|
49
|
+
%td= t('activerecord.attributes.cdr.call_record_exists?')
|
|
50
|
+
%th.actions
|
|
51
|
+
= t('view.actions')
|
|
52
|
+
%tbody
|
|
53
|
+
= render partial: 'bulutfon_dashboard/cdrs/cdr', collection: @cdrs
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<title>BulutfonDashboard</title>
|
|
5
|
+
<%= stylesheet_link_tag 'bulutfon_dashboard/application', media: 'all' %>
|
|
6
|
+
<%= javascript_include_tag 'bulutfon_dashboard/application' %>
|
|
7
|
+
<%= csrf_meta_tags %>
|
|
8
|
+
</head>
|
|
9
|
+
<body>
|
|
10
|
+
|
|
11
|
+
<%= yield %>
|
|
12
|
+
|
|
13
|
+
</body>
|
|
14
|
+
</html>
|