summaryrefslogtreecommitdiff
path: root/app/views/call_routes/test.html.haml
diff options
context:
space:
mode:
authorStefan Wintermeyer <stefan.wintermeyer@amooma.de>2013-03-25 10:27:27 +0100
committerStefan Wintermeyer <stefan.wintermeyer@amooma.de>2013-03-25 10:27:27 +0100
commitdf6e17e48995f25e72509986f30700d778b179b6 (patch)
treef432c24b8e4ad81009188650dabfd99194883265 /app/views/call_routes/test.html.haml
parent11f186a118285fbc87a536af26730780a9ad01f5 (diff)
parentcce94a74aa5c9691f9b37cd9be5a6831f8063812 (diff)
Merge branch 'develop'5.1.2
Diffstat (limited to 'app/views/call_routes/test.html.haml')
-rw-r--r--app/views/call_routes/test.html.haml55
1 files changed, 55 insertions, 0 deletions
diff --git a/app/views/call_routes/test.html.haml b/app/views/call_routes/test.html.haml
new file mode 100644
index 0000000..0b0fba7
--- /dev/null
+++ b/app/views/call_routes/test.html.haml
@@ -0,0 +1,55 @@
+%h2= 'Routing Test'
+
+- if @route_test
+ - if @route_test['destination']
+ %h3= 'Destination'
+ %table.table.table-striped
+ %thead
+ %tr
+ %td= 'number'
+ %td= 'type'
+ %td= 'ID'
+
+ %tbody{ :id => "destination" }
+ %tr
+ %td= @route_test['destination']['number']
+ %td= @route_test['destination']['type']
+ %td= @route_test['destination']['id']
+ -if @route_test['routes'] && @route_test['routes'].count > 0
+ %h3= 'Routes'
+ %table.table.table-striped
+ %thead
+ %tr
+ %th
+ %th= 'ID'
+ %th= 'destination_number'
+ %th= 'endpoint'
+
+ %tbody{ :id => "route_test" }
+ - @route_test['routes'].each do |index, route_entry|
+ %tr
+ %td= index
+ %td= route_entry['route_id']
+ %td= route_entry['destination_number']
+ %td= "#{route_entry['type']}=#{route_entry['id']}"
+ -if @route_test['log'] && @route_test['log'].count > 0
+ %h3= 'Log'
+ %table.table.table-striped
+ %thead
+ %tr
+ %th
+ %tbody{ :id => "log" }
+ - @route_test['log'].each do |index, log_line|
+ - if log_line =~ /^ROUTE_NO_MATCH/
+ - entry_class = 'table error'
+ - elsif log_line =~ /^ELEMENT_NO_MATCH/
+ - entry_class = 'table warning'
+ - elsif log_line =~ /^ROUTE \d+ /
+ - entry_class = 'table success'
+ - elsif log_line =~ /^[A-Z_]+_MATCH/
+ - entry_class = 'table info'
+ - else
+ - entry_class = nil
+ %tr{:class => entry_class}
+ %td= log_line
+