Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/sipcapture/homer-ui
Browse files Browse the repository at this point in the history
  • Loading branch information
Konstantin S. Vishnivetsky committed May 23, 2016
2 parents f47fbf8 + c4332f7 commit 9adef19
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 2 deletions.
24 changes: 24 additions & 0 deletions js/modules/core/services/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,29 @@
return defer.promise;
};

var searchRemoteLog = function (data) {

var defer = $q.defer();

$http.post('api/v1/report/remotelog', data, {handleStatus:[403,503]}).then(
/* good response */
function (results) {
if(results.data.auth == "false") {
defer.reject('user not authorized');
}
else {
defer.resolve(results.data.data);
}
},
/* bad response */
function (results) {
defer.reject('bad response combination');
}
);

return defer.promise;
};

var searchQualityReport = function (type, data) {

var defer = $q.defer();
Expand Down Expand Up @@ -414,6 +437,7 @@
searchQOSReport: searchQOSReport,
searchLogReport: searchLogReport,
searchRtcReport: searchRtcReport,
searchRemoteLog: searchRemoteLog,
searchQualityReport: searchQualityReport,
loadNode: loadNode
};
Expand Down
18 changes: 17 additions & 1 deletion js/modules/pages/controllers/dialogCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@
$scope.enableQualityReport = false;
$scope.enableRTCPReport = false;
$scope.enableLogReport = false;
$scope.enableRemoteLogReport = false;
$scope.enableRtcReport = false;
$scope.enableXRTPReport = false;
$scope.enableRTPAgentReport = false;
Expand Down Expand Up @@ -490,7 +491,7 @@

// RTCP
try {
if(msg.reports.lenght > 0) {
if(msg.reports.length != 0) {

var charts = {};
if(msg.reports.rtcp && msg.reports.rtcp.chart) {
Expand Down Expand Up @@ -678,6 +679,20 @@
$scope.dataLoading = false;
});
};

$scope.showRemoteLogReport = function(rdata) {

search.searchRemoteLog(rdata).then(function(msg) {

$scope.enableRemoteLogReport = true;
if(msg.hits && msg.hits.hits) $scope.remotelogreport = msg.hits.hits;
},
function(sdata) {
return;
}).finally(function() {
$scope.dataLoading = false;
});
};

$scope.showRtcReport = function(rdata) {

Expand Down Expand Up @@ -717,6 +732,7 @@
// console.log(data);
$scope.showQOSReport(data);
$scope.showLogReport(data);
$scope.showRemoteLogReport(data);
$scope.showRtcReport(data);
var makePcapText = function(fdata, type, callid) {
search.makePcapTextforTransaction(fdata, type).then(function(msg) {
Expand Down
2 changes: 1 addition & 1 deletion js/widgets/clock/edit.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<form role="form">
<div class="form-group">
<label for="date">Timezones (comma separated)</label>
<input type="text" class="form-control" id="location" ng-model="config.location" placeholder="Europe/Amsterdam, America/New_York">
<input type="text" class="form-control" id="location" ng-model="config.location" placeholder="UTC/UTC, Europe/Amsterdam, America/New_York">
</div>
<div class="form-group">
<label>Display Seconds: <input type="checkbox" ng-model="config.showseconds"></label>
Expand Down
1 change: 1 addition & 0 deletions js/widgets/clock/timezones.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
var timeZoneData = {
"UTC/UTC": 0,
"Europe/London": 0,
"Europe/Amsterdam": 1,
"America/Los_Angeles":-8,
Expand Down
27 changes: 27 additions & 0 deletions templates/dialogs/transaction.html
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,33 @@ <h4 class="modal-title" style="font-size:15px;margin-left:4px;margin-bottom:10px
</div>

</uib-tab>

<uib-tab ng-show="enableRemoteLogReport">
<uib-tab-heading><i class="fa fa-file-text-o"></i>Remote Logs </uib-tab-heading>
<div id="no-reports" ng-hide="enableRemoteLogReport" class="alert alert-warning alert-dismissible" role="alert">
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<strong>Oops!</strong> No Logs available for this session
</div>
<div id="log-root" ng-if="enableRemoteLogReport" class="jumbotron" style="background-color:transparent;padding:8px;margin:5px;">

<p>Elasticsearch Result from {{ remotelogreport[0].source_ip }}:{{remotelogreport[0].source_port}}</p>
<div class="form-group">
<input type="text" ng-model="remotelogsearch" class="form-control" placeholder="Filter Logs" style="margin-left:15px;width:98%;border-radius: 5px !important;" />
</div>
</p>

<div ng-repeat="log in remotelogreport | filter :{msg:remotelogsearch}" >
<!-- <div class="alert alert-info" role="alert" style="margin-bottom:5px;">{{log.msg}}</div> -->
<div ng-class-odd="(log.msg.indexOf('Authentication') > -1 ? 'alert alert-danger' : 'alert alert-success')" ng-class-even="(log.msg.indexOf('Authentication') > -1 ? 'alert alert-danger' : 'alert alert-info')" role="alert" style="margin-bottom:5px;">{{log}}</div>
</div>
<!--
<ol ng-model="logreport">
<li ng-repeat="log in logreport" ng-include="'logs_renderer.html'"></li>
</ol>
-->
</div>

</uib-tab>

<uib-tab ng-show="enableRtcReport">
<uib-tab-heading><i class="fa fa-exchange"></i> WSS/RTC </uib-tab-heading>
Expand Down

0 comments on commit 9adef19

Please sign in to comment.