Skip to content

Commit

Permalink
Make string to int for some variables
Browse files Browse the repository at this point in the history
  • Loading branch information
xuanyuz committed Dec 24, 2018
1 parent 973e80c commit b5b231b
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions plugins/logpeck/public/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -1188,17 +1188,18 @@ app.run(function($rootScope,$route, $http) {
}

Sender={Name:$rootScope.ConfigName,Config:{Hosts: $rootScope.influxHosts, Database: $rootScope.influxDBName}};
Aggregator={Enable:true,Interval: $rootScope.influxInterval,Options:$rootScope.influxdb_array};
Aggregator={Enable:true,Interval: parseInt($rootScope.influxInterval),Options:$rootScope.influxdb_array};
}else if ($rootScope.ConfigName="Kafka"){
var brokersarray = $rootScope.kafkaBrokers.split(',');
var brokers = [];
for (var id = 0; id < brokersarray.length; id++) {
brokers.push(brokersarray[id]);
}
Sender={Name:$rootScope.ConfigName,Config:{
Brokers: brokers,Topic :$rootScope.kafkaTopic,MaxMessageBytes:$rootScope.kafkaMaxMessageBytes,RequiredAcks:Number($rootScope.kafkaRequiredAcks),
Timeout:$rootScope.kafkaTimeout,Compression:Number($rootScope.kafkaCompression),Partitioner:$rootScope.kafkaPartitioner,ReturnErrors:$rootScope.kafkaReturnErrors,
Flush:$rootScope.kafkaFlush,Retry:$rootScope.kafkaRetry
Brokers: brokers,Topic :$rootScope.kafkaTopic,MaxMessageBytes:parseInt($rootScope.kafkaMaxMessageBytes),Timeout:parseInt($rootScope.kafkaTimeout),
Retry:{RetryMax:parseInt($rootScope.kafkaRetry.RetryMax), RetryBackoff:parseInt($rootScope.kafkaRetry.RetryBackoff)},
RequiredAcks:Number($rootScope.kafkaRequiredAcks),Compression:Number($rootScope.kafkaCompression),Partitioner:$rootScope.kafkaPartitioner,ReturnErrors:$rootScope.kafkaReturnErrors,
Flush:{FlushBytes:parseInt($rootScope.kafkaFlush.FlushBytes), FlushMessages:parseInt($rootScope.kafkaFlush.FlushMessages), FlushFrequency:parseInt($rootScope.kafkaFlush.FlushFrequency), FlushMaxMessages:parseInt($rootScope.kafkaFlush.FlushMaxMessages)}
}};
Aggregator={Enable:false};
}
Expand Down

0 comments on commit b5b231b

Please sign in to comment.